var isNative=function(){for(var t=null,e=[Object,Function,Number],r=0;null===t&&r([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),n=e.replace(r,"$1").trim());oObject.prototype.hasOwnProperty.call(t,e))):r(t,[e])}function n(t){return"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return t instanceof globalThis.Promise||"object"==typeof t&&t&&(g(t.then)||r(t,["isFulfilled","isRejected"]))}function i(t){return function e(){for(var r=arguments.length,n=Array(r),o=0;ot(e)))}}}function c(t,e){return _(e)?"---replaced---":e}function l(){for(var t=arguments.length,e=Array(t),r=0;ro(t,c(0,e)),i]:p(o)||(l=[n,c,i]),globalThis.JSON.stringify.apply(null,l)}function a(){const t=function(){for(var t=arguments.length,e=Array(t),r=0;re.apply(this,0===r?t:[t])),r)}}(...arguments);return e=>e&&t(e)}function s(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=Array(t.length);for(let r=0;r=33&&n<=126?33+(n+14)%94:n)}return e.join("")}function u(t){return Array.from(t).map((t=>/^[\x00-\x7F]$/.test(t)?t:t.split("").map((t=>"\\u".concat(t.charCodeAt(0).toString(16).padStart(4,"0")))).join(""))).join("")}"undefined"==typeof self||self.thn||(self.thn={},function(){function t(t,e){return(e||"")+" (SystemJS https://github.com/systemjs/systemjs/blob/main/docs/errors.md#"+t+")"}function e(t,e){if(-1!==t.indexOf("\\")&&(t=t.replace(E,"/")),"/"===t[0]&&"/"===t[1])return e.slice(0,e.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){var r,n=e.slice(0,e.indexOf(":")+1);if(r="/"===e[n.length+1]?"file:"!==n?(r=e.slice(n.length+2)).slice(r.indexOf("/")+1):e.slice(8):e.slice(n.length+("/"===e[n.length])),"/"===t[0])return e.slice(0,e.length-r.length-1)+t;for(var o=r.slice(0,r.lastIndexOf("/")+1)+t,i=[],c=-1,l=0;lr.length&&"/"!==n[n.length-1]))return n+t.slice(r.length);l("W2",r,n)}}function l(e,r,n,o){console.warn(t(e,[n,r].join(", ")))}function a(t,e,r){for(var n=t.scopes,o=r&&i(r,n);o;){var l=c(e,n[o]);if(l)return l;o=i(o.slice(0,o.lastIndexOf("/")),n)}return c(e,t.imports)||-1!==e.indexOf(":")&&e}function s(){this[T]={}}function u(e,r,n,o){var i=r.split("?")[0],c=e[T][i];if(c)return c;var l=[],a=Object.create(null);O&&Object.defineProperty(a,O,{value:"Module"});var s=Promise.resolve().then((function(){return e.instantiate(r,n,o)})).then((function(n){if(!n)throw Error(t(2,r));var o=n[1]((function(t,e){c.h=!0;var r=!1;if("string"==typeof t)t in a&&a[t]===e||(a[t]=e,r=!0);else{for(var n in t)e=t[n],n in a&&a[n]===e||(a[n]=e,r=!0);t&&t.__esModule&&(a.__esModule=t.__esModule)}if(r)for(var o=0;o{var t,e;return(null===(t=globalThis.scheduler)||void 0===t||null===(e=t.yield)||void 0===e?void 0:e.call(t))||Promise.resolve()})).then((function(){return h(t,e,{})})).then((()=>{var t,e;return(null===(t=globalThis.scheduler)||void 0===t||null===(e=t.yield)||void 0===e?void 0:e.call(t))||Promise.resolve()})).then((function(){return e.n}))}function h(t,e,r){function n(){try{var t=i.call(A);if(t)return t=t.then((function(){e.C=e.n,e.E=null}),(function(t){throw e.er=t,e.E=null,t})),e.E=t;e.C=e.n,e.L=e.I=void 0}catch(t){throw e.er=t,t}}if(!r[e.id]){if(r[e.id]=!0,!e.e){if(e.er)throw e.er;return e.E?e.E:void 0}var o,i=e.e;return e.e=null,e.d.forEach((function(n){try{var i=h(t,n,r);i&&(o=o||[]).push(i)}catch(t){throw e.er=t,t}})),o?Promise.all(o).then(n):n()}}function p(){[].forEach.call(document.querySelectorAll("script"),(function(e){if(!e.sp)if("systemjs-module"===e.type){if(e.sp=!0,!e.src)return;System.import("import:"===e.src.slice(0,7)?e.src.slice(7):r(e.src,v)).catch((function(t){if(t.message.indexOf("https://github.com/systemjs/systemjs/blob/main/docs/errors.md#3")>-1){var r=document.createEvent("Event");r.initEvent("error",!1,!1),e.dispatchEvent(r)}return Promise.reject(t)}))}else if("systemjs-importmap"===e.type){e.sp=!0;var n=e.src?(System.fetch||fetch)(e.src,{integrity:e.integrity,passThrough:!0}).then((function(t){if(!t.ok)throw Error(t.status);return t.text()})).catch((function(r){return r.message=t("W4",e.src)+"\n"+r.message,console.warn(r),"function"==typeof e.onerror&&e.onerror(),"{}"})):e.innerHTML;k=k.then((function(){return n})).then((function(r){!function(e,r,n){var i={};try{i=JSON.parse(r)}catch(e){console.warn(Error(t("W5")))}o(i,n,e)}(x,r,e.src||v)}))}}))}var v,g="undefined"!=typeof Symbol,m="undefined"!=typeof self,y="undefined"!=typeof document,b=m?self:global;if(y){var w=document.querySelector("base[href]");w&&(v=w.href)}if(!v&&"undefined"!=typeof location){var j=(v=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==j&&(v=v.slice(0,j+1))}var S,E=/\\/g,O=g&&Symbol.toStringTag,T=g?Symbol():"@",P=s.prototype;P.delete=function(t){var e=this[T],r=e[t];if(!r||r.p&&null!==r.p.e||r.E)return!1;var n=r.i;return r.d&&r.d.forEach((function(t){var e=t.i.indexOf(r);-1!==e&&t.i.splice(e,1)})),delete e[t],function(){var r=e[t];if(!r||!n||null!==r.e||r.E)return!1;n.forEach((function(t){r.i.push(t),t(r.n)})),n=null}},P.import=function(t,e,r){var n=this;return e&&"object"==typeof e&&(r=e,e=void 0),Promise.resolve(n.prepareImport()).then((function(){return n.resolve(t,e,r)})).then((function(t){var e=u(n,t,void 0,r);return e.C||d(n,e)}))},P.createContext=function(t){var e=this;return{url:t,resolve:function(r,n){return Promise.resolve(e.resolve(r,n||t))}}},P.register=function(t,e,r){S=[t,e,r]},P.getRegister=function(){var t=S;return S=void 0,t};var A=Object.freeze(Object.create(null));b.thn.System=new s;var C,_,k=Promise.resolve(),x={imports:{},scopes:{},depcache:{},integrity:{}},I=y;if(P.prepareImport=function(t){return(I||t)&&(p(),I=!1),k},y&&(p(),window.addEventListener("DOMContentLoaded",p)),P.addImportMap=function(t,e){o(t,e||v,x)},y){window.addEventListener("error",(function(t){R=t.filename,M=t.error}));var L=location.origin}P.createScript=function(t){var e=document.createElement("script");e.async=!0,t.indexOf(L+"/")&&(e.crossOrigin="anonymous");var r=x.integrity[t];return r&&(e.integrity=r),e.src=t,e};var R,M,F={},N=P.register;P.register=function(t,e){if(y&&"loading"===document.readyState&&"string"!=typeof t){var r=document.querySelectorAll("script[src]"),n=r[r.length-1];if(n){C=t;var o=this;_=setTimeout((function(){F[n.src]=[t,e],o.import(n.src)}))}}else C=void 0;return N.call(this,t,e)},P.instantiate=function(e,r){var n=F[e];if(n)return delete F[e],n;var o=this;return Promise.resolve(P.createScript(e)).then((function(n){return new Promise((function(i,c){n.addEventListener("error",(function(){c(Error(t(3,[e,r].join(", "))))})),n.addEventListener("load",(function(){try{document.head.removeChild(n)}catch(t){}if(R===e)c(M);else{var t=o.getRegister(e);t&&t[0]===C&&clearTimeout(_),setTimeout((()=>{i(t)}),0)}})),document.head.appendChild(n)}))}))},P.shouldFetch=function(){return!1},"undefined"!=typeof fetch&&(P.fetch=fetch);var q=P.instantiate,$=/^(text|application)\/(x-)?javascript(;|$)/;P.instantiate=function(e,r,n){var o=this;return this.shouldFetch(e,r,n)?this.fetch(e,{credentials:"same-origin",integrity:x.integrity[e],meta:n}).then((function(n){if(!n.ok)throw Error(t(7,[n.status,n.statusText,e,r].join(", ")));var i=n.headers.get("content-type");if(!i||!$.test(i))throw Error(t(4,i));return n.text().then((function(t){return t.indexOf("//# sourceURL=")<0&&(t+="\n//# sourceURL="+e),(0,eval)(t),o.getRegister(e)}))})):q.apply(this,arguments)},P.resolve=function(r,n){return a(x,e(r,n=n||v)||r,n)||function(e,r){throw Error(t(8,[e,r].join(", ")))}(r,n)};var U=P.instantiate;P.instantiate=function(t,e,r){var n=x.depcache[t];if(n)for(var o=0;ot)).join("&").replace(/\w/,"?$&"),r[0]+n)}(t),r):(".js"===(null==(i=o=n.call(this,t,r))||null===(c=i.split("?")[0])||void 0===c?void 0:c.slice(-3))&&(e=t.split("?")[1]||o.split("?")[1]||""),o)}}("undefined"!=typeof self?self:global));const f="data-thn-current",d="__thn_script_src";var h=function e(){var r=[].slice.call(arguments),n=!1;"boolean"==typeof r[0]&&(n=r.shift());var o=r[0];if(t(o))throw Error("extendee must be an object");for(var i,c=r.slice(1),l=c.length,a=0;an(t)&&r(t,["$decorator","$register","$list"]),g=e("function")(["[object AsyncFunction]","[object Function]","[object GeneratorFunction]","[object Proxy]"]),m=t=>null!=t&&"object"==typeof t&&1===t.nodeType&&!n(t),y=e()(["[object DOMWindow]","[object global]","[object Window]"]),b=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n"".concat("@thehotelsnetwork/").concat(t),P=t=>t.flatMap((t=>[t,t.map((t=>"".concat(t,"/")))])),A=function(t,e){return e[t]||(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"latest")},C=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e=>""+new URL("/sjs".concat(e),t),o=Object.fromEntries(P([].concat(O.map((t=>[t,n("/".concat(t,"@").concat(A(t,e),"&bundle"))])),S.map((t=>{const r=T(t);return[r,n("/".concat(r,"@").concat(A(r,e),"&bundle"))]})),E.map((t=>{const r=T(t);return[r,n("/*".concat(r,"@").concat(A(r,e),"&no-bundle"))]})),j.map((t=>{const r=T(t);return[r,n("/".concat(r,"@").concat(A(r,e,"stable"),"&external=vue&no-bundle"))]}))))),i=Object.fromEntries(P(Object.entries(e).filter((t=>{let[e]=t;return!r(o,e)})).map((t=>{let[r]=t;return[r,n("/".concat(r,"@").concat(A(r,e),"&bundle"))]}))));return{imports:b(o,i)}},_=i("some")(m,v,o,y),k={accountKey:{key:"account_key"},hotelId:{key:"hotel_id"},propertyId:{key:"property_id",encoder:a(l,u,s,globalThis.btoa)}},x="/get_loader_data",I=function(){const t=function(t){var e={},r=function(){var r=Array.prototype.slice.call(arguments),n=JSON.stringify(r);return n in e||(e[n]=t.apply(this,r)),e[n]};return r.cache=e,r}((function(t){const{URL:e}=globalThis,r=new e(t),[n,o,i,c,l,a,s]=[r.searchParams.get("property_id"),r.searchParams.get("hotel_id"),r.searchParams.get("account_key"),r.searchParams.get("bahiaprincipe_id"),r.searchParams.get("octorate_id"),r.searchParams.get("partnership_id"),r.searchParams.get("partnership_hotel_id")];if(n)return Promise.resolve({propertyId:n});if(o||c||l||a&&s){const t=new e(r);return t.pathname="/get_hotel_property_rel",globalThis.fetch(""+t).then((t=>{if(!t.ok)throw Error("".concat(t.status," ").concat(t.statusText));return t.json()})).then((t=>{const e={};return t&&1===t.result?(t.property_id&&(e.propertyId=t.property_id),t.account_key&&(e.accountKey=t.account_key),e):e}))}return Promise.resolve(i?{accountKey:i}:{})}));return t.cache.clear=()=>{Object.keys(t.cache).forEach((e=>{"clear"!==e&&delete t.cache[e]}))},t}(),L=t=>t[d]&&{src:t[d]}||t.document.querySelector("script[".concat(f,'="1"]'))||t.thn[d],R={async install(t){var e,r,n,o;let{thn:i,window:c}=t;const l=L(c);if(!l)return;const{URL:a}=c,s=new a(l.src);s.protocol="https:";const u=await I(l.src),f=await function(t){var e;let{params:r,baseUrl:n}=t;if(!n)return Promise.reject();const{URL:o}=globalThis,i=new o(n);let c;return i.pathname=x,Object.entries(r).forEach((t=>{let[e,r]=t;if(void 0!==r){const t=function(t){return t in k}(e);i.searchParams.set(t?k[e].key:e,(t&&k[e].encoder||String)(r+""))}})),c=null!==(e=globalThis.thn)&&void 0!==e&&e.System?globalThis.thn.System.import(""+i).then((t=>{var e,r,c,l,a,s;const u=new o(x,n);return null===(e=globalThis.thn)||void 0===e||null===(r=e.System)||void 0===r||null===(c=r.delete)||void 0===c||c.call(r,""+u),null===(l=globalThis.thn)||void 0===l||null===(a=l.System)||void 0===a||null===(s=a.delete)||void 0===s||s.call(a,""+i),t.default||{}})):globalThis.fetch(""+i,{credentials:"include",headers:{accept:"application/json"}}).then((t=>t.ok&&t.json()||{})),c.then((t=>{var e;const r=null==t||null===(e=t.data)||void 0===e?void 0:e.initData;return r&&(r.office=t.office,r.hostnameReal=r.hostname,r.hostname=i.host),t})).catch((()=>({})))}({params:u,baseUrl:l.src}),{defaultVersion:h,office:p}=f,v=null==f||null===(e=f.data)||void 0===e?void 0:e.initData,g="index".concat(!1===(null==v?void 0:v.minified)?"":".min",".js"),m=new a("/widget/core/".concat(null!==(r=null!==(n=null==v?void 0:v.version)&&void 0!==n?n:h)&&void 0!==r?r:"4.0","/dist/main/").concat(g),s),y=null==f||null===(o=f.checksums)||void 0===o?void 0:o.main[g];y&&m.searchParams.set("h",y);const w=b({imports:{"@thehotelsnetwork/agent-main":""+m}},C(s.origin)),j=b(w,f.importmap||{});i.System.addImportMap(j),await function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{document:e,MutationObserver:r}=globalThis,{document:n=e,MutationObserver:o=r}=t;return n.body?Promise.resolve():new Promise((t=>{const e=new o((r=>{r.some((r=>Array.from(r.addedNodes).some((r=>r===n.body&&(e.disconnect(),t(),!0)))))}));e.observe(n.documentElement,{childList:!0})}))}(c);const{default:S}=await i.System.import("@thehotelsnetwork/agent-main");if(S.System=i.System,S[d]=i[d],c.thn=S,S.Logger.setLevel(f.loggerLevel&&S.Logger[f.loggerLevel]||p&&S.Logger.DEBUG||S.Logger.OFF),await S.container.scheduler.yield(),f.data)S.siteCheck({loader:f});else{const t=s.searchParams.get("partnership_id")||"";S.partnershipCheck(t)}}};var M=Object.freeze({__proto__:null,plugin:R});!function(t,e){const r={monolith:M};if((t=>{t.requestIdleCallback=t.requestIdleCallback||(t=>setTimeout(t,1))})(globalThis),!(t=>{let{document:e,thn:r}=t;const{currentScript:n}=e;if(n){const t=[...e.querySelectorAll("script[".concat(f,"]")),r[d]].filter(Boolean),o=t.filter((t=>!(n.src===t.src&&+t.getAttribute(f))));o.forEach((t=>{t.setAttribute(f,0)}));const i=o.length===t.length?1:0;if(n.setAttribute(f,i),!i)return!1;r[d]=n}return!0})(globalThis))return;const{URL:n}=globalThis,o=new n(L(globalThis).src);o.protocol="https:","caches"in globalThis&&async function(t){try{const e=await t.keys(),r=await Promise.all(e.map((e=>t.open(e)))),n=await Promise.all(r.map((t=>t.keys()))),i=[];return r.forEach(((t,e)=>{n[e].forEach((e=>{var r;(r=e).url.includes(o.host)&&-1===r.url.indexOf("/__OFFLINE__/")&&i.push(t.delete(e))}))})),await Promise[Promise.allSettled?"allSettled":"all"](i).catch((()=>"")),""}catch(t){return""}}(globalThis.caches),((null===(t=globalThis.scheduler)||void 0===t||null===(e=t.yield)||void 0===e?void 0:e.call(t))||Promise.resolve()).then((()=>Promise.resolve({plugins:["monolith"],importmap:{}}))).then((t=>{let{plugins:e,importmap:n}=t;n&&globalThis.thn.System.addImportMap(n),e.reduce(((t,e)=>t.then((()=>(async t=>{var e;const{thn:n}=globalThis,{plugin:o}=await(t in r?Promise.resolve(r[t]):n.System.import("@thehotelsnetowrk/agent-plugin-".concat(t)));return null===globalThis||void 0===globalThis||null===(e=globalThis.performance)||void 0===e||e.mark("thn-loader-plugin-install",{details:{pluginName:t}}),o.install({thn:n,window:globalThis})})(e))).catch()),Promise.resolve()).then((()=>{var t,e,r,n,o,i;try{var c,l,a,s,u,f;globalThis.thn.logger.debug("(timing) from domInteractive to loader-start:",null===(c=globalThis.performance)||void 0===c||null===(l=c.measure)||void 0===l||null===(a=l.call(c,"domInteractive:thn-loader-start:diff","domInteractive","thn-loader-start"))||void 0===a?void 0:a.duration),globalThis.thn.logger.debug("(timing) from loader-start to loader-end:",null===(s=globalThis.performance)||void 0===s||null===(u=s.measure)||void 0===u||null===(f=u.call(s,"thn-loader-start:thn-loader-end:diff","thn-loader-start"))||void 0===f?void 0:f.duration)}catch(t){}null===(t=globalThis.thn)||void 0===t||null===(e=t.logger)||void 0===e||e.debug("(timing) loader-start: ".concat(new Date(((null===(r=globalThis.performance)||void 0===r?void 0:r.timeOrigin)||0)+((null===(n=globalThis.performance)||void 0===n||null===(o=n.getEntriesByName)||void 0===o||null===(i=o.call(n,"thn-loader-start"))||void 0===i?void 0:i.reverse()[0].startTime)||0)).toISOString()))}))}))}()}()}}();