PageSourceSearch

https://xquare.net/_nuxt/vP3yZV8K.js

js xquare.net collected 2026-10-02 01:10:44 UTC 126,287 bytes, 1 lines download raw bytes

1import{_ as fn}from"./E1pjmW50.js";import{_ as vn}from"./DnyBr02m.js";import{f as Ls}from"./BdPsR_AQ.js";import{d as js,C as Ns,S as bn,T as yn,a as Bs,w as V,x as m,o as vs,a5 as Os,b as o,c as l,h as t,e,t as i,m as W,f as A,g as Z,j as u,W as nt,q as ee,L as te,n as w,F as y,r as _,i as b,k,v as E,s as pe,$ as Me,X as Ee,y as v,J as Ms,E as xn,Q as gn,u as _n,D as hn,A as kn,_ as at,a7 as wn,K as Es}from"./aDqk-s0q.js";import{t as Cn,v as $n,w as zn,x as Sn,y as An,z as Rn,u as Tn}from"./B35Axm-G.js";import{u as In}from"./BS1J8NmY.js";import{u as Dn}from"./D2f9qUix.js";import{u as Un,_ as Ln}from"./BmacO9LR.js";import{a as Mn}from"./BCoxM2y3.js";import{u as En}from"./CQU6jjIx.js";import{h as jn}from"./Bgw7p6-3.js";const Nn={class:"flex-1 min-w-0"},Bn={class:"text-xs text-gray-500 mt-0.5 truncate"},On={key:1,class:"bg-white border border-gray-100 rounded-2xl p-6 text-center mb-4 shadow-sm"},Pn={key:2,class:"bg-white border border-gray-100 rounded-2xl p-5 mb-4 shadow-sm flex items-center gap-3"},Vn={class:"flex-1 min-w-0"},Fn={class:"text-xs text-gray-500 mt-0.5 truncate"},qn={class:"flex-1 overflow-y-auto px-5 py-4 space-y-4"},Kn={key:0,class:"space-y-1.5"},Jn=["aria-expanded"],Gn={class:"flex-1 min-w-0"},Wn={class:"text-sm font-bold text-gray-900 truncate mt-0.5"},Hn={key:0,role:"listbox",class:"absolute z-30 left-0 right-0 mt-2 bg-white border border-gray-100 rounded-xl shadow-xl shadow-gray-200/60 overflow-hidden max-h-[50vh] overflow-y-auto"},Yn=["aria-selected","onClick"],Qn={class:"flex-1 min-w-0"},Zn={class:"text-sm font-bold text-gray-900 truncate"},Xn={class:"text-xs text-gray-500 mt-0.5 inline-flex items-center gap-2"},ea={class:"inline-flex items-center gap-1"},ta={key:0,class:"inline-flex items-center gap-1"},sa={key:0,class:"material-symbols-outlined text-primary shrink-0",style:{"font-size":"1.25rem"}},na={class:"space-y-1.5"},aa=["aria-expanded"],oa={class:"flex-1 min-w-0"},la={class:"text-sm font-bold text-gray-900 truncate mt-0.5"},ra={key:0,role:"dialog",class:"absolute z-30 left-0 right-0 mt-2 bg-white border border-gray-100 rounded-2xl shadow-xl shadow-gray-200/60 p-4"},ia={class:"flex items-center justify-between mb-3"},ua=["disabled"],da={class:"text-sm font-bold text-gray-900"},ca=["disabled"],pa={class:"grid grid-cols-7 gap-1 mb-1"},ma={class:"grid grid-cols-7 gap-1"},fa={key:0,class:"h-10"},va=["disabled","onClick"],ba={key:0,class:"absolute bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-primary"},ya={class:"mt-3 pt-3 border-t border-gray-100 flex items-center justify-between gap-3"},xa={key:0,class:"text-red-600 text-xs mt-1"},ga={key:1,class:"space-y-1.5"},_a={class:"grid grid-cols-2 gap-2"},ha=["onClick"],ka={class:"flex items-center gap-1 font-extrabold text-base leading-tight"},wa={key:0,class:"opacity-60"},Ca={key:1},$a={key:0,class:"text-[11px] opacity-80 mt-0.5 truncate"},za={key:2,class:"space-y-1.5"},Sa={class:"flex items-center justify-between bg-gray-50 rounded-xl p-2"},Aa=["disabled"],Ra={class:"flex-1 text-center"},Ta={class:"text-2xl font-extrabold text-gray-900 leading-none"},Ia={class:"text-[10px] text-gray-500 uppercase tracking-wider font-bold mt-1"},Da=["disabled"],Ua={key:3,class:"text-sm"},La={key:0,class:"flex items-center gap-2 text-gray-500 bg-gray-50 rounded-lg px-3 py-2.5"},Ma={key:1,class:"flex items-center gap-2 text-red-700 bg-red-50 rounded-lg px-3 py-2.5"},Ea={key:2,class:"flex items-center gap-2 text-amber-700 bg-amber-50 rounded-lg px-3 py-2.5"},ja={key:3,class:"flex items-center gap-2 text-emerald-700 bg-emerald-50 rounded-lg px-3 py-2.5"},Na={class:"text-xs font-bold"},Ba={key:4,class:"space-y-1.5"},Oa={key:5,class:"space-y-1.5"},Pa=["value"],Va={key:6,class:"flex items-start gap-2 p-3 bg-emerald-50 text-emerald-800 rounded-xl text-sm"},Fa={key:7,class:"flex items-start gap-2 p-3 bg-red-50 text-red-800 rounded-xl text-sm"},qa={class:"font-semibold leading-snug"},Ka={class:"shrink-0 px-5 pt-3 pb-[max(1rem,env(safe-area-inset-bottom))] border-t border-gray-100 bg-white space-y-3"},Ja={key:0,class:"flex items-center justify-between text-sm"},Ga={class:"font-extrabold text-gray-900"},Wa=["disabled"],Ha={key:0,class:"inline-block w-4 h-4 border-2 border-white border-t-transparent roun
1ded-full animate-spin"},Ya={key:1,class:"material-symbols-outlined",style:{"font-size":"1.2rem"}},Qa={key:0,class:"fixed inset-0 z-[1001] bg-white flex flex-col"},Za={class:"flex items-center justify-between px-4 py-3 border-b border-gray-200 shrink-0"},Xa={class:"flex items-center gap-2 min-w-0"},eo={class:"text-xs text-gray-500 truncate"},to=["src"],so=js({__name:"BookingWidgetMobile",props:{spaceSlug:{},spaceId:{}},setup(Ht){const xe=Ht,{createBooking:ot}=Cn(),{commerceFetch:Yt}=In(),se=Ns(),zt=bn(),F=yn(),d=Bs(),{data:re,pending:lt}=Dn(()=>`/api/spaces/${xe.spaceSlug}/booking`,{lazy:!0},"$plqlKnJY3U"),ge=v(()=>re.value?.external_booking_url??null),St=v(()=>re.value?.external_booking_provider??null),rt=v(()=>{switch(St.value){case"sevenrooms":return"SevenRooms";case"whatsapp":return"WhatsApp";default:return"our partner"}}),X=m(!1),ne=v(()=>(re.value?.bookable_products||[]).map(r=>({id:r.id,product_id:r.product_id,label:r.name||r.sessions?.[0]?.name||"Reservation",min_party_size:r.min_party_size||1,max_party_size:r.max_party_size||10,advance_booking_days:r.advance_booking_days||30,deposit_type:r.deposit_type||"none",deposit_value:r.deposit_value||0,sessions:r.sessions||[]}))),R=m(""),q=m(""),C=m(""),O=m(2),H=m(""),je=m(!1),_e=m(null),he=m(!1),Ne=m(!1),Be=m(null),it=m(!1),T=m(null),ut=m(0),j=m([]),Y=m(""),K=m(!1),At=m(null),z=m(!1),g=m(null),ie=m(!1),ke=m(0),Oe=m(null);function ue(){ie.value=!0}function me(){ie.value=!1,K.value=!1,z.value=!1}function we(c){const r=c.touches[0];r&&(Oe.value=r.clientY)}function ae(c){const r=c.touches[0];if(!r||Oe.value==null)return;const p=r.clientY-Oe.value;ke.value=p>0?p:0}function dt(){ke.value>100&&me(),Oe.value=null,ke.value=0}V(ie,c=>{typeof document>"u"||(document.body.style.overflow=c?"hidden":"")}),V(ne,c=>{if(c.length&&!R.value){const r=String(d.query.service||"");R.value=r&&c.some(p=>p.id===r)?r:c[0].id}},{immediate:!0}),V(R,()=>{q.value="",T.value=null}),V(q,()=>{T.value=null,C.value&&Ae()});async function Ce(){if(!se.isAuthenticated.value){j.value=[];return}try{const c=await Yt("/store/vouchers?limit=100");j.value=(c?.vouchers||[]).filter(r=>$n(r))}catch{j.value=[]}}V(()=>se.isAuthenticated.value,()=>{Ce()},{immediate:!0});const S=v(()=>ne.value.find(c=>c.id===R.value)),Pe=v(()=>zn(j.value,R.value));V(Pe,c=>{Y.value&&!c.some(p=>p.code===Y.value)&&(Y.value="");const r=String(d.query.pass||"");r&&!Y.value&&c.some(p=>p.code===r)&&(Y.value=r)},{immediate:!0});const Rt=v(()=>S.value?.sessions||[]),fe=v(()=>S.value?.min_party_size||1),$e=v(()=>S.value?.max_party_size||10);V([fe,$e],([c,r])=>{O.value<c&&(O.value=c),O.value>r&&(O.value=r)},{immediate:!0});const de=v(()=>{const c=new Date;return c.setDate(c.getDate()+1),c.toISOString().slice(0,10)}),J=v(()=>{const c=new Date;return c.setDate(c.getDate()+(S.value?.advance_booking_days||30)),c.toISOString().slice(0,10)}),ct=v(()=>{if(!S.value)return"Online reservations available";const c=S.value.sessions?.length||0,r=[];c&&r.push(`${c} sessions available`);const p=S.value;if(p.deposit_type!=="none"&&p.deposit_value){const D=p.deposit_type==="percentage"?`${p.deposit_value}%`:Ls(p.deposit_value);r.push(`deposit ${D}`)}else r.push("tanpa deposit");return r.join(" · ")}),P=m(Ve()),Tt=["M","S","S","R","K","J","S"];function Ve(){const c=new Date;return c.setDate(c.getDate()+1),{y:c.getFullYear(),m:c.getMonth()}}function ze(c,r,p){const D=String(r+1).padStart(2,"0"),ve=String(p).padStart(2,"0");return`${c}-${D}-${ve}`}function pt(c){return new Date(c).toLocaleDateString("id-ID",{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Se(c){if(!c)return"";const r=/(\d{1,2}):(\d{2})/.exec(c);return r?`${r[1].padStart(2,"0")}:${r[2]}`:c}const Qt=v(()=>new Date(P.value.y,P.value.m,1).toLocaleDateString("id-ID",{month:"long",year:"numeric"})),It=v(()=>{const{y:c,m:r}=P.value,p=new Date(c,r,1).getDay(),D=new Date(c,r+1,0).getDate(),ve=new Date().toISOString().slice(0,10),Re=[];for(let ce=0;ce<p;ce++)Re.push({day:null,value:null,disabled:!0,isToday:!1});for(let ce=1;ce<=D;ce++){const Te=ze(c,r,ce);Re.push({day:ce,value:Te,disabled:Te<de.value||Te>J.value,isToday:Te===ve})}return Re}),mt=v(()=>{const{y:c,m:r}=P.value;return ze(c,r,1)>de.value}),Dt=v(()=>{const{y:c,m:r}=P.value;return ze(r===11?c+1:c,r===11?0:r+1,1)<=J.value});function Zt(){if(!mt.value)return;const{y:c,m:r}=P.value;P.value=r===0?{y:c-1,m:11}:{y:c,m:r-1}}function Xt(){if(!Dt.value)return;const{y:c,m:r}=P.value;P.value=r===11?{y:c+1,m:0}:{y:c,m:r+1}}function es(){if(!z.value&&C.value){const c=new Date(C.value);P.value={y:c.getFullYear(),m:c.getMonth()}}z.value=!z.value}function Fe(c){C.value=c,z.value=!1,vt()}function ts(c){!c.value||c.disabled||Fe(c.value)}function ft(c){if(K.value){const r=At.value;r&&!r.contains(c.target)&&(K.value=!1)}if(z.value){const r=g.value;r&&!r.contains(c.target)&&(z.value=!1)}}function I(c){if(c.key==="Escape"){if(K.value||z.value){K.value=!1,z.value=!1;return}ie.value&&me()}}vs(()=>{document.addEventListener("click",ft),document.addEventListener("keydown",I),(d.query.service||d.query.pass)&&ue()}),Os(()=>{document.removeEventListener("click",ft),document.removeEventListener("keydown",I),typeof document<"u"&&(document.body.style.overflow="")});function vt(){_e.value=null,T.value=null,C.value&&q.value&&Ae()}async function Ae(){if(!(!C.value||!q.value||!R.value)){it.value=!0,T.value=null;try{const p=((await $fetch(`${zt}/store/bookable-products/${R.value}/sessions`,{query:{date:C.value},headers:{"x-publishable-api-key":F}}))?.sessions||[]).find(D=>D.session_id===q.value);p?(T.value=p.status==="available"?"available":p.status,ut.value=p.available??0):T.value="full"}catch{T.value=null}finally{it.value=!1}}}const bt=v(()=>R.value&&q.value&&C.value&&!_e.value&&T.value==="available"&&O.value>=fe.value);async function Q(){if(bt.value){if(se.state.value.loading&&await new Promise(c=>{const r=V(()=>se.state.value.loading,p=>{p||(r(),c())})}),!se.isAuthenticated.value){await Ms(`/m/sign-in?next=${encodeURIComponent(`/m/s/${xe.spaceSlug}`)}`);return}he.value=!0,Be.value=null,Ne.value=!1;try{const c=se.state.value.user?.user_metadata,p=(await ot({bookable_product_id:R.value,session_id:q.value,date:C.value,party_size:O.value,customer_name:c?.full_name||c?.name||se.state.value.user?.email?.split("@")[0]||"",customer_email:se.state.value.user?.email||"",customer_phone:"",notes:H.value||void 0,voucher_code:Pe.value.some(D=>D.code===Y.value)?Y.value:void 0}))?.booking;if(p?.deposit_amount&&p.deposit_amount>0){await Ms(`/m/spaces/checkout?booking_id=${p.id}&slug=${encodeURIComponent(xe.spaceSlug)}`);return}Ne.value=!0,C.value="",H.value="",Y.value="",T.value=null,Ce()}catch(c){Be.value=c?.message||c?.data?.message||"Booking failed. Please try again."}finally{he.value=!1}}}return(c,r)=>(o(),l("div",null,[!t(ne).length&&!t(lt)&&t(ge)?(o(),l("button",{key:0,t
1ype:"button",class:"w-full bg-white border border-gray-100 rounded-2xl shadow-sm mb-4 p-4 flex items-center gap-3 text-left active:scale-[0.98] transition-transform hover:shadow-md",onClick:r[0]||(r[0]=p=>X.value=!0)},[r[13]||(r[13]=e("div",{class:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0"},[e("span",{class:"material-symbols-outlined text-primary",style:{"font-size":"1.5rem"}},"restaurant_menu")],-1)),e("div",Nn,[r[11]||(r[11]=e("p",{class:"text-[10px] font-bold uppercase tracking-widest text-primary leading-none"},"Reservation",-1)),r[12]||(r[12]=e("p",{class:"text-base font-extrabold text-gray-900 leading-tight mt-1"},"Book a Table",-1)),e("p",Bn,"Reservations via "+i(t(rt)),1)]),r[14]||(r[14]=e("span",{class:"material-symbols-outlined text-gray-400",style:{"font-size":"1.5rem"}},"chevron_right",-1))])):!t(ne).length&&!t(lt)?(o(),l("div",On,[...r[15]||(r[15]=[e("div",{class:"w-14 h-14 mx-auto mb-3 rounded-full bg-amber-50 flex items-center justify-center"},[e("span",{class:"material-symbols-outlined text-amber-500",style:{"font-size":"1.75rem"}},"calendar_month")],-1),e("h6",{class:"font-bold text-gray-900 mb-1"},"Booking not available yet",-1),e("p",{class:"text-sm text-gray-500 leading-relaxed"},"This space hasn't enabled online reservations yet. Contact them directly.",-1)])])):t(lt)?(o(),l("div",Pn,[...r[16]||(r[16]=[e("div",{class:"w-12 h-12 rounded-xl bg-gray-100 animate-pulse"},null,-1),e("div",{class:"flex-1 space-y-2"},[e("div",{class:"h-3 w-24 rounded bg-gray-100 animate-pulse"}),e("div",{class:"h-4 w-40 rounded bg-gray-100 animate-pulse"})],-1)])])):(o(),l("button",{key:3,type:"button",class:"w-full bg-white border border-gray-100 rounded-2xl shadow-sm mb-4 p-4 flex items-center gap-3 text-left active:scale-[0.98] transition-transform hover:shadow-md",onClick:ue},[r[19]||(r[19]=e("div",{class:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0"},[e("span",{class:"material-symbols-outlined text-primary",style:{"font-size":"1.5rem"}},"restaurant_menu")],-1)),e("div",Vn,[r[17]||(r[17]=e("p",{class:"text-[10px] font-bold uppercase tracking-widest text-primary leading-none"},"Reservation",-1)),r[18]||(r[18]=e("p",{class:"text-base font-extrabold text-gray-900 leading-tight mt-1"},"Book a Table",-1)),e("p",Fn,i(t(ct)),1)]),r[20]||(r[20]=e("span",{class:"material-symbols-outlined text-gray-400",style:{"font-size":"1.5rem"}},"chevron_right",-1))])),(o(),W(Ee,{to:"body"},[A(nt,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-150","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Z(()=>[t(ie)?(o(),l("div",{key:0,class:"fixed inset-0 z-[1000] bg-black/50",onClick:me})):u("",!0)]),_:1}),A(nt,{"enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-y-full","enter-to-class":"translate-y-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-y-0","leave-to-class":"translate-y-full"},{default:Z(()=>[t(ie)?(o(),l("div",{key:0,class:"fixed inset-x-0 bottom-0 z-[1001] bg-white rounded-t-3xl shadow-2xl max-h-[92vh] flex flex-col",onClick:r[8]||(r[8]=ee(()=>{},["stop"]))},[e("div",{class:"shrink-0 pt-2 pb-1 cursor-grab touch-none",onTouchstartPassive:we,onTouchmovePassive:ae,onTouchend:dt,style:te(t(ke)>0?{transform:`translateY(${t(ke)}px)`}:null)},[...r[21]||(r[21]=[e("div",{class:"w-10 h-1.5 rounded-full bg-gray-300 mx-auto"},null,-1)])],36),e("div",{class:"shrink-0 px-5 pb-3 flex items-center justify-between border-b border-gray-100"},[r[23]||(r[23]=e("div",{class:"flex items-center gap-2.5"},[e("div",{class:"w-9 h-9 rounded-full bg-amber-50 flex items-center justify-center"},[e("span",{class:"material-symbols-outlined text-amber-500",style:{"font-size":"1.25rem"}},"calendar_month")]),e("div",null,[e("p",{class:"text-[10px] font-bold uppercase tracking-widest text-amber-600 leading-none"},"Reservation"),e("h6",{class:"font-bold text-gray-900 text-base leading-tight mt-0.5"},"Book a Table")])],-1)),e("button",{type:"button",class:"w-9 h-9 rounded-full bg-gray-100 hover:bg-gray-200 active:scale-90 transition-all flex items-center justify-center","aria-label":"Tutup",onClick:me},[...r[22]||(r[22]=[e("span",{class:"material-symbols-outlined text-gray-700",style:{"font-size":"1.2rem"}},"close",-1)])])]),e("div",qn,[t(ne).length>1?(o(),l("div",Kn,[r[29]||(r[29]=e("label",{class:"text-[11px] font-bold tracking-wider up
1percase text-gray-500"},"Choose a service",-1)),e("div",{ref_key:"serviceDropdownRef",ref:At,class:"relative"},[e("button",{type:"button",class:w(["w-full flex items-center gap-3 px-4 py-3 bg-white border-2 rounded-xl text-left transition-all",t(K)?"border-primary shadow-md shadow-primary/10":"border-gray-200 hover:border-gray-300"]),"aria-expanded":t(K),"aria-haspopup":"listbox",onClick:r[1]||(r[1]=p=>K.value=!t(K))},[r[25]||(r[25]=e("div",{class:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0"},[e("span",{class:"material-symbols-outlined text-primary",style:{"font-size":"1.15rem"}},"restaurant")],-1)),e("div",Gn,[r[24]||(r[24]=e("p",{class:"text-[10px] font-bold uppercase tracking-widest text-gray-400 leading-none"},"Layanan",-1)),e("p",Wn,i(t(S)?.label||"Choose a service"),1)]),e("span",{class:w(["material-symbols-outlined text-gray-400 transition-transform",t(K)?"rotate-180":""]),style:{"font-size":"1.25rem"}},"expand_more",2)],10,Jn),A(nt,{"enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:Z(()=>[t(K)?(o(),l("div",Hn,[(o(!0),l(y,null,_(t(ne),p=>(o(),l("button",{key:p.id,type:"button",role:"option","aria-selected":t(R)===p.id,class:w(["w-full flex items-center gap-3 px-4 py-3 text-left transition-colors border-b border-gray-50 last:border-b-0",t(R)===p.id?"bg-primary/5":"hover:bg-gray-50 active:bg-gray-100"]),onClick:D=>{R.value=p.id,K.value=!1}},[e("div",{class:w(["w-9 h-9 rounded-lg flex items-center justify-center shrink-0",t(R)===p.id?"bg-primary text-white":"bg-gray-100 text-gray-500"])},[...r[26]||(r[26]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1.15rem"}},"restaurant",-1)])],2),e("div",Qn,[e("p",Zn,i(p.label||"Reservation"),1),e("p",Xn,[e("span",ea,[r[27]||(r[27]=e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"group",-1)),b(" "+i(p.min_party_size)+"–"+i(p.max_party_size)+" tamu ",1)]),p.sessions?.length?(o(),l("span",ta,[r[28]||(r[28]=e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"schedule",-1)),b(" "+i(p.sessions.length)+" sesi ",1)])):u("",!0)])]),t(R)===p.id?(o(),l("span",sa,"check_circle")):u("",!0)],10,Yn))),128))])):u("",!0)]),_:1})],512)])):u("",!0),e("div",na,[r[35]||(r[35]=e("label",{class:"text-[11px] font-bold tracking-wider uppercase text-gray-500"},"Tanggal",-1)),e("div",{ref_key:"dateDropdownRef",ref:g,class:"relative"},[e("button",{type:"button",class:w(["w-full flex items-center gap-3 px-4 py-3 bg-white border-2 rounded-xl text-left transition-all",t(z)?"border-primary shadow-md shadow-primary/10":"border-gray-200 hover:border-gray-300"]),"aria-expanded":t(z),"aria-haspopup":"dialog",onClick:es},[r[31]||(r[31]=e("div",{class:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0"},[e("span",{class:"material-symbols-outlined text-primary",style:{"font-size":"1.15rem"}},"calendar_month")],-1)),e("div",oa,[r[30]||(r[30]=e("p",{class:"text-[10px] font-bold uppercase tracking-widest text-gray-400 leading-none"},"Choose a date",-1)),e("p",la,i(t(C)?pt(t(C)):"Not selected"),1)]),e("span",{class:w(["material-symbols-outlined text-gray-400 transition-transform",t(z)?"rotate-180":""]),style:{"font-size":"1.25rem"}},"expand_more",2)],10,aa),A(nt,{"enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:Z(()=>[t(z)?(o(),l("div",ra,[e("div",ia,[e("button",{type:"button",class:"w-9 h-9 rounded-lg hover:bg-gray-100 disabled:opacity-30 disabled:hover:bg-transparent flex items-center justify-center transition-colors",disabled:!t(mt),onClick:Zt},[...r[32]||(r[32]=[e("span",{class:"material-symbols-outlined text-gray-600",style:{"font-size":"1.25rem"}},"chevron_left",-1)])],8,ua),e("div",da,i(t(Qt)),1),e("button",{type:"button",class:"w-9 h-9 rounded-lg hover:bg-gray-100 disabled:opacity-30 disabled:hover:bg-transparent flex items-center justify-center transition-colors",disabled:!t(Dt),onClick:Xt},[...r[33]||(r[33]=[e("span",{class:"material-symbols-outlined text-gray-600",style:{"font-size":"1.25rem"}},"chevron_right",-1)])],8,ca)]),e("div",pa,[(o(),l(y,null,_(Tt,p=>e("div",{key:p,class:"text-center text-[10px] font-bold uppercase tracking-wider text-gray-400 py-1"},i(p),1)),64))]),e("div",ma,[(o(!0),l(y,null,_(t(It),(p,D)=>(o(),l(y,{key:D},[p.value?(o(),l("button",{key:1,type:"button",disabled:p.disabled,class:w(["h-10 w-full rounded-lg text-sm font-semibold transition-all relative flex items-center justify-center",{"text-gray-300 cursor-not-allowed":p.disabled,"bg-primary text-white shadow-md shadow-primary/30":!p.disabled&&t(C)===p.value,"bg-primary/10 text-primary hover:bg-primary/15":!p.disabled&&t(C)!==p.value&&p.isToday,"text-gray-700 hover:bg-gray-100":!p.disabled&&t(C)!==p.value&&!p.isToday}]),onClick:ve=>ts(p)},[e("span",null,i(p.day),1),p.isToday&&t(C)!==p.value?(o(),l("span",ba)):u("",!0)],10,va)):(o(),l("div",fa))],64))),128))]),e("div",ya,[r[34]||(r[34]=e("p",{class:"text-[10px] text-gray-400 inline-flex items-center gap-1.5"},[e("span",{class:"w-1.5 h-1.5 rounded-full bg-primary"}),b(" Hari ini ")],-1)),e("button",{type:"button",class:"text-xs font-bold text-gray-500 hover:text-gray-700",onClick:r[2]||(r[2]=p=>z.value=!1)},"Tutup")])])):u("",!0)]),_:1})],512),t(_e)?(o(),l("div",xa,i(t(_e)),1)):u("",!0)]),t(C)&&t(Rt).length?(o(),l("div",ga,[r[36]||(r[36]=e("label",{class:"text-[11px] font-bold tracking-wider up
1percase text-gray-500"},"Choose a session",-1)),e("div",_a,[(o(!0),l(y,null,_(t(Rt),p=>(o(),l("button",{key:p.id,type:"button",class:w(["py-3 px-3 rounded-xl border text-left transition-all",t(q)===p.id?"bg-primary text-white border-primary shadow-md shadow-primary/20":"bg-white text-gray-700 border-gray-200 hover:border-primary/40"]),onClick:D=>q.value=p.id},[e("div",ka,[e("span",null,i(Se(p.start_time)),1),p.end_time?(o(),l("span",wa,"–")):u("",!0),p.end_time?(o(),l("span",Ca,i(Se(p.end_time)),1)):u("",!0)]),p.name?(o(),l("div",$a,i(p.name),1)):u("",!0)],10,ha))),128))])])):u("",!0),t(C)&&t(q)?(o(),l("div",za,[r[37]||(r[37]=e("label",{class:"text-[11px] font-bold tracking-wider uppercase text-gray-500"},"Jumlah tamu",-1)),e("div",Sa,[e("button",{type:"button",class:"w-11 h-11 rounded-lg bg-white border border-gray-200 text-gray-700 text-xl font-bold flex items-center justify-center active:scale-95 transition-transform disabled:opacity-40",disabled:t(O)<=t(fe),onClick:r[3]||(r[3]=p=>O.value=Math.max(t(fe),t(O)-1))},"−",8,Aa),e("div",Ra,[e("div",Ta,i(t(O)),1),e("div",Ia,"Orang · "+i(t(fe))+"–"+i(t($e)),1)]),e("button",{type:"button",class:"w-11 h-11 rounded-lg bg-white border border-gray-200 text-gray-700 text-xl font-bold flex items-center justify-center active:scale-95 transition-transform disabled:opacity-40",disabled:t(O)>=t($e),onClick:r[4]||(r[4]=p=>O.value=Math.min(t($e),t(O)+1))},"+",8,Da)])])):u("",!0),t(C)&&t(q)&&!t(_e)?(o(),l("div",Ua,[t(it)?(o(),l("div",La,[...r[38]||(r[38]=[e("span",{class:"inline-block w-3.5 h-3.5 border-2 border-gray-400 border-t-transparent rounded-full animate-spin"},null,-1),e("span",{class:"text-xs font-semibold"},"Mengecek ketersediaan…",-1)])])):t(T)==="full"?(o(),l("div",Ma,[...r[39]||(r[39]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1.1rem"}},"block",-1),e("span",{class:"text-xs font-bold"},"Sessions are full on this date",-1)])])):t(T)==="too_late"?(o(),l("div",Ea,[...r[40]||(r[40]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1.1rem"}},"schedule",-1),e("span",{class:"text-xs font-bold"},"Too close to start — pick another date",-1)])])):t(T)==="available"?(o(),l("div",ja,[r[41]||(r[41]=e("span",{class:"material-symbols-outlined",style:{"font-size":"1.1rem"}},"check_circle",-1)),e("span",Na,"Tersedia · "+i(t(ut))+" slot tersisa",1)])):u("",!0)])):u("",!0),t(T)==="available"?(o(),l("div",Ba,[e("button",{type:"button",class:"w-full flex items-center justify-between text-[11px] font-bold tracking-wider uppercase text-gray-500",onClick:r[5]||(r[5]=p=>je.value=!t(je))},[r[42]||(r[42]=e("span",{class:"inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.95rem"}},"edit_note"),e("span",null,"Catatan khusus (opsional)")],-1)),e("span",{class:w(["material-symbols-outlined transition-transform",t(je)?"rotate-180":""]),style:{"font-size":"1rem"}},"expand_more",2)]),t(je)?k((o(),l("textarea",{key:0,"onUpdate:modelValue":r[6]||(r[6]=p=>pe(H)?H.value=p:null),rows:"2",class:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm placeholder-gray-400 focus:bg-white focus:border-primary focus:ring-0 transition-colors resize-none",placeholder:"Alergi makanan, permintaan meja khusus, ulang tahun, dll."},null,512)),[[E,t(H)]]):u("",!0)])):u("",!0),t(T)==="available"&&t(Pe).length?(o(),l("div",Oa,[r[44]||(r[44]=e("label",{class:"text-[11px] font-bold tracking-wider uppercase text-gray-500"},"Use a pass (optional)",-1)),k(e("select",{"onUpdate:modelValue":r[7]||(r[7]=p=>pe(Y)?Y.value=p:null),class:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:bg-white focus:border-primary focus:ring-0 transition-colors"},[r[43]||(r[43]=e("option",{value:""},"No pass — pay normally",-1)),(o(!0),l(y,null,_(t(Pe),p=>(o(),l("option",{key:p.id,value:p.code},i(p.tier_label||p.product_title||"Pass")+" ("+i((p.max_redemptions||1)-(p.redemptions_used??p.redemption_count??0))+" left) ",9,Pa))),128))],512),[[Me,t(Y)]]),r[45]||(r[45]=e("p",{class:"text-[11px] text-gray-400"},"A pass covers the deposit; you'll top up any remaining balance.",-1))])):u("",!0),t(Ne)?(o(),l("div",Va,[...r[46]||(r[46]=[e("span",{class:"material-symbols-outlined shrink-0",style:{"font-size":"1.2rem"}},"check_circle",-1),e("span",{class:"font-semibold leading-snug"},"Booking confirmed! Check your bookings page.",-1)])])):u("",!0),t(Be)?(o(),l("div",Fa,[r[47]||(r[47]=e("span",{class:"material-symbols-outlined shrink-0",style:{"font-size":"1.2rem"}},"error",-1)),e("span",qa,i(t(Be)),1)])):u("",!0)]),e("div",Ka,[t(S)?(o(),l("div",Ja,[r[48]||(r[48]=e("span",{class:"text-gray-500 inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined text-amber-500",style:{"font-size":"1rem"}},"verified"),b(" Deposit ")],-1)),e("span",Ga,[t(S).deposit_type!=="none"&&t(S).deposit_value?(o(),l(y,{key:0},[b(i(t(S).deposit_type==="percentage"?t(S).deposit_value+"%":("formatRupiah"in c?c.formatRupiah:t(Ls))(t(S).deposit_value)),1)],64)):(o(),l(y,{key:1},[b("No deposit required")],64))])])):u("",!0),e("button",{type:"button",class:"w-full py-4 bg-primary text-white rounded-xl font-bold text-base shadow-lg shadow-primary/25 active:scale-[0.98] transition-all disabled:opacity-50 disabled:shadow-none disabled:active:scale-100 flex items-center justify-center gap-2",disabled:!t(bt)||t(he),onClick:Q},[t(he)?(o(),l("span",Ha)):(o(),l("span",Ya,"restaurant")),e("span",null,i(t(he)?"Processing…":"Confirm Reservation"),1)],8,Wa)])])):u("",!0)]),_:1})])),(o(),W(Ee,{to:"body"},[A(nt,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-150","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Z(()=>[t(X)?(o(),l("div",{key:0,class:"fixed inset-0 z-[1000] bg-black/60",onClick:r[9]||(r[9]=p=>X.value=!1)})):u("",!0)]),_:1}),A(nt,{"enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-y-full","enter-to-class":"translate-y-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-y-0","leave-to-class":"translate-y-full"},{default:Z(()=>[t(X)?(o(),l("div",Qa,[e("header",Za,[e("div",Xa,[r[49]||(r[49]=e("span",{class:"material-symbols-outlined text-amber-500"}
1,"calendar_month",-1)),r[50]||(r[50]=e("span",{class:"text-sm font-bold uppercase tracking-wider truncate"},"Reservation",-1)),e("span",eo,"· "+i(t(rt)),1)]),e("button",{type:"button",class:"p-2 rounded hover:bg-gray-100 active:scale-95 transition shrink-0","aria-label":"Close",onClick:r[10]||(r[10]=p=>X.value=!1)},[...r[51]||(r[51]=[e("span",{class:"material-symbols-outlined text-gray-700"},"close",-1)])])]),e("iframe",{src:t(ge),class:"flex-1 w-full border-0 bg-white",referrerpolicy:"no-referrer-when-downgrade",allow:"payment *; clipboard-write"},null,8,to)])):u("",!0)]),_:1})]))]))}}),no=Object.assign(so,{__name:"BookingWidgetMobile"}),ao={class:"space-y-6"},oo={key:0,class:"h-48 rounded-2xl bg-surface-container animate-pulse"},lo={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},ro={key:2,class:"rounded-2xl border border-outline-variant/30 bg-surface-container-lowest p-6 text-center space-y-3"},io={key:3,class:"rounded-2xl border border-outline-variant/30 bg-surface-container-lowest overflow-hidden"},uo={class:"p-5 space-y-3"},co={class:"text-lg font-semibold"},po={key:0,class:"text-sm text-on-surface-variant"},mo={key:1,class:"inline-flex items-center px-3 py-1.5 rounded-lg bg-surface-container text-xs text-on-surface-variant"},fo=["disabled"],vo={key:4,class:"rounded-2xl overflow-hidden border border-outline-variant/20 bg-surface-container-lowest"},bo={key:0,class:"absolute top-3 left-3 z-10 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-black/40 text-white text-xs font-bold backdrop-blur-sm"},yo=["href","aria-label"],xo={key:0,viewBox:"0 0 24 24",class:"w-4 h-4",fill:"currentColor"},go={key:1,viewBox:"0 0 24 24",class:"w-4 h-4",fill:"currentColor"},_o={class:"absolute bottom-4 left-5 right-5 flex items-end justify-between gap-3 flex-wrap"},ho={class:"min-w-0"},ko={key:0,class:"text-white font-bold drop-shadow truncate",style:{"font-size":"1.875rem"}},wo={key:2,class:"text-white/90 text-sm flex items-center gap-2 mt-1"},Co={class:"flex items-center gap-2"},$o={key:1,class:"bg-surface-container-lowest/90 text-on-surface-variant text-xs font-medium px-3 py-2 rounded-lg"},zo=["disabled"],So={key:0,class:"border-t border-outline-variant/15"},Ao={class:"px-5 pt-4 pb-3 flex flex-col gap-1"},Ro={class:"flex items-start justify-between gap-2 min-w-0"},To={class:"text-[15px] font-bold tracking-tight leading-snug truncate min-w-0"},Io={class:"font-bold text-on-surface"},Do={class:"font-normal"},Uo={key:1},Lo={key:0,class:"text-xs text-on-surface-variant truncate"},Mo={key:1,class:"text-xs text-on-surface-variant truncate"},Eo={key:1,class:"px-5 py-4 text-sm leading-relaxed text-on-surface-variant border-t border-outline-variant/15"},jo={key:2,class:"px-5 pb-3 text-xs text-error"},No={key:7,role:"tablist","aria-label":"Space sections",class:"flex items-center gap-1 border-b border-outline-variant/30 -mt-2 mb-5 overflow-x-auto snap-x scrollbar-none -mx-4 px-4 lg:-mx-0 lg:px-0"},Bo=["id","aria-selected","aria-controls","tabindex","onClick","onKeydown"],Oo={key:0,"aria-hidden":"true",class:"absolute left-2 right-2 -bottom-px h-0.5 bg-primary rounded-full"},Po={key:8,id:"space-panel-overview",role:"tabpanel","aria-labelledby":"space-tab-overview",tabindex:"0",class:"space-y-4 focus:outline-none"},Vo={key:0,class:"bg-surface-container-lowest rounded-2xl border border-outline-variant/20 p-4"},Fo={key:0,class:"text-sm italic text-on-surface-variant mb-2"},qo={key:3,class:"mt-3 inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-primary/10 text-primary text-xs font-bold"},Ko={key:1,class:"bg-surface-container-lowest rounded-2xl border border-outline-variant/20 p-4 text-xs text-outline"},Jo={key:2,class:"bg-surface-container-lowest rounded-2xl border border-error/30 p-4 text-sm text-error"},Go={key:3},Wo={class:"flex gap-3 overflow-x-auto snap-x snap-mandatory scroll-px-1 pb-3 -mx-4 px-4 lg:-mx-0 lg:px-0"},Ho={key:0,class:"absolute inset-0 flex items-center justify-center material-symbols-outlined text-outline",style:{"font-size":"2.5rem"}},Yo={key:1,class:"absolute top-2 left-2 px-2 py-0.5 rounded-full bg-primary text-on-primary text-[10px] font-bold uppercase tracking-widest"},Qo={class:"p-3 flex-1 flex flex-col gap-1"},Zo={class:"font-bold text-on-surface leading-snug line-clamp-2 text-sm"},Xo={class:"mt-auto pt-2 font-bold text-primary text-sm"},el={key:4},tl={class:"flex gap-3 overflow-x-auto snap-x snap-mandatory pb-3 -mx-4 px-4 lg:-mx-0 lg:px-0"},sl=["title"],nl={key:0,class:"absolute inset-x-0 bottom-0 px-3 py-2 text-xs font-semibold text-white capitalize bg-gradient-to-t from-black/55 via-black/25 to-transparent"},al={key:5,class:"bg-surface-container-lowest rounded-2xl border border-outline-variant/20 p-4"},ol={class:"grid grid-cols-3 gap-2"},ll={class:"material-symbols-outlined text-primary shrink-0",style:{"font-size":"1rem"}},rl={class:"truncate"},il={key:6,class:"bg-surface-container-lowest rounded-2xl border border-outline-variant/20 p-4"},ul={class:"space-y-0.5"},dl={key:0,class:"ml-1.5 text-[10px] font-bold uppercase tracking-wider align-middle"},cl={key:7,class:"bg-surface-container-lowest rounded-2xl border border-outline-variant/20 p-4"},pl={key:8,class:"bg-surface-container-lowest rounded-2xl border border-outline-variant/20 p-4"},ml={class:"grid grid-cols-3 gap-2"},fl=["href","aria-label"],vl={key:0,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},bl={key:1,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},yl={key:2,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},xl={key:3,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},gl={key:4,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},_l={key:5,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},hl={key:6,viewBox:"0 0 24 24",class:"w-4 h-4 text-primary shrink-0",fill:"currentColor"},kl={key:7,class:"material-symbols-outlined text-primary shrink-0",style:{"font-size":"1rem"}},wl={class:"truncate"},Cl={key:9,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_252px] gap-6"},$l={id:"space-panel-feed",role:"tabpanel","aria-labelledby":"space-tab-feed",tabindex:"0",class:"space-y-3 focus:outline-none"},zl={class:"flex items-center gap-2 text-xs font-bold text-primary"},Sl=["disabled"],Al={key:0,class:"text-xs text-error"},Rl={class:"flex items-center justify-end gap-2"},Tl=["disabled"],Il={key:1,class:"text-xs text-outline px-1"},Dl={key:2,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},Ul={key:3,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},Ll={key:4,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},Ml={class:"flex items-center gap-2.5 mb-3"},El={class:"w-9 h-9 rounded-full bg-surface-container-high flex items-center justify-center text-sm font-bold text-primary"},jl={class:"min-w-0"},Nl={class:"text-sm font-bold text-on-surface truncate"},Bl={class:"text-xs text-outline"},Ol={class:"font-bold text-on-surface mb-2 leading-snug hover:text-primary transition-colors",style:{"font-size":"1.125rem"}},Pl={class:"text-sm leading-relaxed text-on-surface-variant line-clamp-3"},Vl={class:"flex items-center gap-4 mt-4 pt-3 border-t border-outline-variant/20 text-sm"},Fl={class:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-primary/8 text-primary font-semibold"},ql={class:"flex items-center gap-1 text-xs text-on-surface-variant"},Kl={key:0,class:"text-outline"},Jl={class:"hidden lg:block space-y-4"},Gl={key:10,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_252px] gap-6"},Wl={id:"space-panel-events",role:"tabpanel","aria-labelledby":"space-tab-events",tabindex:"0",class:"space-y-3 focus:outline-none"},Hl={class:"flex items-end justify-between gap-3"},Yl={class:"min-w-0"},Ql={class:"font-bold text-on-surface leading-tight",style:{"font-size":"1.0625rem"}},Zl={key:0,class:"text-xs text-outline mt-0.5 truncate"},Xl={key:0,class:"text-xs text-outline px-1"},er={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},tr={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},sr=["aria-label"],nr={class:"relative aspect-[16/10] bg-surface-container-high overflow-hidden"},ar={key:1,class:"absolute inset-0 grid place-items-center bg-gradient-to-br from-primary/15 via-surface-container-high to-surface-container"},or={class:"absolute top-1.5 left-1.5 w-9 rounded-lg bg-surface/95 backdrop-blur-sm text-center py-1 shadow-sm"},lr={class:"font-extrabold text-on-surface leading-none",style:{"font-size":"0.875rem"}},rr={class:"text-[8px] uppercase tracking-widest text-outline font-bold mt-0.5"},ir={class:"absolute top-1.5 right-1.5 flex flex-col items-end gap-0.5"},ur={key:0,class:"px-1.5 py-0.5 rounded-full bg-surface/95 backdrop-blur-sm text-[8px] font-extrabold uppercase tracking-widest text-warning"},dr={key:1,class:"px-1.5 py-0.5 rounded-full bg-error text-on-error text-[8px] font-extrabold uppercase tracking-widest"},cr={key:2,class:"px-1.5 py-0.5 rounded-full bg-surface/90 backdrop-blur-sm text-[8px] font-bold text-on-surface"},pr={key:2,class:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 rounded-md bg-surface/95 backdrop-blur-sm font-extrabold text-primary text-[10px]"},mr={class:"p-2.5 flex-1 flex flex-col gap-1"},fr={class:"font-bold text-on-surface leading-snug line-clamp-2",style:{"font-size":"0.8125rem"}},vr={class:"text-[10px] text-on-surface-variant flex items-center gap-1"},br={class:"truncate"},yr={key:0,class:"text-[10px] text-outline flex items-center gap-1"},xr={class:"material-symbols-outlined shrink-0",style:{"font-size":"0.8rem"},"aria-hidden":"true"},gr={class:"truncate"},_r={class:"mt-auto pt-2 space-y-1.5 border-t border-outline-variant/15"},hr={class:"h-1 rounded-full bg-surface-container-high overflow-hidden","aria-hidden":"true"},kr={class:"flex items-center justify-between gap-1.5"},wr={class:"text-[9px] text-outline"},Cr={class:"font-semibold text-on-surface"},$r={key:0,class:"flex items-center justify-center gap-1.5 pt-0.5"},zr=["aria-label","aria-current","onClick"],Sr={class:"hidden lg:block space-y-4"},Ar={key:11,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_252px] gap-6"},Rr={id:"space-panel-courses",role:"tabpanel","aria-labelledby":"space-tab-courses",tabindex:"0",class:"space-y-3 focus:outline-none"},Tr={class:"flex items-end justify-between gap-3"},Ir={class:"min-w-0"},Dr={class:"font-bold text-on-surface leading-tight",style:{"font-size":"1.0625rem"}},Ur={key:0,class:"text-xs text-outline mt-0.5 truncate"},Lr={key:0,class:"text-xs text-outline px-1"},Mr={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},Er={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},jr={class:"flex items-center gap-1.5 flex-wrap"},Nr={key:0,class:"relative inline-flex items-center"},Br=["value"],Or={key:1,class:"relative inline-flex items-center"},Pr=["value"],Vr={class:"relative inline-flex items-center"},Fr={key:0,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-center"},qr={key:1,class:"grid grid-cols-2 lg:grid-cols-3 gap-2.5"},Kr={class:"relative aspect-[16/10] bg-surface-container-high overflow-hidden"},Jr={key:1,class:"absolute inset-0 grid place-items-center bg-gradient-to-br from-primary/15 via-surface-container-high to-surface-container"},Gr={key:2,class:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-surface/95 backdrop-blur-sm text-[8px] font-extrabold uppercase tracking-widest text-on-surface"},Wr={class:"absolute top-1.5 right-1.5 flex flex-col items-end gap-0.5"},Hr={key:0,class:"px-1.5 py-0.5 rounded-full bg-surface/95 backdrop-blur-sm text-[8px] font-extrabold uppercase tracking-widest text-warning"},Yr={key:1,class:"px-1.5 py-0.5 rounded-full bg-surface/90 backdrop-blur-sm text-[8px] font-bold text-on-surface capitalize"},Qr={class:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 rounded-md bg-surface/95 backdrop-blur-sm font-extrabold text-primary text-[10px]"},Zr={class:"p-2.5 flex-1 flex flex-col gap-1"},Xr={class:"font-bold text-on-surface leading-snug line-clamp-2",style:{"font-size":"0.8125rem"}},ei={class:"mt-auto pt-2 flex items-center justify-between gap-1.5 border-t border-outline-variant/15"},ti={class:"text-[9px] text-outline flex items-center gap-1 min-w-0"},si={class:"truncate"},ni={key:12,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_252px] gap-6"},ai={id:"space-panel-reviews",role:"tabpanel","aria-labelledby":"space-tab-reviews",tabindex:"0",class:"space-y-3 focus:outline-none"},oi={key:0,class:"text-xs text-outline px-1"},li={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},ri={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},ii={class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-4 flex items-center gap-4"},ui={class:"text-center"},di={class:"font-extrabold text-primary leading-none",style:{"font-size":"2rem"}},ci={class:"flex-1"},pi={class:"flex items-center gap-0.5"},mi={class:"text-xs text-on-surface-variant mt-1"},fi={class:"flex items-center gap-3"},vi={class:"w-9 h-9 rounded-full bg-primary/10 flex items-center justify-center text-sm font-bold text-primary shrink-0"},bi={class:"flex-1 min-w-0"},yi={class:"text-sm font-bold truncate"},xi={class:"text-xs text-outline"},gi={class:"flex items-center gap-0.5 shrink-0"},_i={key:0,class:"font-bold text-on-surface leading-snug"},hi={key:1,class:"text-sm leading-relaxed text-on-surface-variant whitespace-pre-line"},ki={key:2,class:"mt-2 ml-3 pl-3 border-l-2 border-primary/30 space-y-1"},wi={class:"text-[10px] uppercase tracking-widest font-bold text-primary"},Ci={class:"text-sm text-on-surface-variant whitespace-pre-line"},$i={key:13,id:"space-panel-menu",role:"tabpanel","aria-labelledby":"space-tab-menu",tabindex:"0",class:"focus:outline-none space-y-6"},zi={key:0,class:"text-xs text-outline px-1"},Si={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},Ai={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},Ri={key:3,class:"flex gap-3 overflow-x-auto snap-x snap-mandatory scroll-px-1 pb-3 -mx-4 px-4 lg:-mx-0 lg:px-0"},Ti={key:0,class:"absolute inset-0 flex items-center justify-center material-symbols-outlined text-outline",style:{"font-size":"2.5rem"}},Ii={key:1,class:"absolute top-2 left-2 px-2 py-0.5 rounded-full bg-primary text-on-primary text-[10px] font-bold uppercase tracking-widest"},Di={class:"p-3 flex-1 flex flex-col gap-1"},Ui={class:"font-bold text-on-surface leading-snug line-clamp-2 text-sm"},Li={key:0,class:"text-[11px] text-on-surface-variant line-clamp-2"},Mi={class:"mt-auto pt-2 font-extrabold text-primary text-sm"},Ei={id:"space-panel-gallery"},ji={key:0,class:"text-xs text-outline px-1"},Ni={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},Bi={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},Oi={key:3,class:"flex gap-3 overflow-x-auto snap-x snap-mandatory pb-3 -mx-4 px-4 lg:-mx-0 lg:px-0"},Pi=["title"],Vi={key:0,class:"absolute inset-x-0 bottom-0 px-3 py-2 text-xs font-semibold text-white capitalize bg-gradient-to-t from-black/55 via-black/25 to-transparent"}
1,Fi={key:14,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_252px] gap-6"},qi={id:"space-panel-deals",role:"tabpanel","aria-labelledby":"space-tab-deals",tabindex:"0",class:"space-y-3 focus:outline-none"},Ki={key:0,class:"text-xs text-outline px-1"},Ji={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},Gi={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},Wi={key:3,class:"flex flex-col gap-3"},Hi={key:0,class:"absolute inset-0 flex items-center justify-center material-symbols-outlined text-outline",style:{"font-size":"2rem"}},Yi={key:1,class:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-md bg-error text-on-error text-[10px] font-extrabold leading-none"},Qi={class:"p-4 flex-1 flex flex-col gap-1.5 min-w-0"},Zi={class:"font-bold text-on-surface leading-snug line-clamp-2"},Xi={key:0,class:"text-xs text-on-surface-variant line-clamp-2"},eu={class:"text-xs text-on-surface-variant space-y-1 mt-1"},tu={key:0,class:"flex items-start gap-1.5"},su={key:1,class:"flex items-start gap-1.5"},nu={key:2,class:"flex items-start gap-1.5"},au={class:"mt-auto flex items-end justify-between gap-2 pt-2"},ou={class:"flex items-baseline gap-2 min-w-0"},lu={class:"font-extrabold text-primary truncate"},ru={key:0,class:"text-xs text-on-surface-variant line-through truncate"},iu={key:15,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_252px] gap-6"},uu={id:"space-panel-location",role:"tabpanel","aria-labelledby":"space-tab-location",tabindex:"0",class:"space-y-3 focus:outline-none"},du={key:0,class:"text-xs text-outline px-1"},cu={key:1,class:"rounded-xl border border-error/30 bg-error/5 p-4 text-sm text-error"},pu={key:2,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-6 text-sm text-on-surface-variant"},mu={class:"flex items-start justify-between gap-3"},fu={class:"min-w-0"},vu={class:"font-bold text-on-surface leading-snug",style:{"font-size":"1.125rem"}},bu={key:0,class:"text-xs text-on-surface-variant mt-0.5"},yu=["href"],xu=["href"],gu={class:"hover:underline"},_u={class:"flex flex-wrap items-center gap-3 text-xs"},hu=["href"],ku=["href"],wu={key:16,id:"space-panel-members",role:"tabpanel","aria-labelledby":"space-tab-members",tabindex:"0",class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest overflow-hidden focus:outline-none"},Cu={class:"px-5 py-3 border-b border-outline-variant/15 flex items-center justify-between gap-3"},$u={class:"font-bold text-on-surface"},zu={class:"flex items-center gap-3"},Su={key:0,class:"text-xs text-outline"},Au={key:0,class:"divide-y divide-outline-variant/10"},Ru={class:"w-10 h-10 rounded-full bg-surface-container-high flex items-center justify-center text-sm font-bold text-primary overflow-hidden shrink-0"},Tu=["src","alt"],Iu={key:1},Du={class:"flex-1 min-w-0"},Uu={class:"text-sm font-bold truncate"},Lu={class:"text-xs text-outline truncate"},Mu={class:"text-[10px] font-extrabold uppercase tracking-widest px-2 py-0.5 rounded-full bg-primary/10 text-primary"},Eu=["onClick"],ju={key:1,class:"px-5 py-6 text-sm text-on-surface-variant"},Nu={key:2,class:"px-5 py-6 text-sm text-on-surface-variant"},Bu={key:17,id:"space-panel-manage",role:"tabpanel","aria-labelledby":"space-tab-manage",tabindex:"0",class:"focus:outline-none"},Ou={class:"w-full max-w-lg rounded-xl bg-surface-container-lowest shadow-xl overflow-hidden max-h-[90vh] flex flex-col"},Pu={class:"flex items-center justify-between px-5 py-3 border-b border-outline-variant/15"},Vu={class:"text-sm font-bold"},Fu={class:"grid grid-cols-2 gap-3"},qu={class:"grid grid-cols-2 gap-3"},Ku={class:"grid grid-cols-3 gap-3"},Ju={class:"col-span-2"},Gu={class:"grid grid-cols-2 gap-3"},Wu={key:1,class:"text-xs text-error"},Hu={class:"px-5 py-3 border-t border-outline-variant/15 flex items-center justify-end gap-2"},Yu=["disabled"],Qu=["disabled"],Zu={key:0,class:"material-symbols-outlined animate-spin",style:{"font-size":"1rem"}},Xu={key:1,class:"material-symbols-outlined",style:{"font-size":"1rem"}},ed={class:"w-full max-w-lg rounded-xl bg-surface-container-lowest shadow-xl overflow-hidden max-h-[90vh] flex flex-col"},td={class:"flex items-center justify-between px-5 py-3 border-b border-outline-variant/15"},sd={class:"text-sm font-bold"},nd={class:"grid grid-cols-2 gap-3"},ad={class:"flex items-center gap-2"},od={key:0},ld={key:1,class:"text-xs text-error"},rd={class:"px-5 py-3 border-t border-outline-variant/15 flex items-center justify-end gap-2"},id=["disabled"],ud=["disabled"],dd={key:0,class:"material-symbols-outlined animate-spin",style:{"font-size":"1rem"}},cd={key:1,class:"material-symbols-outlined",style:{"font-size":"1rem"}},pd={class:"w-full max-w-md rounded-xl bg-surface-container-lowest shadow-xl overflow-hidden"},md={class:"flex items-center justify-between px-5 py-3 border-b border-outline-variant/15"},fd={class:"px-5 py-4"},vd={class:"text-body-2 mb-2"},bd={class:"font-weight-semibold"},yd={class:"text-on-surface-variant"},xd={key:0,class:"text-xs text-error mt-2"},gd={class:"px-5 py-3 border-t border-outline-variant/15 flex items-center justify-end gap-2"},_d=["disabled"],hd=["disabled"],kd={key:0,class:"material-symbols-outlined animate-spin",style:{"font-size":"1rem"}},wd={key:1,class:"material-symbols-outlined",style:{"font-size":"1rem"}},Cd={class:"w-full max-w-lg rounded-xl bg-surface-container-lowest shadow-xl overflow-hidden"},$d={class:"flex items-center justify-between px-5 py-3 border-b border-outline-variant/15"},zd={class:"text-sm font-bold"},Sd={class:"px-5 py-4 space-y-3"},Ad={class:"flex items-center justify-between gap-3"},Rd={class:"text-xs text-on-surface-variant"},Td={class:"flex items-center gap-2"},Id={key:0,class:"text-xs text-primary"},Dd=["title"],Ud={class:"px-5 py-3 border-t border-outline-variant/15 flex items-center justify-end gap-2"},Ld=["disabled"],Md=["disabled"],Ed={key:0,class:"material-symbols-outlined animate-spin",style:{"font-size":"1rem"}},jd={key:1,class:"material-symbols-outlined",style:{"font-size":"1rem"}},Nd={class:"w-full max-w-md rounded-xl bg-surface-container-lowest shadow-xl overflow-hidden"},Bd={class:"flex items-center justify-between px-5 py-3 border-b border-outline-variant/15"},Od={class:"text-sm font-bold"},Pd={class:"px-5 py-4 space-y-3"},Vd={class:"flex items-center gap-2"},Fd=["value"],qd={class:"material-symbols-outlined",style:{"font-size":"1rem"}}
1,Kd=js({__name:"SpaceDetailViewMobile",props:{slug:{},vocabulary:{},components:{}},setup(Ht){const xe=Ht,ot=Tn(()=>xe.vocabulary),Yt=Bs(),se=xn(),zt=gn(),F=v(()=>xe.slug??""),{space:d,reason:re,hasPendingRequest:lt,userRoles:ge,loading:St,error:rt,fetchSpace:X,joinSpace:ne}=Mn(F),{isAuthenticated:R}=Ns(),q=v(()=>!R.value&&!d.value?.recent_members?.length&&(d.value?.member_count??0)>0),C=v(()=>`/m/sign-in?redirect=${encodeURIComponent(Yt.fullPath)}`),O=v(()=>d.value?.id??null),H=Un(O,ge),je=v(()=>H.has("create_topic_in_feed")),_e=v(()=>H.has("invite_member")),he=v(()=>H.has("create_or_edit_event")),Ne=v(()=>H.has("create_or_edit_course")),Be=v(()=>H.has("set_invitation_text")),it=v(()=>H.has("suspend_or_remove_member")),T=v(()=>ge.value.some(a=>a==="admin"||a==="moderator"||a==="teacher")),ut=[{id:"menu",label:"Menu"},{id:"reviews",label:"Reviews"},{id:"deals",label:"Deals"},{id:"feed",label:"Feed"},{id:"events",label:"Events"},{id:"courses",label:"Courses"},{id:"location",label:"Location"},{id:"members",label:"Members"}],j=v(()=>d.value?.intended_vertical==="culinary"||d.value?.listing_type_handle==="culinary"),Y={feed:"community",reviews:"social_proof",menu:"primary_commerce",gallery:"media",deals:"promo",events:"events",location:"info"},K=v(()=>Object.fromEntries((xe.components??[]).map(a=>[a.slot,a.effective_on!==!1]))),At=a=>(a?K.value[a]:void 0)??!0,z=v(()=>{let a;return j.value?a=[{id:"overview",label:"Overview"},...ut.filter(f=>f.id!=="members"&&f.id!=="courses"&&f.id!=="menu")]:a=ut,a=a.filter(f=>At(Y[f.id])),(T.value?[...a,{id:"manage",label:"Manage"}]:a).map(f=>({id:f.id,label:ot(`tab.${f.id}`,f.label)}))}),g=m("menu");V(j,a=>{a&&g.value==="menu"&&(g.value="overview")},{immediate:!1}),V(z,a=>{a.length&&!a.some(s=>s.id===g.value)&&(g.value=a[0].id)});const ie=m([]);function ke(a,s){a&&(ie.value[s]=a)}function Oe(a,s){const f=z.value;let x=s;if(a.key==="ArrowRight"||a.key==="ArrowDown")x=(s+1)%f.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")x=(s-1+f.length)%f.length;else if(a.key==="Home")x=0;else if(a.key==="End")x=f.length-1;else return;a.preventDefault(),g.value=f[x].id,Es(()=>ie.value[x]?.focus())}const ue=m([]),me=m(!1),we=m(null),ae=En(),dt=v(()=>!!d.value?.zulip_stream_name);async function Ce(){if(d.value){if(!dt.value){we.value=null,ue.value=[];return}me.value=!0,we.value=null;try{const a=await ae.get(`/api/zulip/feed?stream=${encodeURIComponent(d.value.zulip_stream_name)}&num=60`);ue.value=a.posts??[]}catch(a){we.value=a?.statusMessage??"failed to load posts",ue.value=[]}finally{me.value=!1}}}const S=v(()=>d.value?.storefront_id??null),Pe=v(()=>d.value?.home_storefront_name??null),Rt=v(()=>d.value?.home_storefront_domain??null),fe=v(()=>!!S.value&&zt.value.resolved&&S.value!==zt.value.id),$e=v(()=>{if(!d.value||!fe.value)return null;const a=Rt.value;return!a||!a.includes(".")?null:`https://${a}/${encodeURIComponent(d.value.slug)}`});_n(()=>{const a={title:d.value?`${d.value.name} · xquare hub`:"Space · xquare hub"};return $e.value&&(a.link=[{rel:"canonical",href:$e.value,hid:"canonical"}]),a}),V(F,async()=>{await X(),g.value==="feed"&&await Ce()},{immediate:!1}),vs(async()=>{await X(),await H.reload(),await Ce(),B.value.length===0&&Pt(),L.value.length===0&&us(),N.value.length===0&&Nt(),j.value&&($.value||xs(),Ge.value.length===0&&$s(),Ie.value.length===0&&zs(),navigator.geolocation&&navigator.geolocation.getCurrentPosition(a=>{ns.value=a.coords.latitude,as.value=a.coords.longitude},()=>{},{maximumAge:5*6e4,timeout:5e3}))}),V(g,async a=>{a==="overview"&&($.value||await xs(),N.value.length===0&&Nt(),B.value.length===0&&Pt()),a==="feed"&&ue.value.length===0&&await Ce(),a==="events"&&J.value.length===0&&await Tt(),a==="courses"&&I.value.length===0&&await bt(),a==="menu"&&(N.value.length===0&&await Nt(),L.value.length===0&&us()),a==="deals"&&B.value.length===0&&await Pt(),a==="reviews"&&Ge.value.length===0&&await $s(),a==="location"&&Ie.value.length===0&&await zs(),["reviews","deals","events","location"].includes(a)&&(L.value.length===0&&us(),N.value.length===0&&Nt(),B.value.length===0&&Pt())});const de=hn(),J=m([]),ct=m(!1),P=m(null);
1async function Tt(){if(d.value){ct.value=!0,P.value=null;try{const{data:a,error:s}=await de.schema("community").rpc("get_space_events",{p_space_id:d.value.id});if(s)throw new Error(s.message);J.value=a?.events??[]}catch(a){P.value=a?.message??"failed to load events",J.value=[]}finally{ct.value=!1}}}const Ve=m(null),ze=m(0),pt=m(1);function Se(){const a=Ve.value;a&&(pt.value=Math.max(1,Math.ceil(a.scrollWidth/Math.max(1,a.clientWidth))),ze.value=Math.round(a.scrollLeft/Math.max(1,a.clientWidth)))}function Qt(a){const s=Ve.value;s&&s.scrollTo({left:a*s.clientWidth,behavior:"smooth"})}V(J,()=>Es(Se)),vs(()=>{if(typeof ResizeObserver>"u")return;const a=new ResizeObserver(()=>Se()),s=V(Ve,(f,x,G)=>{f&&(a.observe(f),Se(),G(()=>a.unobserve(f)))},{immediate:!0});Os(()=>{s(),a.disconnect()})});function It(a){return a.cover_image_url||a.metadata?.cover_url||""}function mt(a){return a.price_display||xt(a.metadata?.ticket_price_idr??null)||""}function Dt(a){return new Date(a).toLocaleDateString("id-ID",{day:"2-digit"})}function Zt(a){return new Date(a).toLocaleDateString("id-ID",{month:"short"})}const Xt={physical:"place",virtual:"videocam",hybrid:"sensors",offline:"place",online:"videocam"};function es(a){return Xt[a??""]??"event"}function Fe(a){return a.total_capacity>0&&a.sold_count>=a.total_capacity}function ts(a){return a.total_capacity?Math.min(100,Math.round(a.sold_count/a.total_capacity*100)):0}function ft(a){return a.slug?`/m/events/${a.slug}`:null}const I=m([]),vt=m(!1),Ae=m(null);async function bt(){if(d.value){vt.value=!0,Ae.value=null;try{const{data:a,error:s}=await de.schema("lms").from("course").select("id,space_id,slug,title,description,cover_image_url,level,category,is_free,price,currency,is_published,lesson_count,enrollment_count,created_at").eq("space_id",d.value.id).order("created_at",{ascending:!1});if(s)throw new Error(s.message);I.value=a??[]}catch(a){Ae.value=a?.message??"failed to load courses",I.value=[]}finally{vt.value=!1}}}const Q=m("all"),c=m("all"),r=m("all"),p=["beginner","intermediate","advanced"],D=v(()=>{const a=new Set(I.value.map(x=>(x.level||"").trim().toLowerCase()).filter(Boolean)),s=p.filter(x=>a.has(x)),f=[...a].filter(x=>!p.includes(x)).sort();return[...s,...f]}),ve=v(()=>{const a=new Map;for(const s of I.value){const f=(s.category||"").trim();if(!f)continue;const x=f.toLowerCase();a.has(x)||a.set(x,f.charAt(0).toUpperCase()+f.slice(1))}return[...a.entries()].map(([s,f])=>({key:s,label:f})).sort((s,f)=>s.label.localeCompare(f.label))}),Re=v(()=>I.value.filter(a=>!(Q.value!=="all"&&(a.level||"").trim().toLowerCase()!==Q.value||c.value!=="all"&&(a.category||"").trim().toLowerCase()!==c.value||r.value==="free"&&!a.is_free||r.value==="paid"&&a.is_free)));function ce(a){return a.charAt(0).toUpperCase()+a.slice(1)}const Te=v(()=>Q.value!=="all"||c.value!=="all"||r.value!=="all");function bs(){Q.value="all",c.value="all",r.value="all"}V(I,()=>{I.value.length&&(Q.value!=="all"&&!D.value.includes(Q.value)&&(Q.value="all"),c.value!=="all"&&!ve.value.some(a=>a.key===c.value)&&(c.value="all"))});const qe=m(!1),yt=m(!1),Ke=m(null),U=m({title:"",description:"",category:"",level:"beginner",is_free:!0,price:0,cover_image_url:""});function Ps(){Ke.value=null,U.value={title:"",description:"",category:"",level:"beginner",is_free:!0,price:0,cover_image_url:""},qe.value=!0}async function ys(){if(!d.value)return;const a=U.value;if(!a.title.trim()){Ke.value="Course title is required.";return}yt.value=!0,Ke.value=null;try{const{error:s}=await de.rpc("create_course",{p_space_id:d.value.id,p_title:a.title.trim(),p_description:a.description.trim()||null,p_category:a.category.trim()||null,p_level:a.level,p_is_free:a.is_free,p_price:a.is_free?0:Number(a.price)||0,p_cover_image_url:a.cover_image_url.trim()||null});if(s)throw new Error(s.message);qe.value=!1,await bt()}catch(s){Ke.value=s?.message??"Failed to create course"}finally{yt.value=!1}}const $=m(null),Ut=m(!1),Lt=m(!1),Mt=m(null);async function xs(){if(d.value){Lt.value=!0,Mt.value=null;try{const a=await ae.get(`/api/spaces/${encodeURIComponent(F.value)}/overview`);$.value=a}catch(a){Mt.value=a?.statusMessage??a?.message??"failed to load overview",$.value=null}finally{Lt.value=!1}}}function Vs(a){const s=a.toLowerCase();return s.includes("wifi")?"wifi":s.includes("parking")?"local_parking":s.includes("music")?"music_note":s.includes("ac")||s.includes("air")?"ac_unit":s.includes("private")?"meeting_room":s.includes("takeaway")||s.includes("take away")?"takeout_dining":s.includes("delivery")?"delivery_dining":s.includes("outdoor")?"deck":s.includes("smoking")?"smoking_rooms":s.includes("reservation")||s.includes("booking")?"event_available":s.includes("card")||s.includes("credit")?"credit_card":s.includes("hala")?"restaurant":s.includes("family")?"family_restroom":s.includes("vegan")||s.includes("vegetarian")?"eco":s.includes("pet")?"pets":"check_circle"}const Fs=["mon","tue","wed","thu","fri","sat","sun"],qs={mon:"Senin",tue:"Selasa",wed:"Rabu",thu:"Kamis",fri:"Jumat",sat:"Sabtu",sun:"Minggu"};function Ks(){return["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()]||"mon"}const ss=v(()=>{const a=$.value?.opening_hours;if(!a)return[];
1if(typeof a=="string")return[{key:"all",label:"Every day",hours:a,today:!0}];if(typeof a!="object")return[];const s=Ks();return Fs.filter(f=>a[f]).map(f=>({key:f,label:qs[f]||f,hours:String(a[f]),today:f===s}))}),Et=v(()=>{const a=ss.value.find(M=>M.today);if(!a)return{status:"unknown",text:"Opening hours not available"};const s=String(a.hours||"").trim();if(!s||/tutup|closed/i.test(s))return{status:"closed",text:"Closed today"};const f=s.match(/(\d{1,2})[.:](\d{2})\s*[-–]\s*(\d{1,2})[.:](\d{2})/);if(!f)return{status:"unknown",text:s};const x=new Date,G=x.getHours()*60+x.getMinutes(),$t=Number(f[1])*60+Number(f[2]),tt=Number(f[3])*60+Number(f[4]),ye=tt>$t?G>=$t&&G<tt:G>=$t||G<tt,fs=`${String(f[3]).padStart(2,"0")}:${f[4]}`,n=`${String(f[1]).padStart(2,"0")}:${f[2]}`;return ye?{status:"open",text:`Open now • Closes ${fs}`}:{status:"closed",text:`Closed • Opens ${n}`}}),Je=v(()=>Ie.value[0]||null),gs=v(()=>{const a=Je.value;if(!a)return null;const s=[a.address,a.district,a.city].filter(Boolean);return s.length?s.join(", "):a.title||null}),Js={ACEH:"AC","SUMATERA UTARA":"SU","SUMATERA BARAT":"SB",RIAU:"RI","KEPULAUAN RIAU":"KR",JAMBI:"JA",BENGKULU:"BE","SUMATERA SELATAN":"SS","BANGKA BELITUNG":"BB",LAMPUNG:"LA",BANTEN:"BT","DKI JAKARTA":"JK",JAKARTA:"JK","JAWA BARAT":"JB","JAWA TENGAH":"JT","DI YOGYAKARTA":"YO",YOGYAKARTA:"YO","JAWA TIMUR":"JI",BALI:"BA","NUSA TENGGARA BARAT":"NB","NUSA TENGGARA TIMUR":"NT","KALIMANTAN BARAT":"KB","KALIMANTAN TENGAH":"KT","KALIMANTAN SELATAN":"KS","KALIMANTAN TIMUR":"KI","KALIMANTAN UTARA":"KU","SULAWESI UTARA":"SA","SULAWESI TENGAH":"ST","SULAWESI SELATAN":"SN","SULAWESI TENGGARA":"SG",GORONTALO:"GO","SULAWESI BARAT":"SR",MALUKU:"MA","MALUKU UTARA":"MU",PAPUA:"PA","PAPUA BARAT":"PB"};function Gs(a){return a?Js[a.toUpperCase().replace(/\./g,"").trim()]??null:null}function Ws(a){return a.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}const ns=m(null),as=m(null),os=v(()=>d.value?d.value.cover_image_url?d.value.cover_image_url:j.value&&L.value.length?L.value[0].url:null:null),Hs=["instagram","whatsapp","facebook","tiktok","youtube","twitter","linkedin","website"],_s={instagram:"Instagram",whatsapp:"WhatsApp",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",twitter:"Twitter",linkedin:"LinkedIn",website:"Website"},ls=v(()=>{const a=$.value?.social_links??{},s=Je.value?.contact_whatsapp;return Hs.flatMap(f=>{if(f==="whatsapp")return s?[{key:f,url:`https://wa.me/${s.replace(/[^0-9]/g,"")}`,label:_s.whatsapp}]:[];const x=a[f];return typeof x=="string"&&x?[{key:f,url:x,label:_s[f]}]:[]})}),Ys=v(()=>ls.value.filter(a=>a.key==="instagram"||a.key==="whatsapp"));async function Qs(){if(!d.value)return;const a=typeof window<"u"?window.location.href:"",s=d.value.name,f=d.value.description||d.value.name;if(typeof navigator<"u"&&navigator.share)try{await navigator.share({title:s,text:f,url:a});return}catch{}if(typeof navigator<"u"&&navigator.clipboard&&a)try{await navigator.clipboard.writeText(a)}catch{}}const Zs=v(()=>$.value?.lat??Je.value?.latitude??null),Xs=v(()=>$.value?.lng??Je.value?.longitude??null),hs=v(()=>{const a=$.value?.district||Je.value?.district;return a&&a.trim()?a:null}),ks=v(()=>{const a=$.value?.state||Je.value?.state;return a&&a.trim()?a:null}),ws=v(()=>{const a=Zs.value,s=Xs.value;if(a==null||s==null||ns.value==null||as.value==null)return null;const f=jn(ns.value,as.value,a,s);return f<1?`${Math.round(f*1e3)} m`:`${f<10?f.toFixed(1):Math.round(f)} km`}),Cs=v(()=>{const a=[];if(ws.value&&a.push(ws.value),hs.value&&a.push(Ws(hs.value)),ks.value){const s=Gs(ks.value);s&&a.push(s)}return a.length?a.join(" · "):null});function en(a){if(a==null)return"Free";const s=typeof a=="string"?parseFloat(a):a;return s?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(s):"Free"}const N=m([]),rs=m(!1),jt=m(null);async function Nt(){if(d.value){rs.value=!0,jt.value=null;try{const a=await ae.get(`/api/spaces/${encodeURIComponent(F.value)}/menu`);N.value=a.items??[]}catch(a){jt.value=a?.statusMessage??a?.message??"failed to load menu",N.value=[]}finally{rs.value=!1}}}const L=m([]),is=m(!1),Bt=m(null);async function us(){if(d.value){is.value=!0,Bt.value=null;try{const a=await ae.get(`/api/spaces/${encodeURIComponent(F.value)}/gallery`);L.value=a.images??[]}catch(a){Bt.value=a?.statusMessage??a?.message??"failed to load gallery",L.value=[]}finally{is.value=!1}}}const B=m([]),ds=m(!1),Ot=m(null);async function Pt(){if(d.value){ds.value=!0,Ot.value=null;try{const a=await ae.get(`/api/spaces/${encodeURIComponent(F.value)}/vouchers`);B.value=a.vouchers??[]}catch(a){Ot.value=a?.statusMessage??a?.message??"failed to load deals",B.value=[]}finally{ds.value=!1}}}const Ge=m([]),oe=m({count:0,avg:null}),cs=m(!1),Vt=m(null);async function $s(){if(d.value){cs.value=!0,Vt.value=null;try{const a=await ae.get(`/api/spaces/${encodeURIComponent(F.value)}/reviews`);Ge.value=a.reviews??[],oe.value=a.summary??{count:0,avg:null}}catch(a){Vt.value=a?.statusMessage??a?.message??"failed to load reviews",Ge.value=[]}finally{cs.value=!1}}}const Ie=m([]),ps=m(!1),Ft=m(null);async function zs(){if(d.value){ps.value=!0,Ft.value=null;try{const a=await ae.get(`/api/spaces/${encodeURIComponent(F.value)}/branches`);Ie.value=a.branches??[]}catch(a){Ft.value=a?.statusMessage??a?.message??"failed to load outlets",Ie.value=[]}finally{ps.value=!1}}}function Ss(a,s){if(a==null)return"";const f=(s||"IDR").toUpperCase();return f==="IDR"?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(a):new Intl.NumberFormat("en",{style:"currency",currency:f}).format(a)}function xt(a){return a==null?"":new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(a)}
1function As(a){return new Date(a).toLocaleString("id-ID",{weekday:"short",day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"})}const Rs=v(()=>d.value?.user_role==="owner"||d.value?.user_role==="admin"),We=m(""),He=m(""),Ye=m(!1),gt=m("");async function tn(){if(!d.value?.zulip_stream_name)return;const a=We.value.trim(),s=He.value.trim();if(!a||!s){gt.value="Topic and message are required";return}Ye.value=!0,gt.value="";try{await ae.post("/api/zulip/messages",{stream:d.value.zulip_stream_name,topic:a,content:s}),We.value="",He.value="",await Ce()}catch(f){gt.value=f?.statusMessage??f?.message??"failed to post"}finally{Ye.value=!1}}const _t=m(!1),qt=m("");async function sn(){if(!(!d.value||_t.value)){if(!R.value){se.push(`/sign-in?next=${encodeURIComponent(`/m/s/${F.value}`)}`);return}_t.value=!0,qt.value="";try{await ne()}catch(a){qt.value=a?.message??"join failed"}finally{_t.value=!1}}}const Kt=m(!1);async function nn(){await X()}const Qe=m(!1),De=m(""),Ue=m(!1),Ze=m(null),Jt=m(!1);function an(){De.value=d.value?.invitation_text??"",Ze.value=null,Jt.value=!1,Qe.value=!0}const Le=m(null),le=m(null),ht=m(null);function on(a){ht.value=null,le.value=a}async function ln(){if(!le.value||!d.value||Le.value)return;const a=le.value;Le.value=a.user_id,ht.value=null;try{const{error:s}=await de.schema("community").rpc("remove_space_member",{p_space_id:d.value.id,p_user_id:a.user_id});if(s)throw new Error(s.message);le.value=null,await X()}catch(s){ht.value=s?.message??"Failed to remove member."}finally{Le.value=null}}async function rn(){if(!(!d.value||Ue.value)){Ue.value=!0,Ze.value=null,Jt.value=!1;try{const{error:a}=await de.schema("community").rpc("set_space_invitation_text",{p_space_id:d.value.id,p_text:De.value});if(a)throw new Error(a.message);Jt.value=!0,await X(),setTimeout(()=>{Qe.value=!1},800)}catch(a){Ze.value=a?.message??"Failed to save invitation text."}finally{Ue.value=!1}}}const Xe=m(!1),kt=m(!1),et=m(null),h=m({event_name:"",description:"",category:"meetup",event_type:"offline",event_datetime:"",event_end_datetime:"",city:"",venue_name:"",venue_address:"",total_capacity:50,status:"draft"});function un(){et.value=null,h.value={event_name:"",description:"",category:"meetup",event_type:"offline",event_datetime:"",event_end_datetime:"",city:"",venue_name:"",venue_address:"",total_capacity:50,status:"draft"},Xe.value=!0}async function Ts(){if(!d.value)return;const a=h.value;if(!a.event_name.trim()||!a.event_datetime){et.value="Event name and start datetime are required.";return}kt.value=!0,et.value=null;try{const{error:s}=await de.schema("events").rpc("create_event",{p_event_name:a.event_name.trim(),p_space_id:d.value.id,p_description:a.description.trim()||null,p_category:a.category||"meetup",p_event_type:a.event_type,p_event_datetime:new Date(a.event_datetime).toISOString(),p_event_end_datetime:a.event_end_datetime?new Date(a.event_end_datetime).toISOString():null,p_timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Jakarta",p_city:a.city.trim()||null,p_venue_name:a.venue_name.trim()||null,p_venue_address:a.venue_address.trim()||null,p_total_capacity:Number(a.total_capacity)||0,p_registration_deadline:null,p_price_display:null,p_cover_image_url:null,p_status:a.status,p_recurrence_rule:null});if(s)throw new Error(s.message);Xe.value=!1,await Tt()}catch(s){et.value=s?.message??"Failed to create event"}finally{kt.value=!1}}const Gt=m(!1),wt=m(!1),ms=v(()=>{if(!d.value)return"";const a=typeof window<"u"?window.location.origin:"",s=ge.value.length?`?invited_by=${encodeURIComponent(F.value)}`:"";return`${a}/s/${d.value.slug}${s}`});function dn(){wt.value=!1,Gt.value=!0}async function cn(){if(ms.value)try{await navigator.clipboard.writeText(ms.value),wt.value=!0,setTimeout(()=>{wt.value=!1},2e3)}catch{}}function Is(a){return a==null?"0":a>=1e3?`${(a/1e3).toFixed(a>=1e4?0:1)}k`:String(a)}function be(a){g.value=a==="gallery"?"menu":a}function Ct(a){if(a.nominal_value==null||a.price_idr==null||a.nominal_value<=0||a.price_idr>=a.nominal_value)return null;const s=a.nominal_value-a.price_idr;return{pct:Math.round(s/a.nominal_value*100),saved:s}}function Wt(a){return new Date(a).toLocaleDateString("id-ID",{day:"numeric",month:"short",year:"numeric"})}function Ds(a){return a.valid_from&&a.valid_until?`${Wt(a.valid_from)} – ${Wt(a.valid_until)}`:a.valid_until?`Valid until ${Wt(a.valid_until)}`:a.validity_days?`Valid ${a.validity_days} day${a.validity_days===1?"":"s"} from purchase`:null}const pn=["monday","tuesday","wednesday","thursday","friday","saturday","
1sunday"],mn={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function Us(a){const s=[];if(a.valid_days&&a.valid_days.length&&a.valid_days.length<7){const f=new Set(a.valid_days.map(G=>String(G).toLowerCase())),x=pn.filter(G=>!f.has(G)).map(G=>mn[G]);x.length&&s.push(x.join(", "))}return a.blockout_dates&&a.blockout_dates.length&&s.push(a.blockout_dates.map(Wt).join(", ")),s.length?s.join(" · "):null}return(a,s)=>{const f=fn,x=vn,G=no,$t=Sn,tt=Ln,ye=An,fs=Rn;return o(),l("section",ao,[t(St)&&!t(d)&&!t(re)?(o(),l("div",oo)):t(rt)?(o(),l("div",lo,i(t(rt)),1)):!t(d)&&t(re)==="private_or_not_found"?(o(),l("div",ro,[s[45]||(s[45]=e("h2",{class:"text-base font-semibold"},"Private space",-1)),s[46]||(s[46]=e("p",{class:"text-sm text-on-surface-variant"},"This space's membership is by invitation only.",-1)),A(t(at),{to:"/m/spaces",class:"inline-flex items-center gap-2 text-sm text-primary"},{default:Z(()=>[...s[44]||(s[44]=[b("← Browse spaces",-1)])]),_:1})])):t(d)&&t(re)==="request_to_join"?(o(),l("div",io,[e("div",{class:w(["relative h-40",t(d).cover_image_url?"":"bg-gradient-to-br from-primary/30 via-primary/10 to-surface-container"]),style:te(t(d).cover_image_url?{backgroundImage:`url(${JSON.stringify(encodeURI(t(d).cover_image_url))})`,backgroundSize:"cover",backgroundPosition:"center"}:null)},null,6),e("div",uo,[e("h2",co,i(t(d).name),1),t(d).description?(o(),l("p",po,i(t(d).description),1)):u("",!0),s[47]||(s[47]=e("p",{class:"text-sm text-on-surface-variant"},"Private space — request to join.",-1)),t(lt)?(o(),l("span",mo,"Request pending")):(o(),l("button",{key:2,onClick:s[0]||(s[0]=(...n)=>t(ne)&&t(ne)(...n)),disabled:t(St),class:"inline-flex items-center px-4 py-2 rounded-lg bg-primary text-on-primary text-sm font-medium disabled:opacity-50"},"Request to join",8,fo))])])):u("",!0),t(d)&&t(re)==="visible"?(o(),l("article",vo,[e("div",{class:w(["relative h-48 md:h-56",t(os)?"":"bg-gradient-to-br from-primary/30 via-primary/10 to-surface-container"]),style:te(t(os)?{backgroundImage:`url(${JSON.stringify(encodeURI(t(os)))})`,backgroundSize:"cover",backgroundPosition:"center"}:null)},[t(j)?(o(),l("div",bo,[...s[48]||(s[48]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"restaurant",-1),e("span",null,"Restoran",-1)])])):u("",!0),t(Rs)?(o(),l("button",{key:1,class:"absolute top-3 right-3 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-black/40 hover:bg-black/55 text-white text-xs font-semibold backdrop-blur-sm transition-colors z-10","aria-label":"Edit space",onClick:s[1]||(s[1]=n=>Kt.value=!0)},[...s[49]||(s[49]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"edit",-1),b(" Edit ",-1)])])):u("",!0),t(j)?(o(),l("div",{key:2,class:w(["absolute right-3 z-10 flex items-center gap-1.5",t(Rs)?"top-12":"top-3"])},[(o(!0),l(y,null,_(t(Ys),n=>(o(),l("a",{key:n.key,href:n.url,target:"_blank",rel:"noopener noreferrer","aria-label":n.label,class:"w-9 h-9 inline-flex items-center justify-center rounded-full bg-black/40 hover:bg-black/55 text-white backdrop-blur-sm transition-colors"},[n.key==="instagram"?(o(),l("svg",xo,[...s[50]||(s[50]=[e("path",{d:"M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.8.25 2.23.41.56.22.96.48 1.38.9.42.42.68.82.9 1.38.16.43.36 1.06.41 2.23.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.25 1.8-.41 2.23-.22.56-.48.96-.9 1.38-.42.42-.82.68-1.38.9-.43.16-1.06.36-2.23.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.8-.25-2.23-.41-.56-.22-.96-.48-1.38-.9-.42-.42-.68-.82-.9-1.38-.16-.43-.36-1.06-.41-2.23C2.17 15.58 2.16 15.2 2.16 12s.01-3.58.07-4.85c.05-1.17.25-1.8.41-2.23.22-.56.48-.96.9-1.38.42-.42.82-.68 1.38-.9.43-.16 1.06-.36 2.23-.41C8.42 2.17 8.8 2.16 12 2.16zm0 1.62c-3.15 0-3.51.01-4.74.07-1.07.05-1.66.22-2.04.37-.51.2-.88.44-1.27.82-.39.39-.63.76-.82 1.27-.15.39-.32.97-.37 2.04-.06 1.23-.07 1.6-.07 4.74s.01 3.51.07 4.74c.05 1.07.22 1.66.37 2.04.2.51.44.88.82 1.27.39.39.76.63 1.27.82.39.15.97.32 2.04.37 1.23.06 1.6.07 4.74.07s3.51-.01 4.74-.07c1.07-.05 1.66-.22 2.04-.37.51-.2.88-.44 1.27-.82.39-.39.63-.76.82
1-1.27.15-.39.32-.97.37-2.04.06-1.23.07-1.6.07-4.74s-.01-3.51-.07-4.74c-.05-1.07-.22-1.66-.37-2.04-.2-.51-.44-.88-.82-1.27-.39-.39-.76-.63-1.27-.82-.39-.15-.97-.32-2.04-.37-1.23-.06-1.6-.07-4.74-.07zm0 2.76a5.46 5.46 0 1 1 0 10.92 5.46 5.46 0 0 1 0-10.92zm0 9a3.54 3.54 0 1 0 0-7.08 3.54 3.54 0 0 0 0 7.08zm6.95-9.22a1.27 1.27 0 1 1-2.54 0 1.27 1.27 0 0 1 2.54 0z"},null,-1)])])):n.key==="whatsapp"?(o(),l("svg",go,[...s[51]||(s[51]=[e("path",{d:"M19.05 4.91A9.82 9.82 0 0 0 12.04 2c-5.46 0-9.91 4.45-9.91 9.91 0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38a9.9 9.9 0 0 0 4.74 1.21h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.91-7.02zm-7.01 15.24h-.01a8.23 8.23 0 0 1-4.19-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.18 8.18 0 0 1-1.26-4.38c0-4.54 3.7-8.24 8.24-8.24 2.2 0 4.27.86 5.82 2.41a8.18 8.18 0 0 1 2.41 5.83c0 4.54-3.69 8.24-8.22 8.24zm4.52-6.16c-.25-.12-1.47-.72-1.69-.81-.23-.08-.39-.12-.56.13-.16.25-.64.81-.79.97-.14.17-.29.19-.54.06-.25-.12-1.05-.39-2-1.23-.74-.66-1.24-1.48-1.39-1.72-.14-.25-.02-.39.11-.51.11-.11.25-.29.37-.43.12-.14.16-.25.25-.41.08-.17.04-.31-.02-.43-.06-.12-.56-1.35-.77-1.84-.2-.49-.41-.42-.56-.42l-.48-.01c-.17 0-.43.06-.66.31-.23.25-.86.84-.86 2.05 0 1.21.88 2.38 1 2.54.12.17 1.74 2.65 4.22 3.72.59.25 1.05.4 1.41.51.59.19 1.13.16 1.55.1.47-.07 1.47-.6 1.67-1.18.21-.58.21-1.07.14-1.18-.06-.1-.22-.16-.47-.29z"},null,-1)])])):u("",!0)],8,yo))),128)),e("button",{type:"button","aria-label":"Share",class:"w-9 h-9 inline-flex items-center justify-center rounded-full bg-black/40 hover:bg-black/55 text-white backdrop-blur-sm transition-colors",onClick:Qs},[...s[52]||(s[52]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1.1rem"}},"share",-1)])])],2)):u("",!0),s[55]||(s[55]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/55 via-transparent to-transparent"},null,-1)),e("div",_o,[e("div",ho,[t(j)?u("",!0):(o(),l("h1",ko,i(t(d).name),1)),t(fe)?(o(),W(f,{key:1,"home-storefront-id":t(S),"home-storefront-name":t(Pe),size:"default",class:"mt-1"},null,8,["home-storefront-id","home-storefront-name"])):u("",!0),t(j)?u("",!0):(o(),l("p",wo,[s[53]||(s[53]=e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"group",-1)),e("span",null,i(Is(t(d).member_count))+" members",1)])),t(j)&&t(Et).status!=="unknown"?(o(),l("span",{key:3,class:w(["inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-bold backdrop-blur-sm shadow",t(Et).status==="open"?"bg-emerald-500/90 text-white":"bg-error/90 text-white"])},[e("span",{class:w(["w-1.5 h-1.5 rounded-full",t(Et).status==="open"?"bg-white":"bg-white/80"])},null,2),b(" "+i(t(Et).status==="open"?"Open now":"Closed"),1)],2)):u("",!0)]),e("div",Co,[t(Be)?(o(),l("button",{key:0,type:"button",class:"bg-surface-container-lowest/90 text-on-surface text-xs font-bold px-3 py-2 rounded-lg shadow hover:brightness-95 active:scale-[0.97] transition-[transform,filter] duration-150 inline-flex items-center gap-1",title:"Edit invitation text",onClick:ee(an,["stop","prevent"])},[...s[54]||(s[54]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"edit",-1),b(" Invitation ",-1)])])):u("",!0),t(d).membership_status==="pending_request"?(o(),l("span",$o,"Request pending")):u("",!0)])]),t(d).membership_status==="joinable"||t(d).membership_status==="request"?(o(),l("button",{key:3,type:"button",disabled:t(_t),class:"absolute bottom-3 right-3 z-10 bg-on-primary text-primary text-xs font-bold px-4 py-2 rounded-lg shadow hover:brightness-95 active:scale-[0.97] transition-[transform,filter] duration-150 disabled:opacity-60",onClick:ee(sn,["stop","prevent"])},i(t(_t)?"Joining…":"Join space"),9,zo)):u("",!0)],6),t(j)?(o(),l("div",So,[e("div",Ao,[e("div",Ro,[e("h2",To,i(t(d).name),1),e("button",{type:"button",class:"shrink-0 text-xs text-on-surface-variant whitespace-nowrap pt-0.5 inline-flex items-center gap-0.5",onClick:s[2]||(s[2]=n=>g.value="reviews")},[s[56]||(s[56]=e("span",{class:"material-symbols-outlined text-amber-500",style:{"font-size":"1rem"}},"star",-1)),t(oe).avg!=null&&t(oe).count>0?(o(),l(y,{key:0},[e("span",Io,i(t(oe).avg.toFixed(1)),1),e("span",Do,"("+i(t(oe).count)+")",1)],64)):(o(),l("span",Uo,"No reviews yet"))])]),t(Cs)?(o(),l("p",Lo,i(t(Cs)),1)):t(gs)?(o(),l("p",Mo,i(t(gs)),1)):u("",!0)])])):t(d).description?(o(),l("div",Eo,i(t(d).description),1)):u("",!0),t(qt)?(o(),l("div",jo,i(t(qt)),1)):u("",!0)])):u("",!0),t(d)?(o(),W(x,{key:5,modelValue:t(Kt),"onUpdate:modelValue":s[3]||(s[3]=n=>pe(Kt)?Kt.value=n:null),slug:t(d).slug,"initial-title":t(d).name,"initial-description":t(d).description,"initial-cover-url":t(d).cover_image_url,onSaved:nn},null,8,["modelValue","slug","initial-title","initial-description","initial-cover-url"])):u("",!0),t(d)&&t(re)==="visible"&&t(j)?(o(),W(G,{key:6,"space-slug":t(
1d).slug,"space-id":t(d).id},null,8,["space-slug","space-id"])):u("",!0),t(d)?(o(),l("div",No,[(o(!0),l(y,null,_(t(z),(n,M)=>(o(),l("button",{key:n.id,id:`space-tab-${n.id}`,ref_for:!0,ref:st=>ke(st,M),role:"tab","aria-selected":t(g)===n.id,"aria-controls":`space-panel-${n.id}`,tabindex:t(g)===n.id?0:-1,class:w(["relative shrink-0 snap-start whitespace-nowrap px-4 py-2 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 rounded-t",t(g)===n.id?"text-primary":"text-on-surface-variant hover:text-on-surface"]),onClick:st=>g.value=n.id,onKeydown:st=>Oe(st,M)},[e("span",null,i(n.label),1),t(g)===n.id?(o(),l("span",Oo)):u("",!0)],42,Bo))),128))])):u("",!0),t(d)&&t(g)==="overview"?(o(),l("section",Po,[t(d).description||t($)?.tagline?(o(),l("div",Vo,[s[58]||(s[58]=e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant mb-2 inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"info"),b(" About ")],-1)),t($)?.tagline?(o(),l("p",Fo,i(t($).tagline),1)):u("",!0),t(d).description?(o(),l("p",{key:1,class:w(["text-sm leading-relaxed text-on-surface whitespace-pre-line",t(Ut)?"":"line-clamp-3"])},i(t(d).description),3)):u("",!0),t(d).description&&t(d).description.length>140?(o(),l("button",{key:2,type:"button",class:"mt-1 text-xs font-bold uppercase tracking-wider text-primary",onClick:s[4]||(s[4]=n=>Ut.value=!t(Ut))},i(t(Ut)?"Tampilkan lebih sedikit":"… Selengkapnya"),1)):u("",!0),t($)?.price_range?(o(),l("div",qo,[s[57]||(s[57]=e("span",{class:"material-symbols-outlined",style:{"font-size":"0.9rem"}},"payments",-1)),e("span",null,i(t($).price_range),1)])):u("",!0)])):u("",!0),t(Lt)?(o(),l("div",Ko," Loading overview… ")):t(Mt)?(o(),l("div",Jo,i(t(Mt)),1)):u("",!0),t(N).length?(o(),l("div",Go,[s[59]||(s[59]=e("div",{class:"flex items-center justify-between mb-3 px-1"},[e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"restaurant_menu"),b(" Menu Populer ")])],-1)),e("div",Wo,[(o(!0),l(y,null,_(t(N),n=>(o(),l("article",{key:n.id,class:"snap-start shrink-0 basis-[calc(50%-0.375rem)] lg:basis-[calc(25%-0.5625rem)] rounded-xl border border-outline-variant/20 bg-surface-container-lowest overflow-hidden flex flex-col"},[e("div",{class:"aspect-square bg-surface-container-high relative",style:te(n.image_url?{backgroundImage:`url(${JSON.stringify(encodeURI(n.image_url))})`,backgroundSize:"cover",backgroundPosition:"center"}:null)},[n.image_url?u("",!0):(o(),l("span",Ho,"restaurant_menu")),n.is_bestseller?(o(),l("span",Yo," Bestseller ")):u("",!0)],4),e("div",Qo,[e("h4",Zo,i(n.name),1),e("p",Xo,i(Ss(n.price,n.currency)||"—"),1)])]))),128))])])):u("",!0),t(L).length?(o(),l("div",el,[s[60]||(s[60]=e("div",{class:"flex items-center justify-between mb-3 px-1"},[e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"photo_library"),b(" Gallery ")])],-1)),e("div",tl,[(o(!0),l(y,null,_(t(L),n=>(o(),l("figure",{key:n.id,class:"snap-start shrink-0 basis-[calc(100%-0.5rem)] lg:basis-[calc(50%-0.375rem)] rounded-2xl overflow-hidden border border-outline-variant/20 bg-surface-container relative"},[e("div",{class:"aspect-[4/3] bg-cover bg-center",style:te({backgroundImage:`url(${JSON.stringify(encodeURI(n.url))})`}),title:n.alt_text||""},null,12,sl),n.alt_text||n.category?(o(),l("figcaption",nl,i(n.alt_text||(n.category?n.category.replace(/_/g," "):"")),1)):u("",!0)]))),128))])])):u("",!0),t($)&&t($).amenities.length?(o(),l("div",al,[s[61]||(s[61]=e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant mb-3 inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"star"),b(" Fasilitas ")],-1)),e("div",ol,[(o(!0),l(y,null,_(t($).amenities,n=>(o(),l("div",{key:n,class:"flex items-center gap-1.5 px-2 py-2 rounded-xl bg-surface-container text-xs font-semibold text-on-surface"},[e("span",ll,i(Vs(n)),1),e("span",rl,i(n),1)]))),128))])])):u("",!0),t(ss).length?(o(),l("div",il,[s[62]||(s[62]=e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant mb-3 inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"schedule"),b(" Jam Operasional ")],-1)),e("div",ul,[(o(!0),l(y,null,_(t(ss),n=>(o(),l("div",{key:n.key,class:w(["flex items-center justify-between py-2 px-2 -mx-2 rounded-lg text-sm",n.today?"bg-primary/10 font-bold text-primary":"text-on-surface"])},[e("span",null,[b(i(n.label),1),n.today?(o(),l("span",dl,"Hari ini")):u("",!0)]),e("span",{class:w(n.today?"font-bold":"font-semibold")},i(n.hours),3)],2))),128))])])):t($)&&!t(Lt)?(o(),l("div",cl,[...s[63]||(s[63]=[e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant mb-2 inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"schedule"),b(" Jam Operasional ")],-1),e("p",{class:"text-sm italic text-on-surface-variant inline-flex items-start gap-1.5"},[e("span",{class:"material-symbols-outlined shrink-0 mt-0.5",style:{"font-size":"1rem"}},"info"),e("span",null,"Not available yet. Contact the venue directly to confirm opening hours.")],-1)])])):u("",!0),t(ls).length?(o(),l("div",pl,[s[71]||(s[71]=e("h3",{class:"text-[11px] font-bold uppercase tracking-wider text-on-surface-variant mb-3 inline-flex items-center gap-1.5"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"}},"share"),b(" Media Sosial ")],-1)),e("div",ml,[(o(!0),l(y,null,_(t(ls),n=>(o(),l("a",{key:n.key,href:n.url,target:"_blank",rel:"noopener noreferrer","aria-label":n.label,class:"flex items-center gap-1.5 px-2 py-2 rounded-xl bg-surface-container text-xs font-semibold text-on-surface hover:bg-surface-container-high transition-colors"},[n.key==="instagram"?(o(),l("svg",vl,[...s[64]||(s[64]=[e("path",{d:"M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.8.25 2.23.41.56.22.96.48 1.38.9.42.42.68.82.9 1.38.16.43.36 1.06.41 2.23.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.25 1.8-.41 2.23-.22.56-.48.96-.9 1.38-.42.42-.82.68-1.38.9-.43.16-1.06.36-2.23.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.8-.25-2.23-.41-.56-.22-.96-.48-1.38-.9-.42-.42-.68-.82-.9-1.38-.16-.43-.36-1.06-.41-2.23C2.17 15.58 2.16 15.2 2.16 12s.01-3.58.07-4.85c.05-1.17.25-1.8.41-2.23.22-.56.48-.96.9-1.38.42-.42.82-.68 1.38-.9.43-.16 1.06-.36 2.23-.41C8.42 2.17 8.8 2.16 12 2.16zm0 1.62
1c-3.15 0-3.51.01-4.74.07-1.07.05-1.66.22-2.04.37-.51.2-.88.44-1.27.82-.39.39-.63.76-.82 1.27-.15.39-.32.97-.37 2.04-.06 1.23-.07 1.6-.07 4.74s.01 3.51.07 4.74c.05 1.07.22 1.66.37 2.04.2.51.44.88.82 1.27.39.39.76.63 1.27.82.39.15.97.32 2.04.37 1.23.06 1.6.07 4.74.07s3.51-.01 4.74-.07c1.07-.05 1.66-.22 2.04-.37.51-.2.88-.44 1.27-.82.39-.39.63-.76.82-1.27.15-.39.32-.97.37-2.04.06-1.23.07-1.6.07-4.74s-.01-3.51-.07-4.74c-.05-1.07-.22-1.66-.37-2.04-.2-.51-.44-.88-.82-1.27-.39-.39-.76-.63-1.27-.82-.39-.15-.97-.32-2.04-.37-1.23-.06-1.6-.07-4.74-.07zm0 2.76a5.46 5.46 0 1 1 0 10.92 5.46 5.46 0 0 1 0-10.92zm0 9a3.54 3.54 0 1 0 0-7.08 3.54 3.54 0 0 0 0 7.08zm6.95-9.22a1.27 1.27 0 1 1-2.54 0 1.27 1.27 0 0 1 2.54 0z"},null,-1)])])):n.key==="whatsapp"?(o(),l("svg",bl,[...s[65]||(s[65]=[e("path",{d:"M19.05 4.91A9.82 9.82 0 0 0 12.04 2c-5.46 0-9.91 4.45-9.91 9.91 0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38a9.9 9.9 0 0 0 4.74 1.21h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.91-7.02zm-7.01 15.24h-.01a8.23 8.23 0 0 1-4.19-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.18 8.18 0 0 1-1.26-4.38c0-4.54 3.7-8.24 8.24-8.24 2.2 0 4.27.86 5.82 2.41a8.18 8.18 0 0 1 2.41 5.83c0 4.54-3.69 8.24-8.22 8.24zm4.52-6.16c-.25-.12-1.47-.72-1.69-.81-.23-.08-.39-.12-.56.13-.16.25-.64.81-.79.97-.14.17-.29.19-.54.06-.25-.12-1.05-.39-2-1.23-.74-.66-1.24-1.48-1.39-1.72-.14-.25-.02-.39.11-.51.11-.11.25-.29.37-.43.12-.14.16-.25.25-.41.08-.17.04-.31-.02-.43-.06-.12-.56-1.35-.77-1.84-.2-.49-.41-.42-.56-.42l-.48-.01c-.17 0-.43.06-.66.31-.23.25-.86.84-.86 2.05 0 1.21.88 2.38 1 2.54.12.17 1.74 2.65 4.22 3.72.59.25 1.05.4 1.41.51.59.19 1.13.16 1.55.1.47-.07 1.47-.6 1.67-1.18.21-.58.21-1.07.14-1.18-.06-.1-.22-.16-.47-.29z"},null,-1)])])):n.key==="facebook"?(o(),l("svg",yl,[...s[66]||(s[66]=[e("path",{d:"M22 12.07C22 6.5 17.52 2 12 2S2 6.5 2 12.07C2 17.1 5.66 21.27 10.44 22v-7.03H7.9v-2.9h2.54V9.85c0-2.51 1.49-3.9 3.77-3.9 1.09 0 2.24.2 2.24.2v2.47h-1.26c-1.24 0-1.63.77-1.63 1.56v1.87h2.78l-.44 2.9h-2.33V22C18.34 21.27 22 17.1 22 12.07z"},null,-1)])])):n.key==="tiktok"?(o(),l("svg",xl,[...s[67]||(s[67]=[e("path",{d:"M19.6 7.07c-1.66-.36-3.04-1.4-3.86-2.8a4.9 4.9 0 0 1-.6-1.78V2h-3.34v13.4c0 1.7-1.38 3.08-3.08 3.08-1.7 0-3.07-1.38-3.07-3.08 0-1.7 1.37-3.07 3.07-3.07.32 0 .63.05.93.14V9.04c-.3-.04-.6-.06-.93-.06-3.55 0-6.43 2.88-6.43 6.42 0 3.55 2.88 6.43 6.43 6.43s6.42-2.88 6.42-6.43V8.74a8.21 8.21 0 0 0 4.46 1.31v-3.3a4.7 4.7 0 0 1-.0023.32z"},null,-1)])])):n.key==="youtube"?(o(),l("svg",gl,[...s[68]||(s[68]=[e("path",{d:"M23.5 6.5a3 3 0 0 0-2.11-2.11C19.54 4 12 4 12 4s-7.54 0-9.39.39A3 3 0 0 0 .5 6.5C.11 8.35.11 12 .11 12s0 3.65.39 5.5a3 3 0 0 0 2.11 2.11C4.46 20 12 20 12 20s7.54 0 9.39-.39a3 3 0 0 0 2.11-2.11c.39-1.85.39-5.5.39-5.5s0-3.65-.39-5.5zM9.75 15.5v-7l6.5 3.5-6.5 3.5z"},null,-1)])])):n.key==="twitter"?(o(),l("svg",_l,[...s[69]||(s[69]=[e("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"},null,-1)])])):n.key==="linkedin"?(o(),l("svg",hl,[...s[70]||(s[70]=[e("path",{d:"M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.86 0-2.14 1.45-2.14 2.95v5.66H9.34V9h3.42v1.56h.05c.48-.9 1.65-1.85 3.39-1.85 3.62 0 4.29 2.38 4.29 5.48v6.26zM5.34 7.43a2.07 2.07 0 1 1 0-4.14 2.07 2.07 0 0 1 0 4.14zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z"},null,-1)])])):(o(),l("span",kl,"language")),e("span",wl,i(n.label),1)],8,fl))),128))])])):u("",!0)])):u("",!0),t(d)&&t(g)==="feed"?(o(),l("div",Cl,[e("section",$l,[t(je)&&t(dt)?(o(),l("form",{key:0,onSubmit:ee(tn,["prevent"]),class:"bg-surface-container-lowest rounded-xl border border-outline-variant/20 p-4 space-y-2.5"},[e("div",zl,[s[72]||(s[72]=e("span",{class:"material-symbols-outlined",style:{"font-size":"1.05rem"}},"edit",-1)),e("span",null,"Start a discussion in "+i(t(d).name),1)]),k(e("input",{"onUpdate:modelValue":s[5]||(s[5]=n=>pe(We)?We.value=n:null),type:"text",placeholder:"Topic title",class:"w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm focus:outline-none focus:border-primary/60 focus:ring-2 focus:ring-primary/20",disabled:t(Ye),maxlength:"60"},null,8,Sl),[[E,t(We)]]),A($t,{modelValue:t(He),"onUpdate:modelValue":s[6]||(s[6]=n=>pe(He)?He.value=n:null),placeholder:"What's happening at your space? (markdown supp
1orted)",rows:4,disabled:t(Ye)},null,8,["modelValue","disabled"]),t(gt)?(o(),l("div",Al,i(t(gt)),1)):u("",!0),e("div",Rl,[e("button",{type:"submit",class:"px-4 py-1.5 rounded-lg bg-primary text-on-primary text-xs font-bold hover:brightness-110 transition-[filter] disabled:opacity-50 inline-flex items-center gap-1.5",disabled:t(Ye)||!t(We).trim()||!t(He).trim()},[s[73]||(s[73]=e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"send",-1)),b(" "+i(t(Ye)?"Posting…":"Post"),1)],8,Tl)])],32)):u("",!0),t(me)?(o(),l("div",Il,"Loading discussions…")):t(we)?(o(),l("div",Dl,i(t(we)),1)):t(dt)?t(ue).length?u("",!0):(o(),l("div",Ll," No discussions yet in this space. Be the first to post. ")):(o(),l("div",Ul," This space has no Zulip channel linked yet. Discussions will appear here once an admin syncs it. ")),(o(!0),l(y,null,_(t(ue),n=>(o(),W(t(at),{key:n.id,to:`/topics/${n.id}?space=${t(F)}`,class:"block cursor-pointer bg-surface-container-lowest rounded-xl border border-outline-variant/20 p-5 hover:shadow-md hover:border-primary/30 transition-[box-shadow,border-color] duration-200"},{default:Z(()=>[e("div",Ml,[e("div",El,i(n.author?.[0]??"?"),1),e("div",jl,[e("p",Nl,i(n.author),1),e("p",Bl,i(n.time),1)])]),e("h3",Ol,i(n.topic),1),e("p",Pl,i(n.preview),1),e("div",Vl,[e("span",Fl,[s[74]||(s[74]=e("span",{class:"material-symbols-outlined",style:{"font-size":"1.05rem"}},"chat_bubble_outline",-1)),e("span",null,i(n.replies)+" "+i(n.replies===1?"comment":"comments"),1)]),e("span",ql,[(o(!0),l(y,null,_(n.reactions,M=>(o(),l("span",{key:M.emoji,class:"text-base leading-none"},i(M.emoji),1))),128)),n.reactions.length?(o(),l("span",Kl,i(n.reactions.reduce((M,st)=>M+st.n,0)),1)):u("",!0)]),s[75]||(s[75]=e("span",{class:"ml-auto inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-on-primary text-xs font-bold group-hover:brightness-110 transition-[filter]"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"add_comment"),b(" Comment ")],-1))])]),_:2},1032,["to"]))),128))]),e("div",Jl,[A(tt,{"space-id":t(d).id,"space-name":t(d).name,events:t(J),vouchers:t(B),"on-jump":be},null,8,["space-id","space-name","events","vouchers"]),A(ye,{vouchers:t(B),gallery:t(L),menu:t(N),"on-jump":be,"show-deals":!1},null,8,["vouchers","gallery","menu"])])])):u("",!0),t(d)&&t(g)==="events"?(o(),l("div",Gl,[e("section",Wl,[e("div",Hl,[e("div",Yl,[e("h3",Ql,i(t(ot)("events.heading","Upcoming events")),1),t(J).length?(o(),l("p",Zl,i(t(J).length)+" event"+i(t(J).length===1?"":"s")+" at "+i(t(d).name),1)):u("",!0)]),t(he)?(o(),l("button",{key:0,type:"button",class:"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-primary text-on-primary text-xs font-bold transition-[filter]",onClick:un},[...s[76]||(s[76]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"add",-1),b(" New event ",-1)])])):u("",!0)]),t(ct)?(o(),l("div",Xl,"Loading events…")):t(P)?(o(),l("div",er,i(t(P)),1)):t(J).length?(o(),l(y,{key:3},[e("div",{ref_key:"eventsTrack",ref:Ve,role:"group","aria-roledescription":"carousel","aria-label":`Events at ${t(d).name}`,class:"flex gap-2.5 overflow-x-auto snap-x snap-mandatory scrollbar-none pb-1 -mx-4 px-4 lg:-mx-0 lg:px-0",onScrollPassive:Se},[(o(!0),l(y,null,_(t(J),(n,M)=>(o(),W(wn(ft(n)?t(at):"div"),{key:n.id,to:ft(n)??void 0,"aria-label":`${n.event_name} — ${As(n.event_datetime)}`,"aria-roledescription":"slide","aria-posinset":M+1,"aria-setsize":t(J).length,class:"group snap-start shrink-0 basis-[64%] sm:basis-[46%] lg:basis-[calc(33.333%-0.5rem)] rounded-xl border border-outline-variant/20 bg-surface-container-lowest overflow-hidden active:scale-[0.985] transition-transform duration-150 flex flex-col focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"},{default:Z(()=>[e("div",nr,[It(n)?(o(),l("div",{key:0,class:"absolute inset-0 bg-cover bg-center",style:te({backgroundImage:`url(${JSON.stringify(encodeURI(It(n)))})`})},null,4)):(o(),l("div",ar,[...s[77]||(s[77]=[e("span",{class:"material-symbols-outlined text-primary/45",style:{"font-size":"1.875rem"},"aria-hidden":"true"},"event",-1)])])),s[78]||(s[78]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/45 via-trans
1parent to-black/15","aria-hidden":"true"},null,-1)),e("div",or,[e("p",lr,i(Dt(n.event_datetime)),1),e("p",rr,i(Zt(n.event_datetime)),1)]),e("div",ir,[n.status&&n.status!=="published"?(o(),l("span",ur,i(n.status),1)):u("",!0),Fe(n)?(o(),l("span",dr," Sold out ")):u("",!0),n.category?(o(),l("span",cr,i(n.category),1)):u("",!0)]),mt(n)?(o(),l("p",pr,i(mt(n)),1)):u("",!0)]),e("div",mr,[e("h4",fr,i(n.event_name),1),e("p",vr,[s[79]||(s[79]=e("span",{class:"material-symbols-outlined shrink-0",style:{"font-size":"0.8rem"},"aria-hidden":"true"},"schedule",-1)),e("span",br,i(As(n.event_datetime)),1)]),n.venue_name||n.city||n.event_type?(o(),l("p",yr,[e("span",xr,i(es(n.event_type)),1),e("span",gr,i(n.venue_name||(n.event_type==="virtual"||n.event_type==="online"?"Online event":"")||"—")+i(n.city?` · ${n.city}`:""),1)])):u("",!0),e("div",_r,[e("div",hr,[e("div",{class:w(["h-full rounded-full transition-[width] duration-300",Fe(n)?"bg-error":"bg-primary"]),style:te({width:`${ts(n)}%`})},null,6)]),e("div",kr,[e("p",wr,[e("span",Cr,i(n.sold_count),1),n.total_capacity?(o(),l(y,{key:0},[b(" / "+i(n.total_capacity),1)],64)):u("",!0),s[80]||(s[80]=b(" sold ",-1))]),e("span",{class:w(["px-2 py-1 rounded-md bg-primary text-on-primary text-[10px] font-bold",Fe(n)?"opacity-50":""])},i(Fe(n)?"Sold out":"Reserve"),3)])])])]),_:2},1032,["to","aria-label","aria-posinset","aria-setsize"]))),128))],40,sr),t(pt)>1?(o(),l("div",$r,[(o(!0),l(y,null,_(t(pt),n=>(o(),l("button",{key:n,type:"button",class:w(["h-1.5 rounded-full transition-[width,background-color] duration-200",t(ze)===n-1?"w-5 bg-primary":"w-1.5 bg-outline-variant/50"]),"aria-label":`Go to events page ${n}`,"aria-current":t(ze)===n-1?"true":void 0,onClick:M=>Qt(n-1)},null,10,zr))),128))])):u("",!0)],64)):(o(),l("div",tr," No upcoming events at "+i(t(d).name)+". ",1))]),e("div",Sr,[A(tt,{"space-id":t(d).id,"space-name":t(d).name,vouchers:t(B),"on-jump":be},null,8,["space-id","space-name","vouchers"]),A(ye,{vouchers:t(B),gallery:t(L),menu:t(N),"on-jump":be,"show-deals":!1},null,8,["vouchers","gallery","menu"])])])):u("",!0),t(d)&&t(g)==="courses"?(o(),l("div",Ar,[e("section",Rr,[e("div",Tr,[e("div",Ir,[e("h3",Dr,i(t(ot)("courses.heading","Courses")),1),t(I).length?(o(),l("p",Ur,[t(Te)?(o(),l(y,{key:0},[b(i(t(Re).length)+" of "+i(t(I).length)+" course"+i(t(I).length===1?"":"s"),1)],64)):(o(),l(y,{key:1},[b(i(t(I).length)+" course"+i(t(I).length===1?"":"s")+" at "+i(t(d).name),1)],64))])):u("",!0)]),t(Ne)?(o(),l("button",{key:0,type:"button",class:"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-primary text-on-primary text-xs font-bold transition-[filter]",onClick:Ps},[...s[81]||(s[81]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"add",-1),b(" New course ",-1)])])):u("",!0)]),t(vt)?(o(),l("div",Lr,"Loading courses…")):t(Ae)?(o(),l("div",Mr,i(t(Ae)),1)):t(I).length?(o(),l(y,{key:3},[e("div",jr,[t(D).length>1?(o(),l("label",Nr,[k(e("select",{"onUpdate:modelValue":s[7]||(s[7]=n=>pe(Q)?Q.value=n:null),"aria-label":"Filter by level",class:"appearance-none rounded-lg border border-outline-variant/30 bg-surface-container-lowest pl-2 pr-6 py-1 text-[10px] font-bold text-on-surface focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"},[s[82]||(s[82]=e("option",{value:"all"},"All levels",-1)),(o(!0),l(y,null,_(t(D),n=>(o(),l("option",{key:n,value:n},i(ce(n)),9,Br))),128))],512),[[Me,t(Q)]]),s[83]||(s[83]=e("span",{class:"material-symbols-outlined pointer-events-none absolute right-1 text-outline",style:{"font-size":"0.9rem"},"aria-hidden":"true"},"expand_more",-1))])):u("",!0),t(ve).length>1?(o(),l("label",Or,[k(e("select",{"onUpdate:modelValue":s[8]||(s[8]=n=>pe(c)?c.value=n:null),"aria-label":"Filter by topic",class:"appearance-none rounded-lg border border-outline-variant/30 bg-surface-container-lowest pl-2 pr-6 py-1 text-[10px] font-bold text-on-surface focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"},[s[84]||(s[84]=e("option",{value:"all"},"All topics",-1)),(o(!0),l(y,null,_(t(ve),n=>(o(),l("option",{key:n.key,value:n.key},i(n.label),9,Pr))),128))],512),[[Me,t(c)]]),s[85]||(s[85]=e("span",{class:"material-symbols-outlined pointer-events-none absolute right-1 text-outline",style:{"font-size":"0.9rem"},"aria-hidden":"true"},"expand_more",-1))])):u("",!0),e("label",Vr,[k(e("select",{"onUpdate:modelValue":s[9]||(s[9]=n=>pe(r)?r.value=n:null),"aria-label":"Filter by price",class:"appearance-none rounded-lg border border-outline-variant/30 bg-surface-container-lowest pl-2 pr-6 py-1 text-[10px] font-bold text-on-surface focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"},[...s[86]||(s[86]=[e("option",{value:"all"},"Any price",-1),e("option",{value:"free"},"Free",-1),e("option",{value:"paid"},"Paid",-1)])],512),[[Me,t(r)]]),s[87]||(s[87]=e("span",{class:"material-symbols-outlined pointer-events-none absolute right-1 text-outline",style:{"font-size":"0.9rem"},"aria-hidden":"true"},"expand_more",-1))]),t(Te)?(o(),l("button",{key:2,type:"button",class:"ml-auto inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold text-primary",onClick:bs},[...s[88]||(s[88]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.85rem"},"aria-hidden":"true"},"filter_alt_off",-1),b(" Clear ",-1)])])):u("",!0)]),t(Re).length?(o(),l("div",qr,[(o(!0),l(y,null,_(t(Re),n=>(o(),W(t(at),{key:n.id,to:`/m/courses/${n.slug}`,class:"group rounded-xl border border-outline-variant/20 bg-surface-container-lowest overflow-hidden active:scale-[0.985] transition-transform duration-150 flex flex-col focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"},{default:Z(()=>[e("div",Kr,[n.cover_image_url?(o(),l("div",{key:0,class:"absolute inset-0 bg-cover bg-center",style:te({backgroundImage:`url(${JSON.stringify(encodeURI(n.cover_image_url))})`})},null,4)):(o(),l("div",Jr,[...s[91]||(s[91]=[e("span",{class:"material-symbols-outlined text-primary/45",style:{"font-size":"1.875rem"},"aria-hidden":"true"},"school",-1)])])),s[92]||(s[92]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/45 via-trans
1parent to-black/15","aria-hidden":"true"},null,-1)),n.level?(o(),l("span",Gr,i(n.level),1)):u("",!0),e("div",Wr,[n.is_published?u("",!0):(o(),l("span",Hr," draft ")),n.category?(o(),l("span",Yr,i(n.category),1)):u("",!0)]),e("p",Qr,i(n.is_free?"Free":en(n.price)),1)]),e("div",Zr,[e("h4",Xr,i(n.title),1),e("div",ei,[e("p",ti,[s[93]||(s[93]=e("span",{class:"material-symbols-outlined shrink-0",style:{"font-size":"0.8rem"},"aria-hidden":"true"},"menu_book",-1)),e("span",si,i(n.lesson_count)+" lesson"+i(n.lesson_count===1?"":"s"),1)]),s[94]||(s[94]=e("span",{class:"shrink-0 px-2 py-1 rounded-md bg-primary text-on-primary text-[10px] font-bold"},"View",-1))])])]),_:2},1032,["to"]))),128))])):(o(),l("div",Fr,[s[89]||(s[89]=e("span",{class:"material-symbols-outlined text-outline/60",style:{"font-size":"2rem"},"aria-hidden":"true"},"search_off",-1)),s[90]||(s[90]=e("p",{class:"text-sm font-semibold text-on-surface-variant mt-1"},"No courses match these filters",-1)),e("button",{type:"button",class:"text-xs font-bold text-primary mt-1",onClick:bs},"Clear filters")]))],64)):(o(),l("div",Er,[b(" No courses yet in "+i(t(d).name)+". ",1),t(Ne)?(o(),l(y,{key:0},[b(' Tap "New course" to publish one.')],64)):u("",!0)]))]),A(ye,{vouchers:t(B),gallery:t(L),menu:t(N),"on-jump":be},null,8,["vouchers","gallery","menu"])])):u("",!0),t(d)&&t(g)==="reviews"?(o(),l("div",ni,[e("section",ai,[t(cs)?(o(),l("div",oi,"Loading reviews…")):t(Vt)?(o(),l("div",li,i(t(Vt)),1)):t(Ge).length?(o(),l(y,{key:3},[e("div",ii,[e("div",ui,[e("p",di,i(t(oe).avg??"—"),1),s[95]||(s[95]=e("p",{class:"text-[10px] uppercase tracking-widest text-outline mt-1"},"Avg rating",-1))]),e("div",ci,[e("div",pi,[(o(),l(y,null,_(5,n=>e("span",{key:n,class:w(["material-symbols-outlined",(t(oe).avg??0)>=n?"text-primary":"text-outline-variant"]),style:{"font-size":"1.25rem"}},i((t(oe).avg??0)>=n?"star":"star_border"),3)),64))]),e("p",mi,i(t(oe).count)+" review"+i(t(oe).count===1?"":"s"),1)])]),(o(!0),l(y,null,_(t(Ge),n=>(o(),l("article",{key:n.id,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-5 space-y-2"},[e("header",fi,[e("div",vi,i((n.reviewer_name||"?").trim().charAt(0).toUpperCase()),1),e("div",bi,[e("p",yi,i(n.reviewer_name),1),e("p",xi,i(new Date(n.created_at).toLocaleDateString("id-ID",{day:"2-digit",month:"short",year:"numeric"})),1)]),e("div",gi,[(o(),l(y,null,_(5,M=>e("span",{key:M,class:w(["material-symbols-outlined",(n.rating??0)>=M?"text-primary":"text-outline-variant"]),style:{"font-size":"1rem"}},i((n.rating??0)>=M?"star":"star_border"),3)),64))])]),n.title?(o(),l("h4",_i,i(n.title),1)):u("",!0),n.body?(o(),l("p",hi,i(n.body),1)):u("",!0),n.vendor_reply?(o(),l("div",ki,[e("p",wi,"Reply from "+i(t(d).name),1),e("p",Ci,i(n.vendor_reply),1)])):u("",!0)]))),128))],64)):(o(),l("div",ri," No reviews for "+i(t(d).name)+" yet. Be the first to share your experience. ",1))]),A(ye,{vouchers:t(B),gallery:t(L),menu:t(N),"on-jump":be},null,8,["vouchers","gallery","menu"])])):u("",!0),t(d)&&t(g)==="menu"?(o(),l("section",$i,[e("div",null,[t(rs)?(o(),l("div",zi,"Loading menu…")):t(jt)?(o(),l("div",Si,i(t(jt)),1)):t(N).length?(o(),l("div",Ri,[(o(!0),l(y,null,_(t(N),n=>(o(),l("article",{key:n.id,class:"snap-start shrink-0 basis-[calc(50%-0.375rem)] lg:basis-[calc(25%-0.5625rem)] rounded-xl border border-outline-variant/20 bg-surface-container-lowest overflow-hidden hover:shadow-md hover:border-primary/30 transition-[box-shadow,border-color] duration-200 flex flex-col"},[e("div",{class:"aspect-square bg-surface-container-high relative",style:te(n.image_url?{backgroundImage:`url(${JSON.stringify(encodeURI(n.image_url))})`,backgroundSize:"cover",backgroundPosition:"center"}:null)},[n.image_url?u("",!0):(o(),l("span",Ti,"restaurant_menu")),n.is_bestseller?(o(),l("span",Ii," Bestseller ")):u("",!0)],4),e("div",Di,[e("h4",Ui,i(n.name),1),n.description?(o(),l("p",Li,i(n.description),1)):u("",!0),e("p",Mi,i(Ss(n.price,n.currency)||"—"),1)])]))),128))])):(o(),l("div",Ai," No menu items from "+i(t(d).name)+" yet. ",1))]),e("div",Ei,[s[96]||(s[96]=e("h3",{class:"px-1 pb-2 text-sm font-extrabold uppercase tracking-widest text-on-surface-variant"},"Gallery",-1)),t(is)?(o(),l("div",ji,"Loading gallery…")):t(Bt)?(o(),l("div",Ni,i(t(Bt)),1)):t(L).length?(o(),l("div",Oi,[(o(!0),l(y,null,_(t(L),n=>(o(),l("figure",{key:n.id,class:"snap-start shrink-0 basis-[calc(100%-0.5rem)] lg:basis-[calc(50%-0.375rem)] rounded-2xl overflow-hidden border border-outline-variant/20 bg-surface-container relative"},[e("div",{class:"aspect-[4/3] bg-cover bg-center",style:te({backgroundImage:`url(${JSON.stringify(encodeURI(n.url))})`}),title:n.alt_text||""},null,12,Pi),n.alt_text||n.category?(o(),l("figcaption",Vi,i(n.alt_text||(n.category?n.category.replace(/_/g," "):"")),1)):u("",!0)]))),128))])):(o(),l("div",Bi," No photos from "+i(t(d).name)+" yet. ",1))])])):u("",!0),t(d)&&t(g)==="deals"?(o(),l("div",Fi,[e("section",qi,[t(ds)?(o(),l("div",Ki,"Loading deals…")):t(Ot)?(o(),l("div",Ji,i(t(Ot)),1)):t(B).length?(o(),l("div",Wi,[(o(!0),l(y,null,_(t(B),n=>(o(),W(t(at),{key:n.id,to:`/m/s/${t(F)}/voucher/${n.id}`,class:"block rounded-xl border border-outline-variant/20 bg-surface-container-lowest overflow-hidden hover:shadow-md hover:border-primary/30 transition-[box-shadow,border-color] duration-200 flex flex-row focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"},{default:Z(()=>[e("div",{class:"shrink-0 w-28 sm:w-36 bg-surface-container-high relative",style:te(n.thumbnail?{backgroundImage:`url(${JSON.stringify(encodeURI(n.thumbnail))})`,backgroundSize:"cover",backgroundPosition:"center"}:null)},[n.thumbnail?u("",!0):(o(),l("span",Hi,"local_offer")),Ct(n)?(o(),l("span",Yi," -"+i(Ct(n).pct)+"% ",1)):u("",!0)],4),e("div",Qi,[e("h4",Zi,i(n.title),1),n.description?(o(),l("p",Xi,i(n.description),1)):u("",!0),e("ul",eu,[Ct(n)?(o(),l("li",tu,[s[97]||(s[97]=e("span",{class:"material-symbols-outlined text-emerald-600 shrink-0",style:{"font-size":"1rem"}},"savings",-1)),e("span",null,"Save "+i(xt(Ct(n).saved))+" off "+i(xt(n.nominal_value)),1)])):u("",!0),Ds(n)?(o(),l("li",su,[s[98]||(s[98]=e("span",{class:"material-symbols-outlined shrink-0",style:{"font-size":"1rem"}},"schedule",-1)),e("span",null,i(Ds(n)),1)])):u("",!0),Us(n)?(o(),l("li",nu,[s[99]||(s[99]=e("span",{class:"material-symbols-outlined text-error/80 shrink-0",style:{"font-size":"1rem"}}
1,"event_busy",-1)),e("span",null,"Not valid: "+i(Us(n)),1)])):u("",!0)]),e("div",au,[e("div",ou,[e("p",lu,i(n.price_idr!=null?xt(n.price_idr):"—"),1),Ct(n)?(o(),l("p",ru,i(xt(n.nominal_value)),1)):u("",!0)]),s[100]||(s[100]=e("span",{class:"shrink-0 px-3 py-1.5 rounded-lg border border-primary text-primary text-xs font-bold inline-flex items-center gap-1.5"},[b(" Details "),e("span",{class:"material-symbols-outlined",style:{"font-size":"0.95rem"}},"chevron_right")],-1))])])]),_:2},1032,["to"]))),128))])):(o(),l("div",Gi," No deals from "+i(t(d).name)+" right now. ",1))]),A(ye,{vouchers:t(B),gallery:t(L),menu:t(N),"on-jump":be},null,8,["vouchers","gallery","menu"])])):u("",!0),t(d)&&t(g)==="location"?(o(),l("div",iu,[e("section",uu,[t(ps)?(o(),l("div",du,"Loading outlets…")):t(Ft)?(o(),l("div",cu,i(t(Ft)),1)):t(Ie).length?u("",!0):(o(),l("div",pu," No outlets listed for "+i(t(d).name)+" yet. ",1)),(o(!0),l(y,null,_(t(Ie),n=>(o(),l("article",{key:n.id,class:"rounded-xl border border-outline-variant/20 bg-surface-container-lowest p-5 space-y-3"},[e("header",mu,[e("div",fu,[e("h3",vu,i(n.title),1),n.city?(o(),l("p",bu,i([n.district,n.city,n.state].filter(Boolean).join(", ")),1)):u("",!0)]),e("a",{href:n.latitude!=null&&n.longitude!=null?`https://www.google.com/maps/search/?api=1&query=${n.latitude},${n.longitude}`:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([n.title,n.address,n.city,n.state].filter(Boolean).join(", "))}`,target:"_blank",rel:"noopener",class:"shrink-0 inline-flex items-center gap-1 px-3 py-1.5 rounded-lg bg-primary/10 text-primary text-xs font-bold hover:bg-primary/15 transition-colors"},[...s[101]||(s[101]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.95rem"},"aria-hidden":"true"},"map",-1),b(" Map ",-1)])],8,yu)]),n.address?(o(),l("a",{key:0,href:n.latitude!=null&&n.longitude!=null?`https://www.google.com/maps/search/?api=1&query=${n.latitude},${n.longitude}`:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([n.title,n.address,n.city,n.state].filter(Boolean).join(", "))}`,target:"_blank",rel:"noopener",class:"text-sm leading-relaxed text-on-surface-variant hover:text-primary transition-colors flex items-start gap-2 group"},[s[102]||(s[102]=e("span",{class:"material-symbols-outlined text-on-surface-variant group-hover:text-primary shrink-0 mt-0.5",style:{"font-size":"1rem"},"aria-hidden":"true"},"place",-1)),e("span",gu,i(n.address),1)],8,xu)):u("",!0),e("div",_u,[n.contact_phone?(o(),l("a",{key:0,href:`tel:${n.contact_phone.replace(/\s+/g,"")}`,class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-container hover:bg-surface-container-high text-on-surface transition-colors"},[s[103]||(s[103]=e("span",{class:"material-symbols-outlined",style:{"font-size":"0.95rem"},"aria-hidden":"true"},"call",-1)),b(" "+i(n.contact_phone),1)],8,hu)):u("",!0),n.contact_whatsapp?(o(),l("a",{key:1,href:`https://wa.me/${n.contact_whatsapp.replace(/[^0-9]/g,"")}`,target:"_blank",rel:"noopener",class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-emerald-500/10 text-emerald-700 hover:bg-emerald-500/15 transition-colors font-semibold"},[...s[104]||(s[104]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"0.95rem"},"aria-hidden":"true"},"chat",-1),b(" WhatsApp ",-1)])],8,ku)):u("",!0)])]))),128))]),A(ye,{vouchers:t(B),gallery:t(L),menu:t(N),"on-jump":be},null,8,["vouchers","gallery","menu"])])):u("",!0),t(d)&&t(g)==="members"?(o(),l("section",wu,[e("header",Cu,[e("h4",$u,i(Is(t(d).member_count))+" "+i(t(d).member_count===1?"member":"members"),1),e("div",zu,[!t(q)&&(t(d).recent_members?.length??0)<t(d).member_count?(o(),l("span",Su," showing "+i(t(d).recent_members?.length??0)+" most recent ",1)):u("",!0),t(_e)?(o(),l("button",{key:1,type:"button",class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-primary text-on-primary text-xs font-bold hover:brightness-110 transition-[filter]",onClick:dn},[...s[105]||(s[105]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1rem"}},"person_add",-1),b(" Invite ",-1)])])):u("",!0)])]),t(d).recent_members?.length?(o(),l("ul",Au,[(o(!0),l(y,null,_(t(d).recent_members,n=>(o(),l("li",{key:n.user_id,class:"flex items-center gap-3 px-5 py-3"},[e("div",Ru,[n.avatar_url?(o(),l("img",{key:0,src:n.avatar_url,alt:n.display_name,class:"w-full h-full object-cover"},null,8,Tu)):(o(),l("span",Iu,i((n.display_name||n.email||"?").trim().charAt(0).toUpperCase()),1))]),e("div",Du,[e("p",Uu,i(n.display_name||n.email),1),e("p",Lu,i(n.email),1)]),e("span",Mu,i(n.role),1),t(it)&&n.role!=="owner"?(o(),l("button",{key:0,t
1ype:"button",class:"ml-2 inline-flex items-center justify-center w-8 h-8 rounded-full text-on-surface-variant hover:text-error hover:bg-error/10 transition-colors",title:"Remove from space",onClick:M=>on(n)},[...s[106]||(s[106]=[e("span",{class:"material-symbols-outlined",style:{"font-size":"1.1rem"}},"person_remove",-1)])],8,Eu)):u("",!0)]))),128))])):t(q)?(o(),l("div",ju,[A(t(at),{to:t(C),class:"font-bold text-primary"},{default:Z(()=>[...s[107]||(s[107]=[b("Sign in",-1)])]),_:1},8,["to"]),s[108]||(s[108]=b(" to see who's in this space. ",-1))])):(o(),l("div",Nu," No members yet. Be the first to join. "))])):u("",!0),t(d)&&t(g)==="manage"&&t(T)?(o(),l("section",Bu,[A(fs,{"space-id":t(d).id,"user-roles":t(ge)},null,8,["space-id","user-roles"])])):u("",!0),(o(),W(Ee,{to:"body"},[t(Xe)?(o(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true",onClick:s[23]||(s[23]=ee(n=>Xe.value=!1,["self"]))},[e("div",Ou,[e("header",Pu,[e("h3",Vu,"New event in "+i(t(d)?.name),1),e("button",{type:"button",class:"text-on-surface-variant hover:text-on-surface","aria-label":"Close",onClick:s[10]||(s[10]=n=>Xe.value=!1)},[...s[109]||(s[109]=[e("span",{class:"material-symbols-outlined"},"close",-1)])])]),e("form",{class:"px-5 py-4 space-y-3 overflow-y-auto",onSubmit:ee(Ts,["prevent"])},[e("div",null,[s[110]||(s[110]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Event name *",-1)),k(e("input",{"onUpdate:modelValue":s[11]||(s[11]=n=>t(h).event_name=n),type:"text",required:"",placeholder:"Workshop, dinner, opening...",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).event_name]])]),e("div",Fu,[e("div",null,[s[111]||(s[111]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Start *",-1)),k(e("input",{"onUpdate:modelValue":s[12]||(s[12]=n=>t(h).event_datetime=n),type:"datetime-local",required:"",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).event_datetime]])]),e("div",null,[s[112]||(s[112]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"End",-1)),k(e("input",{"onUpdate:modelValue":s[13]||(s[13]=n=>t(h).event_end_datetime=n),type:"datetime-local",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).event_end_datetime]])])]),e("div",qu,[e("div",null,[s[114]||(s[114]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Type",-1)),k(e("select",{"onUpdate:modelValue":s[14]||(s[14]=n=>t(h).event_type=n),class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},[...s[113]||(s[113]=[e("option",{value:"offline"},"Offline",-1),e("option",{value:"online"},"Online",-1),e("option",{value:"hybrid"},"Hybrid",-1)])],512),[[Me,t(h).event_type]])]),e("div",null,[s[115]||(s[115]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Category",-1)),k(e("input",{"onUpdate:modelValue":s[15]||(s[15]=n=>t(h).category=n),type:"text",placeholder:"meetup, workshop, opening...",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).category]])])]),t(h).event_type!=="online"?(o(),l(y,{key:0},[e("div",null,[s[116]||(s[116]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Venue name",-1)),k(e("input",{"onUpdate:modelValue":s[16]||(s[16]=n=>t(h).venue_name=n),type:"text",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).venue_name]])]),e("div",Ku,[e("div",Ju,[s[117]||(s[11
17]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Address",-1)),k(e("input",{"onUpdate:modelValue":s[17]||(s[17]=n=>t(h).venue_address=n),type:"text",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).venue_address]])]),e("div",null,[s[118]||(s[118]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"City",-1)),k(e("input",{"onUpdate:modelValue":s[18]||(s[18]=n=>t(h).city=n),type:"text",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).city]])])])],64)):u("",!0),e("div",Gu,[e("div",null,[s[119]||(s[119]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Capacity",-1)),k(e("input",{"onUpdate:modelValue":s[19]||(s[19]=n=>t(h).total_capacity=n),type:"number",min:"0",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(h).total_capacity,void 0,{number:!0}]])]),e("div",null,[s[121]||(s[121]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Status",-1)),k(e("select",{"onUpdate:modelValue":s[20]||(s[20]=n=>t(h).status=n),class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},[...s[120]||(s[120]=[e("option",{value:"draft"},"Draft",-1),e("option",{value:"published"},"Published",-1)])],512),[[Me,t(h).status]])])]),e("div",null,[s[122]||(s[122]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Description",-1)),k(e("textarea",{"onUpdate:modelValue":s[21]||(s[21]=n=>t(h).description=n),rows:"3",placeholder:"What's the event about?",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm resize-y"},null,512),[[E,t(h).description]])]),t(et)?(o(),l("p",Wu,i(t(et)),1)):u("",!0)],32),e("footer",Hu,[e("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-xs font-semibold text-on-surface-variant hover:bg-surface-container transition-colors",disabled:t(kt),onClick:s[22]||(s[22]=n=>Xe.value=!1)}," Cancel ",8,Yu),e("button",{type:"button",class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-on-primary text-xs font-bold hover:brightness-110 transition-[filter] disabled:opacity-50",disabled:t(kt),onClick:Ts},[t(kt)?(o(),l("span",Zu,"progress_activity")):(o(),l("span",Xu,"save")),s[123]||(s[123]=b(" Create event ",-1))],8,Qu)])])])):u("",!0)])),(o(),W(Ee,{to:"body"},[t(qe)?(o(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true",onClick:s[33]||(s[33]=ee(n=>qe.value=!1,["self"]))},[e("div",ed,[e("header",td,[e("h3",sd,"New course in "+i(t(d)?.name),1),e("button",{type:"button",class:"text-on-surface-variant hover:text-on-surface","aria-label":"Close",onClick:s[24]||(s[24]=n=>qe.value=!1)},[...s[124]||(s[124]=[e("span",{class:"material-symbols-outlined"},"close",-1)])])]),e("form",{class:"px-5 py-4 space-y-3 overflow-y-auto",onSubmit:ee(ys,["prevent"])},[e("div",null,[s[125]||(s[125]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Title *",-1)),k(e("input",{"onUpdate:modelValue":s[25]||(s[25]=n=>t(U).title=n),type:"text",required:"",placeholder:"Course title",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(U).title]])]),e("div",null,[s[126]||(s[126]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Description",-1)),k(e("textarea",{"onUpdate:modelValue":s[26]||(s[26]=n=>t(U).description=n),rows:"3",placeholder:"What students will learn",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm resize-y"},null,512),[[E,t(U).description]])]),e("div",nd,[e("div",null,[s[128]||(s[128]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Level",-1)),k(e("select",{"onUpdate:modelValue":s[27]||(s[27]=n=>t(U).level=n),class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},[...s[127]||(s[127]=[e("option",{value:"beginner"},"Beginner",-1),e("option",{value:"intermediate"},"Intermediate",-1),e("option",{value:"advanced"},"Advanced",-1)])],512),[[Me,t(U).level]])]),e("div",null,[s[129]||(s[129]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Category",-1)),k(e("input",{"onUpdate:modelValue":s[28]||(s[28]=n=>t(U).category=n),type:"text",placeholder:"culinary, art, business...",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(U).category]])])]),e("div",ad,[k(e("input",{id:"m-course-is-free","onUpdate:modelValue":s[29]||(s[29]=n=>t(U).is_free=n),type:"checkbox",class:"rounded"},null,512),[[kn,t(U).is_free]]),s[130]||(s[130]=e("label",{for:"m-course-is-free",class:"text-xs font-semibold text-on-surface-variant"},"Free course",-1))]),t(U).is_free?u("",!0):(o(),l("div",od,[s[131]||(s[131]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Price (IDR)",-1)),k(e("input",{"onUpdate:modelValue":s[30]||(s[30]=n=>t(U).price=n),type:"number",min:"0",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(U).price,void 0,{number:!0}]])])),e("div",null,[s[132]||(s[132]=e("label",{class:"text-xs font-semibold text-on-surface-variant"},"Cover image URL",-1)),k(e("input",{"onUpdate:modelValue":s[31]||(s[31]=n=>t(U).cover_image_url=n),type:"url",placeholder:"https://…",class:"mt-1 w-full px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-sm"},null,512),[[E,t(U).cover_image_url]])]),t(Ke)?(o(),l("p",ld,i(t(Ke)),1)):u("",!0)],32),e("footer",rd,[e("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-xs font-semibold text-on-surface-variant hover:bg-surface-container transition-colors",disabled:t(yt),onClick:s[32]||(s[32]=n=>qe.value=!1)}," Cancel ",8,id),e("button",{type:"button",class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-on-primary text-xs font-bold hover:brightness-110 transition-[filter] disabled:opacity-50",disabled:t(yt),onClick:ys},[t(yt)?(o(),l("span",dd,"progress_activity")):(o(),l("span",cd,"save")),s[133]||(s[133]=b(" Create course ",-1))],8,ud)])])])):u("",!0)])),(o(),W(Ee,{to:"body"},[t(le)?(o(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true",onClick:s[36]||(s[36]=ee(n=>le.value=null,["self"]))},[e("div",pd,[e("header",md,[s[135]||(s[135]=e("h3",{class:"text-sm font-bold text-error inline-flex items-center gap-2"},[e("span",{class:"material-symbols-outlined",style:{"font-size":"1.1rem"}},"person_remove"),b(" Remove member? ")],-1)),e("button",{type:"button",class:"text-on-surface-variant hover:text-on-surface","aria-label":"Close",onClick:s[34]||(s[34]=n=>le.value=null)},[...s[134]||(s[134]=[e("span",{class:"material-symbols-outlined"},"close",-1)])])]),e("div",fd,[e("p",vd,[e("span",bd,i(t(le).display_name||"Member"),1),e("span",yd," · "+i(t(le).role),1)]),s[136]||(s[136]=e("p",{class:"text-caption text-on-surface-variant mb-0"}," They will lose access to this space immediately. You can re-invite them later via the share link. ",-1)),t(ht)?(o(),l("p",xd,i(t(ht)),1)):u("",!0)]),e("footer",gd,[e("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-xs font-semibold text-on-surface-variant hover:bg-surface-container transition-colors",disabled:!!t(Le),onClick:s[35]||(s[35]=n=>le.value=null)},"Cancel",8,_d),e("button",{type:"button",class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-error text-on-error text-xs font-bold hover:brightness-110 transition-[filter] disabled:opacity-50",disabled:!!t(Le),onClick:ln},[t(Le)?(o(),l("span",kd,"progress_activity")):(o(),l("span",wd,"person_remove")),b(" "+i(t(Le)?"Removing…":"Remove"),1)],8,hd)])])])):u("",!0)])),(o(),W(Ee,{to:"body"},[t(Qe)?(o(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true",onClick:s[40]||(s[40]=ee(n=>Qe.value=!1,["self"]))},[e("div",Cd,[e("header",$d,[e("h3",zd,"Invitation text · "+i(t(d)?.name),1),e("button",{type:"button",class:"text-on-surface-variant hover:text-on-surface","aria-label":"Close",onClick:s[37]||(s[37]=n=>Qe.value=!1)},[...s[137]||(s[137]=[e("span",{class:"material-symbols-outlined"},"close",-1)])])]),e("div",Sd,[s[138]||(s[138]=e("p",{class:"text-xs text-on-surface-variant"}," Sent verbatim when a teacher / moderator / admin enrols someone into this space. ",-1)),k(e("textarea",{"onUpdate:modelValue":s[38]||(s[38]=n=>pe(De)?De.value=n:null),rows:"5",maxlength:"4000",placeholder:"e.g. Welcome to our space! Tap the link below to confirm enrolment.",class:"w-full bg-surface-container border border-outline-variant/30 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary/40 resize-y"},null,512),[[E,t(De)]]),e("div",Ad,[e("span",Rd,i(t(De).length)+" / 4000",1),e("div",Td,[t(Jt)?(o(),l("span",Id,"Saved.")):u("",!0),t(Ze)?(o(),l("span",{key:1,class:"text-xs text-error truncate",title:t(Ze)},i(t(Ze)),9,Dd)):u("",!0)])])]),e("footer",Ud,[e("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-xs font-semibold text-on-surface-variant hover:bg-surface-container transition-colors",disabled:t(Ue),onClick:s[39]||(s[39]=n=>Qe.value=!1)}," Cancel ",8,Ld),e("button",{type:"button",class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-on-primary text-xs font-bold hover:brightness-110 transition-[filter] disabled:opacity-50",disabled:t(Ue)||t(De)===(t(d)?.invitation_text??""),onClick:rn},[t(Ue)?(o(),l("span",Ed,"progress_activity")):(o(),l("span",jd,"save")),b(" "+i(t(Ue)?"Saving…":"Save"),1)],8,Md)])])])):u("",!0)])),(o(),W(Ee,{to:"body"},[t(Gt)?(o(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true",onClick:s[43]||(s[43]=ee(n=>Gt.value=!1,["self"]))},[e("div",Nd,[e("header",Bd,[e("h3",Od,"Invite member to "+i(t(d)?.name),1),e("button",{type:"button",class:"text-on-surface-variant hover:text-on-surface","aria-label":"Close",onClick:s[41]||(s[41]=n=>Gt.value=!1)},[...s[139]||(s[139]=[e("span",{class:"material-symbols-outlined"},"close",-1)])])]),e("div",Pd,[s[140]||(s[140]=e("p",{class:"text-xs text-on-surface-variant"}," Share this link. Anyone with the link can request to join this space. ",-1)),e("div",Vd,[e("input",{value:t(ms),readonly:"",class:"flex-1 px-3 py-2 rounded-lg border border-outline-variant/30 bg-surface-container text-xs font-mono",onFocus:s[42]||(s[42]=n=>n.target.select())},null,40,Fd),e("button",{type:"button",class:"inline-flex items-center gap-1 px-3 py-2 rounded-lg bg-primary text-on-primary text-xs font-bold hover:brightness-110 transition-[filter]",onClick:cn},[e("span",qd,i(t(wt)?"check":"content_copy"),1),b(" "+i(t(wt)?"Copied":"Copy"),1)])])])])])):u("",!0)]))])}}}
1),nc=Object.assign(Kd,{__name:"SpaceDetailViewMobile"});export{nc as _};

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.