UNPKG

pxsol-booking-search-widget

Version:

Embeddable booking engine search widget with React and Web Component builds.

13 lines 71.7 kB
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._title_1bzvz_2{font-size:1rem;margin:0 0 .5rem}._container_1bzvz_7{width:100%}._searchBar_1bzvz_11{position:relative;display:grid;grid-template-columns:1fr;gap:6px;background:#fff;padding:8px;border-radius:10px;border:1px solid rgba(15,23,42,.08);box-shadow:0 3px 10px #0f172a14;transition:box-shadow .16s ease,border-color .16s ease}@media (min-width: 600px){._searchBar_1bzvz_11{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 10px}}@media (min-width: 768px){._searchBar_1bzvz_11{grid-template-columns:repeat(3,minmax(0,1fr)) minmax(190px,1fr);grid-template-areas:"a b c d";align-items:stretch;background:#fff;border-radius:10rem;column-gap:8px;padding:8px 10px;box-shadow:0 6px 16px #0f172a1a}._searchBar_1bzvz_11._noPromoCode_1bzvz_45{grid-template-columns:repeat(3,minmax(0,1fr)) minmax(160px,.9fr)}._actions_1bzvz_49{grid-area:d;display:flex;align-items:center;gap:12px;width:100%;height:auto;justify-content:flex-end}._promoInput_1bzvz_58{width:100%}}._segment_1bzvz_63{position:relative;border-radius:8px;padding:5px 7px;z-index:auto;cursor:pointer;background:#ffffffeb;border:1px solid transparent;transition:background-color .16s ease,box-shadow .16s ease,border-color .16s ease}._segment_1bzvz_63:hover{background-color:#f8fafcf2;border-color:#0f172a1f;box-shadow:0 2px 10px #0f172a14}._segmentActive_1bzvz_80{background:#f6f8fcf5;border-color:var(--accent-border, rgba(31, 41, 55, .28));box-shadow:0 0 0 1px var(--accent-border, rgba(31, 41, 55, .28));z-index:5}._fadeIn_1bzvz_88{animation:_fadeIn_1bzvz_88 .22s ease both}@keyframes _fadeIn_1bzvz_88{0%{opacity:0;transform:translate(0)}to{opacity:1;transform:translate(0)}}@keyframes _fadeSlideInLeft_1bzvz_1{0%{opacity:0;transform:translate(-12px)}to{opacity:1;transform:translate(0)}}@keyframes _fadeSlideInRight_1bzvz_1{0%{opacity:0;transform:translate(12px)}to{opacity:1;transform:translate(0)}}._bgFadeIn_1bzvz_109{animation:_fadeIn_1bzvz_88 .22s ease both}._bgFadeInFromLeft_1bzvz_110{animation:_fadeSlideInLeft_1bzvz_1 .26s ease both}._bgFadeInFromRight_1bzvz_111{animation:_fadeSlideInRight_1bzvz_1 .26s ease both}._segmentBg_1bzvz_114{position:absolute;inset:0;background:var(--accent-surface, rgba(31, 41, 55, .08));border:1px solid var(--accent-border, rgba(31, 41, 55, .18));box-shadow:none;border-radius:inherit;opacity:0;transition:opacity .2s ease;z-index:0;pointer-events:none}._segmentActive_1bzvz_80 ._segmentBg_1bzvz_114{opacity:1}._segment_1bzvz_63>:not(._segmentBg_1bzvz_114){z-index:1}@media (min-width: 768px){._segment_1bzvz_63{border:none;border-radius:10rem;padding:6px 10px;min-width:0}}._segmentLabel_1bzvz_145{position:relative;display:block;font-size:10px;font-weight:600;color:#6b7280;margin-bottom:1px;white-space:nowrap}._segmentButton_1bzvz_155{all:unset;display:inline-flex;align-items:center;gap:6px;font-size:13px;line-height:1.35;color:#111827;cursor:pointer;padding:1px 0;position:relative;border-radius:10px;transition:color .18s ease;white-space:normal;overflow-wrap:anywhere;flex-wrap:wrap;width:100%;text-align:left;-webkit-user-select:none;user-select:none;min-height:22px}._segmentButton_1bzvz_155:focus-visible{outline:2px solid var(--accent-outline, rgba(31, 41, 55, .45));outline-offset:2px}._segmentButton_1bzvz_155[aria-pressed=true]{color:#0f172a}._inputBare_1bzvz_186{width:100%;border:none;outline:none;background:transparent;font-size:14px;padding:2px 0}._suggestions_1bzvz_195{position:absolute;z-index:20;top:100%;left:0;right:0;background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:12px;margin-top:6px;box-shadow:0 10px 30px #11182724;padding:6px;max-height:260px;overflow:auto}._suggestionItem_1bzvz_211{display:flex;width:100%;text-align:left;background:transparent;border:none;padding:10px 8px;border-radius:10px;cursor:pointer;font-size:14px}._suggestionItem_1bzvz_211:hover{background:#f3f4f6}._popover_1bzvz_227{position:absolute;z-index:100;top:calc(100% + 6px);left:0;background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:16px;box-shadow:0 10px 30px #11182724;padding:12px;min-width:280px}._popoverRow_1bzvz_240{display:grid;grid-template-columns:1fr;gap:8px}@media (min-width: 480px){._popoverRow_1bzvz_240{grid-template-columns:1fr 1fr}}._popoverActions_1bzvz_252{display:flex;justify-content:flex-end;margin-top:8px}._secondaryBtn_1bzvz_258{background:transparent;border:1px solid rgba(17,24,39,.2);color:#111827;border-radius:999px;padding:6px 12px;cursor:pointer}._actions_1bzvz_49{display:flex;flex-direction:column;justify-content:flex-start;gap:.75rem;align-items:stretch;width:100%;position:relative;z-index:0}._promoRow_1bzvz_278{display:flex;align-items:center;gap:8px;width:100%;flex:1 1 auto;position:relative;z-index:1}._promoInput_1bzvz_58{background:#fff;border:1px solid rgba(15,23,42,.14);border-radius:10px;padding:6px 9px;font-size:13px;color:#111827;min-width:140px;transition:border-color .16s ease,box-shadow .16s ease}._promoInput_1bzvz_58:focus{border-color:var(--accent-border, rgba(31, 41, 55, .28));box-shadow:0 0 0 3px var(--accent-surface, rgba(31, 41, 55, .12))}._searchBtn_1bzvz_304{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--primary-color, #1f2937);color:#fff;border:none;border-radius:10px;padding:8px 14px;cursor:pointer;box-shadow:0 8px 20px var(--primary-shadow-rgba, rgba(31, 41, 55, .28));width:100%;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease}._searchBtn_1bzvz_304:hover{transform:translateY(-1px);box-shadow:0 12px 24px var(--primary-shadow-rgba, rgba(31, 41, 55, .32));filter:brightness(1.05)}._searchBtn_1bzvz_304:active{transform:translateY(0);box-shadow:0 6px 16px var(--primary-shadow-rgba, rgba(31, 41, 55, .26));filter:brightness(.95)}@media (min-width: 768px){._actions_1bzvz_49{flex-direction:row;align-items:flex-start;gap:10px;width:100%;padding-inline-end:12px;justify-content:flex-end!important}._searchBtn_1bzvz_304{max-width:168px;padding:8px 16px}}._searchText_1bzvz_347{font-weight:600}._spinner_1bzvz_352{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:_spin_1bzvz_352 .6s linear infinite}@keyframes _spin_1bzvz_352{to{transform:rotate(360deg)}}._searchBtn_1bzvz_304:disabled{opacity:.8;cursor:not-allowed}._advanced_1bzvz_371{margin-top:10px}._redirectRow_1bzvz_375{display:flex;gap:8px;align-items:center}._visuallyHidden_1bzvz_381{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}._stickyMiniMobile_1bzvz_394{position:fixed;bottom:10px;left:10px;z-index:1000;background:var(--primary-color, #1f2937);color:#fff;border:none;border-radius:10px;padding:9px 14px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 6px 16px var(--primary-shadow-rgba, rgba(31, 41, 55, .28));cursor:pointer;font-weight:600;font-size:13px;transition:all .2s ease,filter .2s ease}._stickyMiniMobileTop_1bzvz_414{bottom:auto;top:20px}._stickyMiniMobile_1bzvz_394:hover{transform:translateY(-2px);box-shadow:0 8px 20px var(--primary-shadow-rgba, rgba(31, 41, 55, .32));filter:brightness(1.05)}._stickyMiniMobile_1bzvz_394:active{transform:translateY(0);filter:brightness(.95)}@media (min-width: 768px){._stickyMiniMobile_1bzvz_394{display:none}}._stickyBar_1bzvz_437{position:fixed;top:0;left:0;right:0;z-index:1000;background:#fff;border-bottom:1px solid rgba(17,24,39,.12);box-shadow:0 2px 12px #00000014;padding:8px;display:none}@media (min-width: 768px){._stickyBar_1bzvz_437{display:block}}._stickyBarButton_1bzvz_456{all:unset;display:flex;align-items:center;justify-content:center;width:100%;max-width:1000px;margin:0 auto;cursor:pointer}._stickyBarMini_1bzvz_467{display:flex;align-items:center;background:#f8fafcf2;border:1px solid rgba(17,24,39,.1);border-radius:14px;padding:0;gap:0;box-shadow:none;transition:all .2s ease}._stickyBarButton_1bzvz_456:hover ._stickyBarMini_1bzvz_467{box-shadow:0 4px 12px #0000001a}._stickyBarSearchBtn_1bzvz_483{all:unset;display:inline-flex;align-items:center;gap:6px;background:var(--primary-color, #1f2937);color:#fff!important;border:none;border-radius:12px;padding:6px 12px;cursor:pointer;font-size:13px;font-weight:600;box-shadow:0 4px 12px var(--primary-shadow-rgba, rgba(31, 41, 55, .24));transition:all .2s ease,filter .2s ease;white-space:nowrap;margin-inline:8px}._stickyBarSearchBtn_1bzvz_483:hover{transform:translateY(-1px);box-shadow:0 6px 16px var(--primary-shadow-rgba, rgba(31, 41, 55, .28));filter:brightness(1.05);color:#fff!important}._stickyBarSearchBtn_1bzvz_483:active{transform:translateY(0);filter:brightness(.95);color:#fff!important}._stickyBarSearchBtn_1bzvz_483:disabled{opacity:.6;cursor:not-allowed;transform:none!important;color:#fff!important}._stickyBarSegment_1bzvz_522{display:flex;flex-direction:column;padding:6px 12px;gap:1px;position:relative;flex:1 1 0;min-width:0}._stickyBarSegment_1bzvz_522:not(:last-child){border-right:1px solid rgba(17,24,39,.12)}._stickyBarLabel_1bzvz_536{font-size:10px;font-weight:600;color:#6b7280}._stickyBarValue_1bzvz_542{font-size:12px;color:#111827;font-weight:500;line-height:1.3;white-space:normal;overflow-wrap:anywhere}._stickyBarButton_1bzvz_456 svg{flex-shrink:0;color:#111827}._calendarOverlayHost_1bzvz_557{position:fixed;inset:0;background:#00000073;z-index:1200;display:flex;align-items:flex-start;justify-content:center;padding:16px 8px 24px}._calendarOverlayHost_1bzvz_557>div{width:100%;max-width:900px}._groups_1bzvz_574{display:grid;gap:.75rem;border:1px dashed rgba(17,24,39,.15);padding:.75rem;border-radius:8px}._group_1bzvz_574{display:grid;gap:.5rem}._groupControls_1bzvz_587{display:flex;gap:.5rem;flex-wrap:wrap}._groupControls_1bzvz_587 label{flex:1;min-width:120px}._summary_1bzvz_598{font-size:.85rem;opacity:.8}._secondaryBtn_1bzvz_258{background:transparent;border:1px solid rgba(17,24,39,.2);color:inherit;border-radius:999px;padding:.55rem 1rem;cursor:pointer}._error_1bzvz_612{color:#dc2626;font-size:.85rem;font-weight:500;padding:10px 16px;background:#fef2f2;border:1px solid #fecaca;border-radius:8px;margin-top:12px;display:flex;align-items:center;gap:8px}._error_1bzvz_612:before{content:"⚠️";font-size:1.2rem}._actions_1bzvz_49{display:flex;justify-content:space-between;gap:.75rem;align-items:center}@media (max-width: 767px){._searchBar_1bzvz_11{display:none}._searchBar_1bzvz_11._mobileExpanded_1bzvz_644{display:grid;position:relative}._actions_1bzvz_49{width:100%;height:auto}._searchBtn_1bzvz_304{width:100%;justify-content:center;min-height:44px}}._mobileReserveButton_1bzvz_661{display:none}@media (max-width: 767px){._mobileReserveButton_1bzvz_661{display:inline-flex;align-items:center;gap:8px;background:var(--primary-color, #1f2937);color:#fff;border:none;border-radius:10px;padding:12px 18px;cursor:pointer;box-shadow:0 6px 16px var(--primary-shadow-rgba, rgba(31, 41, 55, .28));width:100%;font-weight:600;font-size:16px;transition:all .2s ease,filter .2s ease;justify-content:center}._mobileReserveButton_1bzvz_661:hover{transform:translateY(-2px);box-shadow:0 8px 20px var(--primary-shadow-rgba, rgba(31, 41, 55, .32));filter:brightness(1.05)}._mobileReserveButton_1bzvz_661:active{transform:translateY(0);filter:brightness(.95)}._mobileReserveButton_1bzvz_661:disabled{opacity:.6;cursor:not-allowed;transform:none!important}._mobileCloseButton_1bzvz_702{position:absolute;top:10px;right:10px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:#0000000d;border:none;border-radius:50%;font-size:24px;color:#6b7280;cursor:pointer;z-index:100;transition:all .15s ease;padding:0;line-height:1}._mobileCloseButton_1bzvz_702:hover{background:#0000001a;color:#111827}._mobileCloseButton_1bzvz_702:active{background:#00000026}}._guestsModal_1bzvz_734{padding:0;min-width:320px;max-width:400px}@media (max-width: 480px){._popover_1bzvz_227{left:50%;right:auto;transform:translate(-50%);width:calc(100vw - 24px);min-width:0;box-sizing:border-box}._guestsModal_1bzvz_734{width:100%;max-width:none;min-width:0}}._guestsHeader_1bzvz_757{padding:16px 20px 12px;border-bottom:1px solid rgba(17,24,39,.1)}._guestsTitle_1bzvz_762{font-size:16px;font-weight:600;color:#111827;margin:0 0 4px}._guestsSubtitle_1bzvz_769{font-size:13px;color:#6b7280;margin:0}._guestsContent_1bzvz_775{padding:16px 20px}._roomGroup_1bzvz_780{background:transparent;border:none;border-radius:0;padding:16px 0;margin-bottom:0}._roomGroup_1bzvz_780:last-child{margin-bottom:0}._roomHeader_1bzvz_792{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}._roomTitle_1bzvz_799{font-size:14px;font-weight:600;color:#111827;margin:0}._removeRoomBtn_1bzvz_806{background:transparent;border:1px solid rgba(239,68,68,.3);color:#dc2626;border-radius:6px;padding:4px 8px;font-size:12px;cursor:pointer;transition:all .15s ease}._removeRoomBtn_1bzvz_806:hover{background:#ef44440d;border-color:#ef444480}._counterGroup_1bzvz_823{display:flex;flex-direction:column;gap:0}._counterItem_1bzvz_829{display:flex;align-items:center;justify-content:space-between;padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid rgba(17,24,39,.08)}._counterItem_1bzvz_829:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}._counterText_1bzvz_844{flex:1;display:flex;flex-direction:column}._ageHelperText_1bzvz_850{font-size:11px;color:#9ca3af;margin-top:4px;padding-left:4px}._counterLabel_1bzvz_857{font-size:13px;font-weight:500;color:#374151;margin-bottom:2px}._counterDescription_1bzvz_864{font-size:12px;color:#9ca3af;margin-bottom:0}._counterControl_1bzvz_870{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:8px;padding:8px 12px;min-width:100px}._counterBtn_1bzvz_881{background:transparent;border:none;color:#6b7280;cursor:pointer;padding:4px;border-radius:4px;transition:all .15s ease;display:flex;align-items:center;justify-content:center;width:24px;height:24px}._counterBtn_1bzvz_881:hover{background:#1118270d;color:#111827}._counterBtn_1bzvz_881:disabled{opacity:.4;cursor:not-allowed}._counterValue_1bzvz_906{font-size:14px;font-weight:500;color:#111827;min-width:20px;text-align:center}._childrenAgesInput_1bzvz_914{background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:8px;padding:8px 12px;font-size:14px;color:#111827;width:100%}._childrenAgesInput_1bzvz_914::placeholder{color:#9ca3af}._ageSelectGrid_1bzvz_929{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin-top:8px}._select_1bzvz_936{position:relative}._selectButton_1bzvz_940{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:8px;padding:8px 12px;font-size:14px;color:#111827;cursor:pointer}._selectOptions_1bzvz_955{position:absolute;z-index:25;top:calc(100% + 6px);left:0;right:0;background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:8px;box-shadow:0 10px 30px #11182724;max-height:220px;overflow:auto}._selectOption_1bzvz_955{width:100%;text-align:left;padding:8px 12px;background:transparent;border:none;cursor:pointer}._selectOption_1bzvz_955:hover{background:#1118270d}._addRoomBtn_1bzvz_983{background:transparent;border:1px dashed rgba(17,24,39,.3);color:#6b7280;border-radius:8px;padding:12px;cursor:pointer;transition:all .15s ease;width:100%;font-size:14px;margin-top:8px}._addRoomBtn_1bzvz_983:hover{border-color:#11182780;color:#111827;background:#11182705}._guestsSummary_1bzvz_1003{background:#11182705;border:1px solid rgba(17,24,39,.08);border-radius:8px;padding:12px;margin-top:16px}._guestsSummaryText_1bzvz_1011{font-size:13px;color:#6b7280;margin:0;text-align:center}._guestsActions_1bzvz_1019{padding:16px 20px;border-top:1px solid rgba(17,24,39,.1);display:flex;justify-content:flex-end}._doneBtn_1bzvz_1026{background:var(--primary-color, #1f2937);color:#fff;border:none;border-radius:10px;padding:9px 18px;font-size:14px;font-weight:500;cursor:pointer;transition:all .15s ease,filter .15s ease}._doneBtn_1bzvz_1026:hover{transform:translateY(-1px);filter:brightness(1.05)}._doneBtn_1bzvz_1026:active{transform:translateY(0);filter:brightness(.95)}._nightAdjustment_1bzvz_1049{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#fff;border:1px solid rgba(17,24,39,.1);border-radius:12px;margin-bottom:12px}._nightAdjustmentLabel_1bzvz_1060{font-size:14px;font-weight:500;color:#374151;white-space:nowrap}._nightAdjustmentControls_1bzvz_1067{display:flex;align-items:center;gap:8px;margin-left:auto}._nightAdjustmentBtn_1bzvz_1074{background:#f3f4f6;border:1px solid rgba(17,24,39,.12);color:#111827;border-radius:8px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease;font-size:18px;font-weight:600}._nightAdjustmentBtn_1bzvz_1074:hover:not(:disabled){background:#e5e7eb;border-color:#11182733}._nightAdjustmentBtn_1bzvz_1074:disabled{opacity:.4;cursor:not-allowed}._nightAdjustmentValue_1bzvz_1100{font-size:16px;font-weight:600;color:#111827;min-width:32px;text-align:center}._mobileStickyModal_1bzvz_1109{position:fixed;inset:0;background:#0000008c;z-index:1100;display:flex;align-items:flex-start;justify-content:center;padding:16px;overflow-y:auto;animation:_fadeIn_1bzvz_88 .2s ease}._mobileStickyModalContent_1bzvz_1122{width:100%;max-width:500px;background:#fff;border-radius:16px;box-shadow:0 20px 40px #0000004d;margin:auto;max-height:90vh;display:flex;flex-direction:column;animation:_slideUp_1bzvz_1 .3s ease}@keyframes _slideUp_1bzvz_1{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}._mobileStickyModalHeader_1bzvz_1146{display:flex;align-items:center;justify-content:space-between;padding:20px;border-bottom:1px solid rgba(17,24,39,.1);position:sticky;top:0;background:#fff;border-radius:16px 16px 0 0;z-index:10}._mobileStickyModalTitle_1bzvz_1159{font-size:18px;font-weight:600;color:#111827;margin:0}._mobileStickyModalClose_1bzvz_1166{all:unset;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:#1118270d;cursor:pointer;transition:all .15s ease;color:#6b7280}._mobileStickyModalClose_1bzvz_1166:hover{background:#1118271a;color:#111827}._mobileStickyCalendar_1bzvz_1185{padding:0 16px 16px;max-height:calc(90vh - 200px);overflow-y:auto}._calendarOverlay_f446n_2{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}._calendarModal_f446n_17{background:#fff;border-radius:16px;box-shadow:0 20px 60px #0003;max-width:900px;width:755px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;position:absolute;margin-top:30px;z-index:1}._calendarHeader_f446n_33{display:flex;justify-content:center;align-items:center;padding:20px 24px;border-bottom:1px solid #e5e7eb}._navButton_f446n_40{background:#fff;border:1px solid #e5e7eb;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:#374151;padding:0;border-radius:999px;box-shadow:0 2px 6px #0000000f;margin:0 8px}._navButton_f446n_40:hover{background:#f3f4f6;border-color:#d1d5db}._calendarHeader_f446n_33>h2{margin:0 20px}._calendarHeader_f446n_33 ._closeButton_f446n_65{margin-left:auto}._calendarHeader_f446n_33 h2{margin:0;font-size:18px;font-weight:600;color:#111827}._closeButton_f446n_65{background:none;border:none;font-size:24px;cursor:pointer;color:#6b7280;padding:4px;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;transition:background-color .2s}._closeButton_f446n_65:hover{background-color:#f3f4f6;color:#111827}._calendarContent_f446n_98{flex:1;overflow-y:auto;padding:20px 24px}._monthCards_f446n_104{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:0}._monthCard_f446n_104{position:relative;background:transparent;border-radius:0;padding:20px;border:none;box-shadow:none}._monthCard_f446n_104:not(:last-child):after{content:"";position:absolute;right:0;top:0;bottom:0;width:1px;background-color:#e5e7eb}._monthHeader_f446n_131{margin-bottom:16px}._monthTitle_f446n_135{margin:0;font-size:16px;font-weight:600;color:#111827}._calendarGrid_f446n_143{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}._dayHeader_f446n_149{display:flex;align-items:center;justify-content:center;height:32px;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase}._dayButton_f446n_161{display:flex;align-items:center;justify-content:center;height:40px;width:40px;border:none;background:transparent;border-radius:8px;cursor:pointer;font-size:14px;font-weight:500;color:#374151;transition:all .2s ease;position:relative}._dayButton_f446n_161:hover:not(._disabled_f446n_178){background-color:#f3f4f6;color:#111827}._dayButton_f446n_161:focus{outline:2px solid #3b82f6;outline-offset:2px}._otherMonth_f446n_189{color:#d1d5db;visibility:hidden}._pastDay_f446n_194{color:#d1d5db;text-decoration:line-through;opacity:.5}._today_f446n_200{background-color:#dbeafe;color:#1d4ed8;font-weight:600}._weekend_f446n_206{background-color:var(--calendar-weekend-bg, transparent)}._today_f446n_200:hover{background-color:#bfdbfe}._selected_f446n_215{background-color:#111827;color:#fff;font-weight:600}._selected_f446n_215:hover{background-color:#374151}._checkIn_f446n_225,._checkOut_f446n_234{background-color:#111827;color:#fff;font-weight:600;z-index:2;position:relative;transition:background-color .2s ease,color .2s ease}._inRange_f446n_243{background-color:var(--calendar-range-bg, #e5e7eb);color:#111827;position:relative}._inRange_f446n_243:before{content:"";position:absolute;inset:0 -2px;background-color:var(--calendar-range-bg, #e5e7eb);z-index:-1}._checkIn_f446n_225:after{content:none}._checkOut_f446n_234:before{content:none}._disabled_f446n_178{color:#d1d5db;cursor:not-allowed;background-color:transparent}._disabled_f446n_178:hover{background-color:transparent;color:#d1d5db}._calendarFooter_f446n_277{padding:20px 24px;border-top:1px solid #e5e7eb;display:flex;flex-direction:column;gap:16px;background-color:#fafafa}._calendarFooterTop_f446n_286{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px}._dateSummary_f446n_294{display:flex;gap:24px}._selectedDate_f446n_299{display:flex;flex-direction:column;gap:4px}._dateLabel_f446n_305{font-size:12px;font-weight:500;color:#6b7280;text-transform:uppercase}._dateValue_f446n_312{font-size:14px;font-weight:600;color:#111827}._doneButton_f446n_318{background:var(--primary-color, #111827);color:#fff;border:none;border-radius:8px;padding:10px 20px;font-size:14px;font-weight:600;cursor:pointer;transition:background-color .2s}._doneButton_f446n_318:hover{background-color:var(--primary-color-hover, #374151)}._nightAdjustment_f446n_335{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#fff;border:1px solid rgba(17,24,39,.1);border-radius:12px;margin-bottom:12px}._nightAdjustmentLabel_f446n_346{font-size:14px;font-weight:500;color:#374151;white-space:nowrap}._nightAdjustmentControls_f446n_353{display:flex;align-items:center;gap:8px;margin-left:auto}._nightAdjustmentBtn_f446n_360{background:#f3f4f6;border:1px solid rgba(17,24,39,.12);color:#111827;border-radius:8px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease;font-size:18px;font-weight:600}._nightAdjustmentBtn_f446n_360:hover:not(:disabled){background:#e5e7eb;border-color:#11182733}._nightAdjustmentBtn_f446n_360:disabled{opacity:.4;cursor:not-allowed}._nightAdjustmentValue_f446n_386{font-size:16px;font-weight:600;color:#111827;min-width:48px;text-align:center}@media (max-width: 768px){._calendarOverlay_f446n_2{padding:10px}._calendarModal_f446n_17{max-height:95vh;width:calc(100vw - 24px);left:50%;transform:translate(-50%);right:auto;margin-top:12px;z-index:1000}._calendarHeader_f446n_33,._calendarContent_f446n_98{padding:16px 20px}._monthCard_f446n_104{padding:16px}._calendarFooter_f446n_277{padding:16px 20px;flex-direction:column;gap:16px;align-items:stretch}._nightAdjustment_f446n_335{width:100%}._nightAdjustmentControls_f446n_353{margin-left:0;justify-content:center}._calendarFooterTop_f446n_286{flex-direction:column;align-items:stretch}._dateSummary_f446n_294{justify-content:center;gap:16px;width:100%}._doneButton_f446n_318{width:100%}._monthCard_f446n_104:not(:last-child):after{position:absolute;inset:auto 0 0;height:1px;width:100%}._monthCards_f446n_104{gap:1px}._dayButton_f446n_161{height:36px;width:36px;font-size:13px}}@media (max-width: 480px){._calendarGrid_f446n_143{gap:2px}._dayButton_f446n_161{height:32px;width:32px;font-size:12px}._monthCards_f446n_104{gap:16px}._calendarModal_f446n_17{width:calc(100vw - 16px);border-radius:12px}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),We="_container_1bzvz_7",Je="_searchBar_1bzvz_11",Ue="_noPromoCode_1bzvz_45",He="_actions_1bzvz_49",Ze="_promoInput_1bzvz_58",Xe="_segment_1bzvz_63",Qe="_segmentActive_1bzvz_80",qe="_fadeIn_1bzvz_88",Ke="_bgFadeIn_1bzvz_109",et="_bgFadeInFromLeft_1bzvz_110",tt="_bgFadeInFromRight_1bzvz_111",nt="_segmentBg_1bzvz_114",st="_segmentLabel_1bzvz_145",ot="_segmentButton_1bzvz_155",at="_popover_1bzvz_227",rt="_promoRow_1bzvz_278",it="_searchBtn_1bzvz_304",ct="_searchText_1bzvz_347",lt="_spinner_1bzvz_352",dt="_visuallyHidden_1bzvz_381",ut="_stickyMiniMobile_1bzvz_394",ht="_stickyMiniMobileTop_1bzvz_414",mt="_stickyBar_1bzvz_437",gt="_stickyBarButton_1bzvz_456",bt="_stickyBarMini_1bzvz_467",pt="_stickyBarSearchBtn_1bzvz_483",ft="_stickyBarSegment_1bzvz_522",xt="_stickyBarLabel_1bzvz_536",_t="_stickyBarValue_1bzvz_542",kt="_calendarOverlayHost_1bzvz_557",yt="_error_1bzvz_612",wt="_mobileExpanded_1bzvz_644",vt="_mobileReserveButton_1bzvz_661",jt="_mobileCloseButton_1bzvz_702",Ct="_guestsModal_1bzvz_734",Nt="_guestsHeader_1bzvz_757",Dt="_guestsTitle_1bzvz_762",St="_guestsContent_1bzvz_775",It="_roomGroup_1bzvz_780",Mt="_counterGroup_1bzvz_823",Bt="_counterItem_1bzvz_829",Tt="_counterText_1bzvz_844",At="_counterLabel_1bzvz_857",Et="_counterDescription_1bzvz_864",Ot="_counterControl_1bzvz_870",Rt="_counterBtn_1bzvz_881",Lt="_counterValue_1bzvz_906",zt="_guestsActions_1bzvz_1019",Ft="_doneBtn_1bzvz_1026",o={container:We,searchBar:Je,noPromoCode:Ue,actions:He,promoInput:Ze,segment:Xe,segmentActive:Qe,fadeIn:qe,bgFadeIn:Ke,bgFadeInFromLeft:et,bgFadeInFromRight:tt,segmentBg:nt,segmentLabel:st,segmentButton:ot,popover:at,promoRow:rt,searchBtn:it,searchText:ct,spinner:lt,visuallyHidden:dt,stickyMiniMobile:ut,stickyMiniMobileTop:ht,stickyBar:mt,stickyBarButton:gt,stickyBarMini:bt,stickyBarSearchBtn:pt,stickyBarSegment:ft,stickyBarLabel:xt,stickyBarValue:_t,calendarOverlayHost:kt,error:yt,mobileExpanded:wt,mobileReserveButton:vt,mobileCloseButton:jt,guestsModal:Ct,guestsHeader:Nt,guestsTitle:Dt,guestsContent:St,roomGroup:It,counterGroup:Mt,counterItem:Bt,counterText:Tt,counterLabel:At,counterDescription:Et,counterControl:Ot,counterBtn:Rt,counterValue:Lt,guestsActions:zt,doneBtn:Ft},Pt="_calendarModal_f446n_17",$t="_calendarHeader_f446n_33",Gt="_navButton_f446n_40",Vt="_closeButton_f446n_65",Yt="_calendarContent_f446n_98",Wt="_monthCards_f446n_104",Jt="_monthCard_f446n_104",Ut="_monthHeader_f446n_131",Ht="_monthTitle_f446n_135",Zt="_calendarGrid_f446n_143",Xt="_dayHeader_f446n_149",Qt="_dayButton_f446n_161",qt="_disabled_f446n_178",Kt="_otherMonth_f446n_189",en="_pastDay_f446n_194",tn="_today_f446n_200",nn="_weekend_f446n_206",sn="_selected_f446n_215",on="_checkIn_f446n_225",an="_checkOut_f446n_234",rn="_inRange_f446n_243",cn="_calendarFooter_f446n_277",ln="_calendarFooterTop_f446n_286",dn="_dateSummary_f446n_294",un="_selectedDate_f446n_299",hn="_dateLabel_f446n_305",mn="_dateValue_f446n_312",gn="_doneButton_f446n_318",bn="_nightAdjustment_f446n_335",pn="_nightAdjustmentLabel_f446n_346",fn="_nightAdjustmentControls_f446n_353",xn="_nightAdjustmentBtn_f446n_360",_n="_nightAdjustmentValue_f446n_386",m={calendarModal:Pt,calendarHeader:$t,navButton:Gt,closeButton:Vt,calendarContent:Yt,monthCards:Wt,monthCard:Jt,monthHeader:Ut,monthTitle:Ht,calendarGrid:Zt,dayHeader:Xt,dayButton:Qt,disabled:qt,otherMonth:Kt,pastDay:en,today:tn,weekend:nn,selected:sn,checkIn:on,checkOut:an,inRange:rn,calendarFooter:cn,calendarFooterTop:ln,dateSummary:dn,selectedDate:un,dateLabel:hn,dateValue:mn,doneButton:gn,nightAdjustment:bn,nightAdjustmentLabel:pn,nightAdjustmentControls:fn,nightAdjustmentBtn:xn,nightAdjustmentValue:_n},kn=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],yn=["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],Be=({checkInDate:s,checkOutDate:n,minDate:l,numberOfNights:g=1,editingMode:C,onDateSelect:N,onNightAdjust:v,onClose:T,onDone:S})=>{const y=new Date,ae=y.getMonth(),L=y.getFullYear(),[O,I]=u.useState(ae),[x,M]=u.useState(L);u.useEffect(()=>{console.log("[booking-search-widget][Calendar] props",{checkInDate:s,checkOutDate:n,minDate:l})},[s,n,l]);const H=B=>{const F=B.getFullYear(),A=String(B.getMonth()+1).padStart(2,"0"),R=String(B.getDate()).padStart(2,"0");return`${F}-${A}-${R}`},$=B=>{if(!B)return null;const[F,A,R]=B.split("-").map(Number);return new Date(F,(A||1)-1,R||1)},G=$(s),W=$(n),K=(B,F)=>{const A=new Date(F,B,1),R=new Date(A);R.setDate(R.getDate()-A.getDay());const re=[],ee=new Date(R);for(let b=0;b<42;b++){const D=new Date(ee),Z=D.getDate(),w=D.getMonth()===B,ie=H(D)===H(y),ue=l?$(l):y,te=H(D)<H(ue??y),J=D.getDay()===0||D.getDay()===6,ne=H(D),se=s===ne,he=n===ne;let z=!1;if(he&&G&&s&&n){const X=$(s),Q=$(n);Q&&X&&Q>X&&(z=!0)}const _=se||z;let ce=!1;if(G&&W&&s&&n){const X=$(s),Q=$(n);if(X&&Q&&Q>X){const me=G<W?G:W,P=G>W?G:W;ce=D>me&&D<P}}let d=te||!w;C==="checkout"&&G&&s&&ne<=s&&!se&&(d=!0),re.push({date:D,day:Z,isCurrentMonth:w,isToday:ie,isWeekend:J,isPast:te,isSelected:_,isInRange:ce,isCheckIn:se,isCheckOut:z,isDisabled:d}),ee.setDate(ee.getDate()+1)}return re};u.useMemo(()=>K(O,x),[O,x,s,n,l,C]);const de=B=>{if(B.isDisabled)return;const F=H(B.date);console.log("[booking-search-widget][Calendar] onDateSelect",{dateStr:F,editingMode:C}),N(F)},xe=()=>{O===11?(I(0),M(x+1)):I(O+1)},_e=()=>{O===0?(I(11),M(x-1)):I(O-1)},ke=()=>{const B=[],F=O,A=x,R=(O+1)%12,re=O===11?x+1:x,ee=[[F,A],[R,re]];for(const[b,D]of ee){const Z=K(b,D);B.push(t.jsxs("div",{className:m.monthCard,children:[t.jsx("div",{className:m.monthHeader,children:t.jsxs("h3",{className:m.monthTitle,children:[kn[b]," ",D]})}),t.jsxs("div",{className:m.calendarGrid,children:[yn.map(w=>t.jsx("div",{className:m.dayHeader,children:w},w)),Z.map((w,ie)=>t.jsx("button",{type:"button",className:` ${m.dayButton} ${w.isCurrentMonth?"":m.otherMonth} ${w.isPast?m.pastDay:""} ${w.isWeekend?m.weekend:""} ${w.isToday?m.today:""} ${w.isSelected?m.selected:""} ${w.isInRange?m.inRange:""} ${w.isCheckIn?m.checkIn:""} ${w.isCheckOut?m.checkOut:""} ${w.isDisabled?m.disabled:""} `,onClick:()=>de(w),disabled:w.isDisabled,children:w.day},ie))]})]},`${D}-${b}`))}return B};return t.jsxs("div",{className:m.calendarModal,onMouseDown:B=>B.stopPropagation(),children:[t.jsxs("div",{className:m.calendarHeader,children:[t.jsx("button",{type:"button",className:m.navButton,onClick:_e,"aria-label":"Mes anterior",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":!0,width:"18",height:"18",children:t.jsx("path",{d:"M15.5 19l-7-7 7-7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h2",{children:"Seleccionar fechas"}),t.jsx("button",{type:"button",className:m.navButton,onClick:xe,"aria-label":"Mes siguiente",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":!0,width:"18",height:"18",children:t.jsx("path",{d:"M8.5 5l7 7-7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("button",{type:"button",className:m.closeButton,onClick:T,"aria-label":"Cerrar calendario",children:"×"})]}),t.jsx("div",{className:m.calendarContent,children:t.jsx("div",{className:m.monthCards,children:ke()})}),t.jsxs("div",{className:m.calendarFooter,children:[t.jsxs("div",{className:m.calendarFooterTop,children:[t.jsxs("div",{className:m.dateSummary,children:[s&&t.jsxs("div",{className:m.selectedDate,children:[t.jsx("span",{className:m.dateLabel,children:"Check-in:"}),t.jsx("span",{className:m.dateValue,children:$(s)?.toLocaleDateString("es-ES",{day:"numeric",month:"long"})})]}),n&&t.jsxs("div",{className:m.selectedDate,children:[t.jsx("span",{className:m.dateLabel,children:"Check-out:"}),t.jsx("span",{className:m.dateValue,children:$(n)?.toLocaleDateString("es-ES",{day:"numeric",month:"long"})})]})]}),t.jsx("button",{type:"button",className:m.doneButton,onClick:()=>{S?S():T()},"aria-label":"Aplicar selección",children:"Listo"})]}),s&&n&&v&&t.jsxs("div",{className:m.nightAdjustment,children:[t.jsx("span",{className:m.nightAdjustmentLabel,children:"Ajustar noches:"}),t.jsxs("div",{className:m.nightAdjustmentControls,children:[t.jsx("button",{type:"button",className:m.nightAdjustmentBtn,onClick:()=>v(-1),disabled:g<=1,"aria-label":"Reducir una noche",children:"−"}),t.jsxs("span",{className:m.nightAdjustmentValue,children:[g," ",g===1?"noche":"noches"]}),t.jsx("button",{type:"button",className:m.nightAdjustmentBtn,onClick:()=>v(1),"aria-label":"Aumentar una noche",children:"+"})]})]})]})]})},Ee={rooms:1,adults:2,childrenAges:[],infants:0},Oe=";",Re=".",ye=(s,n=0)=>{const l=Number.parseInt(s,10);return Number.isFinite(l)&&l>=0?l:n},wn=s=>{const n=Number.parseFloat(s);return Number.isFinite(n)&&n>=0?n:0},Le=s=>s?s.split(Oe).map(n=>n.trim()).filter(Boolean).map(n=>{const[l,g]=n.split(":"),[C,N="0",v="0"]=(g??"").split(","),T=N.split(Re).map(S=>S.trim()).filter(Boolean).map(S=>wn(S)).filter(S=>S>=0);return{rooms:Math.max(1,ye(l,1)),adults:Math.max(1,ye(C,1)),childrenAges:T,infants:Math.max(0,ye(v,0))}}):[Ee],ze=s=>s.map(l=>{const C=l.childrenAges.filter(v=>typeof v=="number"&&Number.isFinite(v)&&v>=0).map(v=>{if(Number.isInteger(v))return String(v);const T=Number(v.toFixed(2));return T%1===0?String(T):T.toString()}).join(Re);return`${l.rooms}:${l.adults},${C},${l.infants}`}).join(Oe),we=s=>s.reduce((l,g)=>(l.rooms+=g.rooms,l.adults+=g.adults,l.children+=g.childrenAges.length,l.infants+=g.infants,l),{rooms:0,adults:0,children:0,infants:0}),Fe=s=>s.map(n=>({...n,childrenAges:[...n.childrenAges]})),ve=/\d{4}-\d{2}-\d{2}/,vn=()=>{const s=new Date;s.setHours(0,0,0,0);const n=s.getFullYear(),l=String(s.getMonth()+1).padStart(2,"0"),g=String(s.getDate()).padStart(2,"0");return`${n}-${l}-${g}`},Te=(s,n)=>{const[l,g,C]=s.split("-").map(Number),N=new Date(l,g-1,C);N.setDate(N.getDate()+n);const v=N.getFullYear(),T=String(N.getMonth()+1).padStart(2,"0"),S=String(N.getDate()).padStart(2,"0");return`${v}-${T}-${S}`},Ae=(s,n)=>s&&ve.test(s)?s:n,jn="en",Cn="USD",Nn="GLOBAL",Dn=1e3,je=s=>{const n=Ae(s.initialStart,vn()),l=Ae(s.initialEnd,Te(n,1)),g=n;let C=l;C<=g&&(C=Te(g,1));const N=Le(s.initialGroups),v=N.length?N:[Ee],T=s.productId??Dn;let S;if(typeof window<"u")try{const y=localStorage.getItem(`booking-widget-promo-code-${T}`);y&&(S=y)}catch(y){console.warn("[booking-search-widget] could not read promo code from localStorage",y)}return{startDate:g,endDate:C,pos:s.pos??Nn,locale:s.locale??jn,currency:s.currency??Cn,productId:T,groups:Fe(v),redirect:!!s.redirect,promoCode:S,isSearching:!1,errors:{}}},Sn=(s,n)=>{if(!ve.test(s))return"Start date is invalid.";if(!ve.test(n))return"End date is invalid.";if(n<=s)return"End date must be after start date.";const l=new Date(s),C=new Date(n).getTime()-l.getTime();return Math.ceil(C/(1e3*60*60*24))<1?"Check-out must be at least 1 day after check-in.":null},In=s=>{if(!s.length)return"At least one room group is required.";for(const[n,l]of s.entries()){if(l.rooms<=0)return`Room ${n+1}: rooms must be greater than 0.`;if(l.adults<=0)return`Room ${n+1}: adults must be greater than 0.`;if(l.childrenAges.some(g=>g<0))return`Room ${n+1}: child ages must be >= 0.`;if(l.infants<0)return`Room ${n+1}: infants must be >= 0.`}return null},Pe=s=>{const n={},l=Sn(s.startDate,s.endDate);l&&(n.dates=l),(!s.productId||s.productId<=0)&&(n.productId="Product is required.");const g=In(s.groups);return g&&(n.groups=g),s.pos||(n.pos="POS is required."),s.locale||(n.locale="Language is required."),s.currency||(n.currency="Currency is required."),{valid:Object.keys(n).length===0,errors:n}},$e=(s,n)=>{let l=s.groups;(n.hideBabies||n.hideChildren)&&(l=s.groups.map(N=>({...N,childrenAges:n.hideChildren?[]:N.childrenAges,infants:n.hideBabies?0:N.infants}))),console.log("[booking-search-widget][buildSearchPayload] groups to format:",JSON.stringify(l,null,2));const g=ze(l);console.log("[booking-search-widget][buildSearchPayload] formatted groups_form:",g);const C={start_date:s.startDate,end_date:s.endDate,product_id:Number(s.productId)||0,groups_form:g,pos:s.pos,language:s.locale,currency:s.currency};return s.promoCode&&(C.code=s.promoCode),C},Mn=(s,n)=>{s&&s(n)},Bn=(s,n,l)=>Mn(s,{type:n,payload:l}),Tn=[{value:"en",label:"English"},{value:"es",label:"Español"},{value:"pt",label:"Português"}],An=["USD","EUR","ARS","BRL"],le=767,En="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ill5Mi1oSy1VYktQTFZSci1QSm5heSJ9.eyJnaXZlbl9uYW1lIjoiU2FudGlhZ28iLCJmYW1pbHlfbmFtZSI6IkNhYnJhbCIsIm5pY2tuYW1lIjoic2NhYnJhbCIsIm5hbWUiOiJTYW50aWFnbyBDYWJyYWwiLCJwaWN0dXJlIjoiaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUNnOG9jSkp2NkxsUFVxVl90NTRobjk1TGlqWTJXcTN3S21uaDNSYjZaZFY4Tzk4MW1XOGgySVc9czk2LWMiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0xMFQxODowNjoyMi40NTZaIiwiZW1haWwiOiJzY2FicmFsQHB4c29sLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpc3MiOiJodHRwczovL2F1dGgwLnB4c29sLmNvbS8iLCJhdWQiOiJtN2pDRFBhcVFCaGxNM2hRbFVZYnhhUURUVXhvSmtJVyIsInN1YiI6Imdvb2dsZS1vYXV0aDJ8MTA5Njc3NTgxMDcwMTk4NTU4NjI2IiwiaWF0IjoxNzYyNzk3OTgzLCJleHAiOjE3NjMzOTc5ODMsInNpZCI6IldlRVpNRURhVjFzellyWWh0cXdkbDJPaWtERUpRa190Iiwibm9uY2UiOiI3NWU1M2RkZGFhMzczNWYxMzkzODYxMTM4NGE1ZDZkNCJ9.VON_f1eYpEBwG_L3yXkz4IjeLJXdm6XHS5d753Zm5bBcvQc3zPuCyqG_4vHP5KOHK17VeWslkap1TR_yLGJNUB9XPoyTH7KjQrArPtW9P2p-cIO3uADYdv1sGsLFYYjb_KkVcSOUFD8XXbQ-3mgMOXLKqJbUiLT1M12X9v-mZv-OWwkrg0gLTW9hZVaqs3OU0tnwUsfEH3nHge5EdUj5yAGVDi31aDFke-afR2hBlFEZJ4JHuqjtWXD_vlW-C18psYoWSRojlkkP31W5A6M8TILZZm_ck1QoPf8aN6aXF_g6btkhLpuhw7PSuVmImiw4IFlxdcAnv0dYt962Kqf8HA",On=(s,n,l)=>{const g=Fe(s);return g[n]={...g[n],...l,childrenAges:l.childrenAges??g[n].childrenAges},g},Ge=s=>{const[n,l]=u.useState(()=>je(s)),g=u.useRef(!1),C=u.useRef(null),N=u.useRef(null),v=u.useRef(null),T=u.useRef(null),[S,y]=u.useState(!1),[ae,L]=u.useState(!1),[O,I]=u.useState(!1),[x,M]=u.useState(null),[H,$]=u.useState(!1),[G,W]=u.useState(!1),K=u.useRef(!1),de=u.useRef(!0),xe=()=>typeof window>"u"?!1:window.visualViewport&&typeof window.visualViewport.width=="number"?window.visualViewport.width<=le:typeof window.matchMedia=="function"?window.matchMedia(`(max-width: ${le}px)`).matches:window.innerWidth<=le,[_e,ke]=u.useState(xe),[B,F]=u.useState(!1),A=_e||B,[R,re]=u.useState(null),ee=u.useCallback(e=>{re(a=>a===e?a:e)},[]),b=u.useMemo(()=>{const e=n.productInfo,a={maxAdults:e?.max_mayores??e?.MaxAdult??Number.POSITIVE_INFINITY,maxChildren:e?.max_menores??e?.MaxChild??Number.POSITIVE_INFINITY,maxBabies:e?.max_babies??e?.MaxBabies??Number.POSITIVE_INFINITY,maxChildAge:e?.max_childrens_age??e?.MaxChildrensAge??17,maxBabyAge:e?.max_babies_age??e?.MaxBabiesAge??2,datePickerStart:e?.date_picker_start??e?.DatePickerStart??0};return console.log("[booking-search-widget] computed limits from productInfo",{raw:{max_mayores:e?.max_mayores,MaxAdult:e?.MaxAdult,max_menores:e?.max_menores,MaxChild:e?.MaxChild,max_babies:e?.max_babies,MaxBabies:e?.MaxBabies,max_childrens_age:e?.max_childrens_age,MaxChildrensAge:e?.MaxChildrensAge,max_babies_age:e?.max_babies_age,MaxBabiesAge:e?.MaxBabiesAge},computed:a}),a},[n.productInfo]),D=e=>{const a=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${a}-${r}-${i}`},Z=u.useMemo(()=>{const e=new Date;e.setHours(0,0,0,0);const a=D(e);return console.log("[booking-search-widget] computed minStartDateIso",{datePickerStart:b.datePickerStart,iso:a}),a},[b.datePickerStart]),[w,ie]=u.useState(null),[ue,te]=u.useState(null),J=u.useMemo(()=>x==="checkin"?0:x==="checkout"?1:O?2:null,[x,O]);u.useEffect(()=>{J!==null&&(w===null?te("initial"):J>w?te("fromRight"):J<w?te("fromLeft"):te("initial"),ie(J))},[J,w]);const ne=e=>{const a=J===e,r=`${o.segment} ${a?o.segmentActive:""}`.trim();return a?`${r} ${o.fadeIn}`:r},se=e=>J!==e?"":ue==="fromRight"?o.bgFadeInFromRight:ue==="fromLeft"?o.bgFadeInFromLeft:o.bgFadeIn;u.useEffect(()=>{if(!g.current){g.current=!0;return}l(je(s))},[s.initialStart,s.initialEnd,s.initialGroups,s.locale,s.currency,s.pos,s.productId,s.redirect]),u.useEffect(()=>{const e=T.current;if(!e)return;const a=h=>{de.current=h,$(!h),h&&K.current&&(M("checkin"),y(!0),L(!1),I(!1),K.current=!1)},r=new IntersectionObserver(h=>{const f=h[0],p=f.isIntersecting&&f.intersectionRatio>0;a(p)},{root:null,threshold:[0,.01,.5,1]});r.observe(e);const i=()=>a(de.current);return window.addEventListener("scroll",i,{passive:!0}),()=>{r.disconnect(),window.removeEventListener("scroll",i)}},[]);const he=()=>{if(A)W(!0),K.current=!0,setTimeout(()=>{const e=T.current;e?(console.log("[booking-search-widget] scrolling to search bar",e),e.scrollIntoView({behavior:"smooth",block:"center"})):console.warn("[booking-search-widget] searchBarRef is null")},100);else{K.current=!0;const e=T.current;e?(console.log("[booking-search-widget] scrolling to search bar (desktop)",e),e.scrollIntoView({behavior:"smooth",block:"start"})):console.warn("[booking-search-widget] searchBarRef is null (desktop)")}},z=u.useCallback((e,a)=>{Bn(s.onEvent,e,a)},[s.onEvent]);u.useEffect(()=>{z("ready",{state:n}),console.log("[booking-search-widget] widget ready",{state:n})},[]),u.useEffect(()=>{if(typeof document>"u"||typeof window>"u")return;let e=!1;try{e=window.self!==window.top}catch{e=!0}if(!e||document.querySelector('meta[name="viewport"]'))return;const r=document.createElement("meta");return r.name="viewport",r.content="width=device-width, initial-scale=1",document.head.appendChild(r),()=>{r.parentNode&&r.parentNode.removeChild(r)}},[]),u.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia(`(max-width: ${le}px)`),a=()=>ke(r=>{const i=e.matches;return r===i?r:i});try{e.addEventListener("change",a)}catch{e.addListener(a)}return a(),()=>{try{e.removeEventListener("change",a)}catch{e.removeListener(a)}}},[]),u.useEffect(()=>{if(!R||typeof window>"u")return;const e=i=>{const h=typeof i=="number"?i:R.getBoundingClientRect().width;F(f=>{const p=h<=le;return f===p?f:p})};e();const a=typeof window.ResizeObserver=="function"?window.ResizeObserver:void 0;if(a){const i=new a(h=>{if(!h.length){e();return}const f=h[0].contentRect?.width;e(typeof f=="number"?f:void 0)});return i.observe(R),()=>i.disconnect()}const r=()=>e();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[R]);const _=u.useCallback(e=>{l(a=>{const r=typeof e=="function"?e(a):{...a,...e};return z("change",{state:r}),r})},[z]);u.useEffect(()=>{let e=!1;return(async()=>{try{const r=`https://api-1-eb.pxsol.io/product/info?id=${n.productId}&t=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ill5Mi1oSy1VYktQTFZSci1QSm5heSJ9.eyJnaXZlbl9uYW1lIjoiU2FudGlhZ28iLCJmYW1pbHlfbmFtZSI6IkNhYnJhbCIsIm5pY2tuYW1lIjoic2NhYnJhbCIsIm5hbWUiOiJTYW50aWFnbyBDYWJyYWwiLCJwaWN0dXJlIjoiaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUNnOG9jSkp2NkxsUFVxVl90NTRobjk1TGlqWTJXcTN3S21uaDNSYjZaZFY4Tzk4MW1XOGgySVc9czk2LWMiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0xMFQxODowNjoyMi40NTZaIiwiZW1haWwiOiJzY2FicmFsQHB4c29sLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpc3MiOiJodHRwczovL2F1dGgwLnB4c29sLmNvbS8iLCJhdWQiOiJtN2pDRFBhcVFCaGxNM2hRbFVZYnhhUURUVXhvSmtJVyIsInN1YiI6Imdvb2dsZS1vYXV0aDJ8MTA5Njc3NTgxMDcwMTk4NTU4NjI2IiwiaWF0IjoxNzYyNzk3OTgzLCJleHAiOjE3NjMzOTc5ODMsInNpZCI6IldlRVpNRURhVjFzellyWWh0cXdkbDJPaWtERUpRa190Iiwibm9uY2UiOiI3NWU1M2RkZGFhMzczNWYxMzkzODYxMTM4NGE1ZDZkNCJ9.VON_f1eYpEBwG_L3yXkz4IjeLJXdm6XHS5d753Zm5bBcvQc3zPuCyqG_4vHP5KOHK17VeWslkap1TR_yLGJNUB9XPoyTH7KjQrArPtW9P2p-cIO3uADYdv1sGsLFYYjb_KkVcSOUFD8XXbQ-3mgMOXLKqJbUiLT1M12X9v-mZv-OWwkrg0gLTW9hZVaqs3OU0tnwUsfEH3nHge5EdUj5yAGVDi31aDFke-afR2hBlFEZJ4JHuqjtWXD_vlW-C18psYoWSRojlkkP31W5A6M8TILZZm_ck1QoPf8aN6aXF_g6btkhLpuhw7PSuVmImiw4IFlxdcAnv0dYt962Kqf8HA`,i={"Content-Type":"application/json"};console.log("[booking-search-widget][product-info] REQUEST - Iniciando solicitud",{url:r,productId:n.productId,token:`${En.substring(0,20)}...`,method:"GET"});const h=await fetch(r,{headers:i});console.log("[booking-search-widget][product-info] RESPONSE STATUS",{status:h.status,statusText:h.statusText,ok:h.ok,url:h.url});try{const k={};h.headers.forEach((E,Y)=>k[Y]=E),console.log("[booking-search-widget][product-info] RESPONSE HEADERS",k)}catch(k){console.warn("[booking-search-widget][product-info] Error al leer headers",k)}if(!h.ok){const k=await h.text().catch(()=>"No se pudo leer el cuerpo del error");throw console.error("[booking-search-widget][product-info] ERROR RESPONSE",{status:h.status,statusText:h.statusText,body:k}),new Error(`Product info failed ${h.status}: ${k}`)}const f=await h.text();console.log("[booking-search-widget][product-info] RESPONSE RAW BODY",{length:f.length,preview:f.substring(0,500)+(f.length>500?"...":"")});const p=JSON.parse(f);console.log("[booking-search-widget][product-info] ========== RESPUESTA COMPLETA DE /product/info =========="),console.log("[booking-search-widget][product-info] RESPONSE COMPLETA (JSON completo)",JSON.stringify(p,null,2)),console.log("[booking-search-widget][product-info] RESPONSE PARSED JSON - Estructura completa",{topLevelKeys:Object.keys(p),hasInfo:"info"in p,response:p.response,message:p.message,code:p.code}),console.log("[booking-search-widget][product-info] VERIFICANDO GroupPluralText",{"parsedResponse.GroupPluralText":p.GroupPluralText,"parsedResponse.info?.GroupPluralText":p.info?.GroupPluralText,"has GroupPluralText":"GroupPluralText"in p,"has info.GroupPluralText":p.info&&"GroupPluralText"in p.info});const c=p.info||p;if(console.log("[booking-search-widget][product-info] ========== DATOS EXTRAÍDOS DEL PRODUCTO =========="),console.log("[booking-search-widget][product-info] DATA (productInfo) - Objeto completo extraído",JSON.stringify(c,null,2)),console.log("[booking-search-widget][product-info] VERIFICANDO GroupPluralText EN DATA",{"data.GroupPluralText":c?.GroupPluralText,"data has GroupPluralText":c&&"GroupPluralText"in c,"typeof data.GroupPluralText":typeof c?.GroupPluralText}),console.log("[booking-search-widget][product-info] RESPONSE - Propiedades de edad de menores",{"max_childrens_age (snake_case)":c?.max_childrens_age,"MaxChildrensAge (PascalCase)":c?.MaxChildrensAge,MaxChild:c?.MaxChild,max_mayores:c?.max_mayores,max_menores:c?.max_menores,MaxBabies:c?.MaxBabies,max_babies:c?.max_babies,MaxBabiesAge:c?.MaxBabiesAge,max_babies_age:c?.max_babies_age,GroupPluralText:c?.GroupPluralText,"todas las keys relacionadas con child/children/age/baby":Object.keys(c||{}).filter(k=>k.toLowerCase().includes("child")||k.toLowerCase().includes("children")||k.toLowerCase().includes("age")||k.toLowerCase().includes("baby")||k.toLowerCase().includes("menor")||k.toLowerCase().includes("mayor")),"todas las keys relacionadas con room/group":Object.keys(c||{}).filter(k=>k.toLowerCase().includes("room")||k.toLowerCase().includes("group")),"todas las keys del objeto completo":Object.keys(c||{})}),e)return;_(k=>{const E={...k,productInfo:c};try{const Y=new Date;Y.setHours(0,0,0,0);const V=(typeof c?.date_picker_start=="number"?c.date_picker_start:c?.DatePickerStart)??0,q=D(Y);if(E.startDate<q&&(E.startDate=q,E.endDate<=E.startDate)){const oe=new Date(q);oe.setDate(oe.getDate()+1),E.endDate=D(oe)}const U=c?.max_childrens_age??c?.MaxChildrensAge??17;console.log("[booking-search-widget][product-info] APPLIED - Límites aplicados al estado",{rawData:{max_mayores:c?.max_mayores,MaxAdult:c?.MaxAdult,max_menores:c?.max_menores,MaxChild:c?.MaxChild,max_babies:c?.max_babies,MaxBabies:c?.MaxBabies,max_childrens_age:c?.max_childrens_age,MaxChildrensAge:c?.MaxChildrensAge,max_babies_age:c?.max_babies_age,MaxBabiesAge:c?.MaxBabiesAge,date_picker_start:c?.date_picker_start,DatePickerStart:c?.DatePickerStart,GroupPluralText:c?.GroupPluralText},computedLimits:{maxAdults:c?.max_mayores??c?.MaxAdult??Number.POSITIVE_INFINITY,maxChildren:c?.max_menores??c?.MaxChild??Number.POSITIVE_INFINITY,maxBabies:c?.max_babies??c?.MaxBabies??Number.POSITIVE_INFINITY,maxChildAge:U,maxBabyAge:c?.max_babies_age??c?.MaxBabiesAge??2,datePickerStart:V},dates:{startDate:E.startDate,endDate:E.endDate,minStartDateIso:Z}})}catch(Y){console.warn("[booking-search-widget] product info apply error",Y)}return E})}catch(r){console.error("[booking-search-widget] product info error",r)}})(),()=>{e=!0}},[n.productId,_]),u.useEffect(()=>{let e=!1;return(async()=>{try{const r=n.pos||"GLOBAL",i=`https://api-2-eb.pxsol.io/api/pos/info/${encodeURIComponent(r)}`;console.log("[booking-search-widget] fetching pos info",{url:i,pos:r});const h=await fetch(i,{headers:{"Content-Type":"application/json"}});if(!h.ok)throw new Error(`POS info failed ${h.status}`);const f=await h.json();if(e)return;_(p=>({...p,posInfo:f})),console.log("[booking-search-widget] pos info json",f)}catch(r){co