@findhotel/sapi 0.23.6 → 0.23.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).sapi=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return n(null==t&&r.path)}},r.exports),r.exports}function r(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var i=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function c(e){return this instanceof c?(this.v=e,this):new c(e)}var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var f=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return a},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},__decorate:function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},__createBinding:i,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},__values:u,__read:s,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n},__await:c,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(s,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function s(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),a.shift(),a.length&&u(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:c(e[n](t)),done:"return"===n}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return l(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),d=t((function(e,t){e.exports=function(){function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return u({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return u({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return u({caches:t}).clear()}))}}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=n(),u=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return u(e)})).then((function(){return i}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===g.WithinHeaders?n:{}},queryParameters:function(){return e===g.WithinQueryParameters?n:{}}}}function l(e){var t=0;return e((function r(){return t++,new Promise((function(n){setTimeout((function(){n(e(r))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(r){return f(e.then((function(e){return Promise.all([t(e,r),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[o++])}))}var g={WithinQueryParameters:0,WithinHeaders:1};function v(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var y={Read:1,Write:2,Any:3},m=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var T="DELETE",I="GET",S="POST",x="PUT";function P(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===m||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function E(e,t,n,o){var i=[],u=function(e,t){if(e.method!==I&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,o),s=function(e,t){var n=r(r({},e.headers),t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==I?{}:r(r({},n.data),o.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(r,a){var l=r.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:A(i)};var h={data:u,headers:s,method:c,url:C(l,n.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return i.push(t),t},g={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=p(n);return n.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",R(o)),e.hostsCache.set(l,w(l,n.isTimedOut?_:b))]).then((function(){return t(r,a)}))},onFail:function(e){throw p(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,A(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,g)}))};return P(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,i=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:i,timeouts:u,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=v(t,f.timeouts.read),n=function(){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,f.timeouts.write))}};return f}function j(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function C(e,t,r){var n=D(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function D(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function A(e){return e.map((function(e){return R(e)}))}function R(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){return function(t,r){return e.transporter.write({method:S,path:"2/abtests",data:t},r)}},M=function(e){return function(t,r){return e.transporter.write({method:T,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:I,path:p("2/abtests/%s",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:I,path:"2/abtests"},t)}},L=function(e){return function(t,r){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},r)}},q=function(e){return function(t){return e.transporter.read({method:I,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},r)}};function H(e){return function t(r){return e.request(r).then((function(n){if(void 0!==e.batch&&e.batch(n.hits),!e.shouldStop(n))return n.cursor?t({cursor:n.cursor}):t({page:(r.page||0)+1})}))}({})}var W=function(e){return function(t,o){var a=o||{},i=a.queryParameters,u=n(a,["queryParameters"]),s=r({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:s},u),(function(t,r){return l((function(n){return X(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},z=function(e){return function(t,r,n){var o=v(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Rules]}))}},G=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Settings]}))}},J=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Synonyms]}))}},Q=function(e){return function(t,r){return f(e.transporter.write({method:T,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/keys/%s",t)},r)}},$=function(e){return function(t){return e.transporter.read({method:I,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/clusters/mapping/%s",t)},r)}},te=function(e){return function(t){var r=t||{},o=r.retrieveMappings,a=n(r,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:I,path:"1/clusters/mapping/pending"},a)}},re=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},ne=function(e){return function(t){return e.transporter.read({method:I,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters"},t)}},ae=function(e){return function(t){return e.transporter.read({method:I,path:"1/indexes"},t)}},ie=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters/mapping"},t)}},ue=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},se=function(e){return function(t,r){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return re(e)(n,{methods:{waitTask:tt}}).waitTask(t.taskID[n],r)})))}))}},ce=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},r)}},le=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:D(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,u=a.facetQuery,s=n(a,["facetName","facetQuery"]);return re(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(i,u,r(r({},o),s))})))}},de=function(e){return function(t,r){var n=v(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},n)}},he=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},r)}},ge=function(e){return function(t,r){var o=Object.assign({},r),a=r||{},i=a.queryParameters,u=n(a,["queryParameters"]),s=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:x,path:p("1/keys/%s",t),data:s},u),(function(r,n){return l((function(r){return X(e)(t,n).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){return e[t]===o[t]}))}(e)?Promise.resolve():r()}))}))}))}},ve=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return tt(e)(t.taskID,r)}))}},ye=function(e){return function(t){return H(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},me=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return $e(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return Ze(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,r,o){var a=o||{},i=a.batchSize,u=n(a,["batchSize"]),s={taskIDs:[],objectIDs:[]};return f(function n(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(s):ve(e)(a.map((function(e){return{action:r,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,r)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Oe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=v(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},Te=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=v(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},Ie=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return tt(e)(t.taskID,r)}))}},Se=function(e){return function(t){return f(e.transporter.write({method:T,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},xe=function(e){return function(t,r){return f(Pe(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Pe=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return _e(e)(n,rt.DeleteObject,r)}},Ee=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},ke=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},je=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Ce=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},De=function(e){return function(t,a){var i=a||{},u=i.query,s=i.paginate,c=n(i,["query","paginate"]),l=0;return function n(){return Qe(e)(u||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,a=Object.entries(e.hits);r<a.length;r++){var i=o(a[r],2),u=i[0],c=i[1];if(t(c))return{object:c,position:parseInt(u,10),page:l}}if(l++,!1===s||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Ae=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},Re=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var a=o(n[r],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Ne=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,u=n(a,["attributesToRetrieve"]),s=t.map((function(t){return r({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:s}},u)}},Me=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ue=function(e){return function(t){return e.transporter.read({method:I,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Be=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},Le=function(e){return function(t,r){return f(qe(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},qe=function(e){return function(t,r){var o=r||{},a=o.createIfNotExists,i=n(o,["createIfNotExists"]),u=a?rt.PartialUpdateObject:rt.PartialUpdateObjectNoCreate;return _e(e)(t,u,i)}},Fe=function(e){return function(t,i){var u=i||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,d=n(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return tt(e)(t.taskID,r)}))},g=Math.random().toString(36).substring(7),v="".concat(e.indexName,"_tmp_").concat(g),y=Ye({appId:e.appId,transporter:e.transporter,indexName:v}),m=[],b=h(e.indexName,v,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(b),f((s?b.wait(d):b).then((function(){var e=y(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return m.push(e),s?e.wait(d):e})).then((function(){var t=h(v,e.indexName,"move",d);return m.push(t),s?t.wait(d):t})).then((function(){return Promise.all(m)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],i=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(a(n.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,n){return Ve(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},We=function(e){return function(t,n){return Je(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},ze=function(e){return function(t,r){return f(Ye(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ye=function(e){return function(t,r){var o=r||{},a=o.autoGenerateObjectIDIfNotExist,i=n(o,["autoGenerateObjectIDIfNotExist"]),u=a?rt.AddObject:rt.UpdateObject;if(u===rt.UpdateObject){var s=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!0)if(void 0===d.value.objectID)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{s||null==h.return||h.return()}finally{if(c)throw l}}}return _e(e)(t,u,i)}},Ke=function(e){return function(t,r){return Ve(e)([t],r)}},Ve=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingRules,u=v(n(o,["forwardToReplicas","clearExistingRules"]));return a&&(u.queryParameters.forwardToReplicas=1),i&&(u.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,r){return tt(e)(t.taskID,r)}))}},Ge=function(e){return function(t,r){return Je(e)([t],r)}},Je=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=v(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(s.queryParameters.forwardToReplicas=1),(u||i)&&(s.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,r){return tt(e)(t.taskID,r)}))}},Qe=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},Xe=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},$e=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},Ze=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},et=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,r){return tt(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},r)}}(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},rt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},nt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,at=2,it=3;function ut(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=it,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return at>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[i({key:"".concat("4.8.0","-").concat(e)}),s()]}),userAgent:j("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=k(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(r(r(r({},a),n),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:se,multipleGetObjects:ce,multipleQueries:le,copyIndex:K,copySettings:G,copySynonyms:J,copyRules:V,moveIndex:ue,listIndices:ae,getLogs:$,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:X,addApiKey:W,listApiKeys:ne,updateApiKey:ge,deleteApiKey:Q,restoreApiKey:he,assignUserID:z,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ie,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return re(e)(t,{methods:{batch:ve,delete:Se,findAnswers:Ce,getObject:Ae,getObjects:Ne,saveObject:ze,saveObjects:Ye,search:Qe,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:Le,partialUpdateObjects:qe,deleteObject:xe,deleteObjects:Pe,deleteBy:Ie,clearObjects:we,browseObjects:ye,getObjectPosition:Re,findObject:De,exists:je,saveSynonym:Ge,saveSynonyms:Je,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:ke,clearSynonyms:Te,replaceAllObjects:Fe,replaceAllSynonyms:We,searchRules:$e,getRule:Me,deleteRule:Ee,saveRule:Ke,saveRules:Ve,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{addABTest:N,getABTest:U,getABTests:B,stopABTest:L,deleteABTest:M}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"recommendation.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{getPersonalizationStrategy:q,setPersonalizationStrategy:F}}))}}}}))}return ut.version="4.8.0",ut}()})),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function p(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}var y,m=function(e,t){this.target=t,this.type=e},b=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return p(t,e),t}(m),_=function(e){function t(t,r,n){void 0===t&&(t=1e3),void 0===r&&(r="");var o=e.call(this,"close",n)||this;return o.wasClean=!0,o.code=t,o.reason=r,o}return p(t,e),t}(m),w=function(){if("undefined"!=typeof WebSocket)return WebSocket},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},T=function(){function e(e,t,r){var n=this;void 0===r&&(r={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){n._debug("open event");var t=n._options.minUptime,r=void 0===t?O.minUptime:t;clearTimeout(n._connectTimeout),n._uptimeTimeout=setTimeout((function(){return n._acceptOpen()}),r),n._ws.binaryType=n._binaryType,n._messageQueue.forEach((function(e){return n._ws.send(e)})),n._messageQueue=[],n.onopen&&n.onopen(e),n._listeners.open.forEach((function(t){return n._callEventListener(e,t)}))},this._handleMessage=function(e){n._debug("message event"),n.onmessage&&n.onmessage(e),n._listeners.message.forEach((function(t){return n._callEventListener(e,t)}))},this._handleError=function(e){n._debug("error event",e.message),n._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),n.onerror&&n.onerror(e),n._debug("exec error listeners"),n._listeners.error.forEach((function(t){return n._callEventListener(e,t)})),n._connect()},this._handleClose=function(e){n._debug("close event"),n._clearTimeouts(),n._shouldReconnect&&n._connect(),n.onclose&&n.onclose(e),n._listeners.close.forEach((function(t){return n._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,r=void 0===t?O.maxEnqueuedMessages:t;this._messageQueue.length<r&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,r,n=this._listeners[e.type];if(n)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,v(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?O.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?O.minReconnectionDelay:n,a=e.maxReconnectionDelay,i=void 0===a?O.maxReconnectionDelay:a,u=0;return this._retryCount>0&&(u=o*Math.pow(r,this._retryCount-1))>i&&(u=i),this._debug("next delay",u),u},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,r=t.maxRetries,n=void 0===r?O.maxRetries:r,o=t.connectionTimeout,a=void 0===o?O.connectionTimeout:o,i=t.WebSocket,u=void 0===i?w():i;if(this._retryCount>=n)this._debug("max retries reached",this._retryCount,">=",n);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!function(e){return void 0!==e&&!!e&&2===e.CLOSING}(u))throw Error("No valid WebSocket class provided");this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new u(t,e._protocols):new u(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new b(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new _(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),I=Object.freeze({__proto__:null,default:T}),S=new Uint8Array(16);function x(){if(!y&&!(y="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(S)}var P=/^(?:[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 E(e){return"string"==typeof e&&P.test(e)}for(var k,j,C=[],D=0;D<256;++D)C.push((D+256).toString(16).substr(1));function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+"-"+C[e[t+4]]+C[e[t+5]]+"-"+C[e[t+6]]+C[e[t+7]]+"-"+C[e[t+8]]+C[e[t+9]]+"-"+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase();if(!E(r))throw TypeError("Stringified UUID is invalid");return r}var R=0,N=0;function M(e){if(!E(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function U(e,t,r){function n(e,n,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=M(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(n),i.set(e,n.length),(i=r(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=i[u];return o}return A(i)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function B(e){return 14+(e+64>>>9<<4)+1}function L(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function q(e,t,r,n,o,a){return L((i=L(L(t,e),L(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function F(e,t,r,n,o,a,i){return q(t&r|~t&n,e,t,o,a,i)}function H(e,t,r,n,o,a,i){return q(t&n|r&~n,e,t,o,a,i)}function W(e,t,r,n,o,a,i){return q(t^r^n,e,t,o,a,i)}function z(e,t,r,n,o,a,i){return q(r^(t|~n),e,t,o,a,i)}var Y=U("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",o=0;o<r;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(n.charAt(a>>>4&15)+n.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[B(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=r,s=n,c=o,l=a;r=F(r,n,o,a,e[i],7,-680876936),a=F(a,r,n,o,e[i+1],12,-389564586),o=F(o,a,r,n,e[i+2],17,606105819),n=F(n,o,a,r,e[i+3],22,-1044525330),r=F(r,n,o,a,e[i+4],7,-176418897),a=F(a,r,n,o,e[i+5],12,1200080426),o=F(o,a,r,n,e[i+6],17,-1473231341),n=F(n,o,a,r,e[i+7],22,-45705983),r=F(r,n,o,a,e[i+8],7,1770035416),a=F(a,r,n,o,e[i+9],12,-1958414417),o=F(o,a,r,n,e[i+10],17,-42063),n=F(n,o,a,r,e[i+11],22,-1990404162),r=F(r,n,o,a,e[i+12],7,1804603682),a=F(a,r,n,o,e[i+13],12,-40341101),o=F(o,a,r,n,e[i+14],17,-1502002290),r=H(r,n=F(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=H(a,r,n,o,e[i+6],9,-1069501632),o=H(o,a,r,n,e[i+11],14,643717713),n=H(n,o,a,r,e[i],20,-373897302),r=H(r,n,o,a,e[i+5],5,-701558691),a=H(a,r,n,o,e[i+10],9,38016083),o=H(o,a,r,n,e[i+15],14,-660478335),n=H(n,o,a,r,e[i+4],20,-405537848),r=H(r,n,o,a,e[i+9],5,568446438),a=H(a,r,n,o,e[i+14],9,-1019803690),o=H(o,a,r,n,e[i+3],14,-187363961),n=H(n,o,a,r,e[i+8],20,1163531501),r=H(r,n,o,a,e[i+13],5,-1444681467),a=H(a,r,n,o,e[i+2],9,-51403784),o=H(o,a,r,n,e[i+7],14,1735328473),r=W(r,n=H(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=W(a,r,n,o,e[i+8],11,-2022574463),o=W(o,a,r,n,e[i+11],16,1839030562),n=W(n,o,a,r,e[i+14],23,-35309556),r=W(r,n,o,a,e[i+1],4,-1530992060),a=W(a,r,n,o,e[i+4],11,1272893353),o=W(o,a,r,n,e[i+7],16,-155497632),n=W(n,o,a,r,e[i+10],23,-1094730640),r=W(r,n,o,a,e[i+13],4,681279174),a=W(a,r,n,o,e[i],11,-358537222),o=W(o,a,r,n,e[i+3],16,-722521979),n=W(n,o,a,r,e[i+6],23,76029189),r=W(r,n,o,a,e[i+9],4,-640364487),a=W(a,r,n,o,e[i+12],11,-421815835),o=W(o,a,r,n,e[i+15],16,530742520),r=z(r,n=W(n,o,a,r,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=z(a,r,n,o,e[i+7],10,1126891415),o=z(o,a,r,n,e[i+14],15,-1416354905),n=z(n,o,a,r,e[i+5],21,-57434055),r=z(r,n,o,a,e[i+12],6,1700485571),a=z(a,r,n,o,e[i+3],10,-1894986606),o=z(o,a,r,n,e[i+10],15,-1051523),n=z(n,o,a,r,e[i+1],21,-2054922799),r=z(r,n,o,a,e[i+8],6,1873313359),a=z(a,r,n,o,e[i+15],10,-30611744),o=z(o,a,r,n,e[i+6],15,-1560198380),n=z(n,o,a,r,e[i+13],21,1309151649),r=z(r,n,o,a,e[i+4],6,-145523070),a=z(a,r,n,o,e[i+11],10,-1120210379),o=z(o,a,r,n,e[i+2],15,718787259),n=z(n,o,a,r,e[i+9],21,-343485551),r=L(r,u),n=L(n,s),o=L(o,c),a=L(a,l)}return[r,n,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(B(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}));function K(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function V(e,t){return e<<t|e>>>32-t}var G=U("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o<n.length;++o)e.push(n.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),u=new Array(i),s=0;s<i;++s){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*s+4*l]<<24|e[64*s+4*l+1]<<16|e[64*s+4*l+2]<<8|e[64*s+4*l+3];u[s]=c}u[i-1][14]=8*(e.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[f][h];for(var p=16;p<80;++p)d[p]=V(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=r[0],v=r[1],y=r[2],m=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=V(g,5)+K(w,v,y,m)+b+t[w]+d[_]>>>0;b=m,m=y,y=V(v,30)>>>0,v=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+v>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}));var J=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||k,i=void 0!==e.clockseq?e.clockseq:j;if(null==a||null==i){var u=e.random||(e.rng||x)();null==a&&(a=k=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==i&&(i=j=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:N+1,l=s-R+(c-N)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||s>R)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");R=s,N=c,j=i;var f=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=s/4294967296*1e4&268435455;o[n++]=d>>>8&255,o[n++]=255&d,o[n++]=d>>>24&15|16,o[n++]=d>>>16&255,o[n++]=i>>>8|128,o[n++]=255&i;for(var h=0;h<6;++h)o[n+h]=a[h];return t||A(o)},v3:Y,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||x)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return A(n)},v5:G,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!E(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:E,stringify:A,parse:M}),Q=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return e.nightlyRate})))}})),X=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,r){return void 0===t||void 0===r||0===r?0:e<t?-1*(e-t)/t:e>r?-1*(e-r)/r:0}}));function $(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Z(e){$(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function ee(e){$(1,arguments);var t=Z(e);return!isNaN(t)}var te={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function re(e){return function(t){var r=t||{},n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ne={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ae(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;n=e.formattingValues[i]||e.formattingValues[a]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;n=e.values[s]||e.values[u]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function ie(e){return function(t,r){var n=String(t),o=r||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],u=n.match(i);if(!u)return null;var s,c=u[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}(l,(function(e){return e.test(c)})):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}(l,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:n.slice(c.length)}}}var ue,se={code:"en-US",formatDistance:function(e,t,r){var n;return r=r||{},n="string"==typeof te[e]?te[e]:1===t?te[e].one:te[e].other.replace("{{count}}",t),r.addSuffix?r.comparison>0?"in "+n:n+" ago":n},formatLong:ne,formatRelative:function(e,t,r,n){return oe[e]},localize:{ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:ae({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ae({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:ae({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ae({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ae({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var r=String(e),n=t||{},o=r.match(ue.matchPattern);if(!o)return null;var a=o[0],i=r.match(ue.parsePattern);if(!i)return null;var u=ue.valueCallback?ue.valueCallback(i[0]):i[0];return{value:u=n.valueCallback?n.valueCallback(u):u,rest:r.slice(a.length)}}),era:ie({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ie({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ie({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ie({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ie({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function le(e,t){$(2,arguments);var r=Z(e).getTime(),n=ce(t);return new Date(r+n)}function fe(e,t){$(2,arguments);var r=ce(t);return le(e,-r)}function de(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var he=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return de("yy"===t?n%100:n,t.length)},pe=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):de(r+1,2)},ge=function(e,t){return de(e.getUTCDate(),t.length)},ve=function(e,t){return de(e.getUTCHours()%12||12,t.length)},ye=function(e,t){return de(e.getUTCHours(),t.length)},me=function(e,t){return de(e.getUTCMinutes(),t.length)},be=function(e,t){return de(e.getUTCSeconds(),t.length)},_e=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return de(Math.floor(n*Math.pow(10,r-3)),t.length)},we=864e5;function Oe(e){$(1,arguments);var t=1,r=Z(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function Te(e){$(1,arguments);var t=Z(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=Oe(n),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var i=Oe(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function Ie(e){$(1,arguments);var t=Te(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Oe(r);return n}var Se=6048e5;function xe(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ce(o),i=null==r.weekStartsOn?a:ce(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Z(e),s=u.getUTCDay(),c=(s<i?7:0)+s-i;return u.setUTCDate(u.getUTCDate()-c),u.setUTCHours(0,0,0,0),u}function Pe(e,t){$(1,arguments);var r=Z(e,t),n=r.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,u=null==i?1:ce(i),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,s),c.setUTCHours(0,0,0,0);var l=xe(c,t),f=new Date(0);f.setUTCFullYear(n,0,s),f.setUTCHours(0,0,0,0);var d=xe(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ee(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,a=null==o?1:ce(o),i=null==r.firstWeekContainsDate?a:ce(r.firstWeekContainsDate),u=Pe(e,t),s=new Date(0);s.setUTCFullYear(u,0,i),s.setUTCHours(0,0,0,0);var c=xe(s,t);return c}var ke=6048e5;var je="midnight",Ce="noon",De="morning",Ae="afternoon",Re="evening",Ne="night",Me={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return he(e,t)},Y:function(e,t,r,n){var o=Pe(e,n),a=o>0?o:1-o;return"YY"===t?de(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):de(a,t.length)},R:function(e,t){return de(Te(e),t.length)},u:function(e,t){return de(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return de(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return de(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return pe(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return de(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){$(1,arguments);var r=Z(e),n=xe(r,t).getTime()-Ee(r,t).getTime();return Math.round(n/ke)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):de(o,t.length)},I:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=Oe(t).getTime()-Ie(t).getTime();return Math.round(r/Se)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):de(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):ge(e,t)},D:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/we)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):de(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return de(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return de(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return de(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?Ce:0===o?je:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Re:o>=12?Ae:o>=4?De:Ne,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ve(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ye(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):me(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):be(e,t)},S:function(e,t){return _e(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Be(o);case"XXXX":case"XX":return Le(o);case"XXXXX":case"XXX":default:return Le(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Be(o);case"xxxx":case"xx":return Le(o);case"xxxxx":case"xxx":default:return Le(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ue(o,":");case"OOOO":default:return"GMT"+Le(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ue(o,":");case"zzzz":default:return"GMT"+Le(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return de(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return de((n._originalDate||e).getTime(),t.length)}};function Ue(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),a=n%60;if(0===a)return r+String(o);var i=t||"";return r+String(o)+i+de(a,2)}function Be(e,t){return e%60==0?(e>0?"-":"+")+de(Math.abs(e)/60,2):Le(e,t)}function Le(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+de(Math.floor(o/60),2)+r+de(o%60,2)}function qe(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Fe(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var He={p:Fe,P:function(e,t){var r,n=e.match(/(P+)(p+)?/),o=n[1],a=n[2];if(!a)return qe(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",qe(o,t)).replace("{{time}}",Fe(a,t))}},We=6e4;function ze(e){return e.getTime()%We}function Ye(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var n=r>0?(We+ze(t))%We:ze(t);return r*We+n}var Ke=["D","DD"],Ve=["YY","YYYY"];function Ge(e){return-1!==Ke.indexOf(e)}function Je(e){return-1!==Ve.indexOf(e)}function Qe(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ze=/^'([^]*?)'?$/,et=/''/g,tt=/[a-zA-Z]/;function rt(e){return e.match(Ze)[1].replace(et,"'")}var nt=Object.freeze({__proto__:null,default:function(e,t,r){$(2,arguments);var n=String(t),o=r||{},a=o.locale||se,i=a.options&&a.options.firstWeekContainsDate,u=null==i?1:ce(i),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:ce(c),f=null==o.weekStartsOn?l:ce(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Z(e);if(!ee(d))throw new RangeError("Invalid time value");var h=Ye(d),p=fe(d,h),g={firstWeekContainsDate:s,weekStartsOn:f,locale:a,_originalDate:d},v=n.match($e).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,He[t])(e,a.formatLong,g):e})).join("").match(Xe).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return rt(r);var i=Me[n];if(i)return!o.useAdditionalWeekYearTokens&&Je(r)&&Qe(r,t,e),!o.useAdditionalDayOfYearTokens&&Ge(r)&&Qe(r,t,e),i(p,r,a.localize,g);if(n.match(tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return v}});function ot(e,t){$(2,arguments);var r=Z(e),n=ce(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var at=Object.freeze({__proto__:null,default:ot});function it(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ce(o),i=null==r.weekStartsOn?a:ce(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=Z(e),s=u.getDay(),c=6+(s<i?-7:0)-(s-i);return u.setHours(0,0,0,0),u.setDate(u.getDate()+c),u}var ut=Object.freeze({__proto__:null,default:function(e){return $(1,arguments),it(e,{weekStartsOn:1})}});var st=Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=ce(t),n=7*r;return ot(e,n)}}),ct=36e5,lt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ft=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ht=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(e){var t,r={},n=e.split(lt.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?(r.date=null,t=n[0]):(r.date=n[0],t=n[1],lt.timeZoneDelimiter.test(r.date)&&(r.date=e.split(lt.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=lt.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function gt(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:null};var o=n[1]&&parseInt(n[1]),a=n[2]&&parseInt(n[2]);return{year:null==a?o:100*a,restDateString:e.slice((n[1]||n[2]).length)}}function vt(e,t){if(null===t)return null;var r=e.match(ft);if(!r)return null;var n=!!r[4],o=yt(r[1]),a=yt(r[2])-1,i=yt(r[3]),u=yt(r[4]),s=yt(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,u,s)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,a=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+a),n}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(wt[t]||(Ot(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(Ot(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function yt(e){return e?parseInt(e):1}function mt(e){var t=e.match(dt);if(!t)return null;var r=bt(t[1]),n=bt(t[2]),o=bt(t[3]);return function(e,t,r){if(24===e)return 0===t&&0===r;return r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,o)?r*ct+6e4*n+1e3*o:NaN}function bt(e){return e&&parseFloat(e.replace(",","."))||0}function _t(e){if("Z"===e)return 0;var t=e.match(ht);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?r*(n*ct+6e4*o):NaN}var wt=[31,null,31,30,31,30,31,31,30,31,30,31];function Ot(e){return e%400==0||e%4==0&&e%100}var Tt=Object.freeze({__proto__:null,default:function(e,t){$(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ce(r.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=pt(e);if(a.date){var i=gt(a.date,n);o=vt(i.restDateString,i.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(a.time&&(c=mt(a.time),isNaN(c)||null===c))return new Date(NaN);if(!a.timezone){var l=new Date(s+c),f=new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());return f.setFullYear(l.getUTCFullYear()),f}return u=_t(a.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),It=r(f),St=r(nt),xt=r(at),Pt=r(ut),Et=r(st),kt=r(Tt),jt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=It.__importDefault(St),n=It.__importDefault(xt),o=It.__importDefault(Pt),a=It.__importDefault(Et),i=It.__importDefault(kt);function u(e){return i.default(e+" 12:00:00")}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return n.default(e,t)};t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=u(r.default(new Date,t.DATE_FORMAT));c=void 0!==l?u(l):d?s(g,d):function(e){for(var i,s=e.daysFromNow,c=e.blockedDefaultDates,l=u(r.default(new Date,t.DATE_FORMAT)),f=o.default(n.default(l,s));i=r.default(f,t.DATE_FORMAT),c.includes(i);)f=a.default(f,1);return f}(i);var v=void 0===f?s(c,p):u(f);return{checkIn:r.default(c,t.DATE_FORMAT),checkOut:r.default(v,t.DATE_FORMAT)}}})),Ct=t((function(e,t){function r(e){void 0===e&&(e=[]);var t={},r={};e.forEach((function(e){var r=e[0],n=e[1],o=e[2],a=e[3];n&&(t[r]=X.calculateDiscount(n,o,a))}));var n=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var a=e[0],i=e[1],u=(e[2],e[3]),s=i&&u&&u>0?o===n?1:(t[a]-n)/(o-n):void 0;void 0!==s&&(r[a]=Number(s.toFixed(2)))})),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=r,t.getDealScores=function(e){var t=e.offset,n=e.anchorHotelId,o=e.hotelIds,a=e.hotelEntities,i=e.hotelOfferEntities;return r((void 0===n||t>0?o:It.__spreadArrays([n],o)).map((function(e){var t,r,n,o=a[e],u=i[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],l=s[1];return[e,null===(n=null===(r=null==u?void 0:u.offers)||void 0===r?void 0:r[0])||void 0===n?void 0:n.nightlyRate,c,l]})))}})),Dt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var r={},n={},o=0,a=e.length;o<a;)n[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(n,i)||(r[i]=t[i]);return r}}));function At(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=Pr[e],a=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Rt(e){return!!e&&!!e[Sr]}function Nt(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Er}(e)||Array.isArray(e)||!!e[Ir]||!!e.constructor[Ir]||Ht(e)||Wt(e))}function Mt(e,t,r){void 0===r&&(r=!1),0===Ut(e)?(r?Object.keys:kr)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function Ut(e){var t=e[Sr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ht(e)?2:Wt(e)?3:0}function Bt(e,t){return 2===Ut(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Lt(e,t){return 2===Ut(e)?e.get(t):e[t]}function qt(e,t,r){var n=Ut(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Ft(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ht(e){return _r&&e instanceof Map}function Wt(e){return wr&&e instanceof Set}function zt(e){return e.o||e.t}function Yt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=jr(e);delete t[Sr];for(var r=kr(t),n=0;n<r.length;n++){var o=r[n],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Kt(e,t){return void 0===t&&(t=!1),Gt(e)||Rt(e)||!Nt(e)||(Ut(e)>1&&(e.set=e.add=e.clear=e.delete=Vt),Object.freeze(e),t&&Mt(e,(function(e,t){return Kt(t,!0)}),!0)),e}function Vt(){At(2)}function Gt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Jt(e){var t=Cr[e];return t||At(18,e),t}function Qt(e,t){Cr[e]||(Cr[e]=t)}function Xt(){return"production"===process.env.NODE_ENV||mr||At(0),mr}function $t(e,t){t&&(Jt("Patches"),e.u=[],e.s=[],e.v=t)}function Zt(e){er(e),e.p.forEach(rr),e.p=null}function er(e){e===mr&&(mr=e.l)}function tr(e){return mr={p:[],l:mr,h:e,m:!0,_:0}}function rr(e){var t=e[Sr];0===t.i||1===t.i?t.j():t.O=!0}function nr(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||Jt("ES5").S(t,e,n),n?(r[Sr].P&&(Zt(t),At(4)),Nt(e)&&(e=or(t,e),t.l||ir(t,e)),t.u&&Jt("Patches").M(r[Sr],e,t.u,t.s)):e=or(t,r,[]),Zt(t),t.u&&t.v(t.u,t.s),e!==Tr?e:void 0}function or(e,t,r){if(Gt(t))return t;var n=t[Sr];if(!n)return Mt(t,(function(o,a){return ar(e,n,t,o,a,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ir(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=Yt(n.k):n.o;Mt(3===n.i?new Set(o):o,(function(t,a){return ar(e,n,o,t,a,r)})),ir(e,o,!1),r&&e.u&&Jt("Patches").R(n,r,e.u,e.s)}return n.o}function ar(e,t,r,n,o,a){if("production"!==process.env.NODE_ENV&&o===r&&At(5),Rt(o)){var i=or(e,o,a&&t&&3!==t.i&&!Bt(t.D,n)?a.concat(n):void 0);if(qt(r,n,i),!Rt(i))return;e.m=!1}if(Nt(o)&&!Gt(o)){if(!e.h.F&&e._<1)return;or(e,o),t&&t.A.l||ir(e,o)}}function ir(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Kt(t,r)}function ur(e,t){var r=e[Sr];return(r?zt(r):e)[t]}function sr(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function cr(e){e.P||(e.P=!0,e.l&&cr(e.l))}function lr(e){e.o||(e.o=Yt(e.t))}function fr(e,t,r){var n=Ht(t)?Jt("MapSet").N(t,r):Wt(t)?Jt("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Xt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,a=Dr;r&&(o=[n],a=Ar);var i=Proxy.revocable(o,a),u=i.revoke,s=i.proxy;return n.k=s,n.j=u,s}(t,r):Jt("ES5").J(t,r);return(r?r.A:Xt()).p.push(n),n}function dr(e){return Rt(e)||At(22,e),function e(t){if(!Nt(t))return t;var r,n=t[Sr],o=Ut(t);if(n){if(!n.P&&(n.i<4||!Jt("ES5").K(n)))return n.t;n.I=!0,r=hr(t,o),n.I=!1}else r=hr(t,o);return Mt(r,(function(t,o){n&&Lt(n.t,t)===o||qt(r,t,e(o))})),3===o?new Set(r):r}(e)}function hr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Yt(e)}function pr(){function e(e,t){var r=a[e];return r?r.enumerable=t:a[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[Sr];return"production"!==process.env.NODE_ENV&&o(t),Dr.get(t,e)},set:function(t){var r=this[Sr];"production"!==process.env.NODE_ENV&&o(r),Dr.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Sr];if(!o.P)switch(o.i){case 5:n(o)&&cr(o);break;case 4:r(o)&&cr(o)}}}function r(e){for(var t=e.t,r=e.k,n=kr(r),o=n.length-1;o>=0;o--){var a=n[o];if(a!==Sr){var i=t[a];if(void 0===i&&!Bt(t,a))return!0;var u=r[a],s=u&&u[Sr];if(s?s.t!==i:!Ft(u,i))return!0}}var c=!!t[Sr];return n.length!==kr(t).length+(c?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}function o(e){e.O&&At(3,JSON.stringify(zt(e)))}var a={};Qt("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var a=jr(r);delete a[Sr];for(var i=kr(a),u=0;u<i.length;u++){var s=i[u];a[s]=e(s,t||!!a[s].enumerable)}return Object.create(Object.getPrototypeOf(r),a)}(n,t),a={i:n?5:4,A:r?r.A:Xt(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Sr,{value:a,writable:!0}),o},S:function(e,r,o){o?Rt(r)&&r[Sr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[Sr];if(r){var o=r.t,a=r.k,i=r.D,u=r.i;if(4===u)Mt(a,(function(t){t!==Sr&&(void 0!==o[t]||Bt(o,t)?i[t]||e(a[t]):(i[t]=!0,cr(r)))})),Mt(o,(function(e){void 0!==a[e]||Bt(a,e)||(i[e]=!1,cr(r))}));else if(5===u){if(n(r)&&(cr(r),i.length=!0),a.length<o.length)for(var s=a.length;s<o.length;s++)i[s]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function gr(){function e(t){if(!Nt(t))return t;if(Array.isArray(t))return t.map(e);if(Ht(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(Wt(t))return new Set(Array.from(t).map(e));var r=Object.create(Object.getPrototypeOf(t));for(var n in t)r[n]=e(t[n]);return Bt(t,Ir)&&(r[Ir]=t[Ir]),r}function t(t){return Rt(t)?e(t):t}var r="add";Qt("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,a=n.op,i=t,u=0;u<o.length-1;u++){var s=Ut(i),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||At(24),"function"==typeof i&&"prototype"===c&&At(24),"object"!=typeof(i=Lt(i,c))&&At(15,o.join("/"))}var l=Ut(i),f=e(n.value),d=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(d,f);case 3:At(16);default:return i[d]=f}case r:switch(l){case 1:return i.splice(d,0,f);case 2:return i.set(d,f);case 3:return i.add(f);default:return i[d]=f}case"remove":switch(l){case 1:return i.splice(d,1);case 2:return i.delete(d);case 3:return i.delete(n.value);default:return delete i[d]}default:At(17,a)}})),t},R:function(e,n,o,a){switch(e.i){case 0:case 4:case 2:return function(e,n,o,a){var i=e.t,u=e.o;Mt(e.D,(function(e,s){var c=Lt(i,e),l=Lt(u,e),f=s?Bt(i,e)?"replace":r:"remove";if(c!==l||"replace"!==f){var d=n.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===r?{op:"remove",path:d}:"remove"===f?{op:r,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,n,o,a);case 5:case 1:return function(e,n,o,a){var i=e.t,u=e.D,s=e.o;if(s.length<i.length){var c=[s,i];i=c[0],s=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(u[f]&&s[f]!==i[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(s[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<s.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(s[h])})}i.length<s.length&&a.push({op:"replace",path:n.concat(["length"]),value:i.length})}(e,n,o,a);case 3:return function(e,t,n,o){var a=e.t,i=e.o,u=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);n.push({op:"remove",path:a,value:e}),o.unshift({op:r,path:a,value:e})}u++})),u=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);n.push({op:r,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}u++}))}(e,n,o,a)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===Tr?void 0:t}),n.push({op:"replace",path:[],value:e.t})}})}function vr(){function e(e,t){function r(){this.constructor=e}o(e,t),e.prototype=(r.prototype=t.prototype,new r)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function r(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(Nt(t)){var r=fr(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&At(3,JSON.stringify(zt(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},a=function(){function r(e,t){return this[Sr]={i:2,l:t,A:t?t.A:Xt(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(r,Map);var o=r.prototype;return Object.defineProperty(o,"size",{get:function(){return zt(this[Sr]).size}}),o.has=function(e){return zt(this[Sr]).has(e)},o.set=function(e,r){var o=this[Sr];return n(o),zt(o).has(e)&&zt(o).get(e)===r||(t(o),cr(o),o.D.set(e,!0),o.o.set(e,r),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var r=this[Sr];return n(r),t(r),cr(r),r.D.set(e,!1),r.o.delete(e),!0},o.clear=function(){var e=this[Sr];n(e),zt(e).size&&(t(e),cr(e),e.D=new Map,Mt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;zt(this[Sr]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[Sr];n(r);var o=zt(r).get(e);if(r.I||!Nt(o))return o;if(o!==r.t.get(e))return o;var a=fr(r.A.h,o,r);return t(r),r.o.set(e,a),a},o.keys=function(){return zt(this[Sr]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[xr]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,r=this.keys();return(e={})[xr]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},o[xr]=function(){return this.entries()},r}(),i=function(){function t(e,t){return this[Sr]={i:3,l:t,A:t?t.A:Xt(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return zt(this[Sr]).size}}),o.has=function(e){var t=this[Sr];return n(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[Sr];return n(t),this.has(e)||(r(t),cr(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Sr];return n(t),r(t),cr(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Sr];n(e),zt(e).size&&(r(e),cr(e),e.o.clear())},o.values=function(){var e=this[Sr];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[Sr];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[xr]=function(){return this.values()},o.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},t}();Qt("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var yr,mr,br="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),_r="undefined"!=typeof Map,wr="undefined"!=typeof Set,Or="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Tr=br?Symbol.for("immer-nothing"):((yr={})["immer-nothing"]=!0,yr),Ir=br?Symbol.for("immer-draftable"):"__$immer_draftable",Sr=br?Symbol.for("immer-state"):"__$immer_state",xr="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Pr={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Er=""+Object.prototype.constructor,kr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,jr=Object.getOwnPropertyDescriptors||function(e){var t={};return kr(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Cr={},Dr={get:function(e,t){if(t===Sr)return e;var r=zt(e);if(!Bt(r,t))return function(e,t,r){var n,o=sr(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!Nt(n)?n:n===ur(e.t,t)?(lr(e),e.o[t]=fr(e.A.h,n,e)):n},has:function(e,t){return t in zt(e)},ownKeys:function(e){return Reflect.ownKeys(zt(e))},set:function(e,t,r){var n=sr(zt(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ur(zt(e),t),a=null==o?void 0:o[Sr];if(a&&a.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(Ft(r,o)&&(void 0!==r||Bt(e.t,t)))return!0;lr(e),cr(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==ur(e.t,t)||t in e.t?(e.D[t]=!1,lr(e),cr(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=zt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){At(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){At(12)}},Ar={};Mt(Dr,(function(e,t){Ar[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ar.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&At(13),Dr.deleteProperty.call(this,e[0],t)},Ar.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&At(14),Dr.set.call(this,e[0],t,r,e[0])};var Rr=function(){function e(e){var t=this;this.g=Or,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,i=Array(n>1?n-1:0),u=1;u<n;u++)i[u-1]=arguments[u];return a.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var i;if("function"!=typeof r&&At(6),void 0!==n&&"function"!=typeof n&&At(7),Nt(e)){var u=tr(t),s=fr(t,e,void 0),c=!0;try{i=r(s),c=!1}finally{c?Zt(u):er(u)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return $t(u,n),nr(e,u)}),(function(e){throw Zt(u),e})):($t(u,n),nr(i,u))}if(!e||"object"!=typeof e){if((i=r(e))===Tr)return;return void 0===i&&(i=e),t.F&&Kt(i,!0),i}At(21,e)},this.produceWithPatches=function(e,r){return"function"==typeof e?function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,r,(function(e,t){n=e,o=t})),n,o];var n,o},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Nt(e)||At(8),Rt(e)&&(e=dr(e));var t=tr(this),r=fr(this,e,void 0);return r[Sr].C=!0,er(t),r},t.finishDraft=function(e,t){var r=e&&e[Sr];"production"!==process.env.NODE_ENV&&(r&&r.C||At(9),r.I&&At(10));var n=r.A;return $t(n,t),nr(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Or&&At(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}var o=Jt("Patches").$;return Rt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(r+1))}))},e}(),Nr=new Rr,Mr=Nr.produce,Ur=Nr.produceWithPatches.bind(Nr),Br=Nr.setAutoFreeze.bind(Nr),Lr=Nr.setUseProxies.bind(Nr),qr=Nr.applyPatches.bind(Nr),Fr=Nr.createDraft.bind(Nr),Hr=Nr.finishDraft.bind(Nr),Wr=r(Object.freeze({__proto__:null,default:Mr,Immer:Rr,applyPatches:qr,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:Fr,current:dr,enableAllPlugins:function(){pr(),vr(),gr()},enableES5:pr,enableMapSet:vr,enablePatches:gr,finishDraft:Hr,freeze:Kt,immerable:Ir,isDraft:Rt,isDraftable:Nt,nothing:Tr,original:function(e){return Rt(e)||At(23,e),e[Sr].t},produce:Mr,produceWithPatches:Ur,setAutoFreeze:Br,setUseProxies:Lr})),zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=Wr.produce(t,e)}}}})),Yr=t((function(e,t){e.exports=function e(t,r,o){function a(u,s){if(!r[u]){if(!t[u]){if(!s&&n)return n();if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=r[u]={exports:{}};t[u][0].call(c.exports,(function(e){return a(t[u][1][e]||e)}),c,c.exports,e,t,r,o)}return r[u].exports}for(var i=n,u=0;u<o.length;u++)a(o[u]);return a}({1:[function(e,t,r){(function(n,o,a,i,u,s,c,l,f){var d=e("crypto");function h(e,t){return function(e,t){var r;if(void 0===(r="passthrough"!==t.algorithm?d.createHash(t.algorithm):new b).write&&(r.write=r.update,r.end=r.update),m(t,r).dispatch(e),r.update||r.end(""),r.digest)return r.digest("buffer"===t.encoding?void 0:t.encoding);var n=r.read();return"buffer"!==t.encoding?n.toString(t.encoding):n}(e,t=v(e,t))}(r=t.exports=h).sha1=function(e){return h(e)},r.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(e){return h(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=d.getHashes?d.getHashes().slice():["sha1","md5"];p.push("passthrough");var g=["buffer","hex","binary","base64"];function v(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=!0===t.ignoreUnknown,r.respectType=!1!==t.respectType,r.respectFunctionNames=!1!==t.respectFunctionNames,r.respectFunctionProperties=!1!==t.respectFunctionProperties,r.unorderedArrays=!0===t.unorderedArrays,r.unorderedSets=!1!==t.unorderedSets,r.unorderedObjects=!1!==t.unorderedObjects,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var n=0;n<p.length;++n)p[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=p[n]);if(-1===p.indexOf(r.algorithm))throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(r.encoding)&&"passthrough"!==r.algorithm)throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+g.join(", "));return r}function y(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function m(e,t,r){function n(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return r=r||[],{dispatch:function(t){return e.replacer&&(t=e.replacer(t)),this["_"+(null===t?"null":typeof t)](t)},_object:function(t){var o,i=Object.prototype.toString.call(t),u=/\[object (.*)\]/i.exec(i);if(u=(u=u?u[1]:"unknown:["+i+"]").toLowerCase(),0<=(o=r.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(r.push(t),void 0!==a&&a.isBuffer&&a.isBuffer(t))return n("buffer:"),n(t);if("object"===u||"function"===u||"asyncfunction"===u){var s=Object.keys(t);e.unorderedObjects&&(s=s.sort()),!1===e.respectType||y(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter((function(t){return!e.excludeKeys(t)}))),n("object:"+s.length+":");var c=this;return s.forEach((function(r){c.dispatch(r),n(":"),e.excludeValues||c.dispatch(t[r]),n(",")}))}if(!this["_"+u]){if(e.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}this["_"+u](t)},_array:function(t,o){o=void 0!==o?o:!1!==e.unorderedArrays;var a=this;if(n("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return a.dispatch(e)}));var i=[],u=t.map((function(t){var n=new b,o=r.slice();return m(e,n,o).dispatch(t),i=i.concat(o.slice(r.length)),n.read().toString()}));return r=r.concat(i),u.sort(),this._array(u,!1)},_date:function(e){return n("date:"+e.toJSON())},_symbol:function(e){return n("symbol:"+e.toString())},_error:function(e){return n("error:"+e.toString())},_boolean:function(e){return n("bool:"+e.toString())},_string:function(e){n("string:"+e.length+":"),n(e.toString())},_function:function(t){n("fn:"),y(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return n("number:"+e.toString())},_xml:function(e){return n("xml:"+e.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(e){return n("regex:"+e.toString())},_uint8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return n("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return n("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return n("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return n("url:"+e.toString())},_map:function(t){n("map:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_set:function(t){n("set:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_file:function(e){return n("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return n("domwindow")},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function b(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}r.writeToStream=function(e,t,r){return void 0===r&&(r=t,t={}),m(t=v(e,t),r).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_5812b7fb.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,r){(function(e,t,n,o,a,i,u,s,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,r="+".charCodeAt(0),n="/".charCodeAt(0),o="0".charCodeAt(0),a="a".charCodeAt(0),i="A".charCodeAt(0),u="-".charCodeAt(0),s="_".charCodeAt(0);function c(e){var t=e.charCodeAt(0);return t===r||t===u?62:t===n||t===s?63:t<o?-1:t<o+10?t-o+26+26:t<i+26?t-i:t<a+26?t-a+26:void 0}e.toByteArray=function(e){var r,n;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length,a="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,i=new t(3*e.length/4-a),u=0<a?e.length-4:e.length,s=0;function l(e){i[s++]=e}for(r=0;r<u;r+=4,0)l((16711680&(n=c(e.charAt(r))<<18|c(e.charAt(r+1))<<12|c(e.charAt(r+2))<<6|c(e.charAt(r+3))))>>16),l((65280&n)>>8),l(255&n);return 2==a?l(255&(n=c(e.charAt(r))<<2|c(e.charAt(r+1))>>4)):1==a&&(l((n=c(e.charAt(r))<<10|c(e.charAt(r+1))<<4|c(e.charAt(r+2))>>2)>>8&255),l(255&n)),i},e.fromByteArray=function(e){var t,r,n,o,a=e.length%3,i="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-a;t<n;t+=3)i+=u((o=r=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(a){case 1:i+=u((r=e[e.length-1])>>2),i+=u(r<<4&63),i+="==";break;case 2:i+=u((r=(e[e.length-2]<<8)+e[e.length-1])>>10),i+=u(r>>4&63),i+=u(r<<2&63),i+="="}return i}}(void 0===r?this.base64js={}:r)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,r){(function(t,n,o,a,i,u,s,c,l){var f=e("base64-js"),d=e("ieee754");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var n,a,i,u,s,c=typeof e;if("base64"===t&&"string"==c)for(e=(n=e).trim?n.trim():n.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)a=j(e);else if("string"==c)a=o.byteLength(e,t);else{if("object"!=c)throw new Error("First argument needs to be a number, array or string.");a=j(e.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(a)):((i=this).length=a,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(C(s=e)||o.isBuffer(s)||s&&"object"==typeof s&&"number"==typeof s.length)for(u=0;u<a;u++)o.isBuffer(e)?i[u]=e.readUInt8(u):i[u]=e[u];else if("string"==c)i.write(e,0,t);else if("number"==c&&!o._useTypedArrays&&!r)for(u=0;u<a;u++)i[u]=0;return i}function h(e,t,r,n){return o._charsWritten=N(function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function p(e,t,r,n){return o._charsWritten=N(function(e){for(var t,r,n,o=[],a=0;a<e.length;a++)r=(t=e.charCodeAt(a))>>8,n=t%256,o.push(n),o.push(r);return o}(t),e,r,n)}function g(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;o++)n+=String.fromCharCode(e[o]);return n}function v(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return r?(o=e[t],t+1<a&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<a&&(o|=e[t+1])),o}function y(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return r?(t+2<a&&(o=e[t+2]<<16),t+1<a&&(o|=e[t+1]<<8),o|=e[t],t+3<a&&(o+=e[t+3]<<24>>>0)):(t+1<a&&(o=e[t+1]<<16),t+2<a&&(o|=e[t+2]<<8),t+3<a&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function m(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=v(e,t,r,!0);return 32768&o?-1*(65535-o+1):o}}function b(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=y(e,t,r,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function _(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,23,4)}function w(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,52,8)}function O(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+1<e.length,"trying to write beyond buffer length"),U(t,65535));var a=e.length;if(!(a<=r))for(var i=0,u=Math.min(a-r,2);i<u;i++)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function T(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var a=e.length;if(!(a<=r))for(var i=0,u=Math.min(a-r,4);i<u;i++)e[r+i]=t>>>8*(n?i:3-i)&255}function I(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=r||O(e,0<=t?t:65535+t+1,r,n,o)}function S(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=r||T(e,0<=t?t:4294967295+t+1,r,n,o)}function x(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),L(t,34028234663852886e22,-34028234663852886e22)),e.length<=r||d.write(e,t,r,n,23,4)}function P(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+7<e.length,"Trying to write beyond buffer length"),L(t,17976931348623157e292,-17976931348623157e292)),e.length<=r||d.write(e,t,r,n,52,8)}r.Buffer=o,r.SlowBuffer=o,r.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=A(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=R(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},o.concat=function(e,t){if(q(C(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];if("number"!=typeof t)for(a=t=0;a<e.length;a++)t+=e[a].length;for(var r=new o(t),n=0,a=0;a<e.length;a++){var i=e[a];i.copy(r,n),n+=i.length}return r},o.prototype.write=function(e,t,r,n){var a;isFinite(t)?isFinite(r)||(n=r,r=void 0):(a=n,n=t,t=r,r=a),t=Number(t)||0;var i,u,s,c,l,f,d,g,v,y=this.length-t;switch((!r||y<(r=Number(r)))&&(r=y),n=String(n||"utf8").toLowerCase()){case"hex":i=function(e,t,r,n){r=Number(r)||0;var a=e.length-r;(!n||a<(n=Number(n)))&&(n=a);var i=t.length;q(i%2==0,"Invalid hex string"),i/2<n&&(n=i/2);for(var u=0;u<n;u++){var s=parseInt(t.substr(2*u,2),16);q(!isNaN(s),"Invalid hex string"),e[r+u]=s}return o._charsWritten=2*u,u}(this,e,t,r);break;case"utf8":case"utf-8":f=this,d=e,g=t,v=r,i=o._charsWritten=N(A(d),f,g,v);break;case"ascii":case"binary":i=h(this,e,t,r);break;case"base64":u=this,s=e,c=t,l=r,i=o._charsWritten=N(R(s),u,c,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=p(this,e,t,r);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(e,t,r){var n,o,a,i,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(r=void 0!==r?Number(r):r=u.length)===t)return"";switch(e){case"hex":n=function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||n<r)&&(r=n);for(var o="",a=t;a<r;a++)o+=D(e[a]);return o}(u,t,r);break;case"utf8":case"utf-8":n=function(e,t,r){var n="",o="";r=Math.min(e.length,r);for(var a=t;a<r;a++)e[a]<=127?(n+=M(o)+String.fromCharCode(e[a]),o=""):o+="%"+e[a].toString(16);return n+M(o)}(u,t,r);break;case"ascii":case"binary":n=g(u,t,r);break;case"base64":o=u,i=r,n=0===(a=t)&&i===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(a,i));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=function(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}(u,t,r);break;default:throw new Error("Unknown encoding")}return n},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t=t||0,n!==r&&0!==e.length&&0!==this.length){q(r<=n,"sourceEnd < sourceStart"),q(0<=t&&t<e.length,"targetStart out of bounds"),q(0<=r&&r<this.length,"sourceStart out of bounds"),q(0<=n&&n<=this.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(a<100||!o._useTypedArrays)for(var i=0;i<a;i++)e[i+t]=this[i+r];else e._set(this.subarray(r,r+a),t)}},o.prototype.slice=function(e,t){var r=this.length;if(e=k(e,r,0),t=k(t,r,r),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var n=t-e,a=new o(n,void 0,!0),i=0;i<n;i++)a[i]=this[i+e];return a},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||(q(null!=e,"missing offset"),q(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(q(null!=e,"missing offset"),q(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return _(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return _(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,r){r||(q(null!=e,"missing value"),q(null!=t,"missing offset"),q(t<this.length,"trying to write beyond buffer length"),U(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,r){O(this,e,t,!0,r)},o.prototype.writeUInt16BE=function(e,t,r){O(this,e,t,!1,r)},o.prototype.writeUInt32LE=function(e,t,r){T(this,e,t,!0,r)},o.prototype.writeUInt32BE=function(e,t,r){T(this,e,t,!1,r)},o.prototype.writeInt8=function(e,t,r){r||(q(null!=e,"missing value"),q(null!=t,"missing offset"),q(t<this.length,"Trying to write beyond buffer length"),B(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},o.prototype.writeInt16LE=function(e,t,r){I(this,e,t,!0,r)},o.prototype.writeInt16BE=function(e,t,r){I(this,e,t,!1,r)},o.prototype.writeInt32LE=function(e,t,r){S(this,e,t,!0,r)},o.prototype.writeInt32BE=function(e,t,r){S(this,e,t,!1,r)},o.prototype.writeFloatLE=function(e,t,r){x(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){x(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){P(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){P(this,e,t,!1,r)},o.prototype.fill=function(e,t,r){if(e=e||0,t=t||0,r=r||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),q("number"==typeof e&&!isNaN(e),"value is not a number"),q(t<=r,"end < start"),r!==t&&0!==this.length){q(0<=t&&t<this.length,"start out of bounds"),q(0<=r&&r<=this.length,"end out of bounds");for(var n=t;n<r;n++)this[n]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,n=0;n<t;n++)if(e[n]=D(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;t<r;t+=1)e[t]=this[t];return e.buffer};var E=o.prototype;function k(e,t,r){return"number"!=typeof e?r:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function j(e){return(e=~~Math.ceil(+e))<0?0:e}function C(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t.push(e.charCodeAt(r));else{var o=r;55296<=n&&n<=57343&&r++;for(var a=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),i=0;i<a.length;i++)t.push(parseInt(a[i],16))}}return t}function R(e){return f.toByteArray(e)}function N(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function U(e,t){q("number"==typeof e,"cannot write a non-number as a number"),q(0<=e,"specified a negative value for writing an unsigned value"),q(e<=t,"value is larger than maximum value for type"),q(Math.floor(e)===e,"value has a fractional component")}function B(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(r<=e,"value smaller than minimum allowed value"),q(Math.floor(e)===e,"value has a fractional component")}function L(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(r<=e,"value smaller than minimum allowed value")}function q(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=E.get,e.set=E.set,e.write=E.write,e.toString=E.toString,e.toLocaleString=E.toString,e.toJSON=E.toJSON,e.copy=E.copy,e.slice=E.slice,e.readUInt8=E.readUInt8,e.readUInt16LE=E.readUInt16LE,e.readUInt16BE=E.readUInt16BE,e.readUInt32LE=E.readUInt32LE,e.readUInt32BE=E.readUInt32BE,e.readInt8=E.readInt8,e.readInt16LE=E.readInt16LE,e.readInt16BE=E.readInt16BE,e.readInt32LE=E.readInt32LE,e.readInt32BE=E.readInt32BE,e.readFloatLE=E.readFloatLE,e.readFloatBE=E.readFloatBE,e.readDoubleLE=E.readDoubleLE,e.readDoubleBE=E.readDoubleBE,e.writeUInt8=E.writeUInt8,e.writeUInt16LE=E.writeUInt16LE,e.writeUInt16BE=E.writeUInt16BE,e.writeUInt32LE=E.writeUInt32LE,e.writeUInt32BE=E.writeUInt32BE,e.writeInt8=E.writeInt8,e.writeInt16LE=E.writeInt16LE,e.writeInt16BE=E.writeInt16BE,e.writeInt32LE=E.writeInt32LE,e.writeInt32BE=E.writeInt32BE,e.writeFloatLE=E.writeFloatLE,e.writeFloatBE=E.writeFloatBE,e.writeDoubleLE=E.writeDoubleLE,e.writeDoubleBE=E.writeDoubleBE,e.fill=E.fill,e.inspect=E.inspect,e.toArrayBuffer=E.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){o=e("buffer").Buffer;var f=4,d=new o(f);d.fill(0),t.exports={hash:function(e,t,r,n){return o.isBuffer(e)||(e=new o(e)),function(e,t,r){for(var n=new o(t),a=r?n.writeInt32BE:n.writeInt32LE,i=0;i<e.length;i++)a.call(n,e[i],4*i,!0);return n}(t(function(e,t){var r;e.length%f!=0&&(r=e.length+(f-e.length%f),e=o.concat([e,d],r));for(var n=[],a=t?e.readInt32BE:e.readInt32LE,i=0;i<e.length;i+=f)n.push(a.call(e,i));return n}(e,n),8*e.length),r,n)}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,r){(function(t,n,o,a,i,u,s,c,l){o=e("buffer").Buffer;var f=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:f,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var r=p[e=e||"sha1"],n=[];return r||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),n.push(e),e.length,this},digest:function(e){var a=o.concat(n),i=t?function(e,t,r){o.isBuffer(t)||(t=new o(t)),o.isBuffer(r)||(r=new o(r)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var n=new o(g),a=new o(g),i=0;i<g;i++)n[i]=54^t[i],a[i]=92^t[i];var u=e(o.concat([n,r]));return e(o.concat([a,u]))}(r,t,a):r(a);return n=null,e?i.toString(e):i}}}function m(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}v.fill(0),r.createHash=function(e){return y(e)},r.createHmac=y,r.randomBytes=function(e,t){if(!t||!t.call)return new o(h(e));try{t.call(this,void 0,new o(h(e)))}catch(e){t(e)}},function(e,t){for(var r in e)t(e[r],r)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){r[e]=function(){m("sorry,",e,"is not implemented yet")}}))}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=r,s=n,c=o,l=a;r=p(r,n,o,a,e[i+0],7,-680876936),a=p(a,r,n,o,e[i+1],12,-389564586),o=p(o,a,r,n,e[i+2],17,606105819),n=p(n,o,a,r,e[i+3],22,-1044525330),r=p(r,n,o,a,e[i+4],7,-176418897),a=p(a,r,n,o,e[i+5],12,1200080426),o=p(o,a,r,n,e[i+6],17,-1473231341),n=p(n,o,a,r,e[i+7],22,-45705983),r=p(r,n,o,a,e[i+8],7,1770035416),a=p(a,r,n,o,e[i+9],12,-1958414417),o=p(o,a,r,n,e[i+10],17,-42063),n=p(n,o,a,r,e[i+11],22,-1990404162),r=p(r,n,o,a,e[i+12],7,1804603682),a=p(a,r,n,o,e[i+13],12,-40341101),o=p(o,a,r,n,e[i+14],17,-1502002290),r=g(r,n=p(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=g(a,r,n,o,e[i+6],9,-1069501632),o=g(o,a,r,n,e[i+11],14,643717713),n=g(n,o,a,r,e[i+0],20,-373897302),r=g(r,n,o,a,e[i+5],5,-701558691),a=g(a,r,n,o,e[i+10],9,38016083),o=g(o,a,r,n,e[i+15],14,-660478335),n=g(n,o,a,r,e[i+4],20,-405537848),r=g(r,n,o,a,e[i+9],5,568446438),a=g(a,r,n,o,e[i+14],9,-1019803690),o=g(o,a,r,n,e[i+3],14,-187363961),n=g(n,o,a,r,e[i+8],20,1163531501),r=g(r,n,o,a,e[i+13],5,-1444681467),a=g(a,r,n,o,e[i+2],9,-51403784),o=g(o,a,r,n,e[i+7],14,1735328473),r=v(r,n=g(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=v(a,r,n,o,e[i+8],11,-2022574463),o=v(o,a,r,n,e[i+11],16,1839030562),n=v(n,o,a,r,e[i+14],23,-35309556),r=v(r,n,o,a,e[i+1],4,-1530992060),a=v(a,r,n,o,e[i+4],11,1272893353),o=v(o,a,r,n,e[i+7],16,-155497632),n=v(n,o,a,r,e[i+10],23,-1094730640),r=v(r,n,o,a,e[i+13],4,681279174),a=v(a,r,n,o,e[i+0],11,-358537222),o=v(o,a,r,n,e[i+3],16,-722521979),n=v(n,o,a,r,e[i+6],23,76029189),r=v(r,n,o,a,e[i+9],4,-640364487),a=v(a,r,n,o,e[i+12],11,-421815835),o=v(o,a,r,n,e[i+15],16,530742520),r=y(r,n=v(n,o,a,r,e[i+2],23,-995338651),o,a,e[i+0],6,-198630844),a=y(a,r,n,o,e[i+7],10,1126891415),o=y(o,a,r,n,e[i+14],15,-1416354905),n=y(n,o,a,r,e[i+5],21,-57434055),r=y(r,n,o,a,e[i+12],6,1700485571),a=y(a,r,n,o,e[i+3],10,-1894986606),o=y(o,a,r,n,e[i+10],15,-1051523),n=y(n,o,a,r,e[i+1],21,-2054922799),r=y(r,n,o,a,e[i+8],6,1873313359),a=y(a,r,n,o,e[i+15],10,-30611744),o=y(o,a,r,n,e[i+6],15,-1560198380),n=y(n,o,a,r,e[i+13],21,1309151649),r=y(r,n,o,a,e[i+4],6,-145523070),a=y(a,r,n,o,e[i+11],10,-1120210379),o=y(o,a,r,n,e[i+2],15,718787259),n=y(n,o,a,r,e[i+9],21,-343485551),r=m(r,u),n=m(n,s),o=m(o,c),a=m(a,l)}return Array(r,n,o,a)}function h(e,t,r,n,o,a){return m((i=m(m(t,e),m(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function p(e,t,r,n,o,a,i){return h(t&r|~t&n,e,t,o,a,i)}function g(e,t,r,n,o,a,i){return h(t&n|r&~n,e,t,o,a,i)}function v(e,t,r,n,o,a,i){return h(t^r^n,e,t,o,a,i)}function y(e,t,r,n,o,a,i){return h(r^(t|~n),e,t,o,a,i)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,r){(function(e,r,n,o,a,i,u,s,c){var l;l=function(e){for(var t,r=new Array(e),n=0;n<e;n++)0==(3&n)&&(t=4294967296*Math.random()),r[n]=t>>>((3&n)<<3)&255;return r},t.exports=l}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,o,a,i,u=Array(80),s=1732584193,c=-271733879,l=-1732584194,f=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=s,y=c,m=l,b=f,_=d,w=0;w<80;w++){u[w]=w<16?e[g+w]:p(u[w-3]^u[w-8]^u[w-14]^u[w-16],1);var O=h(h(p(s,5),(o=c,a=l,i=f,(n=w)<20?o&a|~o&i:!(n<40)&&n<60?o&a|o&i|a&i:o^a^i)),h(h(d,u[w]),(r=w)<20?1518500249:r<40?1859775393:r<60?-1894007588:-899497514));d=f,f=l,l=p(c,30),c=s,s=O}s=h(s,v),c=h(c,y),l=h(l,m),f=h(f,b),d=h(d,_)}return Array(s,c,l,f,d)}function h(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var r,n,o,a,i,u,s,c,l,h,p=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var y,m,b,_,w,O,T,I,S=0;S<e.length;S+=16){r=g[0],n=g[1],o=g[2],a=g[3],i=g[4],u=g[5],s=g[6],c=g[7];for(var x=0;x<64;x++)v[x]=x<16?e[x+S]:f(f(f(d(I=v[x-2],17)^d(I,19)^I>>>10,v[x-7]),d(T=v[x-15],7)^d(T,18)^T>>>3),v[x-16]),l=f(f(f(f(c,d(O=i,6)^d(O,11)^d(O,25)),(w=i)&u^~w&s),p[x]),v[x]),h=f(d(_=r,2)^d(_,13)^d(_,22),(y=r)&(m=n)^y&(b=o)^m&b),c=s,s=u,u=i,i=f(a,l),a=o,o=n,n=r,r=f(l,h);g[0]=f(r,g[0]),g[1]=f(n,g[1]),g[2]=f(o,g[2]),g[3]=f(a,g[3]),g[4]=f(i,g[4]),g[5]=f(u,g[5]),g[6]=f(s,g[6]),g[7]=f(c,g[7])}return g}var p=e("./helpers");t.exports=function(e){return p.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,r){(function(e,r,n,o,a,i,u,s,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<r.length&&r.shift()())}),!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=l,e.addListener=l,e.once=l,e.off=l,e.removeListener=l,e.removeAllListeners=l,e.emit=l,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,r){(function(e,t,n,o,a,i,u,s,c){r.read=function(e,t,r,n,o){var a,i,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=u;0<l;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;0<l;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,n),a-=c}return(h?-1:1)*i*Math.pow(2,a-n)},r.write=function(e,t,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),2<=(t+=1<=i+f?d/s:d*Math.pow(2,1-f))*s&&(i++,s/=2),l<=i+f?(u=0,i=l):1<=i+f?(u=(t*s-1)*Math.pow(2,o),i+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));8<=o;e[r+h]=255&u,h+=p,u/=256,o-=8);for(i=i<<o|u,c+=o;0<c;e[r+h]=255&i,h+=p,i/=256,c-=8);e[r+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)})),Kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var r=It.__importDefault(Yr);t.generateSearchId=function(e,t){var n=t.anonymousId,o=t.language,a=t.currency,i=t.countryCode;return r.default(It.__assign(It.__assign({},e),{anonymousId:n,language:o,currency:a,countryCode:i}))}})),Vr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,r){var n;if(void 0===(null===(n=e.pricing)||void 0===n?void 0:n.medianRateBkt)||void 0===r)return e;var o=e.pricing.medianRateBkt*r*t,a=(e.pricing.medianRateBkt+1)*r*t;return It.__assign(It.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),Gr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmpty=void 0,t.removeEmpty=function e(t){return Object.entries(t).filter((function(e){e[0];var t=e[1];return null!=t})).reduce((function(t,r){var n,o=r[0],a=r[1];return It.__assign(It.__assign({},t),((n={})[o]=a===new Object(a)?e(a):a,n))}),{})}})),Jr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Q,t),It.__exportStar(X,t),It.__exportStar(jt,t),It.__exportStar(Ct,t),It.__exportStar(Dt,t),It.__exportStar(zr,t),It.__exportStar(Kr,t),It.__exportStar(Vr,t),It.__exportStar(Gr,t)})),Qr=t((function(e,t){function r(e,t,r,n){return!(void 0!==r&&e.nightlyRate<r)&&!(void 0!==n&&n<t&&e.nightlyRate>n)}function n(e,t){var n,o=e.filters,a=void 0===o?{}:o,i=e.priceBucketWidth,u=e.priceBucketsCount,s=e.exchangeRate;if(void 0===i)return t;var c=a.priceMin,l=a.priceMax,f=u*Math.round(i*s);if((void 0!==c||void 0!==l)&&!(null===(n=t.offers)||void 0===n?void 0:n.some((function(e){return r(e,f,c,l)}))))return It.__assign(It.__assign({},t),{offers:[]});return t}function o(e,t){var r=t.sortField,n=t.sortOrder;return"price"===r?function(e,t){return e.sort((function(e,r){var n,o,a=(null!==(n=Jr.getCheapestRate(e))&&void 0!==n?n:0)-(null!==(o=Jr.getCheapestRate(r))&&void 0!==o?o:0);return"ascending"===t?a:-a}))}(e,void 0===n?"ascending":n):e}function a(e){var t=e.topOfferData,r=e.anchorPriceRateBreakdown,n=r.calculatedTotalRate,o=r.nightlyRate;return It.__assign(It.__assign({},t),{anchorPrice:n,anchorPriceNightly:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.augmentRaaResponse=t.augmentHotelOffersWithAnchorPrice=t.augmentOffersWithAnchorPrice=t.augmentTopOfferDataWithAnchorPrice=t.applyPriceFilter=t.isOfferInPriceRange=t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0},t.isOfferInPriceRange=r,t.applyPriceFilter=n,t.augmentTopOfferDataWithAnchorPrice=a;function i(e,t){var r=e.offers;if(!(null==r?void 0:r.length))return r;var n=t.anchorPrice;return void 0===n?r:r.map((function(e){return It.__assign(It.__assign({},e),{hasAnchorPrice:n-e.calculatedTotalRate>.03*n})}))}function u(e){var t=e.anchorPriceRateBreakdown,r=e.topOfferData;if(void 0===t||void 0===r)return e;var n=a(e),o=i(e,n);return It.__assign(It.__assign({},e),{topOfferData:n,offers:o})}t.augmentOffersWithAnchorPrice=i,t.augmentHotelOffersWithAnchorPrice=u,t.augmentRaaResponse=function(e,t){var r,a=e.hotelOfferEntities,i=e.anchorHotelOfferEntity;a&&(r=a.map((function(e){return n(t,e)})),void 0!==t.sortField&&(r=o(r,t)));var s=[],c={};return null==r||r.forEach((function(e){s.push(e.id),c[e.id]=u(e)})),void 0!==i&&(c[i.id]=u(i)),{hotelIds:s,hotelOfferEntities:c}}})),Xr=r(I),$r=r(J),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.raa=void 0;var r,n=It.__importDefault(Xr);!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={}));t.raa=function(e,t){if(void 0===e)throw new TypeError("RAA endpoint must be provided");if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a=new n.default(e,[],{maxRetries:20,WebSocket:t.WebSocket}),i={};function u(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"daedalus",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==i.current&&a.reconnect()}function s(e){t.logger.log({name:"WebsocketError",value:It.__assign(It.__assign({},e),{service:"daedalus"})}),void 0!==i.current&&a.reconnect()}function c(){var e=i.current;void 0!==e&&a.send(e)}function l(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}void 0!==o&&o(t)}return a.addEventListener("open",c),a.addEventListener("close",u),a.addEventListener("error",s),a.addEventListener("message",l),{getOffers:function(e,n){return It.__awaiter(this,void 0,void 0,(function(){var u;return It.__generator(this,(function(s){return u={},i.current=function(e,t){var r,n,o,a,i,u={checkIn:e.checkIn,checkOut:e.checkOut,destination:null!==(n=null===(r=e.hotelIds)||void 0===r?void 0:r.join(","))&&void 0!==n?n:"",getAllOffers:e.getAllOffers,highlightedHotelID:e.anchorHotelId,rooms:e.rooms,cugDeals:null===(o=e.cugDeals)||void 0===o?void 0:o.join(","),profileId:null!==(a=e.originId)&&void 0!==a?a:"default",searchId:e.searchId,useAlternativeRaaKeys:e.useAlternativeRaaKeys,preferredRate:e.preferredRate,trafficSource:e.trafficSource,deviceCategory:t.deviceType,languageCode:t.language,userCountryCode:t.countryCode,currencyCode:t.currency,anonymousId:t.anonymousId,includeLocalTaxes:t.includeLocalTaxes,includeTaxes:t.includeTaxes,skipBackendAugmentation:t.skipBackendAugmentation,facetsEnabled:t.facetsEnabled,sapiCliKey:t.sapiCliKey,sortingBoost:Qr.generateSortingBoost(e),clientRequestId:$r.v4(),roomLimit:1,anchorRoomLimit:2};try{i=JSON.stringify(u)}catch(e){console.log("WEBSOCKET: error serialising query")}return i}(e,t),[2,new Promise((function(t){o=function(r){var o;if(void 0!==r)if(r.status.complete)t(u),i.current=void 0;else{var a=r.results.find((function(t){return t.id===e.anchorHotelId}));a?u.anchorHotelOfferEntity=Jr.omit(["errors"],a):u.hotelOfferEntities=null===(o=r.results)||void 0===o?void 0:o.map((function(e){return Jr.omit(["errors"],e)})),"function"==typeof n&&n(It.__assign({},u))}},a.readyState===r.Open&&void 0!==i.current&&a.send(i.current)}))]}))}))}}}})),en=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Zr,t),It.__exportStar(Qr,t)}));function tn(e){$(1,arguments);var t=Z(e);return t.setHours(0,0,0,0),t}var rn=864e5;function nn(e,t){$(2,arguments);var r=tn(e),n=tn(t),o=r.getTime()-Ye(r),a=n.getTime()-Ye(n);return Math.round((o-a)/rn)}function on(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}var an=r(Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=Z(e),n=Z(t),o=on(r,n),a=Math.abs(nn(r,n));r.setDate(r.getDate()-o*a);var i=on(r,n)===-o,u=o*(a-i);return 0===u?0:u}})),un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pickIndexVariation=t.hitToPlaceSuggest=t.hitToHotelSuggest=t.hitToPlaceTypeAnchor=t.hitToHotelTypeAnchor=t.hitToHotel=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=t.getTagsFilter=t.getCheckInNights=void 0;var r=It.__importDefault(an),n=It.__importDefault(St);function o(e,t){var o=Jr.dateToMiddayUTC(e),a=Jr.dateToMiddayUTC(t);return n.default(o,"yyMMdd")+"-"+r.default(a,o)}function a(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function i(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];if(a(null==e?void 0:e[o]))return e[o]}return""}function u(e,t,r){void 0===r&&(r=", ");var n={};return t.forEach((function(o){var i=(null==e?void 0:e[o])||[];n[o]=i.map((function(r,n){if(a(r))return r;var o=t.find((function(t){var r;return a(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[n])}));return o?e[o][n]:""})).join(""+r)})),i(n,t)}function s(e,t,r){var n={};return t.forEach((function(o){var i=e[o]||[],u=-1===r?void 0:r+1,s=i.slice(r,u).toString();if(a(s))n[o]=s;else{var c=t.find((function(t){var n;return a(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[r])}));n[o]=c?e[c][r]:""}})),i(n,t)}function c(e,t){var r={};return t.forEach((function(n){var o,i=null===(o=e[n])||void 0===o?void 0:o.value;if(a(i))r[n]=i;else{var u=t.find((function(t){var r;return a(null===(r=e[t])||void 0===r?void 0:r.value)}));r[n]=u?e[u].value:""}})),i(r,t)}function l(e,t,r){var n,o=e[t];if(!o){var a=r.indexOf(t),i=null!==(n=r.slice(a).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function f(e,t,r){for(var n={},o=0,a=r;o<a.length;o++){var i=a[o];n[i]=It.__spreadArrays(l(e,i,r),l(t,i,r))}return u(n,r)}function d(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel "+e.objectID+" is missing "+n+" field")}catch(e){r||console.error(e)}return It.__assign(It.__assign({},t),e)}function h(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}t.getCheckInNights=o,t.getTagsFilter=function(e,t){return["tags:-u"+o(e,t)]},t.isNotEmptyOrWhiteSpace=a,t.getTranslatedAttributes=function(e,t){var r=[];return e.forEach((function(e){var n=t.map((function(t){return t+"."+e}));r.push.apply(r,n)})),r},t.toString=i,t.translatedArrayToString=u,t.getStringFromTranslatedArray=s,t.getValueFromTranslatedHightlightResult=c,t.attributeWithFallback=l,t.mergeTranslatedAttributes=f,t.validateHit=d,t.placeTypeToPlaceTypeName=h,t.hitToHotel=function(e,t){var r=d(e,{address:{},placeADName:{},placeDN:{},hotelName:{}}),n=It.__assign(It.__assign({},r),{displayAddress:f(r.address,r.placeADName,t),placeDisplayName:u(r.placeDN,t),hotelName:i(r.hotelName,t)});return Jr.omit(["address","placeDN","placeADName"],n)},t.hitToHotelTypeAnchor=function(e,t){var r=d(e,{hotelName:{},placeDN:{}}),n=It.__assign(It.__assign({},r),{hotelName:i(r.hotelName,t),placeDisplayName:u(r.placeDN,t)});return Jr.omit(["placeADN","placeDN"],n)},t.hitToPlaceTypeAnchor=function(e,t){var r=d(e,{placeName:{},placeDN:{}}),n=It.__assign(It.__assign({},r),{placeName:i(r.placeName,t),placeDisplayName:u(r.placeDN,t)});return Jr.omit(["placeADN","placeDN"],n)},t.hitToHotelSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=a(o)?o+", "+n:n,l=c(r._highlightResult.hotelName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:i(r.hotelName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h()}},t.hitToPlaceSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=a(o)?o+", "+n:n,l=c(r._highlightResult.placeName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:i(r.placeName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h(r.placeType)}},t.pickIndexVariation=function(e,t){var r=e.find((function(e){return e.variationID&&t.includes(e.variationID)}));return null!=r?r:e.find((function(e){return void 0===e.variationID}))}})),sn=t((function(e,t){var r;function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return It.__spreadArrays(["objectType","placeType","placeCategory","objectID","_geoloc","priceBucketWidth","polygon","pageSize"],t)}function o(e){var t=un.getTranslatedAttributes(e,["hotelName","placeADName","placeDN","address"]);return It.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getAnchor=void 0,function(e){e[e.Hotel=0]="Hotel",e[e.Place=1]="Place",e[e.Location=2]="Location",e[e.Query=3]="Query",e[e.Unknown=4]="Unknown"}(r||(r={})),t.getAnchor=function(e,t,a){var i=this,u=e.search,s=t.autocompleteIndex,c=t.hotelIndex,l=a.languages;return function(e){return It.__awaiter(i,void 0,void 0,(function(){var t,a,i,f,d,h,p,g,v,y,m,b,_;return It.__generator(this,(function(w){switch(w.label){case 0:switch(t=function(e){return e.hotelId?r.Hotel:e.placeId?r.Place:e.geolocation?r.Location:e.query?r.Query:r.Unknown}(e),a=e.hotelId,i=e.placeId,f=e.query,d=[],t){case r.Query:d.push({indexName:s,params:{query:f,hitsPerPage:1,attributesToRetrieve:n(l),attributesToHighlight:[]}}),d.push({indexName:c,params:{query:f,hitsPerPage:1,attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case r.Hotel:a&&d.push({indexName:s,params:{facetFilters:[["objectID:hotel:"+a]],attributesToRetrieve:n(l),attributesToHighlight:[]}},{indexName:c,params:{facetFilters:[["objectID:"+a]],attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case r.Place:default:i&&d.push({indexName:s,params:{facetFilters:[["objectID:place:"+i]],attributesToRetrieve:n(l),attributesToHighlight:[]}})}return[4,u(d)];case 1:switch(g=w.sent().results,v=null===(m=g[0])||void 0===m?void 0:m.hits[0],y=null===(b=g[1])||void 0===b?void 0:b.hits[0],null==v?void 0:v.objectType){case"hotel":h=un.hitToHotelTypeAnchor(v,l),p=un.hitToHotel(y,l);break;case"place":default:h=un.hitToPlaceTypeAnchor(v,l)}return[2,{anchor:h,anchorHotel:p,anchorType:null!==(_=null==v?void 0:v.objectType)&&void 0!==_?_:"place"}]}}))}))}}}));var cn=r(Object.freeze({__proto__:null,default:function(e){$(1,arguments);var t=Z(e),r=t.getDay();return 0===r||6===r}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generatePriceFilter=t.generateSortByPriceFilter=void 0;var r=It.__importDefault(an),n=It.__importDefault(cn);t.generateSortByPriceFilter=function(e){for(var t=[],r=e;r>0;--r){var n=100*(e+1-r);t.push("pricing.minRateBkt:"+r+"<score="+n+">")}return t},t.generatePriceFilter=function(e){var t=e.priceMin,o=e.priceMax,a=e.priceBucketWidth,i=e.priceBucketsCount,u=e.checkIn,s=e.checkOut,c=e.margin,l=void 0===c?2:c,f=[];if(void 0===t&&void 0===o||void 0===a)return f;var d=t?Math.floor(t/a)-l:0,h=o?Math.ceil(o/a)+l:i;d<0&&(d=0),h>i&&(h=i);var p=d,g=function(e,t){if(!e||!t)return"pricing.medianRateBkt";var o=Jr.dateToMiddayUTC(e),a=Jr.dateToMiddayUTC(t);return 1===r.default(a,o)?n.default(o)?"pricing.medianRateSaSuBkt":"pricing.medianRateMoFrBkt":"pricing.medianRateBkt"}(u,s);do{f.push(g+":"+p+"<score=10000>"),p++}while(p<=h);return f}})),fn=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===dn}(e)}(e)};var dn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function hn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?mn((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function pn(e,t,r){return e.concat(t).map((function(e){return hn(e,r)}))}function gn(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function vn(e,t){try{return t in e}catch(e){return!1}}function yn(e,t,r){var n={};return r.isMergeableObject(e)&&gn(e).forEach((function(t){n[t]=hn(e[t],r)})),gn(t).forEach((function(o){(function(e,t){return vn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(vn(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return mn;var r=t.customMerge(e);return"function"==typeof r?r:mn}(o,r)(e[o],t[o],r):n[o]=hn(t[o],r))})),n}function mn(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||pn,r.isMergeableObject=r.isMergeableObject||fn,r.cloneUnlessOtherwiseSpecified=hn;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):yn(e,t,r):hn(t,r)}mn.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return mn(e,r,t)}),{})};var bn=mn,_n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=t.PRICE_BUCKET_COUNT=void 0;var r=It.__importDefault(bn);t.PRICE_BUCKET_COUNT=31;var n={daedalus:{raaEndpoint:"wss://d2jxsjsbxzs3ta.cloudfront.net"},sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{search:"search",offers:"ws/offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search",hotel:"1/hotel"}},algolia:{apiKey:"efa703d5c0057a24487bc9bdcb597770",hotelIndex:"prod_hotel_v3",autocompleteIndex:"prod_autocomplete_v2_os000007",lovIndex:"prod_lov_v2",currencyIndex:"prod_curr_v1",hsoIndex:[{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000003_tags"},{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000004_tags2",variationID:"pp000004-tags2-b"}]},client:{features:["offers","search","suggests","configs"],blockedDefaultDates:["2022-02-27"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]}}},o={"findhotel-website":n,"findhotel-website-e2e":It.__assign(It.__assign({},n),{daedalus:{raaEndpoint:void 0},saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-checkout":It.__assign(It.__assign({},n),{client:It.__assign(It.__assign({},n.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":It.__assign(It.__assign({},n),{saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:It.__assign(It.__assign({},n.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-stg":It.__assign(It.__assign({},n),{saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:It.__assign(It.__assign({},n.client),{features:["rooms"]})})};t.getAppConfig=function(e,t){var n=o[e];if(void 0===n)throw new Error("Profile key is not valid");return t&&(n=r.default(n,t)),n.daedalus.raaEndpoint?n:It.__assign(It.__assign({},n),{daedalus:{raaEndpoint:"http:"===(null===location||void 0===location?void 0:location.protocol)?"ws://"+location.host:"https:"===(null===location||void 0===location?void 0:location.protocol)?"wss://"+location.host:""}})}})),wn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.geoSearch=void 0;function r(e){var t=e.anchorHotelId,r=e.checkIn,n=e.checkOut,o=e.filters,a=void 0===o?{}:o,i=a.facilities,u=a.starRating,s=a.propertyTypeId,c=a.themeIds,l=[];if(null==s?void 0:s.length){var f=s.map((function(e){return"propertyTypeId:"+e}));l.push(f)}if(null==i?void 0:i.length){var d=i.map((function(e){return"facilities:"+e}));l.push.apply(l,d)}if(null==c?void 0:c.length){var h=c.map((function(e){return"themeIds:"+e}));l.push.apply(l,h)}if(null==u?void 0:u.length){var p=[];u.forEach((function(e){p.push("starRating:"+Number(e)),p.push("starRating:"+(Number(e)+.5))})),l.push(p)}return t&&l.push("objectID:-"+t),r&&n&&l.push(un.getTagsFilter(r,n)),l}function n(e){var t=e.guestRating;return(null==t?void 0:t.length)?["guestRating.overall>="+t[0]]:[]}function o(e){var t="isDeleted = 0";return e.noHostels&&(t+=" AND propertyTypeId != 5"),t}function a(e,t){var r=e.filters,n=void 0===r?{}:r,o=e.checkIn,a=e.checkOut,i=e.sortField,u=n.priceMin,s=n.priceMax,c=t.hsoFilter,l=t.priceBucketWidth,f=t.exchangeRate,d=It.__spreadArrays(c);if("price"===i){var h=ln.generateSortByPriceFilter(_n.PRICE_BUCKET_COUNT);d=It.__spreadArrays(d,h)}if(u||s){var p=ln.generatePriceFilter({priceMin:u,priceMax:s,checkIn:o,checkOut:a,priceBucketsCount:_n.PRICE_BUCKET_COUNT,priceBucketWidth:l&&l*f});d=It.__spreadArrays(d,p)}return d}var i=["facilities","propertyTypeId","starRating","themeIds","pricing.medianRateBkt","pricing.medianRateMoFrBkt","pricing.medianRateSaSuBkt","pricing.minRateBkt","tags"];t.geoSearch=function(e,t,u){var s=this,c=e.search,l=t.hotelIndex;return function(e){return It.__awaiter(s,void 0,void 0,(function(){var t,s,f,d,h,p,g,v,y,m,b,_,w,O,T,I,S,x,P,E,k,j,C;return It.__generator(this,(function(D){switch(D.label){case 0:return t=e.boundingBox,s=e.polygon,f=e.geolocation,d=e.length,h=void 0===d?u.requestSize:d,p=e.offset,g=void 0===p?0:p,v=e.filters,m={length:h,offset:g,facets:i,attributesToHighlight:[],getRankingInfo:!1,filters:o(y=void 0===v?{}:v),numericFilters:n(y),facetFilters:r(e),attributesToRetrieve:(A=u.languages,R=un.getTranslatedAttributes(A,["hotelName","placeADName","placeDN","address"]),It.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],R)),optionalFilters:a(e,u)},void 0!==y.hotelName&&(m.query=y.hotelName),t?m.insideBoundingBox=[t]:s?m.insidePolygon=s:f&&(m.aroundLatLng=f.lat+", "+f.lon,m.aroundRadius=null!==(x=f.radius)&&void 0!==x?x:2e4,m.aroundPrecision=null!==(P=f.precision)&&void 0!==P?P:5e3),[4,c([{indexName:l,params:m}])];case 1:for(b=D.sent(),_=b.results[0],w=[],O={},T=0,I=_.hits;T<I.length;T++)S=I[T],O[S.objectID]=un.hitToHotel(S,u.languages),w.push(S.objectID);return[2,{hotelIds:w,hotelEntities:O,resultsCount:null!==(E=_.length)&&void 0!==E?E:0,resultsCountTotal:null!==(k=_.nbHits)&&void 0!==k?k:0,offset:null!==(j=_.offset)&&void 0!==j?j:0,facets:null!==(C=_.facets)&&void 0!==C?C:{}}]}var A,R}))}))}}})),On=t((function(e,t){function r(e){return un.getTranslatedAttributes(e,["placeName","hotelName"])}function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return It.__spreadArrays(["objectType","objectID","placeType"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadSuggests=void 0,t.loadSuggests=function(e,t,o){var a=this,i=e.search,u=t.autocompleteIndex,s=o.languages,c=o.suggestsCount,l=void 0===c?6:c;return function(e){return It.__awaiter(a,void 0,void 0,(function(){var t,o,a;return It.__generator(this,(function(c){switch(c.label){case 0:return t=[{indexName:u,params:{query:e,filters:"isDeleted != 1",hitsPerPage:l,attributesToRetrieve:n(s),attributesToHighlight:r(s)}}],[4,i(t)];case 1:return o=c.sent().results,[2,null===(a=o[0])||void 0===a?void 0:a.hits.map((function(e){switch(e.objectType){case"hotel":return un.hitToHotelSuggest(e,s);case"place":default:return un.hitToPlaceSuggest(e,s)}}))]}}))}))}}})),Tn=t((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));e(Tn);var In=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var Sn=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Pn=function(e,t,r){return t&&xn(e.prototype,t),r&&xn(e,r),e};var En=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n};var kn=function(e){if(Array.isArray(e))return En(e)};var jn=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var Cn=function(e,t){if(e){if("string"==typeof e)return En(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?En(e,t):void 0}};var Dn=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var An=Tn((function(e){return kn(e)||jn(e)||Cn(e)||Dn()})),Rn={functions:"Jexl Function",transforms:"Transform"},Nn={ArrayLiteral:function(e){return this.evalArray(e.value)},BinaryExpression:function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(e){return{eval:function(){return t.eval(e)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then((function(e){return r.eval(e[0],e[1])}))},ConditionalExpression:function(e){var t=this;return this.eval(e.test).then((function(r){return r?e.consequent?t.eval(e.consequent):r:t.eval(e.alternate)}))},FilterExpression:function(e){var t=this;return this.eval(e.subject).then((function(r){return e.relative?t._filterRelative(r,e.expr):t._filterStatic(r,e.expr)}))},Identifier:function(e){return e.from?this.eval(e.from).then((function(t){if(null!=t)return Array.isArray(t)&&(t=t[0]),t[e.value]})):e.relative?this._relContext[e.value]:this._context[e.value]},Literal:function(e){return e.value},ObjectLiteral:function(e){return this.evalMap(e.value)},FunctionCall:function(e){var t=Rn[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool][e.name];if(!r)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then((function(e){return r.apply(void 0,(0,An.default)(e))}))},UnaryExpression:function(e){var t=this;return this.eval(e.right).then((function(r){return t._grammar.elements[e.operator].eval(r)}))}},Mn=Tn(Sn),Un=Tn(Pn),Bn=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Promise;(0,Mn.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,Un.default)(e,[{key:"eval",value:function(e){var t=this;return this.Promise.resolve().then((function(){return Nn[e.type].call(t,e)}))}},{key:"evalArray",value:function(e){var t=this;return this.Promise.all(e.map((function(e){return t.eval(e)})))}},{key:"evalMap",value:function(e){var t=this,r=Object.keys(e),n={},o=r.map((function(r){return t.eval(e[r])}));return this.Promise.all(o).then((function(e){return e.forEach((function(e,t){n[r[t]]=e})),n}))}},{key:"_filterRelative",value:function(t,r){var n=this,o=[];return Array.isArray(t)||(t=void 0===t?[]:[t]),t.forEach((function(t){var a=new e(n._grammar,n._context,t,n.Promise);o.push(a.eval(r))})),this.Promise.all(o).then((function(e){var r=[];return e.forEach((function(e,n){e&&r.push(t[n])})),r}))}},{key:"_filterStatic",value:function(e,t){return this.eval(t).then((function(t){return"boolean"==typeof t?t?e:void 0:e[t]}))}}]),e}(),Ln=Tn(Sn),qn=Tn(Pn),Fn=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,Hn=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,Wn=/\\\\/,zn=/^\s*$/,Yn=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Kn=["[a-zA-Zа-яА-Я_À-ÖØ-öø-ÿ\\$][a-zA-Z0-9а-яА-Я_À-ÖØ-öø-ÿ\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Vn=["binaryOp","unaryOp","openParen","openBracket","question","colon"],Gn=function(){function e(t){(0,Ln.default)(this,e),this._grammar=t}return(0,qn.default)(e,[{key:"getElements",value:function(e){var t=this._getSplitRegex();return e.split(t).filter((function(e){return e}))}},{key:"getTokens",value:function(e){for(var t=[],r=!1,n=0;n<e.length;n++)this._isWhitespace(e[n])?t.length&&(t[t.length-1].raw+=e[n]):"-"===e[n]&&this._isNegative(t)?r=!0:(r&&(e[n]="-"+e[n],r=!1),t.push(this._createToken(e[n])));return r&&t.push(this._createToken("-")),t}},{key:"tokenize",value:function(e){var t=this.getElements(e);return this.getTokens(t)}},{key:"_createToken",value:function(e){var t={type:"literal",value:e,raw:e};if('"'===e[0]||"'"===e[0])t.value=this._unquote(e);else if(e.match(Fn))t.value=parseFloat(e);else if("true"===e||"false"===e)t.value="true"===e;else if(this._grammar.elements[e])t.type=this._grammar.elements[e].type;else{if(!e.match(Hn))throw new Error("Invalid expression token: ".concat(e));t.type="identifier"}return t}},{key:"_escapeRegExp",value:function(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Hn)&&(e="\\b"+e+"\\b"),e}},{key:"_getSplitRegex",value:function(){var e=this;if(!this._splitRegex){var t=Object.keys(this._grammar.elements).sort((function(e,t){return t.length-e.length})).map((function(t){return e._escapeRegExp(t)}),this);this._splitRegex=new RegExp("("+[Yn.join("|"),t.join("|"),Kn.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(e){return!e.length||Vn.some((function(t){return t===e[e.length-1].type}))}},{key:"_isWhitespace",value:function(e){return!!e.match(zn)}},{key:"_unquote",value:function(e){var t=e[0],r=new RegExp("\\\\"+t,"g");return e.substr(1,e.length-2).replace(r,t).replace(Wn,"\\")}}]),e}(),Jn={argVal:function(e){e&&this._cursor.args.push(e)},arrayStart:function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})},arrayVal:function(e){e&&this._cursor.value.push(e)},binaryOp:function(e){for(var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;r&&r.operator&&this._grammar.elements[r.operator].precedence>=t;)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)},dot:function(){this._nextIdentEncapsulate=this._cursor&&"UnaryExpression"!==this._cursor.type&&("BinaryExpression"!==this._cursor.type||"BinaryExpression"===this._cursor.type&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)},filter:function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})},functionCall:function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})},identifier:function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))},literal:function(e){this._placeAtCursor({type:"Literal",value:e.value})},objKey:function(e){this._curObjKey=e.value},objStart:function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})},objVal:function(e){this._cursor.value[this._curObjKey]=e},subExpression:function(e){this._placeAtCursor(e)},ternaryEnd:function(e){this._cursor.alternate=e},ternaryMid:function(e){this._cursor.consequent=e},ternaryStart:function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree},transform:function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})},unaryOp:function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}},Qn={states:{expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Jn.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Jn.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Jn.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Jn.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Jn.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Jn.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Jn.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Jn.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Jn.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Jn.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Jn.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Jn.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Jn.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Jn.ternaryEnd,completable:!0}}},Xn=Tn(Sn),$n=Tn(Pn),Zn=Qn.states,eo=function(){function e(t,r,n){(0,Xn.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,$n.default)(e,[{key:"addToken",value:function(e){if("complete"===this._state)throw new Error("Cannot add a new token to a completed Parser");var t=Zn[this._state],r=this._exprStr;if(this._exprStr+=e.raw,t.subHandler){this._subParser||this._startSubExpression(r);var n=this._subParser.addToken(e);if(n){if(this._endSubExpression(),this._parentStop)return n;this._state=n}}else{if(!t.tokenTypes[e.type]){if(this._stopMap[e.type])return this._stopMap[e.type];throw new Error("Token ".concat(e.raw," (").concat(e.type,") unexpected in expression: ").concat(this._exprStr))}var o=t.tokenTypes[e.type],a=Jn[e.type];o.handler&&(a=o.handler),a&&a.call(this,e),o.toState&&(this._state=o.toState)}return!1}},{key:"addTokens",value:function(e){e.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!Zn[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){Zn[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(e){this._cursor?(this._cursor.right=e,this._setParent(e,this._cursor)):this._tree=e,this._cursor=e}},{key:"_placeBeforeCursor",value:function(e){this._cursor=this._cursor._parent,this._placeAtCursor(e)}},{key:"_setParent",value:function(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}},{key:"_startSubExpression",value:function(t){var r=Zn[this._state].endStates;r||(this._parentStop=!0,r=this._stopMap),this._subParser=new e(this._grammar,t,r)}}]),e}(),to=Tn(Sn),ro=Tn(Pn),no=function(){function e(t){(0,to.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,ro.default)(e,[{key:"catch",value:function(e){if(this.error)try{this._resolve(e(this.error))}catch(e){this._reject(e)}return this}},{key:"then",value:function(e,t){if(!this.error)try{this._resolve(e(this.value))}catch(e){this._reject(e)}return t&&this.catch(t),this}},{key:"_reject",value:function(e){this.value=void 0,this.error=e}},{key:"_resolve",value:function(t){t instanceof e?t.error?this._reject(t.error):this._resolve(t.value):(this.value=t,this.error=void 0)}}]),e}();no.all=function(e){return new no((function(t){t(e.map((function(e){for(;e instanceof no;){if(e.error)throw Error(e.error);e=e.value}return e})))}))},no.resolve=function(e){return new no((function(t){return t(e)}))},no.reject=function(e){return new no((function(t,r){return r(e)}))};var oo=no,ao=Tn(Sn),io=Tn(Pn),uo=function(){function e(t,r){(0,ao.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,io.default)(e,[{key:"compile",value:function(){var e=new Gn(this._grammar),t=new eo(this._grammar),r=e.tokenize(this._exprStr);return t.addTokens(r),this._ast=t.complete(),this}},{key:"eval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._eval(e,Promise)}},{key:"evalSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._eval(e,oo);if(t.error)throw t.error;return t.value}},{key:"_eval",value:function(e,t){var r=this;return t.resolve().then((function(){var n=r._getAst();return new Bn(r._grammar,e,void 0,t).eval(n)}))}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e}(),so=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(e,t){return e+t}},"-":{type:"binaryOp",precedence:30,eval:function(e,t){return e-t}},"*":{type:"binaryOp",precedence:40,eval:function(e,t){return e*t}},"/":{type:"binaryOp",precedence:40,eval:function(e,t){return e/t}},"//":{type:"binaryOp",precedence:40,eval:function(e,t){return Math.floor(e/t)}},"%":{type:"binaryOp",precedence:50,eval:function(e,t){return e%t}},"^":{type:"binaryOp",precedence:50,eval:function(e,t){return Math.pow(e,t)}},"==":{type:"binaryOp",precedence:20,eval:function(e,t){return e==t}},"!=":{type:"binaryOp",precedence:20,eval:function(e,t){return e!=t}},">":{type:"binaryOp",precedence:20,eval:function(e,t){return e>t}},">=":{type:"binaryOp",precedence:20,eval:function(e,t){return e>=t}},"<":{type:"binaryOp",precedence:20,eval:function(e,t){return e<t}},"<=":{type:"binaryOp",precedence:20,eval:function(e,t){return e<=t}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e?t.eval():e}))}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e||t.eval()}))}},in:{type:"binaryOp",precedence:20,eval:function(e,t){return"string"==typeof t?-1!==t.indexOf(e):!!Array.isArray(t)&&t.some((function(t){return t===e}))}},"!":{type:"unaryOp",precedence:1/0,eval:function(e){return!e}}},functions:{},transforms:{}}},co=Tn(In),lo=Tn(Sn),fo=Tn(Pn),ho=so,po=function(){function e(){(0,lo.default)(this,e),this.expr=this.expr.bind(this),this._grammar=ho()}return(0,fo.default)(e,[{key:"addBinaryOp",value:function(e,t,r,n){this._addGrammarElement(e,(0,co.default)({type:"binaryOp",precedence:t},n?"evalOnDemand":"eval",r))}},{key:"addFunction",value:function(e,t){this._grammar.functions[e]=t}},{key:"addFunctions",value:function(e){for(var t in e)this._grammar.functions[t]=e[t]}},{key:"addUnaryOp",value:function(e,t){this._addGrammarElement(e,{type:"unaryOp",weight:1/0,eval:t})}},{key:"addTransform",value:function(e,t){this._grammar.transforms[e]=t}},{key:"addTransforms",value:function(e){for(var t in e)this._grammar.transforms[t]=e[t]}},{key:"compile",value:function(e){return this.createExpression(e).compile()}},{key:"createExpression",value:function(e){return new uo(this._grammar,e)}},{key:"getFunction",value:function(e){return this._grammar.functions[e]}},{key:"getTransform",value:function(e){return this._grammar.transforms[e]}},{key:"eval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.eval(t)}},{key:"evalSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.evalSync(t)}},{key:"expr",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=e.reduce((function(e,t,n){return e+=t+(n<r.length?r[n]:"")}),"");return this.createExpression(o)}},{key:"removeOp",value:function(e){!this._grammar.elements[e]||"binaryOp"!==this._grammar.elements[e].type&&"unaryOp"!==this._grammar.elements[e].type||delete this._grammar.elements[e]}},{key:"_addGrammarElement",value:function(e,t){this._grammar.elements[e]=t}}]),e}(),go=new po,vo=po;go.Jexl=vo;var yo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.loadConfigs=t.getLovAttributesToRetrieve=t.exchangeRatesFromResponse=t.evaluateHsoConfigs=void 0;var r=It.__importDefault(go);function n(e){var t={};return e.forEach((function(e){var r=e.objectID,n=e.rate;t[r]=n})),t}function o(e){var t=un.getTranslatedAttributes(e,["value"]);return It.__spreadArrays(["id","categoryID","objectID"],t)}r.default.addTransform("map",(function(e,t){return e.map((function(e){return t.replace(/%s/g,e)}))})),t.evaluateHsoConfigs=function(e,t){void 0===t&&(t=[]);var n=[];return t.some((function(t){try{r.default.evalSync(t.criteria,e)&&(n=t.value.map((function(t){return r.default.evalSync(t,e)})))}catch(e){}return n.length>0})),n},t.exchangeRatesFromResponse=n,t.getLovAttributesToRetrieve=o,t.loadConfigs=function(e,t,r){var a,i,u,s,c=e.search,l=t.hsoIndex,f=t.lovIndex,d=t.currencyIndex;return It.__awaiter(this,void 0,void 0,(function(){var e,t,h,p,g,v,y,m,b,_,w;return It.__generator(this,(function(O){switch(O.label){case 0:return e=r.currencies,t=r.languages,h=r.variations,p=e.map((function(e){return"objectID:"+e})),g=un.pickIndexVariation(l,h),v=(null==g?void 0:g.objectID)?["objectID:"+g.objectID]:void 0,y=[{indexName:g.name,params:{facetFilters:v,attributesToHighlight:[],getRankingInfo:!1}},{indexName:f,params:{hitsPerPage:1e3,attributesToRetrieve:o(t),attributesToHighlight:[],getRankingInfo:!1}},{indexName:d,params:{hitsPerPage:p.length,query:"",attributesToRetrieve:["rate"],attributesToHighlight:[],facetFilters:[p],getRankingInfo:!1}}],[4,c(y)];case 1:return m=O.sent().results,b=null===(a=m[0])||void 0===a?void 0:a.hits,_=null===(i=m[1])||void 0===i?void 0:i.hits,w=null===(u=m[2])||void 0===u?void 0:u.hits,[2,{hso:null===(s=b[0])||void 0===s?void 0:s.hso,lov:_,exchangeRates:n(w)}]}}))}))}})),mo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(sn,t),It.__exportStar(wn,t),It.__exportStar(un,t),It.__exportStar(ln,t),It.__exportStar(On,t),It.__exportStar(yo,t)})),bo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.getRequestSize=t.prepareSearchParameters=void 0;function r(e,t,r,n){var o,a=It.__assign(It.__assign({},t),{offset:r,anchorHotelId:n});if(null===(o=a.boundingBox)||void 0===o?void 0:o.length)return a;var i=e.polygon;return(null==i?void 0:i.length)?It.__assign(It.__assign({},a),{polygon:i}):e._geoloc?It.__assign(It.__assign({},a),{geolocation:e._geoloc}):a}function n(e,t){var r=e.rooms,n=void 0===r?"2":r,o=Jr.getCheckInCheckOutDates(e,t),a=o.checkIn,i=o.checkOut;return It.__assign(It.__assign({},e),{checkIn:a,checkOut:i,rooms:n})}function o(e,t,r){var n,o,a=e.anchor,i=e.anchorType;return void 0!==a.pageSize&&a.pageSize>=r.pageSize&&void 0===(null===(n=t.filters)||void 0===n?void 0:n.priceMin)&&void 0===(null===(o=t.filters)||void 0===o?void 0:o.priceMax)&&"price"!==t.sortField?a.pageSize:"hotel"===i?45:65}t.prepareSearchParameters=n,t.getRequestSize=o,t.search=function(e){var t=this,a=e.getFeatureEnabled,i=e.appConfig,u=e.algoliaClient,s=e.offersClient,c=e.options,l=e.configs,f=l.hso,d=l.exchangeRates,h=c.languages,p=d[c.currency],g=a("offers");return function(e,a){return void 0===a&&(a={}),It.__awaiter(t,void 0,void 0,(function(){var t,l,d,v,y,m,b,_,w,O,T,I,S,x,P,E=this;return It.__generator(this,(function(k){switch(k.label){case 0:return t=Jr.createState({}),l=0,d=a.onStart,v=a.onAnchorReceived,y=a.onHotelsReceived,m=a.onOffersReceived,b=a.onComplete,_=n(e,i.client),w=Jr.generateSearchId(e,c),t.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof d&&d(t.current()),[4,mo.getAnchor(u,i.algolia,c)(_)];case 1:return O=k.sent(),t.update((function(e){var t,r;if(e.anchor=O.anchor,e.anchorType=O.anchorType,void 0!==O.anchorHotel){var n=O.anchorHotel.objectID;e.anchorHotelId=n,e.hotelEntities=It.__assign(It.__assign({},null!==(r=e.hotelEntities)&&void 0!==r?r:{}),((t={})[n]=O.anchorHotel,t))}})),"function"==typeof v&&v(t.current()),T="hotel"===O.anchorType?"hotel_search":"place_search",I=f[T],S=mo.geoSearch(u,i.algolia,{languages:h,exchangeRate:p,priceBucketWidth:O.anchor.priceBucketWidth,requestSize:o(O,_,c),hsoFilter:mo.evaluateHsoConfigs({anchorHotel:O.anchorHotel,searchParameters:_,checkInNights:mo.getCheckInNights(_.checkIn,_.checkOut)},I)}),[4,(x=function(e){return void 0===e&&(e=0),It.__awaiter(E,void 0,void 0,(function(){var n,o,a,i,u,l,f;return It.__generator(this,(function(d){switch(d.label){case 0:return!0===_.skipGeoSearch?[3,2]:[4,S(r(O.anchor,_,e,null===(l=O.anchorHotel)||void 0===l?void 0:l.objectID))];case 1:n=d.sent(),t.update((function(e){var t;e.facets=n.facets,e.resultsCount=n.resultsCount,e.resultsCountTotal=n.resultsCountTotal,e.offset=n.offset,e.hotelIds=n.hotelIds,e.hotelEntities=It.__assign(It.__assign({},null!==(t=e.hotelEntities)&&void 0!==t?t:{}),n.hotelEntities),e.hotelsHaveStaticPosition=function(e,t,r){var n,o,a,i;if("price"===e.sortField)return!1;if(void 0!==(null===(n=e.filters)||void 0===n?void 0:n.priceMin)||void 0!==(null===(o=e.filters)||void 0===o?void 0:o.priceMax))return!1;if(r){var u=mo.getCheckInNights(e.checkIn,e.checkOut);return(null!==(i=null===(a=r.tags)||void 0===a?void 0:a["a"+u])&&void 0!==i?i:0)>=t}return!0}(_,c.pageSize,n.facets)})),t.update((function(e){Object.keys(e.hotelEntities).forEach((function(t){e.hotelEntities[t]=Jr.augmentHotelWithRegularPriceRange(e.hotelEntities[t],p,e.anchor.priceBucketWidth)}))})),d.label=2;case 2:return"function"==typeof y&&y(t.current()),g&&void 0!==s?(o=t.get("hotelIds"),a=It.__assign(It.__assign({},_),{searchId:w,hotelIds:o,anchorHotelId:null===(f=O.anchorHotel)||void 0===f?void 0:f.objectID}),[4,s.getOffers(a,(function(e){var r=en.augmentRaaResponse(e,It.__assign(It.__assign(It.__assign(It.__assign({},a),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p}));t.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=It.__assign(It.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof m&&m(t.current())}))]):[3,4];case 3:i=d.sent(),u=en.augmentRaaResponse(i,It.__assign(It.__assign(It.__assign(It.__assign({},a),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p})),t.update((function(e){e.hotelIds=u.hotelIds,e.hotelOfferEntities=u.hotelOfferEntities})),t.update((function(e){e.dealScores=Jr.getDealScores(e)})),d.label=4;case 4:return"function"==typeof b&&b(t.current()),[2,t.current()]}}))}))})(_.offset)];case 2:return P=k.sent(),[2,{loadOffers:function(e){return It.__awaiter(E,void 0,void 0,(function(){var t,r,n,o,a;return It.__generator(this,(function(i){switch(i.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!g||!s)throw new Error("Offers loading is disabled");return t=e===P.anchorHotelId,r=It.__assign(It.__assign({},_),{searchId:w,getAllOffers:!0,hotelIds:t?void 0:[e],anchorHotelId:t?e:void 0}),[4,s.getOffers(r)];case 1:return n=i.sent(),o=en.augmentRaaResponse(n,It.__assign(It.__assign(It.__assign(It.__assign({},r),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p})),[2,null===(a=o.hotelOfferEntities)||void 0===a?void 0:a[e]]}}))}))},loadMore:function(){return It.__awaiter(E,void 0,void 0,(function(){return It.__generator(this,(function(e){return l+=o(O,_,c),[2,x(l)]}))}))}}]}}))}))}}}));var _o=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,a=[],i=[],u={},s=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:s,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){a.push(t=t.toLowerCase()),i.push([t,r]),u[t]=u[t]?u[t]+","+r:r})),r(s())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),wo={};try{!function(e,t){if(new e("q=%2B").get("q")!==t||new e({q:t}).get("q")!==t||new e([["q",t]]).get("q")!==t||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;wo.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,u=/\+/g,s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){h(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,r){this._ungap[e]=[t(r)]},forEach:function(e,r){var n=this;for(var o in n._ungap)n._ungap[o].forEach(a,o);function a(a){e.call(r,a,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=g(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+g(o[n]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=n(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,u=a.length;i<u;i++){var s=(c=a[i]).indexOf("=");-1<s?h(t,p(c.slice(0,s)),p(c.slice(s+1))):c.length&&h(t,p(c),"")}break;case r(e):for(i=0,u=e.length;i<u;i++){var c;h(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var l in e)h(t,l,e[l])}}function d(e,t){h(this,t,e)}function h(e,t,n){var o=r(n)?n.join(","):n;t in e?e[t].push(o):e[t]=[o]}function p(e){return decodeURIComponent(e.replace(i,"%25").replace(u," "))}function g(e){return encodeURIComponent(e).replace(a,v)}function v(e){return s[e]}wo.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function r(e,r){var n=[];return e.forEach(r,n),t?n[Symbol.iterator]():{next:function(){var e=n.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var r=this,n=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in n)&&(n[o]=r.getAll(o)).forEach((function(n){e.call(t,n,o,r)}))}))}),"keys"in e||(e.keys=function(){return r(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return r(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return r(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,r,n=this.entries(),o=n.next(),a=o.done,i=[],u=Object.create(null);!a;)t=(r=o.value)[0],i.push(t),t in u||(u[t]=[]),u[t].push(r[1]),a=(o=n.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,u[t].shift())}),function(t){var r=t.defineProperty,n=t.getOwnPropertyDescriptor,o=function(t){var r=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=r},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var u,s,c=i.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(s=function(t){function n(r,n){e.append.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function o(r){e.delete.call(this,r),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function a(r,n){e.set.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}return function(e,t){return e.append=n,e.delete=o,e.set=a,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:s(t,e)}),t},t.defineProperties(c,{href:{get:function(){return f.get.call(this)},set:function(e){var t=this._searchParams;f.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,i),this._searchParams||u(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),u(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(wo.URLSearchParams.prototype);var Oo=wo.URLSearchParams,To=Object.freeze({__proto__:null,default:Oo}),Io=r(_o),So=r(To),xo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.backendSearch=t.createRequestString=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e){var t,r,o,a,i,u,s,c,l,f,d,h,p,g,v,y,m,b,_,w=e.profileKey,O=e.searchParameters,T=e.options,I=e.offset,S=e.attributes,x=Jr.removeEmpty({offset:I,profileId:w,query:O.query,hotelId:O.hotelId,placeId:O.placeId,checkIn:O.checkIn,checkOut:O.checkOut,rooms:O.rooms,dayDistance:O.dayDistance,nights:O.nights,sortField:O.sortField,sortOrder:O.sortOrder,boundingBox:null===(t=O.boundingBox)||void 0===t?void 0:t.join(","),currency:T.currency,language:T.language,variations:null===(r=T.variations)||void 0===r?void 0:r.join(","),starRating:null===(a=null===(o=O.filters)||void 0===o?void 0:o.starRating)||void 0===a?void 0:a.join(","),guestRating:null===(u=null===(i=O.filters)||void 0===i?void 0:i.guestRating)||void 0===u?void 0:u.join(","),propertyTypeId:null===(c=null===(s=O.filters)||void 0===s?void 0:s.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=O.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=O.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(g=null===(p=O.filters)||void 0===p?void 0:p.chainIds)||void 0===g?void 0:g.join(","),noHostels:null===(v=O.filters)||void 0===v?void 0:v.noHostels,priceMin:null===(y=O.filters)||void 0===y?void 0:y.priceMin,priceMax:null===(m=O.filters)||void 0===m?void 0:m.priceMax,hotelName:null===(b=O.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=O.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==S?void 0:S.join(","),anonymousId:T.anonymousId,sapiOverride:"undefined"==typeof window?null:new n.default(window.location.search).get("sapiOverride")});return new n.default(x).toString()}function a(e,t){var n=e.baseUrl,a=e.endpoints;return It.__awaiter(this,void 0,void 0,(function(){var e,i,u,s,c,l;return It.__generator(this,(function(f){switch(f.label){case 0:return e=o(t),[4,r.default("https://"+n+"/"+a.search+"?"+e)];case 1:return(i=f.sent()).ok?[2,i.json()]:(u=t.searchParameters,s=t.options,c=t.offset,l=t.attributes,s.logger.log({name:"SearchFailed",value:It.__assign(It.__assign({},u),{offset:c,attributes:l,language:s.language,currency:s.currency,deviceType:s.deviceType})}),[2,Promise.reject(i)])}}))}))}t.createRequestString=o,t.backendSearch=function(e){var t,r=this,n=e.getFeatureEnabled,o=e.profileKey,i=e.appConfig,u=e.offersClient,s=e.options,c=n("offers"),l=!1;return function(e,n){return void 0===n&&(n={}),It.__awaiter(r,void 0,void 0,(function(){var r,f,d,h,p,g,v,y,m,b,_=this;return It.__generator(this,(function(w){switch(w.label){case 0:return r=Jr.createState({}),f=n.onStart,d=n.onAnchorReceived,h=n.onHotelsReceived,p=n.onOffersReceived,g=n.onComplete,v=0,y=bo.prepareSearchParameters(e,i.client),m=Jr.generateSearchId(e,s),r.update((function(e){e.searchParameters=y,e.searchId=m})),"function"==typeof f&&f(r.current()),b=function(e,n){return void 0===e&&(e=0),It.__awaiter(_,void 0,void 0,(function(){var f,v,b,_,w,O;return It.__generator(this,(function(T){switch(T.label){case 0:return[4,a(i.sapiBackend,{profileKey:o,searchParameters:y,options:s,offset:e,attributes:n})];case 1:return f=T.sent(),l||(t=f.exchangeRates[s.currency],(null===(O=s.callbacks)||void 0===O?void 0:O.onConfigReceived)&&s.callbacks.onConfigReceived({lov:f.lov,exchangeRates:f.exchangeRates}),l=!0),(void 0===n||n.includes("anchor"))&&(r.update((function(e){e.anchor=f.anchor,e.anchorHotelId=f.anchorHotelId,e.anchorType=f.anchorType,e.hotelEntities=f.hotelEntities})),"function"==typeof d&&d(r.current())),r.update((function(e){e.facets=f.facets,e.hotelEntities=f.hotelEntities,e.hotelIds=f.hotelIds,e.hotelsHaveStaticPosition=f.hotelsHaveStaticPosition,e.offset=f.offset,e.resultsCount=f.resultsCount,e.resultsCountTotal=f.resultsCountTotal})),"function"==typeof h&&h(r.current()),c&&void 0!==u?(v=r.get("hotelIds"),b=It.__assign(It.__assign({},y),{searchId:m,hotelIds:v,anchorHotelId:r.get("anchorHotelId")}),[4,u.getOffers(b,(function(e){var n=en.augmentRaaResponse(e,It.__assign(It.__assign(It.__assign(It.__assign({},b),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t}));r.update((function(e){n.hotelIds.length>0&&(e.hotelIds=n.hotelIds),e.hotelOfferEntities=It.__assign(It.__assign({},e.hotelOfferEntities),n.hotelOfferEntities)})),"function"==typeof p&&p(r.current())}))]):[3,3];case 2:_=T.sent(),w=en.augmentRaaResponse(_,It.__assign(It.__assign(It.__assign(It.__assign({},b),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t})),r.update((function(e){e.hotelIds=w.hotelIds,e.hotelOfferEntities=w.hotelOfferEntities})),r.update((function(e){e.dealScores=Jr.getDealScores(e)})),T.label=3;case 3:return"function"==typeof g&&g(r.current()),[2,r.current()]}}))}))},[4,l?b(y.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):b(y.offset)];case 1:return w.sent(),[2,{loadOffers:function(e){return It.__awaiter(_,void 0,void 0,(function(){var n,o,a,i,l;return It.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!c||!u)throw new Error("Offers loading is disabled");return n=e===r.get("anchorHotelId"),o=It.__assign(It.__assign({},y),{searchId:m,getAllOffers:!0,hotelIds:n?void 0:[e],anchorHotelId:n?e:void 0}),[4,u.getOffers(o)];case 1:return a=f.sent(),i=en.augmentRaaResponse(a,It.__assign(It.__assign(It.__assign(It.__assign({},o),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t})),[2,null===(l=i.hotelOfferEntities)||void 0===l?void 0:l[e]]}}))}))},loadMore:function(){return It.__awaiter(_,void 0,void 0,(function(){return It.__generator(this,(function(e){var t,n;return v+=bo.getRequestSize({anchor:r.get("anchor"),anchorHotel:(t=r.get("hotelEntities"),n=r.get("anchorHotelId"),n?t[n]:void 0),anchorType:r.get("anchorType")},y,s),[2,b(v,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"])]}))}))}}]}}))}))}}})),Po=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0,t.suggest=function(e){var t=this,r=e.appConfig,n=e.algoliaClient,o=e.options.languages;return function(e,a){return It.__awaiter(t,void 0,void 0,(function(){return It.__generator(this,(function(t){switch(t.label){case 0:return[4,mo.loadSuggests(n,r.algolia,{suggestsCount:a,languages:o})(e)];case 1:return[2,t.sent()]}}))}))}}})),Eo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e,t){var r,o=e.hotelId,a=e.checkIn,i=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,l=Jr.removeEmpty({hotelId:o,checkIn:a,checkOut:i,rooms:u,providerCode:s,cugDeals:c,deviceType:t.deviceType,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.appConfig,a=e.options;return function(e){return It.__awaiter(t,void 0,void 0,(function(){var t,i,u;return It.__generator(this,(function(s){switch(s.label){case 0:return t=o(e,a),[4,r.default("https://"+n.saf.baseUrl+"/"+n.saf.endpoints.offersRooms+"?"+t)];case 1:return(i=s.sent()).ok?[4,i.json()]:[3,3];case 2:return u=s.sent(),[2,It.__assign({hotelId:e.hotelId,anonymousId:a.anonymousId},u)];case 3:return[2,Promise.reject(i)]}}))}))}}})),ko=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e,t){var r=e.checkInInst,n=e.checkInSpInst,o=e.feesMnd,a=e.feesOpt,i=e.policies,u=e.hotelName,s=e.placeDN,c=e.address,l=e.placeADName,f=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,g=It.__assign(It.__assign({},e),{checkInInst:r&&un.toString(r,t),checkInSpInst:n&&un.toString(n,t),feesMnd:o&&un.toString(o,t),feesOpt:a&&un.toString(a,t),hotelName:un.toString(u,t),policies:i&&un.toString(i,t),placeDisplayName:s&&un.translatedArrayToString(s,t),displayAddress:c&&l&&un.mergeTranslatedAttributes(c,l,t),facilities:null==d?void 0:d.map((function(e){return It.__assign(It.__assign({},e),{value:un.toString(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return It.__assign(It.__assign({},e),{value:un.toString(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return It.__assign(It.__assign({},e),{value:un.toString(e.value,t)})})),propertyType:f&&It.__assign(It.__assign({},f),{value:un.toString(f.value,t)})});return Jr.omit(["placeDN","placeADName","address"],g)}function a(e,t){var r=Jr.removeEmpty({id:e,language:t.join(","),attributes:["objectID","address","guestRating","isDeleted","starRating","_geoloc","feesOpt","placeADName","checkInSpInst","policies","phone","imageURIs","checkInTime","placeDN","checkInInst","reviewCount","chainID","checkInEnd","lastBooked","checkOutTime","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","checkInMinAge","pricing"].join(",")});return new n.default(r).toString()}t.safToSapiHotel=o,t.createRequestString=a,t.hotel=function(e){var t=this,n=e.appConfig,i=e.options;return function(e){return It.__awaiter(t,void 0,void 0,(function(){var t,u;return It.__generator(this,(function(s){switch(s.label){case 0:return t=a(e,i.languages),[4,r.default("https://"+n.saf.baseUrl+"/"+n.saf.endpoints.hotel+"?"+t)];case 1:return(u=s.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,o(s.sent(),i.languages)];case 3:return[2,Promise.reject(u)]}}))}))}}})),jo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.sapiResponseToHotelOfferEntity=void 0;var r,n=It.__importDefault(Xr),o=It.__importDefault(an);function a(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.baseRate;return t&&(n+=e.taxes),r&&(n+=e.localTaxes),n}function i(e,t,r){var n=o.default(Jr.dateToMiddayUTC(r),Jr.dateToMiddayUTC(t));if(n<1)throw new Error("checkOut cannot be the same or less than checkIn");return 1===n?e:e/n}function u(e,t){var r,n={baseRate:e.anchorRate.base,localTaxes:e.anchorRate.hotelFees,taxes:e.anchorRate.taxes},o=a(n,t.includeTaxes,t.includeLocalTaxes),u=i(o,t.checkIn,t.checkOut);return{anchorPriceRateBreakdown:It.__assign(It.__assign({},n),{calculatedTotalRate:o,nightlyRate:u}),availableOffersCount:e.availableOffersCount,fetchedAllOffers:e.fetchedAllOffers,hasMoreOffers:e.hasMoreOffers,id:e.id,offers:null===(r=e.offers)||void 0===r?void 0:r.map((function(r){return function(e,t,r){var n,o,u,s,c,l={baseRate:e.rate.base,localTaxes:e.rate.hotelFees,taxes:e.rate.taxes},f=a(l,r.includeTaxes,r.includeLocalTaxes),d=i(f,r.checkIn,r.checkOut),h=null!==(n=e.tags)&&void 0!==n?n:[],p=h.includes("top_offer"),g=h.includes("anchor_price"),v=h.includes("exclusive_cheapest_offer"),y=null===(o=e.package.amenities)||void 0===o?void 0:o.filter((function(e){return["allInclusive","breakfast","partialBreakfast","lunch","dinner","fullBoard","halfBoard","meals"].includes(e)})),m=e.package.refundable&&(0===e.cancellationPenalties.length||e.cancellationPenalties.some((function(e){return 0===e.amount||0===e.percent||0===e.nights})));return{id:e.id,bookURI:e.url,providerCode:e.providerCode,proxyProviderCode:e.intermediaryProvider,rateBreakdown:l,nightlyRate:d,calculatedTotalRate:f,availableRooms:e.availableRooms,cug:e.accessTier?e.accessTier.split(","):null,currency:e.currency,meals:y,tags:h,canPayLater:e.package.canPayLater,hasAnchorPrice:p,hasFreeCancellation:m,isAnchorPriceOffer:g,isTopOffer:p,isCheapest:v,roomID:e.roomID,roomName:null===(u=null==t?void 0:t[e.roomID])||void 0===u?void 0:u.name,additionalProviderParams:{feedId:null!==(c=null===(s=e.metadata)||void 0===s?void 0:s.feedID)&&void 0!==c?c:""}}}(r,e.rooms,t)})),topOfferData:{anchorPrice:o,anchorPriceNightly:u,offerIndexes:[0,1,2,3]}}}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={})),t.sapiResponseToHotelOfferEntity=u,t.offers=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a="wss://"+e.baseUrl+"/"+e.endpoints.offers,i=new n.default(a,[],{maxRetries:20,WebSocket:t.WebSocket}),s={};function c(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==s.current&&i.reconnect()}function l(e){t.logger.log({name:"WebsocketError",value:It.__assign(It.__assign({},e),{service:"sapi"})}),void 0!==s.current&&i.reconnect()}function f(){var e=s.current;void 0!==e&&i.send(e)}function d(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}"function"==typeof o&&o(t)}return i.addEventListener("open",f),i.addEventListener("close",c),i.addEventListener("error",l),i.addEventListener("message",d),{getOffers:function(e,n){return It.__awaiter(this,void 0,void 0,(function(){var a;return It.__generator(this,(function(c){return a={},s.current=function(e,t){var r,n={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:$r.v4(),sortingBoost:en.generateSortingBoost(e),roomLimit:1,anchorRoomLimit:2,getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.trafficSource,countryCode:t.countryCode};try{r=JSON.stringify(n)}catch(e){console.log("WEBSOCKET: error serialising request")}return r}(e,t),[2,new Promise((function(c){o=function(r){var o,i;if(void 0!==r)if(r.status.complete)c(a),s.current=void 0;else{var l=null===(o=r.results)||void 0===o?void 0:o.find((function(t){return t.id===e.anchorHotelId}));l?a.anchorHotelOfferEntity=u(l,It.__assign(It.__assign({},e),t)):a.hotelOfferEntities=null===(i=r.results)||void 0===i?void 0:i.map((function(r){return u(r,It.__assign(It.__assign({},e),t))})),"function"==typeof n&&n(It.__assign({},a))}},i.readyState===r.Open&&void 0!==s.current&&i.send(s.current)}))]}))}))}}}})),Co=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=void 0;var r=It.__importDefault(d),n={log:function(){}};function o(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r+"-"+e[r]);return t}t.sapi=function(e,t){var a,i,u,s,c,l,f,d,h,p,g;return It.__awaiter(this,void 0,void 0,(function(){function v(e){return m.client.features.includes(e)}var y,m,b,_,w,O,T,I,S,x,P,E;return It.__generator(this,(function(k){switch(k.label){case 0:if(!e)throw new Error("Profile key is required");return y=It.__assign(It.__assign({},t),{logger:null!==(a=t.logger)&&void 0!==a?a:n,variations:o(t.variations),currency:null!==(u=null===(i=t.currency)||void 0===i?void 0:i.toUpperCase())&&void 0!==u?u:"USD",deviceType:null!==(c=null!==(s=t.deviceType)&&void 0!==s?s:t.deviceCategory)&&void 0!==c?c:"desktop",countryCode:null!==(l=t.countryCode)&&void 0!==l?l:t.userCountry,pageSize:null!==(f=t.pageSize)&&void 0!==f?f:20}),m=_n.getAppConfig(e,y.initWithAppConfig),b=r.default("4UYGJP42KQ",m.algolia.apiKey,y.algoliaClientOptions),v("offers")&&m.daedalus.raaEndpoint&&(_=(null===(d=y.variations)||void 0===d?void 0:d.includes("a41n36ps-sapi-offers-b"))?jo.offers(m.sapiBackend,y):en.raa(m.daedalus.raaEndpoint,y)),w={appConfig:m,algoliaClient:b,getFeatureEnabled:v,profileKey:e,offersClient:_,options:It.__assign(It.__assign({},y),{languages:It.__spreadArrays([y.language],null!==(h=m.client.fallbackLanguages[y.language])&&void 0!==h?h:[],["en"])})},(O=null===(p=y.variations)||void 0===p?void 0:p.includes("c48b82da-sapi-backend-b"))||!v("configs")?[3,2]:[4,mo.loadConfigs(b,m.algolia,It.__assign(It.__assign({},w.options),{currencies:[y.currency,"EUR"]}))];case 1:T=k.sent(),(null===(g=y.callbacks)||void 0===g?void 0:g.onConfigReceived)&&(I=T.exchangeRates,S=T.lov,y.callbacks.onConfigReceived({exchangeRates:I,lov:S})),w.configs=T,k.label=2;case 2:return x=function(e){return v("search")?O?xo.backendSearch(e):bo.search(e):function(){throw new Error("Search is not enabled for this Profile key")}},P=function(e){return v("suggests")?Po.suggest(e):function(){throw new Error("Autosuggest is not enabled for this Profile key")}},E=function(e){return v("get-hotel")?ko.hotel(e):function(){throw new Error("Get hotel is not alowed for this Profile key")}},[2,{rooms:function(e){return v("rooms")?Eo.rooms(e):function(){throw new Error("Rooms search is not enabled for this Profile key")}}(w),search:x(w),suggest:P(w),hotel:E(w)}]}}))}))}})),Do=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ao=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ro=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),No=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Do,t),It.__exportStar(Ao,t),It.__exportStar(Ro,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Wr.enableES5(),It.__exportStar(Co,t),It.__exportStar(No,t),t.default=Co.sapi})))}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).sapi=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return r(null==t&&n.path)}},n.exports),n.exports}function n(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};var i=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function c(e){return this instanceof c?(this.v=e,this):new c(e)}var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var f=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return a},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},__decorate:function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},__createBinding:i,__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},__values:s,__read:u,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(u(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)r[o]=a[i];return r},__spreadArray:function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},__await:c,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),a=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(u,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function u(e){s("next",e)}function l(e){s("throw",e)}function f(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:c(e[r](t)),done:"return"===r}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return l(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},__classPrivateFieldSet:function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}}),d=t((function(e,t){e.exports=function(){function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n=JSON.stringify(e),r=a()[n];return Promise.all([r||t(),void 0!==r])})).then((function(e){var t=o(e,2),r=t[0],a=t[1];return Promise.all([r,a||n.miss(r)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,r().setItem(n,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function s(e){var t=a(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return s({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return s({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return s({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return s({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r(),s=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return s(e)})).then((function(){return i}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===g.WithinHeaders?r:{}},queryParameters:function(){return e===g.WithinQueryParameters?r:{}}}}function l(e){var t=0;return e((function n(){return t++,new Promise((function(r){setTimeout((function(){r(e(n))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(n){return f(e.then((function(e){return Promise.all([t(e,n),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function h(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(n[o++])}))}var g={WithinQueryParameters:0,WithinHeaders:1};function v(e,t){var n=e||{},r=n.data||{};return Object.keys(n).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])})),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var y={Read:1,Write:2,Any:3},m=1,_=2,b=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return n(n({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var I="DELETE",T="GET",S="POST",E="PUT";function x(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===m||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return e.status===b&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(n),a(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function P(e,t,r,o){var i=[],s=function(e,t){if(e.method!==T&&(void 0!==e.data||void 0!==t.data)){var r=Array.isArray(e.data)?e.data:n(n({},e.data),t.data);return JSON.stringify(r)}}(r,o),u=function(e,t){var r=n(n({},e.headers),t.headers),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}(e,o),c=r.method,l=r.method!==T?{}:n(n({},r.data),o.data),f=n(n(n({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(n,a){var l=n.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:A(i)};var h={data:s,headers:u,method:c,url:j(l,r.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:n.length};return i.push(t),t},g={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(r){var o=p(r);return r.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",R(o)),e.hostsCache.set(l,w(l,r.isTimedOut?b:_))]).then((function(){return t(n,a)}))},onFail:function(e){throw p(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,A(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,g)}))};return x(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,n=e.logger,r=e.requester,a=e.requestsCache,i=e.responsesCache,s=e.timeouts,u=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:n,requester:r,requestsCache:a,responsesCache:i,timeouts:s,userAgent:u,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var n=v(t,f.timeouts.read),r=function(){return P(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var a={request:e,mappedRequestOptions:n,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,r()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return P(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,f.timeouts.write))}};return f}function C(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function j(e,t,n){var r=D(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function D(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function A(e){return e.map((function(e){return R(e)}))}function R(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return n(n({},e),{},{request:n(n({},e.request),{},{headers:n(n({},e.request.headers),t)})})}var N=function(e){return function(t,n){return e.transporter.write({method:S,path:"2/abtests",data:t},n)}},M=function(e){return function(t,n){return e.transporter.write({method:I,path:p("2/abtests/%s",t)},n)}},U=function(e){return function(t,n){return e.transporter.read({method:T,path:p("2/abtests/%s",t)},n)}},B=function(e){return function(t){return e.transporter.read({method:T,path:"2/abtests"},t)}},q=function(e){return function(t,n){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},n)}},L=function(e){return function(t){return e.transporter.read({method:T,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,n){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},n)}};function H(e){return function t(n){return e.request(n).then((function(r){if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})}))}({})}var W=function(e){return function(t,o){var a=o||{},i=a.queryParameters,s=r(a,["queryParameters"]),u=n({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:u},s),(function(t,n){return l((function(r){return $(e)(t.key,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},z=function(e){return function(t,n,r){var o=v(r);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:n}},o)}},Y=function(e){return function(t,n,r){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r)}},K=function(e){return function(t,n,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},r),(function(n,r){return ne(e)(t,{methods:{waitTask:tt}}).waitTask(n.taskID,r)}))}},V=function(e){return function(t,r,o){return K(e)(t,r,n(n({},o),{},{scope:[rt.Rules]}))}},G=function(e){return function(t,r,o){return K(e)(t,r,n(n({},o),{},{scope:[rt.Settings]}))}},J=function(e){return function(t,r,o){return K(e)(t,r,n(n({},o),{},{scope:[rt.Synonyms]}))}},Q=function(e){return function(t,n){return f(e.transporter.write({method:I,path:p("1/keys/%s",t)},n),(function(n,r){return l((function(n){return $(e)(t,r).then(n).catch((function(e){if(404!==e.status)throw e}))}))}))}},$=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/keys/%s",t)},n)}},X=function(e){return function(t){return e.transporter.read({method:T,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/clusters/mapping/%s",t)},n)}},te=function(e){return function(t){var n=t||{},o=n.retrieveMappings,a=r(n,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:T,path:"1/clusters/mapping/pending"},a)}},ne=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},re=function(e){return function(t){return e.transporter.read({method:T,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters"},t)}},ae=function(e){return function(t){return e.transporter.read({method:T,path:"1/indexes"},t)}},ie=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping"},t)}},se=function(e){return function(t,n,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},r),(function(n,r){return ne(e)(t,{methods:{waitTask:tt}}).waitTask(n.taskID,r)}))}},ue=function(e){return function(t,n){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},n),(function(t,n){return Promise.all(Object.keys(t.taskID).map((function(r){return ne(e)(r,{methods:{waitTask:tt}}).waitTask(t.taskID[r],n)})))}))}},ce=function(e){return function(t,n){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},n)}},le=function(e){return function(t,r){var o=t.map((function(e){return n(n({},e),{},{params:D(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,s=a.facetQuery,u=r(a,["facetName","facetQuery"]);return ne(e)(t.indexName,{methods:{searchForFacetValues:$e}}).searchForFacetValues(i,s,n(n({},o),u))})))}},de=function(e){return function(t,n){var r=v(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:I,path:"1/clusters/mapping"},r)}},he=function(e){return function(t,n){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},n),(function(n,r){return l((function(n){return $(e)(t,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},pe=function(e){return function(t,n){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},n)}},ge=function(e){return function(t,n){var o=Object.assign({},n),a=n||{},i=a.queryParameters,s=r(a,["queryParameters"]),u=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:E,path:p("1/keys/%s",t),data:u},s),(function(n,r){return l((function(n){return $(e)(t,r).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){return e[t]===o[t]}))}(e)?Promise.resolve():n()}))}))}))}},ve=function(e){return function(t,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(function(t,n){return tt(e)(t.taskID,n)}))}},ye=function(e){return function(t){return H(n(n({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(n){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:n},t)}}))}},me=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return Xe(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return Ze(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t,n,o){var a=o||{},i=a.batchSize,s=r(a,["batchSize"]),u={taskIDs:[],objectIDs:[]};return f(function r(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(u):ve(e)(a.map((function(e){return{action:n,body:e}})),s).then((function(e){return u.objectIDs=u.objectIDs.concat(e.objectIDs),u.taskIDs.push(e.taskID),o++,r(o)}))}(),(function(t,n){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,n)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,n){return tt(e)(t.taskID,n)}))}},Oe=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,a=v(r(n,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,n){return tt(e)(t.taskID,n)}))}},Ie=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,a=v(r(n,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,n){return tt(e)(t.taskID,n)}))}},Te=function(e){return function(t,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(function(t,n){return tt(e)(t.taskID,n)}))}},Se=function(e){return function(t){return f(e.transporter.write({method:I,path:p("1/indexes/%s",e.indexName)},t),(function(t,n){return tt(e)(t.taskID,n)}))}},Ee=function(e){return function(t,n){return f(xe(e)([t],n).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},xe=function(e){return function(t,n){var r=t.map((function(e){return{objectID:e}}));return be(e)(r,nt.DeleteObject,n)}},Pe=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=v(r(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:I,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,n){return tt(e)(t.taskID,n)}))}},ke=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=v(r(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:I,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,n){return tt(e)(t.taskID,n)}))}},Ce=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},je=function(e){return function(t,n,r){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},De=function(e){return function(t,a){var i=a||{},s=i.query,u=i.paginate,c=r(i,["query","paginate"]),l=0;return function r(){return Qe(e)(s||"",n(n({},c),{},{page:l})).then((function(e){for(var n=0,a=Object.entries(e.hits);n<a.length;n++){var i=o(a[n],2),s=i[0],c=i[1];if(t(c))return{object:c,position:parseInt(s,10),page:l}}if(l++,!1===u||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return r()}))}()}},Ae=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/%s",e.indexName,t)},n)}},Re=function(){return function(e,t){for(var n=0,r=Object.entries(e.hits);n<r.length;n++){var a=o(r[n],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Ne=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,s=r(a,["attributesToRetrieve"]),u=t.map((function(t){return n({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:u}},s)}},Me=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},n)}},Ue=function(e){return function(t){return e.transporter.read({method:T,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Be=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},n)}},qe=function(e){return function(t,n){return f(Le(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Le=function(e){return function(t,n){var o=n||{},a=o.createIfNotExists,i=r(o,["createIfNotExists"]),s=a?nt.PartialUpdateObject:nt.PartialUpdateObjectNoCreate;return be(e)(t,s,i)}},Fe=function(e){return function(t,i){var s=i||{},u=s.safe,c=s.autoGenerateObjectIDIfNotExist,l=s.batchSize,d=r(s,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,n,r,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:r,destination:n}},o),(function(t,n){return tt(e)(t.taskID,n)}))},g=Math.random().toString(36).substring(7),v="".concat(e.indexName,"_tmp_").concat(g),y=Ye({appId:e.appId,transporter:e.transporter,indexName:v}),m=[],_=h(e.indexName,v,"copy",n(n({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(_),f((u?_.wait(d):_).then((function(){var e=y(t,n(n({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return m.push(e),u?e.wait(d):e})).then((function(){var t=h(v,e.indexName,"move",d);return m.push(t),u?t.wait(d):t})).then((function(){return Promise.all(m)})).then((function(e){var t=o(e,3),n=t[0],r=t[1],i=t[2];return{objectIDs:r.objectIDs,taskIDs:[n.taskID].concat(a(r.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,r){return Ve(e)(t,n(n({},r),{},{clearExistingRules:!0}))}},We=function(e){return function(t,r){return Je(e)(t,n(n({},r),{},{clearExistingSynonyms:!0}))}},ze=function(e){return function(t,n){return f(Ye(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Ye=function(e){return function(t,n){var o=n||{},a=o.autoGenerateObjectIDIfNotExist,i=r(o,["autoGenerateObjectIDIfNotExist"]),s=a?nt.AddObject:nt.UpdateObject;if(s===nt.UpdateObject){var u=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(u=(d=h.next()).done);u=!0)if(void 0===d.value.objectID)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}return be(e)(t,s,i)}},Ke=function(e){return function(t,n){return Ve(e)([t],n)}},Ve=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=o.clearExistingRules,s=v(r(o,["forwardToReplicas","clearExistingRules"]));return a&&(s.queryParameters.forwardToReplicas=1),i&&(s.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},s),(function(t,n){return tt(e)(t.taskID,n)}))}},Ge=function(e){return function(t,n){return Je(e)([t],n)}},Je=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,s=o.replaceExistingSynonyms,u=v(r(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(u.queryParameters.forwardToReplicas=1),(s||i)&&(u.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},u),(function(t,n){return tt(e)(t.taskID,n)}))}},Qe=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},$e=function(e){return function(t,n,r){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},Xe=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n)}},Ze=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n)}},et=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=v(r(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:E,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,n){return tt(e)(t.taskID,n)}))}},tt=function(e){return function(t,n){return l((function(r){return function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},n)}}(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},nt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},rt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,at=2,it=3;function st(e,t,r){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(a),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:(o=it,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return at>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:s({caches:[i({key:"".concat("4.8.0","-").concat(e)}),u()]}),userAgent:C("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,r=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=k(n(n({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(n(n(n({},a),r),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:ue,multipleGetObjects:ce,multipleQueries:le,copyIndex:K,copySettings:G,copySynonyms:J,copyRules:V,moveIndex:se,listIndices:ae,getLogs:X,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:$,addApiKey:W,listApiKeys:re,updateApiKey:ge,deleteApiKey:Q,restoreApiKey:he,assignUserID:z,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ie,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return ne(e)(t,{methods:{batch:ve,delete:Se,findAnswers:je,getObject:Ae,getObjects:Ne,saveObject:ze,saveObjects:Ye,search:Qe,searchForFacetValues:$e,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:qe,partialUpdateObjects:Le,deleteObject:Ee,deleteObjects:xe,deleteBy:Te,clearObjects:we,browseObjects:ye,getObjectPosition:Re,findObject:De,exists:Ce,saveSynonym:Ge,saveSynonyms:Je,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:_e,deleteSynonym:ke,clearSynonyms:Ie,replaceAllObjects:Fe,replaceAllSynonyms:We,searchRules:Xe,getRule:Me,deleteRule:Pe,saveRule:Ke,saveRules:Ve,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",r=c(g.WithinHeaders,e.appId,e.apiKey),o=k(n(n({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(n(n(n({},a),e),{},{methods:{addABTest:N,getABTest:U,getABTests:B,stopABTest:q,deleteABTest:M}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",r=c(g.WithinHeaders,e.appId,e.apiKey),o=k(n(n({hosts:[{url:"recommendation.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(n(n(n({},a),e),{},{methods:{getPersonalizationStrategy:L,setPersonalizationStrategy:F}}))}}}}))}return st.version="4.8.0",st}()})),h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},h(e,t)};function p(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}var y,m=function(e,t){this.target=t,this.type=e},_=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return p(t,e),t}(m),b=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return p(t,e),t}(m),w=function(){if("undefined"!=typeof WebSocket)return WebSocket},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},I=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?O.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?O.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,v(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?O.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?O.minReconnectionDelay:r,a=e.maxReconnectionDelay,i=void 0===a?O.maxReconnectionDelay:a,s=0;return this._retryCount>0&&(s=o*Math.pow(n,this._retryCount-1))>i&&(s=i),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?O.maxRetries:n,o=t.connectionTimeout,a=void 0===o?O.connectionTimeout:o,i=t.WebSocket,s=void 0===i?w():i;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!function(e){return void 0!==e&&!!e&&2===e.CLOSING}(s))throw Error("No valid WebSocket class provided");this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new _(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new b(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),T=Object.freeze({__proto__:null,default:I}),S=new Uint8Array(16);function E(){if(!y&&!(y="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(S)}var x=/^(?:[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 P(e){return"string"==typeof e&&x.test(e)}for(var k,C,j=[],D=0;D<256;++D)j.push((D+256).toString(16).substr(1));function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(j[e[t+0]]+j[e[t+1]]+j[e[t+2]]+j[e[t+3]]+"-"+j[e[t+4]]+j[e[t+5]]+"-"+j[e[t+6]]+j[e[t+7]]+"-"+j[e[t+8]]+j[e[t+9]]+"-"+j[e[t+10]]+j[e[t+11]]+j[e[t+12]]+j[e[t+13]]+j[e[t+14]]+j[e[t+15]]).toLowerCase();if(!P(n))throw TypeError("Stringified UUID is invalid");return n}var R=0,N=0;function M(e){if(!P(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function U(e,t,n){function r(e,r,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=M(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(r),i.set(e,r.length),(i=n(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var s=0;s<16;++s)o[a+s]=i[s];return o}return A(i)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function B(e){return 14+(e+64>>>9<<4)+1}function q(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function L(e,t,n,r,o,a){return q((i=q(q(t,e),q(r,a)))<<(s=o)|i>>>32-s,n);var i,s}function F(e,t,n,r,o,a,i){return L(t&n|~t&r,e,t,o,a,i)}function H(e,t,n,r,o,a,i){return L(t&r|n&~r,e,t,o,a,i)}function W(e,t,n,r,o,a,i){return L(t^n^r,e,t,o,a,i)}function z(e,t,n,r,o,a,i){return L(n^(t|~r),e,t,o,a,i)}var Y=U("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(a>>>4&15)+r.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[B(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var s=n,u=r,c=o,l=a;n=F(n,r,o,a,e[i],7,-680876936),a=F(a,n,r,o,e[i+1],12,-389564586),o=F(o,a,n,r,e[i+2],17,606105819),r=F(r,o,a,n,e[i+3],22,-1044525330),n=F(n,r,o,a,e[i+4],7,-176418897),a=F(a,n,r,o,e[i+5],12,1200080426),o=F(o,a,n,r,e[i+6],17,-1473231341),r=F(r,o,a,n,e[i+7],22,-45705983),n=F(n,r,o,a,e[i+8],7,1770035416),a=F(a,n,r,o,e[i+9],12,-1958414417),o=F(o,a,n,r,e[i+10],17,-42063),r=F(r,o,a,n,e[i+11],22,-1990404162),n=F(n,r,o,a,e[i+12],7,1804603682),a=F(a,n,r,o,e[i+13],12,-40341101),o=F(o,a,n,r,e[i+14],17,-1502002290),n=H(n,r=F(r,o,a,n,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=H(a,n,r,o,e[i+6],9,-1069501632),o=H(o,a,n,r,e[i+11],14,643717713),r=H(r,o,a,n,e[i],20,-373897302),n=H(n,r,o,a,e[i+5],5,-701558691),a=H(a,n,r,o,e[i+10],9,38016083),o=H(o,a,n,r,e[i+15],14,-660478335),r=H(r,o,a,n,e[i+4],20,-405537848),n=H(n,r,o,a,e[i+9],5,568446438),a=H(a,n,r,o,e[i+14],9,-1019803690),o=H(o,a,n,r,e[i+3],14,-187363961),r=H(r,o,a,n,e[i+8],20,1163531501),n=H(n,r,o,a,e[i+13],5,-1444681467),a=H(a,n,r,o,e[i+2],9,-51403784),o=H(o,a,n,r,e[i+7],14,1735328473),n=W(n,r=H(r,o,a,n,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=W(a,n,r,o,e[i+8],11,-2022574463),o=W(o,a,n,r,e[i+11],16,1839030562),r=W(r,o,a,n,e[i+14],23,-35309556),n=W(n,r,o,a,e[i+1],4,-1530992060),a=W(a,n,r,o,e[i+4],11,1272893353),o=W(o,a,n,r,e[i+7],16,-155497632),r=W(r,o,a,n,e[i+10],23,-1094730640),n=W(n,r,o,a,e[i+13],4,681279174),a=W(a,n,r,o,e[i],11,-358537222),o=W(o,a,n,r,e[i+3],16,-722521979),r=W(r,o,a,n,e[i+6],23,76029189),n=W(n,r,o,a,e[i+9],4,-640364487),a=W(a,n,r,o,e[i+12],11,-421815835),o=W(o,a,n,r,e[i+15],16,530742520),n=z(n,r=W(r,o,a,n,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=z(a,n,r,o,e[i+7],10,1126891415),o=z(o,a,n,r,e[i+14],15,-1416354905),r=z(r,o,a,n,e[i+5],21,-57434055),n=z(n,r,o,a,e[i+12],6,1700485571),a=z(a,n,r,o,e[i+3],10,-1894986606),o=z(o,a,n,r,e[i+10],15,-1051523),r=z(r,o,a,n,e[i+1],21,-2054922799),n=z(n,r,o,a,e[i+8],6,1873313359),a=z(a,n,r,o,e[i+15],10,-30611744),o=z(o,a,n,r,e[i+6],15,-1560198380),r=z(r,o,a,n,e[i+13],21,1309151649),n=z(n,r,o,a,e[i+4],6,-145523070),a=z(a,n,r,o,e[i+11],10,-1120210379),o=z(o,a,n,r,e[i+2],15,718787259),r=z(r,o,a,n,e[i+9],21,-343485551),n=q(n,s),r=q(r,u),o=q(o,c),a=q(a,l)}return[n,r,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(B(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}));function K(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function V(e,t){return e<<t|e>>>32-t}var G=U("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),s=new Array(i),u=0;u<i;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*u+4*l]<<24|e[64*u+4*l+1]<<16|e[64*u+4*l+2]<<8|e[64*u+4*l+3];s[u]=c}s[i-1][14]=8*(e.length-1)/Math.pow(2,32),s[i-1][14]=Math.floor(s[i-1][14]),s[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=s[f][h];for(var p=16;p<80;++p)d[p]=V(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=n[0],v=n[1],y=n[2],m=n[3],_=n[4],b=0;b<80;++b){var w=Math.floor(b/20),O=V(g,5)+K(w,v,y,m)+_+t[w]+d[b]>>>0;_=m,m=y,y=V(v,30)>>>0,v=g,g=O}n[0]=n[0]+g>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+y>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+_>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var J=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,o=t||new Array(16),a=(e=e||{}).node||k,i=void 0!==e.clockseq?e.clockseq:C;if(null==a||null==i){var s=e.random||(e.rng||E)();null==a&&(a=k=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==i&&(i=C=16383&(s[6]<<8|s[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:N+1,l=u-R+(c-N)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||u>R)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");R=u,N=c,C=i;var f=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;o[r++]=f>>>24&255,o[r++]=f>>>16&255,o[r++]=f>>>8&255,o[r++]=255&f;var d=u/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16,o[r++]=d>>>16&255,o[r++]=i>>>8|128,o[r++]=255&i;for(var h=0;h<6;++h)o[r+h]=a[h];return t||A(o)},v3:Y,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||E)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return A(r)},v5:G,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!P(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:P,stringify:A,parse:M}),Q=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return e.nightlyRate})))}})),$=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,n){return void 0===t||void 0===n||0===n?0:e<t?-1*(e-t)/t:e>n?-1*(e-n)/n:0}}));function X(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Z(e){X(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function ee(e){X(1,arguments);var t=Z(e);return!isNaN(t)}var te={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ne(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var re={date:ne({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ne({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ne({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ae(e){return function(t,n){var r,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;r=e.formattingValues[i]||e.formattingValues[a]}else{var s=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;r=e.values[u]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var ie={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ae({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ae({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:ae({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ae({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ae({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function se(e){return function(t,n){var r=String(t),o=n||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=r.match(i);if(!s)return null;var u,c=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return u="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(l,(function(e){return e.test(c)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(l,(function(e){return e.test(c)})),u=e.valueCallback?e.valueCallback(u):u,{value:u=o.valueCallback?o.valueCallback(u):u,rest:r.slice(c.length)}}}var ue,ce={ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},o=n.match(ue.matchPattern);if(!o)return null;var a=o[0],i=n.match(ue.parsePattern);if(!i)return null;var s=ue.valueCallback?ue.valueCallback(i[0]):i[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(a.length)}}),era:se({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:se({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:se({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:se({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:se({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},le={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof te[e]?te[e]:1===t?te[e].one:te[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:re,formatRelative:function(e,t,n,r){return oe[e]},localize:ie,match:ce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fe(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function de(e,t){X(2,arguments);var n=Z(e).getTime(),r=fe(t);return new Date(n+r)}function he(e,t){X(2,arguments);var n=fe(t);return de(e,-n)}function pe(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var ge=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return pe("yy"===t?r%100:r,t.length)},ve=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):pe(n+1,2)},ye=function(e,t){return pe(e.getUTCDate(),t.length)},me=function(e,t){return pe(e.getUTCHours()%12||12,t.length)},_e=function(e,t){return pe(e.getUTCHours(),t.length)},be=function(e,t){return pe(e.getUTCMinutes(),t.length)},we=function(e,t){return pe(e.getUTCSeconds(),t.length)},Oe=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return pe(Math.floor(r*Math.pow(10,n-3)),t.length)},Ie=864e5;function Te(e){X(1,arguments);var t=1,n=Z(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function Se(e){X(1,arguments);var t=Z(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Te(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=Te(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Ee(e){X(1,arguments);var t=Se(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Te(n);return r}var xe=6048e5;function Pe(e,t){X(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:fe(o),i=null==n.weekStartsOn?a:fe(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Z(e),u=s.getUTCDay(),c=(u<i?7:0)+u-i;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function ke(e,t){X(1,arguments);var n=Z(e,t),r=n.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,s=null==i?1:fe(i),u=null==o.firstWeekContainsDate?s:fe(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,u),c.setUTCHours(0,0,0,0);var l=Pe(c,t),f=new Date(0);f.setUTCFullYear(r,0,u),f.setUTCHours(0,0,0,0);var d=Pe(f,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ce(e,t){X(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.firstWeekContainsDate,a=null==o?1:fe(o),i=null==n.firstWeekContainsDate?a:fe(n.firstWeekContainsDate),s=ke(e,t),u=new Date(0);u.setUTCFullYear(s,0,i),u.setUTCHours(0,0,0,0);var c=Pe(u,t);return c}var je=6048e5;var De="midnight",Ae="noon",Re="morning",Ne="afternoon",Me="evening",Ue="night",Be={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ge(e,t)},Y:function(e,t,n,r){var o=ke(e,r),a=o>0?o:1-o;return"YY"===t?pe(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):pe(a,t.length)},R:function(e,t){return pe(Se(e),t.length)},u:function(e,t){return pe(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return pe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return pe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ve(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return pe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){X(1,arguments);var n=Z(e),r=Pe(n,t).getTime()-Ce(n,t).getTime();return Math.round(r/je)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):pe(o,t.length)},I:function(e,t,n){var r=function(e){X(1,arguments);var t=Z(e),n=Te(t).getTime()-Ee(t).getTime();return Math.round(n/xe)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):pe(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ye(e,t)},D:function(e,t,n){var r=function(e){X(1,arguments);var t=Z(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/Ie)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):pe(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return pe(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return pe(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return pe(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?Ae:0===o?De:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?Me:o>=12?Ne:o>=4?Re:Ue,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return me(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):_e(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):pe(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):pe(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):be(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):we(e,t)},S:function(e,t){return Oe(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Le(o);case"XXXX":case"XX":return Fe(o);default:return Fe(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Le(o);case"xxxx":case"xx":return Fe(o);default:return Fe(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qe(o,":");default:return"GMT"+Fe(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qe(o,":");default:return"GMT"+Fe(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return pe(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return pe((r._originalDate||e).getTime(),t.length)}};function qe(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;if(0===a)return n+String(o);var i=t||"";return n+String(o)+i+pe(a,2)}function Le(e,t){return e%60==0?(e>0?"-":"+")+pe(Math.abs(e)/60,2):Fe(e,t)}function Fe(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+pe(Math.floor(o/60),2)+n+pe(o%60,2)}function He(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function We(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var ze={p:We,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),o=r[1],a=r[2];if(!a)return He(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",He(o,t)).replace("{{time}}",We(a,t))}},Ye=6e4;function Ke(e){return e.getTime()%Ye}function Ve(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var r=n>0?(Ye+Ke(t))%Ye:Ke(t);return n*Ye+r}var Ge=["D","DD"],Je=["YY","YYYY"];function Qe(e){return-1!==Ge.indexOf(e)}function $e(e){return-1!==Je.indexOf(e)}function Xe(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Ze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,et=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tt=/^'([^]*?)'?$/,nt=/''/g,rt=/[a-zA-Z]/;function ot(e){return e.match(tt)[1].replace(nt,"'")}var at=Object.freeze({__proto__:null,default:function(e,t,n){X(2,arguments);var r=String(t),o=n||{},a=o.locale||le,i=a.options&&a.options.firstWeekContainsDate,s=null==i?1:fe(i),u=null==o.firstWeekContainsDate?s:fe(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:fe(c),f=null==o.weekStartsOn?l:fe(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Z(e);if(!ee(d))throw new RangeError("Invalid time value");var h=Ve(d),p=he(d,h),g={firstWeekContainsDate:u,weekStartsOn:f,locale:a,_originalDate:d},v=r.match(et).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,ze[t])(e,a.formatLong,g):e})).join("").match(Ze).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return ot(n);var i=Be[r];if(i)return!o.useAdditionalWeekYearTokens&&$e(n)&&Xe(n,t,e),!o.useAdditionalDayOfYearTokens&&Qe(n)&&Xe(n,t,e),i(p,n,a.localize,g);if(r.match(rt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return v}});function it(e,t){X(2,arguments);var n=Z(e),r=fe(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}var st=Object.freeze({__proto__:null,default:it});function ut(e,t){X(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:fe(o),i=null==n.weekStartsOn?a:fe(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var s=Z(e),u=s.getDay(),c=6+(u<i?-7:0)-(u-i);return s.setHours(0,0,0,0),s.setDate(s.getDate()+c),s}var ct=Object.freeze({__proto__:null,default:function(e){return X(1,arguments),ut(e,{weekStartsOn:1})}});var lt=Object.freeze({__proto__:null,default:function(e,t){X(2,arguments);var n=fe(t),r=7*n;return it(e,r)}}),ft=36e5,dt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ht=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,pt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,gt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function vt(e){var t,n={},r=e.split(dt.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1],dt.timeZoneDelimiter.test(n.date)&&(n.date=e.split(dt.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var o=dt.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}function yt(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:null};var o=r[1]&&parseInt(r[1]),a=r[2]&&parseInt(r[2]);return{year:null==a?o:100*a,restDateString:e.slice((r[1]||r[2]).length)}}function mt(e,t){if(null===t)return null;var n=e.match(ht);if(!n)return null;var r=!!n[4],o=_t(n[1]),a=_t(n[2])-1,i=_t(n[3]),s=_t(n[4]),u=_t(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,a=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,s,u):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(It[t]||(Tt(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(Tt(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function _t(e){return e?parseInt(e):1}function bt(e){var t=e.match(pt);if(!t)return null;var n=wt(t[1]),r=wt(t[2]),o=wt(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*ft+6e4*r+1e3*o:NaN}function wt(e){return e&&parseFloat(e.replace(",","."))||0}function Ot(e){if("Z"===e)return 0;var t=e.match(gt);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*ft+6e4*o):NaN}var It=[31,null,31,30,31,30,31,31,30,31,30,31];function Tt(e){return e%400==0||e%4==0&&e%100}var St=Object.freeze({__proto__:null,default:function(e,t){X(1,arguments);var n=t||{},r=null==n.additionalDigits?2:fe(n.additionalDigits);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=vt(e);if(a.date){var i=yt(a.date,r);o=mt(i.restDateString,i.year)}if(isNaN(o)||!o)return new Date(NaN);var s,u=o.getTime(),c=0;if(a.time&&(c=bt(a.time),isNaN(c)||null===c))return new Date(NaN);if(!a.timezone){var l=new Date(u+c),f=new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());return f.setFullYear(l.getUTCFullYear()),f}return s=Ot(a.timezone),isNaN(s)?new Date(NaN):new Date(u+c+s)}}),Et=n(f),xt=n(at),Pt=n(st),kt=n(ct),Ct=n(lt),jt=n(St),Dt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var n=Et.__importDefault(xt),r=Et.__importDefault(Pt),o=Et.__importDefault(kt),a=Et.__importDefault(Ct),i=Et.__importDefault(jt);function s(e){return(0,i.default)("".concat(e," 12:00:00"))}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=s;var u=function(e,t){return(0,r.default)(e,t)};t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=s((0,n.default)(new Date,t.DATE_FORMAT));c=void 0!==l?s(l):d?u(g,d):function(e){for(var i,u=e.daysFromNow,c=e.blockedDefaultDates,l=s((0,n.default)(new Date,t.DATE_FORMAT)),f=(0,o.default)((0,r.default)(l,u));i=(0,n.default)(f,t.DATE_FORMAT),c.includes(i);)f=(0,a.default)(f,1);return f}(i);var v=void 0===f?u(c,p):s(f);return{checkIn:(0,n.default)(c,t.DATE_FORMAT),checkOut:(0,n.default)(v,t.DATE_FORMAT)}}})),At=t((function(e,t){function n(e){void 0===e&&(e=[]);var t={},n={};e.forEach((function(e){var n=e[0],r=e[1],o=e[2],a=e[3];r&&(t[n]=(0,$.calculateDiscount)(r,o,a))}));var r=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var a=e[0],i=e[1],s=(e[2],e[3]),u=i&&s&&s>0?o===r?1:(t[a]-r)/(o-r):void 0;void 0!==u&&(n[a]=Number(u.toFixed(2)))})),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=n,t.getDealScores=function(e){var t=e.offset,r=e.anchorHotelId,o=e.hotelIds,a=e.hotelEntities,i=e.hotelOfferEntities,s=(void 0===r||t>0?o:Et.__spreadArray([r],o,!0)).map((function(e){var t,n,r,o=a[e],s=i[e],u=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=u[0],l=u[1];return[e,null===(r=null===(n=null==s?void 0:s.offers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.nightlyRate,c,l]}));return n(s)}})),Rt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var n={},r={},o=0,a=e.length;o<a;)r[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(r,i)||(n[i]=t[i]);return n}}));function Nt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("production"!==process.env.NODE_ENV){var o=Cn[e],a=o?"function"==typeof o?o.apply(null,n):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Mt(e){return!!e&&!!e[Pn]}function Ut(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===jn}(e)||Array.isArray(e)||!!e[xn]||!!e.constructor[xn]||zt(e)||Yt(e))}function Bt(e,t,n){void 0===n&&(n=!1),0===qt(e)?(n?Object.keys:Dn)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function qt(e){var t=e[Pn];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:zt(e)?2:Yt(e)?3:0}function Lt(e,t){return 2===qt(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ft(e,t){return 2===qt(e)?e.get(t):e[t]}function Ht(e,t,n){var r=qt(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function Wt(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function zt(e){return In&&e instanceof Map}function Yt(e){return Tn&&e instanceof Set}function Kt(e){return e.o||e.t}function Vt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=An(e);delete t[Pn];for(var n=Dn(t),r=0;r<n.length;r++){var o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Gt(e,t){return void 0===t&&(t=!1),Qt(e)||Mt(e)||!Ut(e)||(qt(e)>1&&(e.set=e.add=e.clear=e.delete=Jt),Object.freeze(e),t&&Bt(e,(function(e,t){return Gt(t,!0)}),!0)),e}function Jt(){Nt(2)}function Qt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function $t(e){var t=Rn[e];return t||Nt(18,e),t}function Xt(e,t){Rn[e]||(Rn[e]=t)}function Zt(){return"production"===process.env.NODE_ENV||wn||Nt(0),wn}function en(e,t){t&&($t("Patches"),e.u=[],e.s=[],e.v=t)}function tn(e){nn(e),e.p.forEach(on),e.p=null}function nn(e){e===wn&&(wn=e.l)}function rn(e){return wn={p:[],l:wn,h:e,m:!0,_:0}}function on(e){var t=e[Pn];0===t.i||1===t.i?t.j():t.O=!0}function an(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||$t("ES5").S(t,e,r),r?(n[Pn].P&&(tn(t),Nt(4)),Ut(e)&&(e=sn(t,e),t.l||cn(t,e)),t.u&&$t("Patches").M(n[Pn],e,t.u,t.s)):e=sn(t,n,[]),tn(t),t.u&&t.v(t.u,t.s),e!==En?e:void 0}function sn(e,t,n){if(Qt(t))return t;var r=t[Pn];if(!r)return Bt(t,(function(o,a){return un(e,r,t,o,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return cn(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=Vt(r.k):r.o;Bt(3===r.i?new Set(o):o,(function(t,a){return un(e,r,o,t,a,n)})),cn(e,o,!1),n&&e.u&&$t("Patches").R(r,n,e.u,e.s)}return r.o}function un(e,t,n,r,o,a){if("production"!==process.env.NODE_ENV&&o===n&&Nt(5),Mt(o)){var i=sn(e,o,a&&t&&3!==t.i&&!Lt(t.D,r)?a.concat(r):void 0);if(Ht(n,r,i),!Mt(i))return;e.m=!1}if(Ut(o)&&!Qt(o)){if(!e.h.F&&e._<1)return;sn(e,o),t&&t.A.l||cn(e,o)}}function cn(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Gt(t,n)}function ln(e,t){var n=e[Pn];return(n?Kt(n):e)[t]}function fn(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function dn(e){e.P||(e.P=!0,e.l&&dn(e.l))}function hn(e){e.o||(e.o=Vt(e.t))}function pn(e,t,n){var r=zt(t)?$t("MapSet").N(t,n):Yt(t)?$t("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Zt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,a=Nn;n&&(o=[r],a=Mn);var i=Proxy.revocable(o,a),s=i.revoke,u=i.proxy;return r.k=u,r.j=s,u}(t,n):$t("ES5").J(t,n);return(n?n.A:Zt()).p.push(r),r}function gn(e){return Mt(e)||Nt(22,e),function e(t){if(!Ut(t))return t;var n,r=t[Pn],o=qt(t);if(r){if(!r.P&&(r.i<4||!$t("ES5").K(r)))return r.t;r.I=!0,n=vn(t,o),r.I=!1}else n=vn(t,o);return Bt(n,(function(t,o){r&&Ft(r.t,t)===o||Ht(n,t,e(o))})),3===o?new Set(n):n}(e)}function vn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Vt(e)}function yn(){function e(e,t){var n=a[e];return n?n.enumerable=t:a[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Pn];return"production"!==process.env.NODE_ENV&&o(t),Nn.get(t,e)},set:function(t){var n=this[Pn];"production"!==process.env.NODE_ENV&&o(n),Nn.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Pn];if(!o.P)switch(o.i){case 5:r(o)&&dn(o);break;case 4:n(o)&&dn(o)}}}function n(e){for(var t=e.t,n=e.k,r=Dn(n),o=r.length-1;o>=0;o--){var a=r[o];if(a!==Pn){var i=t[a];if(void 0===i&&!Lt(t,a))return!0;var s=n[a],u=s&&s[Pn];if(u?u.t!==i:!Wt(s,i))return!0}}var c=!!t[Pn];return r.length!==Dn(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}function o(e){e.O&&Nt(3,JSON.stringify(Kt(e)))}var a={};Xt("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var a=An(n);delete a[Pn];for(var i=Dn(a),s=0;s<i.length;s++){var u=i[s];a[u]=e(u,t||!!a[u].enumerable)}return Object.create(Object.getPrototypeOf(n),a)}(r,t),a={i:r?5:4,A:n?n.A:Zt(),P:!1,I:!1,D:{},l:n,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Pn,{value:a,writable:!0}),o},S:function(e,n,o){o?Mt(n)&&n[Pn].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Pn];if(n){var o=n.t,a=n.k,i=n.D,s=n.i;if(4===s)Bt(a,(function(t){t!==Pn&&(void 0!==o[t]||Lt(o,t)?i[t]||e(a[t]):(i[t]=!0,dn(n)))})),Bt(o,(function(e){void 0!==a[e]||Lt(a,e)||(i[e]=!1,dn(n))}));else if(5===s){if(r(n)&&(dn(n),i.length=!0),a.length<o.length)for(var u=a.length;u<o.length;u++)i[u]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}function mn(){function e(t){if(!Ut(t))return t;if(Array.isArray(t))return t.map(e);if(zt(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(Yt(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return Lt(t,xn)&&(n[xn]=t[xn]),n}function t(t){return Mt(t)?e(t):t}var n="add";Xt("Patches",{$:function(t,r){return r.forEach((function(r){for(var o=r.path,a=r.op,i=t,s=0;s<o.length-1;s++){var u=qt(i),c=""+o[s];0!==u&&1!==u||"__proto__"!==c&&"constructor"!==c||Nt(24),"function"==typeof i&&"prototype"===c&&Nt(24),"object"!=typeof(i=Ft(i,c))&&Nt(15,o.join("/"))}var l=qt(i),f=e(r.value),d=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(d,f);case 3:Nt(16);default:return i[d]=f}case n:switch(l){case 1:return i.splice(d,0,f);case 2:return i.set(d,f);case 3:return i.add(f);default:return i[d]=f}case"remove":switch(l){case 1:return i.splice(d,1);case 2:return i.delete(d);case 3:return i.delete(r.value);default:return delete i[d]}default:Nt(17,a)}})),t},R:function(e,r,o,a){switch(e.i){case 0:case 4:case 2:return function(e,r,o,a){var i=e.t,s=e.o;Bt(e.D,(function(e,u){var c=Ft(i,e),l=Ft(s,e),f=u?Lt(i,e)?"replace":n:"remove";if(c!==l||"replace"!==f){var d=r.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===n?{op:"remove",path:d}:"remove"===f?{op:n,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,r,o,a);case 5:case 1:return function(e,r,o,a){var i=e.t,s=e.D,u=e.o;if(u.length<i.length){var c=[u,i];i=c[0],u=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(s[f]&&u[f]!==i[f]){var d=r.concat([f]);o.push({op:"replace",path:d,value:t(u[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<u.length;h++){var p=r.concat([h]);o.push({op:n,path:p,value:t(u[h])})}i.length<u.length&&a.push({op:"replace",path:r.concat(["length"]),value:i.length})}(e,r,o,a);case 3:return function(e,t,r,o){var a=e.t,i=e.o,s=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([s]);r.push({op:"remove",path:a,value:e}),o.unshift({op:n,path:a,value:e})}s++})),s=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([s]);r.push({op:n,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}s++}))}(e,r,o,a)}},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===En?void 0:t}),r.push({op:"replace",path:[],value:e.t})}})}function _n(){function e(e,t){function n(){this.constructor=e}o(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(Ut(t)){var n=pn(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function r(e){e.O&&Nt(3,JSON.stringify(Kt(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},a=function(){function n(e,t){return this[Pn]={i:2,l:t,A:t?t.A:Zt(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return Kt(this[Pn]).size}}),o.has=function(e){return Kt(this[Pn]).has(e)},o.set=function(e,n){var o=this[Pn];return r(o),Kt(o).has(e)&&Kt(o).get(e)===n||(t(o),dn(o),o.D.set(e,!0),o.o.set(e,n),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var n=this[Pn];return r(n),t(n),dn(n),n.D.set(e,!1),n.o.delete(e),!0},o.clear=function(){var e=this[Pn];r(e),Kt(e).size&&(t(e),dn(e),e.D=new Map,Bt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var n=this;Kt(this[Pn]).forEach((function(r,o){e.call(t,n.get(o),o,n)}))},o.get=function(e){var n=this[Pn];r(n);var o=Kt(n).get(e);if(n.I||!Ut(o))return o;if(o!==n.t.get(e))return o;var a=pn(n.A.h,o,n);return t(n),n.o.set(e,a),a},o.keys=function(){return Kt(this[Pn]).keys()},o.values=function(){var e,t=this,n=this.keys();return(e={})[kn]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,n=this.keys();return(e={})[kn]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},o[kn]=function(){return this.entries()},n}(),i=function(){function t(e,t){return this[Pn]={i:3,l:t,A:t?t.A:Zt(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return Kt(this[Pn]).size}}),o.has=function(e){var t=this[Pn];return r(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[Pn];return r(t),this.has(e)||(n(t),dn(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Pn];return r(t),n(t),dn(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Pn];r(e),Kt(e).size&&(n(e),dn(e),e.o.clear())},o.values=function(){var e=this[Pn];return r(e),n(e),e.o.values()},o.entries=function(){var e=this[Pn];return r(e),n(e),e.o.entries()},o.keys=function(){return this.values()},o[kn]=function(){return this.values()},o.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();Xt("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var bn,wn,On="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),In="undefined"!=typeof Map,Tn="undefined"!=typeof Set,Sn="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,En=On?Symbol.for("immer-nothing"):((bn={})["immer-nothing"]=!0,bn),xn=On?Symbol.for("immer-draftable"):"__$immer_draftable",Pn=On?Symbol.for("immer-state"):"__$immer_state",kn="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Cn={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},jn=""+Object.prototype.constructor,Dn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,An=Object.getOwnPropertyDescriptors||function(e){var t={};return Dn(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Rn={},Nn={get:function(e,t){if(t===Pn)return e;var n=Kt(e);if(!Lt(n,t))return function(e,t,n){var r,o=fn(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!Ut(r)?r:r===ln(e.t,t)?(hn(e),e.o[t]=pn(e.A.h,r,e)):r},has:function(e,t){return t in Kt(e)},ownKeys:function(e){return Reflect.ownKeys(Kt(e))},set:function(e,t,n){var r=fn(Kt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=ln(Kt(e),t),a=null==o?void 0:o[Pn];if(a&&a.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(Wt(n,o)&&(void 0!==n||Lt(e.t,t)))return!0;hn(e),dn(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==ln(e.t,t)||t in e.t?(e.D[t]=!1,hn(e),dn(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Kt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){Nt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Nt(12)}},Mn={};Bt(Nn,(function(e,t){Mn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Mn.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&Nt(13),Nn.deleteProperty.call(this,e[0],t)},Mn.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&Nt(14),Nn.set.call(this,e[0],t,n,e[0])};var Un=function(){function e(e){var t=this;this.g=Sn,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return a.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var i;if("function"!=typeof n&&Nt(6),void 0!==r&&"function"!=typeof r&&Nt(7),Ut(e)){var s=rn(t),u=pn(t,e,void 0),c=!0;try{i=n(u),c=!1}finally{c?tn(s):nn(s)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return en(s,r),an(e,s)}),(function(e){throw tn(s),e})):(en(s,r),an(i,s))}if(!e||"object"!=typeof e){if((i=n(e))===En)return;return void 0===i&&(i=e),t.F&&Gt(i,!0),i}Nt(21,e)},this.produceWithPatches=function(e,n){return"function"==typeof e?function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,n,(function(e,t){r=e,o=t})),r,o];var r,o},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Ut(e)||Nt(8),Mt(e)&&(e=gn(e));var t=rn(this),n=pn(this,e,void 0);return n[Pn].C=!0,nn(t),n},t.finishDraft=function(e,t){var n=e&&e[Pn];"production"!==process.env.NODE_ENV&&(n&&n.C||Nt(9),n.I&&Nt(10));var r=n.A;return en(r,t),an(void 0,r)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Sn&&Nt(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var o=$t("Patches").$;return Mt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(n+1))}))},e}(),Bn=new Un,qn=Bn.produce,Ln=Bn.produceWithPatches.bind(Bn),Fn=Bn.setAutoFreeze.bind(Bn),Hn=Bn.setUseProxies.bind(Bn),Wn=Bn.applyPatches.bind(Bn),zn=Bn.createDraft.bind(Bn),Yn=Bn.finishDraft.bind(Bn),Kn=Object.freeze({__proto__:null,default:qn,Immer:Un,applyPatches:Wn,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:zn,current:gn,enableAllPlugins:function(){yn(),_n(),mn()},enableES5:yn,enableMapSet:_n,enablePatches:mn,finishDraft:Yn,freeze:Gt,immerable:xn,isDraft:Mt,isDraftable:Ut,nothing:En,original:function(e){return Mt(e)||Nt(23,e),e[Pn].t},produce:qn,produceWithPatches:Ln,setAutoFreeze:Fn,setUseProxies:Hn}),Vn=n(Kn),Gn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=(0,Vn.produce)(t,e)}}}})),Jn=t((function(e,t){e.exports=function e(t,n,o){function a(s,u){if(!n[s]){if(!t[s]){if(!u&&r)return r();if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return a(t[s][1][e]||e)}),c,c.exports,e,t,n,o)}return n[s].exports}for(var i=r,s=0;s<o.length;s++)a(o[s]);return a}({1:[function(e,t,n){(function(r,o,a,i,s,u,c,l,f){var d=e("crypto");function h(e,t){return function(e,t){var n;if(void 0===(n="passthrough"!==t.algorithm?d.createHash(t.algorithm):new _).write&&(n.write=n.update,n.end=n.update),m(t,n).dispatch(e),n.update||n.end(""),n.digest)return n.digest("buffer"===t.encoding?void 0:t.encoding);var r=n.read();return"buffer"!==t.encoding?r.toString(t.encoding):r}(e,t=v(e,t))}(n=t.exports=h).sha1=function(e){return h(e)},n.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(e){return h(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=d.getHashes?d.getHashes().slice():["sha1","md5"];p.push("passthrough");var g=["buffer","hex","binary","base64"];function v(e,t){t=t||{};var n={};if(n.algorithm=t.algorithm||"sha1",n.encoding=t.encoding||"hex",n.excludeValues=!!t.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===t.ignoreUnknown,n.respectType=!1!==t.respectType,n.respectFunctionNames=!1!==t.respectFunctionNames,n.respectFunctionProperties=!1!==t.respectFunctionProperties,n.unorderedArrays=!0===t.unorderedArrays,n.unorderedSets=!1!==t.unorderedSets,n.unorderedObjects=!1!==t.unorderedObjects,n.replacer=t.replacer||void 0,n.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var r=0;r<p.length;++r)p[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=p[r]);if(-1===p.indexOf(n.algorithm))throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(n.encoding)&&"passthrough"!==n.algorithm)throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+g.join(", "));return n}function y(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function m(e,t,n){function r(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return n=n||[],{dispatch:function(t){return e.replacer&&(t=e.replacer(t)),this["_"+(null===t?"null":typeof t)](t)},_object:function(t){var o,i=Object.prototype.toString.call(t),s=/\[object (.*)\]/i.exec(i);if(s=(s=s?s[1]:"unknown:["+i+"]").toLowerCase(),0<=(o=n.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(n.push(t),void 0!==a&&a.isBuffer&&a.isBuffer(t))return r("buffer:"),r(t);if("object"===s||"function"===s||"asyncfunction"===s){var u=Object.keys(t);e.unorderedObjects&&(u=u.sort()),!1===e.respectType||y(t)||u.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(u=u.filter((function(t){return!e.excludeKeys(t)}))),r("object:"+u.length+":");var c=this;return u.forEach((function(n){c.dispatch(n),r(":"),e.excludeValues||c.dispatch(t[n]),r(",")}))}if(!this["_"+s]){if(e.ignoreUnknown)return r("["+s+"]");throw new Error('Unknown object type "'+s+'"')}this["_"+s](t)},_array:function(t,o){o=void 0!==o?o:!1!==e.unorderedArrays;var a=this;if(r("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return a.dispatch(e)}));var i=[],s=t.map((function(t){var r=new _,o=n.slice();return m(e,r,o).dispatch(t),i=i.concat(o.slice(n.length)),r.read().toString()}));return n=n.concat(i),s.sort(),this._array(s,!1)},_date:function(e){return r("date:"+e.toJSON())},_symbol:function(e){return r("symbol:"+e.toString())},_error:function(e){return r("error:"+e.toString())},_boolean:function(e){return r("bool:"+e.toString())},_string:function(e){r("string:"+e.length+":"),r(e.toString())},_function:function(t){r("fn:"),y(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return r("number:"+e.toString())},_xml:function(e){return r("xml:"+e.toString())},_null:function(){return r("Null")},_undefined:function(){return r("Undefined")},_regexp:function(e){return r("regex:"+e.toString())},_uint8array:function(e){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return r("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return r("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return r("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return r("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return r("url:"+e.toString())},_map:function(t){r("map:");var n=Array.from(t);return this._array(n,!1!==e.unorderedSets)},_set:function(t){r("set:");var n=Array.from(t);return this._array(n,!1!==e.unorderedSets)},_file:function(e){return r("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return r("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return r("domwindow")},_process:function(){return r("process")},_timer:function(){return r("timer")},_pipe:function(){return r("pipe")},_tcp:function(){return r("tcp")},_udp:function(){return r("udp")},_tty:function(){return r("tty")},_statwatcher:function(){return r("statwatcher")},_securecontext:function(){return r("securecontext")},_connection:function(){return r("connection")},_zlib:function(){return r("zlib")},_context:function(){return r("context")},_nodescript:function(){return r("nodescript")},_httpparser:function(){return r("httpparser")},_dataview:function(){return r("dataview")},_signal:function(){return r("signal")},_fsevent:function(){return r("fsevent")},_tlswrap:function(){return r("tlswrap")}}}function _(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}n.writeToStream=function(e,t,n){return void 0===n&&(n=t,t={}),m(t=v(e,t),n).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_5812b7fb.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,n){(function(e,t,r,o,a,i,s,u,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),o="0".charCodeAt(0),a="a".charCodeAt(0),i="A".charCodeAt(0),s="-".charCodeAt(0),u="_".charCodeAt(0);function c(e){var t=e.charCodeAt(0);return t===n||t===s?62:t===r||t===u?63:t<o?-1:t<o+10?t-o+26+26:t<i+26?t-i:t<a+26?t-a+26:void 0}e.toByteArray=function(e){var n,r;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length,a="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,i=new t(3*e.length/4-a),s=0<a?e.length-4:e.length,u=0;function l(e){i[u++]=e}for(n=0;n<s;n+=4,0)l((16711680&(r=c(e.charAt(n))<<18|c(e.charAt(n+1))<<12|c(e.charAt(n+2))<<6|c(e.charAt(n+3))))>>16),l((65280&r)>>8),l(255&r);return 2==a?l(255&(r=c(e.charAt(n))<<2|c(e.charAt(n+1))>>4)):1==a&&(l((r=c(e.charAt(n))<<10|c(e.charAt(n+1))<<4|c(e.charAt(n+2))>>2)>>8&255),l(255&r)),i},e.fromByteArray=function(e){var t,n,r,o,a=e.length%3,i="";function s(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-a;t<r;t+=3)i+=s((o=n=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+s(o>>12&63)+s(o>>6&63)+s(63&o);switch(a){case 1:i+=s((n=e[e.length-1])>>2),i+=s(n<<4&63),i+="==";break;case 2:i+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10),i+=s(n>>4&63),i+=s(n<<2&63),i+="="}return i}}(void 0===n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,n){(function(t,r,o,a,i,s,u,c,l){var f=e("base64-js"),d=e("ieee754");function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var r,a,i,s,u,c=typeof e;if("base64"===t&&"string"==c)for(e=(r=e).trim?r.trim():r.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)a=C(e);else if("string"==c)a=o.byteLength(e,t);else{if("object"!=c)throw new Error("First argument needs to be a number, array or string.");a=C(e.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(a)):((i=this).length=a,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(j(u=e)||o.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(s=0;s<a;s++)o.isBuffer(e)?i[s]=e.readUInt8(s):i[s]=e[s];else if("string"==c)i.write(e,0,t);else if("number"==c&&!o._useTypedArrays&&!n)for(s=0;s<a;s++)i[s]=0;return i}function h(e,t,n,r){return o._charsWritten=N(function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function p(e,t,n,r){return o._charsWritten=N(function(e){for(var t,n,r,o=[],a=0;a<e.length;a++)n=(t=e.charCodeAt(a))>>8,r=t%256,o.push(r),o.push(n);return o}(t),e,n,r)}function g(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;o++)r+=String.fromCharCode(e[o]);return r}function v(e,t,n,r){r||(L("boolean"==typeof n,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+1<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return n?(o=e[t],t+1<a&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<a&&(o|=e[t+1])),o}function y(e,t,n,r){r||(L("boolean"==typeof n,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+3<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return n?(t+2<a&&(o=e[t+2]<<16),t+1<a&&(o|=e[t+1]<<8),o|=e[t],t+3<a&&(o+=e[t+3]<<24>>>0)):(t+1<a&&(o=e[t+1]<<16),t+2<a&&(o|=e[t+2]<<8),t+3<a&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function m(e,t,n,r){if(r||(L("boolean"==typeof n,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=v(e,t,n,!0);return 32768&o?-1*(65535-o+1):o}}function _(e,t,n,r){if(r||(L("boolean"==typeof n,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=y(e,t,n,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function b(e,t,n,r){return r||(L("boolean"==typeof n,"missing or invalid endian"),L(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,n,23,4)}function w(e,t,n,r){return r||(L("boolean"==typeof n,"missing or invalid endian"),L(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,n,52,8)}function O(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+1<e.length,"trying to write beyond buffer length"),U(t,65535));var a=e.length;if(!(a<=n))for(var i=0,s=Math.min(a-n,2);i<s;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function I(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var a=e.length;if(!(a<=n))for(var i=0,s=Math.min(a-n,4);i<s;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function T(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=n||O(e,0<=t?t:65535+t+1,n,r,o)}function S(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=n||I(e,0<=t?t:4294967295+t+1,n,r,o)}function E(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+3<e.length,"Trying to write beyond buffer length"),q(t,34028234663852886e22,-34028234663852886e22)),e.length<=n||d.write(e,t,n,r,23,4)}function x(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+7<e.length,"Trying to write beyond buffer length"),q(t,17976931348623157e292,-17976931348623157e292)),e.length<=n||d.write(e,t,n,r,52,8)}n.Buffer=o,n.SlowBuffer=o,n.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=A(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=R(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},o.concat=function(e,t){if(L(j(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];if("number"!=typeof t)for(a=t=0;a<e.length;a++)t+=e[a].length;for(var n=new o(t),r=0,a=0;a<e.length;a++){var i=e[a];i.copy(n,r),r+=i.length}return n},o.prototype.write=function(e,t,n,r){var a;isFinite(t)?isFinite(n)||(r=n,n=void 0):(a=r,r=t,t=n,n=a),t=Number(t)||0;var i,s,u,c,l,f,d,g,v,y=this.length-t;switch((!n||y<(n=Number(n)))&&(n=y),r=String(r||"utf8").toLowerCase()){case"hex":i=function(e,t,n,r){n=Number(n)||0;var a=e.length-n;(!r||a<(r=Number(r)))&&(r=a);var i=t.length;L(i%2==0,"Invalid hex string"),i/2<r&&(r=i/2);for(var s=0;s<r;s++){var u=parseInt(t.substr(2*s,2),16);L(!isNaN(u),"Invalid hex string"),e[n+s]=u}return o._charsWritten=2*s,s}(this,e,t,n);break;case"utf8":case"utf-8":f=this,d=e,g=t,v=n,i=o._charsWritten=N(A(d),f,g,v);break;case"ascii":case"binary":i=h(this,e,t,n);break;case"base64":s=this,u=e,c=t,l=n,i=o._charsWritten=N(R(u),s,c,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=p(this,e,t,n);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(e,t,n){var r,o,a,i,s=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):n=s.length)===t)return"";switch(e){case"hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r<n)&&(n=r);for(var o="",a=t;a<n;a++)o+=D(e[a]);return o}(s,t,n);break;case"utf8":case"utf-8":r=function(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var a=t;a<n;a++)e[a]<=127?(r+=M(o)+String.fromCharCode(e[a]),o=""):o+="%"+e[a].toString(16);return r+M(o)}(s,t,n);break;case"ascii":case"binary":r=g(s,t,n);break;case"base64":o=s,i=n,r=0===(a=t)&&i===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(a,i));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length;a+=2)o+=String.fromCharCode(r[a]+256*r[a+1]);return o}(s,t,n);break;default:throw new Error("Unknown encoding")}return r},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t=t||0,r!==n&&0!==e.length&&0!==this.length){L(n<=r,"sourceEnd < sourceStart"),L(0<=t&&t<e.length,"targetStart out of bounds"),L(0<=n&&n<this.length,"sourceStart out of bounds"),L(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a=r-n;if(a<100||!o._useTypedArrays)for(var i=0;i<a;i++)e[i+t]=this[i+n];else e._set(this.subarray(n,n+a),t)}},o.prototype.slice=function(e,t){var n=this.length;if(e=k(e,n,0),t=k(t,n,n),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var r=t-e,a=new o(r,void 0,!0),i=0;i<r;i++)a[i]=this[i+e];return a},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||(L(null!=e,"missing offset"),L(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(L(null!=e,"missing offset"),L(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return _(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return _(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return b(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return b(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,n){n||(L(null!=e,"missing value"),L(null!=t,"missing offset"),L(t<this.length,"trying to write beyond buffer length"),U(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,n){O(this,e,t,!0,n)},o.prototype.writeUInt16BE=function(e,t,n){O(this,e,t,!1,n)},o.prototype.writeUInt32LE=function(e,t,n){I(this,e,t,!0,n)},o.prototype.writeUInt32BE=function(e,t,n){I(this,e,t,!1,n)},o.prototype.writeInt8=function(e,t,n){n||(L(null!=e,"missing value"),L(null!=t,"missing offset"),L(t<this.length,"Trying to write beyond buffer length"),B(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},o.prototype.writeInt16LE=function(e,t,n){T(this,e,t,!0,n)},o.prototype.writeInt16BE=function(e,t,n){T(this,e,t,!1,n)},o.prototype.writeInt32LE=function(e,t,n){S(this,e,t,!0,n)},o.prototype.writeInt32BE=function(e,t,n){S(this,e,t,!1,n)},o.prototype.writeFloatLE=function(e,t,n){E(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){E(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){x(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){x(this,e,t,!1,n)},o.prototype.fill=function(e,t,n){if(e=e||0,t=t||0,n=n||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),L("number"==typeof e&&!isNaN(e),"value is not a number"),L(t<=n,"end < start"),n!==t&&0!==this.length){L(0<=t&&t<this.length,"start out of bounds"),L(0<=n&&n<=this.length,"end out of bounds");for(var r=t;r<n;r++)this[r]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,r=0;r<t;r++)if(e[r]=D(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer};var P=o.prototype;function k(e,t,n){return"number"!=typeof e?n:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function C(e){return(e=~~Math.ceil(+e))<0?0:e}function j(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(e.charCodeAt(n));else{var o=n;55296<=r&&r<=57343&&n++;for(var a=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),i=0;i<a.length;i++)t.push(parseInt(a[i],16))}}return t}function R(e){return f.toByteArray(e)}function N(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function U(e,t){L("number"==typeof e,"cannot write a non-number as a number"),L(0<=e,"specified a negative value for writing an unsigned value"),L(e<=t,"value is larger than maximum value for type"),L(Math.floor(e)===e,"value has a fractional component")}function B(e,t,n){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(n<=e,"value smaller than minimum allowed value"),L(Math.floor(e)===e,"value has a fractional component")}function q(e,t,n){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(n<=e,"value smaller than minimum allowed value")}function L(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=P.get,e.set=P.set,e.write=P.write,e.toString=P.toString,e.toLocaleString=P.toString,e.toJSON=P.toJSON,e.copy=P.copy,e.slice=P.slice,e.readUInt8=P.readUInt8,e.readUInt16LE=P.readUInt16LE,e.readUInt16BE=P.readUInt16BE,e.readUInt32LE=P.readUInt32LE,e.readUInt32BE=P.readUInt32BE,e.readInt8=P.readInt8,e.readInt16LE=P.readInt16LE,e.readInt16BE=P.readInt16BE,e.readInt32LE=P.readInt32LE,e.readInt32BE=P.readInt32BE,e.readFloatLE=P.readFloatLE,e.readFloatBE=P.readFloatBE,e.readDoubleLE=P.readDoubleLE,e.readDoubleBE=P.readDoubleBE,e.writeUInt8=P.writeUInt8,e.writeUInt16LE=P.writeUInt16LE,e.writeUInt16BE=P.writeUInt16BE,e.writeUInt32LE=P.writeUInt32LE,e.writeUInt32BE=P.writeUInt32BE,e.writeInt8=P.writeInt8,e.writeInt16LE=P.writeInt16LE,e.writeInt16BE=P.writeInt16BE,e.writeInt32LE=P.writeInt32LE,e.writeInt32BE=P.writeInt32BE,e.writeFloatLE=P.writeFloatLE,e.writeFloatBE=P.writeFloatBE,e.writeDoubleLE=P.writeDoubleLE,e.writeDoubleBE=P.writeDoubleBE,e.fill=P.fill,e.inspect=P.inspect,e.toArrayBuffer=P.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,n){(function(n,r,o,a,i,s,u,c,l){o=e("buffer").Buffer;var f=4,d=new o(f);d.fill(0),t.exports={hash:function(e,t,n,r){return o.isBuffer(e)||(e=new o(e)),function(e,t,n){for(var r=new o(t),a=n?r.writeInt32BE:r.writeInt32LE,i=0;i<e.length;i++)a.call(r,e[i],4*i,!0);return r}(t(function(e,t){var n;e.length%f!=0&&(n=e.length+(f-e.length%f),e=o.concat([e,d],n));for(var r=[],a=t?e.readInt32BE:e.readInt32LE,i=0;i<e.length;i+=f)r.push(a.call(e,i));return r}(e,r),8*e.length),n,r)}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,n){(function(t,r,o,a,i,s,u,c,l){o=e("buffer").Buffer;var f=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:f,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var n=p[e=e||"sha1"],r=[];return n||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),r.push(e),e.length,this},digest:function(e){var a=o.concat(r),i=t?function(e,t,n){o.isBuffer(t)||(t=new o(t)),o.isBuffer(n)||(n=new o(n)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var r=new o(g),a=new o(g),i=0;i<g;i++)r[i]=54^t[i],a[i]=92^t[i];var s=e(o.concat([r,n]));return e(o.concat([a,s]))}(n,t,a):n(a);return r=null,e?i.toString(e):i}}}function m(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}v.fill(0),n.createHash=function(e){return y(e)},n.createHmac=y,n.randomBytes=function(e,t){if(!t||!t.call)return new o(h(e));try{t.call(this,void 0,new o(h(e)))}catch(e){t(e)}},function(e,t){for(var n in e)t(e[n],n)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){n[e]=function(){m("sorry,",e,"is not implemented yet")}}))}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,n){(function(n,r,o,a,i,s,u,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var s=n,u=r,c=o,l=a;n=p(n,r,o,a,e[i+0],7,-680876936),a=p(a,n,r,o,e[i+1],12,-389564586),o=p(o,a,n,r,e[i+2],17,606105819),r=p(r,o,a,n,e[i+3],22,-1044525330),n=p(n,r,o,a,e[i+4],7,-176418897),a=p(a,n,r,o,e[i+5],12,1200080426),o=p(o,a,n,r,e[i+6],17,-1473231341),r=p(r,o,a,n,e[i+7],22,-45705983),n=p(n,r,o,a,e[i+8],7,1770035416),a=p(a,n,r,o,e[i+9],12,-1958414417),o=p(o,a,n,r,e[i+10],17,-42063),r=p(r,o,a,n,e[i+11],22,-1990404162),n=p(n,r,o,a,e[i+12],7,1804603682),a=p(a,n,r,o,e[i+13],12,-40341101),o=p(o,a,n,r,e[i+14],17,-1502002290),n=g(n,r=p(r,o,a,n,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=g(a,n,r,o,e[i+6],9,-1069501632),o=g(o,a,n,r,e[i+11],14,643717713),r=g(r,o,a,n,e[i+0],20,-373897302),n=g(n,r,o,a,e[i+5],5,-701558691),a=g(a,n,r,o,e[i+10],9,38016083),o=g(o,a,n,r,e[i+15],14,-660478335),r=g(r,o,a,n,e[i+4],20,-405537848),n=g(n,r,o,a,e[i+9],5,568446438),a=g(a,n,r,o,e[i+14],9,-1019803690),o=g(o,a,n,r,e[i+3],14,-187363961),r=g(r,o,a,n,e[i+8],20,1163531501),n=g(n,r,o,a,e[i+13],5,-1444681467),a=g(a,n,r,o,e[i+2],9,-51403784),o=g(o,a,n,r,e[i+7],14,1735328473),n=v(n,r=g(r,o,a,n,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=v(a,n,r,o,e[i+8],11,-2022574463),o=v(o,a,n,r,e[i+11],16,1839030562),r=v(r,o,a,n,e[i+14],23,-35309556),n=v(n,r,o,a,e[i+1],4,-1530992060),a=v(a,n,r,o,e[i+4],11,1272893353),o=v(o,a,n,r,e[i+7],16,-155497632),r=v(r,o,a,n,e[i+10],23,-1094730640),n=v(n,r,o,a,e[i+13],4,681279174),a=v(a,n,r,o,e[i+0],11,-358537222),o=v(o,a,n,r,e[i+3],16,-722521979),r=v(r,o,a,n,e[i+6],23,76029189),n=v(n,r,o,a,e[i+9],4,-640364487),a=v(a,n,r,o,e[i+12],11,-421815835),o=v(o,a,n,r,e[i+15],16,530742520),n=y(n,r=v(r,o,a,n,e[i+2],23,-995338651),o,a,e[i+0],6,-198630844),a=y(a,n,r,o,e[i+7],10,1126891415),o=y(o,a,n,r,e[i+14],15,-1416354905),r=y(r,o,a,n,e[i+5],21,-57434055),n=y(n,r,o,a,e[i+12],6,1700485571),a=y(a,n,r,o,e[i+3],10,-1894986606),o=y(o,a,n,r,e[i+10],15,-1051523),r=y(r,o,a,n,e[i+1],21,-2054922799),n=y(n,r,o,a,e[i+8],6,1873313359),a=y(a,n,r,o,e[i+15],10,-30611744),o=y(o,a,n,r,e[i+6],15,-1560198380),r=y(r,o,a,n,e[i+13],21,1309151649),n=y(n,r,o,a,e[i+4],6,-145523070),a=y(a,n,r,o,e[i+11],10,-1120210379),o=y(o,a,n,r,e[i+2],15,718787259),r=y(r,o,a,n,e[i+9],21,-343485551),n=m(n,s),r=m(r,u),o=m(o,c),a=m(a,l)}return Array(n,r,o,a)}function h(e,t,n,r,o,a){return m((i=m(m(t,e),m(r,a)))<<(s=o)|i>>>32-s,n);var i,s}function p(e,t,n,r,o,a,i){return h(t&n|~t&r,e,t,o,a,i)}function g(e,t,n,r,o,a,i){return h(t&r|n&~r,e,t,o,a,i)}function v(e,t,n,r,o,a,i){return h(t^n^r,e,t,o,a,i)}function y(e,t,n,r,o,a,i){return h(n^(t|~r),e,t,o,a,i)}function m(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,n){(function(e,n,r,o,a,i,s,u,c){var l;l=function(e){for(var t,n=new Array(e),r=0;r<e;r++)0==(3&r)&&(t=4294967296*Math.random()),n[r]=t>>>((3&r)<<3)&255;return n},t.exports=l}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,n){(function(n,r,o,a,i,s,u,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,o,a,i,s=Array(80),u=1732584193,c=-271733879,l=-1732584194,f=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=u,y=c,m=l,_=f,b=d,w=0;w<80;w++){s[w]=w<16?e[g+w]:p(s[w-3]^s[w-8]^s[w-14]^s[w-16],1);var O=h(h(p(u,5),(o=c,a=l,i=f,(r=w)<20?o&a|~o&i:!(r<40)&&r<60?o&a|o&i|a&i:o^a^i)),h(h(d,s[w]),(n=w)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514));d=f,f=l,l=p(c,30),c=u,u=O}u=h(u,v),c=h(c,y),l=h(l,m),f=h(f,_),d=h(d,b)}return Array(u,c,l,f,d)}function h(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,n){(function(n,r,o,a,i,s,u,c,l){function f(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var n,r,o,a,i,s,u,c,l,h,p=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var y,m,_,b,w,O,I,T,S=0;S<e.length;S+=16){n=g[0],r=g[1],o=g[2],a=g[3],i=g[4],s=g[5],u=g[6],c=g[7];for(var E=0;E<64;E++)v[E]=E<16?e[E+S]:f(f(f(d(T=v[E-2],17)^d(T,19)^T>>>10,v[E-7]),d(I=v[E-15],7)^d(I,18)^I>>>3),v[E-16]),l=f(f(f(f(c,d(O=i,6)^d(O,11)^d(O,25)),(w=i)&s^~w&u),p[E]),v[E]),h=f(d(b=n,2)^d(b,13)^d(b,22),(y=n)&(m=r)^y&(_=o)^m&_),c=u,u=s,s=i,i=f(a,l),a=o,o=r,r=n,n=f(l,h);g[0]=f(n,g[0]),g[1]=f(r,g[1]),g[2]=f(o,g[2]),g[3]=f(a,g[3]),g[4]=f(i,g[4]),g[5]=f(s,g[5]),g[6]=f(u,g[6]),g[7]=f(c,g[7])}return g}var p=e("./helpers");t.exports=function(e){return p.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,n){(function(e,n,r,o,a,i,s,u,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<n.length&&n.shift()())}),!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=l,e.addListener=l,e.once=l,e.off=l,e.removeListener=l,e.removeAllListeners=l,e.emit=l,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,n){(function(e,t,r,o,a,i,s,u,c){n.read=function(e,t,n,r,o){var a,i,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?o-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=s;0<l;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=r;0<l;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,r),a-=c}return(h?-1:1)*i*Math.pow(2,a-r)},n.write=function(e,t,n,r,o,a){var i,s,u,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),2<=(t+=1<=i+f?d/u:d*Math.pow(2,1-f))*u&&(i++,u/=2),l<=i+f?(s=0,i=l):1<=i+f?(s=(t*u-1)*Math.pow(2,o),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));8<=o;e[n+h]=255&s,h+=p,s/=256,o-=8);for(i=i<<o|s,c+=o;0<c;e[n+h]=255&i,h+=p,i/=256,c-=8);e[n+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)})),Qn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var n=Et.__importDefault(Jn);t.generateSearchId=function(e,t){var r=t.anonymousId,o=t.language,a=t.currency,i=t.countryCode;return(0,n.default)(Et.__assign(Et.__assign({},e),{anonymousId:r,language:o,currency:a,countryCode:i}))}})),$n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,n){var r;if(void 0===(null===(r=e.pricing)||void 0===r?void 0:r.medianRateBkt)||void 0===n)return e;var o=e.pricing.medianRateBkt*n*t,a=(e.pricing.medianRateBkt+1)*n*t;return Et.__assign(Et.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),Xn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmpty=void 0,t.removeEmpty=function e(t){return Object.entries(t).filter((function(e){e[0];var t=e[1];return null!=t})).reduce((function(t,n){var r,o=n[0],a=n[1];return Et.__assign(Et.__assign({},t),((r={})[o]=a===new Object(a)?e(a):a,r))}),{})}})),Zn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Et.__exportStar(Q,t),Et.__exportStar($,t),Et.__exportStar(Dt,t),Et.__exportStar(At,t),Et.__exportStar(Rt,t),Et.__exportStar(Gn,t),Et.__exportStar(Qn,t),Et.__exportStar($n,t),Et.__exportStar(Xn,t)})),er=t((function(e,t){function n(e,t,n,r){return!(void 0!==n&&e.nightlyRate<n)&&!(void 0!==r&&r<t&&e.nightlyRate>r)}function r(e,t){var r,o=e.filters,a=void 0===o?{}:o,i=e.priceBucketWidth,s=e.priceBucketsCount,u=e.exchangeRate;if(void 0===i)return t;var c=a.priceMin,l=a.priceMax,f=s*Math.round(i*u);if((void 0!==c||void 0!==l)&&!(null===(r=t.offers)||void 0===r?void 0:r.some((function(e){return n(e,f,c,l)}))))return Et.__assign(Et.__assign({},t),{offers:[]});return t}function o(e,t){var n=t.sortField,r=t.sortOrder;return"price"===n?function(e,t){return e.sort((function(e,n){var r,o,a=(null!==(r=(0,Zn.getCheapestRate)(e))&&void 0!==r?r:0)-(null!==(o=(0,Zn.getCheapestRate)(n))&&void 0!==o?o:0);return"ascending"===t?a:-a}))}(e,void 0===r?"ascending":r):e}function a(e){var t=e.topOfferData,n=e.anchorPriceRateBreakdown,r=n.calculatedTotalRate,o=n.nightlyRate;return Et.__assign(Et.__assign({},t),{anchorPrice:r,anchorPriceNightly:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.augmentRaaResponse=t.augmentHotelOffersWithAnchorPrice=t.augmentOffersWithAnchorPrice=t.augmentTopOfferDataWithAnchorPrice=t.applyPriceFilter=t.isOfferInPriceRange=t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0},t.isOfferInPriceRange=n,t.applyPriceFilter=r,t.augmentTopOfferDataWithAnchorPrice=a;function i(e,t){var n=e.offers;if(!(null==n?void 0:n.length))return n;var r=t.anchorPrice;return void 0===r?n:n.map((function(e){return Et.__assign(Et.__assign({},e),{hasAnchorPrice:r-e.calculatedTotalRate>.03*r})}))}function s(e){var t=e.anchorPriceRateBreakdown,n=e.topOfferData;if(void 0===t||void 0===n)return e;var r=a(e),o=i(e,r);return Et.__assign(Et.__assign({},e),{topOfferData:r,offers:o})}t.augmentOffersWithAnchorPrice=i,t.augmentHotelOffersWithAnchorPrice=s,t.augmentRaaResponse=function(e,t){var n,a=e.hotelOfferEntities,i=e.anchorHotelOfferEntity;a&&(n=a.map((function(e){return r(t,e)})),void 0!==t.sortField&&(n=o(n,t)));var u=[],c={};return null==n||n.forEach((function(e){u.push(e.id),c[e.id]=s(e)})),void 0!==i&&(c[i.id]=s(i)),{hotelIds:u,hotelOfferEntities:c}}})),tr=n(T),nr=n(J),rr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.raa=void 0;var n,r=Et.__importDefault(tr);!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(n||(n={}));t.raa=function(e,t){if(void 0===e)throw new TypeError("RAA endpoint must be provided");if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a=new r.default(e,[],{maxRetries:20,WebSocket:t.WebSocket}),i={};function s(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"daedalus",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==i.current&&a.reconnect()}function u(e){t.logger.log({name:"WebsocketError",value:Et.__assign(Et.__assign({},e),{service:"daedalus"})}),void 0!==i.current&&a.reconnect()}function c(){var e=i.current;void 0!==e&&a.send(e)}function l(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}void 0!==o&&o(t)}return a.addEventListener("open",c),a.addEventListener("close",s),a.addEventListener("error",u),a.addEventListener("message",l),{getOffers:function(e,r){return Et.__awaiter(this,void 0,void 0,(function(){var s;return Et.__generator(this,(function(u){return s={},i.current=function(e,t){var n,r,o,a,i,s={checkIn:e.checkIn,checkOut:e.checkOut,destination:null!==(r=null===(n=e.hotelIds)||void 0===n?void 0:n.join(","))&&void 0!==r?r:"",getAllOffers:e.getAllOffers,highlightedHotelID:e.anchorHotelId,rooms:e.rooms,cugDeals:null===(o=e.cugDeals)||void 0===o?void 0:o.join(","),profileId:null!==(a=e.originId)&&void 0!==a?a:"default",searchId:e.searchId,useAlternativeRaaKeys:e.useAlternativeRaaKeys,preferredRate:e.preferredRate,trafficSource:e.trafficSource,deviceCategory:t.deviceType,languageCode:t.language,userCountryCode:t.countryCode,currencyCode:t.currency,anonymousId:t.anonymousId,includeLocalTaxes:t.includeLocalTaxes,includeTaxes:t.includeTaxes,skipBackendAugmentation:t.skipBackendAugmentation,facetsEnabled:t.facetsEnabled,sapiCliKey:t.sapiCliKey,sortingBoost:(0,er.generateSortingBoost)(e),clientRequestId:(0,nr.v4)(),roomLimit:1,anchorRoomLimit:2};try{i=JSON.stringify(s)}catch(e){console.log("WEBSOCKET: error serialising query")}return i}(e,t),[2,new Promise((function(t){o=function(n){var o;if(void 0!==n)if(n.status.complete)t(s),i.current=void 0;else{var a=n.results.find((function(t){return t.id===e.anchorHotelId}));a?s.anchorHotelOfferEntity=(0,Zn.omit)(["errors"],a):s.hotelOfferEntities=null===(o=n.results)||void 0===o?void 0:o.map((function(e){return(0,Zn.omit)(["errors"],e)})),"function"==typeof r&&r(Et.__assign({},s))}},a.readyState===n.Open&&void 0!==i.current&&a.send(i.current)}))]}))}))}}}})),or=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Et.__exportStar(rr,t),Et.__exportStar(er,t)}));function ar(e){X(1,arguments);var t=Z(e);return t.setHours(0,0,0,0),t}var ir=864e5;function sr(e,t){X(2,arguments);var n=ar(e),r=ar(t),o=n.getTime()-Ve(n),a=r.getTime()-Ve(r);return Math.round((o-a)/ir)}function ur(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var cr=Object.freeze({__proto__:null,default:function(e,t){X(2,arguments);var n=Z(e),r=Z(t),o=ur(n,r),a=Math.abs(sr(n,r));n.setDate(n.getDate()-o*a);var i=ur(n,r)===-o,s=o*(a-i);return 0===s?0:s}}),lr=n(cr),fr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pickIndexVariation=t.hitToPlaceSuggest=t.hitToHotelSuggest=t.hitToPlaceTypeAnchor=t.hitToHotelTypeAnchor=t.hitToHotel=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=t.getTagsFilter=t.getCheckInNights=void 0;var n=Et.__importDefault(lr),r=Et.__importDefault(xt);function o(e,t){var o=(0,Zn.dateToMiddayUTC)(e),a=(0,Zn.dateToMiddayUTC)(t),i=(0,r.default)(o,"yyMMdd"),s=(0,n.default)(a,o);return"".concat(i,"-").concat(s)}function a(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function i(e,t){for(var n=0,r=t;n<r.length;n++){var o=r[n];if(a(null==e?void 0:e[o]))return e[o]}return""}function s(e,t,n){void 0===n&&(n=", ");var r={};return t.forEach((function(o){var i=(null==e?void 0:e[o])||[];r[o]=i.map((function(n,r){if(a(n))return n;var o=t.find((function(t){var n;return a(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[r])}));return o?e[o][r]:""})).join("".concat(n))})),i(r,t)}function u(e,t,n){var r={};return t.forEach((function(o){var i=e[o]||[],s=-1===n?void 0:n+1,u=i.slice(n,s).toString();if(a(u))r[o]=u;else{var c=t.find((function(t){var r;return a(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[n])}));r[o]=c?e[c][n]:""}})),i(r,t)}function c(e,t){var n={};return t.forEach((function(r){var o,i=null===(o=e[r])||void 0===o?void 0:o.value;if(a(i))n[r]=i;else{var s=t.find((function(t){var n;return a(null===(n=e[t])||void 0===n?void 0:n.value)}));n[r]=s?e[s].value:""}})),i(n,t)}function l(e,t,n){var r,o=e[t];if(!o){var a=n.indexOf(t),i=null!==(r=n.slice(a).find((function(t){return e[t]})))&&void 0!==r?r:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function f(e,t,n){for(var r={},o=0,a=n;o<a.length;o++){var i=a[o];r[i]=Et.__spreadArray(Et.__spreadArray([],l(e,i,n),!0),l(t,i,n),!0)}return s(r,n)}function d(e,t,n){if(void 0===e)return t;try{for(var r in t)if(void 0===e[r])throw new TypeError("Hotel ".concat(e.objectID," is missing ").concat(r," field"))}catch(e){n||console.error(e)}return Et.__assign(Et.__assign({},t),e)}function h(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}t.getCheckInNights=o,t.getTagsFilter=function(e,t){var n=o(e,t);return["tags:-u".concat(n)]},t.isNotEmptyOrWhiteSpace=a,t.getTranslatedAttributes=function(e,t){var n=[];return e.forEach((function(e){var r=t.map((function(t){return"".concat(t,".").concat(e)}));n.push.apply(n,r)})),n},t.toString=i,t.translatedArrayToString=s,t.getStringFromTranslatedArray=u,t.getValueFromTranslatedHightlightResult=c,t.attributeWithFallback=l,t.mergeTranslatedAttributes=f,t.validateHit=d,t.placeTypeToPlaceTypeName=h,t.hitToHotel=function(e,t){var n=d(e,{address:{},placeADName:{},placeDN:{},hotelName:{}}),r=Et.__assign(Et.__assign({},n),{displayAddress:f(n.address,n.placeADName,t),placeDisplayName:s(n.placeDN,t),hotelName:i(n.hotelName,t)});return(0,Zn.omit)(["address","placeDN","placeADName"],r)},t.hitToHotelTypeAnchor=function(e,t){var n=d(e,{hotelName:{},placeDN:{}}),r=Et.__assign(Et.__assign({},n),{hotelName:i(n.hotelName,t),placeDisplayName:s(n.placeDN,t)});return(0,Zn.omit)(["placeADN","placeDN"],r)},t.hitToPlaceTypeAnchor=function(e,t){var n=d(e,{placeName:{},placeDN:{}}),r=Et.__assign(Et.__assign({},n),{placeName:i(n.placeName,t),placeDisplayName:s(n.placeDN,t)});return(0,Zn.omit)(["placeADN","placeDN"],r)},t.hitToHotelSuggest=function(e,t){var n=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),r=u(n.placeADN,t,-1),o=u(n.placeDN,t,1),s=a(o)?"".concat(o,", ").concat(r):r,l=c(n._highlightResult.hotelName,t);return{objectID:n.objectID.replace("".concat(n.objectType,":"),""),objectType:n.objectType,value:i(n.hotelName,t),highlightValue:l,placeDisplayName:s,placeTypeName:h()}},t.hitToPlaceSuggest=function(e,t){var n=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),r=u(n.placeADN,t,-1),o=u(n.placeDN,t,1),s=a(o)?"".concat(o,", ").concat(r):r,l=c(n._highlightResult.placeName,t);return{objectID:n.objectID.replace("".concat(n.objectType,":"),""),objectType:n.objectType,value:i(n.placeName,t),highlightValue:l,placeDisplayName:s,placeTypeName:h(n.placeType)}},t.pickIndexVariation=function(e,t){var n=e.find((function(e){return e.variationID&&t.includes(e.variationID)}));return null!=n?n:e.find((function(e){return void 0===e.variationID}))}})),dr=t((function(e,t){var n;function r(e){var t=(0,fr.getTranslatedAttributes)(e,["placeName","placeADN","placeDN","hotelName"]);return Et.__spreadArray(["objectType","placeType","placeCategory","objectID","_geoloc","priceBucketWidth","polygon","pageSize"],t,!0)}function o(e){var t=(0,fr.getTranslatedAttributes)(e,["hotelName","placeADName","placeDN","address"]);return Et.__spreadArray(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],t,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.getAnchor=void 0,function(e){e[e.Hotel=0]="Hotel",e[e.Place=1]="Place",e[e.Location=2]="Location",e[e.Query=3]="Query",e[e.Unknown=4]="Unknown"}(n||(n={})),t.getAnchor=function(e,t,a){var i=this,s=e.search,u=t.autocompleteIndex,c=t.hotelIndex,l=a.languages;return function(e){return Et.__awaiter(i,void 0,void 0,(function(){var t,a,i,f,d,h,p,g,v,y,m,_,b;return Et.__generator(this,(function(w){switch(w.label){case 0:switch(t=function(e){return e.hotelId?n.Hotel:e.placeId?n.Place:e.geolocation?n.Location:e.query?n.Query:n.Unknown}(e),a=e.hotelId,i=e.placeId,f=e.query,d=[],t){case n.Query:d.push({indexName:u,params:{query:f,hitsPerPage:1,attributesToRetrieve:r(l),attributesToHighlight:[]}}),d.push({indexName:c,params:{query:f,hitsPerPage:1,attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case n.Hotel:a&&d.push({indexName:u,params:{facetFilters:[["objectID:hotel:".concat(a)]],attributesToRetrieve:r(l),attributesToHighlight:[]}},{indexName:c,params:{facetFilters:[["objectID:".concat(a)]],attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case n.Place:default:i&&d.push({indexName:u,params:{facetFilters:[["objectID:place:".concat(i)]],attributesToRetrieve:r(l),attributesToHighlight:[]}})}return[4,s(d)];case 1:if(g=w.sent().results,v=null===(m=g[0])||void 0===m?void 0:m.hits[0],y=null===(_=g[1])||void 0===_?void 0:_.hits[0],"hotel"===(null==v?void 0:v.objectType))h=(0,fr.hitToHotelTypeAnchor)(v,l),p=(0,fr.hitToHotel)(y,l);else h=(0,fr.hitToPlaceTypeAnchor)(v,l);return[2,{anchor:h,anchorHotel:p,anchorType:null!==(b=null==v?void 0:v.objectType)&&void 0!==b?b:"place"}]}}))}))}}}));var hr=Object.freeze({__proto__:null,default:function(e){X(1,arguments);var t=Z(e),n=t.getDay();return 0===n||6===n}}),pr=n(hr),gr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generatePriceFilter=t.generateSortByPriceFilter=void 0;var n=Et.__importDefault(lr),r=Et.__importDefault(pr);t.generateSortByPriceFilter=function(e){for(var t=[],n=e;n>0;--n){var r=100*(e+1-n);t.push("pricing.minRateBkt:".concat(n,"<score=").concat(r,">"))}return t},t.generatePriceFilter=function(e){var t=e.priceMin,o=e.priceMax,a=e.priceBucketWidth,i=e.priceBucketsCount,s=e.checkIn,u=e.checkOut,c=e.margin,l=void 0===c?2:c,f=[];if(void 0===t&&void 0===o||void 0===a)return f;var d=t?Math.floor(t/a)-l:0,h=o?Math.ceil(o/a)+l:i;d<0&&(d=0),h>i&&(h=i);var p=d,g=function(e,t){if(!e||!t)return"pricing.medianRateBkt";var o=(0,Zn.dateToMiddayUTC)(e),a=(0,Zn.dateToMiddayUTC)(t);return 1===(0,n.default)(a,o)?(0,r.default)(o)?"pricing.medianRateSaSuBkt":"pricing.medianRateMoFrBkt":"pricing.medianRateBkt"}(s,u);do{f.push("".concat(g,":").concat(p,"<score=").concat(1e4,">")),p++}while(p<=h);return f}})),vr=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===yr}(e)}(e)};var yr="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function mr(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ir((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function _r(e,t,n){return e.concat(t).map((function(e){return mr(e,n)}))}function br(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function wr(e,t){try{return t in e}catch(e){return!1}}function Or(e,t,n){var r={};return n.isMergeableObject(e)&&br(e).forEach((function(t){r[t]=mr(e[t],n)})),br(t).forEach((function(o){(function(e,t){return wr(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(wr(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return Ir;var n=t.customMerge(e);return"function"==typeof n?n:Ir}(o,n)(e[o],t[o],n):r[o]=mr(t[o],n))})),r}function Ir(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||_r,n.isMergeableObject=n.isMergeableObject||vr,n.cloneUnlessOtherwiseSpecified=mr;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Or(e,t,n):mr(t,n)}Ir.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ir(e,n,t)}),{})};var Tr=Ir,Sr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=t.PRICE_BUCKET_COUNT=void 0;var n=Et.__importDefault(Tr);t.PRICE_BUCKET_COUNT=31;var r={daedalus:{raaEndpoint:"wss://d2jxsjsbxzs3ta.cloudfront.net"},sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{anchor:"anchor",search:"search",offers:"ws/offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search",hotel:"1/hotel"}},algolia:{apiKey:"efa703d5c0057a24487bc9bdcb597770",hotelIndex:"prod_hotel_v3",autocompleteIndex:"prod_autocomplete_v2_os000007",lovIndex:"prod_lov_v2",currencyIndex:"prod_curr_v1",hsoIndex:[{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000003_tags"},{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000004_tags2",variationID:"pp000004-tags2-b"}]},client:{features:["offers","search","suggests","configs","rooms","get-hotel"],blockedDefaultDates:["2022-02-27"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]}}},o={"findhotel-website":r,"findhotel-website-e2e":Et.__assign(Et.__assign({},r),{daedalus:{raaEndpoint:void 0},saf:Et.__assign(Et.__assign({},r.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:Et.__assign(Et.__assign({},r.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":Et.__assign(Et.__assign({},r),{sapiBackend:Et.__assign(Et.__assign({},r.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":Et.__assign(Et.__assign({},r),{sapiBackend:Et.__assign(Et.__assign({},r.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":Et.__assign(Et.__assign({},r),{sapiBackend:Et.__assign(Et.__assign({},r.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-checkout":Et.__assign(Et.__assign({},r),{client:Et.__assign(Et.__assign({},r.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":Et.__assign(Et.__assign({},r),{saf:Et.__assign(Et.__assign({},r.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:Et.__assign(Et.__assign({},r.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-stg":Et.__assign(Et.__assign({},r),{saf:Et.__assign(Et.__assign({},r.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:Et.__assign(Et.__assign({},r.client),{features:["rooms","get-hotel"]})})};t.getAppConfig=function(e,t){var r=o[e];if(void 0===r)throw new Error("Profile key is not valid");return t&&(r=(0,n.default)(r,t)),r.daedalus.raaEndpoint?r:Et.__assign(Et.__assign({},r),{daedalus:{raaEndpoint:"http:"===(null===location||void 0===location?void 0:location.protocol)?"ws://"+location.host:"https:"===(null===location||void 0===location?void 0:location.protocol)?"wss://"+location.host:""}})}})),Er=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.geoSearch=void 0;function n(e){var t=e.anchorHotelId,n=e.checkIn,r=e.checkOut,o=e.filters,a=void 0===o?{}:o,i=a.facilities,s=a.starRating,u=a.propertyTypeId,c=a.themeIds,l=[];if(null==u?void 0:u.length){var f=u.map((function(e){return"propertyTypeId:".concat(e)}));l.push(f)}if(null==i?void 0:i.length){var d=i.map((function(e){return"facilities:".concat(e)}));l.push.apply(l,d)}if(null==c?void 0:c.length){var h=c.map((function(e){return"themeIds:".concat(e)}));l.push.apply(l,h)}if(null==s?void 0:s.length){var p=[];s.forEach((function(e){p.push("starRating:".concat(Number(e))),p.push("starRating:".concat(Number(e)+.5))})),l.push(p)}return t&&l.push("objectID:-".concat(t)),n&&r&&l.push((0,fr.getTagsFilter)(n,r)),l}function r(e){var t=e.guestRating;return(null==t?void 0:t.length)?["guestRating.overall>=".concat(t[0])]:[]}function o(e){var t="isDeleted = 0";return e.noHostels&&(t="".concat(t," AND propertyTypeId != ").concat("5")),t}function a(e,t){var n=e.filters,r=void 0===n?{}:n,o=e.checkIn,a=e.checkOut,i=e.sortField,s=r.priceMin,u=r.priceMax,c=t.hsoFilter,l=t.priceBucketWidth,f=t.exchangeRate,d=Et.__spreadArray([],c,!0);if("price"===i){var h=(0,gr.generateSortByPriceFilter)(Sr.PRICE_BUCKET_COUNT);d=Et.__spreadArray(Et.__spreadArray([],d,!0),h,!0)}if(s||u){var p=(0,gr.generatePriceFilter)({priceMin:s,priceMax:u,checkIn:o,checkOut:a,priceBucketsCount:Sr.PRICE_BUCKET_COUNT,priceBucketWidth:l&&l*f});d=Et.__spreadArray(Et.__spreadArray([],d,!0),p,!0)}return d}var i=["facilities","propertyTypeId","starRating","themeIds","pricing.medianRateBkt","pricing.medianRateMoFrBkt","pricing.medianRateSaSuBkt","pricing.minRateBkt","tags"];t.geoSearch=function(e,t,s){var u=this,c=e.search,l=t.hotelIndex;return function(e){return Et.__awaiter(u,void 0,void 0,(function(){var t,u,f,d,h,p,g,v,y,m,_,b,w,O,I,T,S,E,x,P,k,C,j;return Et.__generator(this,(function(D){switch(D.label){case 0:return t=e.boundingBox,u=e.polygon,f=e.geolocation,d=e.length,h=void 0===d?s.requestSize:d,p=e.offset,g=void 0===p?0:p,v=e.filters,m={length:h,offset:g,facets:i,attributesToHighlight:[],getRankingInfo:!1,filters:o(y=void 0===v?{}:v),numericFilters:r(y),facetFilters:n(e),attributesToRetrieve:(A=s.languages,R=(0,fr.getTranslatedAttributes)(A,["hotelName","placeADName","placeDN","address"]),Et.__spreadArray(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],R,!0)),optionalFilters:a(e,s)},void 0!==y.hotelName&&(m.query=y.hotelName),t?m.insideBoundingBox=[t]:u?m.insidePolygon=u:f&&(m.aroundLatLng="".concat(f.lat,", ").concat(f.lon),m.aroundRadius=null!==(E=f.radius)&&void 0!==E?E:2e4,m.aroundPrecision=null!==(x=f.precision)&&void 0!==x?x:5e3),[4,c([{indexName:l,params:m}])];case 1:for(_=D.sent(),b=_.results[0],w=[],O={},I=0,T=b.hits;I<T.length;I++)S=T[I],O[S.objectID]=(0,fr.hitToHotel)(S,s.languages),w.push(S.objectID);return[2,{hotelIds:w,hotelEntities:O,resultsCount:null!==(P=b.length)&&void 0!==P?P:0,resultsCountTotal:null!==(k=b.nbHits)&&void 0!==k?k:0,offset:null!==(C=b.offset)&&void 0!==C?C:0,facets:null!==(j=b.facets)&&void 0!==j?j:{}}]}var A,R}))}))}}})),xr=t((function(e,t){function n(e){return(0,fr.getTranslatedAttributes)(e,["placeName","hotelName"])}function r(e){var t=(0,fr.getTranslatedAttributes)(e,["placeName","placeADN","placeDN","hotelName"]);return Et.__spreadArray(["objectType","objectID","placeType"],t,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadSuggests=void 0,t.loadSuggests=function(e,t,o){var a=this,i=e.search,s=t.autocompleteIndex,u=o.languages,c=o.suggestsCount,l=void 0===c?6:c;return function(e){return Et.__awaiter(a,void 0,void 0,(function(){var t,o,a;return Et.__generator(this,(function(c){switch(c.label){case 0:return t=[{indexName:s,params:{query:e,filters:"isDeleted != 1",hitsPerPage:l,attributesToRetrieve:r(u),attributesToHighlight:n(u)}}],[4,i(t)];case 1:return o=c.sent().results,[2,null===(a=o[0])||void 0===a?void 0:a.hits.map((function(e){return"hotel"===e.objectType?(0,fr.hitToHotelSuggest)(e,u):(0,fr.hitToPlaceSuggest)(e,u)}))]}}))}))}}})),Pr=t((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));e(Pr);var kr=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};var Cr=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function jr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Dr=function(e,t,n){return t&&jr(e.prototype,t),n&&jr(e,n),e};var Ar=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r};var Rr=function(e){if(Array.isArray(e))return Ar(e)};var Nr=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var Mr=function(e,t){if(e){if("string"==typeof e)return Ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ar(e,t):void 0}};var Ur=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var Br=Pr((function(e){return Rr(e)||Nr(e)||Mr(e)||Ur()})),qr={functions:"Jexl Function",transforms:"Transform"},Lr={ArrayLiteral:function(e){return this.evalArray(e.value)},BinaryExpression:function(e){var t=this,n=this._grammar.elements[e.operator];if(n.evalOnDemand){var r=function(e){return{eval:function(){return t.eval(e)}}};return n.evalOnDemand(r(e.left),r(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then((function(e){return n.eval(e[0],e[1])}))},ConditionalExpression:function(e){var t=this;return this.eval(e.test).then((function(n){return n?e.consequent?t.eval(e.consequent):n:t.eval(e.alternate)}))},FilterExpression:function(e){var t=this;return this.eval(e.subject).then((function(n){return e.relative?t._filterRelative(n,e.expr):t._filterStatic(n,e.expr)}))},Identifier:function(e){return e.from?this.eval(e.from).then((function(t){if(null!=t)return Array.isArray(t)&&(t=t[0]),t[e.value]})):e.relative?this._relContext[e.value]:this._context[e.value]},Literal:function(e){return e.value},ObjectLiteral:function(e){return this.evalMap(e.value)},FunctionCall:function(e){var t=qr[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var n=this._grammar[e.pool][e.name];if(!n)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then((function(e){return n.apply(void 0,(0,Br.default)(e))}))},UnaryExpression:function(e){var t=this;return this.eval(e.right).then((function(n){return t._grammar.elements[e.operator].eval(n)}))}},Fr=Pr(Cr),Hr=Pr(Dr),Wr=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Promise;(0,Fr.default)(this,e),this._grammar=t,this._context=n||{},this._relContext=r||this._context,this.Promise=o}return(0,Hr.default)(e,[{key:"eval",value:function(e){var t=this;return this.Promise.resolve().then((function(){return Lr[e.type].call(t,e)}))}},{key:"evalArray",value:function(e){var t=this;return this.Promise.all(e.map((function(e){return t.eval(e)})))}},{key:"evalMap",value:function(e){var t=this,n=Object.keys(e),r={},o=n.map((function(n){return t.eval(e[n])}));return this.Promise.all(o).then((function(e){return e.forEach((function(e,t){r[n[t]]=e})),r}))}},{key:"_filterRelative",value:function(t,n){var r=this,o=[];return Array.isArray(t)||(t=void 0===t?[]:[t]),t.forEach((function(t){var a=new e(r._grammar,r._context,t,r.Promise);o.push(a.eval(n))})),this.Promise.all(o).then((function(e){var n=[];return e.forEach((function(e,r){e&&n.push(t[r])})),n}))}},{key:"_filterStatic",value:function(e,t){return this.eval(t).then((function(t){return"boolean"==typeof t?t?e:void 0:e[t]}))}}]),e}(),zr=Wr,Yr=Pr(Cr),Kr=Pr(Dr),Vr=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,Gr=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,Jr=/\\\\/,Qr=/^\s*$/,$r=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Xr=["[a-zA-Zа-яА-Я_À-ÖØ-öø-ÿ\\$][a-zA-Z0-9а-яА-Я_À-ÖØ-öø-ÿ\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Zr=["binaryOp","unaryOp","openParen","openBracket","question","colon"],eo=function(){function e(t){(0,Yr.default)(this,e),this._grammar=t}return(0,Kr.default)(e,[{key:"getElements",value:function(e){var t=this._getSplitRegex();return e.split(t).filter((function(e){return e}))}},{key:"getTokens",value:function(e){for(var t=[],n=!1,r=0;r<e.length;r++)this._isWhitespace(e[r])?t.length&&(t[t.length-1].raw+=e[r]):"-"===e[r]&&this._isNegative(t)?n=!0:(n&&(e[r]="-"+e[r],n=!1),t.push(this._createToken(e[r])));return n&&t.push(this._createToken("-")),t}},{key:"tokenize",value:function(e){var t=this.getElements(e);return this.getTokens(t)}},{key:"_createToken",value:function(e){var t={type:"literal",value:e,raw:e};if('"'===e[0]||"'"===e[0])t.value=this._unquote(e);else if(e.match(Vr))t.value=parseFloat(e);else if("true"===e||"false"===e)t.value="true"===e;else if(this._grammar.elements[e])t.type=this._grammar.elements[e].type;else{if(!e.match(Gr))throw new Error("Invalid expression token: ".concat(e));t.type="identifier"}return t}},{key:"_escapeRegExp",value:function(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Gr)&&(e="\\b"+e+"\\b"),e}},{key:"_getSplitRegex",value:function(){var e=this;if(!this._splitRegex){var t=Object.keys(this._grammar.elements).sort((function(e,t){return t.length-e.length})).map((function(t){return e._escapeRegExp(t)}),this);this._splitRegex=new RegExp("("+[$r.join("|"),t.join("|"),Xr.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(e){return!e.length||Zr.some((function(t){return t===e[e.length-1].type}))}},{key:"_isWhitespace",value:function(e){return!!e.match(Qr)}},{key:"_unquote",value:function(e){var t=e[0],n=new RegExp("\\\\"+t,"g");return e.substr(1,e.length-2).replace(n,t).replace(Jr,"\\")}}]),e}(),to=eo,no={argVal:function(e){e&&this._cursor.args.push(e)},arrayStart:function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})},arrayVal:function(e){e&&this._cursor.value.push(e)},binaryOp:function(e){for(var t=this._grammar.elements[e.value].precedence||0,n=this._cursor._parent;n&&n.operator&&this._grammar.elements[n.operator].precedence>=t;)this._cursor=n,n=n._parent;var r={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,r),this._cursor=n,this._placeAtCursor(r)},dot:function(){this._nextIdentEncapsulate=this._cursor&&"UnaryExpression"!==this._cursor.type&&("BinaryExpression"!==this._cursor.type||"BinaryExpression"===this._cursor.type&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)},filter:function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})},functionCall:function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})},identifier:function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))},literal:function(e){this._placeAtCursor({type:"Literal",value:e.value})},objKey:function(e){this._curObjKey=e.value},objStart:function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})},objVal:function(e){this._cursor.value[this._curObjKey]=e},subExpression:function(e){this._placeAtCursor(e)},ternaryEnd:function(e){this._cursor.alternate=e},ternaryMid:function(e){this._cursor.consequent=e},ternaryStart:function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree},transform:function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})},unaryOp:function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}},ro={states:{expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:no.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:no.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:no.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:no.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:no.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:no.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:no.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:no.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:no.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:no.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:no.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:no.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:no.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:no.ternaryEnd,completable:!0}}},oo=Pr(Cr),ao=Pr(Dr),io=ro.states,so=function(){function e(t,n,r){(0,oo.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=n||"",this._relative=!1,this._stopMap=r||{}}return(0,ao.default)(e,[{key:"addToken",value:function(e){if("complete"===this._state)throw new Error("Cannot add a new token to a completed Parser");var t=io[this._state],n=this._exprStr;if(this._exprStr+=e.raw,t.subHandler){this._subParser||this._startSubExpression(n);var r=this._subParser.addToken(e);if(r){if(this._endSubExpression(),this._parentStop)return r;this._state=r}}else{if(!t.tokenTypes[e.type]){if(this._stopMap[e.type])return this._stopMap[e.type];throw new Error("Token ".concat(e.raw," (").concat(e.type,") unexpected in expression: ").concat(this._exprStr))}var o=t.tokenTypes[e.type],a=no[e.type];o.handler&&(a=o.handler),a&&a.call(this,e),o.toState&&(this._state=o.toState)}return!1}},{key:"addTokens",value:function(e){e.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!io[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){io[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(e){this._cursor?(this._cursor.right=e,this._setParent(e,this._cursor)):this._tree=e,this._cursor=e}},{key:"_placeBeforeCursor",value:function(e){this._cursor=this._cursor._parent,this._placeAtCursor(e)}},{key:"_setParent",value:function(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}},{key:"_startSubExpression",value:function(t){var n=io[this._state].endStates;n||(this._parentStop=!0,n=this._stopMap),this._subParser=new e(this._grammar,t,n)}}]),e}(),uo=so,co=Pr(Cr),lo=Pr(Dr),fo=function(){function e(t){(0,co.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,lo.default)(e,[{key:"catch",value:function(e){if(this.error)try{this._resolve(e(this.error))}catch(e){this._reject(e)}return this}},{key:"then",value:function(e,t){if(!this.error)try{this._resolve(e(this.value))}catch(e){this._reject(e)}return t&&this.catch(t),this}},{key:"_reject",value:function(e){this.value=void 0,this.error=e}},{key:"_resolve",value:function(t){t instanceof e?t.error?this._reject(t.error):this._resolve(t.value):(this.value=t,this.error=void 0)}}]),e}();fo.all=function(e){return new fo((function(t){t(e.map((function(e){for(;e instanceof fo;){if(e.error)throw Error(e.error);e=e.value}return e})))}))},fo.resolve=function(e){return new fo((function(t){return t(e)}))},fo.reject=function(e){return new fo((function(t,n){return n(e)}))};var ho=fo,po=Pr(Cr),go=Pr(Dr),vo=function(){function e(t,n){(0,po.default)(this,e),this._grammar=t,this._exprStr=n,this._ast=null}return(0,go.default)(e,[{key:"compile",value:function(){var e=new to(this._grammar),t=new uo(this._grammar),n=e.tokenize(this._exprStr);return t.addTokens(n),this._ast=t.complete(),this}},{key:"eval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._eval(e,Promise)}},{key:"evalSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._eval(e,ho);if(t.error)throw t.error;return t.value}},{key:"_eval",value:function(e,t){var n=this;return t.resolve().then((function(){var r=n._getAst();return new zr(n._grammar,e,void 0,t).eval(r)}))}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e}(),yo=vo,mo=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(e,t){return e+t}},"-":{type:"binaryOp",precedence:30,eval:function(e,t){return e-t}},"*":{type:"binaryOp",precedence:40,eval:function(e,t){return e*t}},"/":{type:"binaryOp",precedence:40,eval:function(e,t){return e/t}},"//":{type:"binaryOp",precedence:40,eval:function(e,t){return Math.floor(e/t)}},"%":{type:"binaryOp",precedence:50,eval:function(e,t){return e%t}},"^":{type:"binaryOp",precedence:50,eval:function(e,t){return Math.pow(e,t)}},"==":{type:"binaryOp",precedence:20,eval:function(e,t){return e==t}},"!=":{type:"binaryOp",precedence:20,eval:function(e,t){return e!=t}},">":{type:"binaryOp",precedence:20,eval:function(e,t){return e>t}},">=":{type:"binaryOp",precedence:20,eval:function(e,t){return e>=t}},"<":{type:"binaryOp",precedence:20,eval:function(e,t){return e<t}},"<=":{type:"binaryOp",precedence:20,eval:function(e,t){return e<=t}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e?t.eval():e}))}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e||t.eval()}))}},in:{type:"binaryOp",precedence:20,eval:function(e,t){return"string"==typeof t?-1!==t.indexOf(e):!!Array.isArray(t)&&t.some((function(t){return t===e}))}},"!":{type:"unaryOp",precedence:1/0,eval:function(e){return!e}}},functions:{},transforms:{}}},_o=Pr(kr),bo=Pr(Cr),wo=Pr(Dr),Oo=mo,Io=function(){function e(){(0,bo.default)(this,e),this.expr=this.expr.bind(this),this._grammar=Oo()}return(0,wo.default)(e,[{key:"addBinaryOp",value:function(e,t,n,r){this._addGrammarElement(e,(0,_o.default)({type:"binaryOp",precedence:t},r?"evalOnDemand":"eval",n))}},{key:"addFunction",value:function(e,t){this._grammar.functions[e]=t}},{key:"addFunctions",value:function(e){for(var t in e)this._grammar.functions[t]=e[t]}},{key:"addUnaryOp",value:function(e,t){this._addGrammarElement(e,{type:"unaryOp",weight:1/0,eval:t})}},{key:"addTransform",value:function(e,t){this._grammar.transforms[e]=t}},{key:"addTransforms",value:function(e){for(var t in e)this._grammar.transforms[t]=e[t]}},{key:"compile",value:function(e){return this.createExpression(e).compile()}},{key:"createExpression",value:function(e){return new yo(this._grammar,e)}},{key:"getFunction",value:function(e){return this._grammar.functions[e]}},{key:"getTransform",value:function(e){return this._grammar.transforms[e]}},{key:"eval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.createExpression(e);return n.eval(t)}},{key:"evalSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.createExpression(e);return n.evalSync(t)}},{key:"expr",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=e.reduce((function(e,t,r){return e+=t+(r<n.length?n[r]:"")}),"");return this.createExpression(o)}},{key:"removeOp",value:function(e){!this._grammar.elements[e]||"binaryOp"!==this._grammar.elements[e].type&&"unaryOp"!==this._grammar.elements[e].type||delete this._grammar.elements[e]}},{key:"_addGrammarElement",value:function(e,t){this._grammar.elements[e]=t}}]),e}(),To=new Io,So=Io;To.Jexl=So;var Eo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.loadConfigs=t.getLovAttributesToRetrieve=t.exchangeRatesFromResponse=t.evaluateHsoConfigs=void 0;var n=Et.__importDefault(To);function r(e){var t={};return e.forEach((function(e){var n=e.objectID,r=e.rate;t[n]=r})),t}function o(e){var t=(0,fr.getTranslatedAttributes)(e,["value"]);return Et.__spreadArray(["id","categoryID","objectID"],t,!0)}n.default.addTransform("map",(function(e,t){return e.map((function(e){return t.replace(/%s/g,e)}))})),t.evaluateHsoConfigs=function(e,t){void 0===t&&(t=[]);var r=[];return t.some((function(t){try{n.default.evalSync(t.criteria,e)&&(r=t.value.map((function(t){return n.default.evalSync(t,e)})))}catch(e){}return r.length>0})),r},t.exchangeRatesFromResponse=r,t.getLovAttributesToRetrieve=o,t.loadConfigs=function(e,t,n){var a,i,s,u,c=e.search,l=t.hsoIndex,f=t.lovIndex,d=t.currencyIndex;return Et.__awaiter(this,void 0,void 0,(function(){var e,t,h,p,g,v,y,m,_,b,w;return Et.__generator(this,(function(O){switch(O.label){case 0:return e=n.currencies,t=n.languages,h=n.variations,p=e.map((function(e){return"objectID:".concat(e)})),g=(0,fr.pickIndexVariation)(l,h),v=(null==g?void 0:g.objectID)?["objectID:".concat(g.objectID)]:void 0,y=[{indexName:g.name,params:{facetFilters:v,attributesToHighlight:[],getRankingInfo:!1}},{indexName:f,params:{hitsPerPage:1e3,attributesToRetrieve:o(t),attributesToHighlight:[],getRankingInfo:!1}},{indexName:d,params:{hitsPerPage:p.length,query:"",attributesToRetrieve:["rate"],attributesToHighlight:[],facetFilters:[p],getRankingInfo:!1}}],[4,c(y)];case 1:return m=O.sent().results,_=null===(a=m[0])||void 0===a?void 0:a.hits,b=null===(i=m[1])||void 0===i?void 0:i.hits,w=null===(s=m[2])||void 0===s?void 0:s.hits,[2,{hso:null===(u=_[0])||void 0===u?void 0:u.hso,lov:b,exchangeRates:r(w)}]}}))}))}})),xo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Et.__exportStar(dr,t),Et.__exportStar(Er,t),Et.__exportStar(fr,t),Et.__exportStar(gr,t),Et.__exportStar(xr,t),Et.__exportStar(Eo,t)})),Po=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.getRequestSize=t.prepareSearchParameters=void 0;function n(e,t,n,r){var o,a=Et.__assign(Et.__assign({},t),{offset:n,anchorHotelId:r});if(null===(o=a.boundingBox)||void 0===o?void 0:o.length)return a;var i=e.polygon;return(null==i?void 0:i.length)?Et.__assign(Et.__assign({},a),{polygon:i}):e._geoloc?Et.__assign(Et.__assign({},a),{geolocation:e._geoloc}):a}function r(e,t){var n=e.rooms,r=void 0===n?"2":n,o=(0,Zn.getCheckInCheckOutDates)(e,t),a=o.checkIn,i=o.checkOut;return Et.__assign(Et.__assign({},e),{checkIn:a,checkOut:i,rooms:r})}function o(e,t,n){var r,o,a=e.anchor,i=e.anchorType;return void 0!==a.pageSize&&a.pageSize>=n.pageSize&&void 0===(null===(r=t.filters)||void 0===r?void 0:r.priceMin)&&void 0===(null===(o=t.filters)||void 0===o?void 0:o.priceMax)&&"price"!==t.sortField?a.pageSize:"hotel"===i?45:65}t.prepareSearchParameters=r,t.getRequestSize=o,t.search=function(e){var t=this,a=e.getFeatureEnabled,i=e.appConfig,s=e.algoliaClient,u=e.offersClient,c=e.options,l=e.configs,f=l.hso,d=l.exchangeRates,h=c.languages,p=d[c.currency],g=a("offers");return function(e,a){return void 0===a&&(a={}),Et.__awaiter(t,void 0,void 0,(function(){var t,l,d,v,y,m,_,b,w,O,I,T,S,E,x,P=this;return Et.__generator(this,(function(k){switch(k.label){case 0:return t=(0,Zn.createState)({}),l=0,d=a.onStart,v=a.onAnchorReceived,y=a.onHotelsReceived,m=a.onOffersReceived,_=a.onComplete,b=r(e,i.client),w=(0,Zn.generateSearchId)(e,c),t.update((function(e){e.searchParameters=b,e.searchId=w})),"function"==typeof d&&d(t.current()),[4,(0,xo.getAnchor)(s,i.algolia,c)(b)];case 1:return O=k.sent(),t.update((function(e){var t,n;if(e.anchor=O.anchor,e.anchorType=O.anchorType,void 0!==O.anchorHotel){var r=O.anchorHotel.objectID;e.anchorHotelId=r,e.hotelEntities=Et.__assign(Et.__assign({},null!==(n=e.hotelEntities)&&void 0!==n?n:{}),((t={})[r]=O.anchorHotel,t))}})),"function"==typeof v&&v(t.current()),I="hotel"===O.anchorType?"hotel_search":"place_search",T=f[I],S=(0,xo.geoSearch)(s,i.algolia,{languages:h,exchangeRate:p,priceBucketWidth:O.anchor.priceBucketWidth,requestSize:o(O,b,c),hsoFilter:(0,xo.evaluateHsoConfigs)({anchorHotel:O.anchorHotel,searchParameters:b,checkInNights:(0,xo.getCheckInNights)(b.checkIn,b.checkOut)},T)}),E=function(e){return void 0===e&&(e=0),Et.__awaiter(P,void 0,void 0,(function(){var r,o,a,i,s,l,f;return Et.__generator(this,(function(d){switch(d.label){case 0:return!0===b.skipGeoSearch?[3,2]:[4,S(n(O.anchor,b,e,null===(l=O.anchorHotel)||void 0===l?void 0:l.objectID))];case 1:r=d.sent(),t.update((function(e){var t;e.facets=r.facets,e.resultsCount=r.resultsCount,e.resultsCountTotal=r.resultsCountTotal,e.offset=r.offset,e.hotelIds=r.hotelIds,e.hotelEntities=Et.__assign(Et.__assign({},null!==(t=e.hotelEntities)&&void 0!==t?t:{}),r.hotelEntities),e.hotelsHaveStaticPosition=function(e,t,n){var r,o,a,i;if("price"===e.sortField)return!1;if(void 0!==(null===(r=e.filters)||void 0===r?void 0:r.priceMin)||void 0!==(null===(o=e.filters)||void 0===o?void 0:o.priceMax))return!1;if(n){var s=(0,xo.getCheckInNights)(e.checkIn,e.checkOut);return(null!==(i=null===(a=n.tags)||void 0===a?void 0:a["a".concat(s)])&&void 0!==i?i:0)>=t}return!0}(b,c.pageSize,r.facets)})),t.update((function(e){Object.keys(e.hotelEntities).forEach((function(t){e.hotelEntities[t]=(0,Zn.augmentHotelWithRegularPriceRange)(e.hotelEntities[t],p,e.anchor.priceBucketWidth)}))})),d.label=2;case 2:return"function"==typeof y&&y(t.current()),g&&void 0!==u?(o=t.get("hotelIds"),a=Et.__assign(Et.__assign({},b),{searchId:w,hotelIds:o,anchorHotelId:null===(f=O.anchorHotel)||void 0===f?void 0:f.objectID}),[4,u.getOffers(a,(function(e){var n=(0,or.augmentRaaResponse)(e,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},a),O.anchor),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:p}));t.update((function(e){n.hotelIds.length>0&&(e.hotelIds=n.hotelIds),e.hotelOfferEntities=Et.__assign(Et.__assign({},e.hotelOfferEntities),n.hotelOfferEntities)})),"function"==typeof m&&m(t.current())}))]):[3,4];case 3:i=d.sent(),s=(0,or.augmentRaaResponse)(i,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},a),O.anchor),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:p})),t.update((function(e){e.hotelIds=s.hotelIds,e.hotelOfferEntities=s.hotelOfferEntities})),t.update((function(e){e.dealScores=(0,Zn.getDealScores)(e)})),d.label=4;case 4:return"function"==typeof _&&_(t.current()),[2,t.current()]}}))}))},[4,E(b.offset)];case 2:return x=k.sent(),[2,{loadOffers:function(e){return Et.__awaiter(P,void 0,void 0,(function(){var t,n,r,o,a;return Et.__generator(this,(function(i){switch(i.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!g||!u)throw new Error("Offers loading is disabled");return t=e===x.anchorHotelId,n=Et.__assign(Et.__assign({},b),{searchId:w,getAllOffers:!0,hotelIds:t?void 0:[e],anchorHotelId:t?e:void 0}),[4,u.getOffers(n)];case 1:return r=i.sent(),o=(0,or.augmentRaaResponse)(r,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},n),O.anchor),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:p})),[2,null===(a=o.hotelOfferEntities)||void 0===a?void 0:a[e]]}}))}))},loadMore:function(){return Et.__awaiter(P,void 0,void 0,(function(){return Et.__generator(this,(function(e){return l+=o(O,b,c),[2,E(l)]}))}))}}]}}))}))}}}));var ko=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest,a=[],i=[],s={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){a.push(t=t.toLowerCase()),i.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(u())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),Co={};try{!function(e,t){if(new e("q=%2B").get("q")!==t||new e({q:t}).get("q")!==t||new e([["q",t]]).get("q")!==t||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;Co.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,n){var r=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,s=/\+/g,u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){h(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,n){this._ungap[e]=[t(n)]},forEach:function(e,n){var r=this;for(var o in r._ungap)r._ungap[o].forEach(a,o);function a(a){e.call(n,a,t(o),r)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var n=g(t),r=0,o=this._ungap[t];r<o.length;r++)e.push(n+"="+g(o[r]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=r(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,s=a.length;i<s;i++){var u=(c=a[i]).indexOf("=");-1<u?h(t,p(c.slice(0,u)),p(c.slice(u+1))):c.length&&h(t,p(c),"")}break;case n(e):for(i=0,s=e.length;i<s;i++){var c;h(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var l in e)h(t,l,e[l])}}function d(e,t){h(this,t,e)}function h(e,t,r){var o=n(r)?r.join(","):r;t in e?e[t].push(o):e[t]=[o]}function p(e){return decodeURIComponent(e.replace(i,"%25").replace(s," "))}function g(e){return encodeURIComponent(e).replace(a,v)}function v(e){return u[e]}Co.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function n(e,n){var r=[];return e.forEach(n,r),t?r[Symbol.iterator]():{next:function(){var e=r.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var n=this,r=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in r)&&(r[o]=n.getAll(o)).forEach((function(r){e.call(t,r,o,n)}))}))}),"keys"in e||(e.keys=function(){return n(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return n(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return n(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,n,r=this.entries(),o=r.next(),a=o.done,i=[],s=Object.create(null);!a;)t=(n=o.value)[0],i.push(t),t in s||(s[t]=[]),s[t].push(n[1]),a=(o=r.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,s[t].shift())}),function(t){var n=t.defineProperty,r=t.getOwnPropertyDescriptor,o=function(t){var n=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=n},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var s,u,c=i.prototype,l=r(c,"searchParams"),f=r(c,"href"),d=r(c,"search");!l&&d&&d.set&&(u=function(t){function r(n,r){e.append.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function o(n){e.delete.call(this,n),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function a(n,r){e.set.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}return function(e,t){return e.append=r,e.delete=o,e.set=a,n(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),s=function(e,t){return n(e,"_searchParams",{configurable:!0,writable:!0,value:u(t,e)}),t},t.defineProperties(c,{href:{get:function(){return f.get.call(this)},set:function(e){var t=this._searchParams;f.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,i),this._searchParams||s(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),s(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(Co.URLSearchParams.prototype);var jo=Co.URLSearchParams,Do=Object.freeze({__proto__:null,default:jo}),Ao=n(ko),Ro=n(Do),No=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.backendSearch=t.createAnchorRequestString=t.createSearchRequestString=void 0;var n=Et.__importDefault(Ao),r=Et.__importDefault(Ro);function o(){if("undefined"==typeof window)return null;var e,t=new r.default(window.location.search).get("sapiOverride");try{t?(window.sessionStorage.setItem("sapiOverride",t),e=t):e=window.sessionStorage.getItem("sapiOverride")}catch(e){}return e}function a(e){var t,n,a,i,s,u,c,l,f,d,h,p,g,v,y,m,_,b,w,O,I=e.profileKey,T=e.searchId,S=e.searchParameters,E=e.options,x=e.offset,P=e.attributes,k=(0,Zn.removeEmpty)({offset:x,searchId:T,profileId:I,query:S.query,hotelId:S.hotelId,placeId:S.hotelId?void 0:S.placeId,checkIn:S.checkIn,checkOut:S.checkOut,rooms:S.rooms,dayDistance:S.dayDistance,nights:S.nights,sortField:S.sortField,sortOrder:S.sortOrder,boundingBox:null===(t=S.boundingBox)||void 0===t?void 0:t.join(","),currency:E.currency,language:E.language,variations:null===(n=E.variations)||void 0===n?void 0:n.join(","),starRating:null===(i=null===(a=S.filters)||void 0===a?void 0:a.starRating)||void 0===i?void 0:i.join(","),guestRating:null===(u=null===(s=S.filters)||void 0===s?void 0:s.guestRating)||void 0===u?void 0:u.join(","),propertyTypeId:null===(l=null===(c=S.filters)||void 0===c?void 0:c.propertyTypeId)||void 0===l?void 0:l.join(","),facilities:null===(d=null===(f=S.filters)||void 0===f?void 0:f.facilities)||void 0===d?void 0:d.join(","),themeIds:null===(p=null===(h=S.filters)||void 0===h?void 0:h.themeIds)||void 0===p?void 0:p.join(","),chainIds:null===(v=null===(g=S.filters)||void 0===g?void 0:g.chainIds)||void 0===v?void 0:v.join(","),noHostels:null===(y=S.filters)||void 0===y?void 0:y.noHostels,priceMin:null===(m=S.filters)||void 0===m?void 0:m.priceMin,priceMax:null===(_=S.filters)||void 0===_?void 0:_.priceMax,hotelName:null===(b=S.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(w=S.filters)||void 0===w?void 0:w.freeCancellation,attributes:null==P?void 0:P.join(","),anonymousId:E.anonymousId,cugDeals:null===(O=S.cugDeals)||void 0===O?void 0:O.join(","),deviceType:E.deviceType,originId:S.originId,brand:E.brand,sortingBoost:(0,or.generateSortingBoost)(S),preferredRate:S.preferredRate,label:S.trafficSource,countryCode:E.countryCode,sapiOverride:o()});return new r.default(k).toString()}function i(e,t){var r=e.baseUrl,o=e.endpoints;return Et.__awaiter(this,void 0,void 0,(function(){var e,i,s,u,c,l;return Et.__generator(this,(function(f){switch(f.label){case 0:return e=a(t),[4,(0,n.default)("https://".concat(r,"/").concat(o.search,"?").concat(e),{credentials:"include"})];case 1:return(i=f.sent()).ok?[2,i.json()]:(s=t.searchParameters,u=t.options,c=t.offset,l=t.attributes,u.logger.log({name:"SearchFailed",value:Et.__assign(Et.__assign({},s),{offset:c,attributes:l,language:u.language,currency:u.currency,deviceType:u.deviceType})}),[2,Promise.reject(i)])}}))}))}function s(e){var t,n,o=e.profileKey,a=e.searchId,i=e.searchParameters,s=e.options,u=e.attributes,c=(0,Zn.removeEmpty)({searchId:a,profileId:o,query:i.query,hotelId:i.hotelId,placeId:i.hotelId?void 0:i.placeId,boundingBox:null===(t=i.boundingBox)||void 0===t?void 0:t.join(","),currency:s.currency,language:s.language,variations:null===(n=s.variations)||void 0===n?void 0:n.join(","),attributes:null==u?void 0:u.join(","),anonymousId:s.anonymousId});return new r.default(c).toString()}function u(e,t){var r=e.baseUrl,o=e.endpoints;return Et.__awaiter(this,void 0,void 0,(function(){var e,a,i,u,c;return Et.__generator(this,(function(l){switch(l.label){case 0:return e=s(t),[4,(0,n.default)("https://".concat(r,"/").concat(o.anchor,"?").concat(e))];case 1:return(a=l.sent()).ok?[2,a.json()]:(i=t.searchParameters,u=t.options,c=t.attributes,u.logger.log({name:"AnchorSearchFailed",value:Et.__assign(Et.__assign({},i),{attributes:c,language:u.language,currency:u.currency,deviceType:u.deviceType})}),[2,Promise.reject(a)])}}))}))}t.createSearchRequestString=a,t.createAnchorRequestString=s,t.backendSearch=function(e){var t,n=this,r=e.getFeatureEnabled,o=e.profileKey,a=e.appConfig,s=e.offersClient,c=e.options,l=r("offers"),f=!1;return function(e,r){return void 0===r&&(r={}),Et.__awaiter(n,void 0,void 0,(function(){var n,d,h,p,g,v,y,m,_,b,w,O,I,T=this;return Et.__generator(this,(function(S){switch(S.label){case 0:return n=(0,Zn.createState)({}),d=r.onStart,h=r.onAnchorReceived,p=r.onHotelsReceived,g=r.onOffersReceived,v=r.onComplete,y=0,m=(0,Po.prepareSearchParameters)(e,a.client),_=(0,Zn.generateSearchId)(e,c),n.update((function(e){e.searchParameters=m,e.searchId=_})),"function"==typeof d&&d(n.current()),b=function(e,r,u){return void 0===e&&(e=0),Et.__awaiter(T,void 0,void 0,(function(){var u,d,y,b,w,O;return Et.__generator(this,(function(I){switch(I.label){case 0:return[4,i(a.sapiBackend,{profileKey:o,searchParameters:m,options:c,offset:e,attributes:r,searchId:_})];case 1:return u=I.sent(),f||(t=u.exchangeRates[c.currency],(null===(O=c.callbacks)||void 0===O?void 0:O.onConfigReceived)&&c.callbacks.onConfigReceived({lov:u.lov,exchangeRates:u.exchangeRates}),f=!0),(void 0===r||r.includes("anchor"))&&(n.update((function(e){e.anchor=u.anchor,e.anchorHotelId=u.anchorHotelId,e.anchorType=u.anchorType,e.hotelEntities=u.hotelEntities})),"function"==typeof h&&h(n.current())),n.update((function(e){e.facets=u.facets,e.hotelEntities=u.hotelEntities,e.hotelIds=u.hotelIds,e.hotelsHaveStaticPosition=u.hotelsHaveStaticPosition,e.offset=u.offset,e.resultsCount=u.resultsCount,e.resultsCountTotal=u.resultsCountTotal})),"function"==typeof p&&p(n.current()),l&&void 0!==s?(d=n.get("hotelIds"),y=Et.__assign(Et.__assign({},m),{searchId:_,hotelIds:d,anchorHotelId:n.get("anchorHotelId")}),[4,s.getOffers(y,(function(e){var r=(0,or.augmentRaaResponse)(e,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},y),n.get("anchor")),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:t}));n.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=Et.__assign(Et.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof g&&g(n.current())}))]):[3,3];case 2:b=I.sent(),w=(0,or.augmentRaaResponse)(b,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},y),n.get("anchor")),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:t})),n.update((function(e){e.hotelIds=w.hotelIds,e.hotelOfferEntities=w.hotelOfferEntities})),n.update((function(e){e.dealScores=(0,Zn.getDealScores)(e)})),I.label=3;case 3:return"function"==typeof v&&v(n.current()),[2,n.current()]}}))}))},w=function(e,r,d){return void 0===e&&(e=0),void 0===d&&(d=!0),Et.__awaiter(T,void 0,void 0,(function(){var y,b,w=this;return Et.__generator(this,(function(O){switch(O.label){case 0:return y=function(){return Et.__awaiter(w,void 0,void 0,(function(){var e,r,i,d;return Et.__generator(this,(function(p){switch(p.label){case 0:return e=["anchor","anchorHotelId","anchorType","hotelEntities"],f||e.push("lov","exchangeRates"),[4,u(a.sapiBackend,{searchId:_,profileKey:o,searchParameters:m,options:c,attributes:e})];case 1:return r=p.sent(),f||(t=r.exchangeRates[c.currency],(null===(d=c.callbacks)||void 0===d?void 0:d.onConfigReceived)&&c.callbacks.onConfigReceived({lov:r.lov,exchangeRates:r.exchangeRates}),f=!0),n.update((function(e){e.anchor=r.anchor,e.anchorHotelId=r.anchorHotelId,e.anchorType=r.anchorType,e.hotelEntities=Et.__assign(Et.__assign({},e.hotelEntities),r.hotelEntities)})),"function"==typeof h&&h(n.current()),l&&void 0!==s&&"hotel"===r.anchorType?(i=Et.__assign(Et.__assign({},m),{anchorHotelId:r.anchorHotelId,searchId:_}),[4,s.getOffers(i,(function(e){var r=(0,or.augmentRaaResponse)(e,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},i),n.get("anchor")),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:t}));n.update((function(e){e.hotelOfferEntities=Et.__assign(Et.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof g&&g(n.current())}))]):[3,3];case 2:p.sent(),p.label=3;case 3:return[2,n.current()]}}))}))},b=function(){return Et.__awaiter(w,void 0,void 0,(function(){var r,u,f,h;return Et.__generator(this,(function(v){switch(v.label){case 0:return[4,i(a.sapiBackend,{searchId:_,profileKey:o,searchParameters:m,options:c,offset:e,attributes:["facets","hotelEntities","hotelIds","hotelsHaveStaticPosition","offset","resultsCount","resultsCountTotal"]})];case 1:return r=v.sent(),n.update((function(e){e.facets=r.facets,e.hotelEntities=d?Et.__assign(Et.__assign({},e.hotelEntities),r.hotelEntities):r.hotelEntities,e.hotelIds=r.hotelIds,e.hotelsHaveStaticPosition=r.hotelsHaveStaticPosition,e.offset=r.offset,e.resultsCount=r.resultsCount,e.resultsCountTotal=r.resultsCountTotal})),"function"==typeof p&&p(n.current()),l&&void 0!==s?(u=Et.__assign(Et.__assign({},m),{searchId:_,hotelIds:n.get("hotelIds")}),[4,s.getOffers(u,(function(e){var r=(0,or.augmentRaaResponse)(e,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},u),n.get("anchor")),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:t}));n.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=Et.__assign(Et.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof g&&g(n.current())}))]):[3,3];case 2:f=v.sent(),h=(0,or.augmentRaaResponse)(f,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},u),n.get("anchor")),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:t})),n.update((function(e){e.hotelIds=h.hotelIds,e.hotelOfferEntities=d?Et.__assign(Et.__assign({},e.hotelOfferEntities),h.hotelOfferEntities):h.hotelOfferEntities})),n.update((function(e){e.dealScores=(0,Zn.getDealScores)(e)})),v.label=3;case 3:return[2,n.current()]}}))}))},[4,void 0===r||r.includes("anchor")?Promise.all([y(),b()]):b()];case 1:return O.sent(),"function"==typeof v&&v(n.current()),[2,n.current()]}}))}))},O=(null===(I=c.variations)||void 0===I?void 0:I.includes("sapi4eva1-magic-sort-b"))?w:b,[4,f?O(m.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):O(m.offset)];case 1:return S.sent(),[2,{loadOffers:function(e){return Et.__awaiter(T,void 0,void 0,(function(){var r,o,a,i,u;return Et.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!l||!s)throw new Error("Offers loading is disabled");return r=e===n.get("anchorHotelId"),o=Et.__assign(Et.__assign({},m),{searchId:_,getAllOffers:!0,hotelIds:r?void 0:[e],anchorHotelId:r?e:void 0}),[4,s.getOffers(o)];case 1:return a=f.sent(),i=(0,or.augmentRaaResponse)(a,Et.__assign(Et.__assign(Et.__assign(Et.__assign({},o),n.get("anchor")),c),{priceBucketsCount:Sr.PRICE_BUCKET_COUNT,exchangeRate:t})),[2,null===(u=i.hotelOfferEntities)||void 0===u?void 0:u[e]]}}))}))},loadMore:function(){return Et.__awaiter(T,void 0,void 0,(function(){var e;return Et.__generator(this,(function(t){var r,o;return y+=(null===(e=c.variations)||void 0===e?void 0:e.includes("sapi4eva1-magic-sort-b"))?c.pageSize:(0,Po.getRequestSize)({anchor:n.get("anchor"),anchorHotel:(r=n.get("hotelEntities"),o=n.get("anchorHotelId"),o?r[o]:void 0),anchorType:n.get("anchorType")},m,c),[2,O(y,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"],!1)]}))}))}}]}}))}))}}})),Mo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0,t.suggest=function(e){var t=this,n=e.appConfig,r=e.algoliaClient,o=e.options.languages;return function(e,a){return Et.__awaiter(t,void 0,void 0,(function(){return Et.__generator(this,(function(t){switch(t.label){case 0:return[4,(0,xo.loadSuggests)(r,n.algolia,{suggestsCount:a,languages:o})(e)];case 1:return[2,t.sent()]}}))}))}}})),Uo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var n=Et.__importDefault(Ao),r=Et.__importDefault(Ro);function o(e,t){var n,o=e.hotelId,a=e.checkIn,i=e.checkOut,s=e.rooms,u=e.providerCode,c=e.cugDeals,l=(0,Zn.removeEmpty)({hotelId:o,checkIn:a,checkOut:i,rooms:s,providerCode:u,cugDeals:c,deviceType:t.deviceType,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(n=t.variations)||void 0===n?void 0:n.join(",")});return new r.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,r=e.appConfig,a=e.options;return function(e){return Et.__awaiter(t,void 0,void 0,(function(){var t,i,s;return Et.__generator(this,(function(u){switch(u.label){case 0:return t=o(e,a),[4,(0,n.default)("https://".concat(r.saf.baseUrl,"/").concat(r.saf.endpoints.offersRooms,"?").concat(t))];case 1:return(i=u.sent()).ok?[4,i.json()]:[3,3];case 2:return s=u.sent(),[2,Et.__assign({hotelId:e.hotelId,anonymousId:a.anonymousId},s)];case 3:return[2,Promise.reject(i)]}}))}))}}})),Bo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var n=Et.__importDefault(Ao),r=Et.__importDefault(Ro);function o(e,t){var n=e.checkInInst,r=e.checkInSpInst,o=e.feesMnd,a=e.feesOpt,i=e.policies,s=e.hotelName,u=e.placeDN,c=e.address,l=e.placeADName,f=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,g=Et.__assign(Et.__assign({},e),{checkInInst:n&&(0,fr.toString)(n,t),checkInSpInst:r&&(0,fr.toString)(r,t),feesMnd:o&&(0,fr.toString)(o,t),feesOpt:a&&(0,fr.toString)(a,t),hotelName:(0,fr.toString)(s,t),policies:i&&(0,fr.toString)(i,t),placeDisplayName:u&&(0,fr.translatedArrayToString)(u,t),displayAddress:c&&l&&(0,fr.mergeTranslatedAttributes)(c,l,t),facilities:null==d?void 0:d.map((function(e){return Et.__assign(Et.__assign({},e),{value:(0,fr.toString)(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return Et.__assign(Et.__assign({},e),{value:(0,fr.toString)(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return Et.__assign(Et.__assign({},e),{value:(0,fr.toString)(e.value,t)})})),propertyType:f&&Et.__assign(Et.__assign({},f),{value:(0,fr.toString)(f.value,t)})});return(0,Zn.omit)(["placeDN","placeADName","address"],g)}function a(e,t){var n=(0,Zn.removeEmpty)({id:e,language:t.join(","),attributes:["objectID","address","country","guestRating","isDeleted","starRating","_geoloc","placeADName","checkInSpInst","checkInMinAge","checkOutTime","checkInInst","checkInTime","checkInEnd","feesOpt","policies","phone","imageURIs","placeDN","reviewCount","chainID","lastBooked","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","pricing"].join(",")});return new r.default(n).toString()}t.safToSapiHotel=o,t.createRequestString=a,t.hotel=function(e){var t=this,r=e.appConfig,i=e.options;return function(e){return Et.__awaiter(t,void 0,void 0,(function(){var t,s;return Et.__generator(this,(function(u){switch(u.label){case 0:return t=a(e,i.languages),[4,(0,n.default)("https://".concat(r.saf.baseUrl,"/").concat(r.saf.endpoints.hotel,"?").concat(t))];case 1:return(s=u.sent()).ok?[4,s.json()]:[3,3];case 2:return[2,o(u.sent(),i.languages)];case 3:return[2,Promise.reject(s)]}}))}))}}})),qo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.sapiResponseToHotelOfferEntity=void 0;var n,r=Et.__importDefault(tr),o=Et.__importDefault(lr);function a(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.baseRate;return t&&(r+=e.taxes),n&&(r+=e.localTaxes),r}function i(e,t,n){var r=(0,o.default)((0,Zn.dateToMiddayUTC)(n),(0,Zn.dateToMiddayUTC)(t));if(r<1)throw new Error("checkOut cannot be the same or less than checkIn");return 1===r?e:e/r}function s(e,t){var n,r={baseRate:e.anchorRate.base,localTaxes:e.anchorRate.hotelFees,taxes:e.anchorRate.taxes},o=a(r,t.includeTaxes,t.includeLocalTaxes),s=i(o,t.checkIn,t.checkOut);return{anchorPriceRateBreakdown:Et.__assign(Et.__assign({},r),{calculatedTotalRate:o,nightlyRate:s}),availableOffersCount:e.availableOffersCount,fetchedAllOffers:e.fetchedAllOffers,hasMoreOffers:e.hasMoreOffers,id:e.id,offers:null===(n=e.offers)||void 0===n?void 0:n.map((function(n){return function(e,t,n){var r,o,s,u,c,l,f={baseRate:e.rate.base,localTaxes:e.rate.hotelFees,taxes:e.rate.taxes},d=a(f,n.includeTaxes,n.includeLocalTaxes),h=i(d,n.checkIn,n.checkOut),p=null!==(r=e.tags)&&void 0!==r?r:[],g=p.includes("top_offer"),v=p.includes("anchor_price"),y=p.includes("exclusive_cheapest_offer"),m=null===(o=e.package.amenities)||void 0===o?void 0:o.filter((function(e){return["allInclusive","breakfast","partialBreakfast","lunch","dinner","fullBoard","halfBoard","meals"].includes(e)})),_=e.package.refundable&&(0===e.cancellationPenalties.length||e.cancellationPenalties.some((function(e){return 0===e.amount||0===e.percent||0===e.nights})));return{id:e.id,bookURI:e.url,providerCode:e.providerCode,proxyProviderCode:e.intermediaryProvider,rateBreakdown:f,nightlyRate:h,calculatedTotalRate:d,availableRooms:e.availableRooms,cug:e.accessTier?e.accessTier.split(","):null,currency:e.currency,meals:m,tags:p,canPayLater:e.package.canPayLater,hasAnchorPrice:g,hasFreeCancellation:_,isAnchorPriceOffer:v,isTopOffer:g,isCheapest:y,roomID:e.roomID,roomName:null===(s=null==t?void 0:t[e.roomID])||void 0===s?void 0:s.name,additionalProviderParams:{feedId:null!==(c=null===(u=e.metadata)||void 0===u?void 0:u.feedID)&&void 0!==c?c:"",rateType:null===(l=e.metadata)||void 0===l?void 0:l.providerRateType}}}(n,e.rooms,t)})),topOfferData:{anchorPrice:o,anchorPriceNightly:s,offerIndexes:[0,1,2,3]}}}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(n||(n={})),t.sapiResponseToHotelOfferEntity=s,t.offers=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o="wss://".concat(e.baseUrl,"/").concat(e.endpoints.offers),a=new r.default(o,[],{maxRetries:20,WebSocket:t.WebSocket}),i={},u={};function c(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}}),a.reconnect()}function l(e){t.logger.log({name:"WebsocketError",value:Et.__assign(Et.__assign({},e),{service:"sapi"})}),a.reconnect()}function f(){for(var e=0,t=Object.keys(i);e<t.length;e++){var n=t[e],r=i[n];void 0!==r&&a.send(r)}}function d(e){var t;try{t=JSON.parse(e.data)}catch(e){return void console.log("WEBSOCKET: error parsing message")}var n=u[t.clientRequestId];"function"==typeof n&&n(t)}return a.addEventListener("open",f),a.addEventListener("close",c),a.addEventListener("error",l),a.addEventListener("message",d),{getOffers:function(e,r){return Et.__awaiter(this,void 0,void 0,(function(){var o,c;return Et.__generator(this,(function(l){return o={},c=(0,nr.v4)(),i[c]=function(e,t,n){var r,o={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:n,sortingBoost:(0,or.generateSortingBoost)(e),roomLimit:1,anchorRoomLimit:2,getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.trafficSource,countryCode:t.countryCode};try{r=JSON.stringify(o)}catch(e){console.log("WEBSOCKET: error serialising request")}return r}(e,t,c),[2,new Promise((function(l){u[c]=function(n){var a,f;if(void 0!==n)if(n.status.complete)l(o),i[c]=void 0,u[c]=void 0;else{var d=null===(a=n.results)||void 0===a?void 0:a.find((function(t){return t.id===e.anchorHotelId}));d?o.anchorHotelOfferEntity=s(d,Et.__assign(Et.__assign({},e),t)):o.hotelOfferEntities=null===(f=n.results)||void 0===f?void 0:f.map((function(n){return s(n,Et.__assign(Et.__assign({},e),t))})),"function"==typeof r&&r(Et.__assign({},o))}};var f=i[c];a.readyState===n.Open&&void 0!==f&&a.send(f)}))]}))}))}}}})),Lo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=void 0;var n=Et.__importDefault(d),r={log:function(){}};function o(e){void 0===e&&(e={});var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push("".concat(n,"-").concat(e[n]));return t}t.sapi=function(e,t){var a,i,s,u,c,l,f,d,h,p,g;return Et.__awaiter(this,void 0,void 0,(function(){function v(e){return m.client.features.includes(e)}var y,m,_,b,w,O,I,T,S,E,x,P,k;return Et.__generator(this,(function(C){switch(C.label){case 0:if(!e)throw new Error("Profile key is required");return y=Et.__assign(Et.__assign({},t),{logger:null!==(a=t.logger)&&void 0!==a?a:r,variations:o(t.variations),currency:null!==(s=null===(i=t.currency)||void 0===i?void 0:i.toUpperCase())&&void 0!==s?s:"USD",deviceType:null!==(c=null!==(u=t.deviceType)&&void 0!==u?u:t.deviceCategory)&&void 0!==c?c:"desktop",countryCode:null!==(l=t.countryCode)&&void 0!==l?l:t.userCountry,pageSize:null!==(f=t.pageSize)&&void 0!==f?f:20}),m=(0,Sr.getAppConfig)(e,y.initWithAppConfig),_=(0,n.default)("4UYGJP42KQ",m.algolia.apiKey,y.algoliaClientOptions),v("offers")&&m.daedalus.raaEndpoint&&(b=(null===(d=y.variations)||void 0===d?void 0:d.includes("a41n36ps-sapi-offers-b"))?(0,qo.offers)(m.sapiBackend,y):(0,or.raa)(m.daedalus.raaEndpoint,y)),w={appConfig:m,algoliaClient:_,getFeatureEnabled:v,profileKey:e,offersClient:b,options:Et.__assign(Et.__assign({},y),{languages:Et.__spreadArray(Et.__spreadArray([y.language],null!==(h=m.client.fallbackLanguages[y.language])&&void 0!==h?h:[],!0),["en"],!1)})},(O=null===(p=y.variations)||void 0===p?void 0:p.includes("c48b82da-sapi-backend-b"))||!v("configs")?[3,2]:[4,(0,xo.loadConfigs)(_,m.algolia,Et.__assign(Et.__assign({},w.options),{currencies:[y.currency,"EUR"]}))];case 1:I=C.sent(),(null===(g=y.callbacks)||void 0===g?void 0:g.onConfigReceived)&&(T=I.exchangeRates,S=I.lov,y.callbacks.onConfigReceived({exchangeRates:T,lov:S})),w.configs=I,C.label=2;case 2:return E=function(e){return v("search")?O?(0,No.backendSearch)(e):(0,Po.search)(e):function(){throw new Error("Search is not enabled for this Profile key")}},x=function(e){return v("rooms")?(0,Uo.rooms)(e):function(){throw new Error("Rooms search is not enabled for this Profile key")}},P=function(e){return v("suggests")?(0,Mo.suggest)(e):function(){throw new Error("Autosuggest is not enabled for this Profile key")}},k=function(e){return v("get-hotel")?(0,Bo.hotel)(e):function(){throw new Error("Get hotel is not alowed for this Profile key")}},[2,{rooms:x(w),search:E(w),suggest:P(w),hotel:k(w)}]}}))}))}})),Fo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ho=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Wo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),zo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Et.__exportStar(Fo,t),Et.__exportStar(Ho,t),Et.__exportStar(Wo,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),(0,Vn.enableES5)(),Et.__exportStar(Lo,t),Et.__exportStar(zo,t),t.default=Lo.sapi})))}));