import{an as $,J as b,ao as S,d as A,o as a,c as i,K as z,j as c,L as B,m as x,b as s,n as k,t as r,p as N,z as j,r as H,G as I,W as P,k as L,l as T,f as w,i as D,g as y,X as E,e as V,F as q,h as F,R as Q}from"./index-CGCs88Z3.js";import{I as K}from"./PhClock.vue-FwEMd8aM.js";import{h as W,i as G}from"./api-BU3keoB3.js";function O(e=""){if(!$())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const n=S(e),t=b(n);if(!t)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return t}const R=["width","height","fill","transform"],J={key:0},U=s("path",{d:"M208,52H182.42L170,33.34A12,12,0,0,0,160,28H96a12,12,0,0,0-10,5.34L73.57,52H48A28,28,0,0,0,20,80V192a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V80A28,28,0,0,0,208,52Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4H80a12,12,0,0,0,10-5.34L102.42,52h51.15L166,70.66A12,12,0,0,0,176,76h32a4,4,0,0,1,4,4ZM128,84a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,84Zm0,72a24,24,0,1,1,24-24A24,24,0,0,1,128,156Z"},null,-1),X=[U],Y={key:1},_=s("path",{d:"M208,64H176L160,40H96L80,64H48A16,16,0,0,0,32,80V192a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V80A16,16,0,0,0,208,64ZM128,168a36,36,0,1,1,36-36A36,36,0,0,1,128,168Z",opacity:"0.2"},null,-1),ee=s("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"},null,-1),te=[_,ee],ae={key:2},se=s("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm-44,76a36,36,0,1,1-36-36A36,36,0,0,1,164,132Z"},null,-1),ne=[se],ie={key:3},oe=s("path",{d:"M208,58H179.21L165,36.67A6,6,0,0,0,160,34H96a6,6,0,0,0-5,2.67L76.78,58H48A22,22,0,0,0,26,80V192a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V80A22,22,0,0,0,208,58Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V80A10,10,0,0,1,48,70H80a6,6,0,0,0,5-2.67L99.21,46h57.57L171,67.33A6,6,0,0,0,176,70h32a10,10,0,0,1,10,10ZM128,90a42,42,0,1,0,42,42A42,42,0,0,0,128,90Zm0,72a30,30,0,1,1,30-30A30,30,0,0,1,128,162Z"},null,-1),le=[oe],re={key:4},ce=s("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"},null,-1),ue=[ce],de={key:5},me=s("path",{d:"M208,60H178.13L163.32,37.78A4,4,0,0,0,160,36H96a4,4,0,0,0-3.32,1.78L77.85,60H48A20,20,0,0,0,28,80V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V80A20,20,0,0,0,208,60Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V80A12,12,0,0,1,48,68H80a4,4,0,0,0,3.33-1.78L98.13,44h59.72l14.82,22.22A4,4,0,0,0,176,68h32a12,12,0,0,1,12,12ZM128,92a40,40,0,1,0,40,40A40,40,0,0,0,128,92Zm0,72a32,32,0,1,1,32-32A32,32,0,0,1,128,164Z"},null,-1),fe=[me],ge={name:"PhCamera"},he=A({...ge,props:{weight:{type:String},size:{type:[String,Number]},color:{type:String},mirrored:{type:Boolean}},setup(e){const n=e,t=b("weight","regular"),u=b("size","1em"),m=b("color","currentColor"),o=b("mirrored",!1),l=x(()=>n.weight??t),g=x(()=>n.size??u),f=x(()=>n.color??m),d=x(()=>n.mirrored!==void 0?n.mirrored?"scale(-1, 1)":void 0:o?"scale(-1, 1)":void 0);return(p,h)=>(a(),i("svg",B({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:g.value,height:g.value,fill:f.value,transform:d.value},p.$attrs),[z(p.$slots,"default"),l.value==="bold"?(a(),i("g",J,X)):l.value==="duotone"?(a(),i("g",Y,te)):l.value==="fill"?(a(),i("g",ae,ne)):l.value==="light"?(a(),i("g",ie,le)):l.value==="regular"?(a(),i("g",re,ue)):l.value==="thin"?(a(),i("g",de,fe)):c("",!0)],16,R))}}),Z=A({__name:"StatusBadge",props:{kind:{},label:{}},setup(e){const n={sale:"bg-white/[.94] text-fg",auction:"bg-amber text-white",new:"bg-primary text-white",reduced:"bg-primary text-white",ending:"bg-danger text-white",dark:"bg-fg text-white"};return(t,u)=>(a(),i("span",{class:k(["inline-flex h-6 items-center gap-1.5 rounded-[6px] px-[9px] text-[11px] font-semibold uppercase tracking-[.04em]",n[e.kind]])},r(e.label),3))}}),xe={class:"relative block h-full w-full"},pe={key:0,class:"absolute inset-0 animate-pulse bg-black/[.06]"},ve=["src","loading"],ye=A({__name:"LoadImg",props:{src:{},eager:{type:Boolean},imgClass:{}},emits:["error"],setup(e,{emit:n}){const t=e,u=n,m=H(null),o=H(!1),l=H(!1),g=()=>{var f;return o.value=!!((f=m.value)!=null&&f.complete)&&m.value.naturalWidth>0};return N(g),j(()=>t.src,()=>{o.value=!1,l.value=!1,I(g)}),(f,d)=>(a(),i("span",xe,[!o.value&&!l.value?(a(),i("span",pe)):c("",!0),s("img",{ref_key:"el",ref:m,src:e.src,alt:"",loading:e.eager?"eager":"lazy",decoding:"async",referrerpolicy:"no-referrer",draggable:"false",class:k(["transition-opacity duration-300",[e.imgClass??"block h-full w-full object-cover",o.value?"opacity-100":"opacity-0"]]),onLoad:d[0]||(d[0]=p=>o.value=!0),onError:d[1]||(d[1]=p=>{l.value=!0,u("error")})},null,42,ve)]))}}),C=new Set;function be(e,n="low"){if(!e||C.has(e))return;C.add(e);const t=new Image;t.referrerPolicy="no-referrer",t.fetchPriority=n,t.decoding="async",t.src=e}function we(e,n="low"){for(const t of e)be(t,n)}function ke(e,n,t){const u=[n,t];(n==="sale"?e.prefetchQuery({queryKey:u,queryFn:()=>W(t),staleTime:6e4}):e.prefetchQuery({queryKey:u,queryFn:()=>G(t),staleTime:6e4})).then(()=>{var l;const o=e.getQueryData(u);we(((l=o==null?void 0:o.images)==null?void 0:l.slice(0,3))??[],"high")})}const Ae={class:"relative aspect-[4/3] overflow-hidden bg-[#DCE3DF]"},He={class:"absolute left-2.5 top-2.5 flex gap-1.5"},Le=["aria-label","aria-pressed"],Ve={key:1,class:"absolute bottom-2 right-2 inline-flex h-[22px] items-center gap-[5px] rounded-[5px] bg-fg/70 px-2 text-[11px] font-medium text-white"},Ze={class:"flex flex-1 flex-col gap-2.5 px-4 pb-3 pt-3.5"},Ce={class:"flex flex-col gap-[3px]"},Me={class:"line-clamp-2 text-[15px] font-semibold leading-[1.35] tracking-[-.005em]"},$e={class:"truncate text-[13px] text-fg-muted"},Se={class:"flex flex-wrap items-baseline justify-between gap-2.5"},ze={class:"flex flex-wrap items-baseline gap-2"},Be={class:"tnum text-[20px] font-extrabold tracking-[-.01em]"},Ne={key:0,class:"rounded-[5px] bg-primary-soft px-[7px] py-0.5 text-[12px] font-semibold text-primary"},je={key:0,class:"tnum text-[12px] text-fg-muted"},Ie={key:0,class:"flex flex-wrap gap-1.5 text-[12.5px] text-fg-muted"},Pe={key:0,class:"h-[3px] w-[3px] rounded-full bg-border-strong"},Te={key:1,class:"flex items-center justify-between gap-2 rounded-[7px] bg-amber-soft px-2.5 py-2 text-[12.5px] font-medium text-amber-fg"},De={class:"inline-flex min-w-0 items-center gap-1.5"},Ee={class:"truncate"},qe={key:0,class:"flex-none text-amber-fg-2"},Fe={class:"mt-auto flex justify-between gap-3 border-t border-border-soft pt-2.5 text-[11.5px] text-fg-subtle"},Qe={class:"truncate"},Ke={key:0,class:"truncate"},Re=A({__name:"PropertyCard",props:{item:{},compact:{type:Boolean},selected:{type:Boolean}},emits:["hover"],setup(e,{emit:n}){const t=e,u=n,m=P(),o=x(()=>m.isSaved(t.item.kind,t.item.id)),l=x(()=>t.item.kind==="auction"),g=O();let f=!1;function d(){f||(f=!0,ke(g,t.item.kind,t.item.id))}return(p,h)=>(a(),L(y(Q),{to:e.item.href,class:k(["group flex flex-col overflow-hidden rounded-[18px] border bg-surface text-fg no-underline shadow-card transition-shadow duration-150 hover:text-fg hover:shadow-card-hover",e.selected?"border-primary ring-2 ring-primary/25":"border-border-soft"]),onMouseenter:h[1]||(h[1]=v=>{u("hover",e.item.id),d()}),onTouchstartPassive:d,onFocus:d,onMouseleave:h[2]||(h[2]=v=>u("hover",null))},{default:T(()=>[s("div",Ae,[e.item.image?(a(),L(ye,{key:0,src:e.item.image,eager:""},null,8,["src"])):c("",!0),s("div",He,[w(Z,{kind:e.item.badge,label:e.item.status},null,8,["kind","label"]),e.item.second&&!e.compact?(a(),L(Z,{key:0,kind:"dark",label:e.item.second},null,8,["label"])):c("",!0)]),s("button",{type:"button","aria-label":o.value?"Odebrat z uložených":"Uložit","aria-pressed":o.value,class:k(["absolute right-2 top-2 grid h-8 w-8 place-items-center rounded-full bg-white/[.92] transition-colors hover:text-danger",o.value?"text-danger":"text-fg"]),onClick:h[0]||(h[0]=D(v=>y(m).toggle(e.item),["prevent","stop"]))},[w(y(E),{size:16,weight:o.value?"fill":"regular"},null,8,["weight"])],10,Le),e.item.photos>0?(a(),i("span",Ve,[w(y(he),{size:12}),V(r(e.item.photos),1)])):c("",!0)]),s("div",Ze,[s("div",Ce,[s("div",Me,r(e.item.title),1),s("div",$e,r(e.item.location),1)]),s("div",Se,[s("div",ze,[s("span",Be,r(e.item.price),1),l.value&&e.item.discount?(a(),i("span",Ne,r(e.item.discount),1)):c("",!0)]),e.item.priceNote&&!e.compact?(a(),i("span",je,r(e.item.priceNote),1)):c("",!0)]),e.item.meta.length?(a(),i("div",Ie,[(a(!0),i(q,null,F(e.item.meta,(v,M)=>(a(),i("span",{key:v,class:"inline-flex items-center gap-1.5"},[M>0?(a(),i("span",Pe)):c("",!0),V(r(v),1)]))),128))])):c("",!0),l.value?(a(),i("div",Te,[s("span",De,[w(y(K),{size:13,class:"flex-none"}),s("span",Ee,r(e.item.auctionDate),1)]),e.item.auctionTail?(a(),i("span",qe,r(e.item.auctionTail),1)):c("",!0)])):c("",!0),s("div",Fe,[s("span",Qe,r(e.item.source),1),e.item.seller&&!e.compact?(a(),i("span",Ke,r(e.item.seller),1)):c("",!0)])])]),_:1},8,["to","class"]))}});export{he as G,Re as _,ye as a,be as b,we as p,O as u};