1!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]="01a0d9af-403e-75b1-9c52-a5b80cd43700")}catch(e){}}();import{B as _}from"./Button-DDqYR2UI.js";import{c as s,a as w,d as a,I as l,i as m,w as h,n as k,t as c,ca as f,m as p,r as b,o as r,e as u,F as y}from"./index-BtIFvzQj.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";const P={name:"InspirationItem",emits:["copy-project","preview"],components:{Button:_},props:{item:{type:Object,required:!0},isAuthenticated:{type:Boolean},previewEnabled:{type:Boolean,default:!0},actionLabel:{type:String,default:"Copy project"},actionPendingLabel:{type:String,default:"Copying..."},uniform:{type:Boolean,default:!1}},data(){return{isHovering:!1,hasFocusWithin:!1,isVisible:!1,observer:null,copying:!1}},mounted(){this.setupIntersectionObserver()},beforeUnmount(){this.observer&&this.observer.disconnect()},computed:{actionsVisible(){return this.isHovering||this.hasFocusWithin},canPreview(){return this.previewEnabled&&!!this.item.remixId},madeWithUnicornAI(){return this.item.tags?.some(o=>o.trim().toLowerCase()==="unicorn ai")},previewLabel(){if(!this.canPreview)return;const o=this.item.tags?.slice(0,3).join(", ");return o?`Preview inspiration item: ${o}`:"Preview inspiration item"},isVideo(){return this.item.media?.type==="video"},mediaSrc(){return this.item.media?.src||""},posterSrc(){return this.item.media?.poster||""},videoSrc(){return this.mediaSrc}},methods:{setupIntersectionObserver(){this.observer=new IntersectionObserver(o=>{o.forEach(e=>{const t=this.isVisible;this.isVisible=e.isIntersecting,e.isIntersecting&&!t?this.$nextTick(()=>{this.isVideo&&this.$refs.video&&this.$refs.video.play().catch(()=>{})}):!e.isIntersecting&&this.isVideo&&this.$refs.video&&this.$refs.video.pause()})},{rootMargin:"200px",threshold:0}),this.observer.observe(this.$el)},handleMouseEnter(){this.isHovering=!0},handleMouseLeave(){this.isHovering=!1},handleFocusIn(){this.hasFocusWithin=!0},handleFocusOut(o){this.$el.contains(o.relatedTarget)||(this.hasFocusWithin=!1)},openPreview(){this.canPreview&&this.$emit("preview",this.item)},copyProject(){this.copying=!0,this.$emit("copy-project",this.item.remixId,()=>{this.copying=!1})}}},F=["tabindex","role","aria-label"],x={class:"inspiration-item__media"},C=["src"],L=["src","alt"],V=["inert"],B=["href"],M={key:1,class:"inspiration-item__credit"};function S(o,e,t,A,d,i){const v=b("Button"),g=b("RouterLink");return r(),s("div",{class:p(["inspiration-item",{"inspiration-item--previewable":i.canPreview,"inspiration-item--uniform":t.uniform}]),onMouseenter:e[3]||(e[3]=(...n)=>i.handleMouseEnter&&i.handleMouseEnter(...n)),onMouseleave:e[4]||(e[4]=(...n)=>i.handleMouseLeave&&i.handleMouseLeave(...n)),onFocusin:e[5]||(e[5]=(...n)=>i.handleFocusIn&&i.handleFocusIn(...n)),onFocusout:e[6]||(e[6]=(...n)=>i.handleFocusOut&&i.handleFocusOut(...n)),onClick:e[7]||(e[7]=(...n)=>i.openPreview&&i.openPreview(...n)),onKeydown:[e[8]||(e[8]=f(l((...n)=>i.openPreview&&i.openPreview(...n),["prevent"]),["enter"])),e[9]||(e[9]=f(l((...n)=>i.openPreview&&i.openPreview(...n),["prevent"]),["space"]))],tabindex:i.canPreview?0:void 0,role:i.canPreview?"button":void 0,"aria-label":i.previewLabel},[w("div",x,[i.isVideo?(r(),s("video",{key:0,ref:"video",src:i.videoSrc,muted:"",loop:"",playsinline:"",preload:"metadata"},null,8,C)):(r(),s("img",{key:1,src:i.mediaSrc,alt:t.item.tags?.length?t.item.tags.join(", "):"Inspiration item"},null,8,L)),t.item.tutorialUrl||t.isAuthenticated&&t.item.remixId||!t.isAuthenticated?(r(),s("div",{key:2,class:"inspiration-item__actions",onClick:e[0]||(e[0]=l(()=>{},["stop"])),inert:!i.actionsVisible},[t.item.tutorialUrl?(r(),m(v,{key:0,href:t.item.tutorialUrl,target:"_blank",rel:"noopener noreferrer",icon:"play",class:"button secondary-inverse small inspiration-item__action-button"},{default:h(()=>[...e[10]||(e[10]=[u("Watch Tutorial â",-1)])]),_:1},8,["href"])):a("",!0),t.isAuthenticated&&t.item.remixId?(r(),m(v,{key:1,disabled:d.copying,loading:d.copying,onClick:i.copyProject,class:"button secondary-inverse small inspiration-item__action-button"},{default:h(()=>[d.copying?a("",!0):(r(),s(y,{key:0},[u(c(t.actionLabel),1)],64)),d.copying?(r(),s(y,{key:1}
1,[u(c(t.actionPendingLabel),1)],64)):a("",!0)]),_:1},8,["disabled","loading","onClick"])):t.isAuthenticated?a("",!0):(r(),m(g,{key:2,to:"/login?signup=true",class:"button secondary-inverse small inspiration-item__action-button"},{default:h(()=>[...e[11]||(e[11]=[u(" Login to copy ",-1)])]),_:1}))],8,V)):a("",!0),t.item.credit||t.item.credit_nonlink||i.madeWithUnicornAI?(r(),s("div",{key:3,class:"inspiration-item__credits",style:k({color:t.item.credit_color||"#fff"})},[t.item.credit?(r(),s("a",{key:0,href:`/dashboard/community/${t.item.credit}`,class:"inspiration-item__credit",onClick:e[1]||(e[1]=l(()=>{},["stop"]))},"@"+c(t.item.credit),9,B)):t.item.credit_nonlink?(r(),s("span",M,c(t.item.credit_nonlink),1)):a("",!0),i.madeWithUnicornAI?(r(),s("a",{key:2,href:"/docs/ai",target:"_blank",rel:"noopener noreferrer",class:"inspiration-item__credit",onClick:e[2]||(e[2]=l(()=>{},["stop"]))},"Unicorn AI")):a("",!0)],4)):a("",!0)])],42,F)}const E=I(P,[["render",S],["__scopeId","data-v-31f770b9"]]);export{E as I}; 2 3//# chunkId=01a0d9af-403e-75b1-9c52-a5b80cd43700
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.