PageSourceSearch

https://kvio.ai/assets/_id-JXCn2Hqw.js

js kvio.ai collected 2026-10-05 13:35:09 UTC 29,106 bytes, 1 lines download raw bytes

1import{c as ae,g as w,aL as _e,r as u,aM as D,aN as ve,aO as we,aP as ye,aQ as Ne,aR as Ce,aS as je,aT as G,aU as Ie,aV as Pe,aW as W,aX as Re,aY as Se,aZ as Te,a_ as ke,j as r,a$ as Ee,b0 as ze,b1 as Ae,b2 as Me,b3 as Y,b4 as Oe,b5 as Le,b6 as Fe,b7 as Q,b8 as De,b9 as $e,ba as Be,bb as Ue,bc as Ve,bd as He,be as Ye,bf as Xe,bg as Ke,bh as Ge,bi as ie,bj as We,bk as Qe,bl as qe,bm as Je,bn as Ze,bo as et,bp as tt,bq as nt,br as rt,bs as ot,bt as st,bu as at,bv as it,l as y,a1 as lt,i as B,bw as ct,_ as dt,bx as ut,Y as O,B as M,by as q,bz as mt,P as U,bA as le,bB as ft,I as pt,bC as gt,ay as ht,al as xt,v as bt,bD as _t}from"./main-BsQhsZ_c.js";import{D as vt,I as V,A as wt,b as yt,c as Nt,d as Ct,L as jt}from"./dashboard-header-zlawtkKx.js";import{a as It}from"./image-rail-skeleton-CNYBqbEb.js";import{b as Pt,c as Rt}from"./use-prompt-favorites-BGjszd-8.js";import{I as St,c as Tt,d as kt}from"./download-Btq0RgVJ.js";import{g as Et,c as zt}from"./formatter-S86hkUv5.js";import{a as At,b as Mt}from"./view-transitions-BgnTfd7K.js";import{I as Ot}from"./IconChevronLeft-L_Wf0QNd.js";import{I as Lt}from"./IconCalendar-C4nKSfEN.js";import{I as Ft}from"./IconCopy-CV57CfmB.js";import{I as Dt,c as J,a as Z}from"./common_save-BfNA559Y.js";import{I as ee}from"./IconExternalLink-BfSkwd55.js";import{a as H}from"./ai_page_common_prompt-DxKz3B7l.js";import{c as $t,a as Bt}from"./common_downloading-DOSzb8s0.js";import{c as Ut,a as Vt}from"./common_previous_image-CM5YIGKf.js";import{c as te}from"./common_copied-Cr4tBG7E.js";import{c as Ht}from"./common_copy_prompt-CFN-jOiZ.js";import{a as Yt}from"./admin_tasks_columns_model-Bg0VhsNY.js";import{c as Xt}from"./common_use_this_prompt-3zmYdWJJ.js";import"./IconArrowLeft-Xa73GHTq.js";import"./image-placeholder-Dq3iUqYZ.js";import"./useMutation-BjiKZEzE.js";import"./favorites_remove_failed-DmhHoLaB.js";const Kt=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],Gt=ae("outline","brand-github","BrandGithub",Kt);const Wt=[["path",{d:"M3 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M15 6a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M15 18a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}],["path",{d:"M8.7 10.7l6.6 -3.4",key:"svg-3"}],["path",{d:"M8.7 13.3l6.6 3.4",key:"svg-4"}]],Qt=ae("outline","share","Share",Wt),qt=()=>"Remove from saved",Jt=()=>"Supprimer de l'enregistrement",Zt=()=>"Aus gespeichertem entfernen",en=((e={},n={})=>{const t=n.locale??w();return t==="en"?qt():t==="fr"?Jt():Zt()}),tn=()=>"Attribution",nn=()=>"Attribution",rn=()=>"Namensnennung",$=((e={},n={})=>{const t=n.locale??w();return t==="en"?tn():t==="fr"?nn():rn()}),on=e=>`Data from ${e?.dataset}, by ${e?.author}, licensed under ${e?.license}.`,sn=e=>`Données issues de ${e?.dataset}, par ${e?.author}, sous licence ${e?.license}.`,an=e=>`Daten aus ${e?.dataset}, von ${e?.author}, lizenziert unter ${e?.license}.`,ln=((e,n={})=>{const t=n.locale??w();return t==="en"?on(e):t==="fr"?sn(e):an(e)}),cn=()=>"by",dn=()=>"par",un=()=>"von",mn=((e={},n={})=>{const t=n.locale??w();return t==="en"?cn():t==="fr"?dn():un()}),fn=()=>"Image carousel navigation",pn=()=>"Navigation dans le carrousel d’images",gn=()=>"Bildkarussell-Navigation",hn=((e={},n={})=>{const t=n.locale??w();return t==="en"?fn():t==="fr"?pn():gn()}),xn=e=>`Filter by ${e?.label}`,bn=e=>`Filtrer par ${e?.label}`,_n=e=>`Nach ${e?.label} filtern`,ce=((e,n={})=>{const t=n.locale??w();return t==="en"?xn(e):t==="fr"?bn(e):_n(e)}),vn=()=>"Original prompt in English",wn=()=>"Traduction française par Kvio",yn=()=>"Deutsche Übersetzung von Kvio",Nn=((e={},n={})=>{const t=n.locale??w();return t==="en"?vn():t==="fr"?wn():yn()}),Cn=()=>"No image available.",jn=()=>"Aucune image disponible.",In=()=>"Kein Bild verfügbar.",Pn=((e={},n={})=>{const t=n.locale??w();return t==="en"?Cn():t==="fr"?jn():In()}),Rn=()=>"Share",Sn=()=>"Partager",Tn=()=>"Teilen",kn=((e={},n={})=>{const t=n.locale??w();return t==="en"?Rn():t==="fr"?Sn():Tn()}),En=()=>"Discover this AI image prompt.",zn=()=>"Découvrez ce prompt d’image IA.",An=()=>"Entdecke diesen KI-Bild-Prompt.",Mn=((e={},n={})=>{const t=n.locale??w();
1return t==="en"?En():t==="fr"?zn():An()}),On=e=>`Show image ${e?.number}`,Ln=e=>`Afficher l'image ${e?.number}`,Fn=e=>`Bild anzeigen ${e?.number}`,Dn=((e,n={})=>{const t=n.locale??w();return t==="en"?On(e):t==="fr"?Ln(e):Fn(e)}),$n=()=>"Source and license",Bn=()=>"Source et licence",Un=()=>"Quelle und Lizenz",ne=((e={},n={})=>{const t=n.locale??w();return t==="en"?$n():t==="fr"?Bn():Un()}),Vn=()=>"View on",Hn=()=>"Voir sur",Yn=()=>"Ansehen auf",Xn=((e={},n={})=>{const t=n.locale??w();return t==="en"?Vn():t==="fr"?Hn():Yn()}),Kn=()=>"View original post on X",Gn=()=>"Voir le message original sur X",Wn=()=>"Originalbeitrag auf X anzeigen",Qn=((e={},n={})=>{const t=n.locale??w();return t==="en"?Kn():t==="fr"?Gn():Wn()});function F(e,n,t,o){return{left:e,top:n,right:t,bottom:o,x:e,y:n,width:t-e,height:o-n}}function qn(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function de(e){const n=[];let t,o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(const a of Array.from(e).sort((i,m)=>i.top-m.top)){if(o=Math.min(o,a.left),s=Math.min(s,a.top),l=Math.max(l,a.right),c=Math.max(c,a.bottom),!t||a.top-t.top>t.height/2)n.push(qn(a));else{const i=n[n.length-1];i.left=Math.min(i.left,a.left),i.right=Math.max(i.right,a.right),i.bottom=Math.max(i.bottom,a.bottom),i.width=i.right-i.left,i.height=i.bottom-i.top}t=a}return{lines:n,fallback:F(o,s,l,c)}}function ue(e,n,t){return e.findIndex(o=>n>o.left-2&&n<o.right+2&&t>o.top-2&&t<o.bottom+2)}function re(e){return F(e.left,e.top,e.right,e.bottom)}function Jn(e,n,t){const{lines:o}=de(e.getClientRects());if(o.length<2)return;const s=ue(o,n,t);return{x:n,y:t,lineIndex:s===-1?void 0:s,element:e}}function Zn(e,n,t){const{lines:o,fallback:s}=de(e.getClientRects());if(o.length<2)return null;const l=t?.x,c=t?.y,a=n[0];if(t?.lineIndex!=null&&o[t.lineIndex])return re(o[t.lineIndex]);if(l!=null&&c!=null){const f=ue(o,l,c);if(f!==-1)return re(o[f])}if(o.length===2&&o[0].left>o[1].right&&l!=null&&c!=null)return s;if(a==="t"||a==="b"){const f=o[0],x=o[o.length-1],b=a==="t"?f:x;return F(b.left,f.top,b.right,x.bottom)}const i=a==="l";let m=o[0].left,d=o[0].right,g=i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,h=o[0],p=o[0];for(const f of o){m=Math.min(m,f.left),d=Math.max(d,f.right);const x=i?f.left:f.right;i&&x<g||!i&&x>g?(g=x,h=f,p=f):x===g&&(p=f)}return F(m,h.top,d,p.bottom)}function er(e){return"contextElement"in e&&e.contextElement?e.contextElement:_e(e)?e:void 0}function tr(e,n){function t(s){me(e,s.currentTarget,s.clientX,s.clientY)}function o(s){n||t(s)}return{onFocus(){e.current=void 0},onMouseEnter:t,onMouseMove:o}}function me(e,n,t,o){const s=Jn(n,t,o);return e.current=s,s}function nr(e){return{name:"inline",async fn(n){const t=n.elements.reference;if(typeof t?.getClientRects!="function")return{};const o=er(t),s=e.current,l=s?.element===t||s?.element===o?s:void 0,c=Zn(t,n.placement,l);if(!c||typeof n.platform.getElementRects!="function")return{};const a=await n.platform.getElementRects({reference:{contextElement:o,getBoundingClientRect(){return c}},floating:n.elements.floating,strategy:n.strategy});return n.rects.reference.x===a.reference.x&&n.rects.reference.y===a.reference.y&&n.rects.reference.width===a.reference.width&&n.rects.reference.height===a.reference.height?{}:{reset:{rects:a}}}}}const fe=u.createContext(void 0);function A(e){const n=u.useContext(fe);if(n===void 0&&!e)throw new Error(D(50));return n}const rr=600,pe=300,or={...Ne,instantType:W(e=>e.instantType),hasViewport:W(e=>e.hasViewport)};class X extends ve{constructor(n,t,o=!1){const s=new ye,l={...sr(),...n};l.floatingRootContext=we(s,t,o),super(l,{popupRef:u.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:s,closeDelayRef:{current:pe},inlineRectCoordsRef:{current:void 0}},or)}setOpen=(n,t)=>{const o=t.reason,s=o===G,l=n&&o===Re,c=!n&&(o===Se||o===Te);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(n,t),t.isCanceled)return;const a=t.event;
1n&&s&&t.trigger&&"clientX"in a&&"clientY"in a&&this.context.inlineRectCoordsRef.current?.element!==t.trigger&&me(this.context.inlineRectCoordsRef,t.trigger,a.clientX,a.clientY),this.state.floatingRootContext.dispatchOpenChange(n,t);const i=()=>{const m={open:n};l?m.instantType="focus":c?m.instantType="dismiss":o===G&&(m.instantType=void 0),Ie(m,n,t.trigger),this.update(m)};s?Ce.flushSync(i):i()};static useStore(n,t){return je(n,(s,l)=>new X(t,s,l)).store}}function sr(){return{...Pe(),instantType:void 0,hasViewport:!1}}function oe(e){const{open:n,defaultOpen:t=!1,onOpenChange:o,onOpenChangeComplete:s,actionsRef:l,handle:c,triggerId:a,defaultTriggerId:i=null,children:m}=e,d=X.useStore(c?.store,{open:t,openProp:n,activeTriggerId:i,triggerIdProp:a});ze(()=>{n===void 0&&d.state.open===!1&&t===!0&&d.update({open:!0,activeTriggerId:i})}),d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",a),d.useContextCallback("onOpenChange",o),d.useContextCallback("onOpenChangeComplete",s);const g=d.useState("open"),h=d.useState("activeTriggerId"),p=d.useState("mounted"),f=d.useState("payload");Ae(d);const{forceUnmount:x}=Me(g,d,()=>{d.context.inlineRectCoordsRef.current=void 0});Y(()=>{g&&h==null&&d.set("payload",void 0)},[d,h,g]);const b=u.useCallback(()=>{d.setOpen(!1,Oe(Le))},[d]);u.useImperativeHandle(l,()=>({unmount:x,close:b}),[x,b]);const j=g||p;return r.jsxs(fe.Provider,{value:d,children:[j&&r.jsx(ar,{store:d}),typeof m=="function"?m({payload:f}):m]})}function ar({store:e}){const n=e.useState("floatingRootContext"),t=Fe(n),o=t.reference??Q,s=t.trigger??Q,l=u.useMemo(()=>De($e,t.floating),[t.floating]);return Be(e,{activeTriggerProps:o,inactiveTriggerProps:s,popupProps:l}),null}const ir=ke(function(n){return A(!0)?r.jsx(oe,{...n}):r.jsx(Ee,{children:r.jsx(oe,{...n})})}),ge=u.createContext(void 0);function lr(){const e=u.useContext(ge);if(e===void 0)throw new Error(D(48));return e}const cr=u.forwardRef(function(n,t){const{keepMounted:o=!1,...s}=n;return A().useState("mounted")||o?r.jsx(ge.Provider,{value:o,children:r.jsx(Ue,{ref:t,...s})}):null}),dr=Ve(function(n,t){const{render:o,className:s,delay:l,closeDelay:c,id:a,payload:i,handle:m,style:d,...g}=n,h=A(!0),p=m?.store??h;if(!p)throw new Error(D(89));const f=He(a),x=p.useState("isTriggerActive",f),b=p.useState("isOpenedByTrigger",f),j=p.useState("floatingRootContext"),E=p.context.inlineRectCoordsRef,_=u.useRef(null),N=l??rr,P=c??pe,{registerTrigger:R,isMountedByThisTrigger:C}=Ye(f,_,p,{payload:i});Y(()=>{C&&(p.context.closeDelayRef.current=P)},[p,C,P]);const z=Xe(j,{mouseOnly:!0,move:!1,handleClose:Ke(),delay:()=>({open:N,close:P}),triggerElementRef:_,isActiveTrigger:x,isClosing:()=>p.select("transitionStatus")==="ending"}),k=Ge(j,{delay:N}),v={open:b},I=p.useState("triggerProps",C),S=tr(E,b);return ie("a",n,{state:v,ref:[t,R,_],props:[z,k.reference,I,S,{id:f},g],stateAttributesMapping:We})}),he=u.createContext(void 0);function ur(){const e=u.useContext(he);if(e===void 0)throw new Error(D(49));return e}const mr=u.forwardRef(function(n,t){const{render:o,className:s,anchor:l,positionMethod:c="absolute",side:a="bottom",align:i="center",sideOffset:m=0,alignOffset:d=0,collisionBoundary:g="clipping-ancestors",collisionPadding:h=5,arrowPadding:p=5,sticky:f=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=Qe,style:j,...E}=n,_=A(),N=lr(),P=qe(),R=_.useState("open"),C=_.useState("mounted"),z=_.useState("floatingRootContext"),k=_.useState("instantType"),v=_.useState("transitionStatus"),I=_.useState("hasViewport"),S=_.context.inlineRectCoordsRef,T=Je({anchor:l,floatingRootContext:z,positionMethod:c,mounted:C,side:a,sideOffset:m,align:i,alignOffset:d,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:f,disableAnchorTracking:x,keepMounted:N,nodeId:P,collisionAvoidance:b,adaptiveOrigin:I?Ze:void 0,inline:nr(S)}),K=T.update;Y(()=>{R&&C&&K()},[R,C,K]);const xe={open:R,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:k},be=et(n,xe,{styles:T.positionerStyles,transitionStatus:v,props:E,refs:[t,_.useStateSetter("positionerElement")],hidden:!C,inert:!R});return r.jsx(he.Provider,{value:T,children:r.jsx(tt,{id:P,children:be})})}),fr={...at,...st},pr=u.forwardRef(function(n,t){const{className:o,render:s,style:l,...c}=n,a=A(),{side:i,align:m}=ur(),d=a.useState("open"),g=a.useState("instantType"),h=a.useState("transitionStatus"),p=a.useState("popupProps"),f=a.useState("floatingRootContext");nt({open:d,ref:a.context.popupRef,onComplete(){d&&a.context.onOpenChangeComplete?.(!0)}});const x=rt(()=>a.context.closeDelayRef.current);return ot(f,{closeDelay:x}),ie("div",n,{state:{open:d,side:i,align:m,instant:g,transitionStatus:h}
1,ref:[t,a.context.popupRef,a.useStateSetter("popupElement")],props:[p,it(h),c],stateAttributesMapping:fr})});function gr({...e}){return r.jsx(ir,{"data-slot":"hover-card",...e})}function hr({...e}){return r.jsx(dr,{"data-slot":"hover-card-trigger",...e})}function xr({className:e,side:n="bottom",sideOffset:t=4,align:o="center",alignOffset:s=4,...l}){return r.jsx(cr,{"data-slot":"hover-card-portal",children:r.jsx(mr,{align:o,alignOffset:s,side:n,sideOffset:t,className:"isolate z-50",children:r.jsx(pr,{"data-slot":"hover-card-content",className:y("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l})})})}function br({prompt:e}){const n=e.authorName||e.authorHandle||"MeiGen",t=e.authorHandle?e.authorHandle.startsWith("@")?e.authorHandle:`@${e.authorHandle}`:null,o=lt(),s=u.useCallback(()=>{o.navigate({to:"/generate",search:{promptId:e.id}})},[o,e.id]);return u.useEffect(()=>{function l(c){const a=c.target,i=a?.tagName;if(!(i==="INPUT"||i==="TEXTAREA"||i==="SELECT"||a?.isContentEditable)&&c.key==="Enter"){if(i==="A"||i==="BUTTON")return;c.preventDefault(),s()}}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),u.useEffect(()=>{if(typeof document>"u")return;const l=document.documentElement,c=l.style.scrollBehavior;return l.style.scrollBehavior="auto",()=>{l.style.scrollBehavior=c}},[]),r.jsxs("div",{className:"flex min-h-svh flex-col",children:[r.jsx(vt,{showBack:!0,center:r.jsx("h1",{className:"font-sans font-semibold text-base",children:H()})}),r.jsx("div",{className:"flex-1 px-4 py-6 lg:px-6 lg:py-8",children:r.jsx(_r,{prompt:e,authorLabel:n,authorHandle:t})})]})}function _r({prompt:e,authorLabel:n,authorHandle:t}){const o=u.useMemo(()=>e.images.length>0?e.images:e.coverUrl?[{url:e.coverUrl,alt:e.coverAlt,width:e.width,height:e.height}]:[],[e]),s=o.length,[l,c]=u.useState(0),a=o[l],i=u.useCallback(()=>c(g=>(g-1+s)%s),[s]),m=u.useCallback(()=>c(g=>(g+1)%s),[s]);u.useEffect(()=>{if(s<=1)return;function g(h){const p=h.target,f=p?.tagName;f==="INPUT"||f==="TEXTAREA"||p?.isContentEditable||(h.key==="ArrowLeft"?i():h.key==="ArrowRight"&&m())}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[s,m,i]);const d=s>1?"lg:grid-cols-[auto_minmax(0,1.4fr)_minmax(380px,1fr)]":"lg:grid-cols-[minmax(0,1.4fr)_minmax(380px,1fr)]";return r.jsxs("div",{className:y("grid min-w-0 gap-6 lg:gap-10",d),children:[s>1&&r.jsx("div",{className:"min-w-0 max-w-full animate-in fade-in slide-in-from-left-6 duration-500 ease-out",children:r.jsx(wr,{promptId:e.id,images:o,active:l,onSelect:c}
1)}),r.jsx("div",{className:"min-w-0",children:r.jsx(vr,{prompt:e,images:o,active:l,current:a,total:s,onPrev:i,onNext:m})}),r.jsx("div",{className:"min-w-0 animate-in fade-in slide-in-from-right-6 delay-100 fill-mode-both duration-500 ease-out",children:r.jsx(Nr,{prompt:e,authorLabel:n,authorHandle:t})})]})}function vr({prompt:e,active:n,current:t,total:o,onPrev:s,onNext:l}){const[c,a]=u.useState(!1),[i,m]=u.useState(!1),d=n===0?At(e.id):"none";async function g(){if(!t?.url||i)return;const h=e.externalId||e.id,p=o>1?`-${n+1}`:"";m(!0);const f=new Promise(x=>setTimeout(x,100));try{await Promise.all([kt(t.url,`prompt-${h}${p}.jpg`),f]),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}finally{m(!1)}}return r.jsxs("div",{className:"relative flex min-w-0 w-full flex-col items-center justify-start",children:[r.jsxs("div",{className:"relative flex w-full min-w-0 items-center justify-center px-4 sm:px-6",children:[t?.url?r.jsxs("div",{className:"relative inline-block max-h-[78vh] overflow-hidden rounded-2xl",children:[r.jsx("img",{src:t.url,alt:t.alt,width:t.width,height:t.height,style:{viewTransitionName:d},className:"block h-auto max-h-[78vh] w-auto max-w-full"}),o>1&&r.jsxs("span",{className:"pointer-events-none absolute bottom-3 left-3 inline-flex items-center rounded-full bg-black/55 px-2.5 py-1 font-medium text-white text-xs backdrop-blur-sm",children:[n+1," / ",o]}),r.jsx("button",{type:"button",onClick:g,disabled:i,"aria-label":i?$t():c?Bt():Tt(),className:y("absolute right-3 bottom-3 inline-flex size-9 items-center justify-center rounded-full text-white shadow-sm backdrop-blur-sm transition-all disabled:cursor-not-allowed",c?"bg-emerald-500/80 hover:bg-emerald-500/90":"bg-black/55 hover:bg-emerald-500/80 hover:text-white"),children:i?r.jsx(B,{className:"size-4 animate-spin"}):c?r.jsx(V,{className:"size-4"}):r.jsx(St,{className:"size-4"})})]}):r.jsx("div",{className:"flex aspect-4/5 w-full items-center justify-center rounded-2xl border bg-muted p-6 text-center text-muted-foreground text-sm",children:Pn()}),o>1&&r.jsxs("div",{className:"pointer-events-none absolute inset-y-0 left-0 right-0 flex items-center justify-between",children:[r.jsx("button",{type:"button",onClick:s,"aria-label":Ut(),className:"pointer-events-auto inline-flex size-9 items-center justify-center rounded-full border bg-background text-foreground shadow-sm transition-colors hover:bg-accent",children:r.jsx(Ot,{className:"size-5"})}),r.jsx("button",{type:"button",onClick:l,"aria-label":Vt(),className:"pointer-events-auto inline-flex size-9 items-center justify-center rounded-full border bg-background text-foreground shadow-sm transition-colors hover:bg-accent",children:r.jsx(ct,{className:"size-5"})})]})]}),!t?.url&&o>1&&r.jsx("div",{className:"sr-only",children:hn()})]})}function wr({promptId:e,images:n,active:t,onSelect:o}){const s=u.useRef(null);return u.useEffect(()=>{s.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]),r.jsx("div",{className:"flex w-full min-w-0 max-w-full flex-row gap-4 overflow-x-auto p-1 lg:max-h-[78vh] lg:w-auto lg:flex-col lg:overflow-x-visible lg:overflow-y-auto lg:pb-0",children:n.map((l,c)=>{const a=c===t;return r.jsx(yr,{image:l,promptId:e,index:c,isActive:a,buttonRef:a?s:null,onSelect:o},`${l.url}-${c}`)})})}function yr({image:e,promptId:n,index:t,isActive:o,buttonRef:s,onSelect:l}){const[c,a]=u.useState(!0),i=u.useRef(null),m=Mt(n,t);return u.useEffect(()=>{a(!1);const d=i.current;d?.complete&&d.naturalWidth>0&&a(!0)},[e.url]),r.jsx("button",{ref:s,type:"button",onClick:()=>l(t),"aria-label":Dn({number:t+1}),"aria-current":o,className:y("group relative block size-20 shrink-0 rounded-lg bg-white p-0.5 ring-1 ring-inset transition sm:size-24 dark:bg-zinc-100",o?"shadow-md ring-primary/20 dark:ring-primary/25":"shadow-sm ring-black/5 hover:shadow-md dark:ring-white/10"),children:r.jsxs("span",{className:"relative block size-full overflow-hidden rounded-md bg-muted",children:[!c&&r.jsx(It,{index:t,isActive:o}),r.jsx("img",{ref:i,src:e.url,alt:e.alt,loading:"lazy",onLoad:()=>a(!0),onError:()=>a(!0),style:{viewTransitionName:m},className:y("size-full object-cover transition-opacity duration-300",c?o?"opacity-100":"opacity-50 group-hover:opacity-100":"opacity-0")})]})})}function Nr({prompt:e,authorLabel:n,authorHandle:t}){const[o,s]=u.useState(!1),[l,c]=u.useState(!1),[a,i]=u.useState(!1),m=u.useRef(!1),d=u.useRef(null),{data:g}=dt.useSession(),h=!!g?.user,{pathname:p}=ut(),{data:f}=Pt(e.id,h),x=Rt(),[b,j]=u.useState(!1),[E,_]=u.useState(null),N=b?E??!1:f?.favorited??!1;function P(){if(!h||b)return;const v=f?.favorited??!1;_(v),j(!0);const I=new Promise(S=>setTimeout(S,100));Promise.all([x.mutateAsync({promptId:e.id,favorited:v}),I]).finally(()=>{j(!1),_(null)})}async function R(){try{await navigator.clipboard.writeText(e.prompt),s(!0),window.setTimeout(()=>s(!1),1400)}catch{}}u.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]);async function C(){if(m.current)return;const v=gt(`/prompt/${e.id}`),I=Mn();m.current=!0,i(!0);try{if(typeof navigator.share=="function")try{await navigator.share({title:H(),text:I,url:v});return}catch(S){if(S instanceof DOMException&&S.name==="AbortError")return}try{await navigator.clipboard.writeText(v),c(!0),d.current!==null&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{c(!1),d.current=null},1500)}catch{}}finally{m.current=!1,i(!1)}}const z={promptId:e.id},k=e.authorProfileUrl??e.sourceUrl;return r.jsxs("aside",{className:"flex min-w-0 flex-col gap-6",children:[r.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-4",children:[r.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[r.jsxs(wt,{size:"lg",className:"ring-1 ring-border",children:[e.authorAvatarUrl&&r.jsx(yt,{src:e.authorAvatarUrl,alt:n,referrerPolicy:"no-referrer"}),r.jsx(Nt,{className:"font-medium uppercase",children:Et(n)})]}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"truncate font-medium text-base",children:n}),t&&r.jsx("a",{href:k??"#",target:"_blank",rel:"noreferrer",className:y("block truncate text-muted-foreground text-xs",k?"hover:text-foreground hover:underline":"pointer-events-none"),children:t})]})]}),e.sourceUrl&&r.jsxs("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer","aria-label":Qn(),className:y(O({variant:"outline",size:"sm"}),"shrink-0"),children:[Xn()," ",r.jsx(Ct,{className:"size-3.5"})]})]}),r.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 text-muted-foreground text-sm",children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(Lt,{className:"size-4"}),r.jsx("span",{className:"text-xs",children:zt(e.date)})]})}),r.jsxs("div",{className:"rounded-2xl border bg-card",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 border-b px-4 py-2.5",children:[r.jsx("h2",{className:"font-medium text-foreground text-sm",children:H()}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(M,{t
1ype:"button",size:"icon-sm",variant:o?"outline":"ghost",onClick:R,"aria-label":o?te():Ht(),className:y("shrink-0 text-muted-foreground hover:text-emerald-600 dark:hover:text-emerald-400",o&&"pointer-events-none border-emerald-500/40 bg-emerald-500/10 text-emerald-600 hover:border-emerald-500/40 hover:bg-emerald-500/10 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-400"),children:o?r.jsx(V,{className:"size-3.5"}):r.jsx(Ft,{className:"size-3.5"})}),h?r.jsx(M,{type:"button",size:"icon-sm",variant:N?"outline":"ghost",onClick:P,disabled:b,"aria-pressed":N,"aria-label":N?en():J(),className:y("shrink-0 text-muted-foreground hover:text-amber-600 dark:hover:text-amber-400",N&&"border-amber-500/40 bg-amber-500/10 text-amber-600 hover:border-amber-500/40 hover:bg-amber-500/10 hover:text-amber-600 dark:text-amber-400 dark:hover:text-amber-400"),children:b?r.jsx(B,{className:"size-3.5 animate-spin"}):N?r.jsx(Dt,{className:"size-3.5"}):r.jsx(q,{className:"size-3.5"})}):r.jsx(jt,{mode:"modal",asChild:!0,callbackUrl:p,children:r.jsx(M,{type:"button",size:"icon-sm",variant:"ghost","aria-label":J(),className:"shrink-0 text-muted-foreground hover:text-amber-600 dark:hover:text-amber-400",children:r.jsx(q,{className:"size-3.5"})})}
1),r.jsx(M,{type:"button",size:"icon-sm",variant:l?"outline":"ghost",onClick:C,disabled:a,"aria-label":l?te():kn(),className:y("shrink-0 text-muted-foreground hover:text-primary",l&&"pointer-events-none border-emerald-500/40 bg-emerald-500/10 text-emerald-600 hover:border-emerald-500/40 hover:bg-emerald-500/10 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-400"),children:a?r.jsx(B,{className:"size-3.5 animate-spin"}):l?r.jsx(V,{className:"size-3.5"}):r.jsx(Qt,{className:"size-3.5"})})]})]}),r.jsx("div",{className:"max-h-64 overflow-y-auto px-4 py-3",children:r.jsx("p",{className:"break-words whitespace-pre-wrap text-foreground text-sm leading-relaxed",children:e.prompt})})]}),r.jsxs("dl",{className:"space-y-6 text-sm",children:[r.jsx(se,{label:Yt(),children:r.jsx(Rr,{model:e.model})}),e.categories.length>0&&r.jsx(se,{label:ft(),children:r.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.categories.map(v=>{const I=mt(v.slug);return r.jsxs(U,{to:"/",search:le(void 0,{category:v.slug}),"aria-label":ce({label:v.title}),className:y(O({variant:"outline",size:"sm"}),"h-7 px-2.5 text-xs"),children:[r.jsx(I,{"aria-hidden":"true",className:"size-3.5"}),v.title]},v.slug)})})}),e.attribution&&r.jsx(Cr,{attribution:e.attribution})]}),r.jsxs(U,{to:"/generate",search:z,className:y(O({size:"lg"}),"mt-4 w-full"),children:[r.jsx(pt,{className:"size-4"}),Xt()]})]})}function Cr({attribution:e}){return r.jsxs("div",{children:[r.jsx("dt",{className:"sr-only",children:ne()}),r.jsx("dd",{children:r.jsxs(gr,{children:[r.jsx(hr,{delay:150,closeDelay:150,render:n=>r.jsxs("button",{...n,type:"button",className:"inline-flex items-center gap-1.5 text-muted-foreground text-xs transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[r.jsx("span",{children:ne()}),r.jsx(xt,{"aria-hidden":"true",className:"size-3.5"})]})}),r.jsxs(xr,{align:"start",side:"top",sideOffset:8,className:"w-[min(22rem,calc(100vw-2rem))] p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[r.jsx(jr,{attribution:e}),r.jsx(Pr,{attribution:e})]}),r.jsx("p",{className:"mt-2 text-muted-foreground text-xs leading-relaxed",children:ln({dataset:e.datasetName??$(),author:e.authorName??$(),license:e.licenseName??$()})}),r.jsx("p",{className:"mt-2 text-muted-foreground text-xs leading-relaxed",children:Nn()})]})]})})]})}function jr({attribution:e}){const n=e.links.find(s=>s.kind==="dataset"),t=e.links.find(s=>s.kind==="author"),o=e.links.filter(s=>s.kind==="other");return r.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5 text-muted-foreground text-xs leading-relaxed",children:[n&&r.jsx(L,{href:n.href,label:n.label,icon:Gt}),t&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:mn()}),r.jsx(L,{href:t.href,label:t.label,icon:ee})]}),o.map(s=>r.jsx(L,{href:s.href,label:s.label,icon:ee},s.href))]})}function Ir(e){const n=e.trim(),t=n.match(/^cc[\s-]*by(?:[\s-]*(sa|nc|nd|nc-sa|nc-nd))?[\s-]*(\d+(?:\.\d+)?)$/i);if(t){const o=t[1]?`-${t[1].toUpperCase()}`:"",s=t[2].includes(".")?t[2]:`${t[2]}.0`;return`CC BY${o} ${s}`}return n}function Pr({attribution:e}){const n=e.links.find(s=>s.kind==="license"),t=Ir(e.licenseName??n?.label??"");if(!t)return null;const o=n?.href??e.licenseUrl;return o?r.jsx(L,{href:o,label:t,icon:Z}):r.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground text-xs",children:[r.jsx(Z,{className:"size-3.5 text-muted-foreground"}),r.jsx("span",{className:"font-medium",children:t})]})}function L({href:e,label:n,icon:t}){return r.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex max-w-full items-center gap-1 rounded-md border bg-card px-1.5 py-0.5 font-medium text-foreground transition-colors hover:bg-muted",children:[r.jsx(t,{className:"size-3 shrink-0"}),r.jsx("span",{className:"truncate",children:n})]})}function Rr({model:e}){const t=ht[e]?.displayName??e,o=bt(e);return r.jsxs(U,{to:"/",search:le(void 0,{model:e}),"aria-label":ce({label:t}),className:y(O({variant:"outline",size:"sm"}),"h-7 px-2.5 text-xs"),children:[r.jsx(o,{"aria-hidden":"true",className:"size-3.5"}),t]})}function se({label:e,children:n}){return r.jsxs("div",{className:"grid grid-cols-[100px_minmax(0,1fr)] items-baseline gap-4",children:[r.jsx("dt",{className:"text-muted-foreground text-xs uppercase tracking-wide",children:e}),r.jsx("dd",{className:"min-w-0",children:n})]})}function Jr(){const e=_t.useLoaderData();return r.jsx(br,{prompt:e})}export{Jr as component};

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.