!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a09faf-506c-7590-a90c-fe829b574ede")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,607918,789122,e=>{"use strict";let t=new Map;function r(e,r,n){return null==e?"":(function(e,r){let n=JSON.stringify({locale:e,options:r}),a=t.get(n);if(a)return a;let i=new Intl.NumberFormat(e,r);return t.set(n,i),i})(r,n).format(e)}e.s(["formatNumber",0,r,"formatNumberValue",0,function(e,t,n){return null==e?"":n?r(e,t,n):r(e/100,t,{style:"percent"})}],607918),e.s(["valueToPercent",0,function(e,t,r){return(e-t)*100/(r-t)}],789122)},649188,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))});e.s(["ArrowDownTrayIcon",0,r],649188)},109917,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))});e.s(["ArrowPathIcon",0,r],109917)},646013,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))});e.s(["ArrowUpIcon",0,r],646013)},159119,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))});e.s(["DocumentIcon",0,r],159119)},239718,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"}))});e.s(["EllipsisHorizontalIcon",0,r],239718)},133256,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"}))});e.s(["LightBulbIcon",0,r],133256)},152533,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))});e.s(["MagnifyingGlassIcon",0,r],152533)},492009,e=>{"use strict";var t=e.i(270401);let r=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"}))});e.s(["VideoCameraIcon",0,r],492009)},323813,e=>{"use strict";let t=(0,e.i(202913).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],323813)},634061,e=>{"use strict";let t=(0,e.i(202913).default)("expand",[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]);e.s(["Expand",0,t],634061)},145891,e=>{"use strict";let t=(0,e.i(202913).default)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);e.s(["Pause",0,t],145891)},120612,e=>{"use strict";var t=e.i(222666),r=e.i(505962);e.s([],297422),e.i(297422);var n=e.i(270401),a=e.i(214977),i=e.i(159683),l=e.i(517450),s=e.i(466425),o=e.i(38014),c=e.i(726013),d=e.i(269702),u=e.i(279475),m=e.i(831226),h=e.i(964582),f=e.i(936954),p=e.i(335912),x=e.i(570081);e.s(["Backdrop",()=>o.DialogBackdrop,"Close",()=>c.DialogClose,"Description",()=>d.DialogDescription,"Handle",()=>x.DialogHandle,"Popup",()=>u.DialogPopup,"Portal",()=>m.DialogPortal,"Root",0,function(e){let{children:r,open:o,defaultOpen:c=!1,onOpenChange:d,onOpenChangeComplete:u,actionsRef:m,handle:h,triggerId:f,defaultTriggerId:p=null}=e,x=(0,l.useDialogRootContext)(!0),g=!!x,v=s.DialogStore.useStore(h?.store,{open:c,openProp:o,activeTriggerId:p,triggerIdProp:f,modal:!0,disablePointerDismissal:!0,nested:g,role:"alertdialog"});v.useControlledProp("openProp",o),v.useControlledProp("triggerIdProp",f),v.useSyncedValue("nested",g),v.useContextCallback("onOpenChange",d),v.useContextCallback("onOpenChangeComplete",u);let b=v.useState("payload");(0,i.useDialogRoot)({store:v,actionsRef:m,parentContext:x?.store.context,isDrawer:!1,onOpenChange:d,triggerIdProp:f});let w=n.useMemo(()=>({store:v}),[v]);return(0,t.jsx)(a.IsDrawerContext.Provider,{value:!1,children:(0,t.jsx)(l.DialogRootContext.Provider,{value:w,children:"function"==typeof r?r({payload:b}):r})})},"Title",()=>h.DialogTitle,"Trigger",()=>f.DialogTrigger,"Viewport",()=>p.DialogViewport,"createHandle",0,function(){return new x.DialogHandle(new s.DialogStore({modal:!0,disablePointerDismissal:!0,role:"alertdialog"}))}],246346);var g=e.i(246346),g=g,v=e.i(452473),b=e.i(562580),w=e.i(320187),y=e.i(147680);let j=g.Root,k=g.Portal;function N(e){let n,a,i,l,s,o=(0,r.c)(10);return o[0]!==e?({className:n,ref:i,...a}=e,o[0]=e,o[1]=n,o[2]=a,o[3]=i):(n=o[1],a=o[2],i=o[3]),o[4]!==n?(l=(0,v.cn)("fixed inset-0 z-alert bg-black/50",y.overlayMotion,n),o[4]=n,o[5]=l):l=o[5],o[6]!==a||o[7]!==i||o[8]!==l?(s=(0,t.jsx)(g.Backdrop,{className:l,"data-slot":"alert-dialog-overlay",...a,forceRender:!0,ref:i}),o[6]=a,o[7]=i,o[8]=l,o[9]=s):s=o[9],s}e.s(["AlertDialog",0,j,"AlertDialogAction",0,function(e){let n,a,i,l,s,o=(0,r.c)(10);return o[0]!==e?({className:n,ref:i,...a}=e,o[0]=e,o[1]=n,o[2]=a,o[3]=i):(n=o[1],a=o[2],i=o[3]),o[4]!==n?(l=(0,v.cn)((0,b.buttonVariants)({size:"sm"}),n),o[4]=n,o[5]=l):l=o[5],o[6]!==a||o[7]!==i||o[8]!==l?(s=(0,t.jsx)(g.Close,{ref:i,className:l,...a}),o[6]=a,o[7]=i,o[8]=l,o[9]=s):s=o[9],s},"AlertDialogCancel",0,function(e){let n,a,i,l,s,o=(0,r.c)(10);return o[0]!==e?({className:n,ref:i,...a}=e,o[0]=e,o[1]=n,o[2]=a,o[3]=i):(n=o[1],a=o[2],i=o[3]),o[4]!==n?(l=(0,v.cn)((0,b.buttonVariants)({variant:"outline",size:"sm"}),"mt-2 sm:mt-0",n),o[4]=n,o[5]=l):l=o[5],o[6]!==a||o[7]!==i||o[8]!==l?(s=(0,t.jsx)(g.Close,{ref:i,className:l,...a}),o[6]=a,o[7]=i,o[8]=l,o[9]=s):s=o[9],s},"AlertDialogContent",0,function(e){let n,a,i,l,s,o,c,d,u=(0,r.c)(15);return u[0]!==e?({className:a,children:n,ref:l,...i}=e,u[0]=e,u[1]=n,u[2]=a,u[3]=i,u[4]=l):(n=u[1],a=u[2],i=u[3],l=u[4]),u[5]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(N,{}),u[5]=s):s=u[5],u[6]!==a?(o=(0,v.cn)("fixed left-[50%] top-[50%] z-alert grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-popover text-popover-foreground p-6 shadow-lg rounded-lg",y.dialogMotion,a),u[6]=a,u[7]=o):o=u[7],u[8]!==n?(c=(0,t.jsx)(w.FloatingLayerProvider,{layer:"alert",children:n}),u[8]=n,u[9]=c):c=u[9],u[10]!==i||u[11]!==l||u[12]!==o||u[13]!==c?(d=(0,t.jsxs)(k,{keepMounted:!0,children:[s,(0,t.jsx)(g.Popup,{ref:l,className:o,...i,children:c})]}),u[10]=i,u[11]=l,u[12]=o,u[13]=c,u[14]=d):d=u[14],d},"AlertDialogDescription",0,function(e){let n,a,i,l,s,o=(0,r.c)(10);return o[0]!==e?({className:n,ref:i,...a}=e,o[0]=e,o[1]=n,o[2]=a,o[3]=i):(n=o[1],a=o[2],i=o[3]),o[4]!==n?(l=(0,v.cn)("text-body text-muted-foreground",n),o[4]=n,o[5]=l):l=o[5],o[6]!==a||o[7]!==i||o[8]!==l?(s=(0,t.jsx)(g.Description,{ref:i,className:l,...a}),o[6]=a,o[7]=i,o[8]=l,o[9]=s):s=o[9],s},"AlertDialogFooter",0,function(e){let n,a,i,l,s=(0,r.c)(8);return s[0]!==e?({className:n,...a}=e,s[0]=e,s[1]=n,s[2]=a):(n=s[1],a=s[2]),s[3]!==n?(i=(0,v.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",n),s[3]=n,s[4]=i):i=s[4],s[5]!==a||s[6]!==i?(l=(0,t.jsx)("div",{className:i,...a}),s[5]=a,s[6]=i,s[7]=l):l=s[7],l},"AlertDialogHeader",0,function(e){let n,a,i,l,s=(0,r.c)(8);return s[0]!==e?({className:n,...a}=e,s[0]=e,s[1]=n,s[2]=a):(n=s[1],a=s[2]),s[3]!==n?(i=(0,v.cn)("flex flex-col gap-y-2 text-center sm:text-left",n),s[3]=n,s[4]=i):i=s[4],s[5]!==a||s[6]!==i?(l=(0,t.jsx)("div",{className:i,...a}),s[5]=a,s[6]=i,s[7]=l):l=s[7],l},"AlertDialogTitle",0,function(e){let n,a,i,l,s,o=(0,r.c)(10);return o[0]!==e?({className:n,ref:i,...a}=e,o[0]=e,o[1]=n,o[2]=a,o[3]=i):(n=o[1],a=o[2],i=o[3]),o[4]!==n?(l=(0,v.cn)("text-base font-semibold",n),o[4]=n,o[5]=l):l=o[5],o[6]!==a||o[7]!==i||o[8]!==l?(s=(0,t.jsx)(g.Title,{ref:i,className:l,...a}),o[6]=a,o[7]=i,o[8]=l,o[9]=s):s=o[9],s}],120612)},130868,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(452473),a=e.i(201459),i=e.i(145891),l=e.i(197070),s=e.i(270401),o=e.i(528164);let c=(0,s.createContext)(null),d=(0,s.createContext)(null);function u(){return(0,s.useContext)(c)}function m(){return(0,s.useContext)(d)}function h({audioProps:e,children:r,src:n}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),[l,o]=(0,s.useState)(),[u,m]=(0,s.useState)(null),[f,p]=(0,s.useState)(0),[x,g]=(0,s.useState)(!0),[v,b]=(0,s.useState)(0),[w,y]=(0,s.useState)(0),j=(0,s.useCallback)(async()=>{let e=a.current;if(!e)return;if(i.current)try{await i.current}catch{}finally{i.current=null}let t=e.play();i.current=t;try{await t}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw e}finally{i.current=null}},[]),k=(0,s.useCallback)(()=>{a.current?.pause()},[]),N=(0,s.useCallback)(e=>{let t=a.current;if(!t||void 0===l||!Number.isFinite(l))return;let r=Math.max(0,Math.min(e,l));t.currentTime=r,y(r)},[l]);(0,s.useEffect)(()=>{let e=a.current;e&&(o(void 0),m(null),p(e.networkState),g(!0),b(e.readyState),y(0),e.load())},[n]),(0,s.useEffect)(()=>{let e=a.current;if(!e)return;let t=()=>{p(e.networkState),b(e.readyState)},r=()=>{o(e.duration)},n=()=>{m(e.error)},i=()=>{g(!0)},l=()=>{g(!1)},s=()=>{y(e.currentTime)};return e.addEventListener("canplay",t),e.addEventListener("durationchange",r),e.addEventListener("ended",i),e.addEventListener("error",n),e.addEventListener("loadedmetadata",r),e.addEventListener("loadstart",t),e.addEventListener("pause",i),e.addEventListener("play",l),e.addEventListener("playing",t),e.addEventListener("timeupdate",s),e.addEventListener("waiting",t),()=>{e.removeEventListener("canplay",t),e.removeEventListener("durationchange",r),e.removeEventListener("ended",i),e.removeEventListener("error",n),e.removeEventListener("loadedmetadata",r),e.removeEventListener("loadstart",t),e.removeEventListener("pause",i),e.removeEventListener("play",l),e.removeEventListener("playing",t),e.removeEventListener("timeupdate",s),e.removeEventListener("waiting",t)}},[]);let C=!x,A=v<3&&2===f,S=(0,s.useMemo)(()=>({duration:l,error:u,isBuffering:A,isPlaying:C,pause:k,play:j,ref:a,seek:N}),[l,u,A,C,k,j,N]);return(0,t.jsx)(c.Provider,{value:S,children:(0,t.jsxs)(d.Provider,{value:w,children:[(0,t.jsx)("audio",{ref:a,src:n,className:"hidden",preload:"metadata",...e}),r]})})}function f(e){let s,c,d,m,h,f,p,x,g,v,b,w,y=(0,r.c)(30);y[0]!==e?({children:s,className:c,isLoading:d,size:h,type:f,variant:p,...m}=e,y[0]=e,y[1]=s,y[2]=c,y[3]=d,y[4]=m,y[5]=h,y[6]=f,y[7]=p):(s=y[1],c=y[2],d=y[3],m=y[4],h=y[5],f=y[6],p=y[7]);let j=void 0===h?"icon":h,k=void 0===f?"button":f,N=void 0===p?"outline":p,C=u();if(!C)return null;let A=d??C.isBuffering;y[8]!==C.isPlaying?(x=C.isPlaying?(0,t.jsx)(i.Pause,{}):(0,t.jsx)(l.Play,{}),y[8]=C.isPlaying,y[9]=x):x=y[9];let S=x,E=A||void 0,L=C.isPlaying?"Pause audio":"Play audio";y[10]!==c?(g=(0,n.cn)("shrink-0 rounded-full",c),y[10]=c,y[11]=g):g=y[11];let P=!0===d;return y[12]!==C?(v=()=>{C.isPlaying?C.pause():C.play()},y[12]=C,y[13]=v):v=y[13],y[14]!==s||y[15]!==S||y[16]!==A||y[17]!==d?(b=A&&!0!==d?(0,t.jsx)(a.Loader2,{className:"animate-spin"}):s??S,y[14]=s,y[15]=S,y[16]=A,y[17]=d,y[18]=b):b=y[18],y[19]!==m||y[20]!==j||y[21]!==b||y[22]!==E||y[23]!==L||y[24]!==g||y[25]!==P||y[26]!==v||y[27]!==k||y[28]!==N?(w=(0,t.jsx)(o.Button,{"aria-busy":E,"aria-label":L,className:g,isLoading:P,onClick:v,size:j,type:k,variant:N,...m,children:b}),y[19]=m,y[20]=j,y[21]=b,y[22]=E,y[23]=L,y[24]=g,y[25]=P,y[26]=v,y[27]=k,y[28]=N,y[29]=w):w=y[29],w}function p(e){let a,i,l,o,c,d,h,f,p,g,v,b,w,y,j,k,N,C,A,S,E,L,P,D=(0,r.c)(55);D[0]!==e?({"aria-label":f,className:a,disabled:i,onPointerCancel:l,onPointerDown:o,onPointerUp:c,onValueChange:d,step:p,...h}=e,D[0]=e,D[1]=a,D[2]=i,D[3]=l,D[4]=o,D[5]=c,D[6]=d,D[7]=h,D[8]=f,D[9]=p):(a=D[1],i=D[2],l=D[3],o=D[4],c=D[5],d=D[6],h=D[7],f=D[8],p=D[9]);let T=void 0===f?"Seek audio":f,z=void 0===p?.25:p,R=u(),_=m(),M=(0,s.useRef)(!1),[I,B]=(0,s.useState)(!1),[H,O]=(0,s.useState)(null);if(!R||null===_)return null;let{duration:V}=R;D[10]!==V?(g=void 0!==V&&Number.isFinite(V)&&V>0,D[10]=V,D[11]=g):g=D[11];let W=g,F=I&&null!==H?H:_,$=W?Math.min(100,Math.max(0,F/V*100)):0,U=i||!W;D[12]!==R?(v=()=>{B(!1),O(null),M.current&&R.play().catch(x)},D[12]=R,D[13]=v):v=D[13];let Z=v;D[14]!==Z||D[15]!==c?(b=e=>{Z(),c?.(e)},D[14]=Z,D[15]=c,D[16]=b):b=D[16];let K=b;D[17]!==Z||D[18]!==l?(w=e=>{Z(),l?.(e)},D[17]=Z,D[18]=l,D[19]=w):w=D[19];let G=w;D[20]!==a?(y=(0,n.cn)("group/audio-progress relative flex h-4 min-w-20 flex-1 items-center",a),D[20]=a,D[21]=y):y=D[21],D[22]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 h-1 rounded-full bg-secondary"}),D[22]=j):j=D[22];let q=`${$}%`;D[23]!==q?(k=(0,t.jsx)("div",{className:"pointer-events-none absolute left-0 h-1 rounded-full bg-primary","data-allow-inline-style":!0,style:{width:q}}),D[23]=q,D[24]=k):k=D[24];let X=!U&&"group-hover/audio-progress:opacity-100",Q=!U&&I&&"opacity-100";D[25]!==X||D[26]!==Q?(N=(0,n.cn)("pointer-events-none absolute size-3 rounded-full bg-foreground opacity-0 shadow-sm transition-opacity",X,Q),D[25]=X,D[26]=Q,D[27]=N):N=D[27];let J=`calc(${$}% - 0.375rem)`;D[28]!==J?(C={left:J},D[28]=J,D[29]=C):C=D[29],D[30]!==N||D[31]!==C?(A=(0,t.jsx)("span",{className:N,"data-allow-inline-style":!0,style:C}),D[30]=N,D[31]=C,D[32]=A):A=D[32];let Y=W?V:0;return D[33]!==d||D[34]!==R?(S=e=>{let t=e.currentTarget.valueAsNumber;O(t),R.seek(t),d?.(t)},D[33]=d,D[34]=R,D[35]=S):S=D[35],D[36]!==o||D[37]!==R?(E=e=>{M.current=R.isPlaying,B(!0),R.pause(),o?.(e)},D[36]=o,D[37]=R,D[38]=E):E=D[38],D[39]!==T||D[40]!==F||D[41]!==G||D[42]!==K||D[43]!==U||D[44]!==h||D[45]!==z||D[46]!==Y||D[47]!==S||D[48]!==E?(L=(0,t.jsx)("input",{"aria-label":T,className:"absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent opacity-0 disabled:cursor-not-allowed",disabled:U,max:Y,min:0,onChange:S,onPointerDown:E,onPointerUp:K,onPointerCancel:G,step:z,type:"range",value:F,...h}),D[39]=T,D[40]=F,D[41]=G,D[42]=K,D[43]=U,D[44]=h,D[45]=z,D[46]=Y,D[47]=S,D[48]=E,D[49]=L):L=D[49],D[50]!==k||D[51]!==A||D[52]!==L||D[53]!==y?(P=(0,t.jsxs)("div",{className:y,children:[j,k,A,L]}),D[50]=k,D[51]=A,D[52]=L,D[53]=y,D[54]=P):P=D[54],P}function x(){}function g(e){let a,i,l,s,o,c=(0,r.c)(11);c[0]!==e?({className:a,...i}=e,c[0]=e,c[1]=a,c[2]=i):(a=c[1],i=c[2]);let d=m();return null===d?null:(c[3]!==a?(l=(0,n.cn)("w-10 text-overline tabular-nums text-muted-foreground",a),c[3]=a,c[4]=l):l=c[4],c[5]!==d?(s=w(d),c[5]=d,c[6]=s):s=c[6],c[7]!==i||c[8]!==l||c[9]!==s?(o=(0,t.jsx)("span",{className:l,...i,children:s}),c[7]=i,c[8]=l,c[9]=s,c[10]=o):o=c[10],o)}function v(e){let a,i,l,s,o,c=(0,r.c)(11);c[0]!==e?({className:a,...i}=e,c[0]=e,c[1]=a,c[2]=i):(a=c[1],i=c[2]);let d=u();if(!d)return null;let{duration:m}=d;return c[3]!==a?(l=(0,n.cn)("w-10 text-right text-overline tabular-nums text-muted-foreground",a),c[3]=a,c[4]=l):l=c[4],c[5]!==m?(s=void 0!==m&&Number.isFinite(m)?w(m):"--:--",c[5]=m,c[6]=s):s=c[6],c[7]!==i||c[8]!==l||c[9]!==s?(o=(0,t.jsx)("span",{className:l,...i,children:s}),c[7]=i,c[8]=l,c[9]=s,c[10]=o):o=c[10],o}function b(e){let a,i,l,s,o,c=(0,r.c)(10);c[0]!==e?({className:a,children:l,...i}=e,c[0]=e,c[1]=a,c[2]=i,c[3]=l):(a=c[1],i=c[2],l=c[3]);let d=void 0===l?"Audio could not be loaded.":l,m=u();return m?.error?(c[4]!==a?(s=(0,n.cn)("text-overline text-negative-text",a),c[4]=a,c[5]=s):s=c[5],c[6]!==d||c[7]!==i||c[8]!==s?(o=(0,t.jsx)("div",{className:s,role:"status",...i,children:d}),c[6]=d,c[7]=i,c[8]=s,c[9]=o):o=c[9],o):null}function w(e){let t=Number.isFinite(e)?Math.max(0,e):0,r=Math.floor(t/3600),n=Math.floor(t%3600/60),a=Math.floor(t%60),i=r>0?n.toString().padStart(2,"0"):n.toString(),l=a.toString().padStart(2,"0");return r>0?`${r}:${i}:${l}`:`${i}:${l}`}e.s(["AudioPlayer",0,function(e){let a,i,l,s,o,c,d,u,m,x,w,y,j=(0,r.c)(24);j[0]!==e?({audioProps:a,children:i,className:l,description:s,metadata:o,src:d,title:u,...c}=e,j[0]=e,j[1]=a,j[2]=i,j[3]=l,j[4]=s,j[5]=o,j[6]=c,j[7]=d,j[8]=u):(a=j[1],i=j[2],l=j[3],s=j[4],o=j[5],c=j[6],d=j[7],u=j[8]);let k=void 0===u?"Audio preview":u;return j[9]!==l?(m=(0,n.cn)("flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground shadow-sm",l),j[9]=l,j[10]=m):m=j[10],j[11]!==i||j[12]!==s||j[13]!==o||j[14]!==k?(x=i??(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f,{}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 flex flex-col gap-y-2",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex flex-col gap-y-0.5",children:[(0,t.jsx)("div",{className:"truncate text-xs font-medium",children:k}),s&&(0,t.jsx)("div",{className:"truncate text-overline text-muted-foreground",children:s})]}),o&&(0,t.jsx)("div",{className:"shrink-0 text-overline text-muted-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{}),(0,t.jsx)(p,{}),(0,t.jsx)(v,{})]}),(0,t.jsx)(b,{})]})]}),j[11]=i,j[12]=s,j[13]=o,j[14]=k,j[15]=x):x=j[15],j[16]!==c||j[17]!==m||j[18]!==x?(w=(0,t.jsx)("div",{className:m,...c,children:x}),j[16]=c,j[17]=m,j[18]=x,j[19]=w):w=j[19],j[20]!==a||j[21]!==d||j[22]!==w?(y=(0,t.jsx)(h,{src:d,audioProps:a,children:w}),j[20]=a,j[21]=d,j[22]=w,j[23]=y):y=j[23],y},"AudioPlayerButton",0,f,"AudioPlayerDuration",0,v,"AudioPlayerProgress",0,p,"AudioPlayerProvider",0,h,"AudioPlayerTime",0,g,"useAudioPlayer",0,u,"useAudioPlayerTime",0,m])},671910,e=>{"use strict";var t=e.i(505962);e.i(270401);var r=e.i(575292),n=e.i(795672),a=e.i(150049);function i(e,i){let l,s=(0,t.c)(5),o=(0,n.useFormatters)(),c=(0,a.useResolvedDisplayTimeZone)(e),d=(0,r.useRelativeNow)();return s[0]!==o||s[1]!==d||s[2]!==i||s[3]!==c?(l=e=>void 0===d?o.dateTime(e,{timeZone:c,preset:"full"}):o.relativeTime(e,{timeZone:c,nowMs:d,preset:i}),s[0]=o,s[1]=d,s[2]=i,s[3]=c,s[4]=l):l=s[4],l}e.s(["useRelativeFormatter",0,i,"useRelativeTime",0,function(e,r){let n,a=(0,t.c)(3),l=i(void 0,r);return a[0]!==l||a[1]!==e?(n=l(e),a[0]=l,a[1]=e,a[2]=n):n=a[2],n}])},573503,570655,705113,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(452473);e.s(["AiResponseDisclaimer",0,function(e){let a,i,l,s=(0,r.c)(7);s[0]!==e?(a=void 0===e?{}:e,s[0]=e,s[1]=a):a=s[1];let{isCompact:o,className:c}=a;s[2]!==c?(i=(0,n.cn)("mt-1 text-center text-3xs text-muted-foreground/60",c),s[2]=c,s[3]=i):i=s[3];let d=void 0!==o&&o?"Responses are AI-generated. Verify before relying on them.":"Responses are AI-generated and can be inaccurate. Review all outputs before relying on them.";return s[4]!==i||s[5]!==d?(l=(0,t.jsx)("p",{className:i,children:d}),s[4]=i,s[5]=d,s[6]=l):l=s[6],l}],573503);var a=e.i(270401),i=e.i(399695);function l(e){if("file"!==e.kind)return!1;let t=(e.type||"").toLowerCase();return!t.startsWith("video/")||!!i.allowedVideoFiles.has(t)}function s(){}e.s(["useDragDrop",0,function(e,t){let n,i,o,c,d,u,m,h,f,p,x=(0,r.c)(34);x[0]!==t?(n=void 0===t?{}:t,x[0]=t,x[1]=n):n=x[1];let{shouldPreventDefault:g,animationDelay:v,typeValidator:b,onDrop:w}=n,y=void 0===g||g,j=void 0===v?200:v,k=void 0===b?l:b,[N,C]=(0,a.useState)(!1),[A,S]=(0,a.useState)(!0),E=(0,a.useRef)(0);x[2]!==j?(i=()=>{setTimeout(()=>C(!1),j)},x[2]=j,x[3]=i):i=x[3];let L=i;x[4]!==y?(o=e=>{y&&e.preventDefault(),E.current=E.current+1,C(!0)},x[4]=y,x[5]=o):o=x[5];let P=o;x[6]!==y||x[7]!==L?(c=e=>{y&&e.preventDefault(),E.current=E.current-1,0===E.current&&L()},x[6]=y,x[7]=L,x[8]=c):c=x[8];let D=c;x[9]!==y||x[10]!==k?(d=e=>{y&&e.preventDefault();let t=e.dataTransfer?.items;S(!!t&&Array.from(t).every(e=>k(e)))},x[9]=y,x[10]=k,x[11]=d):d=x[11];let T=d;x[12]!==w||x[13]!==y||x[14]!==L?(u=e=>{if(y&&e.preventDefault(),S(!0),E.current=0,L(),w)try{Promise.resolve(w(e)).catch(s)}catch(e){}},x[12]=w,x[13]=y,x[14]=L,x[15]=u):u=x[15];let z=u;x[16]!==L?(m=()=>{L(),S(!1)},x[16]=L,x[17]=m):m=x[17];let R=m;return x[18]!==e||x[19]!==R||x[20]!==P||x[21]!==D||x[22]!==T||x[23]!==z?(h=()=>{let t=e.current;if(t)return t.addEventListener("dragenter",P),t.addEventListener("dragleave",D),t.addEventListener("dragover",T),t.addEventListener("dragend",R),t.addEventListener("drop",z),()=>{t.removeEventListener("dragenter",P),t.removeEventListener("dragleave",D),t.removeEventListener("dragover",T),t.removeEventListener("dragend",R),t.removeEventListener("drop",z)}},x[18]=e,x[19]=R,x[20]=P,x[21]=D,x[22]=T,x[23]=z,x[24]=h):h=x[24],x[25]!==R||x[26]!==P||x[27]!==D||x[28]!==T||x[29]!==z?(f=[P,D,T,R,z],x[25]=R,x[26]=P,x[27]=D,x[28]=T,x[29]=z,x[30]=f):f=x[30],(0,a.useEffect)(h,f),x[31]!==N||x[32]!==A?(p={isDragging:N,isValid:A},x[31]=N,x[32]=A,x[33]=p):p=x[33],p}],570655);var o=e.i(528164),c=e.i(648156),d=e.i(249656),u=e.i(968076),m=e.i(652942),h=e.i(159119),f=e.i(235856),p=e.i(614991),x=e.i(519202),g=e.i(492009),v=e.i(126154),b=e.i(910939),w=e.i(634061),y=e.i(795672);let j={[u.AttachmentType.Image]:{label:"Image",icon:(0,t.jsx)(p.PhotoIcon,{className:"size-6"})},[u.AttachmentType.Text]:{label:"Text",icon:(0,t.jsx)(f.DocumentTextIcon,{className:"size-6"})},[u.AttachmentType.File]:{label:"PDF",icon:(0,t.jsx)(h.DocumentIcon,{className:"size-6"})},[u.AttachmentType.Audio]:{label:"Audio",icon:(0,t.jsx)(x.SpeakerWaveIcon,{className:"size-6"})},[u.AttachmentType.Video]:{label:"Video",icon:(0,t.jsx)(g.VideoCameraIcon,{className:"size-6"})}};function k(e){let a,i,l,s,o,c,d,m,h,f,p=(0,r.c)(39),{attachment:x,variant:g,isLoading:k}=e,N=(0,y.useFormatters)();if(void 0!==k&&k){let e;return p[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{"aria-label":"Loading attachment",className:"flex size-16 shrink-0 items-center justify-center rounded-lg bg-muted",role:"status",children:(0,t.jsx)(b.Spinner,{className:"size-6 text-muted-foreground"})}),p[0]=e):e=p[0],e}let C=j[x.type],A=x.type===u.AttachmentType.Image&&void 0!==x.url;if(A&&"composer"===g){let e;return p[1]!==x.name||p[2]!==x.url?(e=(0,t.jsx)("img",{alt:x.name,className:"size-16 shrink-0 rounded-lg object-cover ph-no-capture","data-dd-privacy":"hidden",src:x.url}),p[1]=x.name,p[2]=x.url,p[3]=e):e=p[3],e}let S=x.name===C.label&&0===x.size,E="composer"===g?"h-16 w-56 gap-2.5 px-3 py-2":"h-14 min-w-40 max-w-56 gap-2.5 px-3 py-2";p[4]!==E?(a=(0,n.cn)("relative flex min-w-0 cursor-pointer select-none items-center overflow-hidden rounded-lg border bg-background ph-no-capture transition-colors hover:bg-card-hover group-focus-within:ring-2 group-focus-within:ring-ring",E),p[4]=E,p[5]=a):a=p[5],p[6]!==x.name||p[7]!==x.url||p[8]!==A||p[9]!==C.icon||p[10]!==g?(i=A?(0,t.jsx)("img",{alt:x.name,className:(0,n.cn)("shrink-0 rounded-md object-cover","composer"===g?"size-10":"size-9"),src:x.url}):(0,t.jsx)("div",{className:(0,n.cn)("flex shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground","composer"===g?"size-10":"size-9"),children:C.icon}),p[6]=x.name,p[7]=x.url,p[8]=A,p[9]=C.icon,p[10]=g,p[11]=i):i=p[11];let L="composer"===g&&"pr-7";p[12]!==L?(l=(0,n.cn)("min-w-0 text-left",L),p[12]=L,p[13]=l):l=p[13];let P="composer"===g?"text-sm leading-5":"text-xs";p[14]!==P?(s=(0,n.cn)("truncate font-medium text-foreground",P),p[14]=P,p[15]=s):s=p[15];let D=S?C.label:x.name;p[16]!==x.name||p[17]!==s||p[18]!==D?(o=(0,t.jsx)("p",{className:s,title:x.name,children:D}),p[16]=x.name,p[17]=s,p[18]=D,p[19]=o):o=p[19],p[20]!==x.name||p[21]!==x.size||p[22]!==N||p[23]!==S||p[24]!==C.label?(c=S?null:(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[function(e){let t=e.lastIndexOf(".");if(t<=0||t===e.length-1)return null;let r=e.slice(t+1);return r.length>5||!/^[a-zA-Z0-9]+$/.test(r)?null:r.toUpperCase()}(x.name)??C.label,x.size>0?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(v.DotSeparator,{})," ",N.bytes(x.size)??"—"]}):null]}),p[20]=x.name,p[21]=x.size,p[22]=N,p[23]=S,p[24]=C.label,p[25]=c):c=p[25],p[26]!==o||p[27]!==c||p[28]!==l?(d=(0,t.jsxs)("div",{className:l,children:[o,c]}),p[26]=o,p[27]=c,p[28]=l,p[29]=d):d=p[29];let T="composer"===g?"bottom-2 right-3 size-4":"bottom-1.5 right-1.5 size-3.5";return p[30]!==T?(m=(0,n.cn)("absolute text-muted-foreground opacity-60 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100",T),p[30]=T,p[31]=m):m=p[31],p[32]!==m?(h=(0,t.jsx)(w.Expand,{"aria-hidden":"true",className:m}),p[32]=m,p[33]=h):h=p[33],p[34]!==d||p[35]!==h||p[36]!==a||p[37]!==i?(f=(0,t.jsxs)("div",{className:a,"data-dd-privacy":"hidden",children:[i,d,h]}),p[34]=d,p[35]=h,p[36]=a,p[37]=i,p[38]=f):f=p[38],f}var N=e.i(130868),C=e.i(389097),A=e.i(394333);let S=(0,a.lazy)(()=>e.A(339052));function E(e){let n=(0,r.c)(19),{attachment:i}=e;switch(i.type){case"image":{let e;return n[0]!==i.name||n[1]!==i.url?(e=(0,t.jsx)("div",{className:"bg-background h-max w-full max-w-max overflow-auto rounded-md border",children:(0,t.jsx)("picture",{className:"flex shrink-0 self-center",children:(0,t.jsx)("img",{alt:i.name,className:"max-h-screen max-w-full rounded-md",src:i.url})})}),n[0]=i.name,n[1]=i.url,n[2]=e):e=n[2],e}case"text":{let e,r;return n[3]!==i.content?(e=i.content?.slice(0,42e4)??"",n[3]=i.content,n[4]=e):e=n[4],n[5]!==e?(r=(0,t.jsx)("div",{className:"bg-background h-max w-full overflow-auto rounded-md border px-4 py-2",children:(0,t.jsx)("pre",{className:"max-h-[calc(100vh-16rem)] max-w-96 whitespace-pre-wrap break-words rounded-md text-sm",children:e})}),n[5]=e,n[6]=r):r=n[6],r}case"file":{let e,r;return n[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(A.Skeleton,{className:"size-full"}),n[7]=e):e=n[7],n[8]!==i.content?(r=(0,t.jsx)(a.Suspense,{fallback:e,children:(0,t.jsx)(S,{base64DataURL:i.content,showControls:!0,className:"size-full overflow-hidden rounded-md border"})}),n[8]=i.content,n[9]=r):r=n[9],r}case"audio":{let e,r,a,l,s,o=i.url??"";return n[10]===Symbol.for("react.memo_cache_sentinel")?(e={crossOrigin:"anonymous"},n[10]=e):e=n[10],n[11]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(N.AudioPlayerButton,{size:"icon",variant:"outline"}),n[11]=r):r=n[11],n[12]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"font-medium",children:"Audio Input"}),n[12]=a):a=n[12],n[13]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[r,(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[a,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(N.AudioPlayerTime,{}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,t.jsx)(N.AudioPlayerDuration,{})]})]}),(0,t.jsx)(N.AudioPlayerProgress,{})]})]}),n[13]=l):l=n[13],n[14]!==o?(s=(0,t.jsx)("div",{className:"bg-background w-full max-w-md rounded-md border p-6",children:(0,t.jsx)(N.AudioPlayerProvider,{src:o,audioProps:e,children:l})}),n[14]=o,n[15]=s):s=n[15],s}case"video":{let e,r;return n[16]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("track",{kind:"captions"}),n[16]=e):e=n[16],n[17]!==i.url?(r=(0,t.jsx)("div",{className:"bg-background w-full max-w-2xl rounded-md border",children:(0,t.jsx)("video",{className:"max-h-[70vh] w-full rounded-md",src:i.url,controls:!0,autoPlay:!1,children:e})}),n[17]=i.url,n[18]=r):r=n[18],r}default:return null}}function L(e){let i,l,s,c,u,m,h,f,p,x,g,v,b=(0,r.c)(33),{children:w,attachments:y,initialIndex:j}=e,[k,N]=(0,a.useState)(!1),A=y[void 0===j?0:j]??y[0];if(!A)return null;let S="file"===A.type,L=`Open attachment preview: ${A.name}`;b[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>N(!0),b[0]=i):i=b[0],b[1]!==w||b[2]!==L?(l=(0,t.jsx)(o.Button,{variant:"ghost",className:"contents h-auto w-auto p-0 hover:bg-transparent","aria-label":L,onClick:i,children:w}),b[1]=w,b[2]=L,b[3]=l):l=b[3];let P=!S,D=S&&"flex h-[90vh] flex-col";b[4]!==D?(s=(0,n.cn)("w-full max-w-4xl",D),b[4]=D,b[5]=s):s=b[5],b[6]!==A.name?(c=(0,t.jsx)(C.DialogTitle,{className:"sr-only",children:A.name}),b[6]=A.name,b[7]=c):c=b[7],b[8]!==S?(u=S&&(0,t.jsx)(C.DialogClose,{className:(0,n.cn)("absolute right-3 top-3 z-20 flex items-center justify-center","size-8 rounded-full border border-border bg-popover text-popover-foreground","shadow-md transition-colors hover:bg-accent-subtle hover:text-accent-foreground","focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none"),"aria-label":"Close",children:(0,t.jsx)(d.X,{className:"size-4"})}),b[8]=S,b[9]=u):u=b[9];let T=S&&"min-h-0 w-full flex-1";b[10]!==T?(m=(0,n.cn)("flex flex-col items-center justify-center gap-2 ph-no-capture",T),b[10]=T,b[11]=m):m=b[11],b[12]!==A?(h=(0,t.jsx)(E,{attachment:A}),b[12]=A,b[13]=h):h=b[13];let z=A.size>0&&` (${Math.round(A.size/1024/1024*10)/10} MB)`;return b[14]!==A.name||b[15]!==z?(f=(0,t.jsxs)("pre",{className:"text-muted-foreground text-wrap break-all text-center text-xs",children:[A.name,z]}),b[14]=A.name,b[15]=z,b[16]=f):f=b[16],b[17]!==m||b[18]!==h||b[19]!==f?(p=(0,t.jsxs)("div",{className:m,"data-dd-privacy":"hidden",children:[h,f]}),b[17]=m,b[18]=h,b[19]=f,b[20]=p):p=b[20],b[21]!==p||b[22]!==P||b[23]!==s||b[24]!==c||b[25]!==u?(x=(0,t.jsxs)(C.DialogContent,{keepMounted:!1,showCloseButton:P,className:s,children:[c,u,p]}),b[21]=p,b[22]=P,b[23]=s,b[24]=c,b[25]=u,b[26]=x):x=b[26],b[27]!==k||b[28]!==x?(g=(0,t.jsx)(C.Dialog,{open:k,onOpenChange:N,children:x}),b[27]=k,b[28]=x,b[29]=g):g=b[29],b[30]!==g||b[31]!==l?(v=(0,t.jsxs)(t.Fragment,{children:[l,g]}),b[30]=g,b[31]=l,b[32]=v):v=b[32],v}let P=[];function D(e){return e.type===u.AttachmentType.Image}e.s(["AttachmentPreview",0,e=>{let a,i,l,s,h,f=(0,r.c)(18),{attachment:p,attachments:x,onDismiss:g,isLoading:v}=e,b=void 0===x?P:x,w=void 0!==v&&v,y=p.type===u.AttachmentType.Image;f[0]!==p||f[1]!==b||f[2]!==y?(a=y?(b.length>0?b:[p]).filter(D):[],i=y?a.indexOf(p):-1,f[0]=p,f[1]=b,f[2]=y,f[3]=a,f[4]=i):(a=f[3],i=f[4]);let j=i,N=g?"composer":"message",C=y&&"composer"===N&&void 0!==p.url;return f[5]!==C||f[6]!==g?(l=g&&(0,t.jsx)(c.Tooltip,{content:"Remove attachment",side:"left",children:(0,t.jsx)(o.Button,{size:"icon-sm",variant:"ghost",className:(0,n.cn)("absolute z-10",C?"right-1 top-1 size-5 rounded-full border border-border/60 bg-background/80 p-0 shadow-sm backdrop-blur-sm hover:bg-background":"right-1 top-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),"aria-label":"Remove attachment",onClick:g,children:(0,t.jsx)(d.X,{className:C?"size-3":"size-4"})})}),f[5]=C,f[6]=g,f[7]=l):l=f[7],f[8]!==p||f[9]!==a||f[10]!==j||f[11]!==y||f[12]!==w||f[13]!==N?(s=y?(0,t.jsx)(m.ImagePreviewDialog,{images:a,initialIndex:Math.max(j,0),children:(0,t.jsx)(k,{attachment:p,variant:N,isLoading:w})}):(0,t.jsx)(L,{attachments:[p],initialIndex:0,children:(0,t.jsx)(k,{attachment:p,variant:N,isLoading:w})}),f[8]=p,f[9]=a,f[10]=j,f[11]=y,f[12]=w,f[13]=N,f[14]=s):s=f[14],f[15]!==l||f[16]!==s?(h=(0,t.jsx)("div",{className:"min-w-0 duration-200 animate-in fade-in slide-in-from-left-8",children:(0,t.jsxs)("div",{className:"group relative flex min-w-0",children:[l,s]})}),f[15]=l,f[16]=s,f[17]=h):h=f[17],h}],705113)},358058,e=>{"use strict";var t=e.i(475382);e.i(530023);var r=e.i(612774),n=e.i(693697),a=e.i(270401),i=e.i(968076),l=e.i(399695);let s={[l.RejectionReason.TooLarge]:"file is too large.",[l.RejectionReason.Binary]:"binary files are not supported.",[l.RejectionReason.UnsupportedType]:"unsupported file type (supported: images, audio, video, text, and PDF)."};function o(e,t=20){if(e.length<=t)return e;let r=e.lastIndexOf("."),n=r>0?e.slice(r):"",a=e.slice(0,e.length-n.length),i=Math.max(1,t-n.length-1);return`${a.slice(0,i)}…${n}`}let c={[l.WarningReason.PDFOverCloudflareAILimit]:"PDFs over 5MB may not be processed by free models and could fail after sending. Try a paid model or a smaller file."};var d=e.i(624900);let u=8;e.s(["DEFAULT_MAX_ATTACHMENTS",0,u,"useAttachments",0,({limit:e=u}={})=>{let[m,h]=(0,a.useState)([]),[f,p]=(0,a.useState)(new Set),{setError:x}=(0,t.useGlobalErrorToast)(),g=(0,a.useCallback)(e=>{h(t=>t.filter(t=>(0,d.getAttachmentKey)(t)!==e)),p(t=>{if(!t.has(e))return t;let r=new Set(t);return r.delete(e),r})},[]),v=(0,a.useCallback)(e=>{g((0,d.getAttachmentKey)(e))},[g]),b=(0,a.useCallback)(async(e,t=!1)=>{let r=(0,d.getAttachmentKey)(e);try{let a=await (0,l.readFileContent)(e,t);if((0,n.isErr)(a)){x(a.error),g(r);return}h(e=>e.map(e=>(0,d.getAttachmentKey)(e)===r?a.data:e))}finally{p(e=>{if(!e.has(r))return e;let t=new Set(e);return t.delete(r),t})}},[g,x]),w=(0,a.useCallback)(async t=>{let a=await t;if((0,n.isErr)(a))return void x(a.error);let{accepted:u,rejected:f,warned:g}=await (0,l.processAndValidateFiles)(a.data);if(f.length>0&&(0,r.toast)({title:"Unsupported Files",description:Object.values(l.RejectionReason).map(e=>{let t=f.filter(t=>t.reason===e).map(e=>o(e.file.name));return t.length>0?`${t.join(", ")} could not be attached: ${s[e]}`:null}).filter(e=>null!==e).join(" "),variant:"destructive"}),0===u.length)return;let v=new Set(m.map(d.getAttachmentKey)),w=u.filter(({file:e})=>!v.has((0,d.getAttachmentKey)(e)));if(m.length+w.length>e){let t=e-m.length;(0,r.toast)({title:"Attachment Limit Reached",description:`You can only add ${t>0?t:0} more files.`}),w.splice(t)}if(0===w.length)return;let y=new Set(w.map(({file:e})=>e)),j=g.filter(({file:e})=>y.has(e));j.length>0&&(0,r.toast)({title:"Large Attachment",description:Object.values(l.WarningReason).map(e=>{let t=j.filter(t=>t.reason===e).map(e=>o(e.file.name));return t.length>0?`${t.join(", ")}: ${c[e]}`:null}).filter(e=>null!==e).join(" ")});let k=w.map(({file:e})=>({type:i.AttachmentType.Text,name:e.name,size:e.size,content:"Loading..."})),N=w.map(({file:e})=>(0,d.getAttachmentKey)(e));h(e=>[...e,...k]),p(e=>new Set([...e,...N])),await Promise.all(w.map(({file:e,wasSniffed:t})=>b(e,t)))},[m,b,e,x]),y=(0,a.useCallback)(()=>{h([]),p(new Set)},[]),j=(0,a.useCallback)(t=>{h(t.slice(0,e)),p(new Set)},[e]);return{limit:e,list:m,loadingKeys:f,handleFiles:w,reset:y,remove:v,set:j,update:(0,a.useCallback)(e=>{h(t=>t.map(t=>(0,d.getAttachmentKey)(t)===(0,d.getAttachmentKey)(e)?e:t))},[])}}],358058)},404142,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(452473),a=e.i(528164),i=e.i(507869),l=e.i(648156),s=e.i(19379);let o=(0,e.i(202913).default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);function c(e){let i,s,c,d,u,m,h,f,p,x=(0,r.c)(29),{title:g,onToggle:v,newAction:b,newActionPlacement:w}=e,y=b.icon,j="header"===w;return x[0]!==g?(i=(0,t.jsx)("h3",{className:"text-base font-medium text-foreground",children:g}),x[0]=g,x[1]=i):i=x[1],x[2]!==y||x[3]!==j||x[4]!==b.ariaLabel||x[5]!==b.label||x[6]!==b.onClick?(s=j?(0,t.jsx)(l.Tooltip,{side:"bottom",delay:0,content:b.label,children:(0,t.jsx)(a.Button,{size:"icon",variant:"ghost","aria-label":b.ariaLabel,onClick:b.onClick,className:"shrink-0",children:(0,t.jsx)(y,{className:"size-5 text-muted-foreground"})})}):null,x[2]=y,x[3]=j,x[4]=b.ariaLabel,x[5]=b.label,x[6]=b.onClick,x[7]=s):s=x[7],x[8]!==v?(c=e=>{e.stopPropagation(),v()},x[8]=v,x[9]=c):c=x[9],x[10]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)(o,{className:"size-5 text-muted-foreground"}),x[10]=d):d=x[10],x[11]!==c?(u=(0,t.jsx)(a.Button,{size:"icon",variant:"ghost","aria-label":"Toggle sidebar",onClick:c,className:"shrink-0",children:d}),x[11]=c,x[12]=u):u=x[12],x[13]!==s||x[14]!==u?(m=(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[s,u]}),x[13]=s,x[14]=u,x[15]=m):m=x[15],x[16]!==i||x[17]!==m?(h=(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 px-1",children:[i,m]}),x[16]=i,x[17]=m,x[18]=h):h=x[18],x[19]!==y||x[20]!==j||x[21]!==b.ariaLabel||x[22]!==b.label||x[23]!==b.onClick||x[24]!==b.shortcutHint?(f=j?null:(0,t.jsxs)(a.Button,{variant:"outline",size:"md",onClick:b.onClick,"aria-label":b.ariaLabel,className:(0,n.cn)("h-8 w-full justify-start gap-3 px-3","text-foreground hover:bg-card-hover"),children:[(0,t.jsx)(y,{className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{children:b.label}),b.shortcutHint&&(0,t.jsx)("span",{className:"ml-auto hidden text-xs text-muted-foreground md:inline",children:b.shortcutHint})]}),x[19]=y,x[20]=j,x[21]=b.ariaLabel,x[22]=b.label,x[23]=b.onClick,x[24]=b.shortcutHint,x[25]=f):f=x[25],x[26]!==h||x[27]!==f?(p=(0,t.jsxs)(t.Fragment,{children:[h,f]}),x[26]=h,x[27]=f,x[28]=p):p=x[28],p}function d(e){let n,s,c,d,u,m,h,f,p,x,g=(0,r.c)(23),{onToggle:v,newAction:b}=e,w=b.icon;return g[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Toggle sidebar",(0,t.jsx)(i.Shortcut,{children:"["})]}),g[0]=n):n=g[0],g[1]!==v?(s=e=>{e.stopPropagation(),v()},g[1]=v,g[2]=s):s=g[2],g[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(o,{className:"size-5 text-muted-foreground"}),g[3]=c):c=g[3],g[4]!==s?(d=(0,t.jsx)(l.Tooltip,{side:"right",delay:0,content:n,children:(0,t.jsx)(a.Button,{size:"icon",variant:"ghost","aria-label":"Toggle sidebar",onClick:s,className:"shrink-0 hover:stroke-foreground",children:c})}),g[4]=s,g[5]=d):d=g[5],g[6]!==b.shortcutHint?(u=b.shortcutHint&&(0,t.jsx)(i.Shortcut,{children:b.shortcutHint}),g[6]=b.shortcutHint,g[7]=u):u=g[7],g[8]!==b.label||g[9]!==u?(m=(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[b.label,u]}),g[8]=b.label,g[9]=u,g[10]=m):m=g[10],g[11]!==w?(h=(0,t.jsx)(w,{className:"size-5"}),g[11]=w,g[12]=h):h=g[12],g[13]!==b.ariaLabel||g[14]!==b.onClick||g[15]!==h?(f=(0,t.jsx)(a.Button,{size:"icon",variant:"ghost",onClick:b.onClick,"aria-label":b.ariaLabel,className:"shrink-0",children:h}),g[13]=b.ariaLabel,g[14]=b.onClick,g[15]=h,g[16]=f):f=g[16],g[17]!==m||g[18]!==f?(p=(0,t.jsx)(l.Tooltip,{side:"right",delay:0,content:m,children:f}),g[17]=m,g[18]=f,g[19]=p):p=g[19],g[20]!==d||g[21]!==p?(x=(0,t.jsxs)("div",{className:"flex w-full flex-col items-center gap-1",children:[d,p]}),g[20]=d,g[21]=p,g[22]=x):x=g[22],x}e.s(["HistorySidebar",0,e=>{let a,i,l,o,u,m,h,f,p,x,g,v,b,w,y,j,k,N=(0,r.c)(36);N[0]!==e?({children:a,title:x,isCollapsed:i,onToggle:o,newAction:l,newActionPlacement:h,containerClassName:f,className:p,ref:m,...u}=e,N[0]=e,N[1]=a,N[2]=i,N[3]=l,N[4]=o,N[5]=u,N[6]=m,N[7]=h,N[8]=f,N[9]=p,N[10]=x):(a=N[1],i=N[2],l=N[3],o=N[4],u=N[5],m=N[6],h=N[7],f=N[8],p=N[9],x=N[10]);let C=void 0===h?"row":h,A=void 0===f?"":f,S=void 0===p?"":p,E=!i;(0,s.useKeydown)("[",o);let L=E?"w-[260px]":"w-[54px]";N[11]!==A||N[12]!==L?(g=(0,n.cn)("flex h-full shrink-0 flex-col transition-[width] duration-150 ease-in-out p-px","bg-background border-r border-border",L,A),N[11]=A,N[12]=L,N[13]=g):g=N[13],N[14]!==S?(v=(0,n.cn)("flex h-full w-full flex-col gap-2 p-2",S),N[14]=S,N[15]=v):v=N[15],N[16]!==E||N[17]!==l||N[18]!==C||N[19]!==o||N[20]!==x?(b=E?(0,t.jsx)(c,{title:x,onToggle:o,newAction:l,newActionPlacement:C}):(0,t.jsx)(d,{onToggle:o,newAction:l}),N[16]=E,N[17]=l,N[18]=C,N[19]=o,N[20]=x,N[21]=b):b=N[21];let P=E?"opacity-100 visible pointer-events-auto h-auto":"opacity-0 invisible pointer-events-none h-0";return N[22]!==P?(w=(0,n.cn)("flex-1 min-h-0 overflow-hidden",P,"transition-[opacity,visibility,height] duration-200","py-px"),N[22]=P,N[23]=w):w=N[23],N[24]!==a||N[25]!==w?(y=(0,t.jsx)("div",{className:w,children:a}),N[24]=a,N[25]=w,N[26]=y):y=N[26],N[27]!==y||N[28]!==v||N[29]!==b?(j=(0,t.jsxs)("div",{className:v,children:[b,y]}),N[27]=y,N[28]=v,N[29]=b,N[30]=j):j=N[30],N[31]!==u||N[32]!==m||N[33]!==j||N[34]!==g?(k=(0,t.jsx)("aside",{ref:m,...u,className:g,children:j}),N[31]=u,N[32]=m,N[33]=j,N[34]=g,N[35]=k):k=N[35],k}],404142)},649896,936927,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(152533),a=e.i(558200),i=e.i(452473),l=e.i(810563);e.s(["HistorySidebarSearchRow",0,function(e){let s,o,c,d,u,m,h,f=(0,r.c)(15),{placeholder:p,value:x,onValueChange:g}=e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,i.cn)("flex h-8 shrink-0 items-center gap-3 rounded-md pl-3 pr-1","border border-border bg-background","focus-within:border-focus-border focus-within:shadow-focus"),o=(0,t.jsx)(n.MagnifyingGlassIcon,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}),f[0]=s,f[1]=o):(s=f[0],o=f[1]),f[2]!==g?(c=e=>g(e.target.value),f[2]=g,f[3]=c):c=f[3],f[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,i.cn)("h-full flex-1 min-w-0 border-0 bg-transparent px-0 text-sm pointer-coarse:text-base shadow-none","focus-visible:border-transparent focus-visible:shadow-none focus:bg-transparent focus:ring-0","dark:bg-transparent dark:focus:bg-transparent"),f[4]=d):d=f[4],f[5]!==p||f[6]!==c||f[7]!==x?(u=(0,t.jsx)(l.Input,{placeholder:p,value:x,onChange:c,className:d}),f[5]=p,f[6]=c,f[7]=x,f[8]=u):u=f[8],f[9]!==g||f[10]!==x?(m=x&&(0,t.jsx)("button",{type:"button","aria-label":"Clear search",onClick:()=>g(""),className:(0,i.cn)("flex h-5 w-5 shrink-0 items-center justify-center rounded","text-muted-foreground transition-colors hover:bg-card-hover hover:text-accent-foreground"),children:(0,t.jsx)(a.XMarkIcon,{className:"size-3.5"})}),f[9]=g,f[10]=x,f[11]=m):m=f[11],f[12]!==u||f[13]!==m?(h=(0,t.jsxs)("div",{className:s,children:[o,u,m]}),f[12]=u,f[13]=m,f[14]=h):h=f[14],h}],649896);var s=e.i(850658),o=e.i(553215),c=e.i(738286);e.i(530023);var d=e.i(612774),u=e.i(252358),m=e.i(314164),h=e.i(864160),f=e.i(693697),p=e.i(695707),x=e.i(323813),g=e.i(977051);e.i(798823);var v=e.i(429930),b=e.i(22422),w=e.i(624621),y=e.i(48318),j=e.i(328616),k=e.i(408784);function N(e){let n,a,l,s=(0,r.c)(5),{name:o}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.cn)("flex size-6 shrink-0 items-center justify-center rounded-md","bg-primary text-xs font-medium text-primary-foreground"),s[0]=n):n=s[0],s[1]!==o?(a=o.trim().charAt(0).toUpperCase()||"?",s[1]=o,s[2]=a):a=s[2],s[3]!==a?(l=(0,t.jsx)("div",{className:n,children:a}),s[3]=a,s[4]=l):l=s[4],l}function C(){return b.chatroomStoreActions.stopGeneration()}function A(e){return e.entity?.clerk_user_id??null}e.s(["WorkspaceSwitcher",0,function(e){let n,a,l,b,S,E,L,P,D,T,z,R,_,M,I,B,H,O,V=(0,r.c)(71),{surface:W,className:F}=e,{isSignedIn:$}=(0,s.useAuth)(),U=(0,u.usePosthogClient)(),Z=(0,p.useQueryClient)(),K=(0,h.useUserStore)(A),G=!0===$;V[0]!==G?(n={isEnabled:G},V[0]=G,V[1]=n):n=V[1];let{workspaces:q,activeWorkspaceId:X}=(0,y.useUserWorkspaces)(n),{mutate:Q,isPending:J}=(0,y.useSetActiveWorkspace)(),Y=(0,g.useFeatureFlag)("hipaaWorkspaces");if(!$||!q||0===q.length||!X)return null;if(V[2]!==X||V[3]!==F||V[4]!==K||V[5]!==Y||V[6]!==J||V[7]!==U||V[8]!==Z||V[9]!==Q||V[10]!==W||V[11]!==q){let e,r,n,s,u,h,p=[...q].sort((e,t)=>(0,k.compareCanonicalText)(e.created_at,t.created_at)),g=function(e){let t=new Map;for(let r of e)t.set(r.name,(t.get(r.name)??0)+1);return new Map(e.map(e=>[e.id,(t.get(e.name)??0)>1?`${e.name} (${e.slug})`:e.name]))}(p);if(V[26]!==X||V[27]!==q){let t;V[29]!==X?(t=e=>e.id===X,V[29]=X,V[30]=t):t=V[30],e=q.find(t),V[26]=X,V[27]=q,V[28]=e}else e=V[28];let y=e;V[31]!==X||V[32]!==K||V[33]!==U||V[34]!==Z||V[35]!==Q||V[36]!==W?(r=async e=>{if(e===X)return;let t=function({rooms:e}){return Object.values(e).some(e=>e.isProcessing||Object.values(e.messages).some(e=>e.type===v.MessageType.Assistant&&(e.isGenerating||e.isRetrying)))}(w.useChatroomStore.getState());if(t&&!window.confirm("A chat response is still streaming. Switching workspaces will cancel it. Switch anyway?"))return;let r=await Q({workspaceId:e,surface:W,onPersisted:t?C:void 0});(0,f.isErr)(r)?(0,d.toast)({title:"Unable to switch workspace",description:r.error.message||"Something went wrong. Please try again.",variant:"destructive"}):(await Promise.all([Z.resetQueries({exact:!0,queryKey:m.providerPreferencesKeys.detail(K,{includeGuardrails:!1,workspaceId:null})}),Z.resetQueries({exact:!0,queryKey:m.providerPreferencesKeys.detail(K,{includeGuardrails:!0,workspaceId:null})})]),U.capture(o.PostHogEvent.SwitchWorkspace,{cancelled_active_chat:t,surface:W}))},V[31]=X,V[32]=K,V[33]=U,V[34]=Z,V[35]=Q,V[36]=W,V[37]=r):r=V[37];let A=r;V[38]!==F?(E=(0,i.cn)("relative -mx-2 shrink-0 bg-background px-2 pt-2",F),V[38]=F,V[39]=E):E=V[39],V[40]===Symbol.for("react.memo_cache_sentinel")?(L=(0,t.jsx)("div",{"aria-hidden":"true",className:(0,i.cn)("pointer-events-none absolute inset-x-0 bottom-full h-8","bg-gradient-to-t from-background via-background/80 to-transparent")}),P=(0,t.jsx)("div",{"aria-hidden":"true",className:"absolute inset-x-0 top-0 h-px bg-border"}),V[40]=L,V[41]=P):(L=V[40],P=V[41]),l=c.Select,M="compact",I=X,V[42]!==A?(b=e=>void A(e),V[42]=A,V[43]=b):b=V[43],V[44]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.cn)("h-10 w-full shrink-0 gap-2 rounded-md px-2","border-transparent bg-transparent hover:bg-card-hover","text-body md:text-body","[&>span:last-child]:hidden"),V[44]=n):n=V[44];let B=y?.name??"";V[45]!==B?(s=(0,t.jsx)(N,{name:B}),V[45]=B,V[46]=s):s=V[46],V[47]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(c.SelectValue,{}),h=(0,t.jsx)(x.ChevronsUpDown,{className:"size-4 shrink-0 text-muted-foreground"}),V[47]=u,V[48]=h):(u=V[47],h=V[48]),V[49]!==J||V[50]!==s?(S=(0,t.jsxs)(c.SelectTrigger,{"aria-label":"Switch workspace",disabled:J,className:n,children:[s,u,h]}),V[49]=J,V[50]=s,V[51]=S):S=V[51],a=c.SelectContent,D="top",T="start",z=!1,R="min-w-56",_=p.map(e=>(0,t.jsx)(c.SelectItem,{value:e.id,textValue:g.get(e.id)??e.name,className:"pl-3 pr-8 text-body md:text-body [&>span:first-child]:left-auto [&>span:first-child]:right-2",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[g.get(e.id)??e.name,Y&&(0,t.jsx)(j.WorkspaceHipaaBadge,{workspace:e})]})},e.id)),V[2]=X,V[3]=F,V[4]=K,V[5]=Y,V[6]=J,V[7]=U,V[8]=Z,V[9]=Q,V[10]=W,V[11]=q,V[12]=a,V[13]=l,V[14]=b,V[15]=S,V[16]=E,V[17]=L,V[18]=P,V[19]=D,V[20]=T,V[21]=z,V[22]=R,V[23]=_,V[24]=M,V[25]=I}else a=V[12],l=V[13],b=V[14],S=V[15],E=V[16],L=V[17],P=V[18],D=V[19],T=V[20],z=V[21],R=V[22],_=V[23],M=V[24],I=V[25];return V[52]!==a||V[53]!==D||V[54]!==T||V[55]!==z||V[56]!==R||V[57]!==_?(B=(0,t.jsx)(a,{side:D,align:T,showScrollButtons:z,className:R,children:_}),V[52]=a,V[53]=D,V[54]=T,V[55]=z,V[56]=R,V[57]=_,V[58]=B):B=V[58],V[59]!==l||V[60]!==b||V[61]!==S||V[62]!==B||V[63]!==M||V[64]!==I?(H=(0,t.jsxs)(l,{size:M,value:I,onValueChange:b,children:[S,B]}),V[59]=l,V[60]=b,V[61]=S,V[62]=B,V[63]=M,V[64]=I,V[65]=H):H=V[65],V[66]!==E||V[67]!==L||V[68]!==P||V[69]!==H?(O=(0,t.jsxs)("div",{className:E,children:[L,P,H]}),V[66]=E,V[67]=L,V[68]=P,V[69]=H,V[70]=O):O=V[70],O}],936927)},318875,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(452473),a=e.i(528164),i=e.i(389097),l=e.i(784510),s=e.i(270401);e.i(406201);var o=e.i(806024);let c=(0,s.memo)(e=>{let s,c,h,f,p,x,g,v,b,w,y=(0,r.c)(21),{open:j,onOpenChange:k,onContinueWithFreeModels:N}=e,{availableTextModels:C}=(0,l.useGlobal)();e:{let e;if(!C?.length){s="/models?max_price=0";break e}y[0]!==C?(e=C.filter(d).sort(u).slice(0,3).map(m).join(","),y[0]=C,y[1]=e):e=y[1];let t=e;s=t?`/chat?models=${t}`:"/models?max_price=0"}let A=s;y[2]!==k?(c=()=>{k(!1)},y[2]=k,y[3]=c):c=y[3];let S=c;return y[4]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.cn)("max-w-sm"),y[4]=h):h=y[4],y[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsxs)(i.DialogHeader,{className:"text-center",children:[(0,t.jsx)(i.DialogTitle,{children:"Insufficient credits"}),(0,t.jsx)(i.DialogDescription,{children:"Add credits to continue using paid models."})]}),y[5]=f):f=y[5],y[6]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(a.Button,{variant:"default",className:"w-full h-10",children:"Buy credits"}),y[6]=p):p=y[6],y[7]!==S?(x=(0,t.jsx)(o.Link,{href:"https://openrouter.ai/settings/credits",className:"w-full",onClick:S,children:p}),y[7]=S,y[8]=x):x=y[8],y[9]===Symbol.for("react.memo_cache_sentinel")?(g=(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"h-px bg-border flex-1"}),(0,t.jsx)("span",{children:"or"}),(0,t.jsx)("span",{className:"h-px bg-border flex-1"})]}),y[9]=g):g=y[9],y[10]!==S||y[11]!==A||y[12]!==N?(v=(0,t.jsx)("div",{className:"flex items-center justify-center",children:N?(0,t.jsx)("button",{type:"button",className:"text-sm underline hover:opacity-80 text-muted-foreground",onClick:()=>{S(),N()},children:"Continue with free models"}):(0,t.jsx)(o.Link,{href:A,className:"text-sm underline hover:opacity-80",onClick:S,children:"Continue with free models"})}),y[10]=S,y[11]=A,y[12]=N,y[13]=v):v=y[13],y[14]!==x||y[15]!==v?(b=(0,t.jsxs)(i.DialogContent,{className:h,children:[f,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[x,g,v]})]}),y[14]=x,y[15]=v,y[16]=b):b=y[16],y[17]!==k||y[18]!==j||y[19]!==b?(w=(0,t.jsx)(i.Dialog,{open:j,onOpenChange:k,children:b}),y[17]=k,y[18]=j,y[19]=b,y[20]=w):w=y[20],w});function d(e){return e.endpoint?.is_free||e.slug.endsWith(":free")}function u(e,t){let r=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-r}function m(e){return e.slug}e.s(["InsufficientCreditsModal",0,c])},797677,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(452473),a=e.i(270401);function i(e){window.clearTimeout(e)}e.s(["AutoScrollContainer",0,e=>{let l,s,o,c,d,u,m,h=(0,r.c)(17),{children:f,className:p,itemCount:x,orientation:g}=e,v=void 0===g?"horizontal":g,b=(0,a.useRef)(null),w=(0,a.useRef)(x);h[0]!==x||h[1]!==v?(l=()=>{let e=w.current;if(w.current=x,x<=e)return;let t=()=>{if(b.current){if("horizontal"===v){b.current.scrollLeft=b.current.scrollWidth;return}b.current.scrollTop=b.current.scrollHeight}};t();let r=[window.setTimeout(t,50),window.setTimeout(t,200),window.setTimeout(t,500)];return()=>{r.forEach(i)}},s=[x,v],h[0]=x,h[1]=v,h[2]=l,h[3]=s):(l=h[2],s=h[3]),(0,a.useEffect)(l,s),h[4]!==p?(o=(0,n.cn)("w-full overflow-hidden",p),h[4]=p,h[5]=o):o=h[5];let y="horizontal"===v?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden";h[6]!==y?(c=(0,n.cn)("size-full rounded-[inherit]",y),h[6]=y,h[7]=c):c=h[7];let j="horizontal"===v?"w-max":"h-max";return h[8]!==f||h[9]!==j?(d=(0,t.jsx)("div",{className:j,children:f}),h[8]=f,h[9]=j,h[10]=d):d=h[10],h[11]!==c||h[12]!==d?(u=(0,t.jsx)("div",{ref:b,className:c,children:d}),h[11]=c,h[12]=d,h[13]=u):u=h[13],h[14]!==o||h[15]!==u?(m=(0,t.jsx)("div",{className:o,children:u}),h[14]=o,h[15]=u,h[16]=m):m=h[16],m}])},903121,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(270401);let a=n.forwardRef(function({title:e,titleId:t,...r},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{fillRule:"evenodd",d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm14.25 6a.75.75 0 0 1-.22.53l-2.25 2.25a.75.75 0 1 1-1.06-1.06L15.44 12l-1.72-1.72a.75.75 0 1 1 1.06-1.06l2.25 2.25c.141.14.22.331.22.53Zm-10.28-.53a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 1 0 1.06-1.06L8.56 12l1.72-1.72a.75.75 0 1 0-1.06-1.06l-2.25 2.25Z",clipRule:"evenodd"}))}),i=n.forwardRef(function({title:e,titleId:t,...r},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z",clipRule:"evenodd"}),n.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}),l=n.forwardRef(function({title:e,titleId:t,...r},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{fillRule:"evenodd",d:"M1.5 6a2.25 2.25 0 0 1 2.25-2.25h16.5A2.25 2.25 0 0 1 22.5 6v12a2.25 2.25 0 0 1-2.25 2.25H3.75A2.25 2.25 0 0 1 1.5 18V6ZM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0 0 21 18v-1.94l-2.69-2.689a1.5 1.5 0 0 0-2.12 0l-.88.879.97.97a.75.75 0 1 1-1.06 1.06l-5.16-5.159a1.5 1.5 0 0 0-2.12 0L3 16.061Zm10.125-7.81a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z",clipRule:"evenodd"}))});var s=e.i(452473);e.s(["ComposerDropZone",0,e=>{let n,o,c,d,u=(0,r.c)(11),{className:m,isValid:h,onDrop:f}=e;u[0]!==f?(n=f?{onDrop:f}:{},u[0]=f,u[1]=n):n=u[1];let p=h?"border-accent-border bg-selected-bg":"border-destructive bg-destructive/10";return u[2]!==m||u[3]!==p?(o=(0,s.cn)("flex h-32 w-full items-center justify-center rounded-lg border-2 border-dashed backdrop-blur-sm",p,"transition-colors duration-200 ease-in-out",m),u[2]=m,u[3]=p,u[4]=o):o=u[4],u[5]!==h?(c=(0,t.jsx)("div",{className:"text-center",children:h?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 font-semibold text-foreground",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(l,{className:"size-6 -rotate-6 text-muted-foreground"}),(0,t.jsx)(a,{className:"size-6 text-muted-foreground"}),(0,t.jsx)(i,{className:"size-6 rotate-6 text-muted-foreground"})]}),"Drop files here to add to your message"]}):(0,t.jsx)("p",{className:"font-semibold text-destructive",children:"Invalid file type (images, audio, video, text, PDF)"})}),u[5]=h,u[6]=c):c=u[6],u[7]!==n||u[8]!==o||u[9]!==c?(d=(0,t.jsx)("div",{role:"button",tabIndex:0,...n,className:o,children:c}),u[7]=n,u[8]=o,u[9]=c,u[10]=d):d=u[10],d}],903121)},660298,e=>{"use strict";e.s(["downloadMarkdown",0,function(e,{date:t=new Date().toDateString(),name:r="OpenRouter Chat",ext:n=".md"}={}){let a=`${r} ${t}${n}`.trim(),i=a.length>100?`${a.slice(0,100-n.length)}${n}`:a,l=new Blob([e],{type:"text/markdown;charset=utf-8;"}),s=document.createElement("a"),o=URL.createObjectURL(l);s.setAttribute("href",o),s.setAttribute("download",i),s.style.visibility="hidden",document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(o),4e4)}])},328616,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(189511),a=e.i(970654);e.s(["WorkspaceHipaaBadge",0,function(e){let i=(0,r.c)(2),{workspace:l,className:s}=e;switch((0,n.deriveWorkspaceMode)(l)){case n.WorkspaceMode.Standard:return null;case n.WorkspaceMode.Hipaa:{let e;return i[0]!==s?(e=(0,t.jsx)(a.Badge,{variant:"info",size:"sm",className:s,children:"HIPAA"}),i[0]=s,i[1]=e):e=i[1],e}default:return null}}])},215370,784814,e=>{"use strict";var t=e.i(850658),r=e.i(586404),n=e.i(48318);function a(e){let{activeWorkspaceId:t,defaultWorkspaceId:r}=e;return t&&r?t===r?null:t:null}e.s(["computeWorkspacePartitionId",0,a,"isInWorkspacePartition",0,function(e,t){return(e.workspaceId??null)===t}],784814);let i={isReady:!1,partitionId:null},l={isReady:!0,partitionId:null},s=null;e.s(["useActiveWorkspacePartition",0,function(){let{isLoaded:e,isSignedIn:o,userId:c,orgId:d}=(0,t.useAuth)(),{workspaces:u,activeWorkspaceId:m,defaultWorkspaceId:h,didFetchFail:f}=(0,n.useUserWorkspaces)({isEnabled:!0===o});if(!e)return i;if(!o||!(0,r.isDefinedAndNotNull)(c))return l;let p=d??null;if(void 0===u)return f&&s?.userId===c&&s.orgId===p?{isReady:!0,partitionId:s.partitionId}:i;let x=a({activeWorkspaceId:m,defaultWorkspaceId:h});return s={userId:c,orgId:p,partitionId:x},{isReady:!0,partitionId:x}}],215370)}]); //# sourceMappingURL=0l96yupjy8xne.js.map //# chunkId=01a09faf-506c-7590-a90c-fe829b574ede