@alwith/module-chat 0.1.25 → 0.1.27
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 -1
- package/dist/activity-host.d.ts +1 -1
- package/dist/activity-host.js +1 -1
- package/dist/approval/choice-elicitation-form.d.ts +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/chunk-0e1pdbec.js +2 -0
- package/dist/chunk-25na55ve.js +2 -0
- package/dist/chunk-2845n9v4.js +1 -0
- package/dist/chunk-341yykkp.js +1 -0
- package/dist/chunk-6x9vcfpg.js +1 -0
- package/dist/chunk-74phx7h8.js +2 -0
- package/dist/chunk-7gh078gc.js +2 -0
- package/dist/chunk-7pr2j1zb.js +1 -0
- package/dist/chunk-7tj0a2na.js +2 -0
- package/dist/chunk-8bdd6q4w.js +2 -0
- package/dist/chunk-8zs8vy0q.js +1 -0
- package/dist/chunk-9me7jmzd.js +2 -0
- package/dist/chunk-arge74eh.js +2 -0
- package/dist/chunk-awbgf3hp.js +2 -0
- package/dist/chunk-ax9ganqr.js +2 -0
- package/dist/chunk-bhvtt6tv.js +4 -0
- package/dist/chunk-darkfx1b.js +2 -0
- package/dist/chunk-dekjd5sf.js +2 -0
- package/dist/chunk-etvhn65g.js +2 -0
- package/dist/chunk-f20xh0z9.js +1 -0
- package/dist/chunk-g20b01rn.js +2 -0
- package/dist/chunk-g3r8m488.js +2 -0
- package/dist/chunk-g77gammg.js +2 -0
- package/dist/chunk-ghfbzhnb.js +1 -0
- package/dist/chunk-gycty1x1.js +2 -0
- package/dist/chunk-hnt4tt1n.js +2 -0
- package/dist/chunk-hy1x2td2.js +2 -0
- package/dist/chunk-jkr153v1.js +2 -0
- package/dist/chunk-jnx3t913.js +2 -0
- package/dist/chunk-k1c0jrk1.js +1 -0
- package/dist/chunk-m8gejgjs.js +1 -0
- package/dist/chunk-p9wpghey.js +2 -0
- package/dist/chunk-pnncsvbz.js +1 -0
- package/dist/chunk-pve9b7z3.js +2 -0
- package/dist/chunk-q17wr01c.js +3 -0
- package/dist/chunk-qj8r5xvx.js +2 -0
- package/dist/chunk-qyhgwc51.js +2 -0
- package/dist/chunk-r9k7kszp.js +1 -0
- package/dist/chunk-rakd7vzb.js +2 -0
- package/dist/chunk-reqrpvyy.js +2 -0
- package/dist/chunk-rka1mc9r.js +1 -0
- package/dist/chunk-s0nhgptn.js +1 -0
- package/dist/chunk-s28x10qd.js +1 -0
- package/dist/chunk-s3z33k7f.js +2 -0
- package/dist/chunk-src2j5cw.js +2 -0
- package/dist/chunk-v4p0qwmj.js +1 -0
- package/dist/chunk-wc3patey.js +7 -0
- package/dist/chunk-wtkv29ba.js +1 -0
- package/dist/chunk-y2xbq7rb.js +3 -0
- package/dist/chunk-yk52gm8x.js +2 -0
- package/dist/codex/activity-group.d.ts +1 -1
- package/dist/codex/activity-group.js +1 -6
- package/dist/codex/assistant-message.d.ts +3 -3
- package/dist/codex/assistant-message.js +2 -2
- package/dist/codex/async-question-card.js +3 -3
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.d.ts +1 -1
- package/dist/codex/edited-files-card.js +1 -2
- package/dist/codex/image-view-activity.d.ts +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +5 -5
- package/dist/codex/navigation-audio.d.ts +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-instruments.d.ts +1 -1
- package/dist/codex/navigation-instruments.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.css +1 -216
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +2 -2
- package/dist/codex/plan.d.ts +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/terminal-output.js +1 -1
- package/dist/codex/thread-virtualizer.js +1 -1
- package/dist/codex/user-message.d.ts +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.d.ts +2 -2
- package/dist/composer/completion-menu.js +3 -3
- package/dist/composer/completion-trigger.js +1 -3
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.d.ts +3 -3
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.d.ts +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.d.ts +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.d.ts +1 -1
- package/dist/composer/prompt-input-textarea.js +3 -3
- package/dist/composer/prompt-input.d.ts +3 -3
- package/dist/composer/prompt-input.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.d.ts +4 -4
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-parser.worker.js +66 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.d.ts +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-entry.d.ts +1 -1
- package/dist/lib/stream-style.d.ts +1 -1
- package/dist/lib/stream-style.js +1 -2
- package/dist/lib/streaming-markdown.js +2 -2
- package/dist/locales.js +1 -1
- package/dist/search/chat-search.d.ts +3 -3
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/field.d.ts +2 -2
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group-textarea.js +1 -1
- package/dist/ui/input-group.d.ts +4 -4
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +23 -18
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Application navigation, settings, login pages, update UI and general-purpose pro
|
|
|
23
23
|
|
|
24
24
|
Import @alwith/module-chat/markdown.css for Markdown styling and include the package source in Tailwind's @source scan. Local linked development requires React deduplication in the app bundler; React is a peer, never bundled into chat. Bun component tests alias linked React to the real consumer React exports without installing a global DOM.
|
|
25
25
|
|
|
26
|
-
Run bun install at the workspace root, then bun
|
|
26
|
+
Run bun install at the workspace root, then bun check --no-script --cwd packages/chat and bun run test:chat. Consumer DOM tests live in both apps and cover the shared implementations through their real app adapters.
|
|
27
27
|
|
|
28
28
|
ACP session folding stays in @alwith/api. This package owns chat presentation and interaction, not Agent processes or a second session database.
|
|
29
29
|
|
package/dist/activity-host.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
-
import type { ToolUseBlock } from "./lib/group-blocks
|
|
2
|
+
import type { ToolUseBlock } from "./lib/group-blocks";
|
|
3
3
|
export type ChatTranslate = (key: string, values?: Record<string, unknown>) => string;
|
|
4
4
|
export interface ActivityImage {
|
|
5
5
|
src: string;
|
package/dist/activity-host.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wt,t,u}from"./chunk-gycty1x1.js";export{wt as ActivityHostProvider,u as ActivityMarkdown,t as useActivityHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ae}from"../chunk-341yykkp.js";import{e}from"../chunk-7pr2j1zb.js";import{w}from"../chunk-v4p0qwmj.js";import{l}from"../chunk-m8gejgjs.js";import{r}from"../chunk-pnncsvbz.js";import{c,a}from"../chunk-rka1mc9r.js";import{o}from"../chunk-r9k7kszp.js";import{Ce,X,h,F}from"../chunk-yk52gm8x.js";import{autoUpdate as W}from"@floating-ui/dom";import{cn as _}from"cn";import{useCallback as I,useEffect as z,useLayoutEffect as D,useMemo as j,useRef as K,useState as L}from"react";import{createPortal as J}from"react-dom";import{jsxDEV as s}from"react/jsx-dev-runtime";var v="__other__";function ce({current:m,total:q,anchorRef:E,t:x,onAccept:B,onDecline:H}){let S=j(()=>m?Ce(m.requestedSchema):[],[m]),[T,k]=L({}),P=K(null);z(()=>{if(m?.elicitationId===void 0)return;let t={};for(let{key:u,property:n}of S)if(!h(n)){let p=F(n)[0];if(p)t[u]={selected:p.value}}k(t)},[m?.elicitationId,S]),z(()=>{if(m?.elicitationId!==void 0&&P.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")P.current.focus()},[m?.elicitationId]);let[C,M]=L(null),[Q,G]=L(null),U=I(()=>{let t=E.current;if(!t)return;let u=t.getBoundingClientRect();if(u.width===0){let n=Math.min(640,window.innerWidth*0.9);M({left:(window.innerWidth-n)/2,width:n,bottom:24});return}M({left:u.left,width:u.width,bottom:window.innerHeight-u.bottom+20})},[E]);D(()=>{if(!m)return;let t=0,u=()=>{if(E.current){U();return}t=requestAnimationFrame(u)};return u(),()=>cancelAnimationFrame(t)},[m,U,E]),D(()=>{let t=E.current;if(!m||!t||!Q)return;return W(t,Q,U,{animationFrame:!0})},[m,Q,E,U]);let R=j(()=>{if(!m)return!1;for(let{key:t,property:u}of S){let n=T[t];if(!n)return!1;if(h(u)){if(!n.selectedSet||n.selectedSet.size===0)return!1;if(n.selectedSet.has(v)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===v&&!n.otherText?.trim())return!1}}return!0},[m,S,T]),V=I(async()=>{if(!m)return;if(!R)return;let t={},u={};for(let{key:n,property:p}of S){let f=T[n];if(!f)continue;let b;if(h(p))t[n]=[...f.selectedSet??[]].map((g)=>g===v?(f.otherText??"").trim():g).filter(Boolean);else{let g=f.selected??"";if(t[n]=g===v?(f.otherText??"").trim():g,g!==v)b=F(p).find((i)=>i.value===g)?.preview}let N=f.notes?.trim();if(b||N)u[n]={...b&&{preview:b},...N&&{notes:N}}}await B(m.elicitationId,t,u)},[m,S,T,R,B]),O=I(async()=>{if(m)await H(m.elicitationId)},[m,H]);if(!m||!C)return null;return J(s("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),O()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:C.left,width:C.width,bottom:C.bottom,maxHeight:"70vh"},ref:(t)=>{P.current=t,G(t)},children:[s("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:x("askUserQuestion.title")},void 0,!1,void 0,this),q>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${q}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:S.map(({key:t,property:u},n)=>{let p=T[t],f=p?.selected,b=p?.selectedSet??new Set,N=F(u),g=h(u);return s("div",{className:"space-y-2",children:[s("div",{className:"flex items-center gap-2",children:[s(Ae,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:X(u).title??t},void 0,!1,void 0,this),s("div",{className:"text-foreground text-sm font-medium",children:X(u).description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g?s("div",{className:"space-y-1.5 ps-1",children:[N.map((i)=>s("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(w,{checked:b.has(i.value),onCheckedChange:(d)=>{k((y)=>{let A=new Set(y[t]?.selectedSet??new Set);if(d)A.add(i.value);else A.delete(i.value);return{...y,[t]:{...y[t],selectedSet:A}}})}},void 0,!1,void 0,this),s("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:i.label},void 0,!1,void 0,this),i.description&&s("div",{className:"text-muted-foreground text-xs",children:i.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},i.value,!0,void 0,this)),s("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(w,{checked:b.has(v),onCheckedChange:(i)=>{k((d)=>{let y=new Set(d[t]?.selectedSet??new Set);if(i)y.add(v);else y.delete(v);return{...d,[t]:{...d[t],selectedSet:y}}})}},void 0,!1,void 0,this),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:x("askUserQuestion.other")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b.has(v)&&s("div",{className:"ps-7",children:s(l,{placeholder:x("askUserQuestion.otherPlaceholder"),value:p?.otherText??"",onChange:(i)=>k((d)=>({...d,[t]:{...d[t],otherText:i.target.value}}))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s(c,{value:f??"",onValueChange:(i)=>k((d)=>({...d,[t]:{...d[t],selected:i}})),className:"space-y-1.5 ps-1",children:[N.map((i)=>{let d=`${n}:${i.value}`;return s("div",{className:_("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",f===i.value&&"bg-muted/60"),children:[s(a,{value:i.value,id:d},void 0,!1,void 0,this),s(r,{htmlFor:d,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:i.label},void 0,!1,void 0,this),i.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:i.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},i.value,!0,void 0,this)}),s("div",{className:_("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",f===v&&"bg-muted/60"),children:[s(a,{value:v,id:`${n}:other`,className:"mt-0.5"},void 0,!1,void 0,this),s(r,{htmlFor:`${n}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:x("askUserQuestion.other")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f===v&&s("div",{className:"ps-7",children:s(l,{placeholder:x("askUserQuestion.otherPlaceholder"),value:p?.otherText??"",onChange:(i)=>k((d)=>({...d,[t]:{...d[t],otherText:i.target.value}}))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!g&&f&&f!==v&&(()=>{let i=N.find((d)=>d.value===f)?.preview;if(!i)return null;return s("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:i},void 0,!1,void 0,this)})(),N.some((i)=>i.preview)&&s(o,{placeholder:x("askUserQuestion.notesPlaceholder"),value:p?.notes??"",onChange:(i)=>k((d)=>({...d,[t]:{...d[t],notes:i.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"},void 0,!1,void 0,this)]},t,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),s("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(e,{variant:"ghost",size:"sm",onClick:()=>void O(),children:x("askUserQuestion.cancel")},void 0,!1,void 0,this),s(e,{size:"sm",disabled:!R,onClick:()=>void V(),children:x("askUserQuestion.submit")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),document.body)}export{ce as ChoiceElicitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{Ce,X,h,F}from"../chunk-yk52gm8x.js";export{Ce as elicitationFields,X as elicitationLabels,F as elicitationOptions,h as isMultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{rt,Te,Ct,Tt}from"../chunk-darkfx1b.js";export{rt as PERMISSION_KIND_GROUP_ORDER,Ct as isAllowKind,Tt as isAlwaysKind,Te as sortPermissionOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Te}from"../chunk-darkfx1b.js";import{autoUpdate as O}from"@floating-ui/dom";import{cn as k}from"cn";import{CheckCheckIcon as L,CheckIcon as _,ShieldXIcon as M,XIcon as V}from"lucide-react";import{useCallback as F,useEffect as I,useId as H,useLayoutEffect as N,useRef as T,useState as p}from"react";import{createPortal as S}from"react-dom";import{jsxDEV as i}from"react/jsx-dev-runtime";var z={allow_once:{icon:_},allow_always:{icon:L},reject_once:{icon:V},reject_always:{icon:M}};function Q({requestId:u,options:h,title:D,children:E,total:f=1,alwaysLabel:P="always",autoFocus:w="always",anchorRef:n,onRespond:r}){let y=H(),[a,b]=p(0),[s,g]=p(null),[l,j]=p(null),x=T(null),c=Te(h);I(()=>{b(0)},[u]),I(()=>{let e=document.activeElement;if(w==="always"||e===null||e===document.body)x.current?.focus()},[u,l,w]);let d=F(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);g({left:(window.innerWidth-o)/2,width:o,bottom:24});return}g({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(N(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[u,n,d]),N(()=>{let e=n?.current;if(!e||!l)return;return O(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let v=i("div",{ref:j,"data-overlay":"permission-request",className:k("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[i("div",{className:"border-border border-b px-3 py-2",children:[i("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:y,className:"text-foreground text-sm font-medium",children:D},void 0,!1,void 0,this),f>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${f}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E]},void 0,!0,void 0,this),i("div",{role:"listbox","aria-labelledby":y,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),b((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",A=z[o]?.icon??_,C=o==="allow_always"||o==="reject_always",K=o==="reject_once"||o==="reject_always";return i("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:k("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",K&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1},void 0,!1,void 0,this),i(A,{className:"size-3.5 shrink-0 opacity-80"},void 0,!1,void 0,this),i("span",{className:"min-w-0 flex-1 truncate",children:e.name},void 0,!1,void 0,this),C&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:P},void 0,!1,void 0,this)]},e.optionId,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return n?S(v,document.body):v}export{Q as PermissionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e}from"../chunk-7pr2j1zb.js";import{w}from"../chunk-v4p0qwmj.js";import{E,R,qe,Ge,L,je}from"../chunk-s0nhgptn.js";import{r}from"../chunk-pnncsvbz.js";import"../chunk-8zs8vy0q.js";import{Z,Y,Fe,De,He,D}from"../chunk-k1c0jrk1.js";import{l}from"../chunk-m8gejgjs.js";import{c,a}from"../chunk-rka1mc9r.js";import{S}from"../chunk-s28x10qd.js";import{o}from"../chunk-r9k7kszp.js";import{isArrayProperty as O,isBooleanProperty as A,isNumberProperty as C,isStringProperty as N}from"@alwith/api";import{useEffect as V,useMemo as q,useState as P}from"react";import{jsxDEV as i}from"react/jsx-dev-runtime";function G(u){if(!N(u))return null;if(u.oneOf&&u.oneOf.length>0)return u.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(u.enum&&u.enum.length>0)return u.enum.map((t)=>({value:t,label:t}));return null}function I(u){let t=u,s=t._meta?.alwith?.options;if(Array.isArray(s)&&Array.isArray(t.enum))return s.map((n)=>({value:n.const,label:n.title,...n.description?{description:n.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((n)=>({value:String(n),label:String(n)}));if(Array.isArray(t.oneOf))return t.oneOf.map((n)=>({value:n.const,label:n.title,...n.description?{description:n.description}:{}}));return null}function B(u){let t=new Set(u.required??[]);return Object.entries(u.properties??{}).map(([s,n])=>({key:s,property:n,title:n.title??s,description:n.description??null,required:t.has(s),options:G(n),multiOptions:O(n)?I(n.items):null}))}function x(u){let t={};for(let s of u){let n=s.property.default;if(n!==void 0&&n!==null)t[s.key]=n;else if(s.options)t[s.key]=s.options[0].value;else if(A(s.property))t[s.key]=!1;else if(O(s.property))t[s.key]=[]}return t}function K(u,t){if(u.multiOptions)return Array.isArray(t)&&t.length>0;if(!u.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function k({id:u,label:t,description:s,control:n}){return i("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[n,i(r,{htmlFor:u,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[i("div",{className:"text-foreground text-sm",children:t},void 0,!1,void 0,this),s&&i("div",{className:"text-muted-foreground text-xs",children:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function T({id:u,field:t,value:s,onChange:n}){if(t.multiOptions){let m=new Set(Array.isArray(s)?s:[]);return i(Z,{children:[i(Y,{variant:"label",children:t.title},void 0,!1,void 0,this),t.description&&i(D,{children:t.description},void 0,!1,void 0,this),i("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((p)=>{let f=`${u}:${p.value}`;return i(k,{id:f,...p,control:i(w,{id:f,checked:m.has(p.value),onCheckedChange:(y)=>{let g=new Set(m);if(y)g.add(p.value);else g.delete(p.value);n([...g])}},void 0,!1,void 0,this)},p.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(t.options)return i(Z,{children:[i(Y,{variant:"label",children:t.title},void 0,!1,void 0,this),t.description&&i(D,{children:t.description},void 0,!1,void 0,this),i(c,{value:typeof s==="string"?s:"",onValueChange:(m)=>n(String(m)),className:"flex flex-col gap-1",children:t.options.map((m)=>{let p=`${u}:${m.value}`;return i(k,{id:p,...m,control:i(a,{value:m.value,id:p},void 0,!1,void 0,this)},m.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return i(De,{children:[i(He,{htmlFor:u,children:t.title},void 0,!1,void 0,this),A(t.property)?i(S,{id:u,checked:s===!0,onCheckedChange:(m)=>n(m)},void 0,!1,void 0,this):C(t.property)?i(l,{id:u,type:"number",required:t.required,value:typeof s==="number"?s:"",onChange:(m)=>n(m.target.value===""?void 0:Number(m.target.value))},void 0,!1,void 0,this):i(o,{id:u,rows:2,required:t.required,value:typeof s==="string"?s:"",onChange:(m)=>n(m.target.value)},void 0,!1,void 0,this),t.description&&i(D,{children:t.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function te({requestId:u,schema:t,message:s,total:n,t:m,onRespond:p}){let f=q(()=>B(t),[t]),[y,g]=P(()=>x(f));V(()=>g(x(f)),[u,f]);let v=f.every((d)=>K(d,y[d.key])),b=()=>{if(!v)return;let d={};for(let[h,F]of Object.entries(y))if(F!==void 0)d[h]=F;p({action:"accept",content:d})};return i(E,{open:!0,onOpenChange:(d)=>!d&&p({action:"cancel"}),children:i(R,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(d)=>{if(d.key==="Enter"&&(d.metaKey||d.ctrlKey))d.preventDefault(),b()},children:[i(qe,{children:[i("div",{className:"flex items-center justify-between gap-2 pe-8",children:[i(L,{children:t.title??m("approval.needed")},void 0,!1,void 0,this),n>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${n}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i(je,{children:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i(Fe,{children:f.map((d)=>i(T,{id:`${u}:${d.key}`,field:d,value:y[d.key],onChange:(h)=>g((F)=>({...F,[d.key]:h}))},d.key,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),i(Ge,{children:[i(e,{variant:"ghost",onClick:()=>p({action:"decline"}),children:m("actions.decline")},void 0,!1,void 0,this),i(e,{disabled:!v,onClick:b,children:m("actions.submit")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}export{te as SchemaElicitationForm,B as elicitationFields,x as initialValues,K as isAnswered};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e}from"../chunk-7pr2j1zb.js";import{Pe,Ie,Me,Ne,Se,Ee}from"../chunk-f20xh0z9.js";import{ExternalLinkIcon as l}from"lucide-react";import{jsxDEV as a}from"react/jsx-dev-runtime";function p({message:o,url:r,t:i,onOpen:t,onRespond:n}){return a(Pe,{size:"sm",children:[a(Ie,{children:[a(Ne,{children:i("approval.needed")},void 0,!1,void 0,this),a(Me,{children:o},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a(Se,{children:a("div",{className:"flex flex-col gap-3",children:[a(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void t(r),children:[a(l,{"data-icon":"inline-start"},void 0,!1,void 0,this),i("approval.openLink")]},void 0,!0,void 0,this),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),a(Ee,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>n("decline"),children:i("actions.decline")},void 0,!1,void 0,this),a(e,{variant:"ghost",size:"sm",onClick:()=>n("cancel"),children:i("actions.cancel")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{p as UrlElicitationCard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
async function Qe(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
|
|
2
|
+
export{Qe};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function tt(i,e){return n??=new s,n.connect(i,e)}
|
|
2
|
+
export{tt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Menu as n}from"@base-ui/react/menu";import{cn as i}from"cn";import{CheckIcon as c,ChevronRightIcon as p}from"lucide-react";import{jsxDEV as t}from"react/jsx-dev-runtime";function v({...e}){return t(n.Root,{"data-slot":"dropdown-menu",...e},void 0,!1,void 0,this)}function Et({...e}){return t(n.Portal,{"data-slot":"dropdown-menu-portal",...e},void 0,!1,void 0,this)}function x({...e}){return t(n.Trigger,{"data-slot":"dropdown-menu-trigger",...e},void 0,!1,void 0,this)}function m({align:e="start",alignOffset:o=0,side:a="bottom",sideOffset:r=4,className:d,...u}){return t(n.Portal,{children:t(n.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:o,side:a,sideOffset:r,children:t(n.Popup,{"data-slot":"dropdown-menu-content",className:i("bg-popover text-popover-foreground ring-foreground/10 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 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 duration-100 outline-none data-closed:overflow-hidden",d),...u},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function b({...e}){return t(n.Group,{"data-slot":"dropdown-menu-group",...e},void 0,!1,void 0,this)}function H({className:e,inset:o,...a}){return t(n.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:i("text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:pl-8",e),...a},void 0,!1,void 0,this)}function y({className:e,inset:o,variant:a="default",...r}){return t(n.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a,className:i("group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground 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-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r},void 0,!1,void 0,this)}function P({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e},void 0,!1,void 0,this)}function I({className:e,inset:o,children:a,...r}){return t(n.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:i("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,t(p,{className:"ml-auto"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function M({align:e="start",alignOffset:o=-3,side:a="right",sideOffset:r=0,className:d,...u}){return t(m,{"data-slot":"dropdown-menu-sub-content",className:i("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-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 w-auto min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100",d),align:e,alignOffset:o,side:a,sideOffset:r,...u},void 0,!1,void 0,this)}function J({className:e,children:o,checked:a,inset:r,...d}){return t(n.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:i("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...d,children:[t("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:t(n.CheckboxItemIndicator,{children:t(c,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),o]},void 0,!0,void 0,this)}function Oe({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e},void 0,!1,void 0,this)}function Be({className:e,children:o,inset:a,...r}){return t(n.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":a,className:i("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[t("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:t(n.RadioItemIndicator,{children:t(c,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),o]},void 0,!0,void 0,this)}function s({className:e,...o}){return t(n.Separator,{"data-slot":"dropdown-menu-separator",className:i("bg-border -mx-1 my-1 h-px",e),...o},void 0,!1,void 0,this)}function Rt({className:e,...o}){return t("span",{"data-slot":"dropdown-menu-shortcut",className:i("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",e),...o},void 0,!1,void 0,this)}export{v,Et,x,m,b,H,y,P,I,M,J,Oe,Be,s,Rt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var lt=o("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ae({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:d(lt({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{lt,Ae};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PreviewCard as e}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsxDEV as r}from"react/jsx-dev-runtime";function Re({...i}){return r(e.Root,{"data-slot":"hover-card",...i},void 0,!1,void 0,this)}function Le({...i}){return r(e.Trigger,{"data-slot":"hover-card-trigger",...i},void 0,!1,void 0,this)}function _e({className:i,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(e.Portal,{"data-slot":"hover-card-portal",children:r(e.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(e.Popup,{"data-slot":"hover-card-content",className:s("bg-popover text-popover-foreground ring-foreground/10 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 z-50 w-64 origin-(--transform-origin) rounded-lg p-4 text-sm shadow-md ring-1 outline-hidden duration-100",i),...n},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}export{Re,Le,_e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ye}from"./chunk-qj8r5xvx.js";import{E,We,R,L}from"./chunk-s0nhgptn.js";import{cn as p}from"cn";import{XIcon as _}from"lucide-react";import{useCallback as v,useEffect as D,useMemo as j,useRef as N,useState as b}from"react";import{jsxDEV as i}from"react/jsx-dev-runtime";function Ke({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=v((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),W=N(null),s=z??W,S=N(null),[m,x]=b({width:0,height:0}),[C,Z]=b({width:0,height:0}),w=v((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let k=v(()=>{w(1)},[w]),r=j(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,X=n*c;return{width:u*o,height:X*o}},[o,C,m]);if(!h)return null;return i(E,{open:l,onOpenChange:y,children:i(R,{className:p("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(L,{className:"sr-only",children:M||"Image preview"},void 0,!1,void 0,this),i(We,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(_,{className:"size-5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Ye({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:p("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:p("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:k,onLoad:(e)=>{let n=e.currentTarget;Z({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}
|
|
2
|
+
export{Ke};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CheckCircleIcon as d,CircleIcon as c,LoaderIcon as o}from"lucide-react";import{jsxDEV as e}from"react/jsx-dev-runtime";function T({entries:n}){let t=n.filter((a)=>a.status==="completed").length,s=n.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[t,"/",n.length]},void 0,!0,void 0,this),s!==void 0&&e("span",{className:"codex-plan-active",children:["· ",s.content]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e("div",{className:"codex-plan-entries",children:n.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&e(d,{"aria-hidden":"true"},void 0,!1,void 0,this),a.status==="in_progress"&&e(o,{className:"codex-plan-spinner","aria-hidden":"true"},void 0,!1,void 0,this),a.status==="pending"&&e(c,{"aria-hidden":"true"},void 0,!1,void 0,this),e("span",{children:a.content},void 0,!1,void 0,this)]},a.content,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
+
export{T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";import{jsxDEV as s}from"react/jsx-dev-runtime";var ut=d("group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 shadow-xs",secondary:"bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function e({className:r,variant:t="default",size:i="default",...a}){return s(n,{"data-slot":"button",className:o(ut({variant:t,size:i,className:r})),...a},void 0,!1,void 0,this)}export{ut,e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function ot(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function le(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(ot(n,i))}return{imageFiles:e,sawNonImageFile:o}}function de(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function it(t){return[...t].filter((e)=>!s(e)).join("")}function nt(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function _(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=it(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-nt(e,o)),r=Math.max(0,i-nt(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
|
|
2
|
+
export{ot,le,de,it,nt,_};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createPortal as n}from"react-dom";import{jsxDEV as t}from"react/jsx-dev-runtime";function ke({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}},void 0,!1,void 0,this)},void 0,!1,void 0,this),document.body)}
|
|
2
|
+
export{ke};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Separator as o}from"@base-ui/react/separator";import{cn as i}from"cn";import{jsxDEV as e}from"react/jsx-dev-runtime";function N({className:a,orientation:r="horizontal",...t}){return e(o,{"data-slot":"separator",orientation:r,className:i("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...t},void 0,!1,void 0,this)}export{N};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function $e(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function re(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{$e,re};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{se,Je}from"./chunk-hnt4tt1n.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function V(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=se(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function vt(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Je(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
|
|
2
|
+
export{V,vt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as f,useCallback as n,useContext as i,useEffect as et,useMemo as J,useRef as g,useState as K}from"react";import{jsxDEV as N}from"react/jsx-dev-runtime";var A=f(null),O=f(null);function pt(){return i(O)}var B=f(null);function gt(){return i(B)}var k=f(null);function ce(){let r=i(A);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var C=()=>i(A);function ft(){let r=i(k);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var nt=()=>i(k);function ht({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:R,attachmentPolicy:P,value:y,onValueChange:U,attachments:L,onAttachmentsChange:S,children:Q}){let T=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),W=y!==void 0,[V,X]=K(r),a=y??V,o=g({value:a,external:l,revision:0});if(o.current.value!==a||o.current.external!==l)o.current={value:a,external:l,revision:o.current.revision+1};let j=n(()=>o.current.revision,[]),x=n((t)=>{if(o.current.value=t,o.current.revision++,W)U?.(t);else X(t)},[W,U]),h=n(()=>x(""),[x]),v=L!==void 0,[Y,Z]=K([]),I=L??Y,b=g(I);b.current=I;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)S?.(e);else Z(e)},[v,S]),w=g(null),M=g(()=>{}),E=n((t)=>{let e=[...t];if(e.length===0)return;s((m)=>{let d=P===void 0?e:P.uniqueFiles(e,m);return[...m,...d.map((u)=>{let G=P?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:T(u),filename:u.name,size:u.size,lastModified:u.lastModified,...G===void 0?{}:{sourcePath:G}}})]})},[P,T,s]),H=n((t)=>{s((e)=>{let m=e.find((d)=>d.id===t);if(m?.url)URL.revokeObjectURL(m.url);return e.filter((d)=>d.id!==t)}),R?.()},[R,s]),_=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);et(()=>{if(v)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[v]);let q=n(()=>{M.current?.()},[]),F=J(()=>({files:I,add:E,remove:H,clear:_,openFileDialog:q,fileInputRef:w}),[I,E,H,_,q]),D=n((t,e)=>{w.current=t.current,M.current=e},[]),tt=J(()=>({textInput:{value:a,setInput:x,clear:h,getRevision:j,clearSubmitted:c??h},attachments:F,__registerFileInput:D}),[a,x,h,j,c,F,D]);return N(A.Provider,{value:tt,children:N(k.Provider,{value:F,children:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var z=f(null);function p(){let r=nt(),l=i(z),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
+
export{O,pt,B,gt,k,ce,C,ft,ht,z,p};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ke}from"./chunk-8bdd6q4w.js";import{CheckIcon as M,ChevronDownIcon as N,CopyIcon as E,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as x}from"react";import{jsxDEV as e,Fragment as h}from"react/jsx-dev-runtime";var T=20,A='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function v(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function L(n,o){let s=n.getBoundingClientRect(),i=o.getBoundingClientRect();return s.top>=i.top&&s.right<=i.right&&s.bottom<=i.bottom&&s.left>=i.left}function C({text:n,host:o}){let{t:s,Markdown:i}=o,c=I(null),[l,g]=x(!1),[d,b]=x(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){g(!1);return}let p=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(p))throw Error("Codex user message line height is invalid");g(r.scrollHeight>T*p+1)};t();let u=new ResizeObserver(t);return u.observe(r),()=>u.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,u=typeof IntersectionObserver>"u"?null:new IntersectionObserver((a)=>{for(let m of a){let f=m.target;if(!t.has(f))continue;v(f,m.isIntersecting&&m.intersectionRatio>=1,t.get(f))}},{root:r,rootMargin:"0px",threshold:1}),p=()=>{for(let a of t.keys()){if(r.contains(a))continue;u?.unobserve(a),t.delete(a)}for(let a of r.querySelectorAll(A)){if(t.has(a)||a.hasAttribute("inert"))continue;let m=a.getAttribute("aria-hidden");t.set(a,m),v(a,u===null&&L(a,r),m),u?.observe(a)}};p();let y=new MutationObserver(p);return y.observe(r,{childList:!0,subtree:!0}),()=>{u?.disconnect(),y.disconnect();for(let[a,m]of t)v(a,!0,m)}},[l,d]),e("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(i,{text:n,streaming:!1},void 0,!1,void 0,this)},void 0,!1,void 0,this),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"},void 0,!1,void 0,this),l&&e("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")},void 0,!1,void 0,this),e(N,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function W({text:n,label:o}){let[s,i]=x(!1);return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:o,onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2000)},children:s?e(M,{className:"codex-message-action-confirmed"},void 0,!1,void 0,this):e(E,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function R({image:n,openImage:o}){let[s,i]=x(!1),c=`data:${n.mimeType};base64,${n.data}`;return e(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?i(!0):o(c),children:e("img",{src:c,alt:""},void 0,!1,void 0,this)},void 0,!1,void 0,this),s&&e(ke,{src:c,alt:"",onClose:()=>i(!1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function bt({message:n,text:o,textParts:s,mentions:i,images:c,messageTime:l,host:g,bubbleStyle:d}){let{t:b,openImage:r}=g;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:e("div",{className:"group/codex-user codex-user-message-group",children:[i.length>0&&e("div",{className:"codex-user-mentions",children:i.map((t)=>e("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"},void 0,!1,void 0,this),e("span",{className:"codex-user-mention-label",children:t.label},void 0,!1,void 0,this)]},t.key,!0,void 0,this))},void 0,!1,void 0,this),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(R,{image:t,openImage:r},`${t.mimeType}:${t.data}`,!1,void 0,this))},void 0,!1,void 0,this),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,u)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(C,{text:t.text,host:g},void 0,!1,void 0,this):e(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question},void 0,!1,void 0,this),e("div",{className:"codex-user-question-answer",children:t.text},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},u,!1,void 0,this)):e(C,{text:o,host:g},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e("div",{className:"codex-user-actions",children:[e(W,{text:o,label:b("actions.copy")},void 0,!1,void 0,this),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}
|
|
2
|
+
export{W,bt};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function ue(t,e){if(e===0)return null;let r=e-1;while(r>=0){let n=t[r];if(n===" "||n==="\t"||n===`
|
|
2
|
+
`)return null;if(n==="@"||n==="/"){let i=r===0?"":t[r-1],s=r===0||i===`
|
|
3
|
+
`;if(n==="/"?s&&!/[/\\]/.test(t.slice(r+1,e)):s||i===" "||i==="\t")return{kind:n==="/"?"slash":"at",start:r,end:e,query:t.slice(r+1,e)}}r-=1}return null}
|
|
4
|
+
export{ue};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var rt={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Te(e){return[...e].toSorted((o,n)=>(rt[o.kind]??99)-(rt[n.kind]??99))}function Ct(e){return e==="allow_once"||e==="allow_always"}function Tt(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
+
export{rt,Te,Ct,Tt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsxDEV as o}from"react/jsx-dev-runtime";function me({open:r,onOpenChange:a,trigger:i,children:t,...n}){return o(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100},void 0,!1,void 0,this),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
+
export{me};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as y}from"cn";import{jsxDEV as r}from"react/jsx-dev-runtime";function U({name:c,value:o,levels:m,disabled:d,onChange:p}){if(m.length===0)throw Error("EffortSlider requires at least one level");let a=m,l=Math.max(0,a.findIndex((t)=>t.value===o)),u=76,s=14,i=2,n=a.length,h=i+l/Math.max(1,n-1)*(u-s-i*2);return r("div",{className:y("flex items-center justify-between px-2 py-2.5",d&&"opacity-50"),children:[r("span",{className:"text-sm",children:[c," ",r("span",{"data-effort-value":"",style:{fontSize:12},children:["(",a.find((t)=>t.value===o)?.name??o,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r("button",{type:"button",disabled:d,role:"slider","aria-label":c,"aria-valuemin":0,"aria-valuemax":n-1,"aria-valuenow":l,"aria-valuetext":a.find((t)=>t.value===o)?.name??o,onKeyDown:(t)=>{let e;if(t.key==="ArrowRight"||t.key==="ArrowUp")e=Math.min(n-1,l+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")e=Math.max(0,l-1);else if(t.key==="Home")e=0;else if(t.key==="End")e=n-1;else return;if(t.preventDefault(),t.stopPropagation(),!d&&e!==l)p(a[e].value)},className:"relative shrink-0 cursor-pointer overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:u,height:18,background:"var(--input)"},onClick:(t)=>{let e=t.currentTarget.getBoundingClientRect(),f=t.clientX-e.left,b=u/n,g=Math.min(n-1,Math.max(0,Math.floor(f/b)));p(a[g].value)},children:[r("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}},void 0,!1,void 0,this),a.map((t,e)=>{let f=i+s/2+e/Math.max(1,n-1)*(u-s-i*2)-2;return r("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:f,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value,!1,void 0,this)}),r("span",{className:"absolute rounded-full transition-all duration-150",style:{width:s,height:s,top:i,left:h,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
+
export{U};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as r}from"cn";import{jsxDEV as d}from"react/jsx-dev-runtime";function Pe({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o},void 0,!1,void 0,this)}function Ie({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t},void 0,!1,void 0,this)}function Me({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t},void 0,!1,void 0,this)}function Ne({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-muted-foreground text-sm",a),...t},void 0,!1,void 0,this)}function Pt({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t},void 0,!1,void 0,this)}function Se({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t},void 0,!1,void 0,this)}function Ee({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t},void 0,!1,void 0,this)}export{Pe,Ie,Me,Ne,Pt,Se,Ee};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=new Map;var a=0;function ie(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=ie(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Xe(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
+
export{ie,Xe};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Oe,Be}from"./chunk-2845n9v4.js";import{cn as l}from"cn";import{jsxDEV as t}from"react/jsx-dev-runtime";function n({value:a,onValueChange:i,options:o,itemClassName:d}){return t(Oe,{value:a,onValueChange:(e)=>i(String(e)),children:o.map((e)=>t(Be,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:l("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?t("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label},void 0,!1,void 0,this),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label},void 0,!1,void 0,this)]},e.value,!0,void 0,this))},void 0,!1,void 0,this)}
|
|
2
|
+
export{n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var xt=280;function pe({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function g({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=l(t.bottomOffsetsPx,r),s=c(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function K({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function ge({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function fe({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function he({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function l(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function c(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
|
|
2
|
+
export{xt,pe,g,K,ge,fe,he};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e}from"./chunk-7pr2j1zb.js";import{cva as i}from"class-variance-authority";import{cn as r}from"cn";import{jsxDEV as o}from"react/jsx-dev-runtime";function ze({className:a,...t}){return o("div",{"data-slot":"input-group",role:"group",className:r("group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-9 w-full min-w-0 items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 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",a),...t},void 0,!1,void 0,this)}var p=i("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function ee({className:a,align:t="inline-start",...s}){return o("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:r(p({align:t}),a),onClick:(n)=>{if(n.target.closest("button"))return;n.currentTarget.parentElement?.querySelector("input")?.focus()},...s},void 0,!1,void 0,this)}var l=i("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function te({className:a,type:t="button",variant:s="ghost",size:n="xs",...u}){return o(e,{type:t,"data-size":n,variant:s,className:r(l({size:n}),a),...u},void 0,!1,void 0,this)}function Lt({className:a,...t}){return o("span",{className:r("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",a),...t},void 0,!1,void 0,this)}export{ze,ee,te,Lt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as r,useContext as s}from"react";import{jsxDEV as i}from"react/jsx-dev-runtime";var n=r(null);function wt({host:o,children:e}){return i(n.Provider,{value:o,children:e},void 0,!1,void 0,this)}function t(){let o=s(n);if(o===null)throw Error("Activity host is missing");return o}function u(o){let{Markdown:e}=t();return i(e,{...o},void 0,!1,void 0,this)}
|
|
2
|
+
export{wt,t,u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function se(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function Je(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=se(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
|
|
2
|
+
export{se,Je};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t}from"./chunk-gycty1x1.js";import{i}from"./chunk-pve9b7z3.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@alwith/api";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as v}from"react";import{jsxDEV as o}from"react/jsx-dev-runtime";function f(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let c=[];for(let[l,u]of e.content.entries()){if(!b(u))continue;let n=u.content;if(N(n))c.push({key:`${e.id}:${l}`,src:`data:${n.mimeType};base64,${n.data}`,alt:e.title??""});if(w(n))c.push({key:`${e.id}:${l}`,path:n.uri,alt:n.name})}if(c.length)return c;let s=e.rawInput;if(s!==null&&typeof s==="object"&&"path"in s&&typeof s.path==="string")return[{key:e.id,path:s.path,alt:s.path.split(/[\\/]/).at(-1)??s.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:c,openImageGallery:s,openImage:l,t:u}=t(),[n,y]=v({}),[x,I]=v(0),h=JSON.stringify(e);B(()=>{let a=!0,m=JSON.parse(h);y({});for(let r of m)(r.src!==void 0?Promise.resolve(r.src):r.path!==void 0&&c?c(r.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(a)y((g)=>({...g,[r.key]:{src:d}}))},()=>{if(a)y((d)=>({...d,[r.key]:{error:!0}}))});return()=>{a=!1}},[h,c,x]);let k=e.flatMap((a)=>{let m=n[a.key];return m&&"src"in m?[{src:m.src,alt:a.alt}]:[]});return o("div",{className:"codex-image-thumbnails",children:e.map((a,m)=>{let r=n[a.key];if(!r)return o("div",{className:"codex-image-thumbnail",role:"status","aria-label":u("stream.codex.imageLoading"),children:o(A,{className:"motion-safe:animate-spin","aria-hidden":"true"},void 0,!1,void 0,this)},a.key,!1,void 0,this);if("error"in r)return o("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,"aria-label":u("stream.codex.imageFailed"),onClick:()=>I((p)=>p+1),children:o(R,{"aria-hidden":"true"},void 0,!1,void 0,this)},a.key,!1,void 0,this);return o("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,onClick:()=>{let p=e.slice(0,m).filter((d)=>{let g=n[d.key];return g&&"src"in g}).length;if(s)s(k,p);else l?.(r.src)},children:o("img",{src:r.src,alt:a.alt,draggable:!1},void 0,!1,void 0,this)},a.key,!1,void 0,this)})},void 0,!1,void 0,this)}function we({blocks:e}){let{t:c}=t(),s=e.flatMap(T),[l,u]=i(`image-view:${e[0].id}`,!1);return o("div",{className:"codex-activity-item",children:[o("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":l,onClick:()=>u((n)=>!n),children:[o("span",{className:"codex-activity-label",children:[o(S,{className:"codex-activity-icon","aria-hidden":"true"},void 0,!1,void 0,this),o("span",{className:"codex-activity-leading",children:c("stream.codex.viewedImages",{count:s.length})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o(C,{className:l?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l&&o(E,{images:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
+
export{f,we};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-7pr2j1zb.js";import{l}from"./chunk-m8gejgjs.js";import{cn as v}from"cn";import{ChevronDownIcon as g,ChevronUpIcon as b,XIcon as z}from"lucide-react";import{useEffect as B,useImperativeHandle as N,useRef as E}from"react";import{jsxDEV as n}from"react/jsx-dev-runtime";function xe({ref:p,value:i,onChange:m,onFind:o,onClose:s,placeholder:d,autoFocusOpen:a=!0,prevTitle:c,nextTitle:u,className:h}){let r=E(null);N(p,()=>{if(r.current===null)throw Error("FindBar input is not mounted");return r.current},[]),B(()=>{if(!a)return;let t=r.current;if(t===null)throw Error("FindBar input is not mounted");t.focus(),t.select()},[a]);let f=!i;return n("div",{className:v("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",h),children:[n(l,{ref:r,value:i,onChange:(t)=>m(t.target.value),placeholder:d,className:"h-7 text-xs",onKeyDown:(t)=>{if(t.key==="Escape"){t.preventDefault(),s();return}if(t.key==="Enter"){if(t.preventDefault(),i)o(t.shiftKey)}}},void 0,!1,void 0,this),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:f,onClick:()=>o(!0),title:c?`${c} (⇧↵)`:"⇧↵",children:n(b,{className:"size-3.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:f,onClick:()=>o(!1),title:u?`${u} (↵)`:"↵",children:n(g,{className:"size-3.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n(e,{size:"icon",variant:"ghost",className:"size-6",onClick:s,title:"Esc",children:n(z,{className:"size-3.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
+
export{xe};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-r9k7kszp.js";import{cn as a}from"cn";import{jsxDEV as e}from"react/jsx-dev-runtime";function ne({className:r,...n}){return e(o,{"data-slot":"input-group-control",className:a("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",r),...n},void 0,!1,void 0,this)}
|
|
2
|
+
export{ne};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r}from"./chunk-pnncsvbz.js";import{N}from"./chunk-8zs8vy0q.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsxDEV as t}from"react/jsx-dev-runtime";function Z({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e},void 0,!1,void 0,this)}function Y({className:a,variant:e="legend",...o}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...o},void 0,!1,void 0,this)}function Fe({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e},void 0,!1,void 0,this)}var c=p("group/field data-[invalid=true]:text-destructive flex w-full gap-3",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function De({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...o},void 0,!1,void 0,this)}function It({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e},void 0,!1,void 0,this)}function He({className:a,...e}){return t(r,{"data-slot":"field-label",className:l("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e},void 0,!1,void 0,this)}function Mt({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e},void 0,!1,void 0,this)}function D({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-muted-foreground text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",a),...e},void 0,!1,void 0,this)}function Nt({children:a,className:e,...o}){return t("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...o,children:[t(N,{className:"absolute inset-0 top-1/2"},void 0,!1,void 0,this),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function St({className:a,children:e,errors:o,...n}){let s=u(()=>{if(e)return e;if(!o?.length)return null;let i=[...new Map(o.map((d)=>[d?.message,d])).values()];if(i?.length==1)return i[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((d,f)=>d?.message&&t("li",{children:d.message},f,!1,void 0,this))},void 0,!1,void 0,this)},[e,o]);if(!s)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...n,children:s},void 0,!1,void 0,this)}export{Z,Y,Fe,De,It,He,Mt,D,Nt,St};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsxDEV as o}from"react/jsx-dev-runtime";function l({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-9 w-full min-w-0 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",i),...r},void 0,!1,void 0,this)}export{l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function oe(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
|
|
2
|
+
export{oe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as a}from"cn";import{jsxDEV as o}from"react/jsx-dev-runtime";function r({className:e,...t}){return o("label",{"data-slot":"label",className:a("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},void 0,!1,void 0,this)}export{r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useCallback as x,useState as b}from"react";var n=new Map;function i(e,o){let[s,d]=b(()=>({key:e,expanded:n.get(e)??o})),p=s.expanded;if(s.key!==e)p=n.get(e)??o,d({key:e,expanded:p});let a=x((c)=>{d((t)=>{let k=t.key===e?t.expanded:n.get(e)??o,S=typeof c==="function"?c(k):c;return n.set(e,S),t.key===e?{key:e,expanded:S}:t})},[e,o]);return[p,a]}
|
|
2
|
+
export{i};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{t}from"./chunk-gycty1x1.js";import{ChevronDownIcon as g,ChevronUpIcon as b,FileDiffIcon as v}from"lucide-react";import{useState as p}from"react";import{jsxDEV as e}from"react/jsx-dev-runtime";function m(n){if(n===null||n.length===0)return 0;return n.split(`
|
|
2
|
+
`).length}function at(n){let c=new Map;for(let r of n)for(let d of r.content){if(d.type!=="diff")continue;let u=d,l=u._meta?.alwith?.hunks??[],f=l.reduce((i,s)=>i+m(s.newText),0),a=l.reduce((i,s)=>i+m(s.oldText),0);for(let i of u.changes){let s=c.get(i.path);if(s)s.additions+=f,s.deletions+=a;else c.set(i.path,{path:i.path,additions:f,deletions:a})}}return[...c.values()]}function ve({blocks:n}){return e(st,{files:at(n)},void 0,!1,void 0,this)}function st({files:n,onOpen:c,renderPath:r}){let{t:d,openLink:u}=t(),[l,f]=p(!0),[a,i]=p(!1);if(n.length===0)return null;let s=n.reduce((o,h)=>o+h.additions,0),x=n.reduce((o,h)=>o+h.deletions,0);return e("section",{className:"codex-edited-files-card",children:[e("div",{className:"codex-edited-files-header",children:[e("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:e(v,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),e("div",{className:"codex-edited-files-summary",children:[e("strong",{children:d("stream.codex.editedFilesCount",{count:n.length})},void 0,!1,void 0,this),e("button",{type:"button","data-codex-disclosure":"",onClick:()=>{f((o)=>!o),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[e("span",{className:"codex-diff-additions",children:["+",s]},void 0,!0,void 0,this),e("span",{className:"codex-diff-deletions",children:["-",x]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l&&e("div",{className:"codex-edited-files-list",children:[(a?n:n.slice(0,3)).map((o)=>e("div",{className:"codex-edited-file-row",children:[e("button",{type:"button",className:"codex-edited-file-path",title:o.path,onClick:()=>c===void 0?u(o.path):c(o),children:r===void 0?o.path:r(o)},void 0,!1,void 0,this),e("span",{className:"codex-edited-file-counts",children:[e("span",{className:"codex-diff-additions",children:["+",o.additions]},void 0,!0,void 0,this),e("span",{className:"codex-diff-deletions",children:["-",o.deletions]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},o.path,!0,void 0,this)),n.length>3&&e("button",{type:"button",className:"codex-edited-files-more","aria-expanded":a,onClick:()=>i((o)=>!o),children:[d(a?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:n.length-3}),a?e(b,{size:16,"aria-hidden":"true"},void 0,!1,void 0,this):e(g,{size:16,"aria-hidden":"true"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
|
|
3
|
+
export{at,ve,st};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function Ye({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
|
|
2
|
+
export{Ye};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function*q(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function yt(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of q(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
+
export{q,yt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as e}from"cn";import{jsxDEV as a}from"react/jsx-dev-runtime";function o({className:r,...i}){return a("textarea",{"data-slot":"textarea",className:e("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",r),...i},void 0,!1,void 0,this)}export{o};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{q}from"./chunk-qyhgwc51.js";function A(d,f){if(!f)return[];let h=[],s="",n=[],a=()=>{let t=0,e=0;for(let{start:r,end:o}of q(s,f)){while(t<n.length&&n[t].end<=r)t++;e=Math.max(e,t);while(e<n.length&&n[e].end<o)e++;let l=n[t],c=n[e];if(!l||!c)throw Error("Search text offset has no DOM node");let i=document.createRange();i.setStart(l.node,r-l.start),i.setEnd(c.node,o-c.start),h.push(i)}s="",n=[]},u=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),E=(t)=>{if(t.nodeType===Node.TEXT_NODE){let r=t.parentElement;if(!r||r.offsetParent===null&&r.tagName!=="BODY")return;let o=t.nodeValue??"";n.push({node:t,start:s.length,end:s.length+o.length}),s+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){a();return}if(t.tagName==="BR"){a();return}let e=u.has(t.tagName);if(e)a();for(let r of t.childNodes)E(r);if(e)a()};return E(d),a(),h}
|
|
2
|
+
export{A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Radio as o}from"@base-ui/react/radio";import{RadioGroup as t}from"@base-ui/react/radio-group";import{cn as d}from"cn";import{jsxDEV as i}from"react/jsx-dev-runtime";function c({className:r,...e}){return i(t,{"data-slot":"radio-group",className:d("grid w-full gap-3",r),...e},void 0,!1,void 0,this)}function a({className:r,...e}){return i(o.Root,{"data-slot":"radio-group-item",className:d("group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...e,children:i(o.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:i("span",{className:"bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}export{c,a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e}from"./chunk-7pr2j1zb.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as s}from"lucide-react";import{jsxDEV as a}from"react/jsx-dev-runtime";function E({...o}){return a(i.Root,{"data-slot":"dialog",...o},void 0,!1,void 0,this)}function _t({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o},void 0,!1,void 0,this)}function dt({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o},void 0,!1,void 0,this)}function We({...o}){return a(i.Close,{"data-slot":"dialog-close",...o},void 0,!1,void 0,this)}function ct({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t},void 0,!1,void 0,this)}function R({className:o,children:t,showCloseButton:l=!0,...n}){return a(dt,{children:[a(ct,{},void 0,!1,void 0,this),a(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 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 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...n,children:[t,l&&a(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"},void 0,!1,void 0,this),children:[a(s,{},void 0,!1,void 0,this),a("span",{className:"sr-only",children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function qe({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t},void 0,!1,void 0,this)}function Ge({className:o,showCloseButton:t=!1,children:l,...n}){return a("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...n,children:[l,t&&a(i.Close,{render:a(e,{variant:"outline"},void 0,!1,void 0,this),children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function L({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t},void 0,!1,void 0,this)}function je({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t},void 0,!1,void 0,this)}export{E,_t,dt,We,ct,R,qe,Ge,L,je};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsxDEV as e}from"react/jsx-dev-runtime";function S({className:i,size:t="default",...r}){return e(a.Root,{"data-slot":"switch","data-size":t,className:d("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",i),...r,children:e(a.Thumb,{"data-slot":"switch-thumb",className:"bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}export{S};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{et}from"./chunk-y2xbq7rb.js";function Ue(t,o){if(et(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
|
|
2
|
+
export{Ue};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Qe}from"./chunk-0e1pdbec.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function Ve(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Qe(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
|
|
2
|
+
export{Ve};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Checkbox as e}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsxDEV as i}from"react/jsx-dev-runtime";function w({className:r,...a}){return i(e.Root,{"data-slot":"checkbox",className:o("peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:i(e.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:i(t,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}export{w};
|