(function(b){typeof define=="function"&&define.amd?define(b):b()})(function(){"use strict";var Zn=Object.defineProperty,es=Object.defineProperties;var ts=Object.getOwnPropertyDescriptors;var St=Object.getOwnPropertySymbols;var rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable;var He=(b,y,E)=>y in b?Zn(b,y,{enumerable:!0,configurable:!0,writable:!0,value:E}):b[y]=E,T=(b,y)=>{for(var E in y||(y={}))rs.call(y,E)&&He(b,E,y[E]);if(St)for(var E of St(y))ns.call(y,E)&&He(b,E,y[E]);return b},B=(b,y)=>es(b,ts(y));var h=(b,y,E)=>He(b,typeof y!="symbol"?y+"":y,E);var C=(b,y,E)=>new Promise((q,H)=>{var ge=O=>{try{V(E.next(O))}catch(M){H(M)}},R=O=>{try{V(E.throw(O))}catch(M){H(M)}},V=O=>O.done?q(O.value):Promise.resolve(O.value).then(ge,R);V((E=E.apply(b,y)).next())});function b(t){try{const e=new URL(t),r=e.hostname.toLowerCase(),n=e.pathname.toLowerCase(),s=e.protocol;if(r==="localhost"||y(r)||s==="file:"||s==="content:")return!0;const o=n.split("/").filter(a=>a);return!!(o.includes("wp-admin")||o.includes("wp-login")||n.includes("/wp-login.php")||e.searchParams.has("preview")||r.includes("getyourguide")||r.includes("gygdev.gygtest")||r==="translate.google.com"||r==="translate.googleusercontent.com")}catch(e){return!0}}function y(t){const e=t.split(".");return e.length!==4?!1:e.every(r=>{const n=parseInt(r,10);return!isNaN(n)&&n>=0&&n<=255&&r===String(n)})}function E(t){return!b(t)}function q(t,e,r){const n=new RegExp("([?&])"+t+"=.*?(&|$)","i"),s=r.indexOf("?")!==-1?"&":"?";return r.match(n)?r.replace(n,"$1"+t+"="+e+"$2"):r+s+t+"="+e}function H(t){const e="deeplink_id=[\\w-]+";return t.replace(new RegExp(`${e}&|&${e}|${e}`),"")}function ge(t,e){const r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.async=!0,n.src=t,r.appendChild(n)}const R={VIATOR:"viator",MUSEMENT:"musement",KLOOK:"klook",CIVITATIS:"civitatis",TICKETBAR:"ticketbar",TIQETS:"tiqets",MEDIAVINE:"mediavine"},V="https://collector.getyourguide.com",O="https://widget.getyourguide.com",M="gyg_visitor_id";class ${}const Ut=(t,e,...r)=>{t&&console.info(`%c[PA][${e}]`,"color: orange; font-weight: bold;",...r)};class x extends ${constructor(r,n,s){super();h(this,"name");h(this,"debug");h(this,"querySelector");this.name=r,this.debug=s,this.querySelector=n}scrape(r){return Array.from(r.querySelectorAll(this.querySelector)).filter(s=>!s.getAttribute("data-gyg-scraped"))}markElements(r){r.forEach(n=>{n.setAttribute("data-gyg-scraped",Date.now().toString())})}highlightElements(r){this.debug&&r.forEach(n=>{n.style.border="10px solid #39ff14"})}start(s){return C(this,arguments,function*({document:r,payload:n}){const o=this.scrape(r);return this.markElements(o),this.highlightElements(o),this.processElements(o,n),Ut(this.debug,this.name,this.querySelector,`items found: ${o.length}`,o),n})}}let z;const Ot=new Uint8Array(16);function Ct(){if(!z&&(z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!z))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(Ot)}const Lt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Nt(t){return typeof t=="string"&&Lt.test(t)}const I=[];for(let t=0;t<256;++t)I.push((t+256).toString(16).slice(1));function ze(t,e=0){return I[t[e+0]]+I[t[e+1]]+I[t[e+2]]+I[t[e+3]]+"-"+I[t[e+4]]+I[t[e+5]]+"-"+I[t[e+6]]+I[t[e+7]]+"-"+I[t[e+8]]+I[t[e+9]]+"-"+I[t[e+10]]+I[t[e+11]]+I[t[e+12]]+I[t[e+13]]+I[t[e+14]]+I[t[e+15]]}function Gt(t){if(!Nt(t))throw TypeError("Invalid UUID");let e;const r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}function Dt(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r>>32-e}function Mt(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){const a=unescape(encodeURIComponent(t));t=[];for(let u=0;u>>0;_=m,m=i,i=_e(c,30)>>>0,c=d,d=N}r[0]=r[0]+d>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+i>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}const J=Bt("v5",80,Mt);function X(t,e){try{e&&localStorage.setItem(t,e),window._GYG.localStorage=B(T({},window._GYG.localStorage),{[t]:e})}catch(r){window._GYG.localStorage=B(T({},window._GYG.localStorage),{[t]:e})}}function Xe(t){try{if(localStorage.getItem(t))return localStorage.getItem(t)}catch(e){if(window._GYG.localStorage)return window._GYG.localStorage[t]}return null}function $t(t){try{localStorage.removeItem(t)}catch(e){window._GYG.localStorage&&delete window._GYG.localStorage[t]}}const Yt="6ba7b811-9dad-11d1-80b4-00c04fd430c8",ye=t=>{try{const e=new URL(t),r=(e.hostname+e.pathname).replace(/^www\./,"").replace(/\/$/,"");return J(r,Yt)}catch(e){return}},F=class F extends x{constructor(){super("GYG-Deeplinks",F.GYG_LINK_QUERY,window._GYG.debug)}getBoundingClientRect(e){const{width:r,height:n,x:s,y:o}=e.getBoundingClientRect();return{x:s!==void 0?Math.round(s):void 0,y:o!==void 0?Math.round(o):void 0,width:r!==void 0?Math.round(r):void 0,height:n!==void 0?Math.round(n):void 0}}cleanUrl(e){var n;const r=e;if(r&&r.searchParams.has("cmp")){const s=(n=r.searchParams.get("cmp"))==null?void 0:n.split("_amcid")[0];s&&r.searchParams.set("cmp",s)}return r&&r.searchParams.has("recommended_activities")&&r.searchParams.delete("recommended_activities"),r.toString()}isDirectGYGLink(e){const r=e.getAttribute("href")||"";return/^https?:\/\/(www\.)?getyourguide/.test(r)}processElements(e,r){e.filter(this.isDirectGYGLink).filter(n=>n.closest("[data-gyg-widget]")===null).forEach(n=>{var g;const s=this.getBoundingClientRect(n),o=n.getAttribute("href")||"",a=new URL(o),u=a.searchParams.get("partner_id");let d;u?X("partner_id",u):r.header.partner_hash_code&&(a.searchParams.set("partner_id",r.header.partner_hash_code),d=r.header.partner_hash_code);const c=this.cleanUrl(a),i=J(c,F.NAMESPACE),m=ye(r.header.url),_=B(T({},s),{url:c,text:(g=n.textContent)==null?void 0:g.trim(),deeplink_id:i,page_id:m});this.attachIds(n,i,m,d),r.deeplinks=r.deeplinks||[],r.deeplinks.push(_)})}attachIds(e,r,n,s){let o=e.getAttribute("href")||"";o&&(this.isFixTrackDefined()||(o=q("deeplink_id",r,o),n&&(o=q("page_id",n,o)),s&&(o=q("partner_id",s,o))),e.setAttribute("href",o.toString()))}isFixTrackDefined(){return window.hasOwnProperty("FIX")&&window.FIX.hasOwnProperty("track")}};h(F,"GYG_LINK_QUERY",'a[href*="getyourguide."]'),h(F,"NAMESPACE","6ba7b811-9dad-11d1-80b4-00c04fd430c8");let Ee=F;const ee=class ee extends x{constructor(){super("VIATOR-Deeplinks",ee.VIATOR_LINK_QUERY,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{var o;const s={name:R.VIATOR,url:n.getAttribute("href"),text:(o=n.textContent)==null?void 0:o.trim()};r.competitor_deeplinks=r.competitor_deeplinks||[],r.competitor_deeplinks.push(s)}),r}};h(ee,"VIATOR_LINK_QUERY",'a[href*="www.partner.viator.com"]');let we=ee;const te=class te extends x{constructor(){super("TICKETBAR-Deeplinks",te.TICKETBAR_LINK_QUERY,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{var o;const s={name:R.TICKETBAR,url:n.getAttribute("href"),text:(o=n.textContent)==null?void 0:o.trim()};r.competitor_deeplinks=r.competitor_deeplinks||[],r.competitor_deeplinks.push(s)}),r}};h(te,"TICKETBAR_LINK_QUERY",'a[href*="ticketbar.eu"]');let be=te;const re=class re extends x{constructor(){super("MUSEMENT-Deeplinks",re.MUSEMENT_LINK_QUERY,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{var o;const s={name:R.MUSEMENT,url:n.getAttribute("href"),text:(o=n.textContent)==null?void 0:o.trim()};r.competitor_deeplinks=r.competitor_deeplinks||[],r.competitor_deeplinks.push(s)}),r}};h(re,"MUSEMENT_LINK_QUERY",'a[href*="www.musement.com"]');let ve=re;const ne=class ne extends x{constructor(){super("CIVITATIS-Deeplinks",ne.CIVITATIS_LINK_QUERY,window._GYG.debug)}processElements(e,r){e.forEach(n=>{var o;const s={name:R.CIVITATIS,url:n.getAttribute("href"),text:(o=n.textContent)==null?void 0:o.trim()};r.competitor_deeplinks=r.competitor_deeplinks||[],r.competitor_deeplinks.push(s)})}};h(ne,"CIVITATIS_LINK_QUERY",'a[href*="www.civitatis.com"]');let Te=ne;const se=class se extends x{constructor(){super("TIQETS-Deeplinks",se.TIQETS_LINK_QUERY,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{var o;const s={name:R.TIQETS,url:n.getAttribute("href"),text:(o=n.textContent)==null?void 0:o.trim()};r.competitor_deeplinks=r.competitor_deeplinks||[],r.competitor_deeplinks.push(s)}),r}};h(se,"TIQETS_LINK_QUERY",'a[href*="www.tiqets.com"]');let Ie=se;const oe=class oe extends x{constructor(){super("KLOOK-Deeplinks",oe.KLOOK_LINK_QUERY,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{var o;const s={name:R.KLOOK,url:n.getAttribute("href"),text:(o=n.textContent)==null?void 0:o.trim()};r.competitor_deeplinks=r.competitor_deeplinks||[],r.competitor_deeplinks.push(s)}),r}};h(oe,"KLOOK_LINK_QUERY",'a[href*="www.klook.com"]');let Pe=oe;const Ft=[Ee,we,be,ve,Te,Ie,Pe],Wt="0e7c8e4a-453a-4a3f-aa76-186f61d75001",qt=t=>{const e=new URL(t),r=e.pathname.replace(/\/$/,"").split("/").pop().split(".");let n=r[0];n==="activites"&&(n="activities"),n!=="activities"&&n!=="city"&&n!=="availability"&&n!=="activities-auto"&&n!=="map"&&(n="custom");let s=r[1];s==="jpg"&&(s="jpeg");const o={p:e.searchParams.has("partner_id")?e.searchParams.get("partner_id"):e.pathname.split("/")[1],w:n,f:s,m:e.searchParams.has("cmp")?e.searchParams.get("cmp"):void 0,q:e.searchParams.has("q")?e.searchParams.get("q"):void 0,i:e.searchParams.has("iata")?e.searchParams.get("iata"):void 0,d:e.searchParams.has("location_id")?e.searchParams.get("location_id"):void 0,c:e.searchParams.has("currency")?e.searchParams.get("currency"):void 0,l:e.searchParams.has("locale_code")?e.searchParams.get("locale_code"):void 0,n:e.searchParams.has("number_of_items")?Number(e.searchParams.get("number_of_items")):void 0,t:e.searchParams.has("tour_ids")?e.searchParams.get("tour_ids"):void 0,u:e.searchParams.has("tour_id")?e.searchParams.get("tour_id"):void 0,h:e.searchParams.has("theme")?e.searchParams.get("theme"):void 0,v:e.searchParams.has("variant")?e.searchParams.get("variant"):void 0,e:e.searchParams.has("excluded_tour_ids")?e.searchParams.get("excluded_tour_ids"):void 0,a:e.searchParams.has("lat")?e.searchParams.get("lat"):void 0,o:e.searchParams.has("lon")?e.searchParams.get("lon"):void 0};return J(JSON.stringify(o),Wt)},Kt="data-gyg-widget-created",Qt="data-gyg-widget-rendered",Ht="data-gyg-widget-ttfb",zt="data-gyg-widget-fcp",Ze="data-gyg-widget-lcp",ie=class ie extends x{constructor(){super("GYG-Widget",ie.GYG_WIDGET_QUERY,window._GYG.debug)}extractIds(e){return e?e.split(",").map(n=>parseInt(n)).filter(n=>!Number.isNaN(n)):null}parseNumber(e){return e?parseInt(e):null}parseFloat(e){return e?parseFloat(e):null}getBoundingClientRect(e){const{width:r,height:n,x:s,y:o}=e.getBoundingClientRect();return{x:s!==void 0?Math.round(s):0,y:o!==void 0?Math.round(o):0,width:r!==void 0?Math.round(r):0,height:n!==void 0?Math.round(n):0}}getWidgetType(e){let r=e.pathname.split("/")[2].split(".")[0];return r==="activites"&&(r="activities"),r!=="activities"&&r!=="city"&&r!=="availability"&&r!=="activities-auto"&&r!=="map"&&(r="custom"),r}getWidgetFormat(e){const r=e.pathname.split("/")[2].split(".");let n="frame";return r.length>1&&(n=r[1],n==="jpg"&&(n="jpeg")),n}getWidgetRenderingTime(e){const r=e.parentElement;if(!r)return;const n=e.getAttribute(Qt),s=r.getAttribute(Kt);if(!(!n||!s))return parseInt(n,10)-parseInt(s,10)}getWidgetFcp(e){const r=e.getAttribute(zt);return r?this.parseFloat(r):null}getWidgetTtfb(e){const r=e.getAttribute(Ht);return r?this.parseFloat(r):null}getWidgetLcp(e){const r=e.getAttribute(Ze);return r?this.parseFloat(r):null}processElements(e,r){return e.forEach(n=>{const s=this.getBoundingClientRect(n),o=n.getAttribute("src");if(!o)return;const a=new URL(o),u=a.searchParams.get("partner_id"),d=this.parseFloat(a.searchParams.get("lat")),c=this.parseFloat(a.searchParams.get("lon")),i=B(T({},s),{type:this.getWidgetType(a),rendering_time:this.getWidgetRenderingTime(n),fcp:this.getWidgetFcp(n),ttfb:this.getWidgetTtfb(n),lcp:this.getWidgetLcp(n),widget_parameters:{campaign:a.searchParams.get("cmp"),currency:a.searchParams.get("currency"),excluded_tour_ids:this.extractIds(a.searchParams.get("excluded_tour_ids")),iata:a.searchParams.get("iata"),locale_code:a.searchParams.get("locale_code"),number_of_items:this.parseNumber(a.searchParams.get("number_of_items")),partner_hash_code:u,query:a.searchParams.get("q"),tour_ids:this.getTourIdsFromSearchParams(a.searchParams),widget_id:qt(o),geo_location:typeof d=="number"&&typeof c=="number"?{latitude:d,longitude:c}:null,format:this.getWidgetFormat(a)}});u&&X("partner_id",u),r.widgets=r.widgets||[],r.widgets.push(i)}),r}getTourIdsFromSearchParams(e){const r=this.extractIds(e.get("tour_ids"));if(!r){const n=this.parseNumber(e.get("tour_id"));return n?[n]:null}return r}};h(ie,"GYG_WIDGET_QUERY",`iframe[src^="https://widget.getyourguide.com"][${Ze}]`);let Ae=ie;const ae=class ae extends x{constructor(){super("CIVITATIS-CompetitorWidgets",ae.CIVITATIS_LINK_QUERY,window._GYG.debug)}processElements(e,r){e.forEach(n=>{const s={name:R.CIVITATIS,url:n.getAttribute("src")};r.competitor_widgets=r.competitor_widgets||[],r.competitor_widgets.push(s)})}};h(ae,"CIVITATIS_LINK_QUERY",'iframe[src*="www.civitatis.com"]');let Re=ae;const ce=class ce extends x{constructor(){super("KLOOK-CompetitorWidgets",ce.KLOOK_LINK_QUERY,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{const s={name:R.KLOOK,url:n.getAttribute("src")};r.competitor_widgets=r.competitor_widgets||[],r.competitor_widgets.push(s)}),r}};h(ce,"KLOOK_LINK_QUERY",'iframe[src*="affiliate.klook.com"]');let xe=ce;const de=class de extends x{constructor(){super("Ticketbar-CompetitorWidgets",de.TICKETBAR_WIDGET,window._GYG.debug)}processElements(e,r){return e.forEach(()=>{const n={name:R.TICKETBAR,url:""};r.competitor_widgets=r.competitor_widgets||[],r.competitor_widgets.push(n)}),r}};h(de,"TICKETBAR_WIDGET",'div[class*="Ticketbar-Widget"]');let Se=de;const ue=class ue extends x{constructor(){super("Tiqets-CompetitorWidgets",ue.TIQETS_WIDGET,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{const s={name:R.TIQETS,url:n.getAttribute("src")};r.competitor_widgets=r.competitor_widgets||[],r.competitor_widgets.push(s)}),r}};h(ue,"TIQETS_WIDGET",'iframe[src*="www.tiqets.com/widgets"]');let Ue=ue;const le=class le extends x{constructor(){super("Viator-CompetitorWidgets",le.VIATOR_WIDGET,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{const s={name:R.VIATOR,url:n.getAttribute("src")};r.competitor_widgets=r.competitor_widgets||[],r.competitor_widgets.push(s)}),r}};h(le,"VIATOR_WIDGET",'iframe[src*="www.viator.com/orion/widget"]');let Oe=le;const fe=class fe extends x{constructor(){super("Mediavine-CompetitorWidgets",fe.MEDIAVINE_WIDGET,window._GYG.debug)}processElements(e,r){return e.forEach(n=>{const s=n.getAttribute("data-slotid"),o=`${document.baseURI}#slot=${s}`,a={name:R.MEDIAVINE,url:o};r.competitor_widgets=r.competitor_widgets||[],r.competitor_widgets.push(a)}),r}};h(fe,"MEDIAVINE_WIDGET",'div[class*="mv-ad-box"]');let Ce=fe;const Jt=[Ae,Re,xe,Se,Ue,Oe,Ce],Xt=[...Ft,...Jt];class Zt extends ${start(r){return C(this,arguments,function*({payload:e}){const{offsetWidth:n,scrollHeight:s}=document.body,{fontFamily:o,fontSize:a,lineHeight:u}=window.getComputedStyle(document.body),{navigationStart:d,unloadEventStart:c,unloadEventEnd:i,redirectStart:m,redirectEnd:_,fetchStart:g,domainLookupStart:W,domainLookupEnd:N,connectStart:Ke,connectEnd:l,secureConnectionStart:f,requestStart:p,responseStart:U,responseEnd:v,domLoading:Qe,domInteractive:Kn,domContentLoadedEventStart:Qn,domContentLoadedEventEnd:Hn,domComplete:zn,loadEventStart:Jn,loadEventEnd:Xn}=performance.timing;return e.page={width:n,height:s,page_title:document.title,page_font_family:o,page_font_size:a,page_line_height:u,performance:{navigation_start:d,unload_event_start:c,unload_event_end:i,redirect_start:m,redirect_end:_,fetch_start:g,domain_lookup_start:W,domain_lookup_end:N,connect_start:Ke,connect_end:l,secure_connection_start:f!=null?f:0,request_start:p,response_start:U,response_end:v,dom_loading:Qe,dom_interactive:Kn,dom_content_loaded_event_start:Qn,dom_content_loaded_event_end:Hn,dom_complete:zn,load_event_start:Jn,load_event_end:Xn}},e})}}class er extends ${getOS(){let e="Unknown OS";return navigator.appVersion.indexOf("Win")!==-1&&(e="Windows"),navigator.appVersion.indexOf("Mac")!==-1&&(e="MacOS"),navigator.appVersion.indexOf("X11")!==-1&&(e="UNIX"),navigator.appVersion.indexOf("Linux")!==-1&&(e="Linux"),e}getPartnerHashCode(){let e=null;const r=document.querySelector('script[src*="getyourguide.com/dist/pa."]');return r&&(e=r.getAttribute("data-gyg-partner-id"),e&&X("partner_id",e)),e||(e=Xe("partner_id")),e==null?void 0:e.toUpperCase()}isMobileDevice(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}getPlatform(){return this.isMobileDevice()?"mweb":"desktop"}start(r){return C(this,arguments,function*({payload:e}){const{userAgent:n=null,language:s=null}=navigator,{referrer:o=null}=document,{href:a=null,origin:u=null}=window.location;return e.header={platform:this.getPlatform(),domain:u,url:a,user_agent:n,referrer_domain:o,os:this.getOS(),partner_hash_code:this.getPartnerHashCode(),accept_language:[s]},e})}}function Y(t,e){if(!e)return"";let r="; "+t;return e===!0?r:r+"="+e}function tr(t){if(typeof t.expires=="number"){const e=Math.min(Date.now()+t.expires*864e5,864e13);t.expires=new Date(e)}return Y("Expires",t.expires?t.expires.toUTCString():"")+Y("Domain",t.domain)+Y("Path",t.path)+Y("Secure",t.secure)+Y("Partitioned",t.partitioned)+Y("SameSite",t.sameSite)}function rr(t,e,r){return encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)+tr(r)}function nr(t){let e={};const r=t?t.split("; "):[];for(let n of r){const s=n.split("=");let o=s.slice(1).join("=");o[0]==='"'&&(o=o.slice(1,-1));try{const a=decodeURIComponent(s[0]);e[a]=o.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}catch(a){}}return e}function sr(){return nr(document.cookie)}function or(t){return sr()[t]}function ir(t,e,r){document.cookie=rr(t,e,T({path:"/"},r))}var A=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof A!="undefined"&&A,S={searchParams:"URLSearchParams"in A,iterable:"Symbol"in A&&"iterator"in Symbol,blob:"FileReader"in A&&"Blob"in A&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in A,arrayBuffer:"ArrayBuffer"in A};function ar(t){return t&&DataView.prototype.isPrototypeOf(t)}if(S.arrayBuffer)var cr=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],dr=ArrayBuffer.isView||function(t){return t&&cr.indexOf(Object.prototype.toString.call(t))>-1};function K(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Le(t){return typeof t!="string"&&(t=String(t)),t}function Ne(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return S.iterable&&(e[Symbol.iterator]=function(){return e}),e}function w(t){this.map={},t instanceof w?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}w.prototype.append=function(t,e){t=K(t),e=Le(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},w.prototype.delete=function(t){delete this.map[K(t)]},w.prototype.get=function(t){return t=K(t),this.has(t)?this.map[t]:null},w.prototype.has=function(t){return this.map.hasOwnProperty(K(t))},w.prototype.set=function(t,e){this.map[K(t)]=Le(e)},w.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},w.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),Ne(t)},w.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),Ne(t)},w.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),Ne(t)},S.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function Ge(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function et(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function ur(t){var e=new FileReader,r=et(e);return e.readAsArrayBuffer(t),r}function lr(t){var e=new FileReader,r=et(e);return e.readAsText(t),r}function fr(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?e:t}function k(t,e){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof k){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new w(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new w(e.headers)),this.method=pr(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function gr(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(s),decodeURIComponent(o))}}),e}function mr(t){var e=new w,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(` `)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var a=s.join(":").trim();e.append(o,a)}}),e}rt.call(k.prototype);function L(t,e){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new w(e.headers),this.url=e.url||"",this._initBody(t)}rt.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},L.error=function(){var t=new L(null,{status:0,statusText:""});return t.type="error",t};var _r=[301,302,303,307,308];L.redirect=function(t,e){if(_r.indexOf(e)===-1)throw new RangeError("Invalid status code");return new L(null,{status:e,headers:{location:t}})};var j=A.DOMException;try{new j}catch(t){j=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},j.prototype=Object.create(Error.prototype),j.prototype.constructor=j}function nt(t,e){return new Promise(function(r,n){var s=new k(t,e);if(s.signal&&s.signal.aborted)return n(new j("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var d={status:o.status,statusText:o.statusText,headers:mr(o.getAllResponseHeaders()||"")};d.url="responseURL"in o?o.responseURL:d.headers.get("X-Request-URL");var c="response"in o?o.response:o.responseText;setTimeout(function(){r(new L(c,d))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new j("Aborted","AbortError"))},0)};function u(d){try{return d===""&&A.location.href?A.location.href:d}catch(c){return d}}o.open(s.method,u(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(S.blob?o.responseType="blob":S.arrayBuffer&&s.headers.get("Content-Type")&&s.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof w)?Object.getOwnPropertyNames(e.headers).forEach(function(d){o.setRequestHeader(d,Le(e.headers[d]))}):s.headers.forEach(function(d,c){o.setRequestHeader(c,d)}),s.signal&&(s.signal.addEventListener("abort",a),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",a)}),o.send(typeof s._bodyInit=="undefined"?null:s._bodyInit)})}nt.polyfill=!0,A.fetch||(A.fetch=nt,A.Headers=w,A.Request=k,A.Response=L);const yr=t=>(Object.prototype.hasOwnProperty.call(t,"GYG")||(t.GYG=t.GYG||{}),t.GYG.visitorIdPromise||(t.GYG.visitorIdPromise=fetch(`${O}/gnikcart`,{credentials:"include"}).then(e=>e.json()).catch(()=>{const e=me().replace(/-/g,"").toUpperCase().substring(0,32);t.GYG.visitorIdPromise=Promise.resolve({visitor_id:e})})),t.GYG.visitorIdPromise);class Er extends ${getVisitorId(){return C(this,null,function*(){let e=sessionStorage.getItem(M)||"";if(!e){const{visitor_id:r}=yield yr(window);r&&sessionStorage.setItem(M,r),e=r}return e})}getSessionId(e){return e=e||or("session_id"),e||(e=me(),ir("session_id",e)),e}start(n){return C(this,arguments,function*({sessionId:e,payload:r}){const{language:s=null}=navigator;return r.user={visitor_id:yield this.getVisitorId(),session_id:this.getSessionId(e),locale_code:s},r})}}const he=class he extends ${start(r){return C(this,arguments,function*({payload:e}){return e.event_properties={uuid:me(),sent_by:he.SENT_BY},e})}};h(he,"SENT_BY","PartnerAnalyzer");let De=he;class wr extends ${isScriptLoadedViaWidget(e){return e.dataset.gygScriptOrigin==="widget"}getScriptOriginType(e){const r=e.some(this.isScriptLoadedViaWidget),n=!e.every(this.isScriptLoadedViaWidget);return r&&n?"BOTH":r?"WIDGET":"DIRECT"}getScripts(){const e=window._GYG.env==="production"?`${O}/dist/pa.umd.production.min.js`:"dist/pa.umd.development.js";return Array.from(document.querySelectorAll(`script[src*="${e}"]`))}start(r){return C(this,arguments,function*({payload:e}){const n=this.getScriptOriginType(this.getScripts());return e.script_origin=n,e})}}const br=[...[De,Er,er,Zt,wr],...Xt];function st(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ke={exports:{}},ot;function vr(){return ot||(ot=1,function(t){(function(){function e(c,i,m){var _;document.createEvent?(_=document.createEvent("HTMLEvents"),_.initEvent(i,!0,!0)):document.createEventObject&&(_=document.createEventObject(),_.eventType=i),_.state=m,_.eventName=i,c.dispatchEvent?c.dispatchEvent(_):c.fireEvent&&htmlEvents["on"+i]?c.fireEvent("on"+_.eventType,_):c[i]?c[i]():c["on"+i]&&c["on"+i]()}function r(c,i,m){c.addEventListener?c.addEventListener(i,m,!1):c.attachEvent&&htmlEvents["on"+i]?c.attachEvent("on"+i,m):c["on"+i]=m}function n(c,i,m){c.removeventListener?c.removeEventListener(i,m,!1):c.detachEvent&&htmlEvents["on"+i]?c.detachEvent("on"+i,m):c["on"+i]=null}function s(){return typeof window!="undefined"&&window.history&&"pushState"in window.history}if(s()){var o=window.history,a=o.pushState;o.pushState=function(c){var i=a.apply(o,arguments);return e(window,"pushstate",c),e(window,"changestate",c),i};var u=o.replaceState;o.replaceState=function(c){var i=u.apply(o,arguments);return e(window,"replacestate",c),e(window,"changestate",c),i},r(window,"popstate",function(c){e(window,"changestate",c.state)})}var d={isHistorySupported:s,addEventListener:r,removeEventListener:n,triggerEvent:e};s()&&(window.HistoryEvents=d),t.exports=d})()}(ke)),ke.exports}var Tr=vr();const Ir=st(Tr),Pr=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ar=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Rr=/^\s*["[{]|^\s*-?\d[\d.]{0,14}\s*$/;function xr(t,e){if(t!=="__proto__"&&!(t==="constructor"&&e&&typeof e=="object"&&"prototype"in e))return e}function Sr(t,e={}){if(typeof t!="string")return t;const r=t.toLowerCase().trim();if(r==="true")return!0;if(r==="false")return!1;if(r==="null")return null;if(r==="nan")return Number.NaN;if(r==="infinity")return Number.POSITIVE_INFINITY;if(r!=="undefined"){if(!Rr.test(t)){if(e.strict)throw new SyntaxError("Invalid JSON");return t}try{return Pr.test(t)||Ar.test(t)?JSON.parse(t,xr):JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}}const Ur=/#/g,Or=/&/g,Cr=/=/g,it=/\+/g,Lr=/%5B/gi,Nr=/%5D/gi,Gr=/%5E/gi,Dr=/%60/gi,kr=/%7B/gi,jr=/%7C/gi,Br=/%7D/gi,Vr=/%20/gi;function Mr(t){return encodeURI(""+t).replace(jr,"|").replace(Lr,"[").replace(Nr,"]")}function je(t){return Mr(t).replace(it,"%2B").replace(Vr,"+").replace(Ur,"%23").replace(Or,"%26").replace(Dr,"`").replace(kr,"{").replace(Br,"}").replace(Gr,"^")}function Be(t){return je(t).replace(Cr,"%3D")}function at(t=""){try{return decodeURIComponent(""+t)}catch(e){return""+t}}function $r(t){return at(t.replace(it," "))}function Yr(t=""){const e={};t[0]==="?"&&(t=t.substr(1));for(const r of t.split("&")){const n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const s=at(n[1]);if(s==="__proto__"||s==="constructor")continue;const o=$r(n[2]||"");e[s]?Array.isArray(e[s])?e[s].push(o):e[s]=[e[s],o]:e[s]=o}return e}function Fr(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${Be(t)}=${je(r)}`).join("&"):`${Be(t)}=${je(e)}`:Be(t)}function Wr(t){return Object.keys(t).map(e=>Fr(e,t[e])).join("&")}const qr=/^\w+:(\/\/)?/,Kr=/^\/\/[^/]+/;function ct(t,e=!1){return qr.test(t)||e&&Kr.test(t)}const Qr=/\/$|\/\?/;function Ve(t="",e=!1){return e?Qr.test(t):t.endsWith("/")}function Hr(t="",e=!1){if(!e)return(Ve(t)?t.slice(0,-1):t)||"/";if(!Ve(t,!0))return t||"/";const[r,...n]=t.split("?");return(r.slice(0,-1)||"/")+(n.length?`?${n.join("?")}`:"")}function zr(t="",e=!1){if(!e)return t.endsWith("/")?t:t+"/";if(Ve(t,!0))return t||"/";const[r,...n]=t.split("?");return r+"/"+(n.length?`?${n.join("?")}`:"")}function Jr(t=""){return t.startsWith("/")}function Xr(t=""){return(Jr(t)?t.substr(1):t)||"/"}function Zr(t,e){if(tn(e)||ct(t))return t;const r=Hr(e);return t.startsWith(r)?t:nn(r,t)}function en(t,e){const r=sn(t),n=T(T({},Yr(r.search)),e);return r.search=Wr(n),on(r)}function tn(t){return!t||t==="/"}function rn(t){return t&&t!=="/"}function nn(t,...e){let r=t||"";for(const n of e.filter(rn))r=r?zr(r)+Xr(n):n;return r}function sn(t="",e){if(!ct(t,!0))return dt(t);const[r="",n,s=""]=(t.replace(/\\/g,"/").match(/([^:/]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1),[o="",a=""]=(s.match(/([^/?#]*)(.*)?/)||[]).splice(1),{pathname:u,search:d,hash:c}=dt(a);return{protocol:r,auth:n?n.substr(0,n.length-1):"",host:o,pathname:u,search:d,hash:c}}function dt(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function on(t){const e=t.pathname+(t.search?(t.search.startsWith("?")?"":"?")+t.search:"")+t.hash;return t.protocol?t.protocol+"//"+(t.auth?t.auth+"@":"")+t.host+e:e}class an extends Error{constructor(){super(...arguments),this.name="FetchError"}}function cn(t,e,r){let n="";t&&r&&(n=`${r.status} ${r.statusText} (${t.toString()})`),e&&(n=`${e.message} (${n})`);const s=new an(n);return Object.defineProperty(s,"request",{get(){return t}}),Object.defineProperty(s,"response",{get(){return r}}),Object.defineProperty(s,"data",{get(){return r&&r._data}}),Object.defineProperty(s,"status",{get(){return r&&r.status}}),Object.defineProperty(s,"statusText",{get(){return r&&r.statusText}}),Object.defineProperty(s,"statusCode",{get(){return r&&r.status}}),Object.defineProperty(s,"statusMessage",{get(){return r&&r.statusText}}),s}const dn=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function ut(t="GET"){return dn.has(t.toUpperCase())}function un(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const ln=new Set(["image/svg","application/xml","application/xhtml","application/html"]),fn=/^application\/(?:[\w!#$%&*`\-.^~]*\+)?json(;.+)?$/i;function hn(t=""){if(!t)return"json";const e=t.split(";").shift();return fn.test(e)?"json":ln.has(e)||e.startsWith("text/")?"text":"blob"}const pn=new Set([408,409,425,429,500,502,503,504]);function lt(t){const{fetch:e,Headers:r}=t;function n(a){const u=a.error&&a.error.name==="AbortError"||!1;if(a.options.retry!==!1&&!u){const c=typeof a.options.retry=="number"?a.options.retry:ut(a.options.method)?0:1,i=a.response&&a.response.status||500;if(c>0&&pn.has(i))return s(a.request,B(T({},a.options),{retry:c-1}))}const d=cn(a.request,a.error,a.response);throw Error.captureStackTrace&&Error.captureStackTrace(d,s),d}const s=function(c){return C(this,arguments,function*(u,d={}){const i={request:u,options:T(T({},t.defaults),d),response:void 0,error:void 0};i.options.onRequest&&(yield i.options.onRequest(i)),typeof i.request=="string"&&(i.options.baseURL&&(i.request=Zr(i.request,i.options.baseURL)),(i.options.query||i.options.params)&&(i.request=en(i.request,T(T({},i.options.params),i.options.query))),i.options.body&&ut(i.options.method)&&un(i.options.body)&&(i.options.body=typeof i.options.body=="string"?i.options.body:JSON.stringify(i.options.body),i.options.headers=new r(i.options.headers),i.options.headers.has("content-type")||i.options.headers.set("content-type","application/json"),i.options.headers.has("accept")||i.options.headers.set("accept","application/json"))),i.response=yield e(i.request,i.options).catch(_=>C(this,null,function*(){return i.error=_,i.options.onRequestError&&(yield i.options.onRequestError(i)),n(i)}));const m=(i.options.parseResponse?"json":i.options.responseType)||hn(i.response.headers.get("content-type")||"");if(m==="json"){const _=yield i.response.text(),g=i.options.parseResponse||Sr;i.response._data=g(_)}else m==="stream"?i.response._data=i.response.body:i.response._data=yield i.response[m]();return i.options.onResponse&&(yield i.options.onResponse(i)),i.response.status>=400&&i.response.status<600?(i.options.onResponseError&&(yield i.options.onResponseError(i)),n(i)):i.response})},o=function(u,d){return s(u,d).then(c=>c._data)};return o.raw=s,o.create=(a={})=>lt(B(T({},t),{defaults:T(T({},t.defaults),a)})),o}const ft=function(){if(typeof globalThis!="undefined")return globalThis;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")}(),gn=ft.fetch||(()=>Promise.reject(new Error("[ohmyfetch] global.fetch is not supported!"))),mn=ft.Headers,_n=lt({fetch:gn,Headers:mn});var Z,yn=new Uint8Array(16);function En(){if(!Z&&(Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Z))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(yn)}const wn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function bn(t){return typeof t=="string"&&wn.test(t)}for(var P=[],Me=0;Me<256;++Me)P.push((Me+256).toString(16).substr(1));function vn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(P[t[e+0]]+P[t[e+1]]+P[t[e+2]]+P[t[e+3]]+"-"+P[t[e+4]]+P[t[e+5]]+"-"+P[t[e+6]]+P[t[e+7]]+"-"+P[t[e+8]]+P[t[e+9]]+"-"+P[t[e+10]]+P[t[e+11]]+P[t[e+12]]+P[t[e+13]]+P[t[e+14]]+P[t[e+15]]).toLowerCase();if(!bn(r))throw TypeError("Stringified UUID is invalid");return r}function Tn(t,e,r){t=t||{};var n=t.random||(t.rng||En)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,vn(n)}var In=Object.defineProperty,Pn=Object.defineProperties,An=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,$e=(t,e,r)=>e in t?In(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ye=(t,e)=>{for(var r in e||(e={}))Rn.call(e,r)&&$e(t,r,e[r]);if(ht)for(var r of ht(e))xn.call(e,r)&&$e(t,r,e[r]);return t},pt=(t,e)=>Pn(t,An(e)),Sn=(t,e,r)=>($e(t,e+"",r),r),Un=(t,e,r)=>new Promise((n,s)=>{var o=d=>{try{u(r.next(d))}catch(c){s(c)}},a=d=>{try{u(r.throw(d))}catch(c){s(c)}},u=d=>d.done?n(d.value):Promise.resolve(d.value).then(o,a);u((r=r.apply(t,e)).next())}),Q=()=>typeof window!="undefined";const gt="application/vnd.gyg.v2+json",On=2e3;var Cn=(t,e,r)=>Un(void 0,null,function*(){if(Q()&&navigator.sendBeacon){const u=new Blob([JSON.stringify(e)],{type:gt});return navigator.sendBeacon(t,u)}const n=typeof AbortController!="undefined"?new AbortController:void 0,s=setTimeout(()=>n==null?void 0:n.abort(),On),a=yield _n(t,{method:"POST",mode:"cors",cache:"no-cache",headers:Ye({"Content-Type":gt},r?{"x-request-id":r}:void 0),keepalive:!0,body:e,signal:n==null?void 0:n.signal});return clearTimeout(s),a});class Ln{constructor(e){Sn(this,"_config"),this._config=e}log(e,r){var n,s;return!r||!this._config?Promise.resolve():(r.producer_properties={common:this.autoPopulateCommonProperties((n=r.producer_properties)==null?void 0:n.common),web_frontend:this.autoPopulateWebFrontendProperties((s=r.producer_properties)==null?void 0:s.web_frontend)},this._config.isDebug&&console.log(`Would send this event to ${this.getEventUrl(e)}:`,r),Cn(this.getEventUrl(e),r,this._config.xRequestId))}autoPopulateCommonProperties(e){var r,n;return pt(Ye({},e!=null?e:{}),{sent_by:(r=this._config.sentBy)!=null?r:"",timestamp:new Date().toISOString(),producer_id:Tn(),tracking_method:"collector",application_version:(n=this._config.applicationVersion)!=null?n:""})}autoPopulateWebFrontendProperties(e){var r,n,s,o,a,u,d,c,i;return pt(Ye({},e!=null?e:{}),{platform:(r=this._config.platform)!=null?r:"",user_agent:Q()?navigator.userAgent:(n=this._config.userAgent)!=null?n:"",view_id:(o=(s=this._config)==null?void 0:s.viewId)!=null?o:"",container_name:(u=(a=this._config)==null?void 0:a.containerName)!=null?u:"",visitor_id:this._config.visitorId,domain:Q()?window.location.host:(d=this._config.domain)!=null?d:"",url:Q()?window.location.href:(c=this._config.url)!=null?c:"",referrer_url:Q()?document.referrer:(i=this._config.referrerUrl)!=null?i:""})}getEventUrl(e){return`${this._config.collectorUrl}/track/${e}`}}const Nn=(t,e,r)=>{try{const n={isDebug:!1,collectorUrl:t.collector_url,sentBy:t.sent_by,applicationVersion:t.version,platform:t.platform,viewId:t.view_id,containerName:t.container_name,userAgent:t.userAgent,domain:t.domain,url:t.url,referrerUrl:t.referrer_url,visitorId:t.visitor_id};new Ln(n).log(r,e)}catch(n){console.error("AEL ERROR",n)}};class D{constructor(e,r,n=V){h(this,"document");h(this,"dataRepository");h(this,"baseUrl");this.dataRepository=e,this.document=r,this.baseUrl=n}sendEvent(e){window.fetch(this.collectorUrl,{method:"POST",headers:{"Content-type":"text/plain"},body:JSON.stringify(e),keepalive:!0})}sendEventV2(e,r){var s,o,a,u,d;const n={collector_url:this.baseUrl,version:this.dataRepository.version,platform:(s=this.dataRepository.header)==null?void 0:s.platform,view_id:"",container_name:this.dataRepository.container_name,userAgent:(o=this.dataRepository.header)==null?void 0:o.user_agent,domain:this.document.domain,url:this.document.URL,referrer_url:(a=this.dataRepository.header)==null?void 0:a.referrer_url,visitor_id:(u=this.dataRepository.user)==null?void 0:u.visitor_id,sent_by:(d=this.dataRepository.event_properties)==null?void 0:d.sent_by};Nn(n,e,r)}}const Gn="PartnerAnalyzerPageRequest";class Dn extends D{constructor(){super(...arguments);h(this,"_visitorId","");h(this,"_sessionId","")}get visitorId(){return this._visitorId}set visitorId(r){this._visitorId=r}get sessionId(){return this._sessionId}set sessionId(r){this._sessionId=r}get collectorUrl(){return this.baseUrl+"/track/PartnerAnalyzerPageRequest?format=json&strict=true"}cleanupDataRepository(){delete this.dataRepository.competitor_deeplinks,delete this.dataRepository.competitor_widgets,delete this.dataRepository.deeplinks,delete this.dataRepository.widgets}collectData(r){return C(this,null,function*(){yield Promise.all(br.map(n=>new n().start({document:r,payload:this.dataRepository,visitorId:this.visitorId,sessionId:this.sessionId})))})}onNewPageEvent(){if(!this.dataRepository.user||!this.dataRepository.header){console.log("PA: Data hasn't been collected yet, skipping event");return}const r=this.getEventV2Payload();try{this.sendEventV2(r,Gn),this.cleanupDataRepository()}catch(n){console.error("PA ERROR",n)}}addEventListeners(){const r=s=>{window.addEventListener(s,this.onNewPageEvent.bind(this),{capture:!0})},n="onpagehide"in window?"pagehide":"unload";r(n),Ir.isHistorySupported()&&r("changestate")}addPostMessageListener(){window.addEventListener("message",r=>{const{sessionId:n=null}=r.data;this.sessionId=n},{once:!0,passive:!0,capture:!0})}start(){this.addEventListeners(),this.addPostMessageListener(),setInterval(()=>{if(this.document.readyState==="complete")try{this.collectData(document)}catch(r){}},1e3)}getEventV2Payload(){const r=this.getWidgetsV2(),n=ye(this.dataRepository.header.url);return{customer_id:this.dataRepository.user.customer_id,partner_hash_code:this.dataRepository.header.partner_hash_code,partner_id:this.dataRepository.header.partner_id,page_id:n,page:this.dataRepository.page,widgets:r,deeplinks:this.dataRepository.deeplinks,competitor_widgets:this.dataRepository.competitor_widgets,competitor_deeplinks:this.dataRepository.competitor_deeplinks,version:this.dataRepository.version,script_origin:this.dataRepository.script_origin?this.dataRepository.script_origin.toString():""}}getWidgetV2Parameters(r){const n=r.widget_parameters&&this.getGeoLocationIfPresent(r.widget_parameters.geo_location),s=r.widget_parameters&&{widget_id:r.widget_parameters.widget_id,campaign:this.getParameterIfPresent(r.widget_parameters.campaign),currency:this.getParameterIfPresent(r.widget_parameters.currency),excluded_tour_ids:this.getParameterIfPresent(r.widget_parameters.excluded_tour_ids),iata:this.getParameterIfPresent(r.widget_parameters.iata),location_id:this.getParameterIfPresent(r.widget_parameters.location_id),locale_code:this.getParameterIfPresent(r.widget_parameters.locale_code),number_of_items:this.getParameterIfPresent(r.widget_parameters.number_of_items),partner_hash_code:this.getParameterIfPresent(r.widget_parameters.partner_hash_code),query:this.getParameterIfPresent(r.widget_parameters.query),version:this.getParameterIfPresent(r.widget_parameters.version),release_version:this.getParameterIfPresent(r.widget_parameters.release_version),format:this.getParameterIfPresent(r.widget_parameters.format),tour_ids:this.getParameterIfPresent(r.widget_parameters.tour_ids)};return n&&(s.geo_location=n),s}getGeoLocationIfPresent(r){if(r&&r.latitude&&r.longitude)return{latitude:r.latitude,longitude:r.longitude}}getParameterIfPresent(r){return r||void 0}getWidgetsV2(){const r=new Array;return this.dataRepository.widgets&&this.dataRepository.widgets.forEach(n=>{const o={widget_parameters:this.getWidgetV2Parameters(n),x:n.x,y:n.y,width:n.width,height:n.height,type:n.type,rendering_time:n.rendering_time,fcp:n.fcp,ttfb:n.ttfb,lcp:n.lcp};r.push(o)}),r}}const kn="PartnerDeeplinkClick",pe=class pe extends D{get collectorUrl(){return this.baseUrl+"/track/PartnerDeeplinkClick?format=json&strict=true"}getAllGYGDeeplinks(){return this.document.querySelectorAll('a[href*="getyourguide."]')}handleOnClick(e){const r=this.getEventV2Payload(e);try{this.sendEventV2(r,kn)}catch(n){console.error("PDCE ERROR",n)}}getEventV2Payload(e){const r=this.getHREFFromEvent(e),n=ye(this.dataRepository.header.url);return{customer_id:this.dataRepository.user.customer_id,partner_hash_code:this.dataRepository.header.partner_hash_code,partner_id:this.dataRepository.header.partner_id,page_id:n,page:this.dataRepository.page,deeplink_url:r,deeplink_id:J(r,pe.NAMESPACE)}}getHREFFromEvent(e){const r=e.target;return H(r.href)}trackDeeplink(e,r){e.target="_blank",e.addEventListener("click",r)}start(){this.getAllGYGDeeplinks().forEach(e=>this.trackDeeplink(e,this.handleOnClick.bind(this)))}};h(pe,"NAMESPACE","6ba7b811-9dad-11d1-80b4-00c04fd430c8");let Fe=pe;var We,mt;function jn(){if(mt)return We;mt=1;var t=function(f){return e(f)&&!r(f)};function e(l){return!!l&&typeof l=="object"}function r(l){var f=Object.prototype.toString.call(l);return f==="[object RegExp]"||f==="[object Date]"||o(l)}var n=typeof Symbol=="function"&&Symbol.for,s=n?Symbol.for("react.element"):60103;function o(l){return l.$$typeof===s}function a(l){return Array.isArray(l)?[]:{}}function u(l,f){return f.clone!==!1&&f.isMergeableObject(l)?N(a(l),l,f):l}function d(l,f,p){return l.concat(f).map(function(U){return u(U,p)})}function c(l,f){if(!f.customMerge)return N;var p=f.customMerge(l);return typeof p=="function"?p:N}function i(l){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l).filter(function(f){return Object.propertyIsEnumerable.call(l,f)}):[]}function m(l){return Object.keys(l).concat(i(l))}function _(l,f){try{return f in l}catch(p){return!1}}function g(l,f){return _(l,f)&&!(Object.hasOwnProperty.call(l,f)&&Object.propertyIsEnumerable.call(l,f))}function W(l,f,p){var U={};return p.isMergeableObject(l)&&m(l).forEach(function(v){U[v]=u(l[v],p)}),m(f).forEach(function(v){g(l,v)||(_(l,v)&&p.isMergeableObject(f[v])?U[v]=c(v,p)(l[v],f[v],p):U[v]=u(f[v],p))}),U}function N(l,f,p){p=p||{},p.arrayMerge=p.arrayMerge||d,p.isMergeableObject=p.isMergeableObject||t,p.cloneUnlessOtherwiseSpecified=u;var U=Array.isArray(f),v=Array.isArray(l),Qe=U===v;return Qe?U?p.arrayMerge(l,f,p):W(l,f,p):u(f,p)}N.all=function(f,p){if(!Array.isArray(f))throw new Error("first argument should be an array");return f.reduce(function(U,v){return N(U,v,p)},{})};var Ke=N;return We=Ke,We}var Bn=jn();const Vn=st(Bn);class qe{constructor(e,r,n=V){h(this,"document");h(this,"dataRepository");h(this,"baseUrl");this.dataRepository=e,this.document=r,this.baseUrl=n}sendEvent(e,r){const n=Vn(this.getUIEventBase(),r);n&&n.event_properties&&(n.event_properties.event_name=e),n&&n.metadata&&(n.metadata=JSON.stringify(n.metadata)),window.fetch(this.collectorUrl,{method:"POST",headers:{"Content-type":"text/plain"},body:JSON.stringify(n),keepalive:!0})}getUIEventBase(){return{event_properties:T({},this.dataRepository.event_properties),container_name:this.dataRepository.container_name,user:this.dataRepository.user,header:T({},this.dataRepository.header)}}}function G(t,e){window.addEventListener("message",r=>{const n=r==null?void 0:r.data;try{if(n&&n.messageType==="event_logger"){const{eventType:s}=n;if(!s||s.toLowerCase()!==t.toLowerCase())return;e(n)}}catch(s){console.error(`Failed to send ${t} with Partner Analyzer`)}})}class Mn extends qe{constructor(){super(...arguments);h(this,"eventType","UIClick")}get collectorUrl(){return this.baseUrl+`/track/${this.eventType}?format=json&strict=true`}sendEventCallback(r){this.sendEvent(r.eventType,r.eventData)}start(){G(this.eventType,this.sendEventCallback.bind(this))}}class $n extends qe{constructor(){super(...arguments);h(this,"eventType","UIShow")}get collectorUrl(){return this.baseUrl+`/track/${this.eventType}?format=json&strict=true`}sendEventCallback(r){this.sendEvent(r.eventType,r.eventData)}start(){G(this.eventType,this.sendEventCallback.bind(this))}}class Yn extends qe{constructor(){super(...arguments);h(this,"eventType","UIEnteredDisplayPort")}get collectorUrl(){return this.baseUrl+`/track/${this.eventType}?format=json&strict=true`}sendEventCallback(r){this.sendEvent(r.eventType,r.eventData)}start(){G(this.eventType,this.sendEventCallback.bind(this))}}const _t="TicketingWebUIClick";class yt extends D{get collectorUrl(){return""}sendEventCallback(e){this.sendEventV2(e.eventData,_t)}start(){G(_t,this.sendEventCallback.bind(this))}}h(yt,"NAMESPACE","7cde4402-cd54-4f28-a4aa-5eb96add2d88");const Et="TicketingWebPageView";class wt extends D{get collectorUrl(){return""}sendEventCallback(e){this.sendEventV2(e.eventData,Et)}start(){G(Et,this.sendEventCallback.bind(this))}}h(wt,"NAMESPACE","7dde5df8-7dba-4469-ba5a-a800de137523");const bt="TicketingWebLinkVisible";class vt extends D{get collectorUrl(){return""}sendEventCallback(e){this.sendEventV2(e.eventData,bt)}start(){G(bt,this.sendEventCallback.bind(this))}}h(vt,"NAMESPACE","1ac966b7-eba7-4c83-b142-e738da02bf30");const Tt="TicketingWebInitialized";class It extends D{get collectorUrl(){return""}sendEventCallback(e){this.sendEventV2(e.eventData,Tt)}start(){G(Tt,this.sendEventCallback.bind(this))}}h(It,"NAMESPACE","cc34b8d9-1676-433b-8785-17712b04b97b");const Pt="TicketingWebAddToCartSuccess";class At extends D{get collectorUrl(){return""}sendEventCallback(e){this.sendEventV2(e.eventData,Pt)}start(){G(Pt,this.sendEventCallback.bind(this))}}h(At,"NAMESPACE","c9a6bfce-16d7-452e-b463-2872065684c3");const Rt="TicketingWebNoAvailability";class xt extends D{get collectorUrl(){return""}sendEventCallback(e){this.sendEventV2(e.eventData,Rt)}start(){G(Rt,this.sendEventCallback.bind(this))}}h(xt,"NAMESPACE","67e16cd6-4425-4b51-b1e3-beec495401d1");const Fn=[Dn,Fe,Mn,$n,Yn,yt,wt,vt,It,At,xt];class Wn{constructor(){h(this,"dataRepository",{container_name:"partner-analyzer",version:"36f2448401763a36e86c98d77eb33ace03737604"});window._GYG=window._GYG||{};const e="pa_debug",n=new URL(window.location.href).searchParams.get(e);n==="1"?X(e,n):n==="0"&&$t(e),window._GYG.debug=Xe(e)==="1",Fn.forEach(s=>{new s(this.dataRepository,document).start()})}}function qn(){new Wn}(function(){if(!window.gygPAStatus){if(window.gygPAStatus="loading",window._GYG=window._GYG||{},window._GYG.env="production",window._GYG.loadOnlyPA!==!0){window._GYG.env==="test"&&console.log("Loading widget script");const t=`${O}/pw/latest/client-loader/widget.js`;document.querySelector(`script[src="${t}"]`)||ge(t)}E(document.URL)&&(window.gygPAStatus="ok",qn())}})()});