import{u as j}from"./B2EVM8kA.js";import{h as x}from"./IShi1APO.js";import{I as E,aq as u,ar as F,as as I,f as R,o as f,c as d,a as c,d as k,t as B,k as y}from"./BeMLom_z.js";import{u as U}from"./DGSvhV9M.js";import{_ as V}from"./DlAUqK2U.js";function A(o,e,r){const[t={},n]=typeof e=="string"?[{},e]:[e,r],s=E(()=>u(o)),i=t.key||x([n,typeof s.value=="string"?s.value:"",...G(t)]);if(!i||typeof i!="string")throw new TypeError("[nuxt] [useFetch] key must be a string: "+i);const l=i===n?"$f"+i:i;if(!t.baseURL&&typeof s.value=="string"&&s.value[0]==="/"&&s.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const{server:p,lazy:m,default:C,transform:_,pick:$,watch:g,immediate:q,getCachedData:T,deep:D,dedupe:L,...O}=t,w=F({...I,...O,cache:typeof t.cache=="boolean"?void 0:t.cache}),S={server:p,lazy:m,default:C,transform:_,pick:$,immediate:q,getCachedData:T,deep:D,dedupe:L,watch:g===!1?[]:[w,s,...g||[]]};let a;return U(l,()=>{var b;(b=a==null?void 0:a.abort)==null||b.call(a,"Request aborted as another request to the same endpoint was initiated."),a=typeof AbortController<"u"?new AbortController:{};const v=u(t.timeout);let h;return v&&(h=setTimeout(()=>a.abort("Request aborted due to timeout."),v),a.signal.onabort=()=>clearTimeout(h)),(t.$fetch||globalThis.$fetch)(s.value,{signal:a.signal,...w}).finally(()=>{clearTimeout(h)})},S)}function G(o){var r;const e=[((r=u(o.method))==null?void 0:r.toUpperCase())||"GET",u(o.baseURL)];for(const t of[o.params||o.query]){const n=u(t);if(!n)continue;const s={};for(const[i,l]of Object.entries(n))s[u(i)]=u(l);e.push(s)}return e}const N={};j("https://js.tito.io/v2");const M=R({name:"Workshop",props:{ticketingurl:String,conference:Object},data(){return{priceCountry:[],show:!1}},mounted(){const o=async r=>{const t=await e();if("prices"in r.fields){const{data:n,pending:s,error:i,refresh:l}=await A("https://secure.geonames.org/countryCode",{query:{lat:t.coords.latitude,lng:t.coords.longitude,username:"cityjs"}},"$Fm2rqW2tHL"),p=r.fields.prices.filter(m=>m.code.trim("")===n._value.trim(""));this.show=!s,this.priceCountry=p}},e=async()=>new Promise((r,t)=>{"geolocation"in navigator||t(new Error("Geolocation is not available.")),navigator.geolocation.getCurrentPosition(n=>{r(n)},n=>{t(n)})});this.conference&&o(this==null?void 0:this.conference,this.priceCountry)}}),P={class:"lg:w-[70%] w-full"},W={class:"container mx-auto text-center"},z={class:"flex flex-col"},H={key:0},K=["href"],J=["event"],Q=["src"];function X(o,e,r,t,n,s){return f(),d("div",P,[e[5]||(e[5]=c("link",{rel:"stylesheet",type:"text/css",href:"https://css.tito.io/v1.1"},null,-1)),c("div",W,[e[4]||(e[4]=c("h2",null,"Buy tickets",-1)),c("div",z,[e[3]||(e[3]=c("h3",null,"Select between group, combo, and standard tickets",-1)),o.conference.fields.hasIframe?y("",!0):(f(),d("div",H,[o.priceCountry.length>0?(f(),d("a",{key:0,style:{color:"rosybrown","font-weight":"bold","margin-top":"10px"},href:o.priceCountry[0].price},[e[0]||(e[0]=k("Save now with our special limited-time offer for you, ")),e[1]||(e[1]=c("br",null,null,-1)),k(" for our community in "+B(o.priceCountry[0].country)+", ",1),e[2]||(e[2]=c("u",null,"click here",-1))],8,K)):y("",!0),c("tito-widget",{event:o.ticketingurl},null,8,J)])),o.conference.fields.hasIframe?(f(),d("iframe",{key:1,class:"mt-10",src:o.conference.fields.ticetingurl,height:"600"},null,8,Q)):y("",!0)])])])}const Y={$style:N},ie=V(M,[["render",X],["__cssModules",Y]]);export{ie as default};
