"use strict";(globalThis.webpackChunkGamitee=globalThis.webpackChunkGamitee||[]).push([[8870],{1921:(t,e,n)=>{n.d(e,{A:()=>l});var i,o,r,a=n(7117),s=n(9813);class l{set shouldUseAi(t){t?a.ZO.removeItem(s.IS_AI_USAGE_CONSENT_GIVEN):a.ZO.setItem(s.IS_AI_USAGE_CONSENT_GIVEN,"false")}get shouldUseAi(){return"false"!==a.ZO.getItem(s.IS_AI_USAGE_CONSENT_GIVEN)}set isTooltipOpen(t){t?a.ZO.setItem(s.AI_TOOLTIP_STATE,"open"):a.ZO.removeItem(s.AI_TOOLTIP_STATE)}get isTooltipOpen(){return"open"===a.ZO.getItem(s.AI_TOOLTIP_STATE)}get sessionHasBeenShared(){return this._sessionStateDataLayer.sessionHasBeenShared}get _seenLocations(){return JSON.parse(a.ZO.getItem(s.AI_LOCATION_KEY)??"[]")}set _seenLocations(t){a.ZO.setItem(s.AI_LOCATION_KEY,Array.from(t??[]))}constructor(t,e){this._dataLayer=t,this._sessionStateDataLayer=e}markMessageAsAdded(t){const e=JSON.parse(a.ZO.getItem(s.AI_MESSAGES_ADDED)||"{}");e[t]="true",a.ZO.setItem(s.AI_MESSAGES_ADDED,e)}isMessageAdded(t){return"true"===JSON.parse(a.ZO.getItem(s.AI_MESSAGES_ADDED)||"{}")[t]}checkIfLocationSeen(t){return this._seenLocations.some((e=>e.city===t.city&&e.country===t.country&&e.type===t.type))}addSeenLocations(t){a.ZO.setItem(s.AI_LOCATION_KEY,Array.from([...this._seenLocations,...t]??[]))}async getAllQuestions(){return await this._dataLayer.getAllQuestions()}async askAi(t,e,n,i,o){const r=await this._dataLayer.askAi(t,e,n,i,o);return{questionId:r.question_id,text:r.text}}}i=l,r={INVITE:"invite"},(o=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(o="MessagesTypes"))in i?Object.defineProperty(i,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[o]=r},4757:(t,e,n)=>{n.d(e,{KU:()=>a,dn:()=>o,j3:()=>r,wN:()=>s});var i=n(3745).__;const o="ai-assistant",r="ai-assistant",a=()=>i("ai_avatar_name"),s=()=>({_id:r,displayName:a(),imCapabilities:{},isActive:!0,picture:o})},6433:(t,e,n)=>{n.d(e,{P:()=>o,i:()=>i});const i={popup_state_changed_event:"voting-popup-state-changed",voting_clicked_event:"voting-clicked"},o={ITEMS:"items",RECOMMENDATIONS_BY_LOCATION:"recommendationsByLocation",RECOMMENDATIONS_BY_POST_PROPERTY:"recommendationsByPostProperty",API:"api"}},2649:(t,e,n)=>{n.d(e,{A:()=>B});var i=n(7889),o=n(2410),r=n(962),a=n(7639),s=n(4352),l=n(5220),c=n(8551);const d=()=>o.A`
`;var p,u,A,h,m,g,f,C=n(3745).__;function v(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function b(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x(t,e,n,i,o){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce((function(n,i){return i(t,e,n)||n}),r),o&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(o):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}let B=(p=(0,a.Ay)({connectionAware:!0}),(0,i.p_)(u=p((f=class JoynedCommentsCounterBtnElement extends HTMLElement{constructor(){super(),b(this,"styles",[s.A]),b(this,"_commentsIcon",d()),v(this,"unreadCount",h,this),v(this,"commentCounter",m,this),v(this,"inPost",g,this),b(this,"attributeBucket",(0,r.A)(this)),b(this,"registerEvents",(()=>[(0,c.Mm)({target:this,name:"click"},{target:this,name:JoynedCommentsCounterBtnElement.CLICKED}),(0,c.q2)(this,"keydown",this._dispatchOnEnter)]));const t=this.attachShadow({mode:"open"});this.tabIndex=0,this.setAttribute("role","button"),this._counterContent=o.A``,this._commentButton=o.A`
`,t.appendChild(this._commentButton),this.attributeBucket.register("commentCounter",(t=>{const e=t>0?t.toString():"0",n=C("1"===t.toString()?"opinions_offering_tab_singular":"opinions_offering_tab"),i=l.D.test(n);this._counterContent.textContent=i?(0,l.A)(n).format({counter:e}):`${e} ${n}`,this.setAttribute("aria-label",this._counterContent.textContent)})),this.attributeBucket.register("unreadCount",(t=>{this.classList.toggle("blink",t>0)}))}_dispatchOnEnter(t){"Enter"===t.key&&this.dispatchEvent(new Event(JoynedCommentsCounterBtnElement.CLICKED,{bubbles:!0,composed:!0}))}},b(f,"CLICKED","comment-counter-clicked"),h=x((A=f).prototype,"unreadCount",[i.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),m=x(A.prototype,"commentCounter",[i.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g=x(A.prototype,"inPost",[i.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),u=A))||u)||u)},7551:(t,e,n)=>{n.d(e,{A:()=>qt});var i=n(2761),o=n(8723),r=n(1947),a=n(7889),s=n(8037),l=n(4707),c=n(5351),d=n(7809),p=n(2410),u=n(7639),A=n(962),h=n(4265),m=n(3452),g=n(1800),f=n(765);class C extends Event{constructor(t,e,n){super(t),this.offeringId=e,this.data=n}clone(){return new C(this.type,this.offeringId,this.data)}}var v,b,x,B,y=n(7817);function w(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let E=(v=(0,u.Ay)({}),(0,a.p_)(b=v((x=class GamiteeStarRatingElement extends HTMLElement{constructor(){var t,e,n,i;super(),t=this,e="rateCount",i=this,(n=B)&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0}),w(this,"attributeBucket",(0,A.A)(this));const o=this.attachShadow({mode:"open"});this._rating=p.A``,o.appendChild(this._rating),this._stars=this._rating.querySelector("#gmt-star-rating"),this.createAttributes()}createAttributes(){this.attributeBucket.register("rateCount",(t=>{const e=t>5?"5.0":(.5*Math.round(t/.5)).toFixed(1);(0,y.v7)(this._stars),this._stars.appendChild(p.A`
`)}))}},k=x.prototype,F="rateCount",z=[a.CF],S={configurable:!0,enumerable:!0,writable:!0,initializer:null},_={},Object.keys(S).forEach((function(t){_[t]=S[t]})),_.enumerable=!!_.enumerable,_.configurable=!!_.configurable,("value"in _||_.initializer)&&(_.writable=!0),_=z.slice().reverse().reduce((function(t,e){return e(k,F,t)||t}),_),T&&void 0!==_.initializer&&(_.value=_.initializer?_.initializer.call(T):void 0,_.initializer=void 0),void 0===_.initializer&&(Object.defineProperty(k,F,_),_=null),B=_,b=x))||b)||b);var k,F,z,S,T,_,I,j,M,D,O,$,P,L,H,N,U=n(9305),R=n(911),Y=n(3745).__;function G(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function V(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W(t,e,n,i,o){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce((function(n,i){return i(t,e,n)||n}),r),o&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(o):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}let q=(I=(0,u.Ay)({}),(0,a.p_)(j=I((M=class JoynedGoodsOfferingCardElement extends HTMLElement{set priceHeader(t){this._priceHeader.textContent=t}get priceHeader(){return this._priceHeader.textContent??""}get displaySettings(){return this._displaySettings}set displaySettings(t){this._displaySettings=t,this.frameElement.votingColor=t.colors.votingColor??"",this.frameElement.disableMenu=t.disableMenu??!1,this.displaySettings.offeringOptions?.actionButtonText?(this.actionButtonContainer.appendChild(this.timeoutContainer),this.actionButton=p.A`
${this.displaySettings.offeringOptions?.actionButtonText}
`,this.actionButtonContainer.appendChild(this.actionButton),this.displaySettings.colors?.actionButton&&(this.actionButton.style.setProperty("--gm-action-color",this.displaySettings.colors.actionButton.color??""),this.actionButton.style.setProperty("--gm-action-background",this.displaySettings.colors.actionButton.backgroundColor),this.actionButton.style.setProperty("--gm-action-hover-color",this.displaySettings.colors.actionButton.hoverColor),this.actionButton.style.setProperty("--gm-action-hover-background",this.displaySettings.colors.actionButton.hoverBackgroundColor),this.actionButton.style.setProperty("--gm-action-border-color",this.displaySettings.colors.actionButton.borderColor))):this.priceElement.appendChild(this.timeoutContainer),this.timeOutInHours=t.timeOutInHours??0}get offering(){return this._offering}set offering(t){if(this.frameElement.offering=t,t.createdBy&&(this.addedBy.textContent=`${Y("offering_added_by")} ${t.createdBy}`,this.addedBy.setAttribute("aria-label",this.addedBy.textContent)),t.title){const e=t.title.split("&lb");[this.titleElement.textContent,this.secondaryTitleElement.textContent]=e,[this.titleElement.title,this.secondaryTitleElement.title]=e,this.secondaryTitleElement.style.display=e[1]?"-webkit-box":"none"}const{data:e}=t;if(e){const{rating:n}=e;n&&(this.ratingStars.rateCount=5*n.rate,n.reviewsCount&&n.reviewsCount>0&&(this.ratingReviews.textContent=`(${n.reviewsCount})`)),this.ratingContainer.hidden=this.isTrendingCard||null==t.data?.rating}if(t.description){const e=t.description.split("&lb");[this.descriptionElement.textContent,this.secondaryDescriptionElement.textContent]=e,[this.descriptionElement.title,this.secondaryDescriptionElement.title]=e,this.secondaryDescriptionElement.style.display=e[1]?"-webkit-box":"none"}if(t.price){this.totalPriceElement.textContent=(0,R.$g)(t.price,this.displaySettings.priceLocale);const{description:e}=t.price;if(e)if(e.includes("&pf")){const[t,n]=e.split("&pf");this.priceHeader=t,this.priceFooter.textContent=n}else this.priceFooter.textContent=e;else this.timeoutButton.classList.add("small-icon")}t.salePrice?.amount&&(this.salePriceElement.textContent=(0,R.$g)(t.salePrice,this.displaySettings.priceLocale)),this.createdAt=t.createdAt,this.priceElement.hidden=!1===t.isValid,this._offering=t,this.offering.timeoutInHours&&(this.timeOutInHours=this.offering.timeoutInHours)}loadImages(){const t=new U.A(this.offering.images,this.displaySettings.imageStyle?.fit);t.className="goods-img-container",this.imageContainer.appendChild(t)}constructor(){super(),V(this,"shadowRoot",this.attachShadow({mode:"open"})),V(this,"styles",[m.A,g.A,f.A]),V(this,"attributeBucket",(0,A.A)(this)),G(this,"votingFeatureEnabled",D,this),G(this,"hasHighestVotes",O,this),G(this,"isTrendingCard",$,this),G(this,"displayMode",P,this),G(this,"timeOutInHours",L,this),G(this,"popupShow",H,this),G(this,"createdAt",N,this),V(this,"closeAllPopups",(()=>{this.frameElement.isMenuOpen=!1,this.frameElement.votingContainer.votesListShow=!1,this.popupShow=!1})),this.imageContainer=p.A`
`,this.addedBy=p.A` `,this.titleElement=p.A`
`,this.secondaryTitleElement=p.A`
`,this.datesElement=p.A` `,this.descriptionElement=p.A`
`,this.secondaryDescriptionElement=p.A`
`,this.ratingStars=new E,this.ratingContainer=p.A`
${this.ratingStars} ${this.ratingReviews} `,this.ratingContainer.hidden=this.isTrendingCard,this.textHeader=p.A``,this.actionButtonContainer=p.A`
`,this.salePriceElement=p.A` `,this.totalPriceElement=p.A` `,this.timeoutPopup=p.A``,this.timeoutButton=p.A`${(0,h.A)()} `,this.timeoutContainer=p.A`
${this.timeoutButton}${this.timeoutPopup}
`,this.priceElement=p.A`
${this._priceHeader=p.A` `}
${this.salePriceElement}
${this.totalPriceElement}
${this.priceFooter=p.A` `}
`,this.textContainer=p.A`
`;const t=p.A` `,e=p.A`
`;this.frameElement=new o.A,this.frameElement.displayMode=this.displayMode,this.frameElement.menuHandleShape="row",this.frameElement.menuHandleHasShadow=!1,this.frameElement.menuPopupPosition="bottom",this.frameElement.classList.add("goods");const n=p.A`${this.imageContainer}${this.textContainer}
`;this.frameElement.appendChild(n);const i=p.A` `;this.frameElement.appendChild(i),this.frameElement.appendChild(t),this.frameElement.appendChild(e),this.shadowRoot.appendChild(this.frameElement),this.attributeBucket.register("popupShow",(t=>{this.timeoutPopup.classList.toggle("show",t)})),this.attributeBucket.register("votingFeatureEnabled",(t=>{this.frameElement.votingFeatureEnabled=t})),this.attributeBucket.register("hasHighestVotes",(t=>{this.frameElement.hasHighestVotes=t})),this.attributeBucket.register("isTrendingCard",(t=>{this.frameElement.classList.toggle("trending",t),this.ratingContainer.hidden=this.isTrendingCard||null==this._offering?.data?.rating})),this.attributeBucket.register("displayMode",(t=>{this.frameElement.displayMode=t})),this.attributeBucket.register("timeOutInHours",(t=>{if(this.createdAt&&t>0){const e=(new Date).valueOf()-this.createdAt,n=36e5;this.timeoutButton.classList.toggle("show",e>t*n)}}))}registerEvents(){const t=[],e=(0,s.p)((t=>"Enter"===t.key));t.push((0,l.h)((0,c.R)(this.imageContainer,"click"),(0,c.R)(this.textHeader,"click"),(0,c.R)(this.textHeader,"keydown").pipe(e)).pipe((0,d.T)((()=>new C("card-clicked",this.offering.id,{viewUrl:this.offering.directURL})))).subscribe((t=>{this.dispatchEvent(t)}))),this.actionButton&&t.push((0,l.h)((0,c.R)(this.actionButton,"click"),(0,c.R)(this.actionButton,"keydown").pipe(e)).pipe((0,d.T)((()=>new C("action-clicked",this.offering.id,{viewUrl:this.offering.directURL})))).subscribe((t=>{this.dispatchEvent(t)})));const n=()=>{this.popupShow=!this.popupShow},i=t=>{const e=t.composedPath()[0];this.timeoutContainer.contains(e)||(this.popupShow=!1)};return window.addEventListener("click",i),this.timeoutButton.addEventListener("click",n),()=>{t.forEach((t=>{t.unsubscribe()})),window.removeEventListener("click",i),this.timeoutButton.removeEventListener("click",n)}}},D=W(M.prototype,"votingFeatureEnabled",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),O=W(M.prototype,"hasHighestVotes",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),$=W(M.prototype,"isTrendingCard",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),P=W(M.prototype,"displayMode",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"list-item"}}),L=W(M.prototype,"timeOutInHours",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),H=W(M.prototype,"popupShow",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),N=W(M.prototype,"createdAt",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),j=M))||j)||j);var Z=n(6104);const K=()=>p.A`
`;var J,Q,X,tt,et;function nt(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function it(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ot(t,e,n,i,o){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce((function(n,i){return i(t,e,n)||n}),r),o&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(o):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}let rt=(J=(0,u.Ay)({}),(0,a.p_)(Q=J((X=class GamiteeStarsBarElement extends HTMLElement{constructor(){super(),nt(this,"starCount",tt,this),nt(this,"primaryColor",et,this),it(this,"styles",[Z.A]),it(this,"attributeBucket",(0,A.A)(this));const t=this.attachShadow({mode:"open"}),e=[];for(let t=0;t<5;t+=1)e.push(K());t.append(...e),this.attributeBucket.register("starCount",(t=>{for(let n=4;n>=0;n-=1)n>=t?e[n].style.display="none":e[n].style.removeProperty("display")})),this.attributeBucket.register("primaryColor",(t=>{this.style.setProperty("--gm-primary-color",t)}))}},tt=ot(X.prototype,"starCount",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),et=ot(X.prototype,"primaryColor",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"black"}}),Q=X))||Q)||Q);var at,st,lt,ct,dt,pt,ut,At,ht,mt,gt=n(3933),ft=n(3745).__;function Ct(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function vt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bt(t,e,n,i,o){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce((function(n,i){return i(t,e,n)||n}),r),o&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(o):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}let xt=(at=(0,u.Ay)({}),(0,a.p_)(st=at((lt=class JoynedHotelOfferingCardElement extends HTMLElement{set priceHeader(t){this._priceHeader.textContent=t}get priceHeader(){return this._priceHeader.textContent??""}get displaySettings(){return this._displaySettings}set displaySettings(t){this._displaySettings=t,this.frameElement.votingColor=t.colors.votingColor??"",this.frameElement.disableMenu=t.disableMenu??!1,this.displaySettings.offeringOptions?.actionButtonText?(this.actionButtonContainer.appendChild(this.timeoutContainer),this.actionButton=p.A`
${this.displaySettings.offeringOptions?.actionButtonText}
`,this.actionButtonContainer.appendChild(this.actionButton),this.displaySettings.colors?.actionButton&&(this.actionButton.style.setProperty("--gm-action-color",this.displaySettings.colors.actionButton.color??""),this.actionButton.style.setProperty("--gm-action-background",this.displaySettings.colors.actionButton.backgroundColor),this.actionButton.style.setProperty("--gm-action-hover-color",this.displaySettings.colors.actionButton.hoverColor),this.actionButton.style.setProperty("--gm-action-hover-background",this.displaySettings.colors.actionButton.hoverBackgroundColor),this.actionButton.style.setProperty("--gm-action-border-color",this.displaySettings.colors.actionButton.borderColor))):this.priceElement.appendChild(this.timeoutContainer),this.timeOutInHours=t.timeOutInHours??0}get offering(){return this._offering}set offering(t){if(this.frameElement.offering=t,this.createdAt=t.createdAt,t.createdBy&&(this.addedBy.textContent=`${ft("offering_added_by")} ${t.createdBy}`,this.addedBy.setAttribute("aria-label",this.addedBy.textContent)),t.title){const e=t.title.split("&lb");[this.titleElement.textContent,this.secondaryTitleElement.textContent]=e,[this.titleElement.title,this.secondaryTitleElement.title]=e,this.secondaryTitleElement.style.display=e[1]?"-webkit-box":"none"}const{data:e}=t;if(e){const{rating:n,stars:i,startDate:o,endDate:r}=e;if(n&&(this.ratingStars.rateCount=5*n.rate,n.reviewsCount&&n.reviewsCount>0&&(this.ratingReviews.textContent=`(${n.reviewsCount})`)),o&&r){const t=new Intl.DateTimeFormat(this.displaySettings.dateLocale,{month:"numeric",day:"numeric",timeZone:"UTC"});this.datesElement.innerText=`${t.format(o)} - ${t.format(r)}`}i&&(this.starsContainer.starCount=i),this.ratingContainer.hidden=this.isTrendingCard||null==t.data?.rating}if(t.description){const e=t.description.split("&lb");[this.descriptionElement.textContent,this.secondaryDescriptionElement.textContent]=e,[this.descriptionElement.title,this.secondaryDescriptionElement.title]=e,this.secondaryDescriptionElement.style.display=e[1]?"-webkit-box":"none"}if(t.price){this.totalPriceElement.textContent=(0,R.$g)(t.price,this.displaySettings.priceLocale);const{description:e}=t.price,n=this._displaySettings.pricePrefixKey;if(n&&(this.priceHeader=ft(n)),e)if(e.includes("&pf")){const[t,n]=e.split("&pf");this.priceHeader=t,this.priceFooter.textContent=n}else this.priceFooter.textContent=e;else this.timeoutButton.classList.add("small-icon")}t.salePrice?.amount&&(this.salePriceElement.textContent=(0,R.$g)(t.salePrice,this.displaySettings.priceLocale)),this.priceElement.hidden=!1===t.isValid,this._offering=t,t.timeoutInHours&&(this.timeOutInHours=t.timeoutInHours)}constructor(){super(),vt(this,"shadowRoot",this.attachShadow({mode:"open"})),vt(this,"styles",[g.A,gt.A]),vt(this,"attributeBucket",(0,A.A)(this)),Ct(this,"votingFeatureEnabled",ct,this),Ct(this,"hasHighestVotes",dt,this),Ct(this,"isTrendingCard",pt,this),Ct(this,"displayMode",ut,this),Ct(this,"timeOutInHours",At,this),Ct(this,"createdAt",ht,this),Ct(this,"popupShow",mt,this),vt(this,"closeAllPopups",(()=>{this.frameElement.isMenuOpen=!1,this.frameElement.votingContainer.votesListShow=!1,this.popupShow=!1})),this.imageContainer=p.A`
`,this.addedBy=p.A` `,this.titleElement=p.A`
`,this.secondaryTitleElement=p.A`
`,this.datesElement=p.A` `,this.descriptionElement=p.A`
`,this.secondaryDescriptionElement=p.A`
`,this.ratingStars=new E,this.ratingContainer=p.A`
${this.ratingStars} ${this.ratingReviews}
`,this.timeoutPopup=p.A``,this.timeoutButton=p.A`${(0,h.A)()} `,this.timeoutContainer=p.A`
${this.timeoutButton}${this.timeoutPopup}
`,this.textHeader=p.A``,this.starsContainer=new rt,this.actionButtonContainer=p.A`
`,this.salePriceElement=p.A` `,this.totalPriceElement=p.A` `,this.priceElement=p.A`
${this._priceHeader=p.A` `}
${this.salePriceElement}
${this.totalPriceElement}
${this.priceFooter=p.A` `}
`,this.textContainer=p.A`
`;const t=p.A` `,e=p.A`
`;this.frameElement=new o.A,this.frameElement.displayMode=this.displayMode,this.frameElement.menuHandleShape="row",this.frameElement.menuPopupPosition="bottom",this.frameElement.votingPopupDirection="right";const n=p.A`${this.imageContainer}${this.textContainer}
`;this.frameElement.appendChild(n),this.attributeBucket.register("popupShow",(t=>{this.timeoutPopup.classList.toggle("show",t)}));const i=p.A` `;this.frameElement.appendChild(i),this.frameElement.appendChild(t),this.frameElement.appendChild(e),this.shadowRoot.appendChild(this.frameElement),this.attributeBucket.register("votingFeatureEnabled",(t=>{this.frameElement.votingFeatureEnabled=t})),this.attributeBucket.register("hasHighestVotes",(t=>{this.frameElement.hasHighestVotes=t})),this.attributeBucket.register("displayMode",(t=>{this.frameElement.displayMode=t})),this.attributeBucket.register("isTrendingCard",(t=>{this.classList.toggle("trending",t),this.frameElement.classList.toggle("trending",t),this.ratingContainer.hidden=this.isTrendingCard||null==this._offering?.data?.rating})),this.attributeBucket.register("timeOutInHours",(t=>{if(this.createdAt&&t>0){const e=(new Date).valueOf()-this.createdAt,n=36e5;this.timeoutButton.classList.toggle("show",e>t*n)}}))}loadImages(){const t=new U.A(this.offering.images,this.displaySettings.imageStyle?.fit);t.className="hotel-img-container",this.imageContainer.appendChild(t)}registerEvents(){const t=[],e=(0,s.p)((t=>"Enter"===t.key));t.push((0,l.h)((0,c.R)(this.imageContainer,"click"),(0,c.R)(this.textHeader,"click"),(0,c.R)(this.textHeader,"keydown").pipe(e)).pipe((0,d.T)((()=>new C("card-clicked",this.offering.id,{viewUrl:this.offering.directURL})))).subscribe((t=>{this.dispatchEvent(t)}))),this.actionButton&&t.push((0,l.h)((0,c.R)(this.actionButton,"click"),(0,c.R)(this.actionButton,"keydown").pipe(e)).pipe((0,d.T)((()=>new C("action-clicked",this.offering.id,{viewUrl:this.offering.directURL})))).subscribe((t=>{this.dispatchEvent(t)})));const n=()=>{this.popupShow=!this.popupShow},i=t=>{const e=t.composedPath()[0];this.timeoutContainer.contains(e)||(this.popupShow=!1)};return window.addEventListener("click",i),this.timeoutButton.addEventListener("click",n),()=>{t.forEach((t=>{t.unsubscribe()})),window.removeEventListener("click",i),this.timeoutButton.removeEventListener("click",n)}}},ct=bt(lt.prototype,"votingFeatureEnabled",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),dt=bt(lt.prototype,"hasHighestVotes",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pt=bt(lt.prototype,"isTrendingCard",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ut=bt(lt.prototype,"displayMode",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"list-item"}}),At=bt(lt.prototype,"timeOutInHours",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),ht=bt(lt.prototype,"createdAt",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mt=bt(lt.prototype,"popupShow",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),st=lt))||st)||st);var Bt,yt,wt=n(5220),Et=n(6424),kt=n(7168),Ft=n(3745).__;function zt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let St=(0,u.Ay)({})((yt=class JoynedTripDataElement extends HTMLElement{get tripData(){return this._tripData}set tripData(t){const{departTimeMs:e,arrivalTimeMs:n,durationMs:i,sellers:o,connectionsAmount:r,flight:a,ground:s}=t;if(o[0].sellerImage){const t=p.A` `;this.sellerImageContainer.append(t)}else this.sellerName.textContent=o[0].sellerName,this.sellerName.title=o[0].sellerName;const l=new Intl.DateTimeFormat(this.dateFormat,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}),c=new Intl.DateTimeFormat(this.dateFormat,{hour:"numeric",minute:"numeric",timeZone:"UTC",hourCycle:"h24"});if(this.departureHour.innerText=c.format(e),this.departureDate.innerText=l.format(e),this.arrivalHour.innerText=c.format(n),this.arrivalDate.innerText=l.format(n),r){const t=Ft(1===r?"Stop":"Stops");this.numberOfStops.innerText=`${r} ${t}`}if(a){const{arrivalAirport:t,departureAirport:e}=a;this.arrivalStation.innerText=t.airportCode??t.airportName??"",this.arrivalStation.title=t.airportCode??t.airportName??"",this.departureStation.innerText=e.airportCode??e.airportName??"",this.departureStation.title=e.airportCode??e.airportName??""}else if(s){const{arrivalStation:t,departureStation:e}=s;this.arrivalStation.innerText=t.stationName,this.departureStation.innerText=e.stationName}const d=t=>t<10?`0${t}`:`${t}`,u=d(Math.floor(i/36e5%3600)),A=d(Math.floor(i/6e4%60)),h=u?`${u}h `:"",m=A?`${A}m`:"";this.durationTime.innerText=`${h}${m}`,this._tripData=t}constructor(){super(),zt(this,"styles",[kt.A]);const t=this.attachShadow({mode:"open"});this.sellerImageContainer=p.A`
`,this.sellerName=p.A`
`,this.sellerContainer=p.A`${this.sellerImageContainer}${this.sellerName}
`,this.departureHour=p.A`
`,this.departureDate=p.A`
`,this.departureStation=p.A`
`,this.departureContainer=p.A`${this.departureHour}${this.departureDate}${this.departureStation}
`,this.arrivalHour=p.A`
`,this.arrivalDate=p.A`
`,this.arrivalStation=p.A`
`,this.arrivalContainer=p.A`${this.arrivalHour}${this.arrivalDate}${this.arrivalStation}
`,this.numberOfStops=p.A`
`,this.durationTime=p.A`
`,this.arrow=p.A`${((t="joyned-trip-arrow")=>p.A`
`)()}
`,this.durationAndStopsContainer=p.A`
${this.durationTime}
${this.arrow}
${this.numberOfStops}
`,this.tripContainer=p.A`
${this.sellerContainer}
${this.departureContainer}
${this.durationAndStopsContainer}
${this.arrivalContainer}
`,t.appendChild(this.tripContainer)}},zt(yt,"TAG",""),Bt=yt))||Bt;var Tt,_t,It,jt,Mt,Dt,Ot,$t,Pt,Lt,Ht=n(3745).__;function Nt(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function Ut(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rt(t,e,n,i,o){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce((function(n,i){return i(t,e,n)||n}),r),o&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(o):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}const Yt={bus:Ht("trip_bus"),flight:Ht("trip_flight_to"),ferry:Ht("trip_ferry"),train:Ht("trip_train")},Gt={oneWay:Ht("trip_one_way"),roundTrip:Ht("trip_round"),multyWay:Ht("trip_multi_city")};let Vt=(Tt=(0,u.Ay)({}),(0,a.p_)(_t=Tt((It=class JoynedTripOfferingCardElement extends HTMLElement{set priceHeader(t){this._priceHeader.textContent=t}get priceHeader(){return this._priceHeader.textContent??""}get displaySettings(){return this._displaySettings}set displaySettings(t){this._displaySettings=t,this.frameElement.votingColor=t.colors.votingColor??"",this.frameElement.disableMenu=t.disableMenu??!1,this.displaySettings.offeringOptions?.actionButtonText?(this.actionButtonContainer.appendChild(this.timeoutContainer),this.actionButton=p.A`
${this.displaySettings.offeringOptions?.actionButtonText}
`,this.actionButtonContainer.appendChild(this.actionButton),this.displaySettings.colors?.actionButton&&(this.actionButton.style.setProperty("--gm-action-color",this.displaySettings.colors.actionButton.color??""),this.actionButton.style.setProperty("--gm-action-background",this.displaySettings.colors.actionButton.backgroundColor),this.actionButton.style.setProperty("--gm-action-hover-color",this.displaySettings.colors.actionButton.hoverColor),this.actionButton.style.setProperty("--gm-action-hover-background",this.displaySettings.colors.actionButton.hoverBackgroundColor),this.actionButton.style.setProperty("--gm-action-border-color",this.displaySettings.colors.actionButton.borderColor))):this.priceElement.appendChild(this.timeoutContainer),this.timeOutInHours=t.timeOutInHours??0}get offering(){return this._offering}set offering(t){this.frameElement.offering=t,t.createdBy&&(this.addedBy.textContent=`${Ht("offering_added_by")} ${t.createdBy}`,this.addedBy.setAttribute("aria-label",this.addedBy.textContent));const{data:e}=t,{trips:n,destination:i,numOfPassengers:o}=e;this.tripsContainer.replaceChildren(),n.forEach(((t,e)=>{const i=new St;i.dateFormat=this._displaySettings.dateLocale,i.tripData=t,this.tripsContainer.appendChild(p.A`${i}
`),e${((t="joyned-trip-seperate-line")=>p.A`
`)()}`)})),this.expandButton.style.display=n.length>2?"block":"none";const r=n[0].ground?Yt[n[0].ground?.vehicleType]:Yt.flight,a=(0,wt.A)(r);let s;this.titleElement.innerText=a.format({destination:i}),s=1===n.length?Gt.oneWay:2===n.length?Gt.roundTrip:Gt.multyWay;const l=`${o} ${Ht(1===o?"Passenger":"Passengers")}, ${s}`,{ticketType:c}=n[0];if(this.descriptionElement.innerText=c?`${l}, ${c}`:l,t.price){this.totalPriceElement.textContent=(0,R.$g)(t.price,this.displaySettings.priceLocale);const{description:e}=t.price;if(e)if(e.includes("&pf")){const[t,n]=e.split("&pf");this.priceHeader=t,this.priceFooter.textContent=n}else this.priceFooter.textContent=e}t.salePrice?.amount&&(this.salePriceElement.textContent=(0,R.$g)(t.salePrice,this.displaySettings.priceLocale)),this.createdAt=t.createdAt,this.priceElement.hidden=!1===t.isValid,this._offering=t,this.offering.timeoutInHours&&(this.timeOutInHours=this.offering.timeoutInHours)}loadImages(){}constructor(){super(),Ut(this,"shadowRoot",this.attachShadow({mode:"open"})),Ut(this,"styles",[g.A,Et.A]),Ut(this,"attributeBucket",(0,A.A)(this)),Nt(this,"votingFeatureEnabled",jt,this),Nt(this,"hasHighestVotes",Mt,this),Nt(this,"isTrendingCard",Dt,this),Nt(this,"displayMode",Ot,this),Ut(this,"isExpand",!1),Nt(this,"timeOutInHours",$t,this),Nt(this,"createdAt",Pt,this),Nt(this,"popupShow",Lt,this),Ut(this,"closeAllPopups",(()=>{this.frameElement.isMenuOpen=!1,this.frameElement.votingContainer.votesListShow=!1,this.popupShow=!1})),this.addedBy=p.A` `,this.titleElement=p.A`
`,this.secondaryTitleElement=p.A`
`,this.datesElement=p.A` `,this.descriptionElement=p.A`
`,this.secondaryDescriptionElement=p.A`
`,this.textHeader=p.A``,this.actionButtonContainer=p.A`
`,this.timeoutPopup=p.A``,this.timeoutButton=p.A`${(0,h.A)()} `,this.timeoutContainer=p.A`
${this.timeoutButton}${this.timeoutPopup}
`,this.salePriceElement=p.A` `,this.totalPriceElement=p.A` `,this.priceElement=p.A`
${this._priceHeader=p.A` `}
${this.salePriceElement}
${this.totalPriceElement}
${this.priceFooter=p.A` `}
`,this.expandButton=p.A`
`,this.expandButton.innerText=`${Ht("trip_show_more")}`,this.tripsContainer=p.A`
`,this.tripOfferingContainer=p.A`
`,this.tripOfferingContainer.appendChild(this.tripsContainer),this.tripOfferingContainer.append(this.expandButton),this.textContainer=p.A`
${this.textHeader}
${this.tripOfferingContainer}
`,this.attributeBucket.register("popupShow",(t=>{this.timeoutPopup.classList.toggle("show",t)}));const t=p.A` `,e=p.A`
`;this.frameElement=new o.A,this.frameElement.displayMode=this.displayMode,this.frameElement.menuHandleShape="row",this.frameElement.menuPopupPosition="bottom",this.frameElement.votingPopupDirection="right",this.frameElement.classList.add("trip-cards");const n=p.A`${this.textContainer}
`;this.frameElement.appendChild(n),this.attributeBucket.register("timeOutInHours",(t=>{if(this.createdAt&&t>0){const e=(new Date).valueOf()-this.createdAt,n=36e5;this.timeoutButton.classList.toggle("show",e>t*n)}})),this.attributeBucket.register("isTrendingCard",(t=>{this.classList.toggle("trending",t),this.frameElement.classList.toggle("trending",t)}));const i=p.A` `;this.frameElement.appendChild(i),this.frameElement.appendChild(t),this.frameElement.appendChild(e),this.shadowRoot.appendChild(this.frameElement),this.attributeBucket.register("votingFeatureEnabled",(t=>{this.frameElement.votingFeatureEnabled=t})),this.attributeBucket.register("hasHighestVotes",(t=>{this.frameElement.hasHighestVotes=t})),this.attributeBucket.register("displayMode",(t=>{this.frameElement.displayMode=t}))}registerEvents(){const t=[],e=(0,s.p)((t=>"Enter"===t.key));t.push((0,l.h)((0,c.R)(this.textHeader,"click"),(0,c.R)(this.textHeader,"keydown").pipe(e)).pipe((0,d.T)((()=>new C("card-clicked",this.offering.id,{viewUrl:this.offering.directURL})))).subscribe((t=>{this.dispatchEvent(t)}))),this.actionButton&&t.push((0,l.h)((0,c.R)(this.actionButton,"click"),(0,c.R)(this.actionButton,"keydown").pipe(e)).pipe((0,d.T)((()=>new C("action-clicked",this.offering.id,{viewUrl:this.offering.directURL})))).subscribe((t=>{this.dispatchEvent(t)})));this.expandButton.addEventListener("click",(()=>{this.tripsContainer.classList.toggle("joyned-expand-list"),this.isExpand=!this.isExpand,this.frameElement.isOfferingExpanded=this.isExpand,this.expandButton.innerText=this.isExpand?`${Ht("trip_show_less")}`:`${Ht("trip_show_more")}`}));const n=()=>{this.popupShow=!this.popupShow},i=t=>{const e=t.composedPath()[0];this.timeoutContainer.contains(e)||(this.popupShow=!1)};return window.addEventListener("click",i),this.timeoutButton.addEventListener("click",n),()=>{t.forEach((t=>{t.unsubscribe()})),window.removeEventListener("click",i),this.timeoutButton.removeEventListener("click",n)}}},jt=Rt(It.prototype,"votingFeatureEnabled",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Mt=Rt(It.prototype,"hasHighestVotes",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Dt=Rt(It.prototype,"isTrendingCard",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ot=Rt(It.prototype,"displayMode",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"list-item"}}),$t=Rt(It.prototype,"timeOutInHours",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Pt=Rt(It.prototype,"createdAt",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lt=Rt(It.prototype,"popupShow",[a.CF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),_t=It))||_t)||_t);const Wt={"goods-offering":q,"hotel-offering":xt,"trip-offering":Vt};function qt(t,e){const{priceLocale:n,dateLocale:o}=(0,R.jM)(t,e.language.language),a={...{textColor:i.A.white,backgroundColor:t.colors.primaryColor},...t.offerings?.joynedTabActionButtonColors},s={colors:{primaryColor:t.colors.primaryColor,inviteButton:t.share.inviteButton,actionButton:{color:t.offerings?.actionButtonColors?.color??t.colors.accentColor??i.A.accentColor,backgroundColor:t.offerings?.actionButtonColors?.backgroundColor??t.colors.primaryColor??i.A.primaryColor,hoverBackgroundColor:t.offerings?.actionButtonColors?.hoverBackgroundColor??t.colors.accentColor??i.A.accentColor,hoverColor:t.offerings?.actionButtonColors?.hoverColor??t.colors.primaryColor??i.A.primaryColor,borderColor:t.offerings?.actionButtonColors?.borderColor??t.colors.primaryColor??i.A.primaryColor},joynedTabActionButtonColors:a,votingColor:t.colors.votingColor??""},imageStyle:t.imageStyle,fallbackImageUrl:t.fallbackImageUrl,offeringOptions:{actionButtonText:(0,r.A)(t.offerings?.actionButtons?.find((t=>t.text))?.text,e.language.language,"")},timeOutInHours:t.offerings?.timeOutInHours,pricePrefixKey:t.offerings?.pricePrefixKey,priceLocale:n,dateLocale:o};return{resolve:async function(t){if(null==Wt[t.offeringName])throw new Error(`No product is defined for name ${t.offeringName}.\n data: ${JSON.stringify(t)}`);const e=new Wt[t.offeringName];return e.style.setProperty("--gm-icons-color","#718096"),e.displaySettings=s,e.offering=t,e.loadImages(),e},displaySettings:s}}},7548:(t,e,n)=>{n.d(e,{Ay:()=>A,MC:()=>u,sw:()=>d});var i=n(7611),o=n(5773),r=n(7841),a=n(5220),s=n(6433),l=n(8779);function c(t){if("ShortAddress"===t.type){return(0,a.A)("{{city}}, {{country}}").format(t)}return""}const d=(t,e)=>e.some((e=>e.city===t.city&&e.country===t.country&&e.type===t.type)),p={url:(t,e)=>new RegExp(t.rule).test(window.location.href),language:(t,e)=>t.rule===e.language.language,cookie:(t,e)=>{const n=(0,l.UM)(t.rule.cookieKey);return new RegExp(t.rule.cookieValue).test(n??"")}},u=(t,e)=>!t.visibility||t.visibility.every((t=>p[t.name](t,e))),A=(t,e,n,a)=>{const l=e.sourceTypes.items&&e.items?e.items?.filter((t=>u(t,n))).map((t=>(0,r.$X)(t))).map((t=>({...t,source:s.P.ITEMS}))):[],p=new i.B,A=[];let h=[];const m=new i.B;let g={};const f=new i.B;let C={};const v=new i.B;function b(t,e){const i={},o=t=>({...t,source:e});return Object.entries(t).forEach((([t,e])=>{const a=e.filter((t=>u(t,n)));i[t]=a.map((e=>(0,r.$X)(e,function(t){const[e,n]=t.split(",");return{city:e.trim(),country:n.trim(),type:"ShortAddress"}}(t)))).map(o)})),i}e.sourceTypes.recommendationsByLocation&&e.recommendationsByLocation&&(g=b(e.recommendationsByLocation,s.P.RECOMMENDATIONS_BY_LOCATION)),e.sourceTypes.recommendationsForProperty&&e.recommendationsForProperty&&(C=b(e.recommendationsForProperty.recommendations,s.P.RECOMMENDATIONS_BY_POST_PROPERTY));const x=t=>!!e.sourceTypes.api?.includes(t.source);const B=({locations:n,posts:i})=>{p.next({collection:l,change:{type:"initial"}}),function(t){const e=[];t&&(t?.forEach((({location:t})=>{const n=c(t);Object.keys(g).includes(n)&&e.push(...g[n])})),f.next({collection:e,change:{type:"initial"}}))}(n),function(t){const n=[];if(e.recommendationsForProperty){const{propertyToLookFor:i}=e.recommendationsForProperty;t?.forEach((t=>{const{offeringContent:e}=t;if(!e)return;const o=i.split(".").reduce(((t,e)=>t[e]),e);if(!o)return;const r="data.location"===i?c(o):o.toString();Object.keys(C).includes(r)&&n.push(...C[r])}))}v.next({collection:n,change:{type:"initial"}})}(i);const o=e.sourceTypes.api&&e.sourceTypes.api.length>0,a=n?.filter((({location:t})=>!d(t,A)));a?.length&&o&&a.forEach((({location:e})=>(async e=>{if(d(e,A))return;A.push(e);const n=(await t.getRecommendations(e)).filter(x).map((t=>(0,r.J3)(t,e)));h.push(...n),m.next({collection:h,change:{type:"add",addedItems:n}})})(e)))},y=({locations:t})=>{if(t){const e=A?.filter((e=>!d(e,t.map((({location:t})=>t)))));if(!e)return;h=h.filter((t=>((t,e)=>{if(!e?.data)return;const{location:n}=e.data;return n?!d(n,t):void 0})(e,t.offeringContent))),m.next({collection:h,change:{type:"initial"}})}else m.next({collection:[],change:{type:"initial"}}),f.next({collection:[],change:{type:"initial"}})};return a.session$.subscribe((t=>{B(t),y(t)})),{highestVoted$:o.t,get generalRecommendations$(){return p.asObservable()},get locationRecommendations$(){return f.asObservable()},get postRecommendations$(){return v.asObservable()},get pegasusRecommendations$(){return m.asObservable()}}}},8723:(t,e,n)=>{n.d(e,{A:()=>X});var i,o,r,a,s,l,c,d,p=n(7889),u=n(5677),A=n(2410),h=n(2783),m=n(962),g=n(7639),f=n(8551),C=n(8330),v=n(2922),b=n(2400),x=n(6331),B=n(7817),y=n(1800),w=n(9336),E=n(5503),k=n(6433),F=n(3745).__,z=n(9578).u;function S(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function T(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _(t,e,n,i,o){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce((function(n,i){return i(t,e,n)||n}),r),o&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(o):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}function I(t){return(0,x.j)("","thumbs-up",t)}function j(t){return(0,x.j)("","thumbs-down",t)}let M=(i=(0,g.Ay)({}),(0,p.p_)(o=i((r=class JoynedVotingSelectorElement extends HTMLElement{constructor(){super(),T(this,"shadowRoot",this.attachShadow({mode:"open"})),T(this,"styles",[y.A,w.A,E.A]),T(this,"attributeBucket",(0,m.A)(this)),S(this,"votesListShow",a,this),S(this,"hasHighestVotes",s,this),S(this,"votingColor",l,this),S(this,"userVote",c,this),S(this,"popupDirection",d,this),T(this,"closeSelectorPopUp",(()=>{this.votesListShow=!1})),this._buttonThumbsUpButton=A.A`
${I(18)}
`,this._buttonThumbsDownButton=A.A`${j(18)} `,this._buttonUpVoteCount=A.A` `,this._buttonDownVoteCount=A.A` `,this._votingButton=A.A`
${(0,x.j$)()}
${this._buttonUpVoteCount}
${this._buttonThumbsUpButton}
${this._buttonDownVoteCount}
${this._buttonThumbsDownButton}
`,this._popupThumbsUpButton=A.A`
`,this._popupThumbsDownButton=A.A`
${j()} `,this._popupUpVoteCount=A.A` `,this._popupDownVoteCount=A.A` `,this._votesList=A.A`
`,this._votesListPopup=A.A`