1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DoYFg89N.js","./CyGcP7Ue.js","./-zH4zj69.js","./BA2cZanY.js","./BI5BN1rn.js","./DyfadX0W.js","./oiGUARBV.js","./entry.im3Mr2Hu.css"])))=>i.map(i=>d[i]); 2import{c as ot,d as nt,s as ct,C as I,_ as ut,i as lt,h as P,X as dt}from"./BI5BN1rn.js";import{m as f}from"./OSwP1zfw.js";import{G as pt,z as mt,N as ft,w as ht,as as o,ag as V,ah as gt,ak as n,ar as N,I as r,al as p,ao as h,am as H,ax as g,aF as S,aE as yt,ac as vt,e as u,r as z}from"./BA2cZanY.js";import{u as bt}from"./DC1xVCuc.js";import"./DyfadX0W.js";import"./oiGUARBV.js";import"./QfiTXYh-.js";import"./BcA_P1LO.js";const It=["data-product"],kt={class:"mediabox"},_t=["data-product"],St={class:"product-name-wrap"},Yt=["innerHTML"],Tt={key:0,class:"js-cart-product-price suggestion-price"},xt={key:0},wt={key:1},Ct={key:0},Et={class:"times"},Mt=["innerHTML"],Nt={key:2,class:"grid-content-availabilityfooter color-a"},zt={key:0,class:"duration"},Rt={key:1,class:"groupsize"},Bt={key:2,class:"groupsize"},Lt={key:3,class:"groupsize"},jt={key:3,class:"tags grid-content-tags"},Ut={class:"grid-content-tagitem"},$t=pt({__name:"SearchSuggestion",props:{product:{type:Object,required:!0},shopId:{type:String,required:!0},linkUrl:{type:String,required:!1}},setup(s){const O=vt(()=>lt(()=>import("./DoYFg89N.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),{$store:F,$translate:d}=mt(),{currency:Y,getYMD:q,makeUrl:$,truncate:G}=ot(),{makeSearchSuggestionImage:X,makeSeoImageFilename:J}=nt(),{onInternalHtmlLinkClick:R}=bt(),{apiUrl:K,locale:Q,mySettings:T,timezone:y}=ct(F),t=s,W=u(()=>t.linkUrl||$(t.shopId,Q.value,void 0,t.product)),Z=u(()=>t.product?.file_id?3:0),tt=u(()=>t.product?.file_id?9:12),B=z(!1),x=z(null),k=z(null),L=u(()=>t.product&&t.product.availability&&Object.keys(t.product.availability).length>0&&Number(t.product.subtype)!==I.SUBTYPE_CONTENT),j=u(()=>t.product&&t.product.type?parseInt(t.product.type,10)===I.TYPE_BUYABLE:!1),U=u(()=>{if(t.product&&parseInt(t.product.type,10)!==0&&t.product.availability){const e=f.unix(t.product.availability.first).tz(y.value);let a=d(e.format("ddd")),i=e.format(d("M/D"));return e.format("YYYY")!==f().tz(y.value).format("YYYY")&&(i=e.format(d("YYYY/MM/DD"))),e.isSame(f().tz(y.value),"day")?(a="",i=d("Today")):e.isSame(f().tz(y.value).add(1,"days"),"day")&&(a="",i=d("Tomorrow")),a+" "+i+" "+et.value}return""}),et=u(()=>{let e=[],a=[];if(k.value)a=k.value;else{if(t.product&&t.product.availability&&t.product.availability.ownStarttime&&t.product.availability.ownStarttime.length){const c=f.unix(t.product.availability.first).tz(y.value),m=f().tz(y.value),w=c.format("E"),b=parseInt(f().format("h"),10)*60+parseInt(f().format("m"),10);for(let C=0;C<t.product.availability.ownStarttime.length;C++){const v=t.product.availability.ownStarttime[C];let E=null,M=null;parseInt(v.datestart,10)&&(E=f(v.datestart,"D.M.YYYY").tz(y.value)),parseInt(v.dateend,10)&&(M=f(v.dateend,"D.M.YYYY").tz(y.value)),!isNaN(parseInt(v.timestart,10))&&(!E||E.isBefore(c))&&(!M||M.isAfter(c))&&v.weekdays.split(",").includes(w)&&(!c.isSame(m,"day")||b<parseInt(v.timestart,10))&&e.push(parseInt(v.timestart,10))}}if(!e.length)return"";e=e.sort((c,m)=>c-m);for(let c=0;c<e.length;c++){const m=Number(e[c]),w=Math.floor(m/60);let b=String(m%60);Number(b)<10&&(b="0"+b),a.push(w+"."+b)}}const i=2;let l="";return a.length>i&&(l=" .. +"+(a.length-i)),d("at")+" "+a.slice(0,i).join(", ")+l}),D=u(()=>{if(t.product&&t.product.availability&&t.product.availability.product_units){const e=t.product.availability.product_units.split(";");if(e.length)return e[0].includes("d")?e[0]=e[0].split("d")[0]+" "+d("d"):e[0].includes("h")?e[0]=e[0].split("h")[0]+" "+d("h"):e[0]=e[0].split("m")[0]+" "+d("m"),e[0]+(e.length>1?"+":"")}return""}),_=u(()=>{if(!L.value)return;const e=at.value;let a=1,i=parseInt(t.product.availability.capacity,10);return i===0?d("Sold out!"):(e&&e[1]&&!i&&(i=e[1]),e?e[0]&&(a=e[0]):a=1,j.value||i===2147483648?"":a!==i?a+"-"+i:a)}),at=u(()=>{if(t.product&&(t.product.sharedResource||t.product.sharedResourcepool)){let e=1,a=null;if(t.product.sharedResource)for(let i=0;i<t.product.sharedResource.length;i++){const l=t.product.sharedResource[i];e=Math.max(e,parseInt(l.mincount)),a?a=Math.min(a,parseInt(l.count)):a=parseInt(l.count)}if(!a&&t.product.sharedResourcepool)for(let i=0;i<t.product.sharedResourcepool.length;i++){const l=t.product.sharedResourcepool[i];for(let c=0;c<l.sharedResource.length;c++){const m=l.sharedResource[c];e=Math.max(e,parseInt(m.mincount)),a?a=Math.min(a,parseInt(m.count)):a=parseInt(m.count)}}return[e,a]}return null}),A=u(()=>{if(!t.product||!t.product.channeldata)return"";let e=P(t.product.description)?t.product.description:t.product.channeldata.description;const a=dt(e||"").replace(/ /g," ");return P(a)?G(a,200):""}),rt=u(()=>t.product?t.product.marketingname||t.product.name:""),it=u(()=>t.product&&parseInt(t.product.voucher_open)),st=u(()=>!(parseInt(t.product.hide_pricing)&&parseInt(t.product.hide_pricing)!==3&&parseInt(t.product.hide_pricing)!==4&&parseInt(t.product.hide_pricing)!==5&&parseInt(t.product.hide_pricing)!==6||parseInt(t.product.subtype,10)===I.SUBTYPE_EVENT||parseInt(t.product.subtype,10)===I.SUBTYPE_CONTENT||B.value));return ft(()=>{const e=t.product.usemarketingname&&t.product.marketingname?t.product.marketingname:t.product.name;x.value=X(t.product.shopid,t.product.file_id,J(t.product.file_title,e),e)??null}),ht(()=>t.product,async()=>
2{if(t.product&&t.product.availability&&parseInt(t.product.type)===I.TYPE_RESERVABLE&&parseInt(t.product.unit_type)<I.UNIT_DAY){const e=q(new Date(parseInt(t.product.availability.first)*1e3));try{const a=await $fetch(K.value+t.product.shopid+"/products/"+t.product.id+"/availabletimes/"+e+".json?count="+t.product.availability.participants);a&&a.starttimes&&a.starttimes.length?k.value=a.starttimes:k.value=null}catch{return}}}),(e,a)=>{const i=ut;return o(),V(i,{event:"click",class:"search-suggestion js-grid-item js-cart-product row separator-line","data-merchant":s.product.shopid,"data-product":s.product.id,key:s.product.id,to:r(W)},{default:gt(()=>[s.product&&s.product.file_id?(o(),n("div",{key:0,class:N("col-md-"+r(Z)+" hidden-sm hidden-xs")},[p("div",{class:"js-cart-product-image fit-width","data-product":s.product.id},[p("span",kt,[r(x)?(o(),V(r(O),{key:0,image:r(x),classes:"mediabox-img"},null,8,["image"])):h("",!0)])],8,It)],2)):h("",!0),p("div",{class:N("js-cart-product-content col-md-"+r(tt)),"data-product":s.product.id},[p("div",St,[p("span",{class:N("js-cart-product-name grid-content-title suggestion-title"+(s.product.id?" is-clickable":"")),innerHTML:r(rt)},null,10,Yt),s.product.price&&r(st)&&!r(B)?(o(),n("span",Tt,[r(it)?(o(),n("span",wt,g(r(Y)(s.product.minprice,r(T).currency))+" - "+g(r(Y)(s.product.maxprice,r(T).currency)),1)):(o(),n(H,{key:0},[parseInt(s.product.multiple_prices)?(o(),n("span",xt,g(r(d)("From")),1)):h("",!0),S(" "+g(r(Y)(s.product.price,r(T).currency)),1)],64))])):h("",!0)]),r(U)?(o(),n("p",Ct,[p("strong",Et,[a[1]||(a[1]=p("i",{class:"fa fa-fw fa-calendar"},null,-1)),p("span",null,g(r(U)),1)])])):h("",!0),r(A)?(o(),n("p",{key:1,class:"grid-content-text product-description",innerHTML:r(A),onClickCapture:a[0]||(a[0]=(...l)=>r(R)&&r(R)(...l))},null,40,Mt)):h("",!0),r(L)?(o(),n("span",Nt,[r(D)?(o(),n("span",zt,[a[2]||(a[2]=p("i",{class:"fa fa-fw fa-clock-o"},null,-1)),S(g(r(D)),1)])):h("",!0),r(j)&&r(_)?(o(),n("span",Rt,[a[3]||(a[3]=p("i",{class:"fa fa-fw fa-cube"},null,-1)),S(g(r(_)),1)])):r(_)?(o(),n("span",Bt,[a[4]||(a[4]=p("i",{class:"fa fa-fw fa-user"},null,-1)),S(g(r(_)),1)])):(o(),n("div",Lt))])):h("",!0),s.product&&s.product.tags&&s.product.tags.length?(o(),n("div",jt,[(o(!0),n(H,null,yt(s.product.tags,l=>(o(),n("span",Ut,g(l),1))),256))])):h("",!0)],10,_t)]),_:1},8,["data-merchant","data-product","to"])}}});export{$t as default};
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.