import{t as j}from"./triplestore-YmGWX4yk.js";import{O as k,C as x,V as w}from"./ChildTreeSearchButton-C65ZPLlZ.js";import{cd as f,aK as a,s as l,bH as i,I as r,ch as B,cQ as C,dh as u,v as O,b9 as o,cs as g,dI as V,av as v,aX as c,t as n,dJ as T,cm as q,H,cn as S,u as m,cl as N}from"./index-UvaAT40e.js";const D={name:"ObjectThumbnail",props:{images:{type:Array,default:()=>[]},imageHeight:{type:[Number,String],required:!0},styling:{type:Boolean,default:!0}},computed:{with_style:function(){return this.styling?"grey-lighten-4":""},placeholder_height:function(){return this.imageHeight*.6},placeholder_pos:function(){return"top: "+this.imageHeight*.2+"px"}}},I={class:"text-h1 letter-logo"};function E(s,_,t,p,e,h){return t.images.length>0&&t.images[0].url?(a(),l(u,{key:0,height:t.imageHeight,src:t.images[0].url,style:{"background-color":"#f5f5f5"},class:"thesaurus-thumb"},{placeholder:i(()=>[r(B,{class:"fill-height ma-0",align:"center",justify:"center"},{default:i(()=>[r(C,{indeterminate:"",color:"grey-lighten-4"})]),_:1})]),_:1},8,["height","src"])):t.images.length?(a(),l(g,{key:1,height:t.imageHeight,width:"100%",class:"pa-4 text-center mx-auto",style:{"background-color":"#f5f5f5"}},{default:i(()=>[O("div",I,o(t.images[0]),1)]),_:1},8,["height"])):(a(),l(g,{key:2,height:t.imageHeight,width:"100%"},{default:i(()=>[r(u,{alt:"Antiquitatum Thesaurus Logo",class:"shrink",src:V,gradient:"to top right, rgba(255,255,255,.7), rgba(255,255,255,.7)",height:h.placeholder_height,style:v(h.placeholder_pos)},null,8,["height","style"])]),_:1},8,["height"]))}const P=f(D,[["render",E]]),Q={name:"ObjectCard",components:{ObjectBreadcrumbs:k,ObjectThumbnail:P,ChildTreeSearchButton:x},props:{iri:{type:String,required:!1,default:""},objectData:{type:Object,required:!1,default:()=>{}},imageHeight:{type:Number,required:!0},withBreadcrumbs:{type:Boolean,default:!1},cardWidth:{type:Number,default:null},forwardQueryParams:{type:Boolean,default:!1},tooltipEnabled:{type:Boolean,default:!1},searchMode:{type:String,default:""}},data(){return{data:null,loading:!0}},computed:{query_params(){let s=Object.assign({},this.$route.query);return s.mode=this.searchMode,s},link_to(){return this.data.iri?{name:"Object",params:{objectid:this.data.iri.split("/").slice(-1)[0]},query:this.forwardQueryParams?this.query_params:{}}:""},link_href(){return!this.data.iri&&this.data.link?this.data.link:""},target(){return this.data.iri?!1:"_blank"}},async created(){this.objectData?this.data=this.objectData:this.iri?(this.data=await j.get_object_card_data(this.iri),this.data.iri=this.iri):console.error("ObjectCard requires either iri or object_data as prop."),this.loading=!1}},A={key:0},M={key:1};function W(s,_,t,p,e,h){const d=c("ObjectThumbnail"),y=c("ChildTreeSearchButton"),b=c("ObjectBreadcrumbs");return e.data?(a(),l(N,{key:0,class:"object-card text-decoration-none",variant:"outlined",to:h.link_to,href:h.link_href,target:h.target,"min-width":"110","max-width":"100%",width:t.cardWidth,height:"100%"},{default:i(()=>[r(d,{images:e.data.images,"image-height":t.imageHeight,has_children:e.data.has_children},null,8,["images","image-height","has_children"]),e.data.has_children?(a(),l(y,{key:0,class:"ma-2 text-right",objectid:e.data.iri.split("/").slice(-1)[0],style:{position:"absolute",top:"0px",right:"0px"}},null,8,["objectid"])):n("",!0),r(T,{class:"pt-1 px-2 my-0 pb-0 narrow"},{default:i(()=>[t.withBreadcrumbs?(a(),l(b,{key:0,data:e.data.path,link:!1},null,8,["data"])):n("",!0)]),_:1}),r(q,{class:"text-subtitle-2 px-2 py-0 mt-1 mb-1 narrow-wider hyphenate"},{default:i(()=>[H(o(e.data.title),1)]),_:1}),r(S,{class:"pt-1 px-2 pb-0 mb-1 text-caption narrow-light hyphenate text-primary"},{default:i(()=>[e.data.custody?(a(),m("div",A,o(e.data.custody),1)):e.data.location?(a(),m("div",M,o(e.data.location),1)):n("",!0)]),_:1}),e.data&&!(s.$vuetify.display.sm||s.$vuetify.display.xs)?(a(),l(w,{key:1,activator:"parent",location:"left",width:"40vh","open-delay":"600","content-class":"image-tooltip",disabled:!t.tooltipEnabled},{default:i(()=>[r(d,{images:e.data.images,"image-height":"40vh"},null,8,["images"])]),_:1},8,["disabled"])):n("",!0)]),_:1},8,["to","href","target","width"])):n("",!0)}const L=f(Q,[["render",W],["__scopeId","data-v-63704a7d"]]);export{P as O,L as a};