PageSourceSearch

https://openart.ai/suite/_next/static/chunks/8630ebab3f1d4d24.js

js openart.ai collected 2026-09-24 08:30:57 UTC 57,967 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,950248,809454,e=>{"use strict";var t=e.i(743265),r=e.i(74840),a=e.i(93801),n=e.i(834486),o=e.i(478790),s=e.i(779342),i=e.i(526761),l=e.i(746865),c=e.i(86846),d=e.i(244547),u=e.i(250193),p=e.i(642558),f=e.i(368709),m=e.i(647163);e.i(814368);var h=e.i(450082),g=e.i(549949);function x({open:e,onOpenChange:x,switchOnCreate:v=!0,onCreated:y}){let[b,w]=(0,o.useState)(""),[j,E]=(0,o.useState)(!1),k=(0,n.useQueryClient)(),{switchProject:C}=(0,l.useProjectSwitch)(),{data:M,isLoading:R}=(0,d.useCurrentWorkspace)(),{data:_}=(0,u.useMyProfile)(),N=_?.last_used_workspace?.workspace_team_id??"",{count:T,isLoading:F}=(0,c.useProjectCount)(),P=e&&!R&&!F&&M?.subscription_active!==!0&&T>=1,I=()=>{x(!1),E(!0)},D=(0,a.useMutation)({mutationFn:e=>(0,f.post)("/api/projects",{name:e}),onSuccess:(e,t)=>{k.setQueryData(g.projectKeys.list(N),r=>{if(!r||0===r.pages.length)return r;let[a,...n]=r.pages;return a.data.some(t=>t.id===e.data.id)?r:{...r,pages:[{...a,data:[{id:e.data.id,name:t,isDefault:!1,createdAt:null,updatedAt:null,canWrite:!0},...a.data]},...n]}}),k.setQueryData(g.projectKeys.count(N),e=>e?{data:{count:e.data.count+1}}:e);let r=g.projectKeys.searchPrefix(N);k.invalidateQueries({predicate:e=>e.queryKey.length>r.length&&r.every((t,r)=>e.queryKey[r]===t)}),k.setQueryData(g.projectKeys.detail(N,e.data.id),{data:{id:e.data.id,name:t,isDefault:!1,createdAt:null,updatedAt:null}}),s.toast.success("Project created"),(0,p.event)("container_engaged",{container_action:"created",container_type:"project"}),v&&C(e.data.id),y?.(e.data.id),w(""),x(!1)},onError:e=>{if((0,f.isFetchError)(e)&&"ADDITIONAL_PROJECTS_REQUIRE_SUBSCRIPTION"===e.errorKey)return void I();let t=e instanceof Error?e.message:"Failed to create project";s.toast.error(t)}}),S=()=>{let e=b.trim();if(e){if(P)return void I();D.mutate(e)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Root,{open:e,onOpenChange:x,children:(0,t.jsxs)(r.Portal,{children:[(0,t.jsx)(r.Overlay,{className:"fixed inset-0 z-50 bg-black/60",onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),D.isPending||x(!1)}}),(0,t.jsxs)(r.Content,{className:(0,m.cn)("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[400px] max-w-[calc(100vw-32px)]","rounded-2xl bg-background-container-panel-surface border border-border-neutral-outline","p-6 shadow-lg"),onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:[(0,t.jsx)(r.Title,{className:"text-base font-semibold text-text-icon-neutral-primary",children:"New Project"}),(0,t.jsxs)("div",{className:"mt-4",children:[P?(0,t.jsx)("p",{className:"mb-3 text-sm text-text-icon-neutral-secondary",children:"Additional projects require an active subscription for this workspace."}):null,(0,t.jsx)("input",{type:"text",value:b,onChange:e=>w(e.target.value.slice(0,100)),onKeyDown:e=>{"Enter"===e.key&&S()},placeholder:"Project name",maxLength:100,autoFocus:!0,disabled:P,className:(0,m.cn)("w-full rounded-lg px-3 py-2","bg-background-neutral-soft border border-border-neutral-outline","text-sm text-text-icon-neutral-primary placeholder:text-text-icon-neutral-secondary","outline-none focus:border-border-brand-default",P&&"opacity-60 cursor-not-allowed")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-text-icon-neutral-secondary text-right",children:[b.length,"/",100]})]}),(0,t.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,t.jsx)(h.Button,{variant:"ghost",color:"neutral",size:"36",onClick:()=>x(!1),children:"Cancel"}),(0,t.jsx)(h.Button,{variant:"solid",color:"brand",size:"36",disabled:D.isPending||!P&&!b.trim(),onClick:P?I:S,children:D.isPending?"Creating...":P?"Upgrade":"Create"})]})]})]})}),(0,t.jsx)(i.UpgradeDialog,{open:j,paywallTrigger:"feature_gated",onOpenChange:E})]})}e.s(["CreateProjectDialog",()=>x],950248),e.i(563178);var v=e.i(911030),y=e.i(405330);function b({value:e,onChange:r,placeholder:a="Search by name (case-sensitive, starts with)…",className:n}){return(0,t.jsxs)("div",{className:(0,m.cn)("relative",n),children:[(0,t.jsx)(y.IconSearch,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-icon-neutral-secondary"}
1),(0,t.jsx)("input",{type:"text",value:e,onChange:e=>r(e.target.value),placeholder:a,"aria-label":"Search projects by name",maxLength:100,className:(0,m.cn)("w-full rounded-lg py-2 pl-9 pr-9 text-sm","bg-background-neutral-soft border border-border-neutral-outline","text-text-icon-neutral-primary placeholder:text-text-icon-neutral-secondary/70","outline-none focus:ring-2 focus:ring-text-icon-brand-default")}),e&&(0,t.jsx)("button",{type:"button",onClick:()=>r(""),"aria-label":"Clear search",className:(0,m.cn)("absolute right-2.5 top-1/2 -translate-y-1/2","text-text-icon-neutral-secondary hover:text-text-icon-neutral-primary transition-colors"),children:(0,t.jsx)(v.IconCloseBold,{className:"size-4"})})]})}e.s(["ProjectSearchInput",()=>b],809454)},804628,e=>{"use strict";var t=e.i(478790),r=e.i(291967),a=e.i(983318),n=e.i(186474),o=e.i(528275),s=e.i(24939),i=e.i(442106),l=e.i(357196),c=e.i(984571),d=e.i(901540),u=e.i(142889),p=e.i(614106),f=e.i(382029),m=e.i(894758),h=e.i(55717),g=e.i(190820),x=e.i(392240),v=e.i(312814),y=e.i(73772),b=e.i(896134),w=e.i(743265),j=["Enter"," "],E=["ArrowUp","PageDown","End"],k=["ArrowDown","PageUp","Home",...E],C={ltr:[...j,"ArrowRight"],rtl:[...j,"ArrowLeft"]},M={ltr:["ArrowLeft"],rtl:["ArrowRight"]},R="Menu",[_,N,T]=(0,i.createCollection)(R),[F,P]=(0,n.createContextScope)(R,[T,f.createPopperScope,g.createRovingFocusGroupScope]),I=(0,f.createPopperScope)(),D=(0,g.createRovingFocusGroupScope)(),[S,A]=F(R),[L,O]=F(R),U=e=>{let{__scopeMenu:r,open:a=!1,children:n,dir:o,onOpenChange:s,modal:i=!0}=e,c=I(r),[d,u]=t.useState(null),p=t.useRef(!1),m=(0,v.useCallbackRef)(s),h=(0,l.useDirection)(o);return t.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,w.jsx)(f.Root,{...c,children:(0,w.jsx)(S,{scope:r,open:a,onOpenChange:m,content:d,onContentChange:u,children:(0,w.jsx)(L,{scope:r,onClose:t.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:h,modal:i,children:n})})})};U.displayName=R;var B=t.forwardRef((e,t)=>{let{__scopeMenu:r,...a}=e,n=I(r);return(0,w.jsx)(f.Anchor,{...n,...a,ref:t})});B.displayName="MenuAnchor";var K="MenuPortal",[z,H]=F(K,{forceMount:void 0}),$=e=>{let{__scopeMenu:t,forceMount:r,children:a,container:n}=e,o=A(K,t);return(0,w.jsx)(z,{scope:t,forceMount:r,children:(0,w.jsx)(h.Presence,{present:r||o.open,children:(0,w.jsx)(m.Portal,{asChild:!0,container:n,children:a})})})};$.displayName=K;var W="MenuContent",[V,G]=F(W),q=t.forwardRef((e,t)=>{let r=H(W,e.__scopeMenu),{forceMount:a=r.forceMount,...n}=e,o=A(W,e.__scopeMenu),s=O(W,e.__scopeMenu);return(0,w.jsx)(_.Provider,{scope:e.__scopeMenu,children:(0,w.jsx)(h.Presence,{present:a||o.open,children:(0,w.jsx)(_.Slot,{scope:e.__scopeMenu,children:s.modal?(0,w.jsx)(X,{...n,ref:t}):(0,w.jsx)(Q,{...n,ref:t})})})})}),X=t.forwardRef((e,n)=>{let o=A(W,e.__scopeMenu),s=t.useRef(null),i=(0,a.useComposedRefs)(n,s);return t.useEffect(()=>{let e=s.current;if(e)return(0,y.hideOthers)(e)},[]),(0,w.jsx)(Z,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),Q=t.forwardRef((e,t)=>{let r=A(W,e.__scopeMenu);return(0,w.jsx)(Z,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Y=(0,x.createSlot)("MenuContent.ScrollLock"),Z=t.forwardRef((e,n)=>{let{__scopeMenu:o,loop:s=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEntryFocus:h,onEscapeKeyDown:x,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:j,onDismiss:C,disableOutsideScroll:M,...R}=e,_=A(W,o),T=O(W,o),F=I(o),P=D(o),S=N(o),[L,U]=t.useState(null),B=t.useRef(null),K=(0,a.useComposedRefs)(n,B,_.onContentChange),z=t.useRef(0),H=t.useRef(""),$=t.useRef(0),G=t.useRef(null),q=t.useRef("right"),X=t.useRef(0),Q=M?b.RemoveScroll:t.Fragment;t.useEffect(()=>()=>window.clearTimeout(z.current),[]),(0,d.useFocusGuards)();let Z=t.useCallback(e=>{var t,r;return q.current===G.current?.side&&(t=e,!!(r=G.current?.area)&&function(e,t){let{x:r,y:a}=e,n=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let s=t[e],i=t[o],l=s.x,c=s.y,d=i.x,u=i.y;c>a!=u>a&&r<(d-l)*(a-c)/(u-c)+l&&(n=!n)}return n}({x:t.clientX,y:t.clientY},r))},[]);return(0,w.jsx)(V,{scope:o,searchRef:H,onItemEnter:t.useCallback(e=>{Z(e)&&e.preventDefault()},[Z]),onItemLeave:t.useCallback(e=>{Z(e)||(B.current?.focus(),U(null))}
1,[Z]),onTriggerLeave:t.useCallback(e=>{Z(e)&&e.preventDefault()},[Z]),pointerGraceTimerRef:$,onPointerGraceIntentChange:t.useCallback(e=>{G.current=e},[]),children:(0,w.jsx)(Q,{...M?{as:Y,allowPinchZoom:!0}:void 0,children:(0,w.jsx)(u.FocusScope,{asChild:!0,trapped:i,onMountAutoFocus:(0,r.composeEventHandlers)(l,e=>{e.preventDefault(),B.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:(0,w.jsx)(c.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:x,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:j,onDismiss:C,children:(0,w.jsx)(g.Root,{asChild:!0,...P,dir:T.dir,orientation:"vertical",loop:s,currentTabStopId:L,onCurrentTabStopIdChange:U,onEntryFocus:(0,r.composeEventHandlers)(h,e=>{T.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,w.jsx)(f.Content,{role:"menu","aria-orientation":"vertical","data-state":eM(_.open),"data-radix-menu-content":"",dir:T.dir,...F,...R,ref:K,style:{outline:"none",...R.style},onKeyDown:(0,r.composeEventHandlers)(R.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,a=1===e.key.length;if(t){var n;let t,o,s,i,l,c;"Tab"===e.key&&e.preventDefault(),!r&&a&&(n=e.key,t=H.current+n,o=S().filter(e=>!e.disabled),s=document.activeElement,i=o.find(e=>e.ref.current===s)?.textValue,l=function(e,t,r){var a;let n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1,s=(a=Math.max(o,0),e.map((t,r)=>e[(a+r)%e.length]));1===n.length&&(s=s.filter(e=>e!==r));let i=s.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),t,i),c=o.find(e=>e.textValue===l)?.ref.current,function e(t){H.current=t,window.clearTimeout(z.current),""!==t&&(z.current=window.setTimeout(()=>e(""),1e3))}(t),c&&setTimeout(()=>c.focus()))}let o=B.current;if(e.target!==o||!k.includes(e.key))return;e.preventDefault();let s=S().filter(e=>!e.disabled).map(e=>e.ref.current);E.includes(e.key)&&s.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(s)}),onBlur:(0,r.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(z.current),H.current="")}),onPointerMove:(0,r.composeEventHandlers)(e.onPointerMove,eN(e=>{let t=e.target,r=X.current!==e.clientX;e.currentTarget.contains(t)&&r&&(q.current=e.clientX>X.current?"right":"left",X.current=e.clientX)}))})})})})})})});q.displayName=W;var J=t.forwardRef((e,t)=>{let{__scopeMenu:r,...a}=e;return(0,w.jsx)(s.Primitive.div,{role:"group",...a,ref:t})});J.displayName="MenuGroup";var ee=t.forwardRef((e,t)=>{let{__scopeMenu:r,...a}=e;return(0,w.jsx)(s.Primitive.div,{...a,ref:t})});ee.displayName="MenuLabel";var et="MenuItem",er="menu.itemSelect",ea=t.forwardRef((e,n)=>{let{disabled:o=!1,onSelect:i,...l}=e,c=t.useRef(null),d=O(et,e.__scopeMenu),u=G(et,e.__scopeMenu),p=(0,a.useComposedRefs)(n,c),f=t.useRef(!1);return(0,w.jsx)(en,{...l,ref:p,disabled:o,onClick:(0,r.composeEventHandlers)(e.onClick,()=>{let e=c.current;if(!o&&e){let t=new CustomEvent(er,{bubbles:!0,cancelable:!0});e.addEventListener(er,e=>i?.(e),{once:!0}),(0,s.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?f.current=!1:d.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),f.current=!0},onPointerUp:(0,r.composeEventHandlers)(e.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==u.searchRef.current;o||t&&" "===e.key||j.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ea.displayName=et;var en=t.forwardRef((e,n)=>{let{__scopeMenu:o,disabled:i=!1,textValue:l,...c}=e,d=G(et,o),u=D(o),p=t.useRef(null),f=(0,a.useComposedRefs)(n,p),[m,h]=t.useState(!1),[x,v]=t.useState("");return t.useEffect(()=>{let e=p.current;e&&v((e.textContent??"").trim())},[c.children]),(0,w.jsx)(_.ItemSlot,{scope:o,disabled:i,textValue:l??x,children:(0,w.jsx)(g.Item,{asChild:!0,...u,focusable:!i,children:(0,w.jsx)(s.Primitive.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...c,ref:f,onPointerMove:(0,r.composeEventHandlers)(e.onPointerMove,eN(e=>{i?d.onItemLeave(e):(d.onItemEnter(e),e.defaultPrevented||e.currentTarget.focu
1s({preventScroll:!0}))})),onPointerLeave:(0,r.composeEventHandlers)(e.onPointerLeave,eN(e=>d.onItemLeave(e))),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>h(!0)),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>h(!1))})})})}),eo=t.forwardRef((e,t)=>{let{checked:a=!1,onCheckedChange:n,...o}=e;return(0,w.jsx)(ef,{scope:e.__scopeMenu,checked:a,children:(0,w.jsx)(ea,{role:"menuitemcheckbox","aria-checked":eR(a)?"mixed":a,...o,ref:t,"data-state":e_(a),onSelect:(0,r.composeEventHandlers)(o.onSelect,()=>n?.(!!eR(a)||!a),{checkForDefaultPrevented:!1})})})});eo.displayName="MenuCheckboxItem";var es="MenuRadioGroup",[ei,el]=F(es,{value:void 0,onValueChange:()=>{}}),ec=t.forwardRef((e,t)=>{let{value:r,onValueChange:a,...n}=e,o=(0,v.useCallbackRef)(a);return(0,w.jsx)(ei,{scope:e.__scopeMenu,value:r,onValueChange:o,children:(0,w.jsx)(J,{...n,ref:t})})});ec.displayName=es;var ed="MenuRadioItem",eu=t.forwardRef((e,t)=>{let{value:a,...n}=e,o=el(ed,e.__scopeMenu),s=a===o.value;return(0,w.jsx)(ef,{scope:e.__scopeMenu,checked:s,children:(0,w.jsx)(ea,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":e_(s),onSelect:(0,r.composeEventHandlers)(n.onSelect,()=>o.onValueChange?.(a),{checkForDefaultPrevented:!1})})})});eu.displayName=ed;var ep="MenuItemIndicator",[ef,em]=F(ep,{checked:!1}),eh=t.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:a,...n}=e,o=em(ep,r);return(0,w.jsx)(h.Presence,{present:a||eR(o.checked)||!0===o.checked,children:(0,w.jsx)(s.Primitive.span,{...n,ref:t,"data-state":e_(o.checked)})})});eh.displayName=ep;var eg=t.forwardRef((e,t)=>{let{__scopeMenu:r,...a}=e;return(0,w.jsx)(s.Primitive.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});eg.displayName="MenuSeparator";var ex=t.forwardRef((e,t)=>{let{__scopeMenu:r,...a}=e,n=I(r);return(0,w.jsx)(f.Arrow,{...n,...a,ref:t})});ex.displayName="MenuArrow";var ev="MenuSub",[ey,eb]=F(ev),ew=e=>{let{__scopeMenu:r,children:a,open:n=!1,onOpenChange:o}=e,s=A(ev,r),i=I(r),[l,c]=t.useState(null),[d,u]=t.useState(null),m=(0,v.useCallbackRef)(o);return t.useEffect(()=>(!1===s.open&&m(!1),()=>m(!1)),[s.open,m]),(0,w.jsx)(f.Root,{...i,children:(0,w.jsx)(S,{scope:r,open:n,onOpenChange:m,content:d,onContentChange:u,children:(0,w.jsx)(ey,{scope:r,contentId:(0,p.useId)(),triggerId:(0,p.useId)(),trigger:l,onTriggerChange:c,children:a})})})};ew.displayName=ev;var ej="MenuSubTrigger",eE=t.forwardRef((e,n)=>{let o=A(ej,e.__scopeMenu),s=O(ej,e.__scopeMenu),i=eb(ej,e.__scopeMenu),l=G(ej,e.__scopeMenu),c=t.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:u}=l,p={__scopeMenu:e.__scopeMenu},f=t.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return t.useEffect(()=>f,[f]),t.useEffect(()=>{let e=d.current;return()=>{window.clearTimeout(e),u(null)}},[d,u]),(0,w.jsx)(B,{asChild:!0,...p,children:(0,w.jsx)(en,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":i.contentId,"data-state":eM(o.open),...e,ref:(0,a.composeRefs)(n,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:(0,r.composeEventHandlers)(e.onPointerMove,eN(t=>{l.onItemEnter(t),!t.defaultPrevented&&(e.disabled||o.open||c.current||(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100)))})),onPointerLeave:(0,r.composeEventHandlers)(e.onPointerLeave,eN(e=>{f();let t=o.content?.getBoundingClientRect();if(t){let r=o.content?.dataset.side,a="right"===r,n=t[a?"left":"right"],s=t[a?"right":"left"];l.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:n,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:n,y:t.bottom}],side:r}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(e),e.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,t=>{let r=""!==l.searchRef.current;e.disabled||r&&" "===t.key||C[s.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});eE.displayName=ej;
1var ek="MenuSubContent",eC=t.forwardRef((e,n)=>{let o=H(W,e.__scopeMenu),{forceMount:s=o.forceMount,...i}=e,l=A(W,e.__scopeMenu),c=O(W,e.__scopeMenu),d=eb(ek,e.__scopeMenu),u=t.useRef(null),p=(0,a.useComposedRefs)(n,u);return(0,w.jsx)(_.Provider,{scope:e.__scopeMenu,children:(0,w.jsx)(h.Presence,{present:s||l.open,children:(0,w.jsx)(_.Slot,{scope:e.__scopeMenu,children:(0,w.jsx)(Z,{id:d.contentId,"aria-labelledby":d.triggerId,...i,ref:p,align:"start",side:"rtl"===c.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:(0,r.composeEventHandlers)(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=M[c.dir].includes(e.key);t&&r&&(l.onOpenChange(!1),d.trigger?.focus(),e.preventDefault())})})})})})});function eM(e){return e?"open":"closed"}function eR(e){return"indeterminate"===e}function e_(e){return eR(e)?"indeterminate":e?"checked":"unchecked"}function eN(e){return t=>"mouse"===t.pointerType?e(t):void 0}eC.displayName=ek;var eT="DropdownMenu",[eF,eP]=(0,n.createContextScope)(eT,[P]),eI=P(),[eD,eS]=eF(eT),eA=e=>{let{__scopeDropdownMenu:r,children:a,dir:n,open:s,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,d=eI(r),u=t.useRef(null),[f,m]=(0,o.useControllableState)({prop:s,defaultProp:i??!1,onChange:l,caller:eT});return(0,w.jsx)(eD,{scope:r,triggerId:(0,p.useId)(),triggerRef:u,contentId:(0,p.useId)(),open:f,onOpenChange:m,onOpenToggle:t.useCallback(()=>m(e=>!e),[m]),modal:c,children:(0,w.jsx)(U,{...d,open:f,onOpenChange:m,dir:n,modal:c,children:a})})};eA.displayName=eT;var eL="DropdownMenuTrigger",eO=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:o=!1,...i}=e,l=eS(eL,n),c=eI(n);return(0,w.jsx)(B,{asChild:!0,...c,children:(0,w.jsx)(s.Primitive.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:(0,a.composeRefs)(t,l.triggerRef),onPointerDown:(0,r.composeEventHandlers)(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(l.onOpenToggle(),l.open||e.preventDefault())}),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{!o&&(["Enter"," "].includes(e.key)&&l.onOpenToggle(),"ArrowDown"===e.key&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});eO.displayName=eL;var eU=e=>{let{__scopeDropdownMenu:t,...r}=e,a=eI(t);return(0,w.jsx)($,{...a,...r})};eU.displayName="DropdownMenuPortal";var eB="DropdownMenuContent",eK=t.forwardRef((e,a)=>{let{__scopeDropdownMenu:n,...o}=e,s=eS(eB,n),i=eI(n),l=t.useRef(!1);return(0,w.jsx)(q,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:a,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:(0,r.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,a=2===t.button||r;(!s.modal||a)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eK.displayName=eB;var ez=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(J,{...n,...a,ref:t})});ez.displayName="DropdownMenuGroup";var eH=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(ee,{...n,...a,ref:t})});eH.displayName="DropdownMenuLabel";var e$=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(ea,{...n,...a,ref:t})});e$.displayName="DropdownMenuItem";var eW=t.forwardRef((e,t)=>
1{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(eo,{...n,...a,ref:t})});eW.displayName="DropdownMenuCheckboxItem";var eV=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(ec,{...n,...a,ref:t})});eV.displayName="DropdownMenuRadioGroup";var eG=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(eu,{...n,...a,ref:t})});eG.displayName="DropdownMenuRadioItem";var eq=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(eh,{...n,...a,ref:t})});eq.displayName="DropdownMenuItemIndicator";var eX=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(eg,{...n,...a,ref:t})});eX.displayName="DropdownMenuSeparator",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(ex,{...n,...a,ref:t})}).displayName="DropdownMenuArrow";var eQ=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(eE,{...n,...a,ref:t})});eQ.displayName="DropdownMenuSubTrigger";var eY=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...a}=e,n=eI(r);return(0,w.jsx)(eC,{...n,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eY.displayName="DropdownMenuSubContent";var eZ=e=>{let{__scopeDropdownMenu:t,children:r,open:a,onOpenChange:n,defaultOpen:s}=e,i=eI(t),[l,c]=(0,o.useControllableState)({prop:a,defaultProp:s??!1,onChange:n,caller:"DropdownMenuSub"});return(0,w.jsx)(ew,{...i,open:l,onOpenChange:c,children:r})};e.s(["CheckboxItem",()=>eW,"Content",()=>eK,"Group",()=>ez,"Item",()=>e$,"ItemIndicator",()=>eq,"Label",()=>eH,"Portal",()=>eU,"RadioGroup",()=>eV,"RadioItem",()=>eG,"Root",()=>eA,"Separator",()=>eX,"Sub",()=>eZ,"SubContent",()=>eY,"SubTrigger",()=>eQ,"Trigger",()=>eO],804628)},215187,e=>{"use strict";var t=e.i(478790);function r(e,r){let[a,n]=(0,t.useState)(!1),o=(0,t.useRef)(!1),s=r?.root,i=r?.rootMargin??"0px",l=r?.once;return(0,t.useEffect)(()=>{if(l&&o.current)return;let t=e.current;if(!t)return;let r=new IntersectionObserver(([e])=>{e&&(e.isIntersecting?(n(!0),l&&(o.current=!0,r.disconnect())):l||n(!1))},{rootMargin:i,root:s?.current??null});return r.observe(t),()=>r.disconnect()},[e,i,l,s]),a}e.s(["useInViewport",()=>r])},110621,e=>{"use strict";var t=e.i(478790);function r(e,r){let[a,n]=(0,t.useState)(e);return(0,t.useEffect)(()=>{let t=setTimeout(()=>{n(e)},r);return()=>{clearTimeout(t)}},[e,r]),a}e.s(["useDebounce",()=>r])},575592,e=>{"use strict";var t=e.i(55769),r=e.i(834486),a=e.i(478790),n=e.i(272842);let o=(e,t)=>[t,"metadata",e],s=()=>{let e=(0,r.useQueryClient)();return(0,a.useCallback)(async(t,r)=>e.fetchQuery({queryKey:o(t,r),queryFn:async()=>await (0,n.getMediaMetadata)({mediaUrl:t,mediaType:r})}),[e])};e.s(["useFetchImageMetadata",0,()=>{let e=s();return(0,a.useCallback)(t=>e(t,"image"),[e])},"useFetchMediaMetadata",0,s,"useMediaMetadata",0,(e,r)=>(0,t.useQuery)({queryKey:o(e??"",r),queryFn:async()=>await (0,n.getMediaMetadata)({mediaUrl:e??"",mediaType:r}),enabled:!!e})])},6677,e=>{"use strict";var t=e.i(186801),r=e.i(478790),a=e.i(856609),n=e.i(368709);let o={all:["world-resources"],type:e=>["world-resources",e],list:(e,t,r)=>["world-resources",e,...t?[t]:[],...r?[{projectId:r}]:[]]},s={photo:"/api/world/photo",pano:"/api/world/pano","prompt-image":"/api/world/prompt-image"};function i(e,i){let{worldId:l,projectId:c,limit:d=20,enabled:u=!0}=i??{},{projectId:p}=(0,a.useProjectContext)(),f=c??p,m=(0,t.useInfiniteQuery)({queryKey:o.list(e,l,f),queryFn:({pageParam:t,signal:r})=>(0,n.get)([s[e],{worldId:l,projectId:f,limit:d,cursor:t}],{signal:r}),getNextPageParam:e=>e.hasMore?e.nextCursor:void 0,initialPageParam:void 0,enabled:u,staleTime:3e4});return{data:(0,r.useMemo)(()=>m.data?.pages.flatMap(e=>e.resources)??[],[m.data]),isLoading:m.isLoading,hasNextPage:m.hasNextPage,isFetchingNextPage:m.isFetchingNextPage,fetchNextPage:m.fetchNextPage}}function l(e){let{worldId:i,projectId:l,limit:c=20,enabled:d=!0}=e??{},{projectId:u}=(0,a.useProjectContext)(),p=l??u,f=(0,t.useInfiniteQuery)({queryKey:o.list("prompt-image",i,p),queryFn:({pageParam:e,signal:t})=>(0,n.get)([s["prompt-image"],{worldId:i,projectId:p,limit:c,cursor:e}],{signal:t}),getNextPageParam:e=>e.hasMore?e.nextCursor:void 0,initialPageParam:void 0,enabled:d,staleTime:3e4});return{data:(0,r.useMemo)(()=>f.data?.pages.flatMap(e=>e.promptImages)??[],[f.data]),isLoading:f.isLoading,hasNextPage:f.hasNextPage,isFetchingNextPage:f.isFetchingNextPage,fetchNextPage:f.fetchNextPage}}e.s(["useWorldImageResources",()=>i,"useWorldPromptImages",()=>
1l,"worldResourceKeys",0,o])},323020,828027,e=>{"use strict";var t,r;(r=t||(t={})).LOAD="LOAD",r.EXEC="EXEC",r.FFPROBE="FFPROBE",r.WRITE_FILE="WRITE_FILE",r.READ_FILE="READ_FILE",r.DELETE_FILE="DELETE_FILE",r.RENAME="RENAME",r.CREATE_DIR="CREATE_DIR",r.LIST_DIR="LIST_DIR",r.DELETE_DIR="DELETE_DIR",r.ERROR="ERROR",r.DOWNLOAD="DOWNLOAD",r.PROGRESS="PROGRESS",r.LOG="LOG",r.MOUNT="MOUNT",r.UNMOUNT="UNMOUNT",e.s(["CORE_URL",0,"https://unpkg.com/@ffmpeg/[email protected]/dist/umd/ffmpeg-core.js","FFMessageType",()=>t],323020);let a=Error("unknown message type"),n=Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"),o=Error("called FFmpeg.terminate()"),s=Error("failed to import ffmpeg-core.js");e.s(["ERROR_IMPORT_FAILURE",0,s,"ERROR_NOT_LOADED",0,n,"ERROR_TERMINATED",0,o,"ERROR_UNKNOWN_MESSAGE_TYPE",0,a],828027)},921806,e=>{e.v("/suite/_next/static/media/worker.c47db340.js")},244516,e=>{e.v(e.b(["static/chunks/8b58c439b9b7e35e.js","static/chunks/turbopack-2bf67e6dd0d739b1.js"]))},992140,524865,e=>{"use strict";let t;Error("failed to get response body reader"),Error("failed to complete download");let r=async e=>{let t;if("string"==typeof e)t=/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e)?atob(e.split(",")[1]).split("").map(e=>e.charCodeAt(0)):await (await fetch(e)).arrayBuffer();else if(e instanceof URL)t=await (await fetch(e)).arrayBuffer();else{if(!(e instanceof File||e instanceof Blob))return new Uint8Array;t=await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>{let{result:e}=a;e instanceof ArrayBuffer?t(new Uint8Array(e)):t(new Uint8Array)},a.onerror=e=>{r(Error(`File could not be read! Code=${e?.target?.error?.code||-1}`))},a.readAsArrayBuffer(e)})}return new Uint8Array(t)};e.s(["fetchFile",0,r],992140);var a,n,o=e.i(323020);let s=(t=0,()=>t++);var i=e.i(828027);let l={get url(){return`file://${e.P("node_modules/.pnpm/@[email protected]/node_modules/@ffmpeg/ffmpeg/dist/esm/classes.js")}`}};class c{#e=null;#t={};#r={};#a=[];#n=[];loaded=!1;#o=()=>{this.#e&&(this.#e.onmessage=({data:{id:e,type:t,data:r}})=>{switch(t){case o.FFMessageType.LOAD:this.loaded=!0,this.#t[e](r);break;case o.FFMessageType.MOUNT:case o.FFMessageType.UNMOUNT:case o.FFMessageType.EXEC:case o.FFMessageType.FFPROBE:case o.FFMessageType.WRITE_FILE:case o.FFMessageType.READ_FILE:case o.FFMessageType.DELETE_FILE:case o.FFMessageType.RENAME:case o.FFMessageType.CREATE_DIR:case o.FFMessageType.LIST_DIR:case o.FFMessageType.DELETE_DIR:this.#t[e](r);break;case o.FFMessageType.LOG:this.#a.forEach(e=>e(r));break;case o.FFMessageType.PROGRESS:this.#n.forEach(e=>e(r));break;case o.FFMessageType.ERROR:this.#r[e](r)}delete this.#t[e],delete this.#r[e]})};#s=({type:e,data:t},r=[],a)=>this.#e?new Promise((n,o)=>{let i=s();this.#e&&this.#e.postMessage({id:i,type:e,data:t},r),this.#t[i]=n,this.#r[i]=o,a?.addEventListener("abort",()=>{o(new DOMException(`Message # ${i} was aborted`,"AbortError"))},{once:!0})}):Promise.reject(i.ERROR_NOT_LOADED);on(e,t){"log"===e?this.#a.push(t):"progress"===e&&this.#n.push(t)}off(e,t){"log"===e?this.#a=this.#a.filter(e=>e!==t):"progress"===e&&(this.#n=this.#n.filter(e=>e!==t))}load=({classWorkerURL:t,...r}={},{signal:a}={})=>(this.#e||(this.#e=t?new Worker(new URL(t,l.url),{type:"module"}):new Worker(e.r(244516),{type:"module",type:void 0}),this.#o()),this.#s({type:o.FFMessageType.LOAD,data:r},void 0,a));exec=(e,t=-1,{signal:r}={})=>this.#s({type:o.FFMessageType.EXEC,data:{args:e,timeout:t}},void 0,r);ffprobe=(e,t=-1,{signal:r}={})=>this.#s({type:o.FFMessageType.FFPROBE,data:{args:e,timeout:t}},void 0,r);terminate=()=>{for(let e of Object.keys(this.#r))this.#r[e](i.ERROR_TERMINATED),delete this.#r[e],delete this.#t[e];this.#e&&(this.#e.terminate(),this.#e=null,this.loaded=!1)};writeFile=(e,t,{signal:r}={})=>{let a=[];return t instanceof Uint8Array&&a.push(t.buffer),this.#s({type:o.FFMessageType.WRITE_FILE,data:{path:e,data:t}},a,r)};mount=(e,t,r)=>this.#s({type:o.FFMessageType.MOUNT,data:{fsType:e,options:t,mountPoint:r}},[]);unmount=e=>this.#s({type:o.FFMessageType.UNMOUNT,data:{mountPoint:e}},[]);readFile=(e,t="binary",{signal:r}={})=>this.#s({type:o.FFMessageType.READ_FILE,data:{path:e,encoding:t}},void 0,r);deleteFile=(e,{signal:t}={})=>this.#s({type:o.FFMessageType.DELETE_FILE,data:{path:e}},void 0,t);rename=(e,t,{signal:r}={})=>this.#s({type:o.FFMessageType.RENAME,data:{oldPath:e,newPath:t}},void 0,r);createDir=(e,{signal:t}={})=>this.#s({type:o.FFMessageType.CREATE_DIR,data:{path:e}},void 0,t);listDir=(e,{signal:t}={})=>this.#s({type:o.FFMessageType.LIST_DIR,data:{path:e}},void 0,t);deleteDir=(e,{signal:t}={})=>this.#s({type:o.FFMessageType.DELETE_DIR,data:{path:e}},void 0,t)}(a=n||(n={})).MEMFS="MEMFS",a.NODEFS="NODEFS",a.NODERAWFS="NODERAWFS",a.IDBFS="IDBFS",a.WORKERFS="WORKERFS",a.PROXYFS="PROXYFS";let d=null,u=null;function p(){d&&(d.terminate(),d=null),u=null}async function f(){if(d)return d;if(u)return u;u=(async()=>{let e=new c;return await e.load(),d=e,e})();try{return await u}catch{throw u=null,Error("Failed to load FFmpeg")}}let m=Promise.resolve();async function h(e){let t=m,r=()=>{};m=new Promise(e=>{r=e}),await t;try{let t=await f();return await e(t)}finally{p(),r()}}e.s(["getFfmpeg",()=>f,"resetFfmpeg",()=>p,"withFfmpegLock",()=>h],524865)},413015,e=>{"use strict";e.s(["pauseAllAudios",0,e=>{document.querySelectorAll("audio").forEach(t=>{t.paused||t.ended||t===e||t.pause()})}])},358732,e=>{"use strict";
1var t=e.i(743265),r=e.i(647163);let a=e=>{let t=e.replace(/^#/,""),r=3===t.length?t.split("").map(e=>e+e).join(""):t;return[Number.parseInt(r.substring(0,2),16),Number.parseInt(r.substring(2,4),16),Number.parseInt(r.substring(4,6),16)]},n=(e,t,r)=>e+(t-e)*r;function o({progress:e=0,progressStart:o=0,isLoaded:s=!1,waveformData:i,barCount:l=125,minHeight:c=4,maxHeight:d=46,containerHeight:u=46,activeBarClassName:p,inactiveBarClassName:f,useGradient:m=!0,activeGradient:h,className:g}){let x=h?a(h.from):null,v=h?a(h.to):null,y=Array.from({length:l},(t,r)=>{let a;if(!s)return{height:c,isActive:!1};a=i&&void 0!==i[r]?c+(d-c)*i[r]:c+(d-c)*Math.min(1,.4+(.35*Math.abs(Math.sin(.15*r))+.25*Math.abs(Math.cos(.08*r))+.2*Math.abs(Math.sin(.3*r))+.15*(.5*Math.sin(1.7*r)+.5)));let n=r/l*100;return{height:Math.max(c,Math.min(a,d)),isActive:n<e&&n>=o}});return(0,t.jsx)("div",{className:(0,r.cn)("flex items-center gap-[2px] w-full",g),style:{height:`${u}px`},children:y.map((e,a)=>{let o;if(!s)return(0,t.jsx)("div",{className:(0,r.cn)("rounded-[14px]",f||"bg-text-icon-neutral-default"),style:{width:"2px",height:`${c}px`,flexShrink:0}},`bar-${a}`);let i="rounded-full transition-colors flex-1";if(e.isActive)if(x&&v){let e;e=Math.min(1,Math.max(0,a/Math.max(1,l-1))),o=`rgb(${Math.round(n(x[0],v[0],e))}, ${Math.round(n(x[1],v[1],e))}, ${Math.round(n(x[2],v[2],e))})`}else if(m){let e=a/l;o=`hsl(${160+140*e}, 80%, 65%)`}else i=p?(0,r.cn)(i,p):(0,r.cn)(i,"bg-white/95");else i=f?(0,r.cn)(i,f):(0,r.cn)(i,"bg-white/20");return(0,t.jsx)("div",{className:i,style:{height:`${e.height}px`,backgroundColor:o}},`bar-${a}`)})})}e.s(["AUDIO_WAVE_PLAYED_BAR_CLASSNAME",0,"bg-[hsl(300,80%,65%)]","AudioWave",()=>o])},155289,e=>{"use strict";var t=e.i(992140),r=e.i(524865);async function a(e,n="recording"){let o=Date.now(),s=c(e.type)||"webm",i=`record_${o}.${s}`,l=`record_${o}.mp3`;return(0,r.withFfmpegLock)(async r=>{try{let a=await (0,t.fetchFile)(e),s=a instanceof Uint8Array?a:new Uint8Array(a);await r.writeFile(i,s);let c=await r.exec(["-i",i,"-vn","-c:a","libmp3lame","-q:a","2",l]);if(0!==c)throw Error(`FFmpeg mp3 encode failed (code ${c})`);let d=await r.readFile(l),u=d instanceof Uint8Array?new Uint8Array(d):new TextEncoder().encode(d);return new File([u],`${n}-${o}.mp3`,{type:"audio/mpeg"})}finally{await r.deleteFile(i).catch(()=>{}),await r.deleteFile(l).catch(()=>{})}})}function n(){let e=window.AudioContext||window.webkitAudioContext;if(!e)throw Error("Audio encoding is not supported in this browser.");return e}function o(e){try{let t=new(n());"suspended"===t.state&&t.resume().catch(()=>{});let r=t.createAnalyser();return r.fftSize=512,r.smoothingTimeConstant=.65,t.createMediaStreamSource(e).connect(r),{audioContext:t,analyser:r,buffer:new Uint8Array(r.fftSize)}}catch{return null}}async function s(e){let t,r=await e.arrayBuffer(),a=new(n());try{t=await a.decodeAudioData(r)}finally{await a.close()}let o=new OfflineAudioContext(1,Math.max(1,Math.ceil(16e3*t.duration)),16e3),s=o.createBufferSource();return s.buffer=t,s.connect(o.destination),s.start(),function(e,t){let r=2*e.length,a=new DataView(new ArrayBuffer(44+r)),n=(e,t)=>{for(let r=0;r<t.length;r++)a.setUint8(e+r,t.charCodeAt(r))};n(0,"RIFF"),a.setUint32(4,36+r,!0),n(8,"WAVE"),n(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,16e3,!0),a.setUint32(28,32e3,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),n(36,"data"),a.setUint32(40,r,!0);let o=44;for(let t of e){let e=Math.max(-1,Math.min(1,t));a.setInt16(o,e<0?32768*e:32767*e,!0),o+=2}return new Blob([a],{type:"audio/wav"})}((await o.startRendering()).getChannelData(0),0)}function i(e){return new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(String(a.result??"").split(",")[1]??""),a.onerror=r,a.readAsDataURL(e)})}function l(){for(let e of["audio/mp4","audio/aac","audio/wav","audio/webm;codecs=opus","audio/webm"])if(MediaRecorder.isTypeSupported(e))return console.log(`Using audio recording format: ${e}`),e;return console.warn("No supported audio format found, using fallback"),"audio/mp4"}function c(e){return e.includes("mp3")||e.includes("mpeg")?"mp3":e.includes("mp4")||e.includes("aac")?"m4a":e.includes("ogg")?"ogg":e.includes("wav")?"wav":(e.includes("webm"),"webm")}function d(e){let t=Math.round(e),r=Math.floor(t/60);return`${r.toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`}async function u(e,t=75,r=3){let a=await e.arrayBuffer(),n=new AudioContext,o=(await n.decodeAudioData(a)).getChannelData(0),s=Math.floor(o.length/t),i=[];for(let e=0;e<t;e++){let t=s*e,a=0;for(let e=0;e<s;e++)a+=Math.abs(o[t+e]);let n=a/s;i.push(Math.min(n*r,1))}return await n.close(),i}e.s(["analyzeAudioBlobForWaveform",()=>u,"blobToBase64",()=>i,"blobToWav16kMono",()=>s,"createAmplitudeAnalyser",()=>o,"encodeBlobToMp3",()=>a,"formatTime",()=>d,"getAudioFileExtension",()=>
1c,"getSupportedAudioMimeType",()=>l])},327286,e=>{"use strict";var t=e.i(642558);let r={image:"image",video:"video",audio:"audio",character:"character","3d_world":"world"};function a(e,a,n){let o=r[a.resourceType];o&&(0,t.event)("asset_engaged",{action:e,click_source:n,...{asset_type:o,asset_id:a.id}})}e.s(["ResourceAnalytics",0,{trackAssetDownload(e,t){a("download",e,t)},trackAssetShare(e,t){a("share",e,t)},trackAssetFavourite(e,t){a("favourite",e,t)},trackCancelFavourite(e,t){a("cancel_favourite",e,t)},trackAssetDelete(e,t){a("delete",e,t)},trackAddToCollection(e,t){a("add_label",e,t)},trackAddToFolder(e,t){a("add_to_folder",e,t)},trackMoveToProject(e,t){a("move_to_project",e,t)},trackCopyToProject(e,t){a("copy_to_project",e,t)},trackSaveToBrandKit(e,t){a("save_to_brand_kit",e,t)},trackAssetSelected(e,t){a("selected",e,t)},trackGrabFrame(e,t){a("grab_a_frame",e,t)},trackDownloadFrame(e,t){a("grab_download_frame",e,t)},trackGrabImageToVideo(e,t){a("grab_image_to_video",e,t)},trackRecreateVideo(e,t){a("recreate",e,t)},trackRecreateImage(e,t){a("recreate",e,t)},trackUpscaleVideo(e,t){a("upscale",e,t)},trackUpscaleImage(e,t){a("upscale",e,t)},trackModifyVideo(e,t){a("edit",e,t)},trackEditImage(e,t){a("edit",e,t)},trackImageToVideo(e,t){a("image_to_video",e,t)},trackExpandImage(e,t){a("expand_image",e,t)},trackChangeBackground(e,t){a("change_image_background",e,t)},trackReferenceImage(e,t){a("reference_image",e,t)},trackVideoReference(e,t){a("video_reference",e,t)},trackImageVariations(e,t){a("image_variations",e,t)},trackChangeCameraAngle(e,t){a("change_camera_angle",e,t)},trackCheckIpSafety(e,t){a("check_ip_safety",e,t)},track3dWorldCam(e,t){a("3d_world_cam",e,t)},trackCastInScene(e,t){a("cast_in_scene",e,t)},trackWorldAlbum(e,t){a("world_album",e,t)},trackRecreateAudio(e,t){a("recreate",e,t)},trackCloneVoice(e,t){a("clone_voice",e,t)},trackChangeVoice(e,t){a("change_voice",e,t)},trackLipSyncVideo(e,t){a("lip_sync_video",e,t)},trackDubVideo(e,t){a("dub_video",e,t)},trackRecreateWorld(e,t){a("recreate",e,t)},trackAudioPlay(e,t){a("audio_play",e,t)}}])},991556,e=>{"use strict";var t=e.i(743265);e.i(563178);var r=e.i(97635);function a(e){return"image"===e.resourceType&&e.generation?.featureId==="topaz-lab:image-upscale"&&!!e.thumbnailUrl&&e.thumbnailUrl===e.url}e.s(["MediaTooLargeToPreview",0,({compact:e})=>e?(0,t.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 p-2 text-center",children:[(0,t.jsx)(r.IconInfoCircle,{className:"size-5 text-text-icon-neutral-tertiary"}),(0,t.jsx)("span",{className:"text-label-small text-text-icon-neutral-secondary",children:"Too large to preview"})]}):(0,t.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,t.jsx)(r.IconInfoCircle,{className:"size-8 text-text-icon-neutral-tertiary"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-label-large text-text-icon-neutral-primary",children:"This image is too large to preview"}),(0,t.jsx)("span",{className:"text-label-medium text-text-icon-neutral-secondary",children:"Download it to view the full-resolution result."})]})]}),"isImageTooLargeToPreview",()=>a])},914589,e=>{"use strict";var t=e.i(478790),r=e.i(413015);function a(e){let[a,n]=(0,t.useState)(!1),[o,s]=(0,t.useState)(0),[i,l]=(0,t.useState)(0);return(0,t.useEffect)(()=>{if(!e?.current)return;let t=e.current,r=()=>n(!0),a=()=>n(!1),o=()=>n(!1),i=()=>s(t.currentTime),c=()=>l(t.duration);return t.addEventListener("play",r),t.addEventListener("pause",a),t.addEventListener("ended",o),t.addEventListener("timeupdate",i),t.addEventListener("loadedmetadata",c),t.duration&&l(t.duration),()=>{t.removeEventListener("play",r),t.removeEventListener("pause",a),t.removeEventListener("ended",o),t.removeEventListener("timeupdate",i),t.removeEventListener("loadedmetadata",c)}},[e]),{isAudioPlaying:a,currentTime:o,duration:i,handleAudioPlayPause:()=>{e?.current&&(a?e.current.pause():((0,r.pauseAllAudios)(e.current),e.current.play().catch(e=>{console.error("Failed to play audio",e)})))}}}e.s(["useAudioPlayer",()=>a])},964359,e=>{"use strict";
1var t=e.i(743265),r=e.i(281664),a=e.i(478790),n=e.i(327286),o=e.i(358732),s=e.i(991556),i=e.i(914589),l=e.i(155289);e.i(563178);var c=e.i(954629),d=e.i(276810);let u=({src:e})=>(0,t.jsxs)("div",{className:"relative size-full flex items-center justify-center overflow-hidden",children:[(0,t.jsx)("img",{src:e,alt:"","aria-hidden":!0,className:"absolute inset-0 size-full object-cover blur-[20px] scale-110"}),(0,t.jsx)("img",{src:e,alt:"Preview",className:"relative max-w-full max-h-full object-contain"})]}),p=e=>{let t=Math.floor(e/60),r=Math.floor(e%60);return`${t}:${r.toString().padStart(2,"0")}`},f=({item:e})=>{let s=(0,a.useRef)(null),u=(0,a.useRef)(null),{isAudioPlaying:f,currentTime:m,duration:h,handleAudioPlayPause:g}=(0,i.useAudioPlayer)(s),[x,v]=(0,a.useState)([]),[y,b]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!e.url)return;let t=new AbortController;return fetch(e.url,{signal:t.signal}).then(e=>e.blob()).then(e=>(0,l.analyzeAudioBlobForWaveform)(e,100,3)).then(e=>{v(e),b(!0)}).catch(e=>{e instanceof DOMException&&"AbortError"===e.name||b(!0)}),()=>{t.abort()}},[e.url]);let w=h>0?m/h*100:0,j=(0,a.useCallback)(e=>{if(!s.current||!u.current||h<=0)return;let t=u.current.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));s.current.currentTime=r*h},[h]),E=(0,a.useCallback)(e=>{if(!s.current||h<=0)return;let t=s.current;switch(e.key){case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(0,t.currentTime-5);break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(h,t.currentTime+5);break;case"Home":e.preventDefault(),t.currentTime=0;break;case"End":e.preventDefault(),t.currentTime=h}},[h]);return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center w-full h-full gap-6 md:gap-8 p-4",children:[(0,t.jsx)("audio",{ref:s,src:e.url,preload:"metadata"}),(0,t.jsxs)("div",{className:"relative w-36 h-36 sm:w-44 sm:h-44 md:w-48 md:h-48 rounded-2xl border border-border-fixed-black-outline overflow-hidden shrink-0 shadow-lg",children:[(0,t.jsx)(r.default,{unoptimized:!0,src:"https://cdn.openart.ai/assets/internal/uploads/image_HkLCMd2L_516x516_1770004617316.webp",alt:"Audio cover",fill:!0,className:"object-cover",loading:"lazy"}),(0,t.jsx)("button",{type:"button",onClick:()=>{f||n.ResourceAnalytics.trackAudioPlay(e,"asset_detail"),g()},"aria-label":f?"Pause":"Play",className:"absolute inset-0 flex items-center justify-center bg-background-fixed-black-soft hover:bg-background-fixed-black-soft-hover transition-colors",children:f?(0,t.jsx)(c.IconPauseFill,{className:"size-14 text-text-icon-fixed-white-default drop-shadow-lg"}):(0,t.jsx)(d.IconPlayFill,{className:"size-14 text-text-icon-fixed-white-default drop-shadow-lg"})})]}),(0,t.jsxs)("div",{className:"w-full max-w-md flex flex-col gap-3",children:[(0,t.jsx)("div",{ref:u,role:"slider",tabIndex:0,"aria-label":"Seek audio","aria-valuenow":Math.round(w),"aria-valuemin":0,"aria-valuemax":100,onClick:j,onKeyDown:E,className:"cursor-pointer",children:(0,t.jsx)(o.AudioWave,{progress:w,isLoaded:y,waveformData:x,barCount:100,containerHeight:52,minHeight:4,maxHeight:48})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[12px] text-text-icon-neutral-secondary",children:[(0,t.jsx)("span",{children:p(m)}),(0,t.jsx)("span",{children:h>0?p(h):"--:--"})]})]})]})};e.s(["DefaultPreview",0,({item:e})=>{let r=e.resourceType||"image";return"video"===r?(0,t.jsx)("video",{src:e.url,autoPlay:!0,playsInline:!0,controls:!0,className:"max-w-full max-h-full object-contain"}):"audio"===r?(0,t.jsx)(f,{item:e}):"3d_world"===r?(0,t.jsx)(u,{src:e.thumbnailUrl??e.url}):(0,s.isImageTooLargeToPreview)(e)?(0,t.jsx)(s.MediaTooLargeToPreview,{}):(0,t.jsx)("img",{src:e.url,alt:"Preview",className:"max-w-full max-h-full object-contain"})}])},294324,e=>{"use strict";var t=e.i(743265),r=e.i(478790),a=e.i(209751),n=e.i(96673),o=e.i(647163);e.i(563178);var s=e.i(535259),i=e.i(155514),l=e.i(263151),c=e.i(29314),d=e.i(343159),u=e.i(506166);let p="https://cdn.openart.ai/assets/internal/uploads/image_tkxF149w_800x800_1770434103968.webp",f="max-h-[calc(100dvh-2rem)] max-w-[calc(100dvw-2rem)]";function m(e){let t=Math.floor(e/60),r=Math.floor(e%60);return`${t}:${String(r).padStart(2,"0")}`}function h({src:e,name:r}){return(0,t.jsx)("div",{className:"w-[248px] rounded-2xl bg-background-container-overlay-base border border-border-container-overlay-base p-1 shadow-[0_9px_64px_rgba(0,0,0,0.45)]",children:(0,t.jsxs)("div",{className:"relative w-[240px] h-[240px] rounded-xl overflow-hidden",children:[(0,t.jsx)("img",{src:e,alt:"",className:"size-full object-cover"}),(0,t.jsxs)("span",{"data-notranslate":!0,className:"absolute bottom-[6px] left-[8px] text-[13px] font-medium leading-5 text-text-icon-fixed-white-high-contrast drop-shadow-[0_1px_3px_rgba(0,0,0,0.8)]",children:["@",r]})]})})}function g({src:e,name:a}){let n=(0,r.useRef)(null),[o,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>(n.current?.play().catch(()=>{}),()=>{n.current?.pause()}),[]),(0,t.jsx)("div",{className:"w-[248px] rounded-2xl bg-background-container-overlay-base border border-border-container-overlay-base p-1 shadow-[0_9px_64px_rgba(0,0,0,0.45)]",children:(0,t.jsxs)("div",{className:"relative w-[240px] h-[240px] rounded-xl overflow-hidden",children:[(0,t.jsx)("video",{ref:n,src:e,className:"size-full object-cover",muted:!0,loop:!0,playsInl
1ine:!0,preload:"metadata",onLoadedMetadata:e=>s(e.currentTarget.duration)}),(0,t.jsxs)("div",{className:"absolute bottom-[6px] left-[8px] right-[8px] flex items-end justify-between",children:[(0,t.jsxs)("span",{"data-notranslate":!0,className:"text-[13px] font-medium leading-5 text-text-icon-fixed-white-high-contrast drop-shadow-[0_1px_3px_rgba(0,0,0,0.8)]",children:["@",a]}),o>0&&(0,t.jsxs)("span",{className:"flex items-center gap-[3px] rounded-lg bg-fixed-black-surface-active backdrop-blur-[6px] px-1.5 py-0.5 text-[13px] font-medium leading-5 text-text-icon-fixed-white-high-contrast",children:[(0,t.jsx)(c.IconVideoBold,{className:"size-4"}),m(o)]})]})]})})}function x({src:e,name:a}){let n=(0,r.useRef)(null),[o,l]=(0,r.useState)(!1),[c,d]=(0,r.useState)(0),[u,p]=(0,r.useState)(0),f=(0,r.useCallback)(e=>{e.stopPropagation();let t=n.current;t&&(o?t.pause():t.play().catch(()=>{}))},[o]),h=(0,r.useCallback)(e=>{let t=n.current;if(!t||!u)return;let r=e.currentTarget.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width))*u},[u]);(0,r.useEffect)(()=>()=>{n.current?.pause()},[]);let g=u>0?c/u*100:0;return(0,t.jsxs)("div",{className:"w-[248px] rounded-2xl bg-background-container-overlay-base border border-border-container-overlay-base p-1 shadow-[0_9px_64px_rgba(0,0,0,0.45)] flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"px-2 py-1.5",children:(0,t.jsxs)("span",{"data-notranslate":!0,className:"text-[13px] font-medium leading-5 text-text-icon-fixed-white-high-contrast",children:["@",a]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-background-container-overlay-surface-raised p-2",children:[(0,t.jsx)("audio",{ref:n,src:e,preload:"metadata",onLoadedMetadata:e=>p(e.currentTarget.duration),onTimeUpdate:e=>d(e.currentTarget.currentTime),onPlay:()=>l(!0),onPause:()=>l(!1),onEnded:()=>l(!1)}),(0,t.jsx)("button",{type:"button",onClick:f,className:"shrink-0 rounded-lg bg-background-neutral-solid-high-contrast p-2",children:o?(0,t.jsx)(s.IconPauseBold,{className:"size-4 text-text-icon-neutral-solid-high-contrast"}):(0,t.jsx)(i.IconPlayBold,{className:"size-4 text-text-icon-neutral-solid-high-contrast"})}),(0,t.jsxs)("span",{className:"shrink-0 text-xs font-medium leading-4 text-text-icon-neutral-primary whitespace-nowrap",children:[m(c)," / ",m(u)]}),(0,t.jsx)("div",{className:"flex-1 h-1 min-w-0 cursor-pointer rounded-full bg-background-neutral-soft",onClick:h,children:(0,t.jsx)("div",{className:"h-full rounded-full bg-text-icon-neutral-primary transition-[width] duration-100",style:{width:`${g}%`}})})]})]})}function v({src:e}){let a=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{a.current?.pause()},[]),(0,t.jsx)("div",{className:(0,o.cn)("flex min-w-0 min-h-0","bg-background-container-panel-base overflow-hidden border border-border-neutral-outline shadow-2xl","rounded-2xl p-2","md:rounded-[20px]"),onClick:e=>e.stopPropagation(),children:(0,t.jsx)("div",{className:(0,o.cn)("relative bg-background-container-panel-base rounded-xl overflow-hidden","flex items-center justify-center","aspect-square w-[320px]","md:w-[480px]"),children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center w-full h-full gap-6 md:gap-10 p-4",children:[(0,t.jsx)("div",{className:"relative w-32 h-32 sm:w-40 sm:h-40 md:w-44 md:h-44 rounded-2xl border border-[rgba(0,0,0,0.4)] overflow-hidden shrink-0",children:(0,t.jsx)("img",{src:"https://cdn.openart.ai/assets/internal/uploads/image_HkLCMd2L_516x516_1770004617316.webp",alt:"Audio cover",className:"size-full object-cover"})}),(0,t.jsx)("audio",{ref:a,src:e,controls:!0,className:"w-full max-w-sm"})]})})})}function y({src:e,mediaType:s,alt:i,size:c="size-16",className:m,onExpand:y,name:b,hideHoverZoom:w=!1}){let j=(0,n.usePortalZindex)(),[E,k]=(0,r.useState)(!1),[C,M]=(0,r.useState)(!1),[R,_]=(0,r.useState)(!0),[N,T]=(0,r.useState)(!1),F=(0,r.useRef)(null),P=(0,r.useRef)(null),I=(0,r.useRef)(null),[D,S]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!E)return;let e=e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),k(!1))};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[E]),(0,r.useEffect)(()=>{E||_(!0)},[E]),(0,r.useEffect)(()=>{M(!1)},[e]),(0,r.useEffect)(()=>()=>{P.current&&clearTimeout(P.current),I.current&&clearTimeout(I.current)},[]),(0,r.useEffect)(()=>
1{if(!E)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[E]);let A=(0,r.useCallback)(e=>{e.stopPropagation();let t=e.currentTarget;t.paused?t.play().catch(()=>{}):t.pause()},[]),L=(0,r.useCallback)(e=>{e.target===e.currentTarget&&k(!1)},[]),O=(0,r.useCallback)(e=>{e.stopPropagation(),_(e=>!e)},[]),U=(0,r.useCallback)(()=>{P.current&&(clearTimeout(P.current),P.current=null)},[]),B=(0,r.useCallback)(()=>{I.current&&(clearTimeout(I.current),I.current=null)},[]),K=(0,r.useCallback)(()=>{U(),N||(B(),I.current=setTimeout(()=>{if(b&&F.current){let e=F.current.getBoundingClientRect();S({top:e.top,left:e.left})}T(!0)},500))},[b,N,U,B]),z=(0,r.useCallback)(()=>{B(),U(),P.current=setTimeout(()=>{T(!1),S(null)},150)},[U,B]);if(C)return(0,t.jsx)("div",{className:(0,o.cn)("rounded-lg bg-background-neutral-soft flex items-center justify-center text-text-icon-neutral-default text-xs",c,m),children:"Load failed"});let H=!!b&&N;return(0,t.jsxs)("div",{ref:F,className:(0,o.cn)("relative shrink-0",c,m),onMouseEnter:K,onMouseLeave:z,children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{B(),U(),T(!1),S(null),y?y():k(!0)},className:"group relative overflow-hidden rounded-lg size-full",children:["video"===s?(0,t.jsx)("video",{src:e,className:"absolute inset-0 size-full object-cover",muted:!0,playsInline:!0,preload:"metadata",onError:()=>M(!0)}):(0,t.jsx)("img",{src:"audio"===s?p:e,alt:i??"",className:"absolute inset-0 size-full object-cover",onError:()=>M(!0)}),!w&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(l.IconSearchZoomInBold,{className:"size-5 text-white"})})]}),H&&D&&"undefined"!=typeof document&&(0,a.createPortal)((0,t.jsxs)("div",{className:(0,o.cn)("fixed pb-2 pointer-events-auto","hidden","md:[@media(hover:hover)]:block"),style:{zIndex:Math.max(j,70),top:D.top,left:D.left,transform:"translateY(-100%)"},onMouseEnter:()=>{U(),T(!0)},onMouseLeave:z,children:["image"===s&&(0,t.jsx)(h,{src:e,name:b}),"video"===s&&(0,t.jsx)(g,{src:e,name:b}),"audio"===s&&(0,t.jsx)(x,{src:e,name:b})]}),document.body),E&&"undefined"!=typeof document&&(0,a.createPortal)((0,t.jsx)("div",{"data-media-thumbn
1ail-portal":!0,className:"fixed inset-0 flex items-center justify-center bg-background-container-mask-base p-4 pointer-events-auto",style:{zIndex:Math.max(j,70)},onClick:L,children:"video"===s?(0,t.jsxs)("div",{className:(0,o.cn)("relative min-h-0 min-w-0",f),children:[(0,t.jsx)("video",{src:e,className:(0,o.cn)("object-contain",f),autoPlay:!0,loop:!0,muted:R,playsInline:!0,onClick:A}),(0,t.jsx)("button",{type:"button",className:"absolute bottom-4 right-4 rounded-full bg-black/60 p-2 text-white transition-colors hover:bg-black/80",onClick:O,children:R?(0,t.jsx)(d.IconVolumeCrossBold,{className:"size-5"}):(0,t.jsx)(u.IconVolumeHigh,{className:"size-5"})})]}):"audio"===s?(0,t.jsx)(v,{src:e}):(0,t.jsx)("img",{src:e,alt:i??"",className:"max-w-full max-h-full object-contain",onClick:()=>k(!1)})}),document.body)]})}e.s(["AUDIO_THUMBNAIL_URL",0,p,"MediaThumbnail",()=>y])},769653,e=>{"use strict";var t=e.i(743265),r=e.i(478790),a=e.i(797990);e.i(896708);var n=e.i(706357),o=e.i(612003);e.i(563178);var s=e.i(234215),i=e.i(683276),l=e.i(454434),c=e.i(264157),d=e.i(989728),u=e.i(701613),p=e.i(376439);function f(e){return"string"==typeof e&&(e.startsWith("http://")||e.startsWith("https://"))&&null!==e.match(/\.(jpg|jpeg|png|gif|webp)$/i)}function m({item:e}){let m=e.generation,h=m?.legacyConfig,g=(0,r.useContext)(l.FindInChatSlotContext),x=g?.(e)??null,v=(0,a.useCopyToClipboard)({successMessage:"Prompt copied!"}),y=h?.prompt,b=(0,r.useMemo)(()=>y&&h?(0,d.parseLegacyPromptMentions)(y,h):[],[y,h]);if(!h)return x?(0,t.jsx)("div",{className:"flex justify-end px-2 py-1",children:x}):null;let w=function(e){let t=[];for(let r of["image_url","image_urls","start_frame_image_url","end_frame_image_url"]){let a=e[r];if(Array.isArray(a))for(let e of a)f(e)&&t.push(e);else f(a)&&t.push(a)}return t}(h),j=[],E=h.model||h.videoModel||h.ai_model,k=E?(0,n.getModel)(E)?.name:void 0;if(k&&j.push(k),"image"===e.resourceType){if(h.aspect_ratio&&j.push(String(h.aspect_ratio)),h.resolution){let e="number"==typeof h.resolution?`${h.resolution}K`:String(h.resolution);j.push(e)}void 0!==h.seed&&j.push(`Seed: ${h.seed}`)}else if("video"===e.resourceType){if(h.duration&&j.push(`${h.duration} s`),h.aspect_ratio&&j.push(String(h.aspect_ratio)),h.resolution){let e="number"==typeof h.resolution?`${h.resolution}P`:String(h.resolution);j.push(e)}void 0!==h.audio&&j.push("boolean"==typeof h.audio?h.audio?"Audio On":"Audio Off":String(h.audio))}let C=e.createdAt?(0,c.formatDate)(e.createdAt):void 0,M=!!y&&![1e3,1001].includes(h.type);return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)(i.Callout,{variant:"warning",children:["This was created in the"," ",(0,t.jsx)("a",{href:"/assets",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"previous version"}),". You can still view it here, but some settings and features are unavailable."]}),x&&!M&&(0,t.jsx)("div",{className:"flex justify-end px-2 py-1",children:x}),M&&(0,t.jsx)(u.DetailSection,{title:"PROMPT",action:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[x,(0,t.jsx)(o.IconButton,{icon:s.IconCopyBold,onClick:()=>{y&&v(y)},variant:"ghost",color:"neutral",size:"32",tooltip:"Copy","aria-label":"Copy"})]}),children:(0,t.jsx)(p.ExpandableText,{children:(0,t.jsx)("p",{className:"text-[13px] font-normal leading-[20px] text-text-icon-neutral-primary min-w-full",children:b.map(e=>"mention"===e.type?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-text-icon-neutral-secondary rounded px-1 py-0.5 box-decoration-clone bg-background-container-panel-surface",children:["@",e.label]},e.key):(0,t.jsx)(r.Fragment,{children:e.text},e.key))})})}),w.length>0&&(0,t.jsx)(u.DetailSection,{title:"REFERENCES",children:(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:w.map(e=>(0,t.jsx)("div",{className:"relative rounded-[8px] size-[64px]",children:(0,t.jsx)("img",{src:e,alt:"Reference image",className:"absolute max-w-none object-cover rounded-[8px] size-full"})},e))})}),(j.length>0||C)&&(0,t.jsx)(u.DetailSection,{title:"SETTINGS",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-[4px] items-start w-full",children:[j.map(e=>(0,t.jsx)("div",{className:"bg-background-neutral-soft flex items-center justify-center px-[6px] py-[2px] rounded-[6px]",children:(0,t.jsx)("p",{"data-notranslate":!0,className:"text-[11px] font-medium leading-[16
1px] text-text-icon-neutral-primary",children:e})},e)),C&&(0,t.jsx)("div",{className:"bg-background-neutral-soft flex items-center justify-center px-[6px] py-[2px] rounded-[6px]",children:(0,t.jsxs)("p",{className:"text-[11px] font-medium leading-[16px] text-text-icon-neutral-primary",children:["Creation time: ",(0,t.jsx)("span",{"data-notranslate":!0,children:C})]})})]})})]})}e.s(["LegacyParameters",()=>m])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.