bukazu-portal-react 4.2.0 → 4.3.0

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.
@@ -1,4 +1,4 @@
1
- import e,{Component as t,createContext as n,useCallback as r,useContext as o,useEffect as i,useMemo as s,useReducer as a,useRef as c,useState as u}from"react";import{Fragment as l,jsx as d,jsxs as h}from"react/jsx-runtime";var p=()=>/* @__PURE__ */h("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30",enableBackground:"new 0 0 50 50",xmlSpace:"preserve",children:[
1
+ import e,{Component as t,createContext as n,useCallback as r,useContext as o,useEffect as s,useMemo as i,useReducer as a,useRef as c,useState as u}from"react";import{Fragment as l,jsx as d,jsxs as h}from"react/jsx-runtime";var p=()=>/* @__PURE__ */h("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30",enableBackground:"new 0 0 50 50",xmlSpace:"preserve",children:[
2
2
  /* @__PURE__ */h("rect",{x:"0",y:"10",width:"4",height:"10",fill:"#333",opacity:"0.2",children:[
3
3
  /* @__PURE__ */d("animate",{attributeName:"opacity",attributeType:"XML",values:"0.2; 1; .2",begin:"0s",dur:"0.6s",repeatCount:"indefinite"}),
4
4
  /* @__PURE__ */d("animate",{attributeName:"height",attributeType:"XML",values:"10; 20; 10",begin:"0s",dur:"0.6s",repeatCount:"indefinite"}),
@@ -10,75 +10,107 @@ import e,{Component as t,createContext as n,useCallback as r,useContext as o,use
10
10
  /* @__PURE__ */h("rect",{x:"16",y:"10",width:"4",height:"10",fill:"#333",opacity:"0.2",children:[
11
11
  /* @__PURE__ */d("animate",{attributeName:"opacity",attributeType:"XML",values:"0.2; 1; .2",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"}),
12
12
  /* @__PURE__ */d("animate",{attributeName:"height",attributeType:"XML",values:"10; 20; 10",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"}),
13
- /* @__PURE__ */d("animate",{attributeName:"y",attributeType:"XML",values:"10; 5; 10",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"})]})]});function f({filters:e,field:t,options:n,onChange:r,value:o,labelledBy:i}){const s=e.countries,a=["cities","regions"].includes(t.id);/* @__PURE__ */
14
- return d("div",{className:"bu-chips",role:"group","aria-labelledby":i,"aria-label":i?void 0:t.label??t.id,children:n.map(e=>{const n=String(e.id),i=!(!a||!s)&&!s.includes(e.country_id);/* @__PURE__ */
15
- return d("button",{type:"button",className:"bu-chip "+(i?"bu-disabled":""),"data-value":n,"aria-pressed":o===n,disabled:i,onClick:()=>(e=>{r(t.id,o===e?null:e)})(n),children:e.name},n)})})}function m({options:e,field:t,filters:n,value:r,onChange:o}){const i=e=>{o(t.id,e.currentTarget.value)},s=n.countries,a=Array.isArray(n.regions)?n.regions:[n.regions].filter(e=>String(e).trim());if(e&&["countries","cities","regions"].includes(t.id)){const n=e;/* @__PURE__ */
16
- return h("select",{id:t.id,name:t.id,onBlur:i,onChange:i,value:r,children:[/* @__PURE__ */d("option",{value:""}),n.map(e=>{let n=!1;return["cities","regions"].includes(t.id)&&(s&&!s.includes(e.country_id)&&(n=!0),"cities"===t.id&&(!1!=!a.length||a.includes(e.region)||(n=!0))),/* @__PURE__ */d("option",{value:e.id,id:e.region,disabled:n,hidden:n,children:e.name},e.id)})]})}/* @__PURE__ */return h("select",{id:t.id,name:t.id,onBlur:i,onChange:i,value:r,children:[/* @__PURE__ */d("option",{value:""}),e.map(e=>"object"==typeof e?/* @__PURE__ */d("option",{value:e.id,children:e.name},e.id):/* @__PURE__ */d("option",{value:e,children:e},e))]})}function g({options:e,filters:t,onChange:n,field:r,labelledBy:o}){const i=t.countries,s=e=>{n(r.id,e.currentTarget.value)};/* @__PURE__ */
17
- return d("ul",{className:"radioList",role:"radiogroup","aria-labelledby":o,"aria-label":o?void 0:r.label??r.id,children:e.map(e=>{const t="string"==typeof e?e:e.id,n="string"==typeof e?e:e.name,o="string"==typeof e?void 0:e.country_id,a=!(!i||!o)&&!i.includes(o);/* @__PURE__ */
18
- return h("li",{className:"bu-list-item "+(a?"bu-disabled":""),children:[/* @__PURE__ */d("input",{name:r.id,type:"radio",id:t,value:t,disabled:a,onBlur:s,onChange:s}),/* @__PURE__ */d("label",{htmlFor:t,children:n})]},t)})})}function _({value:e,onChange:t,field:n}){const r=e??"",[o,s]=u(r);function a(){o!==r&&t(n.id,o)}return i(()=>{s(r)},[r]),/* @__PURE__ */d("input",{type:"date",id:n.id,name:n.id,value:o,onChange:e=>s(e.target.value),onBlur:a,onKeyDown:e=>{"Enter"===e.key&&a()}})}function y({PortalSite:e,field:t,value:n,onChange:r}){/* @__PURE__ */
19
- return d("input",{id:t.id,name:t.id,value:n,type:"number",min:"0",max:"persons_min"===t.id?e.max_persons:e[t.id],onBlur:e=>{r(t.id,e.currentTarget.value)}})}var b=["persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max"],v=["select","list","radio","number","date"],w=["select","number","date","text"];function x(e){return v.includes(e.type)?e.type:b.includes(e.id)?"select":"text"}function k(e){return w.includes(x(e))}var S=["countries","cities","regions"];function C(e,t){if(e.options)return e.options;if(void 0!==e.max)return"weekprice_max"===e.id?function(e){let t=Math.ceil(e/100);return Array.from({length:t+1},(e,t)=>100*t)}(e.max):(n=e.max,Array.from({length:n+1},(e,t)=>t));var n;if(S.includes(e.id)){const n=t[e.id];return Array.isArray(n)?n:[]}return[]}function E({PortalSite:e,field:t,filters:n,value:r,onFilterChange:o,options:i,labelId:s}){const a=i??C(t,e),c=x(t);return"select"===c?/* @__PURE__ */d(m,{options:a,field:t,filters:n,value:r,onChange:o}):"list"===c?/* @__PURE__ */d(f,{options:a,field:t,filters:n,value:r,onChange:o,labelledBy:s}):"radio"===c?/* @__PURE__ */d(g,{options:a,field:t,filters:n,onChange:o,labelledBy:s}):"number"===c?/* @__PURE__ */d(y,{PortalSite:e,field:t,value:r,onChange:o}):"date"===c?/* @__PURE__ */d(_,{field:t,value:r,onChange:o}):/* @__PURE__ */d("input",{id:t.id,name:t.id,type:"text",defaultValue:r,onBlur:e=>{o(t.id,e.target.value)}})}var T={next:"Next",previous:"Previous",view_details:"View details",price:"Price",calculate:"Next",currency:"Currency",book:"Book",booked:"Booked",booking:"Booking",last_minute_discount:"Last minute discount",discount:"Discount",option:"Option",choose_for_option:"Make a short reservation for this period ",included_in_price:"including",rent_price:"Rental price",extra_costs_included:"Extra costs included",optional_costs:"Extra options",price_after_discount:"Rental price incl. discount",booking_from_til:"Booking dates",total:"Total",stay_details:"Travel group",babies:"Babies",babies_from:"(up to the age of {babies})",adults:"Adults",adults_from:"(from the age of {age})","camper_spot.arrival_date":"Arrival date","camper_spot.departure_date":"Departure date","camper_spot.arrival":"Arrival","camper_spot.departure":"Departure","camping_place.arrival_date":"Arrival date","camping_place.departure_date":"Departure date","camping_place.arrival":"Arrival","camping_place.departure":"Departure","bnb.arrival_date":"Arrival date","bnb.departure_date":"Departure date","bnb.arrival":"Arrival","bnb.departure":"Departure","hotelroom.arrival_date":"Arrival date","hotelroom.departure_date":"Departure date","hotelroom.arrival":"Arrival","hotelroom.departure":"Departure",children:"Children",children_from:"(from {from} to {til} years inclusive)","house.arrival_date":"Arrival date","house.departure_date":"Departure date","house.arrival":"Arrival","house.departure":"Departure","group_accommodation.arrival_date":"Arrival date","group_accommodation.departure_date":"Departure date","group_accommodation.arrival":"Arrival","group_accommodation.departure":"Departure","tent.arrival_date":"Arrival date","tent.departure_date":"Departure date","tent.arrival":"Arrival","tent.departure":"Departure",extra_costs_bookable:"Extra options",costs_on_site:"Additional costs on the spot:",insurances:"Insurances",at_least_1_adult:"Choose at least 1 adult.",max_persons_reached:"Too many people have been selected.",personal_details:"Your information",required:"This field is required.",cancel_insurance_all_risk:"All Risk",cancel_insurance_normal:"Standard",none:"None",cancel_insurance:"Cancellation insurance",insurance_costs:"Insurance Costs",choose:"Choose",yes:"Yes",booking_details:"Booking details",based_on_one_person:"Based on {persons} persons",return_to_calendar:"Back to calendar",close:"Close",cancel_insurance_normal_long:"Short-term Cancellation Insurance ",cancel_insurance_normal_desc:"If you booked a wonderful holiday, cancellation insurance should not be missing! Your booked holiday cannot continue, or you have to go home unexpectedly halfway through the holiday due to, for example, a severe illness. The cancellation insurance of RecreatieVerzekeringen is ideal because it applies before departure and during your holiday.",cancel_insurance_more_insured:"More are insured than you think.",cancel_insurance_more_insured_desc:"Did you know that you can rely on cancellation insurance during pregnancy, a new job, or divorce? Many people expect cancellation insurance to be valid only in the event of illness or death.",cancel_insurance_important:"Important",cancel_insurance_important_message:"For optimal cancellation insurance coverage, you must take it out within seven days after booking the holiday.",cancel_insurance_for_whom:"For whom?",cancel_insurance_for_whom_explain:"This insurance is for a maximum of 4 families or 9 travel companions (no family members).",cancel_insurance_questions:"Frequently Asked Questions",cancel_insurance_questions_explain_1:"Click ",cancel_insurance_questions_explain_link:"here",cancel_insurance_questions_explain_2:" to find the Frequently Asked Questions.",show_terms:"Show conditions",terms:"Terms",remark:"Remark","9persons_9addresses":"The Insurance will pay for up to 9 persons, who live at 9 different addresses,",or:"or","9persons_4addresses":"The insurance pays out for an unlimited number of people who live at a maximum of 4 different addresses.",poliscosts:"Policy fee",poliscosts_are:"The cost for an insurance policy is a one-time charge of € 6,95. No matter if you have one or two insuran",youwillrecieve:"You will receive the insurance terms separate from you booking confirmation per email. The insurance starts as soon as the (first) payment has been made.",thank_you_for_your_request:"Thank you very much for your request.",we_sent_confirmation_check_email:"A copy of your request has been sent to your e-mail address. If you have not received any mail from us, it may be that it is in your spam box.",something_went_wrong_please_try_again:"Oops, something went wrong, please try again later.",no_prices_available_for_period:"No prices are available for the selected period.",persons:"persons",bedrooms:"bedrooms",minimum_week_price:"min. weekly price",no_results:"No results",agree_with:"Clicking 'Book' creates a payment obligation when my booking is accepted. I agree to the ",option_is_free:"An option is free of charge and without obligation.",discount_reason:"Reason discount.",results:"results",bathrooms:"bathrooms",you_need_to_give_reason:"You must indicate a valid discount reason","camper.arrival_date":"Start date","camper.departure_date":"End date","camper.arrival":"Start date","camper.departure":"End date","boat.arrival_date":"Start date","boat.departure_date":"End date","boat.arrival":"Start date","boat.departure":"End date","caravan.arrival_date":"Arrival date","caravan.departure_date":"Departure date","caravan.arrival":"Arrival","caravan.departure":"Departure",filters:"Filters",comply_insurance_card:"I agree that the cancellation insurance insurance card will be digitally issued to me. I receive this card with my booking confirmation.","house.you_picked_arrival_date":"Your arrival date is","house.pick_your_departure_in_the_calendar":"Select a departure date","house.you_picked_departure_date":"Your departure date is","house.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","group_accommodation.you_picked_arrival_date":"Your arrival date is","group_accommodation.pick_your_departure_in_the_calendar":"Select a departure date","group_accommodation.you_picked_departure_date":"Your departure date is","group_accommodation.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","tent.you_picked_arrival_date":"Your arrival date is","tent.pick_your_departure_in_the_calendar":"Select a departure date","tent.you_picked_departure_date":"Your departure date is","tent.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camper.you_picked_arrival_date":"Your pickup date is","camper.pick_your_departure_in_the_calendar":"Select a return date","camper.you_picked_departure_date":"Your return date is","camper.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","boat.you_picked_arrival_date":"Your pickup date is","boat.pick_your_departure_in_the_calendar":"Select a return date","boat.you_picked_departure_date":"Your return date is","boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","bnb.you_picked_arrival_date":"Your arrival date is","bnb.pick_your_departure_in_the_calendar":"Select a departure date","bnb.you_picked_departure_date":"Your departure date is","bnb.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","caravan.you_picked_arrival_date":"Your pickup date is","caravan.pick_your_departure_in_the_calendar":"Select a return date","caravan.you_picked_departure_date":"Your return date is","caravan.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","camper_spot.you_picked_arrival_date":"Your arrival date is","camper_spot.pick_your_departure_in_the_calendar":"Select a departure date","camper_spot.you_picked_departure_date":"Your departure date is","camper_spot.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camping_place.you_picked_arrival_date":"Your arrival date is","camping_place.pick_your_departure_in_the_calendar":"Select a departure date","camping_place.you_picked_departure_date":"Your departure date is","camping_place.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","hotelroom.you_picked_arrival_date":"Your arrival date is","hotelroom.pick_your_departure_in_the_calendar":"Select a departure date","hotelroom.you_picked_departure_date":"Your departure date is","hotelroom.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","house_boat.you_picked_arrival_date":"Your pickup date is","house_boat.pick_your_departure_in_the_calendar":"Select a return date","house_boat.you_picked_departure_date":"Your return date is","house_boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date",no:"No",no_house_found:"No object found for this combination of PortalCode and ObjectCode",insurance_company_needs_date_of_birth:"A date of birth is required for taking out insurance","extra_fields.date_of_birth":"Date of birth",no_discount_code_found:"No discount found with entered code",discount_code:"Discount code",minimum_nights:"At least {minimum} nights",can_only_take_insurance_in_de_be_nl:"You can only take out insurance if you live in the Netherlands, Germany or Belgium.",price_from:"Price from",reviews:"Reviews",load_more_reviews:"Load more reviews",review_response_label:"Response from host",reviews_note_link:"BUKAZU Booking System maintains independent reviews. These reviews are collected after guests stay in the accommodation. There is verification of the combination of booking number and email address.",active_filters:"Active filters ({count})",clear_all:"Clear all",remove_filter:"Remove {filter}",view_mode:"View",grid_view:"Grid view",list_view:"List view",show_results:"Show results"},N=["en","nl","de","fr","es","it"];function R(e){return function(e){return N.includes(e)}(e)?e:"en"}new TextEncoder;function A(e,t,n){let r=t;const o=r+n,i=[];let s="";for(;r<o;){const t=e[r++];if(128&t)if(192==(224&t)){const n=63&e[r++];i.push((31&t)<<6|n)}else if(224==(240&t)){const n=63&e[r++],o=63&e[r++];i.push((31&t)<<12|n<<6|o)}else if(240==(248&t)){let n=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];n>65535&&(n-=65536,i.push(n>>>10&1023|55296),n=56320|1023&n),i.push(n)}else i.push(t);else i.push(t);i.length>=4096&&(s+=String.fromCharCode(...i),i.length=0)}return i.length>0&&(s+=String.fromCharCode(...i)),s}var $=new TextDecoder;function P(e,t,n){return n>200?function(e,t,n){const r=e.subarray(t,t+n);return $.decode(r)}(e,t,n):A(e,t,n)}var I=class{type;data;constructor(e,t){this.type=e,this.data=t}},D=class e extends Error{constructor(t){super(t);const n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};function j(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}function L({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){const t=/* @__PURE__ */new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{const n=e/4294967296,r=4294967295&e,o=/* @__PURE__ */new Uint8Array(8),i=new DataView(o.buffer);return i.setUint32(0,t<<2|3&n),i.setUint32(4,r),o}}{const n=/* @__PURE__ */new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),function(e,t,n){const r=Math.floor(n/4294967296),o=n;e.setUint32(t,r),e.setUint32(t+4,o)}(r,4,e),n}}var O={type:-1,encode:function(e){return e instanceof Date?L(function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),o=Math.floor(r/1e9);return{sec:n+o,nsec:r-1e9*o}}(e)):null},decode:function(e){const t=function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:j(t,4),nsec:t.getUint32(0)};default:throw new D(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);/* @__PURE__ */
20
- return new Date(1e3*t.sec+t.nsec/1e6)}},U=class e{static defaultCodec=new e;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(O)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{const r=-1-e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const r=this.builtInEncoders[n];if(null!=r){const o=r(e,t);if(null!=o){return new I(-1-n,o)}}}for(let n=0;n<this.encoders.length;n++){const r=this.encoders[n];if(null!=r){const o=r(e,t);if(null!=o)return new I(n,o)}}return e instanceof I?e:null}decode(e,t,n){const r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,n):new I(t,e)}};function M(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}(e)?new Uint8Array(e):Uint8Array.from(e)}function q(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}var B="array",F="map_key",z="map_value",H=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new D("The type of key must be string or number but "+typeof e)},Y=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=B,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=F,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===B){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===F||e.type===z){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},W=/* @__PURE__ */new DataView(/* @__PURE__ */new ArrayBuffer(0)),J=new Uint8Array(W.buffer);try{W.getInt8(0)}catch(Rd){if(!(Rd instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var V=/* @__PURE__ */new RangeError("Insufficient data"),K=new class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=16,t=16){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){const r=this.caches[n-1];e:for(const o of r){const r=o.bytes;for(let o=0;o<n;o++)if(r[o]!==e[t+o])continue e;return o.str}return null}store(e,t){const n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){const r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;const o=A(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,o),o}},G=class e{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=W;bytes=J;headByte=-1;stack=new Y;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??U.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=void 0!==e?.keyDecoder?e.keyDecoder:K,this.mapKeyConverter=e?.mapKeyConverter??H}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){const t=M(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){const t=this.bytes.subarray(this.pos),n=M(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:n}=this;/* @__PURE__ */
21
- return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered)yield*this.clone().decodeMulti(e);else try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t,n=!1;for await(const s of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(s);try{t=this.doDecodeSync(),n=!0}catch(Rd){if(!(Rd instanceof RangeError))throw Rd}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}const{headByte:r,pos:o,totalPos:i}=this;throw new RangeError(`Insufficient data in parsing ${q(r)} at ${i} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered)yield*this.clone().decodeMultiAsync(e,t);else try{this.entered=!0;let n=t,r=-1;for await(const o of e){if(t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),n&&(r=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),0!==--r;);}catch(Rd){if(!(Rd instanceof RangeError))throw Rd}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const n=e-128;if(0!==n){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){const n=e-144;if(0!==n){this.pushArrayState(n),this.complete();continue e}t=[]}else{const n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeString(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeString(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeString(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new D(`Unrecognized type byte: ${q(e)}`);{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const n=this.stack;for(;n.length>0;){const e=n.top();if(e.type===B){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;t=e.array,n.release(e)}else{if(e.type===F){if("__proto__"===t)throw new D("The key __proto__ is not allowed");e.key=this.mapKeyConverter(t),e.type=z;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=F;continue e}t=e.map,n.release(e)}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new D(`Unrecognized array type byte: ${q(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new D(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new D(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new D(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw V;const n=this.pos+t;let r;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):P(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===F}decodeBinary(e,t){if(e>this.maxBinLength)throw new D(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw V;const n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new D(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=(t=this.view,n=this.pos,4294967296*t.getUint32(n)+t.getUint32(n+4));var t,n;return this.pos+=8,e}readI64(){const e=j(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};async function X(e,t){let n;try{n=await fetch(e)}catch{throw new Error(t)}if(!n.ok)throw new Error(t);const r=new Uint8Array(await n.arrayBuffer());return o=r,new G(i).decode(o);var o,i}var Q=/* @__PURE__ */new Map([["en",T]]),Z=/* @__PURE__ */new Map,ee={en:async()=>(await(import("./en-OC6xPyPa.js"))).default,nl:async()=>(await(import("./nl-CHsVPRQk.js"))).default,de:async()=>(await(import("./de-DFLve7VR.js"))).default,fr:async()=>(await(import("./fr-D7NJkc7d.js"))).default,es:async()=>(await(import("./es-CSWz839L.js"))).default,it:async()=>(await(import("./it-BRZbP3bC.js"))).default};async function te(e){const t=R(e),n=Q.get(t);if(n)return n;const r=Z.get(t);if(r)return r;const o=async function(e){return X(await ee[e](),`Failed to load translations for locale "${e}"`)}(t).then(e=>(Q.set(t,e),e)).catch(()=>Q.get("en")??{}).finally(()=>{Z.delete(t)});return Z.set(t,o),o}function ne(e,t){const n=R("undefined"!=typeof window&&window.__localeId__||"en"),r=Q.get(n)??Q.get("en")??{};Q.has(n)||te(n);let o=r[e]||e;return t&&Object.entries(t).forEach(([e,t])=>{o=o.replace(new RegExp(`\\{${e}\\}`,"g"),String(t))}),o}function re(e,t){const n="undefined"!=typeof window&&window.__localeId__||"en";return new Intl.NumberFormat(n,t).format(e)}te("en");var oe=({size:e=14})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M5 5l10 10M15 5L5 15"})});function ie({items:e,onRemove:t,onClear:n}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"bu-active-filters",children:[/* @__PURE__ */h("div",{className:"bu-active-filters-header",children:[/* @__PURE__ */d("span",{children:ne("active_filters",{count:e.length})}),/* @__PURE__ */d("button",{type:"button",className:"bu-link-button",onClick:n,children:ne("clear_all")})]}),/* @__PURE__ */d("div",{className:"bu-pills",children:e.map(e=>/* @__PURE__ */h("button",{type:"button",className:"bu-pill","data-filter-key":e.key,"aria-label":ne("remove_filter",{filter:e.text}),onClick:()=>t(e.key),children:[/* @__PURE__ */d("span",{children:e.text}),/* @__PURE__ */d("span",{className:"bu-pill-remove",children:/* @__PURE__ */d(oe,{})})]},e.key))})]})}var se=({size:e=20})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
13
+ /* @__PURE__ */d("animate",{attributeName:"y",attributeType:"XML",values:"10; 5; 10",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"})]})]});function f({filters:e,field:t,options:n,onChange:r,value:o,labelledBy:s}){const i=e.countries,a=["cities","regions"].includes(t.id);/* @__PURE__ */
14
+ return d("div",{className:"bu-chips",role:"group","aria-labelledby":s,"aria-label":s?void 0:t.label??t.id,children:n.map(e=>{const n=String(e.id),s=!(!a||!i)&&!i.includes(e.country_id);/* @__PURE__ */
15
+ return d("button",{type:"button",className:"bu-chip "+(s?"bu-disabled":""),"data-value":n,"aria-pressed":o===n,disabled:s,onClick:()=>(e=>{r(t.id,o===e?null:e)})(n),children:e.name},n)})})}function m({options:e,field:t,filters:n,value:r,onChange:o}){const s=e=>{o(t.id,e.currentTarget.value)},i=n.countries,a=Array.isArray(n.regions)?n.regions:[n.regions].filter(e=>String(e).trim());if(e&&["countries","cities","regions"].includes(t.id)){const n=e;/* @__PURE__ */
16
+ return h("select",{id:t.id,name:t.id,onBlur:s,onChange:s,value:r,children:[/* @__PURE__ */d("option",{value:""}),n.map(e=>{let n=!1;return["cities","regions"].includes(t.id)&&(i&&!i.includes(e.country_id)&&(n=!0),"cities"===t.id&&(!1!=!a.length||a.includes(e.region)||(n=!0))),/* @__PURE__ */d("option",{value:e.id,id:e.region,disabled:n,hidden:n,children:e.name},e.id)})]})}/* @__PURE__ */return h("select",{id:t.id,name:t.id,onBlur:s,onChange:s,value:r,children:[/* @__PURE__ */d("option",{value:""}),e.map(e=>"object"==typeof e?/* @__PURE__ */d("option",{value:e.id,children:e.name},e.id):/* @__PURE__ */d("option",{value:e,children:e},e))]})}function g({options:e,filters:t,onChange:n,field:r,labelledBy:o}){const s=t.countries,i=e=>{n(r.id,e.currentTarget.value)};/* @__PURE__ */
17
+ return d("ul",{className:"radioList",role:"radiogroup","aria-labelledby":o,"aria-label":o?void 0:r.label??r.id,children:e.map(e=>{const t="string"==typeof e?e:e.id,n="string"==typeof e?e:e.name,o="string"==typeof e?void 0:e.country_id,a=!(!s||!o)&&!s.includes(o);/* @__PURE__ */
18
+ return h("li",{className:"bu-list-item "+(a?"bu-disabled":""),children:[/* @__PURE__ */d("input",{name:r.id,type:"radio",id:t,value:t,disabled:a,onBlur:i,onChange:i}),/* @__PURE__ */d("label",{htmlFor:t,children:n})]},t)})})}function _({value:e,onChange:t,field:n}){const r=e??"",[o,i]=u(r);function a(){o!==r&&t(n.id,o)}return s(()=>{i(r)},[r]),/* @__PURE__ */d("input",{type:"date",id:n.id,name:n.id,value:o,onChange:e=>i(e.target.value),onBlur:a,onKeyDown:e=>{"Enter"===e.key&&a()}})}function y({PortalSite:e,field:t,value:n,onChange:r}){/* @__PURE__ */
19
+ return d("input",{id:t.id,name:t.id,value:n,type:"number",min:"0",max:"persons_min"===t.id?e.max_persons:e[t.id],onBlur:e=>{r(t.id,e.currentTarget.value)}})}var b=["persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max"],v=["select","list","radio","number","date"],w=["select","number","date","text"];function k(e){return v.includes(e.type)?e.type:b.includes(e.id)?"select":"text"}function x(e){return w.includes(k(e))}var S=["countries","cities","regions"];function C(e,t){if(e.options)return e.options;if(void 0!==e.max)return"weekprice_max"===e.id?function(e){let t=Math.ceil(e/100);return Array.from({length:t+1},(e,t)=>100*t)}(e.max):(n=e.max,Array.from({length:n+1},(e,t)=>t));var n;if(S.includes(e.id)){const n=t[e.id];return Array.isArray(n)?n:[]}return[]}function E({PortalSite:e,field:t,filters:n,value:r,onFilterChange:o,options:s,labelId:i}){const a=s??C(t,e),c=k(t);return"select"===c?/* @__PURE__ */d(m,{options:a,field:t,filters:n,value:r,onChange:o}):"list"===c?/* @__PURE__ */d(f,{options:a,field:t,filters:n,value:r,onChange:o,labelledBy:i}):"radio"===c?/* @__PURE__ */d(g,{options:a,field:t,filters:n,onChange:o,labelledBy:i}):"number"===c?/* @__PURE__ */d(y,{PortalSite:e,field:t,value:r,onChange:o}):"date"===c?/* @__PURE__ */d(_,{field:t,value:r,onChange:o}):/* @__PURE__ */d("input",{id:t.id,name:t.id,type:"text",defaultValue:r,onBlur:e=>{o(t.id,e.target.value)}})}var N={next:"Next",previous:"Previous",view_details:"View details",price:"Price",calculate:"Next",currency:"Currency",book:"Book",booked:"Booked",booking:"Booking",last_minute_discount:"Last minute discount",discount:"Discount",option:"Option",choose_for_option:"Make a short reservation for this period ",included_in_price:"including",rent_price:"Rental price",extra_costs_included:"Extra costs included",optional_costs:"Extra options",price_after_discount:"Rental price incl. discount",booking_from_til:"Booking dates",total:"Total",stay_details:"Travel group",babies:"Babies",babies_from:"(up to the age of {babies})",adults:"Adults",adults_from:"(from the age of {age})","camper_spot.arrival_date":"Arrival date","camper_spot.departure_date":"Departure date","camper_spot.arrival":"Arrival","camper_spot.departure":"Departure","camping_place.arrival_date":"Arrival date","camping_place.departure_date":"Departure date","camping_place.arrival":"Arrival","camping_place.departure":"Departure","bnb.arrival_date":"Arrival date","bnb.departure_date":"Departure date","bnb.arrival":"Arrival","bnb.departure":"Departure","hotelroom.arrival_date":"Arrival date","hotelroom.departure_date":"Departure date","hotelroom.arrival":"Arrival","hotelroom.departure":"Departure",children:"Children",children_from:"(from {from} to {til} years inclusive)","house.arrival_date":"Arrival date","house.departure_date":"Departure date","house.arrival":"Arrival","house.departure":"Departure","group_accommodation.arrival_date":"Arrival date","group_accommodation.departure_date":"Departure date","group_accommodation.arrival":"Arrival","group_accommodation.departure":"Departure","tent.arrival_date":"Arrival date","tent.departure_date":"Departure date","tent.arrival":"Arrival","tent.departure":"Departure",extra_costs_bookable:"Extra options",costs_on_site:"Additional costs on the spot:",insurances:"Insurances",at_least_1_adult:"Choose at least 1 adult.",max_persons_reached:"Too many people have been selected.",personal_details:"Your information",required:"This field is required.",cancel_insurance_all_risk:"All Risk",cancel_insurance_normal:"Standard",none:"None",cancel_insurance:"Cancellation insurance",insurance_costs:"Insurance Costs",choose:"Choose",yes:"Yes",booking_details:"Booking details",based_on_one_person:"Based on {persons} persons",return_to_calendar:"Back to calendar",close:"Close",cancel_insurance_normal_long:"Short-term Cancellation Insurance ",cancel_insurance_normal_desc:"If you booked a wonderful holiday, cancellation insurance should not be missing! Your booked holiday cannot continue, or you have to go home unexpectedly halfway through the holiday due to, for example, a severe illness. The cancellation insurance of RecreatieVerzekeringen is ideal because it applies before departure and during your holiday.",cancel_insurance_more_insured:"More are insured than you think.",cancel_insurance_more_insured_desc:"Did you know that you can rely on cancellation insurance during pregnancy, a new job, or divorce? Many people expect cancellation insurance to be valid only in the event of illness or death.",cancel_insurance_important:"Important",cancel_insurance_important_message:"For optimal cancellation insurance coverage, you must take it out within seven days after booking the holiday.",cancel_insurance_for_whom:"For whom?",cancel_insurance_for_whom_explain:"This insurance is for a maximum of 4 families or 9 travel companions (no family members).",cancel_insurance_questions:"Frequently Asked Questions",cancel_insurance_questions_explain_1:"Click ",cancel_insurance_questions_explain_link:"here",cancel_insurance_questions_explain_2:" to find the Frequently Asked Questions.",show_terms:"Show conditions",terms:"Terms",remark:"Remark","9persons_9addresses":"The Insurance will pay for up to 9 persons, who live at 9 different addresses,",or:"or","9persons_4addresses":"The insurance pays out for an unlimited number of people who live at a maximum of 4 different addresses.",poliscosts:"Policy fee",poliscosts_are:"The cost for an insurance policy is a one-time charge of € 6,95. No matter if you have one or two insuran",youwillrecieve:"You will receive the insurance terms separate from you booking confirmation per email. The insurance starts as soon as the (first) payment has been made.",thank_you_for_your_request:"Thank you very much for your request.",we_sent_confirmation_check_email:"A copy of your request has been sent to your e-mail address. If you have not received any mail from us, it may be that it is in your spam box.",something_went_wrong_please_try_again:"Oops, something went wrong, please try again later.",no_prices_available_for_period:"No prices are available for the selected period.",persons:"persons",bedrooms:"bedrooms",minimum_week_price:"min. weekly price",no_results:"No results",agree_with:"Clicking 'Book' creates a payment obligation when my booking is accepted. I agree to the ",option_is_free:"An option is free of charge and without obligation.",discount_reason:"Reason discount.",results:"results",bathrooms:"bathrooms",you_need_to_give_reason:"You must indicate a valid discount reason","camper.arrival_date":"Start date","camper.departure_date":"End date","camper.arrival":"Start date","camper.departure":"End date","boat.arrival_date":"Start date","boat.departure_date":"End date","boat.arrival":"Start date","boat.departure":"End date","caravan.arrival_date":"Arrival date","caravan.departure_date":"Departure date","caravan.arrival":"Arrival","caravan.departure":"Departure",filters:"Filters",comply_insurance_card:"I agree that the cancellation insurance insurance card will be digitally issued to me. I receive this card with my booking confirmation.","house.you_picked_arrival_date":"Your arrival date is","house.pick_your_departure_in_the_calendar":"Select a departure date","house.you_picked_departure_date":"Your departure date is","house.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","group_accommodation.you_picked_arrival_date":"Your arrival date is","group_accommodation.pick_your_departure_in_the_calendar":"Select a departure date","group_accommodation.you_picked_departure_date":"Your departure date is","group_accommodation.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","tent.you_picked_arrival_date":"Your arrival date is","tent.pick_your_departure_in_the_calendar":"Select a departure date","tent.you_picked_departure_date":"Your departure date is","tent.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camper.you_picked_arrival_date":"Your pickup date is","camper.pick_your_departure_in_the_calendar":"Select a return date","camper.you_picked_departure_date":"Your return date is","camper.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","boat.you_picked_arrival_date":"Your pickup date is","boat.pick_your_departure_in_the_calendar":"Select a return date","boat.you_picked_departure_date":"Your return date is","boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","bnb.you_picked_arrival_date":"Your arrival date is","bnb.pick_your_departure_in_the_calendar":"Select a departure date","bnb.you_picked_departure_date":"Your departure date is","bnb.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","caravan.you_picked_arrival_date":"Your pickup date is","caravan.pick_your_departure_in_the_calendar":"Select a return date","caravan.you_picked_departure_date":"Your return date is","caravan.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","camper_spot.you_picked_arrival_date":"Your arrival date is","camper_spot.pick_your_departure_in_the_calendar":"Select a departure date","camper_spot.you_picked_departure_date":"Your departure date is","camper_spot.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camping_place.you_picked_arrival_date":"Your arrival date is","camping_place.pick_your_departure_in_the_calendar":"Select a departure date","camping_place.you_picked_departure_date":"Your departure date is","camping_place.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","hotelroom.you_picked_arrival_date":"Your arrival date is","hotelroom.pick_your_departure_in_the_calendar":"Select a departure date","hotelroom.you_picked_departure_date":"Your departure date is","hotelroom.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","house_boat.you_picked_arrival_date":"Your pickup date is","house_boat.pick_your_departure_in_the_calendar":"Select a return date","house_boat.you_picked_departure_date":"Your return date is","house_boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date",no:"No",no_house_found:"No object found for this combination of PortalCode and ObjectCode",insurance_company_needs_date_of_birth:"A date of birth is required for taking out insurance","extra_fields.date_of_birth":"Date of birth",no_discount_code_found:"No discount found with entered code",discount_code:"Discount code",minimum_nights:"At least {minimum} nights",can_only_take_insurance_in_de_be_nl:"You can only take out insurance if you live in the Netherlands, Germany or Belgium.",price_from:"Price from",reviews:"Reviews",load_more_reviews:"Load more reviews",review_response_label:"Response from host",reviews_note_link:"BUKAZU Booking System maintains independent reviews. These reviews are collected after guests stay in the accommodation. There is verification of the combination of booking number and email address.",active_filters:"Active filters ({count})",clear_all:"Clear all",remove_filter:"Remove {filter}",view_mode:"View",grid_view:"Grid view",list_view:"List view",show_results:"Show results",nights:"{count} nights",clear_dates:"Clear dates",change_dates:"Change dates",price_follows_dates:"The price follows your dates",previous_month:"Previous month",next_month:"Next month",have_discount_code:"Have a discount code?",hide:"Hide",your_booking:"Your booking",view_breakdown:"View breakdown",returning_to_calendar:"You will return to the calendar in a moment.",done:"Done",score_excellent:"Excellent",score_very_good:"Very good",score_good:"Good",score_fair:"Fair",via_source:"via {source}",based_on_last_reviews:"Based on the last {count} reviews",score_only:"Score only",based_on_reviews:"Based on {count} reviews"},T=["en","nl","de","fr","es","it"];function R(e){return function(e){return T.includes(e)}(e)?e:"en"}new TextEncoder;function A(e,t,n){let r=t;const o=r+n,s=[];let i="";for(;r<o;){const t=e[r++];if(128&t)if(192==(224&t)){const n=63&e[r++];s.push((31&t)<<6|n)}else if(224==(240&t)){const n=63&e[r++],o=63&e[r++];s.push((31&t)<<12|n<<6|o)}else if(240==(248&t)){let n=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];n>65535&&(n-=65536,s.push(n>>>10&1023|55296),n=56320|1023&n),s.push(n)}else s.push(t);else s.push(t);s.length>=4096&&(i+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(i+=String.fromCharCode(...s)),i}var D=new TextDecoder;function P(e,t,n){return n>200?function(e,t,n){const r=e.subarray(t,t+n);return D.decode(r)}(e,t,n):A(e,t,n)}var $=class{type;data;constructor(e,t){this.type=e,this.data=t}},I=class e extends Error{constructor(t){super(t);const n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};function j(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}function L({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){const t=/* @__PURE__ */new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{const n=e/4294967296,r=4294967295&e,o=/* @__PURE__ */new Uint8Array(8),s=new DataView(o.buffer);return s.setUint32(0,t<<2|3&n),s.setUint32(4,r),o}}{const n=/* @__PURE__ */new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),function(e,t,n){const r=Math.floor(n/4294967296),o=n;e.setUint32(t,r),e.setUint32(t+4,o)}(r,4,e),n}}var M={type:-1,encode:function(e){return e instanceof Date?L(function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),o=Math.floor(r/1e9);return{sec:n+o,nsec:r-1e9*o}}(e)):null},decode:function(e){const t=function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:j(t,4),nsec:t.getUint32(0)};default:throw new I(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);/* @__PURE__ */
20
+ return new Date(1e3*t.sec+t.nsec/1e6)}},O=class e{static defaultCodec=new e;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(M)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{const r=-1-e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const r=this.builtInEncoders[n];if(null!=r){const o=r(e,t);if(null!=o){return new $(-1-n,o)}}}for(let n=0;n<this.encoders.length;n++){const r=this.encoders[n];if(null!=r){const o=r(e,t);if(null!=o)return new $(n,o)}}return e instanceof $?e:null}decode(e,t,n){const r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,n):new $(t,e)}};function U(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}(e)?new Uint8Array(e):Uint8Array.from(e)}function q(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}var B="array",F="map_key",z="map_value",H=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new I("The type of key must be string or number but "+typeof e)},W=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=B,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=F,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===B){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===F||e.type===z){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},Y=/* @__PURE__ */new DataView(/* @__PURE__ */new ArrayBuffer(0)),V=new Uint8Array(Y.buffer);try{Y.getInt8(0)}catch(zd){if(!(zd instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var J=/* @__PURE__ */new RangeError("Insufficient data"),K=new class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=16,t=16){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){const r=this.caches[n-1];e:for(const o of r){const r=o.bytes;for(let o=0;o<n;o++)if(r[o]!==e[t+o])continue e;return o.str}return null}store(e,t){const n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){const r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;const o=A(e,t,n),s=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(s,o),o}},G=class e{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Y;bytes=V;headByte=-1;stack=new W;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??O.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=void 0!==e?.keyDecoder?e.keyDecoder:K,this.mapKeyConverter=e?.mapKeyConverter??H}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){const t=U(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){const t=this.bytes.subarray(this.pos),n=U(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:n}=this;/* @__PURE__ */
21
+ return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered)yield*this.clone().decodeMulti(e);else try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t,n=!1;for await(const i of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(i);try{t=this.doDecodeSync(),n=!0}catch(zd){if(!(zd instanceof RangeError))throw zd}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}const{headByte:r,pos:o,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${q(r)} at ${s} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered)yield*this.clone().decodeMultiAsync(e,t);else try{this.entered=!0;let n=t,r=-1;for await(const o of e){if(t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),n&&(r=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),0!==--r;);}catch(zd){if(!(zd instanceof RangeError))throw zd}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const n=e-128;if(0!==n){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){const n=e-144;if(0!==n){this.pushArrayState(n),this.complete();continue e}t=[]}else{const n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeString(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeString(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeString(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new I(`Unrecognized type byte: ${q(e)}`);{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const n=this.stack;for(;n.length>0;){const e=n.top();if(e.type===B){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;t=e.array,n.release(e)}else{if(e.type===F){if("__proto__"===t)throw new I("The key __proto__ is not allowed");e.key=this.mapKeyConverter(t),e.type=z;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=F;continue e}t=e.map,n.release(e)}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new I(`Unrecognized array type byte: ${q(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new I(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new I(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new I(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw J;const n=this.pos+t;let r;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):P(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===F}decodeBinary(e,t){if(e>this.maxBinLength)throw new I(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw J;const n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new I(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=(t=this.view,n=this.pos,4294967296*t.getUint32(n)+t.getUint32(n+4));var t,n;return this.pos+=8,e}readI64(){const e=j(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};async function X(e,t){let n;try{n=await fetch(e)}catch{throw new Error(t)}if(!n.ok)throw new Error(t);const r=new Uint8Array(await n.arrayBuffer());return o=r,new G(s).decode(o);var o,s}var Q=/* @__PURE__ */new Map([["en",N]]),Z=/* @__PURE__ */new Map,ee={en:async()=>(await(import("./en-CgSqbzSK.js"))).default,nl:async()=>(await(import("./nl-Cz225X0w.js"))).default,de:async()=>(await(import("./de-SfUVSlej.js"))).default,fr:async()=>(await(import("./fr-BMdUPHOL.js"))).default,es:async()=>(await(import("./es-BON5ABqu.js"))).default,it:async()=>(await(import("./it-DQ9dWVHp.js"))).default};async function te(e){const t=R(e),n=Q.get(t);if(n)return n;const r=Z.get(t);if(r)return r;const o=async function(e){return X(await ee[e](),`Failed to load translations for locale "${e}"`)}(t).then(e=>(Q.set(t,e),e)).catch(()=>Q.get("en")??{}).finally(()=>{Z.delete(t)});return Z.set(t,o),o}function ne(e,t){const n=R("undefined"!=typeof window&&window.__localeId__||"en"),r=Q.get(n)??Q.get("en")??{};Q.has(n)||te(n);let o=r[e]||e;return t&&Object.entries(t).forEach(([e,t])=>{o=o.replace(new RegExp(`\\{${e}\\}`,"g"),String(t))}),o}function re(e,t){const n="undefined"!=typeof window&&window.__localeId__||"en";return new Intl.NumberFormat(n,t).format(e)}te("en");var oe=({size:e=14})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M5 5l10 10M15 5L5 15"})});function se({items:e,onRemove:t,onClear:n}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"bu-active-filters",children:[/* @__PURE__ */h("div",{className:"bu-active-filters-header",children:[/* @__PURE__ */d("span",{children:ne("active_filters",{count:e.length})}),/* @__PURE__ */d("button",{type:"button",className:"bu-link-button",onClick:n,children:ne("clear_all")})]}),/* @__PURE__ */d("div",{className:"bu-pills",children:e.map(e=>/* @__PURE__ */h("button",{type:"button",className:"bu-pill","data-filter-key":e.key,"aria-label":ne("remove_filter",{filter:e.text}),onClick:()=>t(e.key),children:[/* @__PURE__ */d("span",{children:e.text}),/* @__PURE__ */d("span",{className:"bu-pill-remove",children:/* @__PURE__ */d(oe,{})})]},e.key))})]})}var ie=({size:e=20})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
22
22
  /* @__PURE__ */d("path",{d:"M3 6h9M15 6h2M3 14h3M9 14h8"}),
23
23
  /* @__PURE__ */d("circle",{cx:"13",cy:"6",r:"2"}),
24
- /* @__PURE__ */d("circle",{cx:"7",cy:"14",r:"2"})]}),ae={en:"en-GB",nl:"nl-NL",de:"de-DE",fr:"fr-FR",it:"it-IT",es:"es-ES"};var ce=/* @__PURE__ */new Map;function ue(e,t){const n=function(){const e="undefined"!=typeof window?window.__localeId__:void 0;return(e&&ae[e])??"en-GB"}(),r=`${n}:${JSON.stringify(t)}`;let o=ce.get(r);return o||(o=new Intl.DateTimeFormat(n,t),ce.set(r,o)),o.format(e)}function le(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function de(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function he(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function pe(e,t){return he(e,-t)}function fe(e,t){const n=new Date(e),r=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(r,o)),n}function me(e,t){return function(e,t){const n=new Date(e),r=n.getMonth(),o=n.getDate();n.setDate(1),n.setFullYear(n.getFullYear()+t),n.setMonth(r);const i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,i)),n}(e,-t)}function ge(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function _e(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ye(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function be(e){const t=ge(e);return t.setDate(t.getDate()-t.getDay()),t}function ve(e){const t=ge(e);return t.setDate(t.getDate()+(6-t.getDay())),t}function we(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xe(e,t){return e.getTime()>t.getTime()}function ke(e,t){return e.getTime()<t.getTime()}function Se(e,t){const n=ge(e).getTime(),r=ge(t).getTime();return Math.round((n-r)/864e5)}var Ce={month:"long",year:"numeric"},Ee={weekday:"long",day:"2-digit",month:"long",year:"numeric"},Te={year:"numeric",month:"long",day:"numeric"};function Ne(e){return ue(le(e.slice(0,10)),Te)}var Re={day:"numeric",month:"short",year:"numeric"};function Ae(e){return null!=e&&("string"==typeof e?""!==e.trim():!Array.isArray(e)||e.length>0)}function $e(e,t){const n={...e};return delete n[t],n}function Pe(e,t){return(Array.isArray(t)?t:[t]).map(t=>function(e){return"date"===e.type||e.id.endsWith("_date")}(e)&&"string"==typeof t?function(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?ue(le(e),Re):e}(t):function(e,t){const n=String(t);for(const r of e.options)if("object"==typeof r){if(String(r.id)===n)return r.name}else if(String(r)===n)return String(r);return null}(e,t)??String(t)).join(", ")}var Ie=["countries","regions","cities"];function De(e,t){return String(e)===String(t)}function je(e,t){return Array.isArray(e)?e.some(e=>De(e,t)):De(e,t)}function Le(e,t){for(const n of e??[])if("object"==typeof n&&De(n.id,t))return n;return null}function Oe(e,t,n,r){let o=Ae(n)?{...e,[t]:n}:$e(e,t);if(!function(e){return Ie.includes(e)}(t))return o;const i=Ie.indexOf(t);if(!Ae(n)){for(const e of Ie.slice(i+1))o=$e(o,e);return o}const s=o;if("cities"===t){const e=Le(r.get("cities"),n);void 0!==e?.region&&null!==e.region&&(s.regions=String(e.region)),void 0!==e?.country_id&&null!==e.country_id&&(s.countries=String(e.country_id))}else if("regions"===t){const e=Le(r.get("regions"),n);void 0!==e?.country_id&&null!==e.country_id&&(s.countries=String(e.country_id))}const a=Le(r.get("regions"),s.regions);Ae(s.regions)&&void 0!==a?.country_id&&Ae(s.countries)&&!je(s.countries,a.country_id)&&(o=$e(o,"regions"));const c=Le(r.get("cities"),s.cities),u=o;if(Ae(u.cities)&&c){const e=void 0!==c.country_id&&Ae(u.countries)&&!je(u.countries,c.country_id),t=void 0!==c.region&&Ae(u.regions)&&!je(u.regions,c.region);(e||t)&&(o=$e(o,"cities"))}return o}var Ue="bu-filters-panel";function Me({filters:e,onFilterChange:t,PortalSite:n,options:r}){const[o,i]=u(!1),s=r.searchFields??[],a=s.map(e=>({...e,options:C(e,n)})),c=new Map(a.map(e=>[e.id,e.options])),p=function(e,t){const n=e;return t.filter(e=>Ae(n[e.id])).map(e=>{const t=e.label??e.id,r=Pe(e,n[e.id]);return{key:e.id,label:t,value:r,text:`${t}: ${r}`}})}(e,a),f=e,m=s.filter(e=>!Ae(f[e.id]));function g(n,r){t(Oe(e,n,r,c))}const _=Boolean(r.filtersForm.fixed_mobile),y=[r.filtersForm.show??!0?`filters filters-${r.filtersForm.location}`:"filters-hidden",_?"bu-filters-sheet":"",o?"showOnMobile":""].filter(Boolean).join(" "),b=p.length>0?/* @__PURE__ */d("span",{className:"bu-badge",children:p.length}):null;/* @__PURE__ */
24
+ /* @__PURE__ */d("circle",{cx:"7",cy:"14",r:"2"})]}),ae={en:"en-GB",nl:"nl-NL",de:"de-DE",fr:"fr-FR",it:"it-IT",es:"es-ES"};var ce=/* @__PURE__ */new Map;function ue(e,t){const n=function(){const e="undefined"!=typeof window?window.__localeId__:void 0;return(e&&ae[e])??"en-GB"}(),r=`${n}:${JSON.stringify(t)}`;let o=ce.get(r);return o||(o=new Intl.DateTimeFormat(n,t),ce.set(r,o)),o.format(e)}function le(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function de(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function he(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function pe(e,t){return he(e,-t)}function fe(e,t){const n=new Date(e),r=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(r,o)),n}function me(e,t){return function(e,t){const n=new Date(e),r=n.getMonth(),o=n.getDate();n.setDate(1),n.setFullYear(n.getFullYear()+t),n.setMonth(r);const s=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,s)),n}(e,-t)}function ge(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function _e(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ye(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function be(e){const t=ge(e);return t.setDate(t.getDate()-(t.getDay()+6)%7),t}function ve(e){const t=ge(e);return t.setDate(t.getDate()+(7-t.getDay())%7),t}function we(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ke(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function xe(e,t){return e.getTime()>t.getTime()}function Se(e,t){return e.getTime()<t.getTime()}function Ce(e,t){const n=ge(e).getTime(),r=ge(t).getTime();return Math.round((n-r)/864e5)}var Ee={month:"long",year:"numeric"},Ne={weekday:"long",day:"2-digit",month:"long",year:"numeric"},Te={year:"numeric",month:"long",day:"numeric"};function Re(e){return ue(le(e.slice(0,10)),Te)}var Ae={day:"numeric",month:"short",year:"numeric"};function De(e){return null!=e&&("string"==typeof e?""!==e.trim():!Array.isArray(e)||e.length>0)}function Pe(e,t){const n={...e};return delete n[t],n}function $e(e,t){return(Array.isArray(t)?t:[t]).map(t=>function(e){return"date"===e.type||e.id.endsWith("_date")}(e)&&"string"==typeof t?function(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?ue(le(e),Ae):e}(t):function(e,t){const n=String(t);for(const r of e.options)if("object"==typeof r){if(String(r.id)===n)return r.name}else if(String(r)===n)return String(r);return null}(e,t)??String(t)).join(", ")}var Ie=["countries","regions","cities"];function je(e,t){return String(e)===String(t)}function Le(e,t){return Array.isArray(e)?e.some(e=>je(e,t)):je(e,t)}function Me(e,t){for(const n of e??[])if("object"==typeof n&&je(n.id,t))return n;return null}function Oe(e,t,n,r){let o=De(n)?{...e,[t]:n}:Pe(e,t);if(!function(e){return Ie.includes(e)}(t))return o;const s=Ie.indexOf(t);if(!De(n)){for(const e of Ie.slice(s+1))o=Pe(o,e);return o}const i=o;if("cities"===t){const e=Me(r.get("cities"),n);void 0!==e?.region&&null!==e.region&&(i.regions=String(e.region)),void 0!==e?.country_id&&null!==e.country_id&&(i.countries=String(e.country_id))}else if("regions"===t){const e=Me(r.get("regions"),n);void 0!==e?.country_id&&null!==e.country_id&&(i.countries=String(e.country_id))}const a=Me(r.get("regions"),i.regions);De(i.regions)&&void 0!==a?.country_id&&De(i.countries)&&!Le(i.countries,a.country_id)&&(o=Pe(o,"regions"));const c=Me(r.get("cities"),i.cities),u=o;if(De(u.cities)&&c){const e=void 0!==c.country_id&&De(u.countries)&&!Le(u.countries,c.country_id),t=void 0!==c.region&&De(u.regions)&&!Le(u.regions,c.region);(e||t)&&(o=Pe(o,"cities"))}return o}var Ue="bu-filters-panel";function qe({filters:e,onFilterChange:t,PortalSite:n,options:r}){const[o,s]=u(!1),i=r.searchFields??[],a=i.map(e=>({...e,options:C(e,n)})),c=new Map(a.map(e=>[e.id,e.options])),p=function(e,t){const n=e;return t.filter(e=>De(n[e.id])).map(e=>{const t=e.label??e.id,r=$e(e,n[e.id]);return{key:e.id,label:t,value:r,text:`${t}: ${r}`}})}(e,a),f=e,m=i.filter(e=>!De(f[e.id]));function g(n,r){t(Oe(e,n,r,c))}const _=Boolean(r.filtersForm.fixed_mobile),y=[r.filtersForm.show??!0?`filters filters-${r.filtersForm.location}`:"filters-hidden",_?"bu-filters-sheet":"",o?"showOnMobile":""].filter(Boolean).join(" "),b=p.length>0?/* @__PURE__ */d("span",{className:"bu-badge",children:p.length}):null;/* @__PURE__ */
25
25
  return h(l,{children:[
26
- /* @__PURE__ */h("button",{type:"button",className:_?"bu-filters-fab":"filters-button","aria-expanded":o,"aria-controls":Ue,onClick:()=>i(!o),children:[_&&/* @__PURE__ */d(se,{}),ne("filters"),b]}),_&&o&&/* @__PURE__ */d("div",{className:"bu-filters-backdrop","data-testid":"filters-backdrop",onClick:()=>i(!1)}),
27
- /* @__PURE__ */h("div",{id:Ue,className:y,onKeyDown:e=>{"Escape"===e.key&&i(!1)},children:[
28
- /* @__PURE__ */h("div",{className:"filters-header",children:[/* @__PURE__ */d("span",{className:"filters-title",children:ne("filters")}),/* @__PURE__ */d("button",{type:"button",className:"filters-close","aria-label":ne("close"),onClick:()=>i(!1),children:/* @__PURE__ */d(oe,{size:18})})]}),
29
- /* @__PURE__ */d(ie,{items:p,onRemove:e=>g(e,null),onClear:()=>t({})}),m.map(t=>/* @__PURE__ */h("div",{className:"bu-field",id:`field-${t.id}`,children:[/* @__PURE__ */d("label",{id:`${t.id}-label`,htmlFor:k(t)?t.id:void 0,children:t.label}),/* @__PURE__ */d(E,{field:t,labelId:`${t.id}-label`,options:c.get(t.id),PortalSite:n,filters:e,value:String(f[t.id]??""),onFilterChange:g})]},t.id)),_&&/* @__PURE__ */d("button",{type:"button",className:"bu-filters-apply",onClick:()=>i(!1),children:ne("show_results")})]})]})}function qe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Be(e){return"number"==typeof e?Number.isInteger(e):"string"==typeof e&&/^-?\d+$/.test(e)}function Fe({result:e,options:t,currency:n}){const r=[t.show_city&&`<span>${qe(e.city)}, </span>`,t.show_region&&`<span>${qe(e.province)}, </span>`,t.show_country&&`<span>${qe(e.country_name)}</span>`].filter(Boolean).join(""),o=[t.show_persons&&`<div>${qe(e.persons)} ${qe(ne("persons"))}</div>`,t.show_bedrooms&&`<div>${qe(e.bedrooms)} ${qe(ne("bedrooms"))}</div>`,t.show_bathrooms&&`<div>${qe(e.bathrooms)} ${qe(ne("bathrooms"))}</div>`].filter(Boolean).join(""),i=t.show_rating&&e.rating?`<div class="result-rating bu_card"><div class="result-rating-inner">${qe(e.rating.toFixed(1))}</div></div>`:"",s=t.show_price?e.booking_price?`<div class="result-price">${qe(ne("price_from"))}<span class="price">${qe(re(e.booking_price.total_price,{style:"currency",currency:e.booking_price.currency,minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:`<div class="result-price">${qe(ne("minimum_week_price"))}<span class="price">${qe(re(e.minimum_week_price,{style:"currency",currency:n??"EUR",minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:"";return`\n <a class="bukazu-result bu_card"${e.house_url?` href="${qe(e.house_url)}"`:""}>\n <div class="bukazu-result-inner">\n <div class="image-holder">\n <img${e.image_url?` src="${qe(e.image_url)}"`:""} alt="${qe(e.name)}" />\n </div>\n <div class="result">\n <div class="result-title">${qe(e.name)}</div>\n <div class="result-place">${r}</div>\n <div class="result-description">${e.description}</div>\n <div class="result-details">${o}</div>\n ${i}\n ${s}\n <div class="result-button">${qe(ne("view_details"))}</div>\n </div>\n </div>\n </a>\n `}function ze({onPageChange:e,totalCount:t,activePage:n,limit:r}){const o=r>0?Math.ceil(t/r):0,i=function(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t);let n=Math.max(1,e-Math.floor(2.5)),r=n+5-1;r>=t-1&&(r=t-2,n=r-5+1);const o=[0];n>1&&o.push("...");for(let i=n;i<=r;i++)o.push(i);return r<t-2&&o.push("..."),o.push(t-1),o}(n,o);/* @__PURE__ */
26
+ /* @__PURE__ */h("button",{type:"button",className:_?"bu-filters-fab":"filters-button","aria-expanded":o,"aria-controls":Ue,onClick:()=>s(!o),children:[_&&/* @__PURE__ */d(ie,{}),ne("filters"),b]}),_&&o&&/* @__PURE__ */d("div",{className:"bu-filters-backdrop","data-testid":"filters-backdrop",onClick:()=>s(!1)}),
27
+ /* @__PURE__ */h("div",{id:Ue,className:y,onKeyDown:e=>{"Escape"===e.key&&s(!1)},children:[
28
+ /* @__PURE__ */h("div",{className:"filters-header",children:[/* @__PURE__ */d("span",{className:"filters-title",children:ne("filters")}),/* @__PURE__ */d("button",{type:"button",className:"filters-close","aria-label":ne("close"),onClick:()=>s(!1),children:/* @__PURE__ */d(oe,{size:18})})]}),
29
+ /* @__PURE__ */d(se,{items:p,onRemove:e=>g(e,null),onClear:()=>t({})}),m.map(t=>/* @__PURE__ */h("div",{className:"bu-field",id:`field-${t.id}`,children:[/* @__PURE__ */d("label",{id:`${t.id}-label`,htmlFor:x(t)?t.id:void 0,children:t.label}),/* @__PURE__ */d(E,{field:t,labelId:`${t.id}-label`,options:c.get(t.id),PortalSite:n,filters:e,value:String(f[t.id]??""),onFilterChange:g})]},t.id)),_&&/* @__PURE__ */d("button",{type:"button",className:"bu-filters-apply",onClick:()=>s(!1),children:ne("show_results")})]})]})}function Be(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Fe(e){return"number"==typeof e?Number.isInteger(e):"string"==typeof e&&/^-?\d+$/.test(e)}function ze({result:e,options:t,currency:n}){const r=[t.show_city&&`<span>${Be(e.city)}, </span>`,t.show_region&&`<span>${Be(e.province)}, </span>`,t.show_country&&`<span>${Be(e.country_name)}</span>`].filter(Boolean).join(""),o=[t.show_persons&&`<div>${Be(e.persons)} ${Be(ne("persons"))}</div>`,t.show_bedrooms&&`<div>${Be(e.bedrooms)} ${Be(ne("bedrooms"))}</div>`,t.show_bathrooms&&`<div>${Be(e.bathrooms)} ${Be(ne("bathrooms"))}</div>`].filter(Boolean).join(""),s=t.show_rating&&e.rating?`<div class="result-rating bu_card"><div class="result-rating-inner">${Be(e.rating.toFixed(1))}</div></div>`:"",i=t.show_price?e.booking_price?`<div class="result-price">${Be(ne("price_from"))}<span class="price">${Be(re(e.booking_price.total_price,{style:"currency",currency:e.booking_price.currency,minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:`<div class="result-price">${Be(ne("minimum_week_price"))}<span class="price">${Be(re(e.minimum_week_price,{style:"currency",currency:n??"EUR",minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:"";return`\n <a class="bukazu-result bu_card"${e.house_url?` href="${Be(e.house_url)}"`:""}>\n <div class="bukazu-result-inner">\n <div class="image-holder">\n <img${e.image_url?` src="${Be(e.image_url)}"`:""} alt="${Be(e.name)}" />\n </div>\n <div class="result">\n <div class="result-title">${Be(e.name)}</div>\n <div class="result-place">${r}</div>\n <div class="result-description">${e.description}</div>\n <div class="result-details">${o}</div>\n ${s}\n ${i}\n <div class="result-button">${Be(ne("view_details"))}</div>\n </div>\n </div>\n </a>\n `}function He({onPageChange:e,totalCount:t,activePage:n,limit:r}){const o=r>0?Math.ceil(t/r):0,s=function(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t);let n=Math.max(1,e-Math.floor(2.5)),r=n+5-1;r>=t-1&&(r=t-2,n=r-5+1);const o=[0];n>1&&o.push("...");for(let s=n;s<=r;s++)o.push(s);return r<t-2&&o.push("..."),o.push(t-1),o}(n,o);/* @__PURE__ */
30
30
  return h("div",{className:"bu-paginator",children:[/* @__PURE__ */h("div",{children:[t," ",ne("results")]}),o>1&&/* @__PURE__ */h("ul",{className:"bu-pagination",children:[
31
- /* @__PURE__ */d("li",{className:0===n?"disabled":"",children:/* @__PURE__ */d("button",{disabled:0===n,onClick:()=>e(n-1),"aria-label":ne("previous"),children:"<"})}),i.map((t,r)=>"..."===t?/* @__PURE__ */d("li",{children:/* @__PURE__ */d("span",{"aria-label":"More pages",children:"..."})},`break-${r}`):/* @__PURE__ */d("li",{className:t===n?"selected":"",children:/* @__PURE__ */d("button",{"data-page-button":!0,onClick:()=>e(t),"aria-current":t===n?"page":void 0,children:t+1})},t)),
32
- /* @__PURE__ */d("li",{className:n===o-1?"disabled":"",children:/* @__PURE__ */d("button",{disabled:n===o-1,onClick:()=>e(n+1),"aria-label":ne("next"),children:">"})})]})]})}var He=({size:e=18})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
31
+ /* @__PURE__ */d("li",{className:0===n?"disabled":"",children:/* @__PURE__ */d("button",{disabled:0===n,onClick:()=>e(n-1),"aria-label":ne("previous"),children:"<"})}),s.map((t,r)=>"..."===t?/* @__PURE__ */d("li",{children:/* @__PURE__ */d("span",{"aria-label":"More pages",children:"..."})},`break-${r}`):/* @__PURE__ */d("li",{className:t===n?"selected":"",children:/* @__PURE__ */d("button",{"data-page-button":!0,onClick:()=>e(t),"aria-current":t===n?"page":void 0,children:t+1})},t)),
32
+ /* @__PURE__ */d("li",{className:n===o-1?"disabled":"",children:/* @__PURE__ */d("button",{disabled:n===o-1,onClick:()=>e(n+1),"aria-label":ne("next"),children:">"})})]})]})}var We=({size:e=18})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
33
33
  /* @__PURE__ */d("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1"}),
34
34
  /* @__PURE__ */d("rect",{x:"11",y:"3",width:"6",height:"6",rx:"1"}),
35
35
  /* @__PURE__ */d("rect",{x:"3",y:"11",width:"6",height:"6",rx:"1"}),
36
- /* @__PURE__ */d("rect",{x:"11",y:"11",width:"6",height:"6",rx:"1"})]}),Ye=({size:e=18})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M3 5h14M3 10h14M3 15h14"})});function We({mode:e,onChange:t}){/* @__PURE__ */
37
- return h("div",{className:"bu-view-toggle",role:"group","aria-label":ne("view_mode"),children:[/* @__PURE__ */d("button",{type:"button","aria-pressed":"grid"===e,"aria-label":ne("grid_view"),onClick:()=>t("grid"),children:/* @__PURE__ */d(He,{})}),/* @__PURE__ */d("button",{type:"button","aria-pressed":"list"===e,"aria-label":ne("list_view"),onClick:()=>t("list"),children:/* @__PURE__ */d(Ye,{})})]})}var Je="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ve=globalThis,Ke="10.75.0";function Ge(){return Xe(Ve),Ve}function Xe(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"10.75.0",t[Ke]=t["10.75.0"]||{}}function Qe(e,t,n=Ve){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ke]=r["10.75.0"]||{};return o[e]||(o[e]=t())}var Ze=["debug","info","warn","error","log","assert","trace"],et={};function tt(e){if(!("console"in Ve))return e();const t=Ve.console,n={},r=Object.keys(et);r.forEach(e=>{const r=et[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function nt(){return ot().enabled}function rt(e,...t){Je&&nt()&&tt(()=>{Ve.console[e](`Sentry Logger [${e}]:`,...t)})}function ot(){return Je?Qe("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var it={enable:function(){ot().enabled=!0},disable:function(){ot().enabled=!1},isEnabled:nt,log:function(...e){rt("log",...e)},warn:function(...e){rt("warn",...e)},error:function(...e){rt("error",...e)}},st=/\(error: (.*)\)/,at=/captureMessage|captureException/;function ct(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const o=[],i=e.split("\n");for(let s=n;s<i.length;s++){let e=i[s];e.length>1024&&(e=e.slice(0,1024));const n=st.test(e)?e.replace(st,"$1"):e;if(!n.includes("Error: ")){for(const e of t){const t=e(n);if(t){o.push(t);break}}if(o.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(ut(t).function||"")&&t.pop();t.reverse(),at.test(ut(t).function||"")&&(t.pop(),at.test(ut(t).function||"")&&t.pop());return t.slice(0,50).map(e=>({...e,filename:e.filename||ut(t).filename,function:e.function||"?"}))}(o.slice(r))}}function ut(e){return e[e.length-1]||{}}var lt="<anonymous>";function dt(e){try{return e&&"function"==typeof e&&e.name||lt}catch{return lt}}function ht(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}var pt={},ft={};function mt(e,t){return pt[e]=pt[e]||[],pt[e].push(t),()=>{const n=pt[e];if(n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}}function gt(e,t){if(!ft[e]){ft[e]=!0;try{t()}catch(Rd){Je&&it.error(`Error while instrumenting ${e}`,Rd)}}}function _t(e,t){const n=e&&pt[e];if(n)for(const r of n)try{r(t)}catch(Rd){Je&&it.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${dt(r)}\nError:`,Rd)}}var yt=null;function bt(){yt=Ve.onerror,Ve.onerror=function(e,t,n,r,o){return _t("error",{column:r,error:o,line:n,msg:e,url:t}),!!yt&&yt.apply(this,arguments)},Ve.onerror.__SENTRY_INSTRUMENTED__=!0}var vt=null;function wt(){vt=Ve.onunhandledrejection,Ve.onunhandledrejection=function(e){return _t("unhandledrejection",e),!vt||vt.apply(this,arguments)},Ve.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var xt,kt=Object.prototype.toString;function St(e){switch(kt.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return jt(e,Error)}}function Ct(e,t){return kt.call(e)===`[object ${t}]`}function Et(e){return Ct(e,"ErrorEvent")}function Tt(e){return Ct(e,"DOMError")}function Nt(e){return Ct(e,"String")}function Rt(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function At(e){return null===e||Rt(e)||"object"!=typeof e&&"function"!=typeof e}function $t(e){return Ct(e,"Object")}function Pt(e){return"object"==typeof e&&null!==e}function It(e){return"undefined"!=typeof Event&&jt(e,Event)}function Dt(e){return Boolean(e?.then&&"function"==typeof e.then)}function jt(e,t){try{return e instanceof t}catch{return!1}}function Lt(e){return"undefined"!=typeof Request&&jt(e,Request)}function Ot(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const o=n(r);"function"==typeof o&&Mt(o,r);try{e[t]=o}catch{Je&&it.log(`Failed to replace method "${t}" in object`,e)}}function Ut(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Je&&it.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Mt(e,t){try{e.prototype=t.prototype=t.prototype||{},Ut(e,"__sentry_original__",t)}catch{}}function qt(e){return e.__sentry_original__}function Bt(e){if(St(e))return{message:e.message,name:e.name,stack:e.stack,...Ft(e)};if(It(e)){const{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...Ft(e)}}return e}function Ft(e){return Pt(e)?Object.fromEntries(Object.entries(e)):{}}function zt(e){if(void 0!==xt)return xt?xt(e):e();const t=/* @__PURE__ */Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=Ve;return t in n&&"function"==typeof n[t]?(xt=n[t])(e):(xt=null,e())}function Ht(){return zt(()=>Math.random())}function Yt(){return zt(()=>Date.now())}var Wt,Jt,Vt=/* @__PURE__ */Symbol.for("sentry.skipNormalization"),Kt=/* @__PURE__ */Symbol.for("sentry.overrideNormalizationDepth");function Gt(e,t=100,n=1/0){try{return Qt("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Xt(e,t=3,n=102400){const r=Gt(e,t);return o=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(o))>n?Xt(e,t-1,n):r;var o}function Qt(e,t,n=1/0,r=1/0,o=function(){const e=/* @__PURE__ */new WeakSet;function t(t){return!!e.has(t)||(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}()){const[i,s]=o;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=Zt(e,t);if(!a.startsWith("[object "))return a;if(function(e){return Boolean(e[Vt])}(t))return t;const c=function(e){const t=e[Kt];return"number"==typeof t?t:void 0}(t),u=void 0!==c?c:n;if(0===u)return a.replace("object ","");if(i(t))return"[Circular ~]";const l=t;if(l&&"function"==typeof l.toJSON)try{return Qt("",l.toJSON(),u-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const p=Bt(t);for(const f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(h>=r){d[f]="[MaxProperties ~]";break}const e=p[f];d[f]=Qt(f,e,u-1,r,o),h++}return s(t),d}function Zt(e,t){try{if(Wt){const e=Wt(t);if(e)return e}return"undefined"!=typeof global&&t===global?"[Global]":"number"!=typeof t||Number.isFinite(t)?"function"==typeof t?`[Function: ${dt(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t)}]`:`[${t}]`}catch(n){return`**non-serializable** (${n})`}}function en(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function tn(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];At(t)?n.push(String(t)):t instanceof Error?n.push(t.message?`${t.name}: ${t.message}`:t.name):n.push(Zt(0,t))}return n.join(t)}function nn(e,t,n=!1){return!!Nt(e)&&(Ct(t,"RegExp")?t.test(e):Nt(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function rn(e,t=[],n=!1){for(const r of t)if(nn(e,r,n))return!0;return!1}function on(e=function(){const e=Ve;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return zt(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Jt||(Jt="10000000100040008000100000000000"),Jt.replace(/[018]/g,e=>(e^(16*Ht()&15)>>e/4).toString(16))}function sn(e){return e.exception?.values?.[0]}function an(e){const{message:t,event_id:n}=e;if(t)return t;const r=sn(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function cn(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function un(e,t){const n=sn(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function ln(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Ut(e,"__sentry_captured__",!0)}catch{}return!1}var dn;function hn(){return Yt()/1e3}function pn(){return(dn??(dn=function(){const{performance:e}=Ve;if(!e?.now||!e.timeOrigin)return hn;const t=e.timeOrigin;return()=>(t+zt(()=>e.now()))/1e3}()))()}function fn(e){const t=pn(),n={sid:on(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:/* @__PURE__ */new Date(1e3*e.started).toISOString(),timestamp:/* @__PURE__ */new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&mn(n,e),n}function mn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||pn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:on()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function gn(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=gn(r[o],t[o],n-1));return r}function _n(){return on()}function yn(){return on().substring(16)}function bn(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}var vn="_sentrySpan";function wn(e,t){t?Ut(e,vn,function(e){try{const t=Ve.WeakRef;if("function"==typeof t)return new t(e)}catch{}return e}(t)):delete e[vn]}function xn(e){return bn(e[vn])}var kn=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:_n(),sampleRand:Ht()}}clone(){const t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,wn(t,xn(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&mn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,{tags:r,attributes:o,extra:i,user:s,contexts:a,level:c,fingerprint:u=[],propagationContext:l,conversationId:d}=(n instanceof e?n.getScopeData():$t(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...o},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,wn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:_n(),sampleRand:Ht()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:hn(),...e,message:e.message?en(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:xn(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=gn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||on();if(!this._client)return Je&&it.warn("No client configured on scope - will not capture exception!"),n;const r=/* @__PURE__ */new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||on();if(!this._client)return Je&&it.warn("No client configured on scope - will not capture message!"),r;const o=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||on();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(Je&&it.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};var Sn=e=>e instanceof Promise&&!e[Cn],Cn=/* @__PURE__ */Symbol("chained PromiseLike"),En=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];"function"==typeof o?Object.defineProperty(t,r,{value:(...t)=>o.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Cn]:!0}),t},Tn=class{constructor(e,t){let n,r;n=e||new kn,r=t||new kn,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(Rd){throw this._popScope(),Rd}return Dt(n)?((e,t,n)=>{const r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Sn(r)&&Sn(e)?r:En(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function Nn(){const e=Xe(Ge());return e.stack=e.stack||new Tn(Qe("defaultCurrentScope",()=>new kn),Qe("defaultIsolationScope",()=>new kn))}function Rn(e){return Nn().withScope(e)}function An(e,t){const n=Nn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function $n(e){return Nn().withScope(()=>e(Nn().getIsolationScope()))}function Pn(e){const t=Xe(e);return t.acs?t.acs:{withIsolationScope:$n,withScope:Rn,withSetScope:An,withSetIsolationScope:(e,t)=>$n(t),getCurrentScope:()=>Nn().getScope(),getIsolationScope:()=>Nn().getIsolationScope()}}function In(e,t){const{value:n,unit:r}="object"==typeof(o=e)&&null!=o&&!Array.isArray(o)&&Object.keys(o).includes("value")?e:{value:e,unit:void 0};var o;const i=function(e){if(Array.isArray(e))return{value:e,type:"array"};const t="string"==typeof e?"string":"boolean"==typeof e?"boolean":"number"!=typeof e||Number.isNaN(e)?null:Number.isInteger(e)?"integer":"double";if(t)return{value:e,type:t}}(n),s=r&&"string"==typeof r?{unit:r}:{};if(i)return{...i,...s};if(!t||"skip-undefined"===t&&void 0===n)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...s}}function Dn(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const e=In(o,t);e&&(n[r]=e)}return n}function jn(){return Pn(Ge()).getCurrentScope()}function Ln(){return Pn(Ge()).getIsolationScope()}function On(){return jn().getClient()}function Un(e){const t=void 0;const{traceId:n,parentSpanId:r,propagationSpanId:o}=e.getPropagationContext(),i={trace_id:n,span_id:o||yn()};return r&&(i.parent_span_id=r),i}function Mn(e){const t=e;return{scope:t._sentryScope,isolationScope:bn(t._sentryIsolationScope)}}function qn(e){const t=function(e){if(!e||!Nt(e)&&!Array.isArray(e))return;return Array.isArray(e)?e.reduce((e,t)=>{const n=Bn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Bn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith("sentry-")){e[t.slice(7)]=n}return e},{});return Object.keys(n).length>0?n:void 0}function Bn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var Fn=/^o(\d+)\./,zn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Hn(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function Yn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Wn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){return e.match(Fn)?.[1]}(n)),r}function Jn(e){const t="string"==typeof e?function(e){const t=zn.exec(e);if(!t)return void tt(()=>{});const[n,r,o="",i="",s="",a=""]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Yn({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}(e):Yn(e);if(t&&function(e){if(!Je)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(it.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(it.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(it.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(it.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var Vn=!1;function Kn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Zn(e).parent_span_id,i=Mn(e).scope;return{parent_span_id:o,span_id:r?i?.getPropagationContext().propagationSpanId||yn():t,trace_id:n}}function Gn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:o})=>({span_id:e,trace_id:t,sampled:1===n,attributes:o,...r})):void 0}function Xn(e){return"number"==typeof e?Qn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Qn(e.getTime()):pn()}function Qn(e){return e>9999999999?e/1e3:e}function Zn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:o,name:i,endTime:s,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:er(e),start_timestamp:Xn(o),timestamp:Xn(s)||void 0,status:tr(a),op:r["sentry.op"],origin:r["sentry.origin"],links:Gn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function er(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function tr(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}var nr=function(e){return e._sentryRootSpan||e};function rr(){Vn||(tt(()=>{}),Vn=!0)}function or(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=e||On()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}function ir(e){it.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function sr(e,t){if(!t?.length)return!1;for(const n of t){if(ur(n)){if(e.description&&nn(e.description,n))return Je&&ir(e),!0;continue}const t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;const r=!n.name||e.description&&nn(e.description,n.name),o=!n.op||e.op&&nn(e.op,n.op),i=!n.attributes||Object.entries(n.attributes).every(([t,n])=>ar(e.attributes?.[t],n));if(r&&o&&i)return Je&&ir(e),!0}return!1}function ar(e,t){return"string"==typeof e&&("string"==typeof t||t instanceof RegExp)?nn(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function cr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function ur(e){return"string"==typeof e||e instanceof RegExp}var lr=/* @__PURE__ */Symbol.for("sentry.nonRecordingSpan");var dr="production";function hr(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||"production",release:n.release,public_key:r,trace_id:e,org_id:Wn(t)};return t.emit("createDsc",o),o}function pr(e,t){const n=t.getPropagationContext();return n.dsc||hr(n.traceId,e)}function fr(e){const t=On();if(!t)return{};const n=nr(e),r=Zn(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o["sentry.sample_rate"]??o["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof s&&"string"!=typeof s||(e.sample_rate=`${s}`),e}const c=n._frozenDsc;if(c)return a(c);const u=function(e){return!!e&&!0===e[lr]}(n),l=u&&"ignored"===n.dropReason;if(u&&(!or(t.getOptions())||l)){const e=Mn(n).scope;if(e){const n={...pr(t,e)};return l&&(n.sampled="false"),a(n)}}const d=i?.get("sentry.dsc"),h=d&&qn(d);if(h)return a(h);const p=hr(e.spanContext().traceId,t),f=o["sentry.source"]??o["sentry.segment.name.source"],m=r.description;return"url"!==f&&m&&(p.transaction=m),or()&&(p.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),p.sample_rand=i?.get("sentry.sample_rand")??Mn(n).scope?.getPropagationContext().sampleRand.toString()),a(p),t.emit("createDsc",p,n),p}function mr(e,t=[]){return[e,t]}function gr(e,t){const[n,r]=e;return[n,[...r,t]]}function _r(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function yr(e){const t=Xe(Ve);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function br(e){const[t,n]=e;let r=JSON.stringify(t);function o(e){"string"==typeof r?r="string"==typeof e?r+e:[yr(r),e]:r.push("string"==typeof e?yr(e):e)}for(const i of n){const[e,t]=i;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(Gt(t))}o(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}(r)}function vr(e){const t="string"==typeof e.data?yr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var wr={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function xr(e){return function(e){return e in wr}(e)?wr[e]:e}function kr(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Sr(e,t,n,r){const o=kr(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const s=function(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(Yt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Hn(r)},...o&&{trace:o}}}(e,o,r,t);return delete e.sdkProcessingMetadata,mr(s,[[{type:i},e]])}function Cr(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra});Object.keys(r).length&&(e.tags={...r,...e.tags});Object.keys(o).length&&(e.user={...o,...e.user});Object.keys(i).length&&(e.contexts={...i,...e.contexts});s&&(e.level=s);a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:Kn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:fr(t),...e.sdkProcessingMetadata};const n=nr(t),r=Zn(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,o),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}function Er(e,t){const{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:d,attachments:h,propagationContext:p,transactionName:f,span:m}=t;Tr(e,"extra",n),Tr(e,"tags",r),Tr(e,"attributes",o),Tr(e,"user",i),Tr(e,"contexts",s),e.sdkProcessingMetadata=gn(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...p}}function Tr(e,t,n){e[t]=gn(e[t],n,1)}function Nr(e,t){const n=Qe("globalScope",()=>new kn).getScopeData();return e&&Er(n,e.getScopeData()),t&&Er(n,t.getScopeData()),n}var Rr="user_agent.original";function Ar(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([e,t])=>{null==t||e in n||(n[e]=t)})}function $r(e){return new Or(t=>{t(e)})}function Pr(e){return new Or((t,n)=>{n(e)})}var Ir,Dr,jr,Lr,Or=class e{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(t)try{e(t(n))}catch(Rd){r(Rd)}else e(n)},t=>{if(n)try{e(n(t))}catch(Rd){r(Rd)}else r(t)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,o;return this.then(e=>{o=!1,r=e,t&&t()},e=>{o=!0,r=e,t&&t()}).then(()=>{o?n(r):e(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(Dt(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(Rd){r(Rd)}}};function Ur(e,t,n,r=0){try{const o=Mr(t,n,e,r);return Dt(o)?o:$r(o)}catch(o){return Pr(o)}}function Mr(e,t,n,r){const o=n[r];if(!e||!o)return e;const i=o({...e},t);return Je&&null===i&&it.log(`Event processor "${o.id||"?"}" dropped event`),Dt(i)?i.then(e=>Mr(e,t,n,r+1)):Mr(i,t,n,r+1)}function qr(e,t,n,r,o,i){const{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||on(),timestamp:t.timestamp||hn()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||"production",!e.release&&r&&(e.release=r);!e.dist&&o&&(e.dist=o);const s=e.request;s?.url&&i&&(s.url=en(s.url,i));i&&e.exception?.values?.forEach(e=>{e.value&&(e.value=en(e.value,i))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),o&&o.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=Ve._sentryDebugIds,n=Ve._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Lr&&r.length===Dr&&o.length===jr)return Lr;Dr=r.length,jr=o.length,Lr={},Ir||(Ir={});const i=(t,n)=>{for(const r of t){const t=n[r],o=Ir?.[r];if(o&&Lr&&t)Lr[o[0]]=t,Ir&&(Ir[r]=[o[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const o=n[e]?.filename;if(o&&Lr&&Ir){Lr[o]=t,Ir[r]=[o,t];break}}}}};return t&&i(r,t),n&&i(o,n),Lr}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const l=function(e,t){if(!t)return e;const n=e?e.clone():new kn;return n.update(t),n}(r,n.captureContext);n.mechanism&&un(c,n.mechanism);const d=o?o.getEventProcessors():[],h=Nr(i,l),p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),Cr(c,h);const f=[...d,...h.eventProcessors];return(n.data&&!0===n.data.__sentry__?$r(c):Ur(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof s&&s>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Gt(e.data,t,n)}}))},...e.user&&{user:Gt(e.user,t,n)},...e.contexts&&{contexts:Gt(e.contexts,t,n)},...e.extra&&{extra:Gt(e.extra,t,n)}};e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Gt(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Gt(e.data,t,n)}})));e.contexts?.flags&&r.contexts&&(r.contexts.flags=Gt(e.contexts.flags,3,n));return r}(e,s,a):e))}function Br(e){if(e)return function(e){return e instanceof kn||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>Fr.includes(e))}(e)?{captureContext:e}:e}var Fr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function zr(e,t){return jn().captureException(e,Br(t))}function Hr(e,t){return jn().captureEvent(e,t)}function Yr(e,t){Ln().setTag(e,t)}function Wr(e){const t=Ln(),{user:n}=Nr(t,jn()),{userAgent:r}=Ve.navigator||{},o=fn({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&mn(i,{status:"exited"}),Jr(),t.setSession(o),o}function Jr(){const e=Ln(),t=jn().getSession()||e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),mn(e,n)}(t),Vr(),e.setSession()}function Vr(){const e=Ln(),t=On(),n=e.getSession();n&&t&&t.captureSession(n)}function Kr(e=!1){e?Jr():Vr()}function Gr(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}function Xr(e,t,n){return t||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}var Qr=[];function Zr(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function eo(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function to(e,t,n){if(n[t.name])Je&&it.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Qr.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Qr.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),Je&&it.log(`Integration installed: ${t.name}`)}}function no(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function ro(){return"undefined"!=typeof window&&(!no()||"renderer"===Ve.process?.type)}function oo(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...ro()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function io(e,t){const n=t??function(e){return so().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Hn(r)),mr(i,[oo(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);so().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function so(){return Qe("clientToLogBufferMap",()=>/* @__PURE__ */new WeakMap)}function ao(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...ro()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function co(e,t){const n=t??function(e){return uo().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Hn(r)),mr(i,[ao(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);uo().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function uo(){return Qe("clientToMetricBufferMap",()=>/* @__PURE__ */new WeakMap)}function lo(e){const t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:e.status&&"ok"!==e.status&&"cancelled"!==e.status?"error":"ok",is_segment:!1,attributes:{...e.data},links:e.links};return n=t,{...n,attributes:Dn(n.attributes),links:n.links?.map(e=>({...e,attributes:Dn(e.attributes)}))};var n}var ho=/* @__PURE__ */Symbol.for("SentryBufferFullError");function po(e=100){const t=/* @__PURE__ */new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Pr(ho);const o=r();return t.add(o),o.then(()=>n(o),()=>n(o)),o},drain:function(e){if(!t.size)return $r(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>Gr(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function fo(e,{statusCode:t,headers:n},r=Yt()){const o={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(const a of i.trim().split(",")){const[e,t,,,n]=a.split(":",5),i=parseInt(e,10),s=1e3*(isNaN(i)?60:i);if(t)for(const a of t.split(";"))"metric_bucket"===a&&n&&!n.split(";").includes("custom")||(o[a]=r+s);else o.all=r+s}else s?o.all=r+function(e,t=Yt()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(s,r):429===t&&(o.all=r+6e4);return o}function mo(e,t,n=po(e.bufferSize||64)){let r={};return{send:function(o){const i=[];if(_r(o,(t,n)=>{const o=xr(n);!function(e,t,n=Yt()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",o)}),0===i.length)return Promise.resolve({});const s=mr(o[0],i),a=t=>{!function(e,t){return _r(e,(e,n)=>t.includes(n))}(s,["client_report"])?_r(s,(n,r)=>{e.recordDroppedEvent(t,xr(r))}):Je&&it.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:br(s)}).then(e=>413===e.statusCode?(Je&&it.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(Je&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&it.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=fo(r,e),e),e=>{throw a("network_error"),Je&&it.error("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===ho)return Je&&it.error("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function go(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}var _o=["forwarded","-ip","remote-","via","-user"];var yo={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function bo(e,t){return void 0===e?{...t.httpHeaders}:"boolean"==typeof(n=e)||"allow"in n||"deny"in n?{request:e,response:e}:{request:e.request??t.httpHeaders.request,response:e.response??t.httpHeaders.response};var n}function vo(e){const t=null!=e.dataCollection?yo:!0===e.sendDefaultPii?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:_o},httpHeaders:{request:{deny:_o},response:{deny:_o}},httpBodies:[],urlQueryParams:{deny:_o},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7};const n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:bo(n.httpHeaders,t),httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var wo="Not capturing exception because it's already been captured.",xo="Discarded session because of missing or non-string release",ko=/* @__PURE__ */Symbol.for("SentryInternalError"),So=/* @__PURE__ */Symbol.for("SentryDoNotSendEventError");function Co(e){return{message:e,[ko]:!0}}function Eo(e){return{message:e,[So]:!0}}function To(e){return Pt(e)&&ko in e}function No(e){return Pt(e)&&So in e}function Ro(e,t,n,r,o){let i,s=0,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,t=>{if(s+=r(t),s>=8e5)o(e);else if(!a){const t=e.getOptions()._flushInterval??5e3;t>0&&(a=!0,i=Gr(setTimeout(()=>{o(e)},t)))}}),e.on("flush",()=>{o(e)})}var Ao=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=po(e.transportOptions?.bufferSize??64),this._dataCollection=vo(e),e.dsn?this._dsn=Jn(e.dsn):Je&&it.warn("No DSN provided, client will not send events."),this._dsn){const t=Xr(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&Ro(this,"afterCaptureLog","flushLogs",jo,io),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Ro(this,"afterCaptureMetric","flushMetrics",Do,co)}captureException(e,t,n){const r=on();if(ln(e))return Je&&it.log(wo),r;const o={event_id:r,...t};return this._process(()=>this.eventFromException(e,o).then(e=>this._captureEvent(e,o,n)).then(e=>e),"error"),o.event_id}captureMessage(e,t,n,r){const o={event_id:on(),...n},i=Rt(e)?e:String(e),s=At(e),a=s?this.eventFromMessage(i,t,o):this.eventFromException(e,o);return this._process(()=>a.then(e=>this._captureEvent(e,o,r)),s?"unknown":"error"),o.event_id}captureEvent(e,t,n){const r=on();if(t?.originalException&&ln(t.originalException))return Je&&it.log(wo),r;const o={event_id:r,...t},i=e.sdkProcessingMetadata||{},s=i.capturedSpanScope,a=i.capturedSpanIsolationScope,c=$o(e.type);return this._process(()=>this._captureEvent(e,o,s||n,a),c),o.event_id}captureSession(e){this.sendSession(e),mn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(this.emit("flush"),!t)return!0;const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),to(this,e,this._integrations),t||eo(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);const n=function(e,t){if("transaction"!==e.type||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!1===t.getOptions().streamGenAiSpans||function(e){return"stream"===e.getOptions().traceLifecycle}(t))return;const n=[],r=[];for(const i of e.spans)i.op?.startsWith("gen_ai.")?n.push(lo(i)):r.push(i);if(0===n.length)return;e.spans=r;const o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...ro()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}(e,this);let r=Sr(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])r=gr(r,vr(o));n&&(r=gr(r,n)),this.sendEnvelope(r).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=dr}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(Je&&it.warn(xo));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(Je&&it.warn(xo));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const o=kr(n);return mr({sent_at:new Date(Yt()).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Hn(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;Je&&it.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||/* @__PURE__ */new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(t){return Je&&it.error("Error while sending envelope:",t),{}}return Je&&it.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&to(e,t,n)}),n}(this,e),eo(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const o=t.exception?.values;if(o){r=!0,n=!1;for(const e of o)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(mn(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const o=this.getOptions(),i=this.getIntegrationNames();return!t.integrations&&i.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),qr(o,e,t,n,this,r).then(e=>(null===e||(this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...Un(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:pr(this,n),...e.sdkProcessingMetadata}),e))}_captureEvent(e,t={},n=jn(),r=Ln()){return Je&&Po(e)&&it.log(`Captured error event \`${go(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{Je&&(No(e)?it.log(e.message):To(e)?it.warn(e.message):it.warn(e))})}_processEvent(e,t,n,r){const o=this.getOptions(),{sampleRate:i}=o,s=Io(e),a=Po(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(i),l=$o(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l),Eo("An event processor returned `null`, will not send event.");return!0===t.data?.__sentry__?e:function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Dt(e))return e.then(e=>{if(!$t(e)&&null!==e)throw Co(n);return e},e=>{throw Co(`${t} rejected with ${e}`)});if(!$t(e)&&null!==e)throw Co(n);return e}(function(e,t,n,r){const{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=(c=t.beforeSendSpan,!(c&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan);var c;let u=n;if(Po(u)&&o)return o(u,r);if(Io(u)){if(a||s){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.["sentry.profile_id"],exclusive_time:s?.["sentry.exclusive_time"],measurements:e.measurements,is_segment:!0}}(u);if(s?.length&&sr({description:t.description,op:t.op,attributes:t.data},s))return null;if(a){const e=a(t);e?u=gn(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{"sentry.profile_id":l.profile_id},...l.exclusive_time&&{"sentry.exclusive_time":l.exclusive_time}}}},measurements:l.measurements}):rr()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(s?.length&&sr({description:e.description,op:e.op,attributes:e.data},s))cr(n,e);else if(a){const n=a(e);n?t.push(n):(rr(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(i){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(u,r)}}var l;return u}(this,o,e,t),c)}).then(o=>{if(null===o){if(this.recordDroppedEvent("before_send",l),s){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw Eo(`${c} returned \`null\`, will not send event.`)}const d=n.getSession()||r.getSession();if(a&&d&&this._updateSessionFromEvent(d,o),a&&"number"==typeof u&&Ht()>u)throw this.recordDroppedEvent("sample_rate","error"),Eo(`Discarding event because it's not included in the random sample (sampling rate = ${i})`);if(s){const e=(o.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(o.spans?o.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const h=o.transaction_info;if(s&&h&&o.transaction!==e.transaction){const e="custom";o.transaction_info={...h,source:e}}return this.sendEvent(o,t),o}).then(null,e=>{if(No(e)||To(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),Co(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===ho&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){Je&&it.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(Je&&it.log("No outcomes to send"));if(!this._dsn)return void(Je&&it.log("No dsn provided, will not send outcomes"));Je&&it.log("Sending outcomes:",e);const t=(n=e,mr((r=this._options.tunnel&&Hn(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||hn(),discarded_events:n}]]));var n,r,o;this.sendEnvelope(t)}};function $o(e){return"replay_event"===e?"replay":e||"error"}function Po(e){return void 0===e.type}function Io(e){return"transaction"===e.type}function Do(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Lo(e.attributes)}function jo(e){let t=0;return e.message&&(t+=2*e.message.length),t+Lo(e.attributes)}function Lo(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Oo(e[0]):At(e)?t+=Oo(e):t+=100}),t}function Oo(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Uo(e,t){!0===t.debug&&(Je?it.enable():tt(()=>{})),jn().update(t.initialScope);const n=new e(t);return function(e){jn().setClient(e)}(n),n.init(),n}function Mo(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function qo(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}var Bo=100;function Fo(e,t){const n=On(),r=Ln();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Bo}=n.getOptions();if(i<=0)return;const s={timestamp:hn(),...e},a=o?tt(()=>o(s,t)):s;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}var zo=/* @__PURE__ */new WeakMap,Ho=()=>({name:"FunctionToString",setupOnce(){const e=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=qt(this);let r;try{zo.has(On())&&void 0!==n&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){zo.set(e,!0)}}),Yo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],Wo=(e={})=>{let t;return{name:"EventFilters",setup(n){t=Vo(e,n.getOptions())},processEvent:(n,r,o)=>(t||(t=Vo(e,o.getOptions())),function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&rn(n,t)}(e,t.ignoreTransactions))return Je&&it.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${an(e)}`),!0}else{if(function(e,t){return!!t?.length&&go(e).some(e=>rn(e,t))}(e,t.ignoreErrors))return Je&&it.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${an(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return Je&&it.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${an(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Ko(e);return!!n&&rn(n,t)}(e,t.denyUrls))return Je&&it.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${an(e)}.\nUrl: ${Ko(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Ko(e);return!n||rn(n,t)}(e,t.allowUrls))return Je&&it.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${an(e)}.\nUrl: ${Ko(e)}`),!0}return!1}(n,t)?null:n)}},Jo=(e={})=>({...Wo(e),name:"InboundFilters"});function Vo(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Yo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Ko(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch{return Je&&it.error(`Cannot extract url for event ${an(e)}`),null}}function Go(e,t,n,r,o,i){if(!o.exception?.values||!i||!St(i.originalException))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=Xo(e,t,r,i.originalException,n,o.exception.values,s,0))}function Xo(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(St(r[o])){Zo(s,a,r);const i=e(t,r[o]),u=c.length;ei(i,o,u,a),c=Xo(e,t,n,r[o],o,[i,...c],i,u)}return Qo(r)&&r.errors.forEach((i,u)=>{if(St(i)){Zo(s,a,r);const l=e(t,i),d=c.length;ei(l,`errors[${u}]`,d,a),c=Xo(e,t,n,i,o,[l,...c],l,d)}}),c}function Qo(e){return Array.isArray(e.errors)}function Zo(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Qo(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ei(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function ti(e){return function(e){return St(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var ni=/* @__PURE__ */new Set([]);var ri=/* @__PURE__ */new Set;function oi(){"console"in Ve&&Ze.forEach(function(e){!ri.has(e)&&e in Ve.console&&(ri.add(e),Ot(Ve.console,e,function(t){return et[e]=t,function(...t){const n=t[0],r=et[e],o=ni.size&&"string"==typeof n&&rn(n,ni);o||_t("console",{args:t,level:e}),(!o||Je&&it.isEnabled())&&r?.apply(Ve.console,t)}}))})}function ii(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var si=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!ci(e,t)&&!!ai(e,t))))}(e,t)||!!function(e,t){const n=ui(t),r=ui(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!ci(e,t)&&!!ai(e,t)))}(e,t))}(t,e))return Je&&it.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function ai(e,t){let n=ht(e),r=ht(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const e=r[o],t=n[o];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function ci(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function ui(e){return e.exception?.values?.[0]}var li=()=>({name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=jn().getScopeData(),n=Ln().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:o}=Zn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!o?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}});function di(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}var hi=Ve;function pi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function fi(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in hi))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(pi(hi.fetch))return!0;let e=!1;const t=hi.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=pi(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Je&&it.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function mi(e,t){const n="fetch",r=mt(n,e);return gt(n,()=>function(e,t=!1){if(t&&!fi())return;Ot(Ve,"fetch",function(t){return function(...n){const r=/* @__PURE__ */new Error,{method:o,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:_i(t),method:gi(n,"method")?String(n.method).toUpperCase():Lt(t)&&gi(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:_i(t),method:gi(t,"method")?String(t.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:o,url:i},startTimestamp:1e3*pn(),virtualError:r,headers:yi(n)};return e||_t("fetch",{...s}),t.apply(Ve,n).then(async t=>(e?e(t):_t("fetch",{...s,endTimestamp:1e3*pn(),response:t}),t),e=>{_t("fetch",{...s,endTimestamp:1e3*pn(),error:e}),St(e)&&void 0===e.stack&&(e.stack=r.stack,Ut(e,"framesToPop",1));const t=On()?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==t&&St(e)&&"TypeError"===e.name&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const n=new URL(s.fetchData.url).host;"always"===t?e.message=`${e.message} (${n})`:Ut(e,"__sentry_fetch_url_host__",n)}catch{}throw e})}})}(void 0,t)),r}function gi(e,t){return Pt(e)&&!!e[t]}function _i(e){return"string"==typeof e?e:e?gi(e,"url")?e.url:e.toString?e.toString():"":""}function yi(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Lt(t))return new Headers(t.headers)}catch{}}var bi=Ve;function vi(){try{return bi.document.location.href}catch{return""}}var wi=Ve,xi=0;function ki(){return xi>0}function Si(e,t={}){if("function"!=typeof e)return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const t=e.__sentry_wrapped__;return"function"==typeof t?t:e}if(qt(e))return e}catch{return e}const n=function(...n){Ve._sentryWrappedDepth=(Ve._sentryWrappedDepth||0)+1;try{const r=n.map(e=>Si(e,t));return e.apply(this,r)}catch(r){throw xi++,setTimeout(()=>{xi--}),function(...e){const t=Pn(Ge());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{e.addEventProcessor(e=>(t.mechanism&&(cn(e,void 0,void 0),un(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),zr(r)}),r}finally{Ve._sentryWrappedDepth=(Ve._sentryWrappedDepth||0)-1}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Mt(n,e),Ut(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function Ci(){const e=vi(),{referrer:t}=wi.document||{},{userAgent:n}=wi.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function Ei(e,t){const n=Ri(e,t),r={type:Pi(t),value:Ii(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Ti(e,t,n,r){const o=On()?.getOptions().normalizeDepth,i=(s=t,Object.values(s).find(St));var s;const a={__serialized__:Xt(t,o)};if(i)return{exception:{values:[Ei(e,i)]},extra:a};const c={exception:{values:[{type:It(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Li(t,{isUnhandledRejection:r})}]},extra:a};if(n){const t=Ri(e,n);t.length&&(c.exception.values[0].stacktrace={frames:t})}return c}function Ni(e,t){return{exception:{values:[Ei(e,t)]}}}function Ri(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Ai.test(e.message)?1:0}(t),o=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,o)}catch{}return[]}var Ai=/Minified React error #\d+;/i;function $i(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Pi(e){const t=e?.name;return!t&&$i(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Ii(e){const t=e?.message;return $i(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?ti(t.error):ti(e):"No error message"}function Di(e,t,n,r,o){let i;if(Et(t)&&t.error)return Ni(e,t.error);if(Tt(t)||Ct(t,"DOMException")){const o=t;if("stack"in t){i=Ni(e,t);const o=i.exception?.values?.[0];if(r&&n&&o&&!o.stacktrace){const t=Ri(e,n);t.length&&(o.stacktrace={frames:t},un(i,{synthetic:!0}))}}else{const t=o.name||(Tt(o)?"DOMError":"DOMException"),s=o.message?`${t}: ${o.message}`:t;i=ji(e,s,n,r),cn(i,s)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return St(t)?Ni(e,t):$t(t)||It(t)?(i=Ti(e,t,n,o),un(i,{synthetic:!0}),i):(i=ji(e,t,n,r),cn(i,`${t}`,void 0),un(i,{synthetic:!0}),i)}function ji(e,t,n,r){const o={};if(r&&n){const r=Ri(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]}),un(o,{synthetic:!0})}if(Rt(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Li(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(Bt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return Et(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:It(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}var Oi=class extends Ao{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:wi.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:Ke})),o.version=Ke)}(t,"browser",["browser"],wi.SENTRY_SDK_SOURCE||"npm"),super(t);const{userInfo:r}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:r?"auto":"never",...t._metadata.sdk.settings});const{sendClientReports:o}=this._options;wi.document&&wi.document.addEventListener("visibilitychange",()=>{"hidden"===wi.document.visibilityState&&(o&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),r&&this.on("beforeSendSession",qo)}eventFromException(e,t){return function(e,t,n,r){const o=Di(e,t,n?.syntheticException||void 0,r);return un(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),$r(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const i=ji(e,t,r?.syntheticException||void 0,o);return i.level=n,r?.event_id&&(i.event_id=r.event_id),$r(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}};var Ui="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Mi=Ve;function qi(e,t,n){Mi.document&&Mi.addEventListener(e,t,n)}function Bi(e,t,n){Mi.document&&Mi.removeEventListener(e,t,n)}var Fi={};try{"undefined"!=typeof Node&&(Fi.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),"undefined"!=typeof Element&&(Fi.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,Fi.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,Fi.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,Fi.getAttribute=Element.prototype.getAttribute),"undefined"!=typeof HTMLElement&&(Fi.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function zi(e,t,n){const r=Fi[t];if(r)try{return r.call(e,n)}catch{}const o=e[t];return"function"==typeof o?o.call(e,n):o}function Hi(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let i=0,s=0;const a=" > ",c=3;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<r&&(u=Yi(n,l),!("html"===u||i>1&&s+o.length*c+u.length>=d));)o.push(u),s+=u.length,n=zi(n,"parentNode");return o.reverse().join(a)}catch{return"<unknown>"}}function Yi(e,t){const n=[],r=zi(e,"tagName");if(!r)return"";if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){const t=zi(e,"dataset");if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());const o=t?.length?t.filter(t=>zi(e,"getAttribute",t)).map(t=>[t,zi(e,"getAttribute",t)]):null;if(o?.length)o.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{const t=zi(e,"id");t&&n.push(`#${t}`);const r=zi(e,"className");if(r&&Nt(r)){const e=r.split(/\s+/);for(const t of e)n.push(`.${t}`)}}for(const i of["aria-label","type","name","title","alt"]){const t=zi(e,"getAttribute",i);t&&n.push(`[${i}="${t}"]`)}return n.join("")}var Wi,Ji,Vi,Ki;function Gi(){if(!Mi.document)return;const e=_t.bind(null,"dom"),t=Xi(e,!0);Mi.document.addEventListener("click",t,!1),Mi.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Mi[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(Ot(n,"addEventListener",function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=Xi(e);i.handler=r,t.call(this,n,r,o)}i.refCount++}catch{}return t.call(this,n,r,o)}}),Ot(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},o=n[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Xi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Ut(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ut(r,"_sentryId",on());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Ji)return!1;try{if(!e.target||e.target._sentryId!==Vi)return!1}catch{}return!0})(n)||(e({event:n,name:o,global:t}),Ji=n.type,Vi=r?r._sentryId:void 0),clearTimeout(Wi),Wi=Mi.setTimeout(()=>{Vi=void 0,Ji=void 0},1e3)}}function Qi(e){const t="history";mt(t,e),gt(t,Zi)}function Zi(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=Ki,o=function(e){try{return new URL(e,Mi.location.origin).toString()}catch{return e}}(String(n));if(Ki=o,r===o)return e.apply(this,t);_t("history",{from:r,to:o})}return e.apply(this,t)}}Mi.addEventListener("popstate",()=>{const e=Mi.location.href,t=Ki;Ki=e,t!==e&&_t("history",{from:t,to:e})}),"history"in hi&&hi.history&&(Ot(Mi.history,"pushState",e),Ot(Mi.history,"replaceState",e))}var es={};var ts="__sentry_xhr_v3__";function ns(){if(!Mi.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=/* @__PURE__ */new Error;const o=1e3*pn(),i=Nt(n[0])?n[0].toUpperCase():void 0,s=function(e){if(Nt(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!s)return e.apply(t,n);t[ts]={method:i,url:s,request_headers:{}},"POST"===i&&s.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[ts];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}_t("xhr",{endTimestamp:1e3*pn(),startTimestamp:o,xhr:t,virtualError:r}),r=void 0,t.removeEventListener("readystatechange",a)}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,o]=n,i=t[ts];return i&&Nt(r)&&Nt(o)&&(i.request_headers[r.toLowerCase()]=o),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[ts];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return _t("xhr",{startTimestamp:1e3*pn(),xhr:t}),e.apply(t,n)}})}function rs(e,t=function(e){const t=es[e];if(t)return t;let n=Mi[e];if(pi(n))return es[e]=n.bind(Mi);const r=Mi.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o?.[e]&&(n=o[e]),r.head.removeChild(t)}catch(Rd){Ui&&it.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,Rd)}return n?es[e]=n.bind(Mi):n}("fetch")){let n=0,r=0;return mo(e,async function(o){const i=o.body.length;n+=i,r++;const s={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,s);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(Rd){throw es["fetch"]=void 0,Rd}finally{n-=i,r--}},po(e.bufferSize||40))}var os="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function is(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var ss=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,as=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cs=/\((\S*)(?::(\d+))(?::(\d+))\)/,us=/at (.+?) ?\(data:(.+?),/,ls=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ds=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hs=ct(...[[30,e=>{const t=e.match(us);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ss.exec(e);if(n){const[,e,t,r]=n;return is(e,"?",+t,+r)}const r=as.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=cs.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=ps(r[1]||"?",r[2]);return is(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=ls.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ds.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=ps(n,e),is(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),ps=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},fs=1024,ms=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console",n=mt(t,e);gt(t,oi)}(function(e){return function(t){if(On()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:ii(t.level),message:tn(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${tn(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Fo(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(On()!==e)return;let r,o,i="object"==typeof t?t.serializeAttribute:void 0,s="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;s&&s>fs&&(os&&it.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=fs),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=Hi(t,{keyAttrs:i,maxStringLength:s}),o=function(e,t=5){if(!bi.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};o&&(a.data={"ui.component_name":o}),Fo(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),mt("dom",n),gt("dom",Gi)),t.xhr&&function(e){mt("xhr",e),gt("xhr",ns)}(function(e){return function(t){if(On()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[ts];if(!n||!r||!o)return;const{method:i,url:s,status_code:a,body:c}=o,u={method:i,url:s,status_code:a},l={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:u,type:"http",level:di(a)};e.emit("beforeOutgoingRequestBreadcrumb",d,l),Fo(d,l)}}(e)),t.fetch&&mi(function(e){return function(t){if(On()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,o),Fo(i,o)}else{const o=t.response,i={...t.fetchData,status_code:o?.status},s={input:t.args,response:o,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:di(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,s),Fo(a,s)}}}(e)),t.history&&Qi(function(e){return function(t){if(On()!==e)return;let n=t.from,r=t.to;const o=Mo(wi.location.href);let i=n?Mo(n):void 0;const s=Mo(r);i?.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),Fo({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){On()===e&&Fo({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:an(t)},{event:t})}}(e))}}};var gs="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),_s=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ot(wi,"setTimeout",ys),t.setInterval&&Ot(wi,"setInterval",ys),t.requestAnimationFrame&&Ot(wi,"requestAnimationFrame",bs),t.XMLHttpRequest&&"XMLHttpRequest"in wi&&Ot(XMLHttpRequest.prototype,"send",vs);const e=t.eventTarget;e&&(Array.isArray(e)?e:gs).forEach(e=>function(e,t){const n=wi[e]?.prototype;if(!n?.hasOwnProperty?.("addEventListener"))return;Ot(n,"addEventListener",function(n){return function(r,o,i){try{"function"==typeof o.handleEvent&&(o.handleEvent=Si(o.handleEvent,{mechanism:{data:{handler:dt(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,o),n.apply(this,[r,Si(o,{mechanism:{data:{handler:dt(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),Ot(n,"removeEventListener",function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,"__sentry_wrapped__")){const o=n.__sentry_wrapped__;o&&e.call(this,t,o,r)}}catch{}return e.call(this,t,n,r)}})}(e,t))}}};function ys(e){return function(...t){const n=t[0];return t[0]=Si(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${dt(e)}`}}),e.apply(this,t)}}function bs(e){return function(t){return e.apply(this,[Si(t,{mechanism:{data:{handler:dt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function vs(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ot(n,e,function(t){const n={mechanism:{data:{handler:dt(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=qt(t);return r&&(n.mechanism.data.handler=dt(r)),Si(t,n)})}),e.apply(this,t)}}var ws=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===wi.document)return void(os&&it.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));Wr({ignoreDuration:!0});let e=!1;(e=>{const t=Mi.requestIdleCallback||Mi.setTimeout;"hidden"===Mi.document?.visibilityState?e():(qi("visibilitychange",e=(e=>{let t=!1;return()=>{t||(e(),t=!0)}})(e),{once:!0,capture:!0}),qi("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Bi("visibilitychange",e,{capture:!0}),Bi("pagehide",e,{capture:!0})}))})(()=>{e||(Kr(),e=!0)});const n=Ln();let r=n.getUser();n.addScopeListener(t=>{const n=t.getUser();r?.id===n?.id&&r?.ip_address===n?.ip_address||(r=n,e&&Kr())}),"route"===t&&Qi(({from:t,to:n})=>{t!==n&&(Wr({ignoreDuration:!0}),Kr(),e=!0)})}}},xs=()=>({name:"CultureContext",preprocessEvent(e){const t=ks();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=ks();t&&Ar(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}});function ks(){try{const e=wi.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Ss=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";mt(t,e),gt(t,bt)}(t=>{const{stackParser:n,attachStacktrace:r}=Es();if(On()!==e||ki())return;const{msg:o,url:i,line:s,column:a,error:c}=t,u=function(e,t,n,r){const o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[];0===c.length&&c.push({colno:r,lineno:n,filename:Ts(t)??vi(),function:"?",in_app:!0});return e}(Di(n,c||o,void 0,r,!1),i,s,a);u.level="error",Hr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(e),Cs("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";mt(t,e),gt(t,wt)}(t=>{const{stackParser:n,attachStacktrace:r}=Es();if(On()!==e||ki())return;const o=function(e){if(At(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=At(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Di(n,o,void 0,r,!0);i.level="error",Hr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(e),Cs("onunhandledrejection"))}}};function Cs(e){os&&it.log(`Global Handler attached: ${e}`)}function Es(){return On()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ts(e){if(Nt(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(",");let s="";if(t&&-1!==i){const t=e.slice(i+1);s=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}(e,!1)}>`:e}var Ns=()=>({name:"HttpContext",preprocessEvent(e){if(!wi.navigator&&!wi.location&&!wi.document)return;const t=Ci(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!wi.navigator&&!wi.location&&!wi.document)return;const t=Ci();Ar(e,{[Rr]:t.headers["User-Agent"],...e.is_segment&&{"url.full":"http.client"!==e.attributes?.["sentry.op"]?t.url:void 0,"http.request.header.referer":t.headers.Referer}})}}),Rs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){Go(Ei,o.getOptions().stackParser,n,t,e,r)}}},As=/^HTML(\w*)Element$/;function $s(e){if("undefined"!=typeof window&&e===window)return"[Window]";if("undefined"!=typeof document&&e===document)return"[Document]";if(function(e){if("undefined"==typeof Element)return!1;try{return e instanceof Element}catch{return!1}}(e)){const t=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(e);if(As.test(t))return`[HTMLElement: ${Hi(e)}]`}}function Ps(){return!!function(){if(void 0===wi.window)return!1;const e=wi;if(e.nw)return!1;if(!(e.chrome||e.browser)?.runtime?.id)return!1;const t=vi();return!(wi===wi.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}()&&(os&&tt(()=>{}),!0)}function Is(e={}){const t=!e.skipBrowserExtensionCheck&&Ps();let n=null==e.defaultIntegrations?[Jo(),Ho(),li(),_s(),ms(),Ss(),Rs(),si(),Ns(),xs(),ws()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(o=e.stackParser||hs,Array.isArray(o)?ct(...o):o),integrations:Zr({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||rs};var o;return Wt=$s,Uo(Oi,r)}function Ds(e){const t="undefined"!=typeof window?window.location.href:void 0;Yr("portal_code",e.portalCode),Yr("object_code",e.objectCode??""),Yr("locale",e.locale??""),function(e,t){Ln().setContext(e,t)}("bukazu",{portal_code:e.portalCode,object_code:e.objectCode??null,locale:e.locale??null,url:t??null})}function js(e){zr(e)}function Ls(e){!function(e,t){const n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;jn().captureMessage(e,n,r)}(e,"error")}var Os=/* @__PURE__ */new WeakSet;function Us(e){return function(e){return"messages"in e&&Array.isArray(e.messages)&&e.messages.every(e=>"string"==typeof e)}(e)?e.messages:[e.message]}function Ms(e){const t=Us(e.errors);return"object"!=typeof e.errors||null===e.errors||Os.has(e.errors)||(Os.add(e.errors),js(new Error(t.join("\n")))),/* @__PURE__ */h("div",{className:"bukazu-error-message",children:[/* @__PURE__ */d("h2",{children:ne("something_went_wrong_please_try_again")}),/* @__PURE__ */d("ul",{children:t.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}var qs=["en","nl","de","fr","es","it"];function Bs(e){if(!e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return function(e){return qs.includes(e)}(t)?t:"en"}var Fs=e=>"[object Object]"===Object.prototype.toString.call(e),zs=n({locale:"nl",portalCode:"",objectCode:"",apiUrl:"https://api.bukazu.com"}),Hs="bukazuCurrency";function Ys(e){const t="string"==typeof e?.default&&""!==e.default?e.default:"EUR",n=Array.isArray(e?.allowed)?e.allowed.filter(e=>"string"==typeof e&&""!==e):[];return{multi_currency:e?.multi_currency??!1,default:t,allowed:[.../* @__PURE__ */new Set([...n,t])]}}var Ws=n({currency:void 0,setCurrency:()=>{},allowed:[],multiCurrency:!1});function Js({currencies:e,children:t}){const n=s(()=>Ys(e),[e]),[o,i]=u(()=>{const e=function(){try{return window.localStorage.getItem(Hs)}catch{return null}}();return e&&n.allowed.includes(e)?e:n.default}),a=r(e=>{n.allowed.includes(e)&&(!function(e){try{window.localStorage.setItem(Hs,e)}catch{}}(e),i(e))},[n]),c=n.multi_currency&&n.allowed.length>1,l=s(()=>({currency:c?o:void 0,setCurrency:a,allowed:n.allowed,multiCurrency:c}),[c,n.allowed,o,a]);/* @__PURE__ */
38
- return d(Ws.Provider,{value:l,children:t})}function Vs(){return o(Ws)}function Ks(){const{currency:e,setCurrency:t,allowed:n,multiCurrency:r}=Vs();return!r||n.length<=1?null:/* @__PURE__ */h("div",{className:"bu-currency-selector",children:[/* @__PURE__ */d("label",{htmlFor:"bu-currency",children:ne("currency")}),/* @__PURE__ */d("select",{id:"bu-currency",value:e,onChange:e=>{t(e.target.value)},children:n.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})]})}var Gs=class extends Error{name="KyError";get isKyError(){return!0}},Xs=class extends Gs{name="HTTPError";response;request;options;data;constructor(e,t,n){const r=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},Qs=class extends Gs{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},Zs=e=>null!==e&&"object"==typeof e,ea=e=>Zs(e)&&!Array.isArray(e),ta=e=>"number"==typeof e&&e>=0,na=Object.prototype.toString,ra=e=>e instanceof Error||"[object Error]"===na.call(e),oa=e=>e instanceof globalThis.Request||"[object Request]"===na.call(e),ia=e=>e instanceof globalThis.Response||"[object Response]"===na.call(e),sa=class e extends Error{static wrap(t){return ra(t)?t:new e(t)}name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},aa=class extends Gs{name="ForceRetryError";customDelay;code;customRequest;constructor(e){if(null===e)throw new TypeError("The `ky.retry()` options must be an object");const t=e?.delay;if(void 0!==t&&!ta(t))throw new TypeError("The `ky.retry()` `delay` option must be a non-negative number or `Infinity`");if(void 0!==e?.code&&"string"!=typeof e.code)throw new TypeError("The `ky.retry()` `code` option must be a string");if(void 0!==e?.request&&!oa(e.request))throw new TypeError("The `ky.retry()` `request` option must be a `Request`");const n=void 0===e?.cause?void 0:sa.wrap(e.cause);super(void 0===e?.code?"Forced retry":`Forced retry: ${e.code}`,n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ca=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},ua=class extends Gs{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},la=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch{return!1}const o="Bun"in globalThis||"Deno"in globalThis;return(e||o)&&!t})(),da="function"==typeof globalThis.AbortController,ha="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,pa="function"==typeof globalThis.ReadableStream,fa="function"==typeof globalThis.FormData,ma=["get","post","put","patch","head","delete","query"],ga={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},_a=()=>Object.keys(ga).filter(e=>"bytes"!==e||"function"==typeof globalThis.Response?.prototype?.bytes),ya=2147483647,ba=Symbol.for("ky.stop"),va=class{get isRetryMarker(){return!0}options;constructor(e){this.options=e}},wa=e=>e instanceof va||!0===e?.isRetryMarker,xa=e=>new va(e),ka=["onUploadProgress","onDownloadProgress","timeout","fetch","throwHttpErrors"],Sa={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,maxResponseSize:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Ca={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ea=class extends Gs{name="ResponseSizeError";request;maxResponseSize;constructor(e,t){super(`Response body exceeded ${t} bytes: ${e.method} ${e.url}`),this.request=e,this.maxResponseSize=t}},Ta=new TextEncoder,Na=/* @__PURE__ */new WeakMap,Ra=/* @__PURE__ */new Set([101,103,204,205,304]),Aa=(e,t)=>{const n=e?.body;n&&n!==t?.body&&n.cancel().catch(()=>{})},$a=e=>Math.max(0,Number(e.get("content-length"))||0),Pa=e=>e.replaceAll(/\r\n|\r|\n/g,"\r\n"),Ia=e=>e.replaceAll("\n","%0A").replaceAll("\r","%0D").replaceAll('"',"%22"),Da=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(e,i){if(i.enqueue(e),r){o+=r.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),n?.({percent:e,totalBytes:0===t?0:Math.max(t,o),transferredBytes:o},r)}r=e},flush(){const e=r??/* @__PURE__ */new Uint8Array;o+=e.byteLength,n?.({percent:1,totalBytes:o,transferredBytes:o},e)}}))},ja=(e,t,n=(t.body?Na.get(t.body):void 0))=>{const r=e.clone.bind(e);if(e.body&&n){Na.set(e.body,n);for(const t of Object.keys(ga)){if("function"!=typeof e[t])continue;const r=e[t].bind(e);Object.defineProperty(e,t,{async value(){try{return await r()}catch(e){throw n()??e}},writable:!0,configurable:!0})}}return Object.defineProperties(e,{url:{value:t.url},redirected:{value:t.redirected},type:{value:t.type},headers:{value:t.headers},clone:{value(){const t=r();return e.body&&n&&Na.set(e.body,n),ja(t,e)},writable:!0,configurable:!0}}),e},La=e=>{const{body:t}=e;if(t&&!e.bodyUsed&&!t.locked&&!Ra.has(e.status))return t},Oa=(e,t,n)=>{if(!e.body||e.bodyUsed||e.body.locked||e.keepalive||"no-cors"===e.mode||!(e instanceof globalThis.Request))return e;const r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=44,t+=Ta.encode(`Content-Disposition: form-data; name="${Ia(Pa(n))}"`).byteLength,r instanceof Blob&&(t+=Ta.encode(`; filename="${Ia(r.name??"")}"`).byteLength,t+=Ta.encode(`\r\nContent-Type: ${r.type||"application/octet-stream"}`).byteLength),t+=4,t+="string"==typeof r?Ta.encode(Pa(r)).byteLength:r.size,t+=2;return 0===t?0:t+40+6}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?Ta.encode(e).byteLength:e instanceof URLSearchParams?Ta.encode(e.toString()).byteLength:0})(n??e.body)||$a(e.headers);return new Request(e,{duplex:"half",body:Da(e.body,r,t),headers:e.headers,referrer:e.referrer,referrerPolicy:e.referrerPolicy})},Ua=Symbol.for("ky.replaceOption"),Ma=e=>Zs(e)&&!0===e[Ua]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},qa=(...e)=>{for(const t of e)if(void 0!==t&&!ea(t))throw new TypeError("The `options` argument must be an object");return nc({},...e)},Ba=(e={},t={})=>{const n=new globalThis.Headers(e);for(const[r,o]of Object.entries(Ja(t)))void 0===o?n.delete(r):n.set(r,o);return n},Fa=e=>{if(!ea(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},za=e=>Fa(e)||Array.isArray(e),Ha=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),n=e[Xa];return n&&(t[Xa]=new Set(n)),t}return Array.isArray(e)?[...e]:Fa(e)?{...e}:e},Ya=e=>Array.isArray(e)?e.map(e=>Ha(e)):Ha(e),Wa=(e,t=/* @__PURE__ */new WeakMap)=>{if(!za(e))return e;const n=t.get(e);if(n)return n;if(Array.isArray(e)){const n=[];t.set(e,n);for(const r of e)n.push(Wa(r,t));return n}const r=null===Object.getPrototypeOf(e)?Object.create(null):{};t.set(e,r);for(const o of Reflect.ownKeys(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Object.defineProperty(r,o,{value:Wa(e[o],t),writable:!0,enumerable:!0,configurable:!0});return r},Ja=e=>{if(Fa(e))return e;const t=e instanceof globalThis.Headers,n={};for(const[r,o]of new globalThis.Headers(e).entries())n[r]=t&&"undefined"===o?void 0:o;return n},Va=(e,t)=>{const n=/* @__PURE__ */new Map;for(const[r,o]of[...Object.entries(Ja(e)),...Object.entries(Ja(t))])n.set(r.toLowerCase(),o);return Object.fromEntries(n)};function Ka(e,t,n){if(Object.hasOwn(t,n)&&void 0===t[n])return[];const{isReplace:r,value:o}=Ma(t[n]);if(!(void 0===o||Array.isArray(o)&&o.every(e=>"function"==typeof e)))throw new TypeError(`\`hooks.${n}\` must be an array of functions`);return r?[...o??[]]:nc(e[n]??[],o??[])}var Ga=(e={},t={})=>{if(!ea(t))throw new TypeError("The `hooks` option must be an object");return{init:Ka(e,t,"init"),beforeRequest:Ka(e,t,"beforeRequest"),beforeRetry:Ka(e,t,"beforeRetry"),beforeError:Ka(e,t,"beforeError"),afterResponse:Ka(e,t,"afterResponse")}},Xa=Symbol("deletedParameters"),Qa=/* @__PURE__ */new Set(["json","context"]),Za=(e,t)=>{if(!za(e))return e;if(t.has(e))return t.get(e);t.set(e,e);const n=((e,t)=>{let n;for(const[r,o]of Object.entries(e)){const i=t(o);i!==o&&(n??=Array.isArray(e)?[...e]:{...e},n[r]=i)}return n??e})(e,e=>Za(Ma(e).value,t));return t.set(e,n),n},ec=(e,t)=>{const n=new URLSearchParams,r=/* @__PURE__ */new Set;for(const o of[e,t])if(o instanceof URLSearchParams){const e=o[Xa];if(e)for(const t of e)n.delete(t),r.add(t);for(const[t,r]of o.entries())n.append(t,r)}else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");const t=String(e[0]),{isReplace:r,value:o}=Ma(e[1]);r&&n.delete(t),n.append(t,String(o))}else if(Zs(o))for(const[e,t]of Object.entries(o)){const{isReplace:o,value:i}=Ma(t);void 0===i?(n.delete(e),r.add(e)):(o&&n.delete(e),n.append(e,String(i)))}else{const e=new URLSearchParams(o);for(const[t,r]of e.entries())n.append(t,r)}return r.size>0&&(n[Xa]=r),n},tc=(e,...t)=>{let n,r={},o={},i={};const s=[];for(const a of t)if(Array.isArray(a))Array.isArray(r)||(r=[]),r=[...r,...a];else if(Zs(a)){for(let[t,o]of Object.entries(a)){const i=Ma(o),{isReplace:a}=i;o=i.value;const c=e&&"signal"===t;if(c&&(a||void 0===o)&&(s.length=0),c&&o instanceof globalThis.AbortSignal)s.push(o);else{if(e&&"headers"===t&&null===o)throw new TypeError("The `headers` option must not be `null`. Use `undefined` to clear it.");if(e&&"context"===t){if(void 0!==o&&!ea(o))throw new TypeError("The `context` option must be an object");r={...r,context:void 0===o?{}:a?{...o}:{...r.context,...o}}}else if(e&&"searchParams"===t){if(null===o)throw new TypeError("The `searchParams` option must not be `null`. Use `undefined` to clear it.");n=void 0===o?void 0:a||void 0===n?Ya(o):ec(n,o)}else{if(e&&"retry"===t&&void 0!==o&&"number"!=typeof o&&!ea(o))throw new TypeError("`retry` must be a number or an object");e&&"retry"===t&&!a&&(Zs(o)&&"number"==typeof r[t]?r={...r,[t]:{limit:r[t]}}:"number"==typeof o&&Zs(r[t])&&(o={limit:o})),e&&"retry"===t&&Fa(o)&&(a||!za(r[t]))?o=tc(!1,{},o):!a&&za(r[t])&&za(o)&&Array.isArray(r[t])===Array.isArray(o)&&(o=tc(!1,r[t],o)),r={...r,[t]:o}}}}if(e&&void 0!==a.hooks){const{value:e,isReplace:t}=Ma(a.hooks);i=Ga(t?{}:i,e),r.hooks=i}if(e&&Zs(a.headers)){const{value:e,isReplace:t}=Ma(a.headers);o=Va(t?{}:o,e),r.headers=o}}if(void 0!==n&&(r.searchParams=n),s.length>0&&(1===s.length?r.signal=s[0]:r.signal=ha?AbortSignal.any(s):s.at(-1)),e)for(const[a,c]of Object.entries(r))Qa.has(a)||(r[a]=Za(c,/* @__PURE__ */new Map));return r},nc=(...e)=>tc(!0,...e),rc=e=>ma.includes(e.toLowerCase())?e.toUpperCase():e,oc=/* @__PURE__ */new Set([...ma,"options","trace"]),ic=e=>oc.has(e.toLowerCase())?e.toLowerCase():e,sc={limit:2,methods:["get","put","head","delete","options","trace","query"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},ac=(e={})=>{if("number"==typeof e&&(e={limit:e}),!ea(e))throw new TypeError("`retry` must be a number or an object");const t={...sc,...Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))};if(!Number.isInteger(t.limit)||t.limit<0)throw new TypeError("`retry.limit` must be a finite, non-negative integer");for(const n of["methods","statusCodes","afterStatusCodes"])if(!Array.isArray(t[n]))throw new Error(`retry.${n} must be an array`);for(const[n,r]of[["methods",e=>"string"==typeof e],["statusCodes",e=>Number.isInteger(e)],["afterStatusCodes",e=>Number.isInteger(e)]])if(t[n].some(e=>!r(e)))throw new TypeError(`\`retry.${n}\` must only contain ${"methods"===n?"strings":"numbers"}`);for(const n of["maxRetryAfter","backoffLimit"])if(!ta(t[n]))throw new TypeError(`\`retry.${n}\` must be a non-negative number or \`Infinity\``);for(const n of["delay","shouldRetry"])if(void 0!==t[n]&&"function"!=typeof t[n])throw new TypeError(`\`retry.${n}\` must be a function`);if(void 0!==t.jitter&&"boolean"!=typeof t.jitter&&"function"!=typeof t.jitter)throw new TypeError("`retry.jitter` must be a boolean or a function");if("boolean"!=typeof t.retryOnTimeout)throw new TypeError("`retry.retryOnTimeout` must be a boolean");return t.methods=t.methods.map(e=>ic(e)),t.statusCodes=[...t.statusCodes],t.afterStatusCodes=[...t.afterStatusCodes],t};async function cc(e,{signal:t}){return new Promise((n,r)=>{function o(){clearTimeout(i),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const i=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var uc=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function lc(e){if(!e||!ra(e)||"TypeError"!==e.name||"string"!=typeof e.message)return!1;const{message:t,stack:n}=e;return"Load failed"===t||t.startsWith("Load failed (")&&t.endsWith(")")?void 0===n||"__sentry_captured__"in e:!!t.startsWith("error sending request for url")||(!!("Failed to fetch"===t||t.startsWith("Failed to fetch (")&&t.endsWith(")"))||uc.has(t))}var dc=(e,t)=>e instanceof t||!0===e?.isKyError&&e?.name===t.name;function hc(e){return dc(e,aa)}var pc=/^\d+$/,fc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mc=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,gc=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,_c=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,yc=({year:e,month:t,day:n,hours:r,minutes:o,seconds:i})=>{const s=fc.indexOf(t),a=Number(n),c=Number(r),u=Number(o),l=Number(i);if(-1===s||c>23||u>59||l>60)return;const d=Math.min(l,59),h=new Date(Date.UTC(e,s,a,c,u,d));h.setUTCFullYear(e);const p=h.getTime();return h.getUTCFullYear()===e&&h.getUTCMonth()===s&&h.getUTCDate()===a&&h.getUTCHours()===c&&h.getUTCMinutes()===u&&h.getUTCSeconds()===d?60===l?p+1e3:p:void 0},bc=(e,t)=>e[t],vc=({value:e,allowTimestamp:t})=>{if(pc.test(e)){let n=1e3*Number(e);return t&&Number(e)>=1e9&&(n-=Date.now()),Math.max(0,n)}const n=(e=>{const t=mc.exec(e);if(t)return yc({year:Number(bc(t,3)),month:bc(t,2),day:bc(t,1),hours:bc(t,4),minutes:bc(t,5),seconds:bc(t,6)});const n=gc.exec(e);if(n){const e=/* @__PURE__ */new Date,t=Number(bc(n,3)),r=100*Math.floor(e.getUTCFullYear()/100)+t,o=Date.UTC(e.getUTCFullYear()+50,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());let i;for(const s of[r-100,r,r+100]){const e=yc({year:s,month:bc(n,2),day:bc(n,1),hours:bc(n,4),minutes:bc(n,5),seconds:bc(n,6)});void 0!==e&&e<=o&&(i=e)}return i}const r=_c.exec(e);if(r){const[e,t,n]=bc(r,4).split(":");return yc({year:Number(bc(r,5)),month:bc(r,2),day:bc(r,3).trim(),hours:e,minutes:t,seconds:n})}})(e);if(void 0!==n)return Math.max(0,n-Date.now())},wc=Symbol("timedOut"),xc=()=>globalThis.performance?.now()??Date.now(),kc=(e,t)=>Promise.race([e,new Promise(n=>{const r=setTimeout(()=>{n(wc)},t);e.finally(()=>{clearTimeout(r)}).catch(()=>{})})]),Sc=e=>{(ia(e)||oa(e))&&Aa(e)},Cc=e=>{e.then(e=>{Sc(e)}).catch(()=>{})},Ec=e=>{const t=(e.split(";",1)[0]??"").trim().toLowerCase();if(!t.endsWith("json"))return!1;const n=t.at(-5);return"/"===n||("."===n||"+"===n||"-"===n)&&t.includes("/")},Tc=async(e,t)=>{const{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}const o=e.headers.get("content-type")??"",i=Ec(o)?new TextDecoder:(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder})(o),s=[];let a=0;const c=(async()=>{try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(a+=t.byteLength,a>10485760)return void r.cancel().catch(()=>{});s.push(i.decode(t,{stream:!0}))}}catch(e){if(function(e){return dc(e,Ea)}(e))throw e;return}return s.push(i.decode()),s.join("")})(),u=await kc(c,t);return u===wc&&r.cancel().catch(()=>{}),u},Nc=(e,t)=>{if(!1!==e){if(!ta(e))throw new TypeError(`The \`${t}\` option must be a non-negative number or \`false\``);if(e>2147483647)throw new RangeError(`The \`${t}\` option cannot be greater than 2147483647`)}},Rc=({throwHttpErrors:e=!0,timeout:t=1e4,fetch:n=globalThis.fetch.bind(globalThis)})=>({throwHttpErrors:e,timeout:t,fetch:n}),Ac=e=>{for(const n of["parseJson","stringifyJson","fetch","onDownloadProgress","onUploadProgress"])if(void 0!==e[n]&&"function"!=typeof e[n])throw new TypeError(`The \`${n}\` option must be a function`);const{throwHttpErrors:t}=e;if("boolean"!=typeof t&&"function"!=typeof t)throw new TypeError("The `throwHttpErrors` option must be a boolean or a function")},$c=/^[\0-\u0020]+/g,Pc=/[\t\n\r]/g,Ic=/^[a-z][\d+.a-z-]*:/i,Dc=/^https?:(?!\/\/)/i,jc=(e,t,n)=>{if("string"!=typeof e)return e;if(t&&(e=`${t.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`),n){const t=(e=>e.replaceAll($c,"").replaceAll(Pc,""))(e);if(Dc.test(t))throw new TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");if(!(e=>Ic.test(e))(t))return new URL(e,new Request(n).url)}return e},Lc=(e,t)=>{e.searchParams.has(t)&&e.searchParams.delete(t)};var Oc=async(e,t)=>{const n=Zs(t)||"function"==typeof t?t["~standard"]:void 0;if(!Zs(n)||"function"!=typeof n.validate)throw new TypeError("The `schema` argument must follow the Standard Schema specification");const r=await n.validate(e);if(r.issues)throw new ca(r.issues);return r.value},Uc=class e{static create(t,n){const r=n.hooks?.init??[],o=r.length>0?function(e){return{...e,headers:Va({},e.headers??{}),context:{...e.context},json:Wa(e.json),searchParams:Ya(e.searchParams),retry:Wa(e.retry)}}(n):n;for(const e of r)e(o);const i=new e(t,o),s=(async()=>{let e;try{return e=await i.#e(),e}catch(t){return await i.#t(t)}finally{const t=i.#n;Aa(t,e),t&&i.request!==t&&Aa(i.request,e)}})();for(const e of _a()){const t=ga[e];s[e]=async n=>{i.request!==i.#n&&i.request.headers.set("accept",i.request.headers.get("accept")||t);const r=await s;if(void 0===r)throw new TypeError("The request resolved without a response, so there is no body to read. This happens when a `beforeRetry` hook returns `ky.stop`. Throw from the hook instead of returning `ky.stop`.");if("json"!==e)return i.#r(async()=>r[e](),r);const o=await i.#r(async()=>r.text(),r),a=i.#o(r);let c;try{c=await i.#i(async()=>{const e=""!==o||void 0===n||i.#s.parseJson?await i.#a(o,a,r):void 0;return void 0===n?e:await Oc(e,n)})}catch(u){throw i.#c?.aborted&&await i.#t(i.#c.reason,a),u}return c===wc&&await i.#t(new ua(a),a),c}}return s}request;#u;#l=0;#d;#s;#h;#n;#p=!1;#c;#f=/* @__PURE__ */new WeakSet;#m;#g;#_=/* @__PURE__ */new WeakSet;#y=/* @__PURE__ */new WeakMap;#b=/* @__PURE__ */new WeakSet;constructor(e,t={}){if("string"!=typeof e&&!(e instanceof URL||e instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");const{maxResponseSize:n=Number.POSITIVE_INFINITY,totalTimeout:r=!1}=t;if(Object.hasOwn(t,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");for(const s of["headers","method","prefix","baseUrl","referrer","referrerPolicy"])if(null===t[s])throw new TypeError(`The \`${s}\` option must not be \`null\`. Use \`undefined\` to clear it.`);if(void 0!==t.context&&!ea(t.context))throw new TypeError("The `context` option must be an object");if(this.#s={...t,headers:Ba(e.headers,t.headers),hooks:Ga({},t.hooks),method:rc(t.method??e.method??"GET"),referrer:t.referrer??e.referrer,referrerPolicy:t.referrerPolicy??e.referrerPolicy,prefix:String(t.prefix||""),retry:ac(t.retry),...Rc(t),totalTimeout:r,maxResponseSize:n,context:t.context??{}},Ac(this.#s),Nc(this.#s.timeout,"timeout"),Nc(r,"totalTimeout"),this.#d=this.#s.retry.limit,n!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(n)||n<0))throw new TypeError("The `maxResponseSize` option must be a non-negative safe integer or Infinity");this.#h=e instanceof globalThis.Request?e:void 0,e=jc(e,this.#s.prefix,this.#s.baseUrl),da&&ha&&(this.#c=this.#s.signal??this.#h?.signal,this.#u=new globalThis.AbortController,this.#s.signal=this.#v()),la&&(this.#s.duplex="half");const o=void 0!==t.headers&&Ba({},t.headers).has("content-type");void 0!==this.#s.json&&(this.#s.body=this.#s.stringifyJson?.(this.#s.json)??JSON.stringify(this.#s.json),o||this.#s.headers.set("content-type","application/json")),e instanceof globalThis.Request&&(fa&&this.#s.body instanceof globalThis.FormData||this.#s.body instanceof URLSearchParams)&&!o&&this.#s.headers.delete("content-type"),this.request=new globalThis.Request(e,this.#s),this.#p="function"==typeof globalThis.ReadableStream&&this.#s.body instanceof globalThis.ReadableStream;const{searchParams:i}=this.#s;if((e=>{if(void 0===e)return!1;if(null===e)throw new TypeError("The `searchParams` option must not be `null`. Use `undefined` to clear it.");return Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||Boolean(e[Xa]?.size):"object"==typeof e?Object.keys(e).length>0:"string"==typeof e?e.trim().length>0:Boolean(e)})(i)){const e=new URL(this.request.url);if(((e,t)=>{const n=t?.[Xa];if(n)for(const r of n)Lc(e,r);if("string"==typeof t){const n=t.replace(/^\?/,"");""!==n&&(e.search=e.search?`${e.search}&${n}`:`?${n}`)}else if(!ea(t)||t instanceof URLSearchParams)for(const[r,o]of new URLSearchParams(t))e.searchParams.append(r,o);else for(const[r,o]of Object.entries(t))void 0===o?Lc(e,r):e.searchParams.append(r,o)})(e,i),e.href!==this.request.url){const{body:t,cache:n,credentials:r,integrity:o,keepalive:i,mode:s,redirect:a,referrer:c,referrerPolicy:u}=this.request,l=la&&!i&&"no-cors"!==s;this.request=new globalThis.Request(e,{...this.#s,cache:n,credentials:r,integrity:o,keepalive:i,mode:s,redirect:a,referrer:c,referrerPolicy:u,body:this.#s.body??(l?t:void 0)})}}this.#g="number"==typeof r?xc()+r:Number.POSITIVE_INFINITY}async#e(){await Promise.resolve();const e=await this.#w();void 0!==e&&(this.#d=ac(this.#s.retry).limit);let t=e??await this.#x();for(;;){if(void 0===t)return;const e=this.#_.has(t);let r;try{t=await this.#k(t)}catch(n){if(!hc(n))throw n;r=n}if(void 0===r){const n=t;if(n.ok||"opaque"===n.type||!this.#S(n))break;const o=new Xs(n,this.#o(n),this.#C());if(o.data=await this.#E(n),this.#T(),this.#N(),e)throw o;r=o}t=await this.#R(r)}if(this.#A(t),this.#s.onDownloadProgress){if(!pa)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=((e,t)=>{const n=La(e);if(!n)return e;const r=e.headers.get("content-encoding")?.toLowerCase(),o=Boolean(r)&&"identity"!==r?0:$a(e.headers),i=Da(n,o,t);return ja(new Response(i,e),e)})(t,this.#s.onDownloadProgress);return this.#$(e,this.#o(t)),this.#A(e)}return t}#P(e,t){const n=e.delay(this.#l+1);if(!ta(n))throw new TypeError("`retry.delay` must return a non-negative number or `Infinity`",{cause:t});let r=n;return!0===e.jitter?r=Math.random()*n:"function"==typeof e.jitter&&(r=e.jitter(n),(!Number.isFinite(r)||r<0)&&(r=n)),Math.min(e.backoffLimit,r)}async#I(e){const t=ac(this.#s.retry);if(this.#l>=Math.min(t.limit,this.#d))throw e;const n=sa.wrap(e);if(hc(n))return n.customDelay??this.#P(t,e);if(!t.methods.includes(ic(this.request.method)))throw e;let r=!1;const{shouldRetry:o}=t;if(void 0!==o){const t=await this.#i(async()=>o({error:n,retryCount:this.#l+1}));if(this.#T(),t===wc)throw new ua(this.#D);if(!1===t)throw e;r=!0===t}if(function(e){return dc(e,ua)}(e)){if(!r&&!t.retryOnTimeout)throw e;return this.#P(t,e)}if(function(e){return dc(e,Xs)}(e)){if(!r&&!t.statusCodes.includes(e.response.status))throw e;const n=(e=>{const t=e.get("Retry-After");if(null!==t)return{value:t,allowTimestamp:!1};const n=e.get("RateLimit-Reset");if(null!==n)return{value:n,allowTimestamp:!0};const r=e.get("X-RateLimit-Retry-After");if(null!==r)return{value:r,allowTimestamp:!1};const o=e.get("X-RateLimit-Reset")??e.get("X-Rate-Limit-Reset");return null!==o?{value:o,allowTimestamp:!0}:void 0})(e.response.headers);if(n&&t.afterStatusCodes.includes(e.response.status)){const r=vc(n);return void 0===r?this.#P(t,e):Math.min(t.maxRetryAfter,r)}if(!r&&413===e.response.status)throw e;return this.#P(t,e)}if(!r&&!function(e){return dc(e,Qs)}(e))throw e;return this.#P(t,e)}#A(e){if(!this.#s.parseJson||this.#b.has(e))return e;this.#b.add(e);const t=this.#o(e);e.json=async()=>this.#a(await e.text(),t,e);const n=e.clone.bind(e);return e.clone=()=>this.#A(this.#$(n(),t)),e}async#t(e,t=this.#D){if(!ra(e))throw e;if(this.#f.has(e))throw e;let n=e;for(const r of this.#s.hooks.beforeError){const e=await r({request:t,options:this.#C(),error:n,retryCount:this.#l});ra(e)&&(n=e)}throw n}async#E(e){const t=this.#o(e),n=({fromTotalTimeout:e})=>{if(e)throw new ua(t);this.#N(t)},r=this.#j(t),o=await Tc(e,r.milliseconds);if(o===wc)return void n(r);if(!o)return;if(!Ec(e.headers.get("content-type")??""))return o;const i=this.#j(t),s=await kc(Promise.resolve().then(()=>this.#a(o,t,e)),i.milliseconds).catch(()=>{});if(s!==wc)return s;n(i)}#j(e){const t=!1===this.#s.timeout?1e4:this.#s.timeout,n=this.#L();if(0===n)throw new ua(e);return{milliseconds:Math.min(t,n),fromTotalTimeout:n<=t}}#O(){const e=this.#L();if(0===e)throw new ua(this.#D);const t=Math.min(!1===this.#s.timeout?Number.POSITIVE_INFINITY:this.#s.timeout,e);return t===Number.POSITIVE_INFINITY?void 0:t}async#r(e,t){const n=this.#o(t);let r;try{r=this.#O()}catch(s){await this.#t(s,n)}const o=e();let i;try{i=void 0===r?await o:await kc(o,r)}catch(s){this.#c?.aborted&&await this.#t(this.#c.reason,n),0!==this.#L()&&(lc(s)&&await this.#t(new Qs(n,{cause:s}),n),await this.#t(s,n)),i=wc}return this.#c?.aborted&&await this.#t(this.#c.reason,n),i!==wc&&0!==this.#L()||(this.#u?.abort(),await this.#t(new ua(n),n)),i}async#i(e){const t=this.#c;t?.throwIfAborted();const n=this.#L();if(0===n)return this.#u?.abort(),wc;let r,o,i;try{const s=new Promise((e,n)=>{t&&(o=()=>{n(t.reason)},t.addEventListener("abort",o,{once:!0}))});if(i=e(),n===Number.POSITIVE_INFINITY)return await Promise.race([i,s]);const a=new Promise(e=>{r=setTimeout(()=>{e(wc)},n)}),c=await Promise.race([i,a,s]);return c===wc||0===this.#L()?(this.#u?.abort(),c===wc?Cc(i):Sc(c),wc):c}catch(s){if(t?.aborted&&(i&&Cc(i),t.throwIfAborted()),0===this.#L())return this.#u?.abort(),wc;throw s}finally{clearTimeout(r),o&&t?.removeEventListener("abort",o)}}#a(e,t,n){const{parseJson:r}=this.#s;return r?r(e,{request:t,response:n}):JSON.parse(e)}#v(){return this.#c?AbortSignal.any([this.#c,this.#u.signal]):this.#u.signal}#S(e){const{throwHttpErrors:t}=this.#s;try{return"function"==typeof t?t(e.status):t}catch(n){throw Aa(e),n}}get#D(){return this.#n??this.request}#N(e=this.#D){if(0===this.#L())throw new ua(e)}async#w(){for(const e of this.#s.hooks.beforeRequest){const t=await this.#i(async()=>e({request:this.request,options:this.#C(),retryCount:0}));if(t===wc)throw new ua(this.#D);if(oa(t))this.#U(this.#M(t));else if(ia(t))return this.#_.add(t),t}}async#k(e){const t=this.#o(e);e=this.#q(e);for(const r of this.#s.hooks.afterResponse){const o=this.#$(e.clone(),t);let i;this.#A(o);try{if(i=await this.#i(async()=>r({request:this.request,options:this.#C(),response:o,retryCount:this.#l})),i===wc)throw new ua(this.#D);if(wa(i))throw new aa(i.options)}catch(n){throw Aa(o),Aa(e),n}const s=ia(i)?this.#$(i,t):e;Aa(o,s),Aa(e,s),s!==e&&(e=this.#q(s))}return e}async#x(){try{return await this.#B()}catch(e){return this.#R(e)}}async#R(e){this.#T();const t=Math.min(await this.#I(e),ya),n={signal:this.#c},r=this.#L();if(0===r)throw new ua(this.#D);if(t>=r)throw await cc(r,n),new ua(this.#D);await cc(t,n),this.#N(),this.#u?.signal.aborted&&(this.#u=new globalThis.AbortController,this.#s.signal=this.#v(),this.#U(this.#M(this.request),this.#p)),hc(e)&&e.customRequest&&this.#U(this.#M(e.customRequest));for(const i of this.#s.hooks.beforeRetry){let t;try{t=await this.#i(async()=>i({request:this.request,options:this.#C(),error:sa.wrap(e),retryCount:this.#l+1}))}catch(o){throw this.#T(),ra(o)&&o!==e&&this.#f.add(o),o}if(t===wc)throw new ua(this.#D);if(oa(t)){this.#U(this.#M(t));break}if(ia(t))return this.#_.add(t),this.#l++,t;if(t===ba)return;ea(t)&&this.#F(t.options)}return this.#N(),this.#l++,this.#x()}async#B(){Aa(this.#n,this.request);const e=(e=>{const t={};for(const n of Object.keys(e))Object.hasOwn(Ca,n)||Object.hasOwn(Sa,n)||Object.defineProperty(t,n,{value:e[n],writable:!0,enumerable:!0,configurable:!0});return t})(this.#s);this.#d=ac(this.#s.retry).limit;const t=this.#d>0?this.#M(this.request.clone()):void 0,n=this.#z(this.request);this.#n=n,t&&(this.request=t,this.#p=!0);try{const t=this.#O(),{fetch:r}=this.#s,o=void 0===t?await r(n,e):await async function(e,t,n,r){let o,i=!1;try{return await new Promise((s,a)=>{o=setTimeout(()=>{i=!0,n?.abort(),a(new ua(e))},r.timeout);const{fetch:c}=r;c(e,t).then(e=>{i?Aa(e):s(e)}).catch(a)})}finally{clearTimeout(o)}}(n,e,this.#u,{timeout:t,fetch:r});if(!ia(o))throw new TypeError("The `fetch` option must resolve with a `Response`");if(0===this.#L())throw this.#u?.abort(),Aa(o),new ua(n);return this.#$(o,n)}catch(r){if(this.#T(),0===this.#L())throw this.#u?.abort(),new ua(n);if(lc(r))throw new Qs(n,{cause:r});throw r}}#T(){this.#c?.throwIfAborted()}#L(){return Math.max(0,this.#g-xc())}#F(e){if(!ea(e))throw new TypeError("The `options` returned from a `beforeRetry` hook must be an object");for(const r of Object.keys(e))if(!ka.includes(r))throw new TypeError(`The \`${r}\` option cannot be changed from a \`beforeRetry\` hook`);const t={...this.#s,...e},n={...t,...Rc(t)};Ac(n),Nc(n.timeout,"timeout"),Object.assign(this.#s,n),this.#m=void 0}#C(){if(!this.#m){const{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:o,timeout:i,totalTimeout:s,maxResponseSize:a,throwHttpErrors:c,fetch:u,...l}=this.#s;this.#m=Object.freeze(l)}return this.#m}#U(e,t=!1){this.#p&&Aa(this.request,e),this.#m=void 0,this.request=e,this.#p=t}#M(e){return this.#s.signal&&e instanceof globalThis.Request?new globalThis.Request(e,{signal:this.#s.signal,referrer:e.referrer,referrerPolicy:e.referrerPolicy}):e}#o(e){return this.#y.get(e)??this.#D}#$(e,t){return this.#y.set(e,t),e}#q(e){const t=this.#o(e);return this.#$(((e,t,n)=>{const r=La(e);if(!r||n===Number.POSITIVE_INFINITY)return e;let o,i=0;const s=Na.get(r),a=r.pipeThrough(new TransformStream({transform(e,r){if(i+=e.byteLength,i>n)throw o=new Ea(t,n),o;r.enqueue(e)}}));return ja(new Response(a,e),e,()=>o??s?.())})(e,t,this.#s.maxResponseSize),t)}#z(e){return this.#s.onUploadProgress&&la&&e.body?Oa(e,this.#s.onUploadProgress,this.#s.body):e}},Mc=(e,t)=>{try{return Uc.create(e,t())}catch(n){const e=Promise.reject(n);for(const t of _a())e[t]=async()=>e;return e}},qc=e=>{const t=(t,n)=>Mc(t,()=>qa(e,n));for(const n of ma)t[n]=(t,r)=>Mc(t,()=>qa(e,r,{method:n}));return t.create=e=>qc(qa(e)),t.extend=t=>("function"==typeof t&&(t=t(qa(Wa(e)))),qc(qa(e,t))),t.stop=ba,t.retry=xa,t},Bc=qc(),Fc=/* @__PURE__ */new Map,zc=Bc.create({retry:{limit:3,methods:["get","put","head","delete","options","trace"],statusCodes:[408,429,500,502,503,504]},headers:{Accept:"application/json"},hooks:{beforeRequest:[({request:e})=>{if("GET"!==e.method)return;const t=Fc.get(e.url);t&&(t.etag&&e.headers.set("If-None-Match",t.etag),t.lastModified&&e.headers.set("If-Modified-Since",t.lastModified))}],afterResponse:[async({request:e,response:t})=>{if("GET"!==e.method)return t;if(304===t.status){const t=Fc.get(e.url);if(t)return new Response(t.body,{status:200,headers:{"Content-Type":"application/json"}})}if(t.ok){const n=t.headers.get("ETag")??void 0,r=t.headers.get("Last-Modified")??void 0;if(void 0!==n||void 0!==r){const o=await t.clone().text();Fc.set(e.url,{etag:n,lastModified:r,body:o})}}return t}]}});async function Hc({apiUrl:e,locale:t,portalCode:n,params:r,signal:o}){const i=function({apiUrl:e,portalCode:t,params:n}){const r=new URL("/portal_api/v1/accommodations",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,...n}).toString(),r.toString()}({apiUrl:e,portalCode:n,params:r});try{return await zc.get(i,{headers:{locale:t},signal:o}).json()}catch(s){if(s instanceof Xs)throw new Error(`Search request failed (${s.response.status})`);throw s}}function Yc(e){const t=Object.entries(e).filter(([e,t])=>/^category_\d+$/.test(e)&&t).map(([,e])=>Number(e));return[...new Set([...e.properties||[],...t].map(Number).filter(Number.isFinite))].sort((e,t)=>e-t)}function Wc(e,t,n){const r=Number(n);r&&(e[t]=String(r))}var Jc=/^\d{4}-\d{2}-\d{2}$/,Vc=/^\d{1,10}$/,Kc="\\|[\\p{L}\\p{M}\\d '’.()-]{1,100}",Gc=new RegExp(`^\\d{1,10}${Kc}$`,"u"),Xc=new RegExp(`^\\d{1,10}${Kc}${Kc}$`,"u");function Qc(e){return e&&Jc.test(e)?e:void 0}function Zc(e){return"number"==typeof e?Number.isSafeInteger(e)&&e>=0:"string"==typeof e&&Vc.test(e)}function eu(e){return t=>"string"==typeof t&&e.test(t)}var tu={countries:{format:Zc,list:!0},regions:{format:eu(Gc),list:!0},cities:{format:eu(Xc),list:!0},persons_max:{format:Zc,list:!1},bedrooms_min:{format:Zc,list:!1},bathrooms_min:{format:Zc,list:!1},weekprice_max:{format:Zc,list:!1}};function nu(e,{format:t,list:n}){if(t(e))return e;if(!n||!Array.isArray(e)||e.length>50)return;const r=e.filter(t);return r.length>0?r:void 0}function ru(e,t){const n=parseInt(String(e.persons_min??""),10),r=function(e){const t={};for(const[r,o]of Object.entries(tu)){const n=nu(e[r],o);void 0!==n&&(t[r]=n)}const n=Yc(e).filter(Zc);return n.length>0&&n.length<=50&&(t.properties=n),t}(e);return{arrival:Qc(e.arrival_date),departure:Qc(e.departure_date),persons:n>0?n:void 0,filters:Object.keys(r).length>0?r:void 0,result_count:t}}var ou=/* @__PURE__ */new Set;function iu(e){return e.isConnected&&"true"===e.getAttribute("data-consent")}function su(){return"undefined"!=typeof window&&!0===window.bukazuConsent||[...ou,...document.querySelectorAll(".bukazu-app, #bukazu-app")].some(iu)}var au="https://api.bukazu.com/tracking",cu="bu_portal_session",uu=/^[A-Za-z0-9_.-]{1,64}$/,lu="",du=null,hu=!1,pu=null;function fu(){return su()&&wu(cu)||lu}function mu(e){return"string"==typeof e&&uu.test(e)}async function gu(e){try{!fu()&&pu&&await pu;const t=async function(e){const t=su(),n=fu(),r={...e,interaction_info:_u(e.interaction_info),url:window.location.href,consented:t};n&&(r.session_identifier=n);const o=t&&!hu&&!wu(cu);o&&(r.attribution=function(){if(du)return du;const e=new URLSearchParams(window.location.search),t={landing_path:window.location.pathname,device_class:yu(window.innerWidth)},n=function(){const e=bu();return e===window.location.host?"":e}();n&&(t.referrer_host=n);for(const r of["utm_source","utm_medium","utm_campaign"]){const n=e.get(r);n&&(t[r]=n)}return du=t,t}(),hu=!0);let i="";try{i=(await zc.post(au,{json:r}).text()).trim()}finally{!i&&o&&(hu=!1)}if(!i)return;lu=i,su()&&function(e,t,n){const r=/* @__PURE__ */new Date;r.setTime(r.getTime()+24*n*60*60*1e3),document.cookie=`${e}=${t};expires=${r.toUTCString()};path=/;SameSite=Lax;Secure`}(cu,i,14)}(e);if(!fu()&&!pu){const e=()=>{pu=null};pu=t.then(e,e)}await t}catch{}}function _u(e){const t={};for(const[n,r]of Object.entries(e))null!=r&&""!==r&&(t[n]=r);return t}function yu(e){return e<768?"mobile":e<1024?"tablet":"desktop"}function bu(){try{return document.referrer?new URL(document.referrer).host:""}catch{return""}}function vu(){const e=bu();return e?e===window.location.host?"search":"external":"direct"}function wu(e){let t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "==e.charAt(0);)e=e.substring(1);if(0==e.indexOf(t))return e.substring(t.length,e.length)}return""}function xu({filters:e,PortalSite:t,limit:n,skip:r,onPageChange:a,activePage:l,viewMode:f,onViewModeChange:m}){const{portalCode:g,apiUrl:_,locale:y}=o(zs),{currency:b}=Vs(),[v,w]=u({status:"loading"}),x=JSON.stringify(function(e,{limit:t,skip:n,currency:r}){const o={limit:String(t),skip:String(n)};r&&(o.currency=r),e.countries&&(o.country_id=String(e.countries)),e.regions&&(o.region_id=String(e.regions)),e.cities&&(o.city_id=String(e.cities)),e.extra_search&&(o.extra_search=e.extra_search),Wc(o,"persons_min",e.persons_min),Wc(o,"persons_max",e.persons_max),Wc(o,"bedrooms_min",e.bedrooms_min),Wc(o,"bathrooms_min",e.bathrooms_min),Wc(o,"weekprice_max",e.weekprice_max);const i=Yc(e);return i.length>0&&(o.properties=i.join(",")),e.arrival_date&&(o.arrival_date=e.arrival_date,e.departure_date?(o.starts_at=e.arrival_date,o.ends_at=e.departure_date,Wc(o,"no_nights_min",Se(le(e.departure_date),le(e.arrival_date)))):o.no_nights_min="1"),o}(e,{limit:n,skip:r,currency:b})),k=s(()=>JSON.parse(x),[x]),S=JSON.stringify(e),C=c(e);C.current=e;const E=c(null),T=c(null),N=c(null),R=()=>{const e=T.current;null!==e&&null!==N.current&&(T.current=null,E.current=e,gu({portal_code:g,locale:y,interaction_type:"search",interaction_info:ru(C.current,N.current)}))};if(i(()=>{if(E.current===S)return;const e=setTimeout(()=>{T.current=S,R()},1e3);return()=>{clearTimeout(e),T.current=null}},[S,g,y]),i(()=>{const e=new AbortController;return N.current=null,w({status:"loading"}),Hc({apiUrl:_,locale:y,portalCode:g,params:k,signal:e.signal}).then(t=>{e.signal.aborted||(w({status:"ready",response:t}),N.current=t.meta.total_count,R())}).catch(t=>{e.signal.aborted||w({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error("A search request failed")})}),()=>{e.abort()}},[_,y,g,k]),"loading"===v.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===v.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(Ms,{errors:v.error})});const{items:A,meta:$}=v.response,P=f??t.options.filtersForm.mode,I=/* @__PURE__ */d(ze,{totalCount:$.total_count,activePage:l,limit:n,onPageChange:a});/* @__PURE__ */
36
+ /* @__PURE__ */d("rect",{x:"11",y:"11",width:"6",height:"6",rx:"1"})]}),Ye=({size:e=18})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M3 5h14M3 10h14M3 15h14"})});function Ve({mode:e,onChange:t}){/* @__PURE__ */
37
+ return h("div",{className:"bu-view-toggle",role:"group","aria-label":ne("view_mode"),children:[/* @__PURE__ */d("button",{type:"button","aria-pressed":"grid"===e,"aria-label":ne("grid_view"),onClick:()=>t("grid"),children:/* @__PURE__ */d(We,{})}),/* @__PURE__ */d("button",{type:"button","aria-pressed":"list"===e,"aria-label":ne("list_view"),onClick:()=>t("list"),children:/* @__PURE__ */d(Ye,{})})]})}var Je="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ke=globalThis,Ge="10.75.0";function Xe(){return Qe(Ke),Ke}function Qe(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"10.75.0",t[Ge]=t["10.75.0"]||{}}function Ze(e,t,n=Ke){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ge]=r["10.75.0"]||{};return o[e]||(o[e]=t())}var et=["debug","info","warn","error","log","assert","trace"],tt={};function nt(e){if(!("console"in Ke))return e();const t=Ke.console,n={},r=Object.keys(tt);r.forEach(e=>{const r=tt[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function rt(){return st().enabled}function ot(e,...t){Je&&rt()&&nt(()=>{Ke.console[e](`Sentry Logger [${e}]:`,...t)})}function st(){return Je?Ze("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var it={enable:function(){st().enabled=!0},disable:function(){st().enabled=!1},isEnabled:rt,log:function(...e){ot("log",...e)},warn:function(...e){ot("warn",...e)},error:function(...e){ot("error",...e)}},at=/\(error: (.*)\)/,ct=/captureMessage|captureException/;function ut(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const o=[],s=e.split("\n");for(let i=n;i<s.length;i++){let e=s[i];e.length>1024&&(e=e.slice(0,1024));const n=at.test(e)?e.replace(at,"$1"):e;if(!n.includes("Error: ")){for(const e of t){const t=e(n);if(t){o.push(t);break}}if(o.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(lt(t).function||"")&&t.pop();t.reverse(),ct.test(lt(t).function||"")&&(t.pop(),ct.test(lt(t).function||"")&&t.pop());return t.slice(0,50).map(e=>({...e,filename:e.filename||lt(t).filename,function:e.function||"?"}))}(o.slice(r))}}function lt(e){return e[e.length-1]||{}}var dt="<anonymous>";function ht(e){try{return e&&"function"==typeof e&&e.name||dt}catch{return dt}}function pt(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}var ft={},mt={};function gt(e,t){return ft[e]=ft[e]||[],ft[e].push(t),()=>{const n=ft[e];if(n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}}function _t(e,t){if(!mt[e]){mt[e]=!0;try{t()}catch(zd){Je&&it.error(`Error while instrumenting ${e}`,zd)}}}function yt(e,t){const n=e&&ft[e];if(n)for(const r of n)try{r(t)}catch(zd){Je&&it.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ht(r)}\nError:`,zd)}}var bt=null;function vt(){bt=Ke.onerror,Ke.onerror=function(e,t,n,r,o){return yt("error",{column:r,error:o,line:n,msg:e,url:t}),!!bt&&bt.apply(this,arguments)},Ke.onerror.__SENTRY_INSTRUMENTED__=!0}var wt=null;function kt(){wt=Ke.onunhandledrejection,Ke.onunhandledrejection=function(e){return yt("unhandledrejection",e),!wt||wt.apply(this,arguments)},Ke.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var xt,St=Object.prototype.toString;function Ct(e){switch(St.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Lt(e,Error)}}function Et(e,t){return St.call(e)===`[object ${t}]`}function Nt(e){return Et(e,"ErrorEvent")}function Tt(e){return Et(e,"DOMError")}function Rt(e){return Et(e,"String")}function At(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Dt(e){return null===e||At(e)||"object"!=typeof e&&"function"!=typeof e}function Pt(e){return Et(e,"Object")}function $t(e){return"object"==typeof e&&null!==e}function It(e){return"undefined"!=typeof Event&&Lt(e,Event)}function jt(e){return Boolean(e?.then&&"function"==typeof e.then)}function Lt(e,t){try{return e instanceof t}catch{return!1}}function Mt(e){return"undefined"!=typeof Request&&Lt(e,Request)}function Ot(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const o=n(r);"function"==typeof o&&qt(o,r);try{e[t]=o}catch{Je&&it.log(`Failed to replace method "${t}" in object`,e)}}function Ut(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Je&&it.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function qt(e,t){try{e.prototype=t.prototype=t.prototype||{},Ut(e,"__sentry_original__",t)}catch{}}function Bt(e){return e.__sentry_original__}function Ft(e){if(Ct(e))return{message:e.message,name:e.name,stack:e.stack,...zt(e)};if(It(e)){const{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...zt(e)}}return e}function zt(e){return $t(e)?Object.fromEntries(Object.entries(e)):{}}function Ht(e){if(void 0!==xt)return xt?xt(e):e();const t=/* @__PURE__ */Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=Ke;return t in n&&"function"==typeof n[t]?(xt=n[t])(e):(xt=null,e())}function Wt(){return Ht(()=>Math.random())}function Yt(){return Ht(()=>Date.now())}var Vt,Jt,Kt=/* @__PURE__ */Symbol.for("sentry.skipNormalization"),Gt=/* @__PURE__ */Symbol.for("sentry.overrideNormalizationDepth");function Xt(e,t=100,n=1/0){try{return Zt("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Qt(e,t=3,n=102400){const r=Xt(e,t);return o=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(o))>n?Qt(e,t-1,n):r;var o}function Zt(e,t,n=1/0,r=1/0,o=function(){const e=/* @__PURE__ */new WeakSet;function t(t){return!!e.has(t)||(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}()){const[s,i]=o;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=en(e,t);if(!a.startsWith("[object "))return a;if(function(e){return Boolean(e[Kt])}(t))return t;const c=function(e){const t=e[Gt];return"number"==typeof t?t:void 0}(t),u=void 0!==c?c:n;if(0===u)return a.replace("object ","");if(s(t))return"[Circular ~]";const l=t;if(l&&"function"==typeof l.toJSON)try{return Zt("",l.toJSON(),u-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const p=Ft(t);for(const f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(h>=r){d[f]="[MaxProperties ~]";break}const e=p[f];d[f]=Zt(f,e,u-1,r,o),h++}return i(t),d}function en(e,t){try{if(Vt){const e=Vt(t);if(e)return e}return"undefined"!=typeof global&&t===global?"[Global]":"number"!=typeof t||Number.isFinite(t)?"function"==typeof t?`[Function: ${ht(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t)}]`:`[${t}]`}catch(n){return`**non-serializable** (${n})`}}function tn(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function nn(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];Dt(t)?n.push(String(t)):t instanceof Error?n.push(t.message?`${t.name}: ${t.message}`:t.name):n.push(en(0,t))}return n.join(t)}function rn(e,t,n=!1){return!!Rt(e)&&(Et(t,"RegExp")?t.test(e):Rt(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function on(e,t=[],n=!1){for(const r of t)if(rn(e,r,n))return!0;return!1}function sn(e=function(){const e=Ke;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return Ht(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Jt||(Jt="10000000100040008000100000000000"),Jt.replace(/[018]/g,e=>(e^(16*Wt()&15)>>e/4).toString(16))}function an(e){return e.exception?.values?.[0]}function cn(e){const{message:t,event_id:n}=e;if(t)return t;const r=an(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function un(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function ln(e,t){const n=an(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function dn(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Ut(e,"__sentry_captured__",!0)}catch{}return!1}var hn;function pn(){return Yt()/1e3}function fn(){return(hn??(hn=function(){const{performance:e}=Ke;if(!e?.now||!e.timeOrigin)return pn;const t=e.timeOrigin;return()=>(t+Ht(()=>e.now()))/1e3}()))()}function mn(e){const t=fn(),n={sid:sn(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:/* @__PURE__ */new Date(1e3*e.started).toISOString(),timestamp:/* @__PURE__ */new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&gn(n,e),n}function gn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||fn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:sn()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function _n(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=_n(r[o],t[o],n-1));return r}function yn(){return sn()}function bn(){return sn().substring(16)}function vn(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}var wn="_sentrySpan";function kn(e,t){t?Ut(e,wn,function(e){try{const t=Ke.WeakRef;if("function"==typeof t)return new t(e)}catch{}return e}(t)):delete e[wn]}function xn(e){return vn(e[wn])}var Sn=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:yn(),sampleRand:Wt()}}clone(){const t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,kn(t,xn(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&gn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,{tags:r,attributes:o,extra:s,user:i,contexts:a,level:c,fingerprint:u=[],propagationContext:l,conversationId:d}=(n instanceof e?n.getScopeData():Pt(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...o},this._extra={...this._extra,...s},this._contexts={...this._contexts,...a},i&&Object.keys(i).length&&(this._user=i),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,kn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:yn(),sampleRand:Wt()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:pn(),...e,message:e.message?tn(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:xn(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=_n(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||sn();if(!this._client)return Je&&it.warn("No client configured on scope - will not capture exception!"),n;const r=/* @__PURE__ */new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||sn();if(!this._client)return Je&&it.warn("No client configured on scope - will not capture message!"),r;const o=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||sn();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(Je&&it.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};var Cn=e=>e instanceof Promise&&!e[En],En=/* @__PURE__ */Symbol("chained PromiseLike"),Nn=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];"function"==typeof o?Object.defineProperty(t,r,{value:(...t)=>o.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[En]:!0}),t},Tn=class{constructor(e,t){let n,r;n=e||new Sn,r=t||new Sn,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(zd){throw this._popScope(),zd}return jt(n)?((e,t,n)=>{const r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Cn(r)&&Cn(e)?r:Nn(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function Rn(){const e=Qe(Xe());return e.stack=e.stack||new Tn(Ze("defaultCurrentScope",()=>new Sn),Ze("defaultIsolationScope",()=>new Sn))}function An(e){return Rn().withScope(e)}function Dn(e,t){const n=Rn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Pn(e){return Rn().withScope(()=>e(Rn().getIsolationScope()))}function $n(e){const t=Qe(e);return t.acs?t.acs:{withIsolationScope:Pn,withScope:An,withSetScope:Dn,withSetIsolationScope:(e,t)=>Pn(t),getCurrentScope:()=>Rn().getScope(),getIsolationScope:()=>Rn().getIsolationScope()}}function In(e,t){const{value:n,unit:r}="object"==typeof(o=e)&&null!=o&&!Array.isArray(o)&&Object.keys(o).includes("value")?e:{value:e,unit:void 0};var o;const s=function(e){if(Array.isArray(e))return{value:e,type:"array"};const t="string"==typeof e?"string":"boolean"==typeof e?"boolean":"number"!=typeof e||Number.isNaN(e)?null:Number.isInteger(e)?"integer":"double";if(t)return{value:e,type:t}}(n),i=r&&"string"==typeof r?{unit:r}:{};if(s)return{...s,...i};if(!t||"skip-undefined"===t&&void 0===n)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...i}}function jn(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const e=In(o,t);e&&(n[r]=e)}return n}function Ln(){return $n(Xe()).getCurrentScope()}function Mn(){return $n(Xe()).getIsolationScope()}function On(){return Ln().getClient()}function Un(e){const t=void 0;const{traceId:n,parentSpanId:r,propagationSpanId:o}=e.getPropagationContext(),s={trace_id:n,span_id:o||bn()};return r&&(s.parent_span_id=r),s}function qn(e){const t=e;return{scope:t._sentryScope,isolationScope:vn(t._sentryIsolationScope)}}function Bn(e){const t=function(e){if(!e||!Rt(e)&&!Array.isArray(e))return;return Array.isArray(e)?e.reduce((e,t)=>{const n=Fn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Fn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith("sentry-")){e[t.slice(7)]=n}return e},{});return Object.keys(n).length>0?n:void 0}function Fn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var zn=/^o(\d+)\./,Hn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Wn(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}function Yn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Vn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){return e.match(zn)?.[1]}(n)),r}function Jn(e){const t="string"==typeof e?function(e){const t=Hn.exec(e);if(!t)return void nt(()=>{});const[n,r,o="",s="",i="",a=""]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Yn({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}(e):Yn(e);if(t&&function(e){if(!Je)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(it.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(it.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(it.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(it.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var Kn=!1;function Gn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:er(e).parent_span_id,s=qn(e).scope;return{parent_span_id:o,span_id:r?s?.getPropagationContext().propagationSpanId||bn():t,trace_id:n}}function Xn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:o})=>({span_id:e,trace_id:t,sampled:1===n,attributes:o,...r})):void 0}function Qn(e){return"number"==typeof e?Zn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Zn(e.getTime()):fn()}function Zn(e){return e>9999999999?e/1e3:e}function er(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:tr(e),start_timestamp:Qn(o),timestamp:Qn(i)||void 0,status:nr(a),op:r["sentry.op"],origin:r["sentry.origin"],links:Xn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function tr(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function nr(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}var rr=function(e){return e._sentryRootSpan||e};function or(){Kn||(nt(()=>{}),Kn=!0)}function sr(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=e||On()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}function ir(e){it.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function ar(e,t){if(!t?.length)return!1;for(const n of t){if(lr(n)){if(e.description&&rn(e.description,n))return Je&&ir(e),!0;continue}const t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;const r=!n.name||e.description&&rn(e.description,n.name),o=!n.op||e.op&&rn(e.op,n.op),s=!n.attributes||Object.entries(n.attributes).every(([t,n])=>cr(e.attributes?.[t],n));if(r&&o&&s)return Je&&ir(e),!0}return!1}function cr(e,t){return"string"==typeof e&&("string"==typeof t||t instanceof RegExp)?rn(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function ur(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function lr(e){return"string"==typeof e||e instanceof RegExp}var dr=/* @__PURE__ */Symbol.for("sentry.nonRecordingSpan");var hr="production";function pr(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||"production",release:n.release,public_key:r,trace_id:e,org_id:Vn(t)};return t.emit("createDsc",o),o}function fr(e,t){const n=t.getPropagationContext();return n.dsc||pr(n.traceId,e)}function mr(e){const t=On();if(!t)return{};const n=rr(e),r=er(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o["sentry.sample_rate"]??o["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof i&&"string"!=typeof i||(e.sample_rate=`${i}`),e}const c=n._frozenDsc;if(c)return a(c);const u=function(e){return!!e&&!0===e[dr]}(n),l=u&&"ignored"===n.dropReason;if(u&&(!sr(t.getOptions())||l)){const e=qn(n).scope;if(e){const n={...fr(t,e)};return l&&(n.sampled="false"),a(n)}}const d=s?.get("sentry.dsc"),h=d&&Bn(d);if(h)return a(h);const p=pr(e.spanContext().traceId,t),f=o["sentry.source"]??o["sentry.segment.name.source"],m=r.description;return"url"!==f&&m&&(p.transaction=m),sr()&&(p.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),p.sample_rand=s?.get("sentry.sample_rand")??qn(n).scope?.getPropagationContext().sampleRand.toString()),a(p),t.emit("createDsc",p,n),p}function gr(e,t=[]){return[e,t]}function _r(e,t){const[n,r]=e;return[n,[...r,t]]}function yr(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function br(e){const t=Qe(Ke);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function vr(e){const[t,n]=e;let r=JSON.stringify(t);function o(e){"string"==typeof r?r="string"==typeof e?r+e:[br(r),e]:r.push("string"==typeof e?br(e):e)}for(const s of n){const[e,t]=s;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(Xt(t))}o(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}(r)}function wr(e){const t="string"==typeof e.data?br(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var kr={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function xr(e){return function(e){return e in kr}(e)?kr[e]:e}function Sr(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Cr(e,t,n,r){const o=Sr(n),s=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const i=function(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(Yt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Wn(r)},...o&&{trace:o}}}(e,o,r,t);return delete e.sdkProcessingMetadata,gr(i,[[{type:s},e]])}function Er(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;!function(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra});Object.keys(r).length&&(e.tags={...r,...e.tags});Object.keys(o).length&&(e.user={...o,...e.user});Object.keys(s).length&&(e.contexts={...s,...e.contexts});i&&(e.level=i);a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:Gn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:mr(t),...e.sdkProcessingMetadata};const n=rr(t),r=er(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,o),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,s)}function Nr(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:d,attachments:h,propagationContext:p,transactionName:f,span:m}=t;Tr(e,"extra",n),Tr(e,"tags",r),Tr(e,"attributes",o),Tr(e,"user",s),Tr(e,"contexts",i),e.sdkProcessingMetadata=_n(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...p}}function Tr(e,t,n){e[t]=_n(e[t],n,1)}function Rr(e,t){const n=Ze("globalScope",()=>new Sn).getScopeData();return e&&Nr(n,e.getScopeData()),t&&Nr(n,t.getScopeData()),n}var Ar="user_agent.original";function Dr(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([e,t])=>{null==t||e in n||(n[e]=t)})}function Pr(e){return new Or(t=>{t(e)})}function $r(e){return new Or((t,n)=>{n(e)})}var Ir,jr,Lr,Mr,Or=class e{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(t)try{e(t(n))}catch(zd){r(zd)}else e(n)},t=>{if(n)try{e(n(t))}catch(zd){r(zd)}else r(t)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,o;return this.then(e=>{o=!1,r=e,t&&t()},e=>{o=!0,r=e,t&&t()}).then(()=>{o?n(r):e(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(jt(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(zd){r(zd)}}};function Ur(e,t,n,r=0){try{const o=qr(t,n,e,r);return jt(o)?o:Pr(o)}catch(o){return $r(o)}}function qr(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return Je&&null===s&&it.log(`Event processor "${o.id||"?"}" dropped event`),jt(s)?s.then(e=>qr(e,t,n,r+1)):qr(s,t,n,r+1)}function Br(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||sn(),timestamp:t.timestamp||pn()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||"production",!e.release&&r&&(e.release=r);!e.dist&&o&&(e.dist=o);const i=e.request;i?.url&&s&&(i.url=tn(i.url,s));s&&e.exception?.values?.forEach(e=>{e.value&&(e.value=tn(e.value,s))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),o&&o.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=Ke._sentryDebugIds,n=Ke._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Mr&&r.length===jr&&o.length===Lr)return Mr;jr=r.length,Lr=o.length,Mr={},Ir||(Ir={});const s=(t,n)=>{for(const r of t){const t=n[r],o=Ir?.[r];if(o&&Mr&&t)Mr[o[0]]=t,Ir&&(Ir[r]=[o[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const o=n[e]?.filename;if(o&&Mr&&Ir){Mr[o]=t,Ir[r]=[o,t];break}}}}};return t&&s(r,t),n&&s(o,n),Mr}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const l=function(e,t){if(!t)return e;const n=e?e.clone():new Sn;return n.update(t),n}(r,n.captureContext);n.mechanism&&ln(c,n.mechanism);const d=o?o.getEventProcessors():[],h=Rr(s,l),p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),Er(c,h);const f=[...d,...h.eventProcessors];return(n.data&&!0===n.data.__sentry__?Pr(c):Ur(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof i&&i>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Xt(e.data,t,n)}}))},...e.user&&{user:Xt(e.user,t,n)},...e.contexts&&{contexts:Xt(e.contexts,t,n)},...e.extra&&{extra:Xt(e.extra,t,n)}};e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Xt(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Xt(e.data,t,n)}})));e.contexts?.flags&&r.contexts&&(r.contexts.flags=Xt(e.contexts.flags,3,n));return r}(e,i,a):e))}function Fr(e){if(e)return function(e){return e instanceof Sn||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>zr.includes(e))}(e)?{captureContext:e}:e}var zr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Hr(e,t){return Ln().captureException(e,Fr(t))}function Wr(e,t){return Ln().captureEvent(e,t)}function Yr(e,t){Mn().setTag(e,t)}function Vr(e){const t=Mn(),{user:n}=Rr(t,Ln()),{userAgent:r}=Ke.navigator||{},o=mn({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return"ok"===s?.status&&gn(s,{status:"exited"}),Jr(),t.setSession(o),o}function Jr(){const e=Mn(),t=Ln().getSession()||e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),gn(e,n)}(t),Kr(),e.setSession()}function Kr(){const e=Mn(),t=On(),n=e.getSession();n&&t&&t.captureSession(n)}function Gr(e=!1){e?Jr():Kr()}function Xr(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}function Qr(e,t,n){return t||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}var Zr=[];function eo(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function to(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function no(e,t,n){if(n[t.name])Je&&it.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Zr.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Zr.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),Je&&it.log(`Integration installed: ${t.name}`)}}function ro(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function oo(){return"undefined"!=typeof window&&(!ro()||"renderer"===Ke.process?.type)}function so(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...oo()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function io(e,t){const n=t??function(e){return ao().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Wn(r)),gr(s,[so(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);ao().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function ao(){return Ze("clientToLogBufferMap",()=>/* @__PURE__ */new WeakMap)}function co(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...oo()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function uo(e,t){const n=t??function(e){return lo().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Wn(r)),gr(s,[co(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);lo().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function lo(){return Ze("clientToMetricBufferMap",()=>/* @__PURE__ */new WeakMap)}function ho(e){const t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:e.status&&"ok"!==e.status&&"cancelled"!==e.status?"error":"ok",is_segment:!1,attributes:{...e.data},links:e.links};return n=t,{...n,attributes:jn(n.attributes),links:n.links?.map(e=>({...e,attributes:jn(e.attributes)}))};var n}var po=/* @__PURE__ */Symbol.for("SentryBufferFullError");function fo(e=100){const t=/* @__PURE__ */new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return $r(po);const o=r();return t.add(o),o.then(()=>n(o),()=>n(o)),o},drain:function(e){if(!t.size)return Pr(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>Xr(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function mo(e,{statusCode:t,headers:n},r=Yt()){const o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[e,t,,,n]=a.split(":",5),s=parseInt(e,10),i=1e3*(isNaN(s)?60:s);if(t)for(const a of t.split(";"))"metric_bucket"===a&&n&&!n.split(";").includes("custom")||(o[a]=r+i);else o.all=r+i}else i?o.all=r+function(e,t=Yt()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(i,r):429===t&&(o.all=r+6e4);return o}function go(e,t,n=fo(e.bufferSize||64)){let r={};return{send:function(o){const s=[];if(yr(o,(t,n)=>{const o=xr(n);!function(e,t,n=Yt()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?s.push(t):e.recordDroppedEvent("ratelimit_backoff",o)}),0===s.length)return Promise.resolve({});const i=gr(o[0],s),a=t=>{!function(e,t){return yr(e,(e,n)=>t.includes(n))}(i,["client_report"])?yr(i,(n,r)=>{e.recordDroppedEvent(t,xr(r))}):Je&&it.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:vr(i)}).then(e=>413===e.statusCode?(Je&&it.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(Je&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&it.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=mo(r,e),e),e=>{throw a("network_error"),Je&&it.error("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===po)return Je&&it.error("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function _o(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}var yo=["forwarded","-ip","remote-","via","-user"];var bo={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function vo(e,t){return void 0===e?{...t.httpHeaders}:"boolean"==typeof(n=e)||"allow"in n||"deny"in n?{request:e,response:e}:{request:e.request??t.httpHeaders.request,response:e.response??t.httpHeaders.response};var n}function wo(e){const t=null!=e.dataCollection?bo:!0===e.sendDefaultPii?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:yo},httpHeaders:{request:{deny:yo},response:{deny:yo}},httpBodies:[],urlQueryParams:{deny:yo},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7};const n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:vo(n.httpHeaders,t),httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var ko="Not capturing exception because it's already been captured.",xo="Discarded session because of missing or non-string release",So=/* @__PURE__ */Symbol.for("SentryInternalError"),Co=/* @__PURE__ */Symbol.for("SentryDoNotSendEventError");function Eo(e){return{message:e,[So]:!0}}function No(e){return{message:e,[Co]:!0}}function To(e){return $t(e)&&So in e}function Ro(e){return $t(e)&&Co in e}function Ao(e,t,n,r,o){let s,i=0,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,t=>{if(i+=r(t),i>=8e5)o(e);else if(!a){const t=e.getOptions()._flushInterval??5e3;t>0&&(a=!0,s=Xr(setTimeout(()=>{o(e)},t)))}}),e.on("flush",()=>{o(e)})}var Do=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=fo(e.transportOptions?.bufferSize??64),this._dataCollection=wo(e),e.dsn?this._dsn=Jn(e.dsn):Je&&it.warn("No DSN provided, client will not send events."),this._dsn){const t=Qr(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&Ao(this,"afterCaptureLog","flushLogs",Lo,io),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Ao(this,"afterCaptureMetric","flushMetrics",jo,uo)}captureException(e,t,n){const r=sn();if(dn(e))return Je&&it.log(ko),r;const o={event_id:r,...t};return this._process(()=>this.eventFromException(e,o).then(e=>this._captureEvent(e,o,n)).then(e=>e),"error"),o.event_id}captureMessage(e,t,n,r){const o={event_id:sn(),...n},s=At(e)?e:String(e),i=Dt(e),a=i?this.eventFromMessage(s,t,o):this.eventFromException(e,o);return this._process(()=>a.then(e=>this._captureEvent(e,o,r)),i?"unknown":"error"),o.event_id}captureEvent(e,t,n){const r=sn();if(t?.originalException&&dn(t.originalException))return Je&&it.log(ko),r;const o={event_id:r,...t},s=e.sdkProcessingMetadata||{},i=s.capturedSpanScope,a=s.capturedSpanIsolationScope,c=Po(e.type);return this._process(()=>this._captureEvent(e,o,i||n,a),c),o.event_id}captureSession(e){this.sendSession(e),gn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(this.emit("flush"),!t)return!0;const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),no(this,e,this._integrations),t||to(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);const n=function(e,t){if("transaction"!==e.type||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!1===t.getOptions().streamGenAiSpans||function(e){return"stream"===e.getOptions().traceLifecycle}(t))return;const n=[],r=[];for(const s of e.spans)s.op?.startsWith("gen_ai.")?n.push(ho(s)):r.push(s);if(0===n.length)return;e.spans=r;const o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...oo()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}(e,this);let r=Cr(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])r=_r(r,wr(o));n&&(r=_r(r,n)),this.sendEnvelope(r).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=hr}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(Je&&it.warn(xo));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(Je&&it.warn(xo));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const o=Sr(n);return gr({sent_at:new Date(Yt()).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Wn(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;Je&&it.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||/* @__PURE__ */new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(t){return Je&&it.error("Error while sending envelope:",t),{}}return Je&&it.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&no(e,t,n)}),n}(this,e),to(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const o=t.exception?.values;if(o){r=!0,n=!1;for(const e of o)if(!1===e.mechanism?.handled){n=!0;break}}const s="ok"===e.status;(s&&0===e.errors||s&&n)&&(gn(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const o=this.getOptions(),s=this.getIntegrationNames();return!t.integrations&&s.length&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Br(o,e,t,n,this,r).then(e=>(null===e||(this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...Un(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:fr(this,n),...e.sdkProcessingMetadata}),e))}_captureEvent(e,t={},n=Ln(),r=Mn()){return Je&&$o(e)&&it.log(`Captured error event \`${_o(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{Je&&(Ro(e)?it.log(e.message):To(e)?it.warn(e.message):it.warn(e))})}_processEvent(e,t,n,r){const o=this.getOptions(),{sampleRate:s}=o,i=Io(e),a=$o(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===s?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(s),l=Po(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l),No("An event processor returned `null`, will not send event.");return!0===t.data?.__sentry__?e:function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(jt(e))return e.then(e=>{if(!Pt(e)&&null!==e)throw Eo(n);return e},e=>{throw Eo(`${t} rejected with ${e}`)});if(!Pt(e)&&null!==e)throw Eo(n);return e}(function(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=(c=t.beforeSendSpan,!(c&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan);var c;let u=n;if($o(u)&&o)return o(u,r);if(Io(u)){if(a||i){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.["sentry.profile_id"],exclusive_time:i?.["sentry.exclusive_time"],measurements:e.measurements,is_segment:!0}}(u);if(i?.length&&ar({description:t.description,op:t.op,attributes:t.data},i))return null;if(a){const e=a(t);e?u=_n(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{"sentry.profile_id":l.profile_id},...l.exclusive_time&&{"sentry.exclusive_time":l.exclusive_time}}}},measurements:l.measurements}):or()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(i?.length&&ar({description:e.description,op:e.op,attributes:e.data},i))ur(n,e);else if(a){const n=a(e);n?t.push(n):(or(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(s){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return s(u,r)}}var l;return u}(this,o,e,t),c)}).then(o=>{if(null===o){if(this.recordDroppedEvent("before_send",l),i){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw No(`${c} returned \`null\`, will not send event.`)}const d=n.getSession()||r.getSession();if(a&&d&&this._updateSessionFromEvent(d,o),a&&"number"==typeof u&&Wt()>u)throw this.recordDroppedEvent("sample_rate","error"),No(`Discarding event because it's not included in the random sample (sampling rate = ${s})`);if(i){const e=(o.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(o.spans?o.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const h=o.transaction_info;if(i&&h&&o.transaction!==e.transaction){const e="custom";o.transaction_info={...h,source:e}}return this.sendEvent(o,t),o}).then(null,e=>{if(Ro(e)||To(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),Eo(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===po&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){Je&&it.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(Je&&it.log("No outcomes to send"));if(!this._dsn)return void(Je&&it.log("No dsn provided, will not send outcomes"));Je&&it.log("Sending outcomes:",e);const t=(n=e,gr((r=this._options.tunnel&&Wn(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||pn(),discarded_events:n}]]));var n,r,o;this.sendEnvelope(t)}};function Po(e){return"replay_event"===e?"replay":e||"error"}function $o(e){return void 0===e.type}function Io(e){return"transaction"===e.type}function jo(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Mo(e.attributes)}function Lo(e){let t=0;return e.message&&(t+=2*e.message.length),t+Mo(e.attributes)}function Mo(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Oo(e[0]):Dt(e)?t+=Oo(e):t+=100}),t}function Oo(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Uo(e,t){!0===t.debug&&(Je?it.enable():nt(()=>{})),Ln().update(t.initialScope);const n=new e(t);return function(e){Ln().setClient(e)}(n),n.init(),n}function qo(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Bo(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}var Fo=100;function zo(e,t){const n=On(),r=Mn();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Fo}=n.getOptions();if(s<=0)return;const i={timestamp:pn(),...e},a=o?nt(()=>o(i,t)):i;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,s))}var Ho=/* @__PURE__ */new WeakMap,Wo=()=>({name:"FunctionToString",setupOnce(){const e=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=Bt(this);let r;try{Ho.has(On())&&void 0!==n&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){Ho.set(e,!0)}}),Yo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],Vo=(e={})=>{let t;return{name:"EventFilters",setup(n){t=Ko(e,n.getOptions())},processEvent:(n,r,o)=>(t||(t=Ko(e,o.getOptions())),function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&on(n,t)}(e,t.ignoreTransactions))return Je&&it.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${cn(e)}`),!0}else{if(function(e,t){return!!t?.length&&_o(e).some(e=>on(e,t))}(e,t.ignoreErrors))return Je&&it.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${cn(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return Je&&it.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${cn(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Go(e);return!!n&&on(n,t)}(e,t.denyUrls))return Je&&it.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${cn(e)}.\nUrl: ${Go(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Go(e);return!n||on(n,t)}(e,t.allowUrls))return Je&&it.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${cn(e)}.\nUrl: ${Go(e)}`),!0}return!1}(n,t)?null:n)}},Jo=(e={})=>({...Vo(e),name:"InboundFilters"});function Ko(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Yo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Go(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch{return Je&&it.error(`Cannot extract url for event ${cn(e)}`),null}}function Xo(e,t,n,r,o,s){if(!o.exception?.values||!s||!Ct(s.originalException))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=Qo(e,t,r,s.originalException,n,o.exception.values,i,0))}function Qo(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Ct(r[o])){es(i,a,r);const s=e(t,r[o]),u=c.length;ts(s,o,u,a),c=Qo(e,t,n,r[o],o,[s,...c],s,u)}return Zo(r)&&r.errors.forEach((s,u)=>{if(Ct(s)){es(i,a,r);const l=e(t,s),d=c.length;ts(l,`errors[${u}]`,d,a),c=Qo(e,t,n,s,o,[l,...c],l,d)}}),c}function Zo(e){return Array.isArray(e.errors)}function es(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Zo(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ts(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function ns(e){return function(e){return Ct(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var rs=/* @__PURE__ */new Set([]);var os=/* @__PURE__ */new Set;function ss(){"console"in Ke&&et.forEach(function(e){!os.has(e)&&e in Ke.console&&(os.add(e),Ot(Ke.console,e,function(t){return tt[e]=t,function(...t){const n=t[0],r=tt[e],o=rs.size&&"string"==typeof n&&on(n,rs);o||yt("console",{args:t,level:e}),(!o||Je&&it.isEnabled())&&r?.apply(Ke.console,t)}}))})}function is(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var as=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!us(e,t)&&!!cs(e,t))))}(e,t)||!!function(e,t){const n=ls(t),r=ls(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!us(e,t)&&!!cs(e,t)))}(e,t))}(t,e))return Je&&it.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function cs(e,t){let n=pt(e),r=pt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const e=r[o],t=n[o];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function us(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function ls(e){return e.exception?.values?.[0]}var ds=()=>({name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=Ln().getScopeData(),n=Mn().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:o}=er(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!o?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}});function hs(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}var ps=Ke;function fs(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ms(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in ps))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(fs(ps.fetch))return!0;let e=!1;const t=ps.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=fs(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Je&&it.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function gs(e,t){const n="fetch",r=gt(n,e);return _t(n,()=>function(e,t=!1){if(t&&!ms())return;Ot(Ke,"fetch",function(t){return function(...n){const r=/* @__PURE__ */new Error,{method:o,url:s}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:ys(t),method:_s(n,"method")?String(n.method).toUpperCase():Mt(t)&&_s(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:ys(t),method:_s(t,"method")?String(t.method).toUpperCase():"GET"}}(n),i={args:n,fetchData:{method:o,url:s},startTimestamp:1e3*fn(),virtualError:r,headers:bs(n)};return e||yt("fetch",{...i}),t.apply(Ke,n).then(async t=>(e?e(t):yt("fetch",{...i,endTimestamp:1e3*fn(),response:t}),t),e=>{yt("fetch",{...i,endTimestamp:1e3*fn(),error:e}),Ct(e)&&void 0===e.stack&&(e.stack=r.stack,Ut(e,"framesToPop",1));const t=On()?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==t&&Ct(e)&&"TypeError"===e.name&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const n=new URL(i.fetchData.url).host;"always"===t?e.message=`${e.message} (${n})`:Ut(e,"__sentry_fetch_url_host__",n)}catch{}throw e})}})}(void 0,t)),r}function _s(e,t){return $t(e)&&!!e[t]}function ys(e){return"string"==typeof e?e:e?_s(e,"url")?e.url:e.toString?e.toString():"":""}function bs(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Mt(t))return new Headers(t.headers)}catch{}}var vs=Ke;function ws(){try{return vs.document.location.href}catch{return""}}var ks=Ke,xs=0;function Ss(){return xs>0}function Cs(e,t={}){if("function"!=typeof e)return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const t=e.__sentry_wrapped__;return"function"==typeof t?t:e}if(Bt(e))return e}catch{return e}const n=function(...n){Ke._sentryWrappedDepth=(Ke._sentryWrappedDepth||0)+1;try{const r=n.map(e=>Cs(e,t));return e.apply(this,r)}catch(r){throw xs++,setTimeout(()=>{xs--}),function(...e){const t=$n(Xe());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{e.addEventProcessor(e=>(t.mechanism&&(un(e,void 0,void 0),ln(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),Hr(r)}),r}finally{Ke._sentryWrappedDepth=(Ke._sentryWrappedDepth||0)-1}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}qt(n,e),Ut(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function Es(){const e=ws(),{referrer:t}=ks.document||{},{userAgent:n}=ks.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function Ns(e,t){const n=As(e,t),r={type:$s(t),value:Is(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Ts(e,t,n,r){const o=On()?.getOptions().normalizeDepth,s=(i=t,Object.values(i).find(Ct));var i;const a={__serialized__:Qt(t,o)};if(s)return{exception:{values:[Ns(e,s)]},extra:a};const c={exception:{values:[{type:It(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Ms(t,{isUnhandledRejection:r})}]},extra:a};if(n){const t=As(e,n);t.length&&(c.exception.values[0].stacktrace={frames:t})}return c}function Rs(e,t){return{exception:{values:[Ns(e,t)]}}}function As(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Ds.test(e.message)?1:0}(t),o=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,o)}catch{}return[]}var Ds=/Minified React error #\d+;/i;function Ps(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function $s(e){const t=e?.name;return!t&&Ps(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Is(e){const t=e?.message;return Ps(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?ns(t.error):ns(e):"No error message"}function js(e,t,n,r,o){let s;if(Nt(t)&&t.error)return Rs(e,t.error);if(Tt(t)||Et(t,"DOMException")){const o=t;if("stack"in t){s=Rs(e,t);const o=s.exception?.values?.[0];if(r&&n&&o&&!o.stacktrace){const t=As(e,n);t.length&&(o.stacktrace={frames:t},ln(s,{synthetic:!0}))}}else{const t=o.name||(Tt(o)?"DOMError":"DOMException"),i=o.message?`${t}: ${o.message}`:t;s=Ls(e,i,n,r),un(s,i)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return Ct(t)?Rs(e,t):Pt(t)||It(t)?(s=Ts(e,t,n,o),ln(s,{synthetic:!0}),s):(s=Ls(e,t,n,r),un(s,`${t}`,void 0),ln(s,{synthetic:!0}),s)}function Ls(e,t,n,r){const o={};if(r&&n){const r=As(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]}),ln(o,{synthetic:!0})}if(At(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Ms(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(Ft(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return Nt(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:It(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}var Os=class extends Do{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:ks.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:Ge})),o.version=Ge)}(t,"browser",["browser"],ks.SENTRY_SDK_SOURCE||"npm"),super(t);const{userInfo:r}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:r?"auto":"never",...t._metadata.sdk.settings});const{sendClientReports:o}=this._options;ks.document&&ks.document.addEventListener("visibilitychange",()=>{"hidden"===ks.document.visibilityState&&(o&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),r&&this.on("beforeSendSession",Bo)}eventFromException(e,t){return function(e,t,n,r){const o=js(e,t,n?.syntheticException||void 0,r);return ln(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),Pr(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const s=Ls(e,t,r?.syntheticException||void 0,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),Pr(s)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}};var Us="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,qs=Ke;function Bs(e,t,n){qs.document&&qs.addEventListener(e,t,n)}function Fs(e,t,n){qs.document&&qs.removeEventListener(e,t,n)}var zs={};try{"undefined"!=typeof Node&&(zs.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),"undefined"!=typeof Element&&(zs.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,zs.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,zs.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,zs.getAttribute=Element.prototype.getAttribute),"undefined"!=typeof HTMLElement&&(zs.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function Hs(e,t,n){const r=zs[t];if(r)try{return r.call(e,n)}catch{}const o=e[t];return"function"==typeof o?o.call(e,n):o}function Ws(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",c=3;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&s++<r&&(u=Ys(n,l),!("html"===u||s>1&&i+o.length*c+u.length>=d));)o.push(u),i+=u.length,n=Hs(n,"parentNode");return o.reverse().join(a)}catch{return"<unknown>"}}function Ys(e,t){const n=[],r=Hs(e,"tagName");if(!r)return"";if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){const t=Hs(e,"dataset");if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());const o=t?.length?t.filter(t=>Hs(e,"getAttribute",t)).map(t=>[t,Hs(e,"getAttribute",t)]):null;if(o?.length)o.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{const t=Hs(e,"id");t&&n.push(`#${t}`);const r=Hs(e,"className");if(r&&Rt(r)){const e=r.split(/\s+/);for(const t of e)n.push(`.${t}`)}}for(const s of["aria-label","type","name","title","alt"]){const t=Hs(e,"getAttribute",s);t&&n.push(`[${s}="${t}"]`)}return n.join("")}var Vs,Js,Ks,Gs;function Xs(){if(!qs.document)return;const e=yt.bind(null,"dom"),t=Qs(e,!0);qs.document.addEventListener("click",t,!1),qs.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=qs[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(Ot(n,"addEventListener",function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},s=r[n]=r[n]||{refCount:0};if(!s.handler){const r=Qs(e);s.handler=r,t.call(this,n,r,o)}s.refCount++}catch{}return t.call(this,n,r,o)}}),Ot(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},o=n[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Qs(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Ut(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ut(r,"_sentryId",sn());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Js)return!1;try{if(!e.target||e.target._sentryId!==Ks)return!1}catch{}return!0})(n)||(e({event:n,name:o,global:t}),Js=n.type,Ks=r?r._sentryId:void 0),clearTimeout(Vs),Vs=qs.setTimeout(()=>{Ks=void 0,Js=void 0},1e3)}}function Zs(e){const t="history";gt(t,e),_t(t,ei)}function ei(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=Gs,o=function(e){try{return new URL(e,qs.location.origin).toString()}catch{return e}}(String(n));if(Gs=o,r===o)return e.apply(this,t);yt("history",{from:r,to:o})}return e.apply(this,t)}}qs.addEventListener("popstate",()=>{const e=qs.location.href,t=Gs;Gs=e,t!==e&&yt("history",{from:t,to:e})}),"history"in ps&&ps.history&&(Ot(qs.history,"pushState",e),Ot(qs.history,"replaceState",e))}var ti={};var ni="__sentry_xhr_v3__";function ri(){if(!qs.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=/* @__PURE__ */new Error;const o=1e3*fn(),s=Rt(n[0])?n[0].toUpperCase():void 0,i=function(e){if(Rt(e))return e;try{return e.toString()}catch{}}(n[1]);if(!s||!i)return e.apply(t,n);t[ni]={method:s,url:i,request_headers:{}},"POST"===s&&i.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[ni];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}yt("xhr",{endTimestamp:1e3*fn(),startTimestamp:o,xhr:t,virtualError:r}),r=void 0,t.removeEventListener("readystatechange",a)}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,o]=n,s=t[ni];return s&&Rt(r)&&Rt(o)&&(s.request_headers[r.toLowerCase()]=o),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[ni];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return yt("xhr",{startTimestamp:1e3*fn(),xhr:t}),e.apply(t,n)}})}function oi(e,t=function(e){const t=ti[e];if(t)return t;let n=qs[e];if(fs(n))return ti[e]=n.bind(qs);const r=qs.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o?.[e]&&(n=o[e]),r.head.removeChild(t)}catch(zd){Us&&it.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,zd)}return n?ti[e]=n.bind(qs):n}("fetch")){let n=0,r=0;return go(e,async function(o){const s=o.body.length;n+=s,r++;const i={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,i);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(zd){throw ti["fetch"]=void 0,zd}finally{n-=s,r--}},fo(e.bufferSize||40))}var si="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function ii(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var ai=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ci=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ui=/\((\S*)(?::(\d+))(?::(\d+))\)/,li=/at (.+?) ?\(data:(.+?),/,di=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,hi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,pi=ut(...[[30,e=>{const t=e.match(li);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ai.exec(e);if(n){const[,e,t,r]=n;return ii(e,"?",+t,+r)}const r=ci.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=ui.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=fi(r[1]||"?",r[2]);return ii(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=di.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=hi.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=fi(n,e),ii(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),fi=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},mi=1024,gi=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console",n=gt(t,e);_t(t,ss)}(function(e){return function(t){if(On()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:is(t.level),message:nn(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${nn(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}zo(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(On()!==e)return;let r,o,s="object"==typeof t?t.serializeAttribute:void 0,i="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;i&&i>mi&&(si&&it.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=mi),"string"==typeof s&&(s=[s]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=Ws(t,{keyAttrs:s,maxStringLength:i}),o=function(e,t=5){if(!vs.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};o&&(a.data={"ui.component_name":o}),zo(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),gt("dom",n),_t("dom",Xs)),t.xhr&&function(e){gt("xhr",e),_t("xhr",ri)}(function(e){return function(t){if(On()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[ni];if(!n||!r||!o)return;const{method:s,url:i,status_code:a,body:c}=o,u={method:s,url:i,status_code:a},l={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:u,type:"http",level:hs(a)};e.emit("beforeOutgoingRequestBreadcrumb",d,l),zo(d,l)}}(e)),t.fetch&&gs(function(e){return function(t){if(On()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},s={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,o),zo(s,o)}else{const o=t.response,s={...t.fetchData,status_code:o?.status},i={input:t.args,response:o,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:s,type:"http",level:hs(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,i),zo(a,i)}}}(e)),t.history&&Zs(function(e){return function(t){if(On()!==e)return;let n=t.from,r=t.to;const o=qo(ks.location.href);let s=n?qo(n):void 0;const i=qo(r);s?.path||(s=o),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),o.protocol===s.protocol&&o.host===s.host&&(n=s.relative),zo({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){On()===e&&zo({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:cn(t)},{event:t})}}(e))}}};var _i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),yi=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ot(ks,"setTimeout",bi),t.setInterval&&Ot(ks,"setInterval",bi),t.requestAnimationFrame&&Ot(ks,"requestAnimationFrame",vi),t.XMLHttpRequest&&"XMLHttpRequest"in ks&&Ot(XMLHttpRequest.prototype,"send",wi);const e=t.eventTarget;e&&(Array.isArray(e)?e:_i).forEach(e=>function(e,t){const n=ks[e]?.prototype;if(!n?.hasOwnProperty?.("addEventListener"))return;Ot(n,"addEventListener",function(n){return function(r,o,s){try{"function"==typeof o.handleEvent&&(o.handleEvent=Cs(o.handleEvent,{mechanism:{data:{handler:ht(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,o),n.apply(this,[r,Cs(o,{mechanism:{data:{handler:ht(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),s])}}),Ot(n,"removeEventListener",function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,"__sentry_wrapped__")){const o=n.__sentry_wrapped__;o&&e.call(this,t,o,r)}}catch{}return e.call(this,t,n,r)}})}(e,t))}}};function bi(e){return function(...t){const n=t[0];return t[0]=Cs(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ht(e)}`}}),e.apply(this,t)}}function vi(e){return function(t){return e.apply(this,[Cs(t,{mechanism:{data:{handler:ht(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function wi(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ot(n,e,function(t){const n={mechanism:{data:{handler:ht(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Bt(t);return r&&(n.mechanism.data.handler=ht(r)),Cs(t,n)})}),e.apply(this,t)}}var ki=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===ks.document)return void(si&&it.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));Vr({ignoreDuration:!0});let e=!1;(e=>{const t=qs.requestIdleCallback||qs.setTimeout;"hidden"===qs.document?.visibilityState?e():(Bs("visibilitychange",e=(e=>{let t=!1;return()=>{t||(e(),t=!0)}})(e),{once:!0,capture:!0}),Bs("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Fs("visibilitychange",e,{capture:!0}),Fs("pagehide",e,{capture:!0})}))})(()=>{e||(Gr(),e=!0)});const n=Mn();let r=n.getUser();n.addScopeListener(t=>{const n=t.getUser();r?.id===n?.id&&r?.ip_address===n?.ip_address||(r=n,e&&Gr())}),"route"===t&&Zs(({from:t,to:n})=>{t!==n&&(Vr({ignoreDuration:!0}),Gr(),e=!0)})}}},xi=()=>({name:"CultureContext",preprocessEvent(e){const t=Si();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Si();t&&Dr(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}});function Si(){try{const e=ks.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Ci=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";gt(t,e),_t(t,vt)}(t=>{const{stackParser:n,attachStacktrace:r}=Ni();if(On()!==e||Ss())return;const{msg:o,url:s,line:i,column:a,error:c}=t,u=function(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];0===c.length&&c.push({colno:r,lineno:n,filename:Ti(t)??ws(),function:"?",in_app:!0});return e}(js(n,c||o,void 0,r,!1),s,i,a);u.level="error",Wr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(e),Ei("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";gt(t,e),_t(t,kt)}(t=>{const{stackParser:n,attachStacktrace:r}=Ni();if(On()!==e||Ss())return;const o=function(e){if(Dt(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),s=Dt(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:js(n,o,void 0,r,!0);s.level="error",Wr(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(e),Ei("onunhandledrejection"))}}};function Ei(e){si&&it.log(`Global Handler attached: ${e}`)}function Ni(){return On()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ti(e){if(Rt(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&-1!==s){const t=e.slice(s+1);i=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}(e,!1)}>`:e}var Ri=()=>({name:"HttpContext",preprocessEvent(e){if(!ks.navigator&&!ks.location&&!ks.document)return;const t=Es(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!ks.navigator&&!ks.location&&!ks.document)return;const t=Es();Dr(e,{[Ar]:t.headers["User-Agent"],...e.is_segment&&{"url.full":"http.client"!==e.attributes?.["sentry.op"]?t.url:void 0,"http.request.header.referer":t.headers.Referer}})}}),Ai=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){Xo(Ns,o.getOptions().stackParser,n,t,e,r)}}},Di=/^HTML(\w*)Element$/;function Pi(e){if("undefined"!=typeof window&&e===window)return"[Window]";if("undefined"!=typeof document&&e===document)return"[Document]";if(function(e){if("undefined"==typeof Element)return!1;try{return e instanceof Element}catch{return!1}}(e)){const t=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(e);if(Di.test(t))return`[HTMLElement: ${Ws(e)}]`}}function $i(){return!!function(){if(void 0===ks.window)return!1;const e=ks;if(e.nw)return!1;if(!(e.chrome||e.browser)?.runtime?.id)return!1;const t=ws();return!(ks===ks.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}()&&(si&&nt(()=>{}),!0)}function Ii(e={}){const t=!e.skipBrowserExtensionCheck&&$i();let n=null==e.defaultIntegrations?[Jo(),Wo(),ds(),yi(),gi(),Ci(),Ai(),as(),Ri(),xi(),ki()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(o=e.stackParser||pi,Array.isArray(o)?ut(...o):o),integrations:eo({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||oi};var o;return Vt=Pi,Uo(Os,r)}function ji(e){const t="undefined"!=typeof window?window.location.href:void 0;Yr("portal_code",e.portalCode),Yr("object_code",e.objectCode??""),Yr("locale",e.locale??""),function(e,t){Mn().setContext(e,t)}("bukazu",{portal_code:e.portalCode,object_code:e.objectCode??null,locale:e.locale??null,url:t??null})}function Li(e){Hr(e)}function Mi(e){!function(e,t){const n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;Ln().captureMessage(e,n,r)}(e,"error")}var Oi=/* @__PURE__ */new WeakSet;function Ui(e){return function(e){return"messages"in e&&Array.isArray(e.messages)&&e.messages.every(e=>"string"==typeof e)}(e)?e.messages:[e.message]}function qi(e){const t=Ui(e.errors);return"object"!=typeof e.errors||null===e.errors||Oi.has(e.errors)||(Oi.add(e.errors),Li(new Error(t.join("\n")))),/* @__PURE__ */h("div",{className:"bukazu-error-message",children:[/* @__PURE__ */d("h2",{children:ne("something_went_wrong_please_try_again")}),/* @__PURE__ */d("ul",{children:t.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}var Bi=["en","nl","de","fr","es","it"];function Fi(e){if(!e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return function(e){return Bi.includes(e)}(t)?t:"en"}var zi=e=>"[object Object]"===Object.prototype.toString.call(e),Hi=n({locale:"nl",portalCode:"",objectCode:"",apiUrl:"https://api.bukazu.com"}),Wi="bukazuCurrency";function Yi(e){const t="string"==typeof e?.default&&""!==e.default?e.default:"EUR",n=Array.isArray(e?.allowed)?e.allowed.filter(e=>"string"==typeof e&&""!==e):[];return{multi_currency:e?.multi_currency??!1,default:t,allowed:[.../* @__PURE__ */new Set([...n,t])]}}var Vi=n({currency:void 0,setCurrency:()=>{},allowed:[],multiCurrency:!1});function Ji({currencies:e,children:t}){const n=i(()=>Yi(e),[e]),[o,s]=u(()=>{const e=function(){try{return window.localStorage.getItem(Wi)}catch{return null}}();return e&&n.allowed.includes(e)?e:n.default}),a=r(e=>{n.allowed.includes(e)&&(!function(e){try{window.localStorage.setItem(Wi,e)}catch{}}(e),s(e))},[n]),c=n.multi_currency&&n.allowed.length>1,l=i(()=>({currency:c?o:void 0,setCurrency:a,allowed:n.allowed,multiCurrency:c}),[c,n.allowed,o,a]);/* @__PURE__ */
38
+ return d(Vi.Provider,{value:l,children:t})}function Ki(){return o(Vi)}function Gi(){const{currency:e,setCurrency:t,allowed:n,multiCurrency:r}=Ki();return!r||n.length<=1?null:/* @__PURE__ */h("div",{className:"bu-currency-selector",children:[/* @__PURE__ */d("label",{htmlFor:"bu-currency",children:ne("currency")}),/* @__PURE__ */d("select",{id:"bu-currency",value:e,onChange:e=>{t(e.target.value)},children:n.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})]})}var Xi=class extends Error{name="KyError";get isKyError(){return!0}},Qi=class extends Xi{name="HTTPError";response;request;options;data;constructor(e,t,n){const r=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},Zi=class extends Xi{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},ea=e=>null!==e&&"object"==typeof e,ta=e=>ea(e)&&!Array.isArray(e),na=e=>"number"==typeof e&&e>=0,ra=Object.prototype.toString,oa=e=>e instanceof Error||"[object Error]"===ra.call(e),sa=e=>e instanceof globalThis.Request||"[object Request]"===ra.call(e),ia=e=>e instanceof globalThis.Response||"[object Response]"===ra.call(e),aa=class e extends Error{static wrap(t){return oa(t)?t:new e(t)}name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},ca=class extends Xi{name="ForceRetryError";customDelay;code;customRequest;constructor(e){if(null===e)throw new TypeError("The `ky.retry()` options must be an object");const t=e?.delay;if(void 0!==t&&!na(t))throw new TypeError("The `ky.retry()` `delay` option must be a non-negative number or `Infinity`");if(void 0!==e?.code&&"string"!=typeof e.code)throw new TypeError("The `ky.retry()` `code` option must be a string");if(void 0!==e?.request&&!sa(e.request))throw new TypeError("The `ky.retry()` `request` option must be a `Request`");const n=void 0===e?.cause?void 0:aa.wrap(e.cause);super(void 0===e?.code?"Forced retry":`Forced retry: ${e.code}`,n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ua=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},la=class extends Xi{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},da=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch{return!1}const o="Bun"in globalThis||"Deno"in globalThis;return(e||o)&&!t})(),ha="function"==typeof globalThis.AbortController,pa="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,fa="function"==typeof globalThis.ReadableStream,ma="function"==typeof globalThis.FormData,ga=["get","post","put","patch","head","delete","query"],_a={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},ya=()=>Object.keys(_a).filter(e=>"bytes"!==e||"function"==typeof globalThis.Response?.prototype?.bytes),ba=2147483647,va=Symbol.for("ky.stop"),wa=class{get isRetryMarker(){return!0}options;constructor(e){this.options=e}},ka=e=>e instanceof wa||!0===e?.isRetryMarker,xa=e=>new wa(e),Sa=["onUploadProgress","onDownloadProgress","timeout","fetch","throwHttpErrors"],Ca={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,maxResponseSize:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Ea={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Na=class extends Xi{name="ResponseSizeError";request;maxResponseSize;constructor(e,t){super(`Response body exceeded ${t} bytes: ${e.method} ${e.url}`),this.request=e,this.maxResponseSize=t}},Ta=new TextEncoder,Ra=/* @__PURE__ */new WeakMap,Aa=/* @__PURE__ */new Set([101,103,204,205,304]),Da=(e,t)=>{const n=e?.body;n&&n!==t?.body&&n.cancel().catch(()=>{})},Pa=e=>Math.max(0,Number(e.get("content-length"))||0),$a=e=>e.replaceAll(/\r\n|\r|\n/g,"\r\n"),Ia=e=>e.replaceAll("\n","%0A").replaceAll("\r","%0D").replaceAll('"',"%22"),ja=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(e,s){if(s.enqueue(e),r){o+=r.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),n?.({percent:e,totalBytes:0===t?0:Math.max(t,o),transferredBytes:o},r)}r=e},flush(){const e=r??/* @__PURE__ */new Uint8Array;o+=e.byteLength,n?.({percent:1,totalBytes:o,transferredBytes:o},e)}}))},La=(e,t,n=(t.body?Ra.get(t.body):void 0))=>{const r=e.clone.bind(e);if(e.body&&n){Ra.set(e.body,n);for(const t of Object.keys(_a)){if("function"!=typeof e[t])continue;const r=e[t].bind(e);Object.defineProperty(e,t,{async value(){try{return await r()}catch(e){throw n()??e}},writable:!0,configurable:!0})}}return Object.defineProperties(e,{url:{value:t.url},redirected:{value:t.redirected},type:{value:t.type},headers:{value:t.headers},clone:{value(){const t=r();return e.body&&n&&Ra.set(e.body,n),La(t,e)},writable:!0,configurable:!0}}),e},Ma=e=>{const{body:t}=e;if(t&&!e.bodyUsed&&!t.locked&&!Aa.has(e.status))return t},Oa=(e,t,n)=>{if(!e.body||e.bodyUsed||e.body.locked||e.keepalive||"no-cors"===e.mode||!(e instanceof globalThis.Request))return e;const r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=44,t+=Ta.encode(`Content-Disposition: form-data; name="${Ia($a(n))}"`).byteLength,r instanceof Blob&&(t+=Ta.encode(`; filename="${Ia(r.name??"")}"`).byteLength,t+=Ta.encode(`\r\nContent-Type: ${r.type||"application/octet-stream"}`).byteLength),t+=4,t+="string"==typeof r?Ta.encode($a(r)).byteLength:r.size,t+=2;return 0===t?0:t+40+6}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?Ta.encode(e).byteLength:e instanceof URLSearchParams?Ta.encode(e.toString()).byteLength:0})(n??e.body)||Pa(e.headers);return new Request(e,{duplex:"half",body:ja(e.body,r,t),headers:e.headers,referrer:e.referrer,referrerPolicy:e.referrerPolicy})},Ua=Symbol.for("ky.replaceOption"),qa=e=>ea(e)&&!0===e[Ua]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},Ba=(...e)=>{for(const t of e)if(void 0!==t&&!ta(t))throw new TypeError("The `options` argument must be an object");return rc({},...e)},Fa=(e={},t={})=>{const n=new globalThis.Headers(e);for(const[r,o]of Object.entries(Ja(t)))void 0===o?n.delete(r):n.set(r,o);return n},za=e=>{if(!ta(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},Ha=e=>za(e)||Array.isArray(e),Wa=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),n=e[Qa];return n&&(t[Qa]=new Set(n)),t}return Array.isArray(e)?[...e]:za(e)?{...e}:e},Ya=e=>Array.isArray(e)?e.map(e=>Wa(e)):Wa(e),Va=(e,t=/* @__PURE__ */new WeakMap)=>{if(!Ha(e))return e;const n=t.get(e);if(n)return n;if(Array.isArray(e)){const n=[];t.set(e,n);for(const r of e)n.push(Va(r,t));return n}const r=null===Object.getPrototypeOf(e)?Object.create(null):{};t.set(e,r);for(const o of Reflect.ownKeys(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Object.defineProperty(r,o,{value:Va(e[o],t),writable:!0,enumerable:!0,configurable:!0});return r},Ja=e=>{if(za(e))return e;const t=e instanceof globalThis.Headers,n={};for(const[r,o]of new globalThis.Headers(e).entries())n[r]=t&&"undefined"===o?void 0:o;return n},Ka=(e,t)=>{const n=/* @__PURE__ */new Map;for(const[r,o]of[...Object.entries(Ja(e)),...Object.entries(Ja(t))])n.set(r.toLowerCase(),o);return Object.fromEntries(n)};function Ga(e,t,n){if(Object.hasOwn(t,n)&&void 0===t[n])return[];const{isReplace:r,value:o}=qa(t[n]);if(!(void 0===o||Array.isArray(o)&&o.every(e=>"function"==typeof e)))throw new TypeError(`\`hooks.${n}\` must be an array of functions`);return r?[...o??[]]:rc(e[n]??[],o??[])}var Xa=(e={},t={})=>{if(!ta(t))throw new TypeError("The `hooks` option must be an object");return{init:Ga(e,t,"init"),beforeRequest:Ga(e,t,"beforeRequest"),beforeRetry:Ga(e,t,"beforeRetry"),beforeError:Ga(e,t,"beforeError"),afterResponse:Ga(e,t,"afterResponse")}},Qa=Symbol("deletedParameters"),Za=/* @__PURE__ */new Set(["json","context"]),ec=(e,t)=>{if(!Ha(e))return e;if(t.has(e))return t.get(e);t.set(e,e);const n=((e,t)=>{let n;for(const[r,o]of Object.entries(e)){const s=t(o);s!==o&&(n??=Array.isArray(e)?[...e]:{...e},n[r]=s)}return n??e})(e,e=>ec(qa(e).value,t));return t.set(e,n),n},tc=(e,t)=>{const n=new URLSearchParams,r=/* @__PURE__ */new Set;for(const o of[e,t])if(o instanceof URLSearchParams){const e=o[Qa];if(e)for(const t of e)n.delete(t),r.add(t);for(const[t,r]of o.entries())n.append(t,r)}else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");const t=String(e[0]),{isReplace:r,value:o}=qa(e[1]);r&&n.delete(t),n.append(t,String(o))}else if(ea(o))for(const[e,t]of Object.entries(o)){const{isReplace:o,value:s}=qa(t);void 0===s?(n.delete(e),r.add(e)):(o&&n.delete(e),n.append(e,String(s)))}else{const e=new URLSearchParams(o);for(const[t,r]of e.entries())n.append(t,r)}return r.size>0&&(n[Qa]=r),n},nc=(e,...t)=>{let n,r={},o={},s={};const i=[];for(const a of t)if(Array.isArray(a))Array.isArray(r)||(r=[]),r=[...r,...a];else if(ea(a)){for(let[t,o]of Object.entries(a)){const s=qa(o),{isReplace:a}=s;o=s.value;const c=e&&"signal"===t;if(c&&(a||void 0===o)&&(i.length=0),c&&o instanceof globalThis.AbortSignal)i.push(o);else{if(e&&"headers"===t&&null===o)throw new TypeError("The `headers` option must not be `null`. Use `undefined` to clear it.");if(e&&"context"===t){if(void 0!==o&&!ta(o))throw new TypeError("The `context` option must be an object");r={...r,context:void 0===o?{}:a?{...o}:{...r.context,...o}}}else if(e&&"searchParams"===t){if(null===o)throw new TypeError("The `searchParams` option must not be `null`. Use `undefined` to clear it.");n=void 0===o?void 0:a||void 0===n?Ya(o):tc(n,o)}else{if(e&&"retry"===t&&void 0!==o&&"number"!=typeof o&&!ta(o))throw new TypeError("`retry` must be a number or an object");e&&"retry"===t&&!a&&(ea(o)&&"number"==typeof r[t]?r={...r,[t]:{limit:r[t]}}:"number"==typeof o&&ea(r[t])&&(o={limit:o})),e&&"retry"===t&&za(o)&&(a||!Ha(r[t]))?o=nc(!1,{},o):!a&&Ha(r[t])&&Ha(o)&&Array.isArray(r[t])===Array.isArray(o)&&(o=nc(!1,r[t],o)),r={...r,[t]:o}}}}if(e&&void 0!==a.hooks){const{value:e,isReplace:t}=qa(a.hooks);s=Xa(t?{}:s,e),r.hooks=s}if(e&&ea(a.headers)){const{value:e,isReplace:t}=qa(a.headers);o=Ka(t?{}:o,e),r.headers=o}}if(void 0!==n&&(r.searchParams=n),i.length>0&&(1===i.length?r.signal=i[0]:r.signal=pa?AbortSignal.any(i):i.at(-1)),e)for(const[a,c]of Object.entries(r))Za.has(a)||(r[a]=ec(c,/* @__PURE__ */new Map));return r},rc=(...e)=>nc(!0,...e),oc=e=>ga.includes(e.toLowerCase())?e.toUpperCase():e,sc=/* @__PURE__ */new Set([...ga,"options","trace"]),ic=e=>sc.has(e.toLowerCase())?e.toLowerCase():e,ac={limit:2,methods:["get","put","head","delete","options","trace","query"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},cc=(e={})=>{if("number"==typeof e&&(e={limit:e}),!ta(e))throw new TypeError("`retry` must be a number or an object");const t={...ac,...Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))};if(!Number.isInteger(t.limit)||t.limit<0)throw new TypeError("`retry.limit` must be a finite, non-negative integer");for(const n of["methods","statusCodes","afterStatusCodes"])if(!Array.isArray(t[n]))throw new Error(`retry.${n} must be an array`);for(const[n,r]of[["methods",e=>"string"==typeof e],["statusCodes",e=>Number.isInteger(e)],["afterStatusCodes",e=>Number.isInteger(e)]])if(t[n].some(e=>!r(e)))throw new TypeError(`\`retry.${n}\` must only contain ${"methods"===n?"strings":"numbers"}`);for(const n of["maxRetryAfter","backoffLimit"])if(!na(t[n]))throw new TypeError(`\`retry.${n}\` must be a non-negative number or \`Infinity\``);for(const n of["delay","shouldRetry"])if(void 0!==t[n]&&"function"!=typeof t[n])throw new TypeError(`\`retry.${n}\` must be a function`);if(void 0!==t.jitter&&"boolean"!=typeof t.jitter&&"function"!=typeof t.jitter)throw new TypeError("`retry.jitter` must be a boolean or a function");if("boolean"!=typeof t.retryOnTimeout)throw new TypeError("`retry.retryOnTimeout` must be a boolean");return t.methods=t.methods.map(e=>ic(e)),t.statusCodes=[...t.statusCodes],t.afterStatusCodes=[...t.afterStatusCodes],t};async function uc(e,{signal:t}){return new Promise((n,r)=>{function o(){clearTimeout(s),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const s=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var lc=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function dc(e){if(!e||!oa(e)||"TypeError"!==e.name||"string"!=typeof e.message)return!1;const{message:t,stack:n}=e;return"Load failed"===t||t.startsWith("Load failed (")&&t.endsWith(")")?void 0===n||"__sentry_captured__"in e:!!t.startsWith("error sending request for url")||(!!("Failed to fetch"===t||t.startsWith("Failed to fetch (")&&t.endsWith(")"))||lc.has(t))}var hc=(e,t)=>e instanceof t||!0===e?.isKyError&&e?.name===t.name;function pc(e){return hc(e,ca)}var fc=/^\d+$/,mc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gc=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,_c=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,yc=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,bc=({year:e,month:t,day:n,hours:r,minutes:o,seconds:s})=>{const i=mc.indexOf(t),a=Number(n),c=Number(r),u=Number(o),l=Number(s);if(-1===i||c>23||u>59||l>60)return;const d=Math.min(l,59),h=new Date(Date.UTC(e,i,a,c,u,d));h.setUTCFullYear(e);const p=h.getTime();return h.getUTCFullYear()===e&&h.getUTCMonth()===i&&h.getUTCDate()===a&&h.getUTCHours()===c&&h.getUTCMinutes()===u&&h.getUTCSeconds()===d?60===l?p+1e3:p:void 0},vc=(e,t)=>e[t],wc=({value:e,allowTimestamp:t})=>{if(fc.test(e)){let n=1e3*Number(e);return t&&Number(e)>=1e9&&(n-=Date.now()),Math.max(0,n)}const n=(e=>{const t=gc.exec(e);if(t)return bc({year:Number(vc(t,3)),month:vc(t,2),day:vc(t,1),hours:vc(t,4),minutes:vc(t,5),seconds:vc(t,6)});const n=_c.exec(e);if(n){const e=/* @__PURE__ */new Date,t=Number(vc(n,3)),r=100*Math.floor(e.getUTCFullYear()/100)+t,o=Date.UTC(e.getUTCFullYear()+50,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());let s;for(const i of[r-100,r,r+100]){const e=bc({year:i,month:vc(n,2),day:vc(n,1),hours:vc(n,4),minutes:vc(n,5),seconds:vc(n,6)});void 0!==e&&e<=o&&(s=e)}return s}const r=yc.exec(e);if(r){const[e,t,n]=vc(r,4).split(":");return bc({year:Number(vc(r,5)),month:vc(r,2),day:vc(r,3).trim(),hours:e,minutes:t,seconds:n})}})(e);if(void 0!==n)return Math.max(0,n-Date.now())},kc=Symbol("timedOut"),xc=()=>globalThis.performance?.now()??Date.now(),Sc=(e,t)=>Promise.race([e,new Promise(n=>{const r=setTimeout(()=>{n(kc)},t);e.finally(()=>{clearTimeout(r)}).catch(()=>{})})]),Cc=e=>{(ia(e)||sa(e))&&Da(e)},Ec=e=>{e.then(e=>{Cc(e)}).catch(()=>{})},Nc=e=>{const t=(e.split(";",1)[0]??"").trim().toLowerCase();if(!t.endsWith("json"))return!1;const n=t.at(-5);return"/"===n||("."===n||"+"===n||"-"===n)&&t.includes("/")},Tc=async(e,t)=>{const{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}const o=e.headers.get("content-type")??"",s=Nc(o)?new TextDecoder:(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder})(o),i=[];let a=0;const c=(async()=>{try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(a+=t.byteLength,a>10485760)return void r.cancel().catch(()=>{});i.push(s.decode(t,{stream:!0}))}}catch(e){if(function(e){return hc(e,Na)}(e))throw e;return}return i.push(s.decode()),i.join("")})(),u=await Sc(c,t);return u===kc&&r.cancel().catch(()=>{}),u},Rc=(e,t)=>{if(!1!==e){if(!na(e))throw new TypeError(`The \`${t}\` option must be a non-negative number or \`false\``);if(e>2147483647)throw new RangeError(`The \`${t}\` option cannot be greater than 2147483647`)}},Ac=({throwHttpErrors:e=!0,timeout:t=1e4,fetch:n=globalThis.fetch.bind(globalThis)})=>({throwHttpErrors:e,timeout:t,fetch:n}),Dc=e=>{for(const n of["parseJson","stringifyJson","fetch","onDownloadProgress","onUploadProgress"])if(void 0!==e[n]&&"function"!=typeof e[n])throw new TypeError(`The \`${n}\` option must be a function`);const{throwHttpErrors:t}=e;if("boolean"!=typeof t&&"function"!=typeof t)throw new TypeError("The `throwHttpErrors` option must be a boolean or a function")},Pc=/^[\0-\u0020]+/g,$c=/[\t\n\r]/g,Ic=/^[a-z][\d+.a-z-]*:/i,jc=/^https?:(?!\/\/)/i,Lc=(e,t,n)=>{if("string"!=typeof e)return e;if(t&&(e=`${t.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`),n){const t=(e=>e.replaceAll(Pc,"").replaceAll($c,""))(e);if(jc.test(t))throw new TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");if(!(e=>Ic.test(e))(t))return new URL(e,new Request(n).url)}return e},Mc=(e,t)=>{e.searchParams.has(t)&&e.searchParams.delete(t)};var Oc=async(e,t)=>{const n=ea(t)||"function"==typeof t?t["~standard"]:void 0;if(!ea(n)||"function"!=typeof n.validate)throw new TypeError("The `schema` argument must follow the Standard Schema specification");const r=await n.validate(e);if(r.issues)throw new ua(r.issues);return r.value},Uc=class e{static create(t,n){const r=n.hooks?.init??[],o=r.length>0?function(e){return{...e,headers:Ka({},e.headers??{}),context:{...e.context},json:Va(e.json),searchParams:Ya(e.searchParams),retry:Va(e.retry)}}(n):n;for(const e of r)e(o);const s=new e(t,o),i=(async()=>{let e;try{return e=await s.#e(),e}catch(t){return await s.#t(t)}finally{const t=s.#n;Da(t,e),t&&s.request!==t&&Da(s.request,e)}})();for(const e of ya()){const t=_a[e];i[e]=async n=>{s.request!==s.#n&&s.request.headers.set("accept",s.request.headers.get("accept")||t);const r=await i;if(void 0===r)throw new TypeError("The request resolved without a response, so there is no body to read. This happens when a `beforeRetry` hook returns `ky.stop`. Throw from the hook instead of returning `ky.stop`.");if("json"!==e)return s.#r(async()=>r[e](),r);const o=await s.#r(async()=>r.text(),r),a=s.#o(r);let c;try{c=await s.#s(async()=>{const e=""!==o||void 0===n||s.#i.parseJson?await s.#a(o,a,r):void 0;return void 0===n?e:await Oc(e,n)})}catch(u){throw s.#c?.aborted&&await s.#t(s.#c.reason,a),u}return c===kc&&await s.#t(new la(a),a),c}}return i}request;#u;#l=0;#d;#i;#h;#n;#p=!1;#c;#f=/* @__PURE__ */new WeakSet;#m;#g;#_=/* @__PURE__ */new WeakSet;#y=/* @__PURE__ */new WeakMap;#b=/* @__PURE__ */new WeakSet;constructor(e,t={}){if("string"!=typeof e&&!(e instanceof URL||e instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");const{maxResponseSize:n=Number.POSITIVE_INFINITY,totalTimeout:r=!1}=t;if(Object.hasOwn(t,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");for(const i of["headers","method","prefix","baseUrl","referrer","referrerPolicy"])if(null===t[i])throw new TypeError(`The \`${i}\` option must not be \`null\`. Use \`undefined\` to clear it.`);if(void 0!==t.context&&!ta(t.context))throw new TypeError("The `context` option must be an object");if(this.#i={...t,headers:Fa(e.headers,t.headers),hooks:Xa({},t.hooks),method:oc(t.method??e.method??"GET"),referrer:t.referrer??e.referrer,referrerPolicy:t.referrerPolicy??e.referrerPolicy,prefix:String(t.prefix||""),retry:cc(t.retry),...Ac(t),totalTimeout:r,maxResponseSize:n,context:t.context??{}},Dc(this.#i),Rc(this.#i.timeout,"timeout"),Rc(r,"totalTimeout"),this.#d=this.#i.retry.limit,n!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(n)||n<0))throw new TypeError("The `maxResponseSize` option must be a non-negative safe integer or Infinity");this.#h=e instanceof globalThis.Request?e:void 0,e=Lc(e,this.#i.prefix,this.#i.baseUrl),ha&&pa&&(this.#c=this.#i.signal??this.#h?.signal,this.#u=new globalThis.AbortController,this.#i.signal=this.#v()),da&&(this.#i.duplex="half");const o=void 0!==t.headers&&Fa({},t.headers).has("content-type");void 0!==this.#i.json&&(this.#i.body=this.#i.stringifyJson?.(this.#i.json)??JSON.stringify(this.#i.json),o||this.#i.headers.set("content-type","application/json")),e instanceof globalThis.Request&&(ma&&this.#i.body instanceof globalThis.FormData||this.#i.body instanceof URLSearchParams)&&!o&&this.#i.headers.delete("content-type"),this.request=new globalThis.Request(e,this.#i),this.#p="function"==typeof globalThis.ReadableStream&&this.#i.body instanceof globalThis.ReadableStream;const{searchParams:s}=this.#i;if((e=>{if(void 0===e)return!1;if(null===e)throw new TypeError("The `searchParams` option must not be `null`. Use `undefined` to clear it.");return Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||Boolean(e[Qa]?.size):"object"==typeof e?Object.keys(e).length>0:"string"==typeof e?e.trim().length>0:Boolean(e)})(s)){const e=new URL(this.request.url);if(((e,t)=>{const n=t?.[Qa];if(n)for(const r of n)Mc(e,r);if("string"==typeof t){const n=t.replace(/^\?/,"");""!==n&&(e.search=e.search?`${e.search}&${n}`:`?${n}`)}else if(!ta(t)||t instanceof URLSearchParams)for(const[r,o]of new URLSearchParams(t))e.searchParams.append(r,o);else for(const[r,o]of Object.entries(t))void 0===o?Mc(e,r):e.searchParams.append(r,o)})(e,s),e.href!==this.request.url){const{body:t,cache:n,credentials:r,integrity:o,keepalive:s,mode:i,redirect:a,referrer:c,referrerPolicy:u}=this.request,l=da&&!s&&"no-cors"!==i;this.request=new globalThis.Request(e,{...this.#i,cache:n,credentials:r,integrity:o,keepalive:s,mode:i,redirect:a,referrer:c,referrerPolicy:u,body:this.#i.body??(l?t:void 0)})}}this.#g="number"==typeof r?xc()+r:Number.POSITIVE_INFINITY}async#e(){await Promise.resolve();const e=await this.#w();void 0!==e&&(this.#d=cc(this.#i.retry).limit);let t=e??await this.#k();for(;;){if(void 0===t)return;const e=this.#_.has(t);let r;try{t=await this.#x(t)}catch(n){if(!pc(n))throw n;r=n}if(void 0===r){const n=t;if(n.ok||"opaque"===n.type||!this.#S(n))break;const o=new Qi(n,this.#o(n),this.#C());if(o.data=await this.#E(n),this.#N(),this.#T(),e)throw o;r=o}t=await this.#R(r)}if(this.#A(t),this.#i.onDownloadProgress){if(!fa)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=((e,t)=>{const n=Ma(e);if(!n)return e;const r=e.headers.get("content-encoding")?.toLowerCase(),o=Boolean(r)&&"identity"!==r?0:Pa(e.headers),s=ja(n,o,t);return La(new Response(s,e),e)})(t,this.#i.onDownloadProgress);return this.#D(e,this.#o(t)),this.#A(e)}return t}#P(e,t){const n=e.delay(this.#l+1);if(!na(n))throw new TypeError("`retry.delay` must return a non-negative number or `Infinity`",{cause:t});let r=n;return!0===e.jitter?r=Math.random()*n:"function"==typeof e.jitter&&(r=e.jitter(n),(!Number.isFinite(r)||r<0)&&(r=n)),Math.min(e.backoffLimit,r)}async#$(e){const t=cc(this.#i.retry);if(this.#l>=Math.min(t.limit,this.#d))throw e;const n=aa.wrap(e);if(pc(n))return n.customDelay??this.#P(t,e);if(!t.methods.includes(ic(this.request.method)))throw e;let r=!1;const{shouldRetry:o}=t;if(void 0!==o){const t=await this.#s(async()=>o({error:n,retryCount:this.#l+1}));if(this.#N(),t===kc)throw new la(this.#I);if(!1===t)throw e;r=!0===t}if(function(e){return hc(e,la)}(e)){if(!r&&!t.retryOnTimeout)throw e;return this.#P(t,e)}if(function(e){return hc(e,Qi)}(e)){if(!r&&!t.statusCodes.includes(e.response.status))throw e;const n=(e=>{const t=e.get("Retry-After");if(null!==t)return{value:t,allowTimestamp:!1};const n=e.get("RateLimit-Reset");if(null!==n)return{value:n,allowTimestamp:!0};const r=e.get("X-RateLimit-Retry-After");if(null!==r)return{value:r,allowTimestamp:!1};const o=e.get("X-RateLimit-Reset")??e.get("X-Rate-Limit-Reset");return null!==o?{value:o,allowTimestamp:!0}:void 0})(e.response.headers);if(n&&t.afterStatusCodes.includes(e.response.status)){const r=wc(n);return void 0===r?this.#P(t,e):Math.min(t.maxRetryAfter,r)}if(!r&&413===e.response.status)throw e;return this.#P(t,e)}if(!r&&!function(e){return hc(e,Zi)}(e))throw e;return this.#P(t,e)}#A(e){if(!this.#i.parseJson||this.#b.has(e))return e;this.#b.add(e);const t=this.#o(e);e.json=async()=>this.#a(await e.text(),t,e);const n=e.clone.bind(e);return e.clone=()=>this.#A(this.#D(n(),t)),e}async#t(e,t=this.#I){if(!oa(e))throw e;if(this.#f.has(e))throw e;let n=e;for(const r of this.#i.hooks.beforeError){const e=await r({request:t,options:this.#C(),error:n,retryCount:this.#l});oa(e)&&(n=e)}throw n}async#E(e){const t=this.#o(e),n=({fromTotalTimeout:e})=>{if(e)throw new la(t);this.#T(t)},r=this.#j(t),o=await Tc(e,r.milliseconds);if(o===kc)return void n(r);if(!o)return;if(!Nc(e.headers.get("content-type")??""))return o;const s=this.#j(t),i=await Sc(Promise.resolve().then(()=>this.#a(o,t,e)),s.milliseconds).catch(()=>{});if(i!==kc)return i;n(s)}#j(e){const t=!1===this.#i.timeout?1e4:this.#i.timeout,n=this.#L();if(0===n)throw new la(e);return{milliseconds:Math.min(t,n),fromTotalTimeout:n<=t}}#M(){const e=this.#L();if(0===e)throw new la(this.#I);const t=Math.min(!1===this.#i.timeout?Number.POSITIVE_INFINITY:this.#i.timeout,e);return t===Number.POSITIVE_INFINITY?void 0:t}async#r(e,t){const n=this.#o(t);let r;try{r=this.#M()}catch(i){await this.#t(i,n)}const o=e();let s;try{s=void 0===r?await o:await Sc(o,r)}catch(i){this.#c?.aborted&&await this.#t(this.#c.reason,n),0!==this.#L()&&(dc(i)&&await this.#t(new Zi(n,{cause:i}),n),await this.#t(i,n)),s=kc}return this.#c?.aborted&&await this.#t(this.#c.reason,n),s!==kc&&0!==this.#L()||(this.#u?.abort(),await this.#t(new la(n),n)),s}async#s(e){const t=this.#c;t?.throwIfAborted();const n=this.#L();if(0===n)return this.#u?.abort(),kc;let r,o,s;try{const i=new Promise((e,n)=>{t&&(o=()=>{n(t.reason)},t.addEventListener("abort",o,{once:!0}))});if(s=e(),n===Number.POSITIVE_INFINITY)return await Promise.race([s,i]);const a=new Promise(e=>{r=setTimeout(()=>{e(kc)},n)}),c=await Promise.race([s,a,i]);return c===kc||0===this.#L()?(this.#u?.abort(),c===kc?Ec(s):Cc(c),kc):c}catch(i){if(t?.aborted&&(s&&Ec(s),t.throwIfAborted()),0===this.#L())return this.#u?.abort(),kc;throw i}finally{clearTimeout(r),o&&t?.removeEventListener("abort",o)}}#a(e,t,n){const{parseJson:r}=this.#i;return r?r(e,{request:t,response:n}):JSON.parse(e)}#v(){return this.#c?AbortSignal.any([this.#c,this.#u.signal]):this.#u.signal}#S(e){const{throwHttpErrors:t}=this.#i;try{return"function"==typeof t?t(e.status):t}catch(n){throw Da(e),n}}get#I(){return this.#n??this.request}#T(e=this.#I){if(0===this.#L())throw new la(e)}async#w(){for(const e of this.#i.hooks.beforeRequest){const t=await this.#s(async()=>e({request:this.request,options:this.#C(),retryCount:0}));if(t===kc)throw new la(this.#I);if(sa(t))this.#O(this.#U(t));else if(ia(t))return this.#_.add(t),t}}async#x(e){const t=this.#o(e);e=this.#q(e);for(const r of this.#i.hooks.afterResponse){const o=this.#D(e.clone(),t);let s;this.#A(o);try{if(s=await this.#s(async()=>r({request:this.request,options:this.#C(),response:o,retryCount:this.#l})),s===kc)throw new la(this.#I);if(ka(s))throw new ca(s.options)}catch(n){throw Da(o),Da(e),n}const i=ia(s)?this.#D(s,t):e;Da(o,i),Da(e,i),i!==e&&(e=this.#q(i))}return e}async#k(){try{return await this.#B()}catch(e){return this.#R(e)}}async#R(e){this.#N();const t=Math.min(await this.#$(e),ba),n={signal:this.#c},r=this.#L();if(0===r)throw new la(this.#I);if(t>=r)throw await uc(r,n),new la(this.#I);await uc(t,n),this.#T(),this.#u?.signal.aborted&&(this.#u=new globalThis.AbortController,this.#i.signal=this.#v(),this.#O(this.#U(this.request),this.#p)),pc(e)&&e.customRequest&&this.#O(this.#U(e.customRequest));for(const s of this.#i.hooks.beforeRetry){let t;try{t=await this.#s(async()=>s({request:this.request,options:this.#C(),error:aa.wrap(e),retryCount:this.#l+1}))}catch(o){throw this.#N(),oa(o)&&o!==e&&this.#f.add(o),o}if(t===kc)throw new la(this.#I);if(sa(t)){this.#O(this.#U(t));break}if(ia(t))return this.#_.add(t),this.#l++,t;if(t===va)return;ta(t)&&this.#F(t.options)}return this.#T(),this.#l++,this.#k()}async#B(){Da(this.#n,this.request);const e=(e=>{const t={};for(const n of Object.keys(e))Object.hasOwn(Ea,n)||Object.hasOwn(Ca,n)||Object.defineProperty(t,n,{value:e[n],writable:!0,enumerable:!0,configurable:!0});return t})(this.#i);this.#d=cc(this.#i.retry).limit;const t=this.#d>0?this.#U(this.request.clone()):void 0,n=this.#z(this.request);this.#n=n,t&&(this.request=t,this.#p=!0);try{const t=this.#M(),{fetch:r}=this.#i,o=void 0===t?await r(n,e):await async function(e,t,n,r){let o,s=!1;try{return await new Promise((i,a)=>{o=setTimeout(()=>{s=!0,n?.abort(),a(new la(e))},r.timeout);const{fetch:c}=r;c(e,t).then(e=>{s?Da(e):i(e)}).catch(a)})}finally{clearTimeout(o)}}(n,e,this.#u,{timeout:t,fetch:r});if(!ia(o))throw new TypeError("The `fetch` option must resolve with a `Response`");if(0===this.#L())throw this.#u?.abort(),Da(o),new la(n);return this.#D(o,n)}catch(r){if(this.#N(),0===this.#L())throw this.#u?.abort(),new la(n);if(dc(r))throw new Zi(n,{cause:r});throw r}}#N(){this.#c?.throwIfAborted()}#L(){return Math.max(0,this.#g-xc())}#F(e){if(!ta(e))throw new TypeError("The `options` returned from a `beforeRetry` hook must be an object");for(const r of Object.keys(e))if(!Sa.includes(r))throw new TypeError(`The \`${r}\` option cannot be changed from a \`beforeRetry\` hook`);const t={...this.#i,...e},n={...t,...Ac(t)};Dc(n),Rc(n.timeout,"timeout"),Object.assign(this.#i,n),this.#m=void 0}#C(){if(!this.#m){const{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:o,timeout:s,totalTimeout:i,maxResponseSize:a,throwHttpErrors:c,fetch:u,...l}=this.#i;this.#m=Object.freeze(l)}return this.#m}#O(e,t=!1){this.#p&&Da(this.request,e),this.#m=void 0,this.request=e,this.#p=t}#U(e){return this.#i.signal&&e instanceof globalThis.Request?new globalThis.Request(e,{signal:this.#i.signal,referrer:e.referrer,referrerPolicy:e.referrerPolicy}):e}#o(e){return this.#y.get(e)??this.#I}#D(e,t){return this.#y.set(e,t),e}#q(e){const t=this.#o(e);return this.#D(((e,t,n)=>{const r=Ma(e);if(!r||n===Number.POSITIVE_INFINITY)return e;let o,s=0;const i=Ra.get(r),a=r.pipeThrough(new TransformStream({transform(e,r){if(s+=e.byteLength,s>n)throw o=new Na(t,n),o;r.enqueue(e)}}));return La(new Response(a,e),e,()=>o??i?.())})(e,t,this.#i.maxResponseSize),t)}#z(e){return this.#i.onUploadProgress&&da&&e.body?Oa(e,this.#i.onUploadProgress,this.#i.body):e}},qc=(e,t)=>{try{return Uc.create(e,t())}catch(n){const e=Promise.reject(n);for(const t of ya())e[t]=async()=>e;return e}},Bc=e=>{const t=(t,n)=>qc(t,()=>Ba(e,n));for(const n of ga)t[n]=(t,r)=>qc(t,()=>Ba(e,r,{method:n}));return t.create=e=>Bc(Ba(e)),t.extend=t=>("function"==typeof t&&(t=t(Ba(Va(e)))),Bc(Ba(e,t))),t.stop=va,t.retry=xa,t},Fc=Bc(),zc=/* @__PURE__ */new Map,Hc=Fc.create({retry:{limit:3,methods:["get","put","head","delete","options","trace"],statusCodes:[408,429,500,502,503,504]},headers:{Accept:"application/json"},hooks:{beforeRequest:[({request:e})=>{if("GET"!==e.method)return;const t=zc.get(e.url);t&&(t.etag&&e.headers.set("If-None-Match",t.etag),t.lastModified&&e.headers.set("If-Modified-Since",t.lastModified))}],afterResponse:[async({request:e,response:t})=>{if("GET"!==e.method)return t;if(304===t.status){const t=zc.get(e.url);if(t)return new Response(t.body,{status:200,headers:{"Content-Type":"application/json"}})}if(t.ok){const n=t.headers.get("ETag")??void 0,r=t.headers.get("Last-Modified")??void 0;if(void 0!==n||void 0!==r){const o=await t.clone().text();zc.set(e.url,{etag:n,lastModified:r,body:o})}}return t}]}});async function Wc({apiUrl:e,locale:t,portalCode:n,params:r,signal:o}){const s=function({apiUrl:e,portalCode:t,params:n}){const r=new URL("/portal_api/v1/accommodations",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,...n}).toString(),r.toString()}({apiUrl:e,portalCode:n,params:r});try{return await Hc.get(s,{headers:{locale:t},signal:o}).json()}catch(i){if(i instanceof Qi)throw new Error(`Search request failed (${i.response.status})`);throw i}}function Yc(e){const t=Object.entries(e).filter(([e,t])=>/^category_\d+$/.test(e)&&t).map(([,e])=>Number(e));return[...new Set([...e.properties||[],...t].map(Number).filter(Number.isFinite))].sort((e,t)=>e-t)}function Vc(e,t,n){const r=Number(n);r&&(e[t]=String(r))}var Jc=/^\d{4}-\d{2}-\d{2}$/,Kc=/^\d{1,10}$/,Gc="\\|[\\p{L}\\p{M}\\d '’.()-]{1,100}",Xc=new RegExp(`^\\d{1,10}${Gc}$`,"u"),Qc=new RegExp(`^\\d{1,10}${Gc}${Gc}$`,"u");function Zc(e){return e&&Jc.test(e)?e:void 0}function eu(e){return"number"==typeof e?Number.isSafeInteger(e)&&e>=0:"string"==typeof e&&Kc.test(e)}function tu(e){return t=>"string"==typeof t&&e.test(t)}var nu={countries:{format:eu,list:!0},regions:{format:tu(Xc),list:!0},cities:{format:tu(Qc),list:!0},persons_max:{format:eu,list:!1},bedrooms_min:{format:eu,list:!1},bathrooms_min:{format:eu,list:!1},weekprice_max:{format:eu,list:!1}};function ru(e,{format:t,list:n}){if(t(e))return e;if(!n||!Array.isArray(e)||e.length>50)return;const r=e.filter(t);return r.length>0?r:void 0}function ou(e,t){const n=parseInt(String(e.persons_min??""),10),r=function(e){const t={};for(const[r,o]of Object.entries(nu)){const n=ru(e[r],o);void 0!==n&&(t[r]=n)}const n=Yc(e).filter(eu);return n.length>0&&n.length<=50&&(t.properties=n),t}(e);return{arrival:Zc(e.arrival_date),departure:Zc(e.departure_date),persons:n>0?n:void 0,filters:Object.keys(r).length>0?r:void 0,result_count:t}}var su=/* @__PURE__ */new Set;function iu(e){return e.isConnected&&"true"===e.getAttribute("data-consent")}function au(){return"undefined"!=typeof window&&!0===window.bukazuConsent||[...su,...document.querySelectorAll(".bukazu-app, #bukazu-app")].some(iu)}var cu="https://api.bukazu.com/tracking",uu="bu_portal_session",lu=/^[A-Za-z0-9_.-]{1,64}$/,du="",hu=null,pu=!1,fu=null;function mu(){return au()&&ku(uu)||du}function gu(e){return"string"==typeof e&&lu.test(e)}async function _u(e){try{!mu()&&fu&&await fu;const t=async function(e){const t=au(),n=mu(),r={...e,interaction_info:yu(e.interaction_info),url:window.location.href,consented:t};n&&(r.session_identifier=n);const o=t&&!pu&&!ku(uu);o&&(r.attribution=function(){if(hu)return hu;const e=new URLSearchParams(window.location.search),t={landing_path:window.location.pathname,device_class:bu(window.innerWidth)},n=function(){const e=vu();return e===window.location.host?"":e}();n&&(t.referrer_host=n);for(const r of["utm_source","utm_medium","utm_campaign"]){const n=e.get(r);n&&(t[r]=n)}return hu=t,t}(),pu=!0);let s="";try{s=(await Hc.post(cu,{json:r}).text()).trim()}finally{!s&&o&&(pu=!1)}if(!s)return;du=s,au()&&function(e,t,n){const r=/* @__PURE__ */new Date;r.setTime(r.getTime()+24*n*60*60*1e3),document.cookie=`${e}=${t};expires=${r.toUTCString()};path=/;SameSite=Lax;Secure`}(uu,s,14)}(e);if(!mu()&&!fu){const e=()=>{fu=null};fu=t.then(e,e)}await t}catch{}}function yu(e){const t={};for(const[n,r]of Object.entries(e))null!=r&&""!==r&&(t[n]=r);return t}function bu(e){return e<768?"mobile":e<1024?"tablet":"desktop"}function vu(){try{return document.referrer?new URL(document.referrer).host:""}catch{return""}}function wu(){const e=vu();return e?e===window.location.host?"search":"external":"direct"}function ku(e){let t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "==e.charAt(0);)e=e.substring(1);if(0==e.indexOf(t))return e.substring(t.length,e.length)}return""}function xu({filters:e,PortalSite:t,limit:n,skip:r,onPageChange:a,activePage:l,viewMode:f,onViewModeChange:m}){const{portalCode:g,apiUrl:_,locale:y}=o(Hi),{currency:b}=Ki(),[v,w]=u({status:"loading"}),k=JSON.stringify(function(e,{limit:t,skip:n,currency:r}){const o={limit:String(t),skip:String(n)};r&&(o.currency=r),e.countries&&(o.country_id=String(e.countries)),e.regions&&(o.region_id=String(e.regions)),e.cities&&(o.city_id=String(e.cities)),e.extra_search&&(o.extra_search=e.extra_search),Vc(o,"persons_min",e.persons_min),Vc(o,"persons_max",e.persons_max),Vc(o,"bedrooms_min",e.bedrooms_min),Vc(o,"bathrooms_min",e.bathrooms_min),Vc(o,"weekprice_max",e.weekprice_max);const s=Yc(e);return s.length>0&&(o.properties=s.join(",")),e.arrival_date&&(o.arrival_date=e.arrival_date,e.departure_date?(o.starts_at=e.arrival_date,o.ends_at=e.departure_date,Vc(o,"no_nights_min",Ce(le(e.departure_date),le(e.arrival_date)))):o.no_nights_min="1"),o}(e,{limit:n,skip:r,currency:b})),x=i(()=>JSON.parse(k),[k]),S=JSON.stringify(e),C=c(e);C.current=e;const E=c(null),N=c(null),T=c(null),R=()=>{const e=N.current;null!==e&&null!==T.current&&(N.current=null,E.current=e,_u({portal_code:g,locale:y,interaction_type:"search",interaction_info:ou(C.current,T.current)}))};if(s(()=>{if(E.current===S)return;const e=setTimeout(()=>{N.current=S,R()},1e3);return()=>{clearTimeout(e),N.current=null}},[S,g,y]),s(()=>{const e=new AbortController;return T.current=null,w({status:"loading"}),Wc({apiUrl:_,locale:y,portalCode:g,params:x,signal:e.signal}).then(t=>{e.signal.aborted||(w({status:"ready",response:t}),T.current=t.meta.total_count,R())}).catch(t=>{e.signal.aborted||w({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error("A search request failed")})}),()=>{e.abort()}},[_,y,g,x]),"loading"===v.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===v.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(qi,{errors:v.error})});const{items:A,meta:D}=v.response,P=f??t.options.filtersForm.mode,$=/* @__PURE__ */d(He,{totalCount:D.total_count,activePage:l,limit:n,onPageChange:a});/* @__PURE__ */
39
39
  return h("div",{id:"results",className:P,children:[
40
- /* @__PURE__ */h("div",{className:"bu-results-toolbar",children:[/* @__PURE__ */d(Ks,{}),m&&/* @__PURE__ */d(We,{mode:P,onChange:m})]}),I,0===A.length?/* @__PURE__ */d("div",{className:"bu-noresults",children:ne("no_results")}):null,A.map(e=>/* @__PURE__ */d("div",{style:{display:"contents"},dangerouslySetInnerHTML:{__html:Fe({result:e,options:t.options.filtersForm,currency:$.currency??b})}},e.id)),I]})}var ku=["countries","regions","cities","arrival_date","departure_date","persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max","extra_search"];var Su="bukazuViewMode";function Cu(){try{const t=window.localStorage.getItem(Su);return"grid"===(e=t)||"list"===e?t:null}catch{return null}var e}var Eu=class extends t{constructor(e){super(e);let t=Number(this.props.options.filtersForm.no_results);const n=(this.props.options.filtersForm.prefill_filters_from_url??!0)&&"undefined"!=typeof window?function(e){const t=new URLSearchParams(e),n={};return t.forEach((e,t)=>{if(e){if("properties"===t){const t=e.split(",").map(e=>e.trim()).filter(Boolean);return void(t.length>0&&(n.properties=t))}(ku.includes(t)||/^category_\d+$/.test(t))&&(n[t]=e)}}),n}(window.location.search):{};this.hasUrlFilters=Object.keys(n).length>0,this.state={filters:{...this.props.filters||{},...n},activePage:1,limit:t,skip:0,viewMode:Cu()??this.props.options.filtersForm.mode??"grid"},this.onFilterChange=this.onFilterChange.bind(this),this.onViewModeChange=this.onViewModeChange.bind(this),this.pageChange=this.pageChange.bind(this)}componentDidMount(){if(gu({portal_code:this.props.PortalSite.portal_code,interaction_type:"search_view",locale:this.props.locale,interaction_info:{}}),this.hasUrlFilters)return;let e=localStorage.getItem("bukazuFilters"),t=localStorage.getItem("bukazuActivePage");e&&this.setState({filters:JSON.parse(e)}),t&&this.pageChange(parseInt(t)||0)}onFilterChange(e){let t=e;this.setState({filters:t}),localStorage.setItem("bukazuFilters",JSON.stringify(t)),this.pageChange(0)}onViewModeChange(e){this.setState({viewMode:e}),function(e){try{window.localStorage.setItem(Su,e)}catch{}}(e)}pageChange(e){const{limit:t}=this.state;let n=e*t;localStorage.setItem("bukazuActivePage",e.toString()),this.setState({activePage:e,skip:n})}render(){const{filters:e,activePage:t,limit:n,skip:r,viewMode:o}=this.state,{options:i,PortalSite:s}=this.props;/* @__PURE__ */
41
- return h("div",{id:"search-page",className:"right"===i.filtersForm.location?"bu-reverse":"top"===i.filtersForm.location?"bu-column":"",children:[/* @__PURE__ */d(Me,{PortalSite:s,filters:e,onFilterChange:this.onFilterChange,options:i}),/* @__PURE__ */d(xu,{PortalSite:s,filters:e,activePage:t,onPageChange:this.pageChange,skip:r,limit:n,viewMode:o,onViewModeChange:this.onViewModeChange})]})}},Tu=class extends Error{constructor(e,t,n){super(t.join("\n")||`Booking request failed (${e})`),this.name="CreateBookingError",this.status=e,this.messages=t.length>0?t:[this.message],n&&(this.fieldErrors=n)}};async function Nu({apiUrl:e,locale:t,payload:n}){const r=function({apiUrl:e}){return new URL("/portal_api/v1/accommodations/bookings",new URL(e).origin).toString()}({apiUrl:e});try{return await zc.post(r,{json:n,headers:{locale:t}}).json()}catch(o){if(o instanceof Xs)throw await async function(e){const t=e.response.status;let n={};try{n=await e.response.json()}catch{return new Tu(t,[])}const r=n.error?[n.error]:[];return new Tu(t,r,n.errors)}(o);throw o}}var Ru=["first_name","preposition","last_name","company_name","email","phone","phone_mobile","address","house_number","zipcode","city","iban","bic","holder","comment","discount_code","discount_reason","currency"];function Au(e){if("string"!=typeof e)return;const t=e.trim();return""===t?void 0:t}function $u(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=Number(r);Number.isFinite(e)&&e>0&&(t[n]=e)}return t}function Pu({values:e,objectCode:t,portalCode:n,locale:r,sessionIdentifier:o}){const i={portal_code:n,object_code:t,starts_at:e.arrivalDate.date,ends_at:e.departureDate.date,is_option:"true"===e.is_option,language:r,country:e.country.toUpperCase(),adults:Number(e.adults)||0,children:Number(e.children)||0,babies:Number(e.babies)||0,discount:Number(e.discount)||0,cancel_insurance:Number(e.cancel_insurance)||0,costs:$u(e.costs)},s=function(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=Au(r);void 0!==e&&(t[n]=e)}return Object.keys(t).length>0?t:void 0}(e.extra_fields);s&&(i.extra_fields=s),o&&(i.session_identifier=o);for(const a of Ru){const t=Au(e[a]);void 0!==t&&(i[a]=t)}return i}function Iu({children:e,buttonText:t,show:n=!1,onClose:r}){const[o,s]=u(n),a=c(null);i(()=>{const e=a.current;e&&(o?e.showModal():e.close())},[o]);const p=()=>{s(!1),r?.()};/* @__PURE__ */
42
- return h(l,{children:[!o&&t&&/* @__PURE__ */d("button",{type:"button",className:"info-button",onClick:()=>s(!0),children:t}),/* @__PURE__ */h("dialog",{ref:a,className:"bukazu-modal",onCancel:p,onClick:e=>{e.target===a.current&&p()},children:[/* @__PURE__ */d("div",{className:"bukazu-modal-content",children:e}),/* @__PURE__ */d("div",{className:"bukazu-modal-footer",children:/* @__PURE__ */d("button",{type:"button",onClick:p,children:ne("close")})})]})]})}function Du(e){return Array.from({length:e+1},(e,t)=>t)}function ju(e){const t={};return e.forEach(e=>{t[e.id]=""}),t}function Lu(e){return e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".")}function Ou(e,t){const n=Lu(t);let r=e;for(const o of n){if(null===r||"object"!=typeof r||!(o in r))return;r=r[o]}return r}function Uu(e,t,n){const r=Lu(t),o={...e};let i=o,s=e;return r.forEach((e,t)=>{if(t===r.length-1)return void(i[e]=n);const o=null!==s&&"object"==typeof s?s[e]:void 0,a=null===o||"object"!=typeof o||Array.isArray(o)?{}:{...o};i[e]=a,i=a,s=o}),o}function Mu(e,t){let n=Number(t.babies)-Number(e.babies_extra);return n<0&&(n=0),Number(t.children)+Number(t.adults)+n}function qu(e,t){/* @__PURE__ */
43
- return d("option",{value:t,children:ne(e)})}var Bu=n({values:{arrivalDate:{},departureDate:{},is_option:"false",costs:{},adults:0,children:0,babies:0,persons:0,discount:0,country:"",cancel_insurance:"0",discount_code:"",extra_fields:{}},errors:{},touched:{},isSubmitting:!1,setFieldValue:()=>{},setFieldTouched:()=>{}});function Fu(e){const{values:t,errors:n,touched:r,setFieldValue:i}=o(Bu),s=n[e],a=Ou(n,e),c="string"==typeof s?s:"string"==typeof a?a:void 0,u=r[e],l=Ou(r,e);return{error:c,touched:"boolean"==typeof u?u:"boolean"==typeof l&&l,value:Ou(t,e)??"",onBlur:()=>{},onChange:t=>{i(e,t.target.value)}}}var zu={selectedDate:null,arrivalDate:null,departureDate:null,bookingStarted:!1,persons:0},Hu=n(zu),Yu=n(Ju);function Wu({children:e}){const[t,n]=a(Ju,zu);/* @__PURE__ */
44
- return d(Hu.Provider,{value:t,children:/* @__PURE__ */d(Yu.Provider,{value:n,children:e})})}function Ju(e,t){switch(t.type){case"clicked":{const{day:n,house:r}=t,{selectedDate:o,arrivalDate:i}=e,s=le(n.date),a=r.persons>2?2:r.persons;return n.departure&&o&&i&&xe(s,o)&&Se(s,o)<=r.max_nights&&Se(s,o)>=i.min_nights&&Se(s,o)<=i.max_nights?{...e,departureDate:n}:n.arrival?{bookingStarted:!1,selectedDate:s,arrivalDate:n,departureDate:null,persons:a}:e}case"reset":return zu;case"start":return{...e,bookingStarted:!0,persons:t.persons};case"return":return{...e,bookingStarted:!1};default:throw Error("Unknown action: "+t.type)}}var Vu=({error:e})=>e?/* @__PURE__ */d("div",{className:"input-feedback",children:e}):null,Ku=({name:e,value:t,currentValue:n,onChange:r,onBlur:o,id:i,label:s,...a})=>/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("input",{name:e,id:i,type:"radio",value:t,checked:t===n,onChange:r,onBlur:o,className:"radio-button",...a}),/* @__PURE__ */d("label",{htmlFor:i,children:s})]}),Gu=({error:e,touched:t,label:n,className:r,children:o})=>/* @__PURE__ */h("div",{className:r,children:[
45
- /* @__PURE__ */d("div",{className:"legend",children:n}),o,t&&/* @__PURE__ */d(Vu,{error:e})]});function Xu({house:e}){const t=Fu("is_option");/* @__PURE__ */
46
- return d(l,{children:e.allow_option&&/* @__PURE__ */d("div",{children:/* @__PURE__ */h(Gu,{id:"is_option",className:"booking_option",children:[/* @__PURE__ */d(Ku,{name:"is_option",value:"true",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"true",disabled:!e.allow_option,label:ne("option")}),/* @__PURE__ */d(Ku,{name:"is_option",value:"false",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"false",label:ne("booking")})]})})})}var Qu=({height:e="16px",width:t="16px"})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",style:{height:e,width:t},children:[
40
+ /* @__PURE__ */h("div",{className:"bu-results-toolbar",children:[/* @__PURE__ */d(Gi,{}),m&&/* @__PURE__ */d(Ve,{mode:P,onChange:m})]}),$,0===A.length?/* @__PURE__ */d("div",{className:"bu-noresults",children:ne("no_results")}):null,A.map(e=>/* @__PURE__ */d("div",{style:{display:"contents"},dangerouslySetInnerHTML:{__html:ze({result:e,options:t.options.filtersForm,currency:D.currency??b})}},e.id)),$]})}var Su=["countries","regions","cities","arrival_date","departure_date","persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max","extra_search"];var Cu="bukazuViewMode";function Eu(){try{const t=window.localStorage.getItem(Cu);return"grid"===(e=t)||"list"===e?t:null}catch{return null}var e}var Nu=class extends t{constructor(e){super(e);let t=Number(this.props.options.filtersForm.no_results);const n=(this.props.options.filtersForm.prefill_filters_from_url??!0)&&"undefined"!=typeof window?function(e){const t=new URLSearchParams(e),n={};return t.forEach((e,t)=>{if(e){if("properties"===t){const t=e.split(",").map(e=>e.trim()).filter(Boolean);return void(t.length>0&&(n.properties=t))}(Su.includes(t)||/^category_\d+$/.test(t))&&(n[t]=e)}}),n}(window.location.search):{};this.hasUrlFilters=Object.keys(n).length>0,this.state={filters:{...this.props.filters||{},...n},activePage:1,limit:t,skip:0,viewMode:Eu()??this.props.options.filtersForm.mode??"grid"},this.onFilterChange=this.onFilterChange.bind(this),this.onViewModeChange=this.onViewModeChange.bind(this),this.pageChange=this.pageChange.bind(this)}componentDidMount(){if(_u({portal_code:this.props.PortalSite.portal_code,interaction_type:"search_view",locale:this.props.locale,interaction_info:{}}),this.hasUrlFilters)return;let e=localStorage.getItem("bukazuFilters"),t=localStorage.getItem("bukazuActivePage");e&&this.setState({filters:JSON.parse(e)}),t&&this.pageChange(parseInt(t)||0)}onFilterChange(e){let t=e;this.setState({filters:t}),localStorage.setItem("bukazuFilters",JSON.stringify(t)),this.pageChange(0)}onViewModeChange(e){this.setState({viewMode:e}),function(e){try{window.localStorage.setItem(Cu,e)}catch{}}(e)}pageChange(e){const{limit:t}=this.state;let n=e*t;localStorage.setItem("bukazuActivePage",e.toString()),this.setState({activePage:e,skip:n})}render(){const{filters:e,activePage:t,limit:n,skip:r,viewMode:o}=this.state,{options:s,PortalSite:i}=this.props;/* @__PURE__ */
41
+ return h("div",{id:"search-page",className:"right"===s.filtersForm.location?"bu-reverse":"top"===s.filtersForm.location?"bu-column":"",children:[/* @__PURE__ */d(qe,{PortalSite:i,filters:e,onFilterChange:this.onFilterChange,options:s}),/* @__PURE__ */d(xu,{PortalSite:i,filters:e,activePage:t,onPageChange:this.pageChange,skip:r,limit:n,viewMode:o,onViewModeChange:this.onViewModeChange})]})}},Tu=class extends Error{constructor(e,t,n){super(t.join("\n")||`Booking request failed (${e})`),this.name="CreateBookingError",this.status=e,this.messages=t.length>0?t:[this.message],n&&(this.fieldErrors=n)}};async function Ru({apiUrl:e,locale:t,payload:n}){const r=function({apiUrl:e}){return new URL("/portal_api/v1/accommodations/bookings",new URL(e).origin).toString()}({apiUrl:e});try{return await Hc.post(r,{json:n,headers:{locale:t}}).json()}catch(o){if(o instanceof Qi)throw await async function(e){const t=e.response.status;let n={};try{n=await e.response.json()}catch{return new Tu(t,[])}const r=n.error?[n.error]:[];return new Tu(t,r,n.errors)}(o);throw o}}var Au=["first_name","preposition","last_name","company_name","email","phone","phone_mobile","address","house_number","zipcode","city","iban","bic","holder","comment","discount_code","discount_reason","currency"];function Du(e){if("string"!=typeof e)return;const t=e.trim();return""===t?void 0:t}function Pu(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=Number(r);Number.isFinite(e)&&e>0&&(t[n]=e)}return t}function $u({values:e,objectCode:t,portalCode:n,locale:r,sessionIdentifier:o}){const s={portal_code:n,object_code:t,starts_at:e.arrivalDate.date,ends_at:e.departureDate.date,is_option:"true"===e.is_option,language:r,country:e.country.toUpperCase(),adults:Number(e.adults)||0,children:Number(e.children)||0,babies:Number(e.babies)||0,discount:Number(e.discount)||0,cancel_insurance:Number(e.cancel_insurance)||0,costs:Pu(e.costs)},i=function(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=Du(r);void 0!==e&&(t[n]=e)}return Object.keys(t).length>0?t:void 0}(e.extra_fields);i&&(s.extra_fields=i),o&&(s.session_identifier=o);for(const a of Au){const t=Du(e[a]);void 0!==t&&(s[a]=t)}return s}function Iu({children:e,buttonText:t,show:n=!1,onClose:r}){const[o,i]=u(n),a=c(null);s(()=>{const e=a.current;e&&(o?e.showModal():e.close())},[o]);const p=()=>{i(!1),r?.()};/* @__PURE__ */
42
+ return h(l,{children:[!o&&t&&/* @__PURE__ */d("button",{type:"button",className:"info-button",onClick:()=>i(!0),children:t}),/* @__PURE__ */h("dialog",{ref:a,className:"bukazu-modal",onCancel:p,onClick:e=>{e.target===a.current&&p()},children:[/* @__PURE__ */d("div",{className:"bukazu-modal-content",children:e}),/* @__PURE__ */d("div",{className:"bukazu-modal-footer",children:/* @__PURE__ */d("button",{type:"button",onClick:p,children:ne("close")})})]})]})}function ju(e){return Array.from({length:e+1},(e,t)=>t)}function Lu(e){const t={};return e.forEach(e=>{t[e.id]=""}),t}function Mu(e){return e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".")}function Ou(e,t){const n=Mu(t);let r=e;for(const o of n){if(null===r||"object"!=typeof r||!(o in r))return;r=r[o]}return r}function Uu(e,t,n){const r=Mu(t),o={...e};let s=o,i=e;return r.forEach((e,t)=>{if(t===r.length-1)return void(s[e]=n);const o=null!==i&&"object"==typeof i?i[e]:void 0,a=null===o||"object"!=typeof o||Array.isArray(o)?{}:{...o};s[e]=a,s=a,i=o}),o}function qu(e,t){let n=Number(t.babies)-Number(e.babies_extra);return n<0&&(n=0),Number(t.children)+Number(t.adults)+n}var Bu=n({values:{arrivalDate:{},departureDate:{},is_option:"false",costs:{},adults:0,children:0,babies:0,persons:0,discount:0,country:"",cancel_insurance:"0",discount_code:"",extra_fields:{}},errors:{},touched:{},isSubmitting:!1,setFieldValue:()=>{},setFieldTouched:()=>{}});function Fu(){return o(Bu)}function zu(e){const{values:t,errors:n,touched:r,setFieldValue:o}=Fu(),s=n[e],i=Ou(n,e),a="string"==typeof s?s:"string"==typeof i?i:void 0,c=r[e],u=Ou(r,e);return{error:a,touched:"boolean"==typeof c?c:"boolean"==typeof u&&u,value:Ou(t,e)??"",onBlur:()=>{},onChange:t=>{o(e,t.target.value)}}}var Hu={selectedDate:null,arrivalDate:null,departureDate:null,bookingStarted:!1,persons:0,hoverDate:null,hoverValid:!1},Wu=n(Hu),Yu=n(Ju);function Vu({children:e,initialState:t}){const[n,r]=a(Ju,{...Hu,...t});/* @__PURE__ */
43
+ return d(Wu.Provider,{value:n,children:/* @__PURE__ */d(Yu.Provider,{value:r,children:e})})}function Ju(e,t){switch(t.type){case"clicked":{const{day:n,house:r}=t,{selectedDate:o,arrivalDate:s}=e,i=le(n.date),a=r.persons>2?2:r.persons;return n.departure&&o&&s&&xe(i,o)&&Ce(i,o)<=r.max_nights&&Ce(i,o)>=s.min_nights&&Ce(i,o)<=s.max_nights?{...e,departureDate:n,hoverDate:null,hoverValid:!1}:n.arrival?{...e,selectedDate:i,arrivalDate:n,departureDate:null,persons:e.bookingStarted?e.persons:a,hoverDate:null,hoverValid:!1}:e}case"hover":return{...e,hoverDate:t.date,hoverValid:t.valid};case"unhover":return e.hoverDate?{...e,hoverDate:null,hoverValid:!1}:e;case"set_dates":return{...e,selectedDate:le(t.arrivalDate.date),arrivalDate:t.arrivalDate,departureDate:t.departureDate,hoverDate:null,hoverValid:!1};case"reset":return Hu;case"start":return{...e,bookingStarted:!0,persons:t.persons};case"return":return{...e,bookingStarted:!1};default:throw Error("Unknown action: "+t.type)}}var Ku=({error:e})=>e?/* @__PURE__ */d("div",{className:"input-feedback",children:e}):null,Gu=({name:e,value:t,currentValue:n,onChange:r,onBlur:o,id:s,label:i,...a})=>/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("input",{name:e,id:s,type:"radio",value:t,checked:t===n,onChange:r,onBlur:o,className:"radio-button",...a}),/* @__PURE__ */d("label",{htmlFor:s,children:i})]}),Xu=({error:e,touched:t,label:n,className:r,children:o})=>/* @__PURE__ */h("div",{className:r,children:[
44
+ /* @__PURE__ */d("div",{className:"legend",children:n}),o,t&&/* @__PURE__ */d(Ku,{error:e})]});function Qu({house:e}){const t=zu("is_option");/* @__PURE__ */
45
+ return d(l,{children:e.allow_option&&/* @__PURE__ */d("div",{children:/* @__PURE__ */h(Xu,{id:"is_option",className:"booking_option",children:[/* @__PURE__ */d(Gu,{name:"is_option",value:"true",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"true",disabled:!e.allow_option,label:ne("option")}),/* @__PURE__ */d(Gu,{name:"is_option",value:"false",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"false",label:ne("booking")})]})})})}var Zu=({height:e="16px",width:t="16px"})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",style:{height:e,width:t},children:[
47
46
  /* @__PURE__ */d("path",{d:"M50,5c24.813,0,45,20.187,45,45c0,24.813-20.187,45-45,45C25.187,95,5,74.813,5,50C5,25.187,25.187,5,50,5 M50,0C22.386,0,0,22.386,0,50c0,27.614,22.386,50,50,50c27.614,0,50-22.386,50-50C100,22.386,77.614,0,50,0L50,0z"}),
48
47
  /* @__PURE__ */d("circle",{cx:"50",cy:"29.546",r:"4.934"}),
49
- /* @__PURE__ */d("rect",{x:"46.5",y:"41.21",width:"7",height:"34.179"})]});function Zu({description:e}){let t=/* @__PURE__ */d("span",{});return e&&(t=/* @__PURE__ */d("span",{style:{padding:"0 0 0 8px"},children:/* @__PURE__ */d(Iu,{buttonText:/* @__PURE__ */d(Qu,{}),children:/* @__PURE__ */d("p",{children:e})})})),t}function el({name:e,amount:t,description:n,method_name:r,formatName:o,forceMethod:i,currency:s="EUR"}){/* @__PURE__ */
50
- return h("tr",{children:[/* @__PURE__ */h("td",{children:[o?ne(e):e,n&&/* @__PURE__ */d(l,{children:/* @__PURE__ */d(Zu,{description:n})})]}),/* @__PURE__ */d("td",{className:"price",children:t&&t>0?/* @__PURE__ */h(l,{children:[re(t,{style:"currency",currency:s}),i&&/* @__PURE__ */h(l,{children:[" ",r]})]}):/* @__PURE__ */d(l,{children:r})})]})}function tl({prices:e}){const{insurances:t,required_costs:n}=e.total_costs,{not_on_site:r}=n,{currency:o}=e;/* @__PURE__ */
51
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[t&&/* @__PURE__ */d(l,{children:Object.keys(t).map(e=>{const n=t[e];if(n>0)/* @__PURE__ */return d(el,{name:e,formatName:!0,amount:n,currency:o},e)})}),e.required_house_costs.map(e=>{if(!e.on_site&&"0120"!==e.gl)return"none"===e.method?/* @__PURE__ */d(el,{...e,currency:o},e.id):0===e.amount?null:/* @__PURE__ */d(el,{...e,amount:r?.find(t=>t.id==e.id)?.amount??0,currency:o},e.id)})]})})})}el.defaultValues={formatName:!1,forceMethod:!1};var nl=class extends Error{constructor(e,t){super(`No prices available for ${e} - ${t}`),this.name="PriceUnavailableError"}};async function rl(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,startsAt:r,endsAt:o,persons:i,currency:s,cancelInsurance:a,discount:c,discountCode:u,costs:l,includeAccommodation:d}){const h=new URL("/portal_api/v1/accommodations/price",new URL(e).origin),p=new URLSearchParams({portal_code:t,object_code:n,starts_at:r,ends_at:o});if(void 0!==i&&p.set("persons",String(i)),s&&p.set("currency",s),void 0!==a&&p.set("cancel_insurance",String(a)),void 0!==c&&p.set("discount",String(c)),u&&p.set("discount_code",u),l)for(const[f,m]of Object.entries(l))p.set(`costs[${f}]`,String(m));return d&&p.set("include_accommodation","true"),h.search=p.toString(),h.toString()}(e);let n;try{n=await zc.get(t,{headers:{locale:e.locale}}).json()}catch(r){if(r instanceof Xs){if(422===r.response.status)throw new nl(e.startsAt,e.endsAt);throw new Error(`Price request failed (${r.response.status})`)}throw r}if(!n.currency)throw new nl(e.startsAt,e.endsAt);return n}function ol({prices:e}){const{rent_price:t,discount:n,discounted_price:r,currency:o}=e;/* @__PURE__ */
52
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[/* @__PURE__ */d(el,{name:"rent_price",formatName:!0,amount:t,currency:o}),n>0?/* @__PURE__ */h(l,{children:[/* @__PURE__ */d(el,{name:"discount",formatName:!0,amount:n,currency:o}),/* @__PURE__ */d(el,{name:"price_after_discount",formatName:!0,amount:r,currency:o})]}):null]})})})}function il({prices:e}){const{optional_costs:t}=e.total_costs,{not_on_site:n}=t;/* @__PURE__ */
53
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e.optional_house_costs.map(t=>{if(!t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(el,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(el,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(el,{...t,amount:r,currency:e.currency},t.id)}}})})})})}function sl({prices:e}){const{optional_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
54
- return d(l,{children:e.optional_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(el,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n?.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(el,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n?.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(el,{...t,amount:r,currency:e.currency},t.id)}}})})}function al({prices:e}){const{required_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
55
- return h("div",{className:"costs-section",children:[/* @__PURE__ */d("strong",{children:ne("costs_on_site")}),/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[e.required_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(el,{...t,currency:e.currency},t.id);{let r=n.find(e=>e.id==t.id)?.amount??0;/* @__PURE__ */
56
- return d(el,{...t,amount:r,currency:e.currency},t.id)}}}),/* @__PURE__ */d(sl,{prices:e})]})})]})}function cl({children:e}){/* @__PURE__ */
57
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e})})})}function ul({prices:e}){const{currency:t}=e;/* @__PURE__ */
48
+ /* @__PURE__ */d("rect",{x:"46.5",y:"41.21",width:"7",height:"34.179"})]});function el({description:e}){let t=/* @__PURE__ */d("span",{});return e&&(t=/* @__PURE__ */d("span",{style:{padding:"0 0 0 8px"},children:/* @__PURE__ */d(Iu,{buttonText:/* @__PURE__ */d(Zu,{}),children:/* @__PURE__ */d("p",{children:e})})})),t}function tl({name:e,amount:t,description:n,method_name:r,formatName:o,forceMethod:s,currency:i="EUR"}){/* @__PURE__ */
49
+ return h("tr",{children:[/* @__PURE__ */h("td",{children:[o?ne(e):e,n&&/* @__PURE__ */d(l,{children:/* @__PURE__ */d(el,{description:n})})]}),/* @__PURE__ */d("td",{className:"price",children:t&&t>0?/* @__PURE__ */h(l,{children:[re(t,{style:"currency",currency:i}),s&&/* @__PURE__ */h(l,{children:[" ",r]})]}):/* @__PURE__ */d(l,{children:r})})]})}function nl({prices:e}){const{insurances:t,required_costs:n}=e.total_costs,{not_on_site:r}=n,{currency:o}=e;/* @__PURE__ */
50
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[t&&/* @__PURE__ */d(l,{children:Object.keys(t).map(e=>{const n=t[e];if(n>0)/* @__PURE__ */return d(tl,{name:e,formatName:!0,amount:n,currency:o},e)})}),e.required_house_costs.map(e=>{if(!e.on_site&&"0120"!==e.gl)return"none"===e.method?/* @__PURE__ */d(tl,{...e,currency:o},e.id):0===e.amount?null:/* @__PURE__ */d(tl,{...e,amount:r?.find(t=>t.id==e.id)?.amount??0,currency:o},e.id)})]})})})}tl.defaultValues={formatName:!1,forceMethod:!1};var rl=class extends Error{constructor(e,t){super(`No prices available for ${e} - ${t}`),this.name="PriceUnavailableError"}};async function ol(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,startsAt:r,endsAt:o,persons:s,currency:i,cancelInsurance:a,discount:c,discountCode:u,costs:l,includeAccommodation:d}){const h=new URL("/portal_api/v1/accommodations/price",new URL(e).origin),p=new URLSearchParams({portal_code:t,object_code:n,starts_at:r,ends_at:o});if(void 0!==s&&p.set("persons",String(s)),i&&p.set("currency",i),void 0!==a&&p.set("cancel_insurance",String(a)),void 0!==c&&p.set("discount",String(c)),u&&p.set("discount_code",u),l)for(const[f,m]of Object.entries(l))p.set(`costs[${f}]`,String(m));return d&&p.set("include_accommodation","true"),h.search=p.toString(),h.toString()}(e);let n;try{n=await Hc.get(t,{headers:{locale:e.locale}}).json()}catch(r){if(r instanceof Qi){if(422===r.response.status)throw new rl(e.startsAt,e.endsAt);throw new Error(`Price request failed (${r.response.status})`)}throw r}if(!n.currency)throw new rl(e.startsAt,e.endsAt);return n}function sl({prices:e}){const{rent_price:t,discount:n,discounted_price:r,currency:o}=e;/* @__PURE__ */
51
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[/* @__PURE__ */d(tl,{name:"rent_price",formatName:!0,amount:t,currency:o}),n>0?/* @__PURE__ */h(l,{children:[/* @__PURE__ */d(tl,{name:"discount",formatName:!0,amount:n,currency:o}),/* @__PURE__ */d(tl,{name:"price_after_discount",formatName:!0,amount:r,currency:o})]}):null]})})})}function il({prices:e}){const{optional_costs:t}=e.total_costs,{not_on_site:n}=t;/* @__PURE__ */
52
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e.optional_house_costs.map(t=>{if(!t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(tl,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(tl,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(tl,{...t,amount:r,currency:e.currency},t.id)}}})})})})}function al({prices:e}){const{optional_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
53
+ return d(l,{children:e.optional_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(tl,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n?.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(tl,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n?.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(tl,{...t,amount:r,currency:e.currency},t.id)}}})})}function cl({prices:e}){const{required_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
54
+ return h("div",{className:"costs-section",children:[/* @__PURE__ */d("strong",{children:ne("costs_on_site")}),/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[e.required_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(tl,{...t,currency:e.currency},t.id);{let r=n.find(e=>e.id==t.id)?.amount??0;/* @__PURE__ */
55
+ return d(tl,{...t,amount:r,currency:e.currency},t.id)}}}),/* @__PURE__ */d(al,{prices:e})]})})]})}function ul({children:e}){/* @__PURE__ */
56
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e})})})}function ll({prices:e}){const{currency:t}=e;/* @__PURE__ */
58
57
  return h(l,{children:[
59
- /* @__PURE__ */d(cl,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:ne("total")}),/* @__PURE__ */d("th",{className:"price",style:{fontSize:18},children:re(e.total_costs.sub_total,{style:"currency",currency:t})})]})}),
60
- /* @__PURE__ */h(cl,{children:[
61
- /* @__PURE__ */d(ll,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.on_site,currency:t}),
62
- /* @__PURE__ */d(ll,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.not_on_site,currency:t}),
63
- /* @__PURE__ */d(ll,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.on_site,currency:t}),
64
- /* @__PURE__ */d(ll,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.not_on_site,currency:t})]}),
65
- /* @__PURE__ */d(cl,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:ne("total")}),/* @__PURE__ */d("td",{className:"price",children:re(e.total_costs.total_price,{style:"currency",currency:t})})]})})]})}function ll({cost_array:e,price_array:t,currency:n}){/* @__PURE__ */
66
- return d(l,{children:e.map(e=>{let r=t.find(t=>t.id==e.id);if("0120"===e.gl&&r&&r.amount>0)/* @__PURE__ */return d(el,{...e,amount:r.amount,currency:n},e.id)})})}function dl({values:e,house:t}){let n=Number(e.babies)-Number(t.babies_extra);n<0&&(n=0);const r=Number(e.children)+Number(e.adults)+n,{portalCode:s,objectCode:a,locale:c,apiUrl:p}=o(zs),{currency:f}=Vs(),[m,g]=u(null),[_,y]=u(!0),[b,v]=u(null);return i(()=>{let t=!1;return y(!0),v(null),rl({apiUrl:p,locale:c,portalCode:s,objectCode:a,startsAt:e.arrivalDate.date,endsAt:e.departureDate.date,persons:r,currency:f,costs:e.costs,discount:Number(e.discount),discountCode:e.discount_code,cancelInsurance:Number(e.cancel_insurance)}).then(e=>{t||(g(e),y(!1))}).catch(e=>{t||(v(e),y(!1))}),()=>{t=!0}},[p,c,s,a,e.arrivalDate.date,e.departureDate.date,r,f,e.costs,e.discount,e.discount_code,e.cancel_insurance]),_?/* @__PURE__ */d("span",{children:"Loading..."}):b||!m?/* @__PURE__ */d("div",{children:String(b)}):/* @__PURE__ */h(l,{children:[
67
- /* @__PURE__ */d(ol,{prices:m}),
68
- /* @__PURE__ */d(tl,{prices:m}),
69
- /* @__PURE__ */d(il,{prices:m}),
70
- /* @__PURE__ */d(al,{prices:m}),
71
- /* @__PURE__ */d(ul,{prices:m})]})}var hl=class{constructor(e,t){this.house=e,this.values=t,this.t={formatMessage:(e,t)=>ne(e.id,t)}}updateValues(e){this.values=e}render(){const{arrivalDate:e,departureDate:t}=this.values,n=document.createDocumentFragment(),r=document.createElement("h2");r.textContent=this.t.formatMessage({id:"booking_details"}),n.appendChild(r);const o=document.createElement("div");o.className="house-details";const i=document.createElement("div");if(i.textContent=this.house.name,o.appendChild(i),this.house.image_url){const e=document.createElement("img");e.src=this.house.image_url,e.alt="",o.appendChild(e)}const s=document.createElement("table"),a=document.createElement("tbody"),c=document.createElement("tr"),u=document.createElement("th");u.textContent=this.t.formatMessage({id:`${this.house.house_type}.arrival`});const l=document.createElement("td");l.className="price",l.textContent=ue(le(e.date),Ee);const d=document.createElement("td");d.textContent=`${e.arrival_time_from} - ${e.arrival_time_to}`,c.append(u,l,d);const h=document.createElement("tr"),p=document.createElement("th");p.textContent=this.t.formatMessage({id:`${this.house.house_type}.departure`});const f=document.createElement("td");f.className="price",f.textContent=ue(le(t.date),Ee);const m=document.createElement("td");m.textContent=t.departure_time??"",h.append(p,f,m),a.append(c,h),s.appendChild(a),o.appendChild(s),n.appendChild(o);const g=document.createElement("div");return g.appendChild(n),g}};function pl({values:e,house:t}){const n=c(null),r=c(null);return n.current||(n.current=new hl(t,e)),i(()=>{if(n.current&&(n.current.updateValues(e),r.current)){for(;r.current.firstChild;)r.current.removeChild(r.current.firstChild);r.current.appendChild(n.current.render())}},[e,t]),/* @__PURE__ */h("div",{children:[
72
- /* @__PURE__ */d("div",{ref:r}),
73
- /* @__PURE__ */d(Xu,{house:t}),
74
- /* @__PURE__ */d(dl,{values:e,house:t})]})}function fl({label:e,description:t,count:n=0,name:r}){const o=Du(n),i=Fu(r);/* @__PURE__ */
58
+ /* @__PURE__ */d(ul,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:ne("total")}),/* @__PURE__ */d("th",{className:"price",style:{fontSize:18},children:re(e.total_costs.sub_total,{style:"currency",currency:t})})]})}),
59
+ /* @__PURE__ */h(ul,{children:[
60
+ /* @__PURE__ */d(dl,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.on_site,currency:t}),
61
+ /* @__PURE__ */d(dl,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.not_on_site,currency:t}),
62
+ /* @__PURE__ */d(dl,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.on_site,currency:t}),
63
+ /* @__PURE__ */d(dl,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.not_on_site,currency:t})]}),
64
+ /* @__PURE__ */d(ul,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:ne("total")}),/* @__PURE__ */d("td",{className:"price",children:re(e.total_costs.total_price,{style:"currency",currency:t})})]})})]})}function dl({cost_array:e,price_array:t,currency:n}){/* @__PURE__ */
65
+ return d(l,{children:e.map(e=>{let r=t.find(t=>t.id==e.id);if("0120"===e.gl&&r&&r.amount>0)/* @__PURE__ */return d(tl,{...e,amount:r.amount,currency:n},e.id)})})}function hl({values:e,house:t,onPrices:n}){let r=Number(e.babies)-Number(t.babies_extra);r<0&&(r=0);const i=Number(e.children)+Number(e.adults)+r,{portalCode:a,objectCode:c,locale:p,apiUrl:f}=o(Hi),{currency:m}=Ki(),[g,_]=u(null),[y,b]=u(!0),[v,w]=u(null);return s(()=>{let t=!1;return b(!0),w(null),ol({apiUrl:f,locale:p,portalCode:a,objectCode:c,startsAt:e.arrivalDate.date,endsAt:e.departureDate.date,persons:i,currency:m,costs:e.costs,discount:Number(e.discount),discountCode:e.discount_code,cancelInsurance:Number(e.cancel_insurance)}).then(e=>{t||(_(e),b(!1),n?.(e))}).catch(e=>{t||(w(e),b(!1),n?.(null))}),()=>{t=!0}},[f,p,a,c,e.arrivalDate.date,e.departureDate.date,i,m,e.costs,e.discount,e.discount_code,e.cancel_insurance]),y?/* @__PURE__ */d("span",{children:"Loading..."}):v||!g?/* @__PURE__ */d("div",{children:String(v)}):/* @__PURE__ */h(l,{children:[
66
+ /* @__PURE__ */d(sl,{prices:g}),
67
+ /* @__PURE__ */d(nl,{prices:g}),
68
+ /* @__PURE__ */d(il,{prices:g}),
69
+ /* @__PURE__ */d(cl,{prices:g}),
70
+ /* @__PURE__ */d(ll,{prices:g})]})}var pl=({size:e=16})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[/* @__PURE__ */d("rect",{x:"3",y:"4",width:"14",height:"13",rx:"2"}),/* @__PURE__ */d("path",{d:"M3 8h14M7 2v4M13 2v4"})]}),fl=({size:e=24})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
71
+ /* @__PURE__ */d("rect",{x:"3",y:"4",width:"14",height:"12",rx:"2"}),
72
+ /* @__PURE__ */d("circle",{cx:"7.5",cy:"8.5",r:"1.5"}),
73
+ /* @__PURE__ */d("path",{d:"M17 13l-4-4-7 7"})]}),ml={weekday:"short",day:"numeric",month:"short"};function gl({house:e,values:t,onChangeDates:n}){const{arrivalDate:r,departureDate:o}=t,s=le(r.date),i=le(o.date),a=Ce(i,s),c=[r.arrival_time_from&&r.arrival_time_to?`${ne(`${e.house_type}.arrival`)} ${r.arrival_time_from} - ${r.arrival_time_to}`:null,o.departure_time?`${ne(`${e.house_type}.departure`)} ${o.departure_time}`:null].filter(e=>null!==e);/* @__PURE__ */
74
+ return h("div",{className:"house-details bu-stay-card",children:[
75
+ /* @__PURE__ */d("h2",{className:"bu-visually-hidden",children:ne("booking_details")}),
76
+ /* @__PURE__ */h("div",{className:"bu-stay-card-house",children:[e.image_url?/* @__PURE__ */d("img",{src:e.image_url,alt:"",className:"bu-stay-card-image"}):/* @__PURE__ */d("div",{className:"bu-stay-card-image bu-stay-card-placeholder",children:/* @__PURE__ */d(fl,{})}),/* @__PURE__ */d("div",{className:"bu-stay-card-name",children:e.name})]}),
77
+ /* @__PURE__ */h("div",{className:"bu-stay-card-dates",children:[
78
+ /* @__PURE__ */h("div",{className:"bu-stay-card-row",children:[/* @__PURE__ */h("span",{className:"bu-stay-card-range",children:[
79
+ /* @__PURE__ */d(pl,{}),ue(s,ml)," →"," ",ue(i,ml)]}),n&&/* @__PURE__ */d("button",{type:"button",className:"bu-link-button",onClick:n,children:ne("change_dates")})]}),
80
+ /* @__PURE__ */h("div",{className:"bu-stay-card-meta",children:[/* @__PURE__ */d("span",{children:ne("nights",{count:a})}),/* @__PURE__ */h("span",{children:[t.persons," ",ne("persons")]})]}),c.length>0&&/* @__PURE__ */d("div",{className:"bu-stay-card-meta",children:c.map(e=>/* @__PURE__ */d("span",{children:e},e))})]})]})}function _l({values:e,house:t,onChangeDates:n,onPrices:r}){/* @__PURE__ */
81
+ return h("div",{className:"bu-summary",children:[
82
+ /* @__PURE__ */d(gl,{house:t,values:e,onChangeDates:n}),
83
+ /* @__PURE__ */d(Qu,{house:t}),
84
+ /* @__PURE__ */d(hl,{values:e,house:t,onPrices:r})]})}var yl=({size:e=16})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M4 10h12M11 5l5 5-5 5"})}),bl=({size:e=14})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M4 16h3l9-9-3-3-9 9z"})});function vl({house:e,persons:t,onChange:n}){const{arrivalDate:r,departureDate:s}=o(Wu);if(!r||!s)return null;const i=le(r.date),a=le(s.date),c=Ce(a,i),u=(e,t)=>/* @__PURE__ */h("button",{type:"button",className:"bu-date-pill",onClick:n,children:[/* @__PURE__ */d(pl,{}),/* @__PURE__ */h("span",{className:"bu-date-pill-text",children:[/* @__PURE__ */d("span",{className:"bu-date-pill-label",children:e}),/* @__PURE__ */d("span",{className:"bu-date-pill-value",children:ue(t,Ne)})]})]});/* @__PURE__ */
85
+ return h("div",{className:"bu-date-strip",children:[/* @__PURE__ */h("div",{className:"bu-date-strip-dates",children:[u(ne(`${e.house_type}.arrival`),i),
86
+ /* @__PURE__ */d("span",{className:"bu-date-strip-arrow","aria-hidden":"true",children:/* @__PURE__ */d(yl,{size:18})}),u(ne(`${e.house_type}.departure`),a),
87
+ /* @__PURE__ */d("span",{className:"bu-pill",children:ne("nights",{count:c})}),
88
+ /* @__PURE__ */h("span",{className:"bu-pill",children:[t," ",ne("persons")]})]}),/* @__PURE__ */h("button",{type:"button",className:"bu-link-button bu-date-strip-change",onClick:n,children:[/* @__PURE__ */d(bl,{}),ne("change_dates")]})]})}function wl({house:e}){/* @__PURE__ */
89
+ return h("div",{className:"legend bu-legend",children:[
90
+ /* @__PURE__ */h("div",{className:"bu-legend-item",children:[/* @__PURE__ */d("span",{className:"legend-field bu-legend-swatch arrival"}),ne(`${e.house_type}.arrival_date`)]}),
91
+ /* @__PURE__ */h("div",{className:"bu-legend-item",children:[/* @__PURE__ */d("span",{className:"legend-field bu-legend-swatch booked"}),ne("booked")]}),
92
+ /* @__PURE__ */h("div",{className:"bu-legend-item",children:[/* @__PURE__ */d("span",{className:"legend-field bu-legend-swatch departure"}),ne(`${e.house_type}.departure_date`)]}),
93
+ /* @__PURE__ */h("div",{className:"bu-legend-item",children:[/* @__PURE__ */d("span",{className:"legend-field bu-legend-swatch last_minute_discount"}),ne("discount")]})]})}async function kl({apiUrl:e,locale:t,portalCode:n,objectCode:r,startsDate:o,endDate:s}){const i=function({apiUrl:e,portalCode:t,objectCode:n,startsDate:r,endDate:o}){const s=new URL("/portal_api/v1/accommodations/availability",new URL(e).origin);return s.search=new URLSearchParams({portal_code:t,object_code:n,starts_date:de(r),end_date:de(o)}).toString(),s.toString()}({apiUrl:e,portalCode:n,objectCode:r,startsDate:o,endDate:s});try{return await Hc.get(i,{headers:{locale:t}}).json()}catch(a){if(a instanceof Qi)throw new Error(`Availability request failed (${a.response.status})`);throw a}}var xl=({size:e=16})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M12 5l-5 5 5 5"})}),Sl=({size:e=16})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M8 5l5 5-5 5"})}),Cl=({month:e,onPrev:t,onNext:n,prevDisabled:r=!1})=>/* @__PURE__ */h("div",{className:"bu-month-header bu-bold",children:[t?/* @__PURE__ */d("button",{type:"button",className:"bu-month-nav","aria-label":ne("previous_month"),disabled:r,onClick:t,children:/* @__PURE__ */d(xl,{})}):/* @__PURE__ */d("div",{className:"bu-month-nav bu-month-nav-spacer","aria-hidden":"true"}),
94
+ /* @__PURE__ */d("div",{className:"bu-month-title bu-text-center",children:/* @__PURE__ */d("span",{children:ue(e,Ee)})}),n?/* @__PURE__ */d("button",{type:"button",className:"bu-month-nav","aria-label":ne("next_month"),onClick:n,children:/* @__PURE__ */d(Sl,{})}):/* @__PURE__ */d("div",{className:"bu-month-nav bu-month-nav-spacer","aria-hidden":"true"})]});function El({day:e,buDate:t,prevBooked:n,dates:r,house:o}){const{selectedDate:s,arrivalDate:i}=r;if(!s)return!1;const a=Ce(e,s),c=a>=(i?.min_nights??0),u=a<=o.max_nights&&a<=(i?.max_nights??0);return t.departure&&xe(e,s)&&c&&u&&void 0!==n&&0!==n.max_nights}function Nl({day:e,monthStart:t,buDate:n,prevBooked:r,dates:o,house:s,discounts:i}){const{selectedDate:a,departureDate:c,arrivalDate:u,hoverDate:l,hoverValid:d}=o,h=/* @__PURE__ */new Date,p=["bu-day"];if(!ke(e,t))return p.push("disabled"),p.join(" ");if(Se(e,pe(h,1))&&p.push("bu-past"),n&&(n.arrival&&xe(e,pe(h,1))&&0!==n.max_nights?0===r?.max_nights?p.push("departure-arrival"):p.push("arrival"):0===n.max_nights?void 0!==r&&0!==r.max_nights?p.push("booked-departure"):p.push("booked"):n.max_nights>0&&(void 0===r||0===r.max_nights)&&!n.arrival&&p.push("booked")),we(e,h)&&p.push("bu-today"),a&&(we(e,a)&&(p.push("selected","bu-stay-start"),c?p.push("bu-stay-has-end"):l&&d&&xe(l,a)&&p.push("bu-preview-start")),El({day:e,buDate:n,prevBooked:r,dates:o,house:s})&&p.push("departure")),c&&a){const t=le(c.date);xe(e,a)&&Se(e,t)&&p.push("selected","bu-stay-in"),we(e,t)&&p.push("selected","bu-stay-end")}else a&&l&&xe(l,a)&&(we(e,l)?p.push("bu-preview",d?"bu-preview-end":"bu-preview-invalid"):d&&xe(e,a)&&Se(e,l)&&p.push("bu-preview","bu-preview-in"));const f=Ce(e,h),m=f<=s.last_minute_days&&f>0,g=i.find(t=>Se(pe(le(t.discount_starts_at),1),e)&&xe(he(le(t.discount_ends_at),1),e));return(m||g||n.special_offer>0)&&p.push("discount"),p.join(" ")}function Tl({availabilities:e,month:t,discounts:n,house:r}){const s=o(Yu),i=o(Wu),a=_e(t),c=ye(a),u=be(a),l=ve(c),h=/* @__PURE__ */new Date,p=[],f=null!==i.selectedDate&&null===i.departureDate;let m=u;for(;m<=l;){const t=de(m),o=de(pe(m,1)),c=e.find(e=>e.date===t),u=e.find(e=>e.date===o);if(!c||!ke(m,a)){p.push(/* @__PURE__ */d("div",{className:"bu-day disabled","aria-hidden":"true",children:/* @__PURE__ */d("span",{children:ue(m,{day:"numeric"})})},t)),m=he(m,1);continue}const l=c,g=m,_=Se(g,pe(h,1)),y=El({day:g,buDate:c,prevBooked:u,dates:i,house:r}),b=Nl({day:g,monthStart:a,discounts:n,buDate:c,prevBooked:u,house:r,dates:i});let v;b.includes("bu-preview-invalid")&&i.arrivalDate&&i.selectedDate&&Ce(g,i.selectedDate)<i.arrivalDate.min_nights&&(v=ne("minimum_nights",{minimum:i.arrivalDate.min_nights}));const w=()=>{_||s({type:"clicked",day:l,house:r})};p.push(/* @__PURE__ */d("div",{className:b,role:"button",tabIndex:_?-1:0,"aria-label":ue(g,Ne),"aria-disabled":_||void 0,"data-bu-tip":v,onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},onMouseEnter:()=>{f&&!_&&s({type:"hover",date:g,valid:y})},onMouseLeave:()=>{f&&s({type:"unhover"})},children:/* @__PURE__ */d("span",{children:ue(g,{day:"numeric"})})},c.date)),m=he(m,1)}/* @__PURE__ */
95
+ return d("div",{className:"bu-days bu-grid bu-grid-cols-7",children:p})}function Rl({month:e}){const t={weekday:"short"};let n=[],r=be(e);for(let o=0;o<7;o++)n.push(/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:ue(he(r,o),t)},o));/* @__PURE__ */
96
+ return d("div",{className:"bu-weekdays bu-grid bu-grid-cols-7",children:n})}function Al({count:e,currentMonth:t,house:n,availabilities:r,discounts:o,onPrev:s,onNext:i,prevDisabled:a}){const c=fe(t,e);/* @__PURE__ */
97
+ return h("div",{className:"bu-calendar calendar",children:[
98
+ /* @__PURE__ */d(Cl,{month:c,onPrev:s,onNext:i,prevDisabled:a}),
99
+ /* @__PURE__ */d(Rl,{month:c}),
100
+ /* @__PURE__ */d(Tl,{availabilities:r,discounts:o,month:c,house:n})]},c.toISOString())}function Dl({numberOfMonthsInARow:e,currentMonth:t,numberOfMonths:n,house:r,changeMonth:i}){const{portalCode:a,objectCode:c,locale:l,apiUrl:h}=o(Hi),[f,m]=u(null),[g,_]=u(!0),[y,b]=u(!1);if(s(()=>{let e=!1;_(!0),b(!1);const r=be(_e(t)),o=ve(ye(fe(t,n-1)));return kl({apiUrl:h,locale:l,portalCode:a,objectCode:c,startsDate:r,endDate:o}).then(t=>{e||(m(t),_(!1))}).catch(()=>{e||(b(!0),_(!1))}),()=>{e=!0}},[h,l,a,c,t,n]),g)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if(y||!f)/* @__PURE__ */return d("div",{children:"Error"});const v=!xe(_e(t),_e(/* @__PURE__ */new Date)),w=i?()=>i(fe(t,-n)):void 0,k=i?()=>i(fe(t,n)):void 0;let x=[];for(let o=0;o<n;o++)x.push(/* @__PURE__ */d(Al,{house:r,currentMonth:t,count:o,availabilities:f.availabilities,discounts:f.discounts,onPrev:0===o?w:void 0,onNext:o===n-1?k:void 0,prevDisabled:v},de(fe(t,o)).slice(0,7)));/* @__PURE__ */
101
+ return d("div",{className:"bu-months",style:{"--bu-months-per-row":e||2},children:x})}function Pl({house:e}){const{departureDate:t,arrivalDate:n}=o(Wu);if(t?.date&&n?.date){const e=le(n.date),r=le(t.date);/* @__PURE__ */
102
+ return h("div",{className:"bu-assistance",role:"status",children:[/* @__PURE__ */h("span",{className:"bu-assistance-title",children:[ue(e,Ne)," →"," ",ue(r,Ne)]}),/* @__PURE__ */d("span",{className:"bu-assistance-hint",children:ne("nights",{count:Ce(r,e)})})]})}return n?.date?/* @__PURE__ */h("div",{className:"bu-assistance",role:"status",children:[/* @__PURE__ */d("span",{className:"bu-assistance-title",children:ne(`${e.house_type}.pick_your_departure_in_the_calendar`)}),/* @__PURE__ */h("span",{className:"bu-assistance-hint",children:[ne(`${e.house_type}.you_picked_arrival_date`)," ",ue(le(n.date),Ne)," ·"," ",ne("minimum_nights",{minimum:n.min_nights})]})]}):/* @__PURE__ */d("div",{className:"bu-assistance",role:"status",children:/* @__PURE__ */d("span",{className:"bu-assistance-title",children:ne(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})})}function $l({house:e,numberOfMonths:t,numberOfMonthsInARow:n,onClose:r,onApply:s}){const{selectedDate:i,arrivalDate:a,departureDate:c}=o(Wu),[p,f]=u(()=>_e(i??/* @__PURE__ */new Date));/* @__PURE__ */
103
+ return h(l,{children:[
104
+ /* @__PURE__ */d(Pl,{house:e}),
105
+ /* @__PURE__ */d(Dl,{house:e,numberOfMonths:t,numberOfMonthsInARow:n,currentMonth:p,changeMonth:f}),
106
+ /* @__PURE__ */h("div",{className:"bu-popover-footer",children:[/* @__PURE__ */d(wl,{house:e}),/* @__PURE__ */h("div",{className:"bu-popover-actions",children:[/* @__PURE__ */d("button",{type:"button",className:"bu-button-ghost",onClick:r,children:ne("close")}),/* @__PURE__ */d("button",{type:"button",className:"bu-button-primary",disabled:!a||!c,onClick:()=>{a&&c&&s(a,c)},children:ne("done")})]})]})]})}function Il({house:e,numberOfMonths:t,numberOfMonthsInARow:n,onClose:r}){const i=o(Wu),a=o(Yu);return s(()=>{const e=e=>{"Escape"===e.key&&r()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]),/* @__PURE__ */h(l,{children:[/* @__PURE__ */d("div",{className:"bu-popover-backdrop",onClick:r}),/* @__PURE__ */d("div",{className:"bu-popover",role:"dialog","aria-modal":"true","aria-label":ne("change_dates"),children:/* @__PURE__ */d(Vu,{initialState:{selectedDate:i.selectedDate,arrivalDate:i.arrivalDate,departureDate:i.departureDate,persons:i.persons,bookingStarted:!0},children:/* @__PURE__ */d($l,{house:e,numberOfMonths:t,numberOfMonthsInARow:n,onClose:r,onApply:(e,t)=>{a({type:"set_dates",arrivalDate:e,departureDate:t}),r()}})})})]})}function jl({label:e,description:t,count:n=0,name:r}){const o=ju(n),s=zu(r);/* @__PURE__ */
75
107
  return h("div",{className:"form-row inline",id:`bukazu_form_${r}`,children:[
76
108
  /* @__PURE__ */d("label",{htmlFor:r,children:ne(e)}),
77
- /* @__PURE__ */d("select",{id:r,name:r,value:String(i.value),onChange:i.onChange,onBlur:i.onBlur,children:o.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))}),t,i.touched&&i.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:i.error})]})}function ml({label:e,description:t,name:n,inline:r,required:o=!1}){const i=Fu(n),s="string"==typeof i.value&&""!==i.value?i.value:"";/* @__PURE__ */
109
+ /* @__PURE__ */d("select",{id:r,name:r,value:String(s.value),onChange:s.onChange,onBlur:s.onBlur,children:o.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))}),t,s.touched&&s.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:s.error})]})}function Ll({label:e,description:t,name:n,inline:r,required:o=!1}){const s=zu(n),i="string"==typeof s.value&&""!==s.value?s.value:"";/* @__PURE__ */
78
110
  return h("div",{className:`form-row ${r&&"inline"}`,id:`bukazu_form_${n}`,children:[
79
111
  /* @__PURE__ */d("label",{htmlFor:n,children:ne(e)}),
80
- /* @__PURE__ */d("input",{type:"date",className:"bukazu-date-picker",id:n,name:n,required:o,value:s,onChange:i.onChange,onBlur:i.onBlur}),
81
- /* @__PURE__ */d("span",{className:"bu-input-description",children:t}),i.touched&&i.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:i.error})]})}ml.defaultValues={inline:!0};var gl=()=>{const{locale:e}=o(zs);/* @__PURE__ */
112
+ /* @__PURE__ */d("input",{type:"date",className:"bukazu-date-picker",id:n,name:n,required:o,value:i,onChange:s.onChange,onBlur:s.onBlur}),
113
+ /* @__PURE__ */d("span",{className:"bu-input-description",children:t}),s.touched&&s.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:s.error})]})}Ll.defaultValues={inline:!0};var Ml=()=>{const{locale:e}=o(Hi);/* @__PURE__ */
82
114
  return h(l,{children:[
83
115
  /* @__PURE__ */d("h2",{children:ne("cancel_insurance_normal_long")}),
84
116
  /* @__PURE__ */d("p",{children:ne("cancel_insurance_normal_desc")}),
@@ -92,87 +124,71 @@ return h(l,{children:[
92
124
  /* @__PURE__ */h("p",{children:[ne("cancel_insurance_questions_explain_1"),
93
125
  /* @__PURE__ */d("a",{href:{nl:"https://recreatieverzekeringen.nl/veelgestelde-vragen",de:"https://recreatieverzekeringen.nl/de/haufig-gestellte-fragen",en:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",fr:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",es:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",it:"https://recreatieverzekeringen.nl/en/frequently-asked-questions"}[e],target:"_blank",children:ne("cancel_insurance_questions_explain_link")}),ne("cancel_insurance_questions_explain_2")]}),
94
126
  /* @__PURE__ */d("h3",{children:ne("terms")}),
95
- /* @__PURE__ */d("a",{href:`https://api.bukazu.com/files/${e}/insurance.pdf`,target:"_blank",rel:"noopener noreferrer",children:ne("show_terms")})]})};function _l({house:e}){const t=Fu("cancel_insurance");return e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-row inline",children:[
96
- /* @__PURE__ */d("label",{htmlFor:"cancel_insurance",children:ne("cancel_insurance")}),
97
- /* @__PURE__ */h("select",{id:"cancel_insurance",name:"cancel_insurance",value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,required:!0,children:[qu("choose",""),qu("cancel_insurance_normal","1"),qu("none","0")]}),
98
- /* @__PURE__ */d(Iu,{buttonText:/* @__PURE__ */d(Qu,{}),children:/* @__PURE__ */d(gl,{})})]}):null}var yl=({house:e,values:t})=>e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-section bup-16",id:"insurances",children:[
127
+ /* @__PURE__ */d("a",{href:`https://api.bukazu.com/files/${e}/insurance.pdf`,target:"_blank",rel:"noopener noreferrer",children:ne("show_terms")})]})};function Ol(){const e=zu("cancel_insurance"),{setFieldValue:t}=Fu(),n=String(e.value),r=(e,r)=>/* @__PURE__ */d("button",{type:"button",className:"bu-chip","aria-pressed":n===e,onClick:()=>t("cancel_insurance",e),children:ne(r)});/* @__PURE__ */
128
+ return h("div",{className:"form-row bu-insurance",children:[
129
+ /* @__PURE__ */h("div",{className:"bu-field-label",id:"cancel_insurance_label",children:[ne("cancel_insurance"),/* @__PURE__ */d(Iu,{buttonText:/* @__PURE__ */d(Zu,{}),children:/* @__PURE__ */d(Ml,{})})]}),
130
+ /* @__PURE__ */h("div",{className:"bu-chips",role:"group","aria-labelledby":"cancel_insurance_label",children:[r("0","none"),r("1","cancel_insurance_normal")]}),
131
+ /* @__PURE__ */d("input",{type:"hidden",name:"cancel_insurance",value:n})]})}var Ul=({house:e,values:t})=>e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-section bup-16",id:"insurances",children:[
99
132
  /* @__PURE__ */d("h2",{children:ne("insurances")}),
100
- /* @__PURE__ */d(_l,{house:e}),t.cancel_insurance&&"0"!==t.cancel_insurance&&/* @__PURE__ */d(ml,{label:"extra_fields.date_of_birth",name:"extra_fields.date_of_birth",required:!0,inline:!1,description:ne("insurance_company_needs_date_of_birth")})]}):/* @__PURE__ */d("div",{}),bl=class extends Error{constructor(e){super(`Discount code request failed (${e})`),this.name="DiscountCodeError",this.status=e,this.notFound=404===e}};async function vl(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,code:r,currency:o}){const i=new URL("/portal_api/v1/accommodations/discount-code",new URL(e).origin),s=new URLSearchParams({portal_code:t,object_code:n,code:r});return o&&s.set("currency",o),i.search=s.toString(),i.toString()}(e);try{return await zc.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof Xs)throw new bl(n.response.status);throw n}}function wl({house:e}){const{apiUrl:t,locale:n,portalCode:r}=o(zs),{currency:i}=Vs(),s=Fu("discount_code"),[a,l]=u(null),[p,f]=u(!1),[m,g]=u(!1),[_,y]=u(!1),b=c(0);/* @__PURE__ */
133
+ /* @__PURE__ */d(Ol,{}),t.cancel_insurance&&"0"!==t.cancel_insurance&&/* @__PURE__ */d(Ll,{label:"extra_fields.date_of_birth",name:"extra_fields.date_of_birth",required:!0,inline:!1,description:ne("insurance_company_needs_date_of_birth")})]}):/* @__PURE__ */d("div",{}),ql=class extends Error{constructor(e){super(`Discount code request failed (${e})`),this.name="DiscountCodeError",this.status=e,this.notFound=404===e}};async function Bl(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,code:r,currency:o}){const s=new URL("/portal_api/v1/accommodations/discount-code",new URL(e).origin),i=new URLSearchParams({portal_code:t,object_code:n,code:r});return o&&i.set("currency",o),s.search=i.toString(),s.toString()}(e);try{return await Hc.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof Qi)throw new ql(n.response.status);throw n}}function Fl({house:e}){const{apiUrl:t,locale:n,portalCode:r}=o(Hi),{currency:s}=Ki(),i=zu("discount_code"),[a,l]=u(null),[p,f]=u(!1),[m,g]=u(!1),[_,y]=u(!1),b=c(0);/* @__PURE__ */
101
134
  return h("div",{className:"form-row inline",children:[
102
135
  /* @__PURE__ */d("label",{htmlFor:"discount_code",children:ne("discount_code")}),
103
- /* @__PURE__ */d("input",{id:"discount_code",name:"discount_code",value:String(s.value),onBlur:o=>{s.onBlur(),(o=>{const s=++b.current;if(""===o)return l(null),g(!1),y(!1),void f(!1);f(!0),vl({apiUrl:t,locale:n,portalCode:r,objectCode:e.code,code:o,currency:i}).then(e=>{s===b.current&&(l(e),g(!1),y(!1),f(!1))}).catch(e=>{if(s!==b.current)return;const t=e instanceof bl&&e.notFound;l(null),g(t),y(!t),f(!1)})})(o.target.value.trim())},onChange:s.onChange}),p&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:"Loading..."}),!p&&m&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:ne("no_discount_code_found")}),!p&&_&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:ne("something_went_wrong_please_try_again")}),!p&&a&&/* @__PURE__ */h("div",{className:"bu_discount_code",children:[/* @__PURE__ */d("div",{children:a.name}),a.use_price?null!=a.price&&/* @__PURE__ */d("div",{children:re(a.price,{style:"currency",currency:a.currency})}):null!=a.percentage&&/* @__PURE__ */h("div",{children:[a.percentage,"%"]})]})]})}var xl=({errors:e,house:t,bookingFormConfiguration:n,values:r})=>{const o=Fu("discount"),i=Fu("discount_reason");if(t.discounts&&"0"!==t.discounts||n.show_discount_code){const r=t.discounts?t.discounts.split(","):[];/* @__PURE__ */
104
- return h("div",{className:"form-section bup-16",children:[t.discounts&&"0"!==t.discounts&&/* @__PURE__ */h(l,{children:[
136
+ /* @__PURE__ */d("input",{id:"discount_code",name:"discount_code",value:String(i.value),onBlur:o=>{i.onBlur(),(o=>{const i=++b.current;if(""===o)return l(null),g(!1),y(!1),void f(!1);f(!0),Bl({apiUrl:t,locale:n,portalCode:r,objectCode:e.code,code:o,currency:s}).then(e=>{i===b.current&&(l(e),g(!1),y(!1),f(!1))}).catch(e=>{if(i!==b.current)return;const t=e instanceof ql&&e.notFound;l(null),g(t),y(!t),f(!1)})})(o.target.value.trim())},onChange:i.onChange}),p&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:"Loading..."}),!p&&m&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:ne("no_discount_code_found")}),!p&&_&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:ne("something_went_wrong_please_try_again")}),!p&&a&&/* @__PURE__ */h("div",{className:"bu_discount_code",children:[/* @__PURE__ */d("div",{children:a.name}),a.use_price?null!=a.price&&/* @__PURE__ */d("div",{children:re(a.price,{style:"currency",currency:a.currency})}):null!=a.percentage&&/* @__PURE__ */h("div",{children:[a.percentage,"%"]})]})]})}var zl=({errors:e,house:t,bookingFormConfiguration:n,values:r})=>{const o=zu("discount"),s=zu("discount_reason"),[i,a]=u(Number(r.discount)>0||""!==r.discount_code);if(t.discounts&&"0"!==t.discounts||n.show_discount_code){const r=t.discounts?t.discounts.split(","):[];/* @__PURE__ */
137
+ return h("div",{className:"form-section bup-16 bu-discount",children:[/* @__PURE__ */h("div",{className:"bu-section-head",children:[/* @__PURE__ */d("h2",{children:ne("discount")}),/* @__PURE__ */d("button",{type:"button",className:"bu-link-button bu-discount-toggle","aria-expanded":i,onClick:()=>a(e=>!e),children:ne(i?"hide":"have_discount_code")})]}),i&&/* @__PURE__ */h("div",{className:"bu-discount-fields",children:[t.discounts&&"0"!==t.discounts&&/* @__PURE__ */h(l,{children:[
105
138
  /* @__PURE__ */h("div",{className:"form-row inline",children:[/* @__PURE__ */d("label",{htmlFor:"discount",children:ne("discount")}),/* @__PURE__ */d("select",{id:"discount",name:"discount",value:String(o.value),onChange:o.onChange,onBlur:o.onBlur,children:r.map(e=>/* @__PURE__ */h("option",{value:e,children:[e,"%"]},e))})]}),
106
139
  /* @__PURE__ */h("div",{className:"form-row inline",children:[
107
140
  /* @__PURE__ */d("label",{htmlFor:"discount_reason",children:ne("discount_reason")}),
108
- /* @__PURE__ */d("input",{id:"discount_reason",name:"discount_reason",value:String(i.value),onChange:i.onChange,onBlur:i.onBlur}),e.discount_reason&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:e.discount_reason})]}),
109
- /* @__PURE__ */d("div",{children:/* @__PURE__ */d("i",{style:{fontSize:14},children:t.discounts_info})})]}),n.show_discount_code&&/* @__PURE__ */d(wl,{house:t})]})}return null},kl=()=>/* @__PURE__ */h("div",{className:"success-message",children:[
110
- /* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 125",style:{fill:"green",height:"150px"},xmlSpace:"preserve",children:/* @__PURE__ */d("path",{d:"M50,5C25.2,5,5,25.1,5,50c0,24.8,20.2,45,45,45s45-20.2,45-45C95,25.1,74.8,5,50,5z M72.7,38.2L44.2,66.7 c-0.4,0.4-0.9,0.6-1.4,0.6s-1-0.2-1.4-0.6l-14-14c-0.8-0.8-0.8-2,0-2.8c0.8-0.8,2-0.8,2.8,0l12.6,12.6l27.1-27.1 c0.8-0.8,2-0.8,2.8,0C73.5,36.1,73.5,37.4,72.7,38.2z"})}),
141
+ /* @__PURE__ */d("input",{id:"discount_reason",name:"discount_reason",value:String(s.value),onChange:s.onChange,onBlur:s.onBlur}),e.discount_reason&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:e.discount_reason})]}),t.discounts_info&&/* @__PURE__ */d("div",{className:"bu-discount-info",children:t.discounts_info})]}),n.show_discount_code&&/* @__PURE__ */d(Fl,{house:t})]})]})}return null},Hl=({size:e=12})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M4 10l4 4 8-8"})}),Wl=()=>/* @__PURE__ */h("div",{className:"success-message bu-success",children:[
142
+ /* @__PURE__ */d("div",{className:"bu-success-icon",children:/* @__PURE__ */d(Hl,{size:28})}),
111
143
  /* @__PURE__ */d("h3",{children:ne("thank_you_for_your_request")}),
112
- /* @__PURE__ */d("p",{children:ne("we_sent_confirmation_check_email")})]}),Sl=/* @__PURE__ */new Map,Cl={en:async()=>(await(import("./en-Bv1I_37O.js"))).default,nl:async()=>(await(import("./nl-B6ga4Zc8.js"))).default,de:async()=>(await(import("./de-AbyP7SiX.js"))).default,fr:async()=>(await(import("./fr-DQXnO3jP.js"))).default,es:async()=>(await(import("./es-EcksbtWo.js"))).default,it:async()=>(await(import("./it-z_lt2h0g.js"))).default};async function El(e){const t=R(e);if(Sl.has(t))return Sl.get(t);const n=await async function(e){return X(await Cl[e](),`Failed to load country data for locale "${e}"`)}(t);return Sl.set(t,n),n}var Tl=[{id:"first_name",label:"Voornaam",type:"text",options:["text"],required:!0,placeholder:""},{id:"last_name",label:"Achternaam",type:"text",options:["text"],required:!0,mandatory:!0,placeholder:""},{id:"address",label:"Adres",type:"text",options:["text"],required:!0,placeholder:""},{id:"house_number",label:"Huisnummer",type:"text",options:["text"],required:!0,placeholder:""},{id:"zipcode",label:"Postcode",type:"text",options:["text"],required:!0,placeholder:""},{id:"city",label:"Plaats",type:"text",options:["text"],required:!0,placeholder:""},{id:"country",label:"Land",type:"select",options:["select"],required:!0,mandatory:!0,placeholder:""},{id:"email",label:"E-mail",type:"email",options:["email"],required:!0,mandatory:!0,placeholder:""},{id:"phone",label:"Telefoonnummer",type:"text",options:["text"],required:!0,placeholder:""}];function Nl({name:e,type:t="text",required:n=!1,onKeyPress:r}){const o=Fu(e);return"textarea"===t?/* @__PURE__ */d("textarea",{id:e,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r}):/* @__PURE__ */d("input",{id:e,type:t,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r})}function Rl({bookingField:e,required:t=!1}){const n=Fu(`extra_fields.booking_field_${e.id}`);return"textarea"===e.field_type?/* @__PURE__ */d("textarea",{id:`extra_fields.booking_field_${e.id}`,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}}):/* @__PURE__ */d("input",{id:`extra_fields.booking_field_${e.id}`,type:"text"===e.field_type?"text":e.field_type,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}})}function Al({countries:e,disabled:t,required:n=!1}){const r=Fu("country");/* @__PURE__ */
113
- return h("select",{name:"country",id:"country",disabled:t,required:n,value:String(r.value),onChange:r.onChange,onBlur:r.onBlur,children:[/* @__PURE__ */d("option",{value:"",children:"—"}),e.map(e=>/* @__PURE__ */d("option",{value:e.alpha2,children:e.name},e.alpha2))]})}function $l({bookingFields:e,errors:t,touched:n,PortalSite:r,values:o}){const[a,c]=u([]),[l,p]=u(!0);i(()=>{let e=!0;const t="undefined"!=typeof window&&window.__localeId__||"en";return(async()=>{try{const n=await El(t);e&&c(n)}catch{}finally{e&&p(!1)}})(),()=>{e=!1}},[]);const f=s(()=>{const t=[...e];return"1"!==o.cancel_insurance&&"2"!==o.cancel_insurance||["address","house_number","zipcode","city"].forEach(n=>{const r=Tl.find(e=>e.id===n);if(!r)return;const o=e.findIndex(e=>e.id===n);-1!==o?t[o]=r:t.push(r)}),t},[e,o.cancel_insurance]);/* @__PURE__ */
114
- return h("div",{className:"form-section bup-16",children:[/* @__PURE__ */d("h2",{children:ne("personal_details")}),f.map(e=>function({input:e,PortalSite:t,countries:n,countriesLoading:r,errors:o,touched:i}){const s="telephone"===e.id?"phonenumber":e.id;if("booking_field"===e.type||Be(s)){const n=t.booking_fields?.find(e=>e.id===s);return n?/* @__PURE__ */h("div",{className:"form-row",children:[
144
+ /* @__PURE__ */d("p",{children:ne("we_sent_confirmation_check_email")}),
145
+ /* @__PURE__ */d("p",{className:"bu-success-hint",children:ne("returning_to_calendar")})]}),Yl=/* @__PURE__ */new Map,Vl={en:async()=>(await(import("./en-Bv1I_37O.js"))).default,nl:async()=>(await(import("./nl-B6ga4Zc8.js"))).default,de:async()=>(await(import("./de-AbyP7SiX.js"))).default,fr:async()=>(await(import("./fr-DQXnO3jP.js"))).default,es:async()=>(await(import("./es-EcksbtWo.js"))).default,it:async()=>(await(import("./it-z_lt2h0g.js"))).default};async function Jl(e){const t=R(e);if(Yl.has(t))return Yl.get(t);const n=await async function(e){return X(await Vl[e](),`Failed to load country data for locale "${e}"`)}(t);return Yl.set(t,n),n}var Kl=[{id:"first_name",label:"Voornaam",type:"text",options:["text"],required:!0,placeholder:""},{id:"last_name",label:"Achternaam",type:"text",options:["text"],required:!0,mandatory:!0,placeholder:""},{id:"address",label:"Adres",type:"text",options:["text"],required:!0,placeholder:""},{id:"house_number",label:"Huisnummer",type:"text",options:["text"],required:!0,placeholder:""},{id:"zipcode",label:"Postcode",type:"text",options:["text"],required:!0,placeholder:""},{id:"city",label:"Plaats",type:"text",options:["text"],required:!0,placeholder:""},{id:"country",label:"Land",type:"select",options:["select"],required:!0,mandatory:!0,placeholder:""},{id:"email",label:"E-mail",type:"email",options:["email"],required:!0,mandatory:!0,placeholder:""},{id:"phone",label:"Telefoonnummer",type:"text",options:["text"],required:!0,placeholder:""}];function Gl({name:e,type:t="text",required:n=!1,onKeyPress:r}){const o=zu(e);return"textarea"===t?/* @__PURE__ */d("textarea",{id:e,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r}):/* @__PURE__ */d("input",{id:e,type:t,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r})}function Xl({bookingField:e,required:t=!1}){const n=zu(`extra_fields.booking_field_${e.id}`);return"textarea"===e.field_type?/* @__PURE__ */d("textarea",{id:`extra_fields.booking_field_${e.id}`,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}}):/* @__PURE__ */d("input",{id:`extra_fields.booking_field_${e.id}`,type:"text"===e.field_type?"text":e.field_type,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}})}function Ql({countries:e,disabled:t,required:n=!1}){const r=zu("country");/* @__PURE__ */
146
+ return h("select",{name:"country",id:"country",disabled:t,required:n,value:String(r.value),onChange:r.onChange,onBlur:r.onBlur,children:[/* @__PURE__ */d("option",{value:"",children:"—"}),e.map(e=>/* @__PURE__ */d("option",{value:e.alpha2,children:e.name},e.alpha2))]})}function Zl({bookingFields:e,errors:t,touched:n,PortalSite:r,values:o}){const[a,c]=u([]),[l,p]=u(!0);s(()=>{let e=!0;const t="undefined"!=typeof window&&window.__localeId__||"en";return(async()=>{try{const n=await Jl(t);e&&c(n)}catch{}finally{e&&p(!1)}})(),()=>{e=!1}},[]);const f=i(()=>{const t=[...e];return"1"!==o.cancel_insurance&&"2"!==o.cancel_insurance||["address","house_number","zipcode","city"].forEach(n=>{const r=Kl.find(e=>e.id===n);if(!r)return;const o=e.findIndex(e=>e.id===n);-1!==o?t[o]=r:t.push(r)}),t},[e,o.cancel_insurance]);/* @__PURE__ */
147
+ return h("div",{className:"form-section bup-16",children:[/* @__PURE__ */d("h2",{children:ne("personal_details")}),f.map(e=>function({input:e,PortalSite:t,countries:n,countriesLoading:r,errors:o,touched:s}){const i="telephone"===e.id?"phonenumber":e.id;if("booking_field"===e.type||Fe(i)){const n=t.booking_fields?.find(e=>e.id===i);return n?/* @__PURE__ */h("div",{className:"form-row",children:[
115
148
  /* @__PURE__ */h("label",{htmlFor:`extra_fields.booking_field_${n.id}`,children:[n.label," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
116
- /* @__PURE__ */d(Rl,{bookingField:n,required:e.required}),o[e.id]&&(i.extra_fields&&i.extra_fields[`booking_field_${n.id}`]||i[e.id])&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[e.id]})]},n.id):null}return"country"===s?/* @__PURE__ */h("div",{className:"form-row",children:[
117
- /* @__PURE__ */h("label",{htmlFor:s,children:[t[`${s}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
118
- /* @__PURE__ */d(Al,{countries:n,disabled:r,required:e.required}),o[s]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[s]})]},s):"date"===e.type?/* @__PURE__ */d("div",{className:"form-row",children:/* @__PURE__ */d(ml,{name:s,label:s,inline:!1,required:e.required})},s):/* @__PURE__ */h("div",{className:"form-row",children:[
119
- /* @__PURE__ */h("label",{htmlFor:s,children:[t[`${s.replace(/\./g,"_")}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
120
- /* @__PURE__ */d(Nl,{type:e.type,name:s,required:e.required,onKeyPress:e=>{13===e.which&&e.preventDefault()}}),o[s]&&i[s]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[s]})]},s)}({input:e,PortalSite:r,countries:a,countriesLoading:l,errors:t,touched:n}))]})}function Pl({cost:e}){const t=Fu(`costs[${e.id}]`);return 1===e.max_available?/* @__PURE__ */h("select",{id:e.id,name:`costs[${e.id}]`,value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,children:[/* @__PURE__ */d("option",{value:0,children:ne("no")}),/* @__PURE__ */d("option",{value:1,children:ne("yes")})]}):/* @__PURE__ */d("select",{id:e.id,name:`costs[${e.id}]`,value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,children:Du(e.max_available).map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})}function Il({costs:e,currency:t}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"form-section bup-16 optional_house_costs",children:[/* @__PURE__ */d("h2",{children:ne("extra_costs_bookable")}),/* @__PURE__ */d("div",{children:e.map(e=>!["none","total"].includes(e.method)&&e.max_available>0?/* @__PURE__ */h("div",{className:"form-row inline",children:[
121
- /* @__PURE__ */d("label",{htmlFor:e.id,children:e.name}),
122
- /* @__PURE__ */d(Pl,{cost:e}),
123
- /* @__PURE__ */h("div",{className:"price_per",children:[re(e.amount,{style:"currency",currency:t??"EUR"})," ",e.method_name]}),
124
- /* @__PURE__ */d("div",{children:e.description?/* @__PURE__ */d("div",{children:/* @__PURE__ */d(Iu,{buttonText:/* @__PURE__ */d(Qu,{}),children:/* @__PURE__ */d("p",{children:e.description})})}):null})]},e.id):"")})]})}function Dl({bookingFormConfiguration:e,house:t}){/* @__PURE__ */
125
- return h(l,{children:[
126
- /* @__PURE__ */d(fl,{name:"adults",label:"adults",count:t.persons,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("adults_from",{age:e.adults_from_age})})}),e.children_allowed?/* @__PURE__ */d(fl,{name:"children",label:"children",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("children_from",{from:e.children_from_age,til:e.children_till_age})})}):null,e.babies_allowed?/* @__PURE__ */d(fl,{name:"babies",label:"babies",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("babies_from",{babies:e.babies_till_age})})}):null]})}function jl(e,t,n){const{persons:r}=t,o={},i=Mu(t,e);for(const a of n){if(!a.required)continue;if(Be(a.id)){const t=Ou(e,`extra_fields.booking_field_${a.id}`);t&&""!==t||(o[a.id]=ne("required"));continue}const t=Ou(e,a.id);t&&""!==t||(o[a.id]=ne("required"))}e.adults<1&&r>0&&(o.adults=ne("at_least_1_adult")),Number(e.discount)>0&&!e.discount_reason&&(o.discount_reason=ne("you_need_to_give_reason")),i>r&&(o.max_persons=ne("max_persons_reached"));const s=e.extra_fields?.date_of_birth;return"0"!==e.cancel_insurance&&s&&xe(new Date(s),me(/* @__PURE__ */new Date,18))&&(o["extra_fields.date_of_birth"]=ne("at_least_18y_old"),o.insurances=ne("at_least_18y_old")),o}function Ll({house:e,PortalSite:t}){const{persons:n,arrivalDate:i,departureDate:a}=o(Hu),{locale:c,portalCode:l,objectCode:p,apiUrl:f}=o(zs),{currency:m}=Vs(),g=o(Yu),{options:_,bookingFormConfiguration:y}=t,b=_.bookingFields.map(e=>"telephone"===e.id?{...e,id:"phonenumber"}:e),v=e.booking_price,w=r(()=>{const t={};for(const e of v.optional_house_costs)t[e.id]="0";const r={...ju(b),arrivalDate:i,departureDate:a,is_option:"false",costs:t,adults:n,children:0,babies:0,persons:n,discount:0,country:"nl",cancel_insurance:"0",discount_code:"",currency:m??"",extra_fields:{}};return{...r,persons:Mu(e,r)}},[i,b,v.optional_house_costs,a,e,n,m]),[x,k]=u(()=>w()),[S,C]=u({}),[E,T]=u(!1),[N,R]=u(null),[A,$]=u(null),[P,I]=u({}),D=r(()=>{R(null),I({})},[]),j=r((t,n)=>{I(e=>void 0===e[t]?e:{...e,[t]:void 0}),k(r=>{let o=Uu(r,t,n);return["adults","children","babies"].includes(t)&&(o={...o,persons:Mu(e,o)}),o})},[e]),L=r((e,t=!0)=>{C(n=>Uu(n,e,t))},[]),O=fu()||null,U=s(()=>({...P,...jl(x,e,b)}),[b,e,P,x]),M=r(async t=>{t.preventDefault();const n={house_code:p,portal_code:l,locale:c},r=e=>{gu({...n,interaction_type:"booking_form_error",interaction_info:{fields:e.filter(mu)}})},o=jl(x,e,b);if(C(function(e,t){let n={adults:!0,children:!0,babies:!0,cancel_insurance:!0};return e.forEach(e=>{n=Uu(n,Be(e.id)?`extra_fields.booking_field_${e.id}`:e.id,!0)}),Number(t.discount)>0&&(n.discount_reason=!0),"1"!==t.cancel_insurance&&"2"!==t.cancel_insurance||(["address","house_number","zipcode","city"].forEach(e=>{n=Uu(n,e,!0)}),n=Uu(n,"extra_fields.date_of_birth",!0)),n}(b,x)),Object.keys(o).length>0)r(Object.keys(o));else{T(!0),R(null),I({});try{const e=await Nu({apiUrl:f,locale:c,payload:Pu({values:x,objectCode:p,portalCode:l,locale:c,sessionIdentifier:O})});$(e);const t=y.redirect_urls??{},n=e.redirect_to_payment&&e.payment_url||e.redirect_url||t[c];n&&""!==n?(i=n,window.location.href=i):setTimeout(()=>{g({type:"return"})},15e3)}catch(s){if(gu({...n,interaction_type:"booking_failed",interaction_info:{error_key:s instanceof Tu?`http_${s.status}`:"network"}}),R(s instanceof Error?s:/* @__PURE__ */new Error("The booking could not be created")),s instanceof Tu&&s.fieldErrors){const e={};for(const[t,n]of Object.entries(s.fieldErrors))e[t]=n.join(" ");I(e),r(Object.keys(s.fieldErrors))}}finally{T(!1)}var i}},[f,b,y,g,e,c,p,l,O,x]);/* @__PURE__ */
127
- return d(Bu.Provider,{value:{values:x,errors:U,touched:S,isSubmitting:E,setFieldValue:j,setFieldTouched:L},children:/* @__PURE__ */h("form",{className:"form",onSubmit:M,children:[E&&/* @__PURE__ */d("div",{className:"return-message",children:"Creating booking..."}),N&&/* @__PURE__ */d(Iu,{show:!0,onClose:D,children:/* @__PURE__ */d(Ms,{errors:N})}),A&&/* @__PURE__ */d(Iu,{show:!0,children:/* @__PURE__ */d(kl,{})}),
149
+ /* @__PURE__ */d(Xl,{bookingField:n,required:e.required}),o[e.id]&&(s.extra_fields&&s.extra_fields[`booking_field_${n.id}`]||s[e.id])&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[e.id]})]},n.id):null}return"country"===i?/* @__PURE__ */h("div",{className:"form-row",children:[
150
+ /* @__PURE__ */h("label",{htmlFor:i,children:[t[`${i}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
151
+ /* @__PURE__ */d(Ql,{countries:n,disabled:r,required:e.required}),o[i]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[i]})]},i):"date"===e.type?/* @__PURE__ */d("div",{className:"form-row",children:/* @__PURE__ */d(Ll,{name:i,label:i,inline:!1,required:e.required})},i):/* @__PURE__ */h("div",{className:"form-row",children:[
152
+ /* @__PURE__ */h("label",{htmlFor:i,children:[t[`${i.replace(/\./g,"_")}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
153
+ /* @__PURE__ */d(Gl,{type:e.type,name:i,required:e.required,onKeyPress:e=>{13===e.which&&e.preventDefault()}}),o[i]&&s[i]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[i]})]},i)}({input:e,PortalSite:r,countries:a,countriesLoading:l,errors:t,touched:n}))]})}function ed({cost:e}){const t=`costs[${e.id}]`,n=zu(t),{setFieldValue:r}=Fu();if(1===e.max_available){const o=String(n.value),s=(e,n)=>/* @__PURE__ */d("button",{type:"button","aria-pressed":o===e,onClick:()=>r(t,e),children:ne(n)});/* @__PURE__ */
154
+ return h("div",{className:"bu-segmented",role:"group","aria-labelledby":`bu_cost_${e.id}`,children:[s("0","no"),s("1","yes"),
155
+ /* @__PURE__ */d("input",{type:"hidden",id:e.id,name:t,value:o})]})}/* @__PURE__ */
156
+ return d("select",{id:e.id,name:t,className:"bu-extra-quantity",value:String(n.value),onChange:n.onChange,onBlur:n.onBlur,children:ju(e.max_available).map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})}function td({costs:e,currency:t}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"form-section bup-16 optional_house_costs",children:[/* @__PURE__ */d("h2",{children:ne("extra_costs_bookable")}),/* @__PURE__ */d("div",{className:"bu-extras",children:e.map(e=>!["none","total"].includes(e.method)&&e.max_available>0?/* @__PURE__ */h("div",{className:"form-row bu-extra-row",children:[/* @__PURE__ */h("div",{className:"bu-extra-info",children:[/* @__PURE__ */h("label",{htmlFor:e.id,id:`bu_cost_${e.id}`,className:"bu-extra-name",children:[e.name,e.description?/* @__PURE__ */d(Iu,{buttonText:/* @__PURE__ */d(Zu,{}),children:/* @__PURE__ */d("p",{children:e.description})}):null]}),/* @__PURE__ */h("div",{className:"price_per bu-extra-price",children:[re(e.amount,{style:"currency",currency:t??"EUR"})," ",e.method_name]})]}),/* @__PURE__ */d(ed,{cost:e})]},e.id):"")})]})}function nd({bookingFormConfiguration:e,house:t}){/* @__PURE__ */
157
+ return h("div",{className:"bu-guests",children:[
158
+ /* @__PURE__ */d(jl,{name:"adults",label:"adults",count:t.persons,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("adults_from",{age:e.adults_from_age})})}),e.children_allowed?/* @__PURE__ */d(jl,{name:"children",label:"children",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("children_from",{from:e.children_from_age,til:e.children_till_age})})}):null,e.babies_allowed?/* @__PURE__ */d(jl,{name:"babies",label:"babies",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("babies_from",{babies:e.babies_till_age})})}):null]})}function rd(e,t,n){const{persons:r}=t,o={},s=qu(t,e);for(const a of n){if(!a.required)continue;if(Fe(a.id)){const t=Ou(e,`extra_fields.booking_field_${a.id}`);t&&""!==t||(o[a.id]=ne("required"));continue}const t=Ou(e,a.id);t&&""!==t||(o[a.id]=ne("required"))}e.adults<1&&r>0&&(o.adults=ne("at_least_1_adult")),Number(e.discount)>0&&!e.discount_reason&&(o.discount_reason=ne("you_need_to_give_reason")),s>r&&(o.max_persons=ne("max_persons_reached"));const i=e.extra_fields?.date_of_birth;return"0"!==e.cancel_insurance&&i&&xe(new Date(i),me(/* @__PURE__ */new Date,18))&&(o["extra_fields.date_of_birth"]=ne("at_least_18y_old"),o.insurances=ne("at_least_18y_old")),o}function od({house:e,PortalSite:t}){const{persons:n,arrivalDate:a,departureDate:c}=o(Wu),{locale:p,portalCode:f,objectCode:m,apiUrl:g}=o(Hi),{currency:_}=Ki(),y=o(Yu),{options:b,bookingFormConfiguration:v}=t,w=b.bookingFields.map(e=>"telephone"===e.id?{...e,id:"phonenumber"}:e),k=e.booking_price,x=r(()=>{const t={};for(const e of k.optional_house_costs)t[e.id]="0";const r={...Lu(w),arrivalDate:a,departureDate:c,is_option:"false",costs:t,adults:n,children:0,babies:0,persons:n,discount:0,country:"nl",cancel_insurance:"0",discount_code:"",currency:_??"",extra_fields:{}};return{...r,persons:qu(e,r)}},[a,w,k.optional_house_costs,c,e,n,_]),[S,C]=u(()=>x()),[E,N]=u({}),[T,R]=u(!1),[A,D]=u(null),[P,$]=u(null),[I,j]=u({}),[L,M]=u(!1),[O,U]=u(!1),[q,B]=u(null),F=r(()=>M(!0),[]),z=r(()=>M(!1),[]);s(()=>{a&&c&&C(e=>e.arrivalDate===a&&e.departureDate===c?e:{...e,arrivalDate:a,departureDate:c})},[a,c]);const H=r(()=>{D(null),j({})},[]),W=r((t,n)=>{j(e=>void 0===e[t]?e:{...e,[t]:void 0}),C(r=>{let o=Uu(r,t,n);return["adults","children","babies"].includes(t)&&(o={...o,persons:qu(e,o)}),o})},[e]),Y=r((e,t=!0)=>{N(n=>Uu(n,e,t))},[]),V=mu()||null,J=i(()=>({...I,...rd(S,e,w)}),[w,e,I,S]),K=r(async t=>{t.preventDefault();const n={house_code:m,portal_code:f,locale:p},r=e=>{_u({...n,interaction_type:"booking_form_error",interaction_info:{fields:e.filter(gu)}})},o=rd(S,e,w);if(N(function(e,t){let n={adults:!0,children:!0,babies:!0,cancel_insurance:!0};return e.forEach(e=>{n=Uu(n,Fe(e.id)?`extra_fields.booking_field_${e.id}`:e.id,!0)}),Number(t.discount)>0&&(n.discount_reason=!0),"1"!==t.cancel_insurance&&"2"!==t.cancel_insurance||(["address","house_number","zipcode","city"].forEach(e=>{n=Uu(n,e,!0)}),n=Uu(n,"extra_fields.date_of_birth",!0)),n}(w,S)),Object.keys(o).length>0)r(Object.keys(o));else{R(!0),D(null),j({});try{const e=await Ru({apiUrl:g,locale:p,payload:$u({values:S,objectCode:m,portalCode:f,locale:p,sessionIdentifier:V})});$(e);const t=v.redirect_urls??{},n=e.redirect_to_payment&&e.payment_url||e.redirect_url||t[p];n&&""!==n?(s=n,window.location.href=s):setTimeout(()=>{y({type:"return"})},15e3)}catch(i){if(_u({...n,interaction_type:"booking_failed",interaction_info:{error_key:i instanceof Tu?`http_${i.status}`:"network"}}),D(i instanceof Error?i:/* @__PURE__ */new Error("The booking could not be created")),i instanceof Tu&&i.fieldErrors){const e={};for(const[t,n]of Object.entries(i.fieldErrors))e[t]=n.join(" ");j(e),r(Object.keys(i.fieldErrors))}}finally{R(!1)}var s}},[g,w,v,y,e,p,m,f,V,S]),G=Math.min(2,Math.max(1,v.show_months_amount||2)),X=t.form_submit_button_text||ne("book"),Q=q?re(q.total_costs.sub_total,{style:"currency",currency:q.currency}):null,Z=/* @__PURE__ */h(l,{children:[
159
+ /* @__PURE__ */d(_l,{house:e,values:S,onChangeDates:F,onPrices:B}),
160
+ /* @__PURE__ */h("div",{className:"terms",children:[t.form_submit_text," ",
161
+ /* @__PURE__ */d(Iu,{buttonText:ne("terms"),children:/* @__PURE__ */d("div",{style:{width:"90vh",height:"90vh"},children:/* @__PURE__ */d("iframe",{src:e.rental_terms??void 0,width:"100%",height:"100%",title:"Terms"})})}),e.allow_option&&/* @__PURE__ */h("span",{children:[", ",ne("option_is_free")]})]}),[1,2].includes(Number(S.cancel_insurance))?/* @__PURE__ */d("div",{className:"terms",children:ne("comply_insurance_card")}):null,
162
+ /* @__PURE__ */d("button",{className:"bu-calendar-button",type:"submit",disabled:T,children:X})]});/* @__PURE__ */
163
+ return d(Bu.Provider,{value:{values:S,errors:J,touched:E,isSubmitting:T,setFieldValue:W,setFieldTouched:Y},children:/* @__PURE__ */h("form",{className:"form bu-booking",onSubmit:K,children:[T&&/* @__PURE__ */d("div",{className:"return-message",children:"Creating booking..."}),A&&/* @__PURE__ */d(Iu,{show:!0,onClose:H,children:/* @__PURE__ */d(qi,{errors:A})}),P&&/* @__PURE__ */d(Iu,{show:!0,children:/* @__PURE__ */d(Wl,{})}),
164
+ /* @__PURE__ */h("div",{className:"bu-booking-head",children:[
165
+ /* @__PURE__ */d("a",{className:"return-link bu-link-button",role:"link",tabIndex:0,onClick:()=>{y({type:"return"})},children:ne("return_to_calendar")}),
166
+ /* @__PURE__ */d(vl,{house:e,persons:S.persons,onChange:F}),L&&/* @__PURE__ */d(Il,{house:e,numberOfMonths:G,numberOfMonthsInARow:G,onClose:z})]}),
167
+ /* @__PURE__ */h("div",{className:"bu-booking-body",children:[
128
168
  /* @__PURE__ */h("div",{className:"form-content",children:[
129
169
  /* @__PURE__ */h("div",{className:"form-section bup-16",children:[
130
- /* @__PURE__ */d("a",{className:"return-link",role:"link",tabIndex:0,onClick:()=>{g({type:"return"})},children:ne("return_to_calendar")}),
131
170
  /* @__PURE__ */d("h2",{children:ne("stay_details")}),
132
- /* @__PURE__ */d(Dl,{bookingFormConfiguration:y,house:e}),U.max_persons&&/* @__PURE__ */d("div",{className:"error-message bu-error-message persons",children:U.max_persons})]}),
133
- /* @__PURE__ */d(xl,{errors:U,house:e,bookingFormConfiguration:y,values:x}),
134
- /* @__PURE__ */d(yl,{house:e,values:x}),
135
- /* @__PURE__ */d(Il,{costs:v.optional_house_costs,currency:v.currency}),
136
- /* @__PURE__ */d($l,{bookingFields:b,errors:U,touched:S,PortalSite:t,values:x})]}),
137
- /* @__PURE__ */h("div",{className:"form-sum bup-16",children:[
138
- /* @__PURE__ */d(pl,{house:e,values:x}),
139
- /* @__PURE__ */h("div",{className:"terms",children:[t.form_submit_text," ",
140
- /* @__PURE__ */d(Iu,{buttonText:ne("terms"),children:/* @__PURE__ */d("div",{style:{width:"90vh",height:"90vh"},children:/* @__PURE__ */d("iframe",{src:e.rental_terms??void 0,width:"100%",height:"100%",title:"Terms"})})}),e.allow_option&&/* @__PURE__ */h("span",{children:[", ",ne("option_is_free")]})]}),[1,2].includes(Number(x.cancel_insurance))?/* @__PURE__ */d("div",{className:"terms",children:ne("comply_insurance_card")}):null,
141
- /* @__PURE__ */d("button",{className:"bu-calendar-button",type:"submit",disabled:E,children:t.form_submit_button_text})]})]})})}var Ol=/* @__PURE__ */new Set;function Ul(e){return!Ol.has(e)&&(Ol.add(e),!0)}function Ml(e,t){return Ul(`price_unavailable:${e}:${t.arrival}:${t.departure}`)}function ql({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:s}=o(zs),{currency:a}=Vs(),{arrivalDate:l,departureDate:h,persons:f}=o(Hu),[m,g]=u(null),[_,y]=u(null),b=c(/* @__PURE__ */new Set);return i(()=>{let e=!1;g(null),y(null);const o={arrival:l.date,departure:h.date},i={house_code:n,portal_code:t,locale:r};return rl({apiUrl:s,locale:r,portalCode:t,objectCode:n,startsAt:l.date,endsAt:h.date,currency:a,includeAccommodation:!0}).then(t=>{e||(t.accommodation?((()=>{const e=`${n}:${o.arrival}:${o.departure}`;return!b.current.has(e)&&(b.current.add(e),!0)})()&&gu({...i,interaction_type:"booking_started",interaction_info:{...o,persons:f}}),g({...t.accommodation,booking_price:{total_price:t.total_price,currency:t.currency,optional_house_costs:t.optional_house_costs.map(e=>({id:String(e.id),name:e.name,method:e.method,max_available:e.max_available,amount:e.amount,method_name:e.method_name,description:e.description}))}})):y(/* @__PURE__ */new Error("Price response lacks the accommodation")))}).catch(t=>{e||(y(t instanceof Error?t:new Error(String(t))),t instanceof nl&&Ml(n,o)&&gu({...i,interaction_type:"price_unavailable",interaction_info:o}))}),()=>{e=!0}},[s,r,t,n,l,h,f,a]),m||_?_||!m?/* @__PURE__ */d("div",{children:ne(_ instanceof nl?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */d(Ll,{house:m,PortalSite:e}):/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})})}var Bl=class extends Error{constructor(e){super(`Accommodation detail request failed (${e})`),this.name="AccommodationDetailError",this.status=e,this.notFound=404===e}};async function Fl(e){const t=function({apiUrl:e,portalCode:t,objectCode:n}){const r=new URL("/portal_api/v1/accommodations/detail",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,object_code:n}).toString(),r.toString()}(e);try{return await zc.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof Xs)throw new Bl(n.response.status);throw n}}var zl=()=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 100 100",x:"0px",y:"0px",children:[/* @__PURE__ */d("title",{children:"Forward"}),/* @__PURE__ */d("path",{d:"M97.64,44.1,64.72,11.18a8.06,8.06,0,1,0-11.4,11.39L72.78,42H8.06a8.06,8.06,0,0,0,0,16.12H72.6L53.32,77.43a8.06,8.06,0,0,0,11.4,11.39L97.64,55.9A8,8,0,0,0,100,50.2a1.27,1.27,0,0,0,0-.2,1.41,1.41,0,0,0,0-.2A8.07,8.07,0,0,0,97.64,44.1Z"})]}),Hl=()=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",height:"16px",children:/* @__PURE__ */d("path",{fill:"#000000",stroke:"2",d:"M77,53.752c0,0.012,0,0.022,0,0.034c0,14.92-12.019,27.058-26.938,27.058 c-14.92,0-26.948-12.138-26.948-27.058C23.114,38.961,35,26.889,50,26.738v4.942c0,2.84,2.54,2.913,3.947,1.647l10.354-7.714 c0,0,1.128-0.942,1.128-1.979c0-1.089-1.147-1.979-1.147-1.979L53.95,13.941C52.543,12.675,50,12.749,50,15.588v5.149 c-18,0.151-32.826,14.915-32.826,33.048c0,18.229,14.686,33.058,32.914,33.058C68.314,86.844,83,72.015,83,53.786 c0-0.012,0-0.022,0-0.034c0,0,0-3.375-3.037-3.375C77.109,50.376,77,53.752,77,53.752z"})});function Yl({changeMonth:e,currentMonth:t,numberOfMonths:n}){const r=o(Yu);/* @__PURE__ */
142
- return h("div",{className:"calendars-header bu-grid bu-grid-cols-3",children:[
143
- /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8",style:{textAlign:"center"},onClick:function(){e(fe(t,-n))},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 100 100",viewBox:"0 0 100 125",xmlSpace:"preserve",children:/* @__PURE__ */d("path",{d:"M2.4,44.1l32.9-32.9c3.1-3.1,8.2-3.1,11.4,0c1.6,1.6,2.4,3.6,2.4,5.7c0,2.1-0.8,4.1-2.4,5.7L27.2,42h64.7 c2.2,0,4.2,0.9,5.7,2.4c1.5,1.5,2.4,3.5,2.4,5.7c0,4.4-3.6,8.1-8.1,8.1H27.4l19.3,19.3c1.6,1.6,2.4,3.6,2.4,5.7s-0.8,4.1-2.4,5.7 c-3.1,3.1-8.3,3.1-11.4,0L2.4,55.9C0.8,54.3,0,52.3,0,50.2c0-0.1,0-0.1,0-0.2c0-0.1,0-0.1,0-0.2C0,47.7,0.8,45.7,2.4,44.1z"})})})}),
144
- /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8",onClick:()=>{r({type:"reset"})},style:{textAlign:"center"},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d(Hl,{})})}),
145
- /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8 bup-x16",onClick:function(){e(fe(t,n))},style:{textAlign:"center"},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d(zl,{})})})]})}function Wl({house:e}){const{departureDate:t,arrivalDate:n}=o(Hu);return t?.date?/* @__PURE__ */h("div",{className:"bup-16 bu-bold",children:[ne(`${e.house_type}.you_picked_arrival_date`),":"," ",ue(le(n.date),Ee),
146
- /* @__PURE__ */d("br",{}),ne(`${e.house_type}.you_picked_departure_date`),":"," ",ue(le(t.date),Ee)]}):n?.date?/* @__PURE__ */h("div",{className:"bup-16 bu-bold",children:[ne(`${e.house_type}.you_picked_arrival_date`),":"," ",ue(le(n.date),Ee),
147
- /* @__PURE__ */d("br",{}),ne(`${e.house_type}.pick_your_departure_in_the_calendar`),
148
- /* @__PURE__ */d("br",{}),ne("minimum_nights",{minimum:n.min_nights})]}):/* @__PURE__ */d("div",{className:"bup-16 bu-bold",children:ne(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})}function Jl({house:e}){/* @__PURE__ */
149
- return h("div",{className:"legend",children:[
150
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field arrival"}),ne(`${e.house_type}.arrival_date`)]}),
151
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field booked"}),ne("booked")]}),
152
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field departure"}),ne(`${e.house_type}.departure_date`)]}),
153
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field last_minute_discount"}),ne("discount")]})]})}async function Vl({apiUrl:e,locale:t,portalCode:n,objectCode:r,startsDate:o,endDate:i}){const s=function({apiUrl:e,portalCode:t,objectCode:n,startsDate:r,endDate:o}){const i=new URL("/portal_api/v1/accommodations/availability",new URL(e).origin);return i.search=new URLSearchParams({portal_code:t,object_code:n,starts_date:de(r),end_date:de(o)}).toString(),i.toString()}({apiUrl:e,portalCode:n,objectCode:r,startsDate:o,endDate:i});try{return await zc.get(s,{headers:{locale:t}}).json()}catch(a){if(a instanceof Xs)throw new Error(`Availability request failed (${a.response.status})`);throw a}}var Kl=({month:e})=>/* @__PURE__ */d("div",{className:"bu-bold bup-4",children:/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:/* @__PURE__ */d("span",{children:ue(e,Ce)})})});function Gl({day:e,monthStart:t,buDate:n,prevBooked:r,dates:o,house:i,discounts:s}){const{selectedDate:a,departureDate:c,arrivalDate:u}=o,l=/* @__PURE__ */new Date,d=["bu-grid","bu-center","bu-rounded-half","bu-h-42","bu-w-42"];if(p=t,(h=e).getFullYear()!==p.getFullYear()||h.getMonth()!==p.getMonth())return d.push("disabled"),d.join(" ");var h,p;if(n&&(n.arrival&&xe(e,pe(l,1))&&0!==n.max_nights?0===r?.max_nights?d.push("departure-arrival","bu-hover-bright"):d.push("arrival","bu-hover-bright"):0===n.max_nights?void 0!==r&&0!==r.max_nights?d.push("booked-departure","bu-hover-bright"):d.push("booked"):n.max_nights>0&&(void 0===r||0===r.max_nights)&&!n.arrival&&d.push("booked")),a){we(e,a)&&d.push("selected");const t=Se(e,a),o=t>=(u?.min_nights??0),s=t<=i.max_nights&&t<=(u?.max_nights??0);n.departure&&xe(e,a)&&o&&s&&void 0!==r&&0!==r.max_nights&&d.push("departure")}if(c&&a){const t=le(c.date);xe(e,a)&&ke(e,t)&&d.push("selected"),we(e,t)&&d.push("selected")}const f=Se(e,l),m=f<=i.last_minute_days&&f>0,g=s.find(t=>ke(pe(le(t.discount_starts_at),1),e)&&xe(he(le(t.discount_ends_at),1),e));return(m||g||n.special_offer>0)&&d.push("discount"),d.join(" ")}function Xl({availabilities:e,month:t,discounts:n,house:r}){const i=o(Yu),s=o(Hu),a=_e(t),c=ye(a),u=be(a),l=ve(c),h=[];let p=[],f=u;for(;f<=l;){for(let t=0;t<7;t++){let t=de(f),o=de(pe(f,1));const c=e.find(e=>e.date===t),u=e.find(e=>e.date===o);if(!c){p.push(/* @__PURE__ */d("div",{className:"bu-grid bu-center disabled",children:/* @__PURE__ */d("span",{children:ue(f,{day:"numeric"})})},t)),f=he(f,1);continue}const l=c;p.push(/* @__PURE__ */d("div",{className:Gl({day:f,monthStart:a,discounts:n,buDate:c,prevBooked:u,house:r,dates:s}),role:"button",tabIndex:0,onClick:()=>{ke(le(l.date),/* @__PURE__ */new Date)||i({type:"clicked",day:l,house:r})},children:/* @__PURE__ */d("span",{children:ue(f,{day:"numeric"})})},c.date)),f=he(f,1)}h.push(p),p=[]}/* @__PURE__ */
154
- return d("div",{className:"bu-grid bu-grid-cols-7",children:h})}function Ql({month:e}){const t={weekday:"short"};let n=[],r=be(e);for(let o=0;o<7;o++)n.push(/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:ue(he(r,o),t)},o));/* @__PURE__ */
155
- return d("div",{className:"bu-grid bu-grid-cols-7",children:n})}function Zl({count:e,currentMonth:t,house:n,availabilities:r,discounts:o}){const i=fe(t,e);/* @__PURE__ */
156
- return h("div",{className:"bu-calendar calendar bup-16",children:[
157
- /* @__PURE__ */d(Kl,{month:i}),
158
- /* @__PURE__ */d(Ql,{month:i}),
159
- /* @__PURE__ */d(Xl,{availabilities:r,discounts:o,month:i,house:n})]},i.toISOString())}function ed({numberOfMonthsInARow:e,currentMonth:t,numberOfMonths:n,house:r}){const{portalCode:s,objectCode:a,locale:c,apiUrl:l}=o(zs),[h,f]=u(null),[m,g]=u(!0),[_,y]=u(!1);if(i(()=>{let e=!1;g(!0),y(!1);const r=be(_e(t)),o=ve(ye(fe(t,n-1)));return Vl({apiUrl:l,locale:c,portalCode:s,objectCode:a,startsDate:r,endDate:o}).then(t=>{e||(f(t),g(!1))}).catch(()=>{e||(y(!0),g(!1))}),()=>{e=!0}},[l,c,s,a,t,n]),m)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if(_||!h)/* @__PURE__ */return d("div",{children:"Error"});let b=[];for(let o=0;o<n;o++)b.push(/* @__PURE__ */d(Zl,{house:r,currentMonth:t,count:o,availabilities:h.availabilities,discounts:h.discounts},de(fe(t,o)).slice(0,7)));/* @__PURE__ */
160
- return d("div",{className:`bu-grid bu-grid-cols-${e||2} bu-gap-16`,children:b})}function td({persons:e,variables:t}){const{portalCode:n,objectCode:r,locale:s,apiUrl:a}=o(zs),{currency:c}=Vs(),[f,m]=u(null),[g,_]=u(!0),[y,b]=u(null);return i(()=>{let o=!1;_(!0),b(null);const i={arrival:t.starts_at,departure:t.ends_at};return rl({apiUrl:a,locale:s,portalCode:n,objectCode:r,startsAt:t.starts_at,endsAt:t.ends_at,persons:e,currency:c}).then(t=>{o||(m(t),_(!1),function(e,t,n){return Ul(`quote_shown:${e}:${t.arrival}:${t.departure}:${n}`)}(r,i,e)&&gu({house_code:r,portal_code:n,locale:s,interaction_type:"quote_shown",interaction_info:{...i,persons:e,total_cents:Math.round(100*t.total_price),currency:t.currency.toUpperCase()}}))}).catch(e=>{o||(b(e),_(!1),e instanceof nl&&Ml(r,i)&&gu({house_code:r,portal_code:n,locale:s,interaction_type:"price_unavailable",interaction_info:i}))}),()=>{o=!0}},[a,s,n,r,t.starts_at,t.ends_at,e,c]),g?/* @__PURE__ */d("div",{className:"price-overview--build bup-16",children:/* @__PURE__ */d(p,{})}):y||!f?/* @__PURE__ */d("div",{className:"price-overview--build bup-16",children:ne(y instanceof nl?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */d(l,{children:/* @__PURE__ */h("div",{className:"price-overview--book",children:[/* @__PURE__ */d("div",{className:"price",children:re(Math.round(f.total_price),{style:"currency",currency:f.currency})}),/* @__PURE__ */d("div",{children:/* @__PURE__ */d("i",{children:ne("based_on_one_person",{persons:e})})})]})})}var nd=Ee;function rd({house:e}){const t=e.persons>2?2:e.persons,[n,r]=u(t),{arrivalDate:i,departureDate:s}=o(Hu),a=o(Yu);let c=Du(e.persons);/* @__PURE__ */
161
- return h("div",{className:"calendar--picker",children:[
162
- /* @__PURE__ */h("div",{className:"calendar--picker--date",children:[/* @__PURE__ */d("span",{className:"name",children:ne(`${e.house_type}.arrival`)}),/* @__PURE__ */d("span",{className:"detail",children:i?.date?/* @__PURE__ */d("span",{children:ue(le(i?.date),nd)}):ne(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})]}),
163
- /* @__PURE__ */h("div",{className:"calendar--picker--date",children:[/* @__PURE__ */d("span",{className:"name",children:ne(`${e.house_type}.departure`)}),/* @__PURE__ */d("span",{className:"detail",children:s?.date?/* @__PURE__ */d("span",{children:ue(le(s?.date),nd)}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{children:ne(`${e.house_type}.pick_your_departure_in_the_calendar`)}),i&&ne("minimum_nights",{minimum:i?.min_nights})]})})]}),
164
- /* @__PURE__ */d("div",{className:"calendar--picker--date",children:/* @__PURE__ */d("span",{className:"detail",children:/* @__PURE__ */d("select",{className:"calendar--picker--persons",value:n,onChange:e=>{r(Number(e.target.value))},children:c.map(e=>/* @__PURE__ */h("option",{value:e,children:[e," ",ne("persons")]},e))})})}),
165
- /* @__PURE__ */d("div",{className:"calendar--picker--date",children:/* @__PURE__ */d(Ks,{})}),
166
- /* @__PURE__ */d("div",{className:"calendar--picker--date",children:i&&s&&/* @__PURE__ */d(td,{persons:n,variables:{starts_at:i?.date,ends_at:s?.date}})}),
167
- /* @__PURE__ */d("button",{className:"button",disabled:!i||!s,onClick:()=>{i&&s&&a({type:"start",persons:n})},children:ne("calculate")})]})}function od({house:e}){/* @__PURE__ */
168
- return d("div",{className:"price-overview bup-16",children:/* @__PURE__ */d(rd,{house:e})})}function id({numberOfMonths:e,house:t,numberOfMonthsInARow:n}){const[r,o]=u(/* @__PURE__ */new Date);/* @__PURE__ */
169
- return h("div",{className:"calendar-container ",children:[/* @__PURE__ */d(od,{house:t}),/* @__PURE__ */h("div",{className:"calendar-section",children:[
170
- /* @__PURE__ */d(Yl,{changeMonth:o,currentMonth:r,numberOfMonths:e}),
171
- /* @__PURE__ */d(ed,{house:t,numberOfMonths:e,numberOfMonthsInARow:n,currentMonth:r}),
172
- /* @__PURE__ */d(Jl,{house:t}),
173
- /* @__PURE__ */d(Wl,{house:t})]})]})}function sd({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:s}=o(zs),[a,c]=u({status:"loading"});if(i(()=>{let e=!1;return c({status:"loading"}),Fl({apiUrl:s,locale:r,portalCode:t,objectCode:n}).then(t=>{e||c({status:"ready",house:t})}).catch(t=>{e||(t instanceof Bl&&t.notFound?c({status:"not-found"}):c({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error(`The accommodation request failed: ${String(t)}`)}))}),()=>{e=!0}},[s,r,t,n]),"loading"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(Ms,{errors:a.error})});const l=e.bookingFormConfiguration.show_months_amount,f=e.bookingFormConfiguration.show_months_in_a_row_amount;/* @__PURE__ */
174
- return d("div",{id:"calendar-container",children:"not-found"===a.status?/* @__PURE__ */d("div",{children:ne("no_house_found")}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{className:"bup-16",children:a.house.name}),/* @__PURE__ */d(id,{numberOfMonths:l,numberOfMonthsInARow:f,house:a.house})]})})}function ad({portalSite:e}){const{bookingStarted:t}=o(Hu);/* @__PURE__ */
175
- return d(t?ql:sd,{portalSite:e})}function cd({portalSite:e}){const{portalCode:t,objectCode:n,locale:r}=o(zs);return i(()=>{Ul(`house_view:${n}`)&&gu({house_code:n,portal_code:t,locale:r,interaction_type:"house_view",interaction_info:{entry:vu()}})},[n,t,r]),/* @__PURE__ */d(Wu,{children:/* @__PURE__ */d(ad,{portalSite:e})})}async function ud({portalCode:e,objectCode:t,apiUrl:n="",after:r}){const o=new URLSearchParams({portal_code:e,object_code:t});r&&o.set("after",r);const i=`${n?new URL(n).origin:""}/portal_api/v1/accommodations/reviews?${o.toString()}`;try{const e=await zc.get(i).json();return{house:{id:"",name:e.house.name,rating:Number(e.house.rating),scoreAmount:Number(e.house.score_amount),reviews:e.items.map(e=>({id:"",name:e.name,review:e.review,score:Number(e.score),createdAt:e.created_at,sourceName:e.source_name??"",reviewResponses:e.review_responses??[],reviewCriteria:(e.review_criteria??[]).map(e=>({id:0,name:e.name,score:Number(e.score)}))}))},pageInfo:e.page_info}}catch(s){if(s instanceof Xs)throw new Error(`Reviews request failed (${s.response.status})`);throw s}}function ld(e){return e>7?"best":e>6?"good":e>4?"medium":"low"}function dd(e){return{color:ld(e),formatted:e%1==0?String(e):e.toFixed(1)}}function hd(e,t){const n=document.createElement("div");return e&&(n.className=e),t&&(n.textContent=t),n}function pd(e){const t=hd("bu_reviews bup-16"),n=hd("bu_reviews__overview bup-16 bu_card"),r=hd("bu_score");if(e.rating){const t=dd(e.rating),n=hd(`bu_score__rating bu_card ${t.color}`);n.textContent=t.formatted,r.appendChild(n)}const o=hd("bu_reviews__overview__number",`${e.scoreAmount} ${ne("reviews")}`);return n.appendChild(r),n.appendChild(o),t.appendChild(n),e.reviews.forEach(e=>{const n=function(e){const t=dd(e.score);return{id:e.id,name:e.name,createdAt:e.createdAt,review:e.review,color:t.color,formatted:t.formatted,sourceName:e.sourceName,reviewResponses:e.reviewResponses,criteria:e.reviewCriteria.map(e=>{const t=dd(e.score);return{id:e.id,name:e.name,score:e.score,color:t.color,formatted:t.formatted}})}}(e),r=hd("bu_single_review bup-16 bu_card"),o=hd("bu_review_summary"),i=hd("bu_score");if(e.score){const e=hd(`bu_score__rating bu_card ${n.color}`,n.formatted);i.appendChild(e)}const s=hd("bu_review_summary__date_name"),a=hd(void 0,`${Ne(n.createdAt)}, `),c=hd("bu_review_summary__name",n.name);if(s.appendChild(a),s.appendChild(c),o.appendChild(i),o.appendChild(s),n.sourceName){const e=hd("bu_review_summary__source",n.sourceName);o.appendChild(e)}if(r.appendChild(o),n.review){const e=document.createElement("blockquote");e.className="bu_review",e.textContent=n.review,r.appendChild(e)}if(n.criteria.length>0){const e=hd("bu_criteria");n.criteria.forEach(t=>{const n=hd("bu_score");if(t.score){const e=hd(`bu_score__rating bu_card ${t.color}`,t.formatted);n.appendChild(e)}n.appendChild(hd(void 0,t.name)),e.appendChild(n)}),r.appendChild(e)}if(n.reviewResponses?.length>0){const e=hd("bu_review_responses");n.reviewResponses.forEach(t=>{const n=hd("bu_review_response"),r=hd("bu_review_response__label",ne("review_response_label")),o=hd("bu_review_response__header"),i=Ne(t.created_at);o.appendChild(hd("bu_review_response__sender",t.sender)),o.appendChild(hd("bu_review_response__date",i));const s=document.createElement("p");s.className="bu_review_response__message",s.textContent=t.message,n.appendChild(r),n.appendChild(o),n.appendChild(s),e.appendChild(n)}),r.appendChild(e)}t.appendChild(r)}),t}function fd({house:e}){const t=c(null);return i(()=>{var n,r;if(t.current)return n=t.current,r=()=>pd(e),n.replaceChildren(r()),()=>{n.replaceChildren()}},[e]),/* @__PURE__ */d("div",{ref:t})}function md({objectCode:e,portalCode:t,apiUrl:n}){const[r,o]=u({status:"loading"}),s=c(!0);if(i(()=>(s.current=!0,()=>{s.current=!1}),[]),i(()=>{let r=!0;return o({status:"loading"}),ud({portalCode:t,objectCode:e,apiUrl:n}).then(({house:e,pageInfo:t})=>{r&&o({status:"ready",house:e,endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{r&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})}),()=>{r=!1}},[t,e,n]),"loading"===r.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===r.status)/* @__PURE__ */return d("div",{className:"bukazu-error-message","data-testid":"error",children:/* @__PURE__ */d("h2",{children:ne("something_went_wrong_please_try_again")})});const a=r.house,f="ready"===r.status&&r.hasNextPage,m="loading_more"===r.status;/* @__PURE__ */
171
+ /* @__PURE__ */d(nd,{bookingFormConfiguration:v,house:e}),J.max_persons&&/* @__PURE__ */d("div",{className:"error-message bu-error-message persons",children:J.max_persons})]}),
172
+ /* @__PURE__ */d(zl,{errors:J,house:e,bookingFormConfiguration:v,values:S}),
173
+ /* @__PURE__ */d(Ul,{house:e,values:S}),
174
+ /* @__PURE__ */d(td,{costs:k.optional_house_costs,currency:k.currency}),
175
+ /* @__PURE__ */d(Zl,{bookingFields:w,errors:J,touched:E,PortalSite:t,values:S})]}),
176
+ /* @__PURE__ */h("div",{className:"form-sum bup-16"+(O?" bu-open":""),children:[/* @__PURE__ */h("div",{className:"bu-sheet-head",children:[/* @__PURE__ */d("span",{className:"bu-sheet-title",children:ne("your_booking")}),/* @__PURE__ */d("button",{type:"button",className:"bu-sheet-close","aria-label":ne("close"),onClick:()=>U(!1),children:/* @__PURE__ */d(oe,{size:18})})]}),Z]}),O&&/* @__PURE__ */d("div",{className:"bu-form-backdrop",onClick:()=>U(!1)})]}),
177
+ /* @__PURE__ */h("div",{className:"bu-form-bar",children:[/* @__PURE__ */h("button",{type:"button",className:"bu-form-bar-total","aria-expanded":O,onClick:()=>U(!0),children:[/* @__PURE__ */d("span",{className:"bu-form-bar-amount",children:Q??"—"}),/* @__PURE__ */d("span",{className:"bu-form-bar-hint",children:ne("view_breakdown")})]}),/* @__PURE__ */d("button",{className:"bu-form-bar-submit",type:"submit",disabled:T,children:X})]})]})})}var sd=/* @__PURE__ */new Set;function id(e){return!sd.has(e)&&(sd.add(e),!0)}function ad(e,t){return id(`price_unavailable:${e}:${t.arrival}:${t.departure}`)}function cd({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:i}=o(Hi),{currency:a}=Ki(),{arrivalDate:l,departureDate:h,persons:f}=o(Wu),[m,g]=u(null),[_,y]=u(null),b=c(/* @__PURE__ */new Set);return s(()=>{let e=!1;y(null);const o={arrival:l.date,departure:h.date},s={house_code:n,portal_code:t,locale:r};return ol({apiUrl:i,locale:r,portalCode:t,objectCode:n,startsAt:l.date,endsAt:h.date,currency:a,includeAccommodation:!0}).then(t=>{e||(t.accommodation?((()=>{const e=`${n}:${o.arrival}:${o.departure}`;return!b.current.has(e)&&(b.current.add(e),!0)})()&&_u({...s,interaction_type:"booking_started",interaction_info:{...o,persons:f}}),g({...t.accommodation,booking_price:{total_price:t.total_price,currency:t.currency,optional_house_costs:t.optional_house_costs.map(e=>({id:String(e.id),name:e.name,method:e.method,max_available:e.max_available,amount:e.amount,method_name:e.method_name,description:e.description}))}})):y(/* @__PURE__ */new Error("Price response lacks the accommodation")))}).catch(t=>{e||(y(t instanceof Error?t:new Error(String(t))),t instanceof rl&&ad(n,o)&&_u({...s,interaction_type:"price_unavailable",interaction_info:o}))}),()=>{e=!0}},[i,r,t,n,l,h,f,a]),m||_?_||!m?/* @__PURE__ */d("div",{children:ne(_ instanceof rl?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */d(od,{house:m,PortalSite:e}):/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})})}var ud=class extends Error{constructor(e){super(`Accommodation detail request failed (${e})`),this.name="AccommodationDetailError",this.status=e,this.notFound=404===e}};async function ld(e){const t=function({apiUrl:e,portalCode:t,objectCode:n}){const r=new URL("/portal_api/v1/accommodations/detail",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,object_code:n}).toString(),r.toString()}(e);try{return await Hc.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof Qi)throw new ud(n.response.status);throw n}}function dd({persons:e,variables:t}){const{portalCode:n,objectCode:r,locale:i,apiUrl:a}=o(Hi),{currency:c}=Ki(),[l,f]=u(null),[m,g]=u(!0),[_,y]=u(null);return s(()=>{let o=!1;g(!0),y(null);const s={arrival:t.starts_at,departure:t.ends_at};return ol({apiUrl:a,locale:i,portalCode:n,objectCode:r,startsAt:t.starts_at,endsAt:t.ends_at,persons:e,currency:c}).then(t=>{o||(f(t),g(!1),function(e,t,n){return id(`quote_shown:${e}:${t.arrival}:${t.departure}:${n}`)}(r,s,e)&&_u({house_code:r,portal_code:n,locale:i,interaction_type:"quote_shown",interaction_info:{...s,persons:e,total_cents:Math.round(100*t.total_price),currency:t.currency.toUpperCase()}}))}).catch(e=>{o||(y(e),g(!1),e instanceof rl&&ad(r,s)&&_u({house_code:r,portal_code:n,locale:i,interaction_type:"price_unavailable",interaction_info:s}))}),()=>{o=!0}},[a,i,n,r,t.starts_at,t.ends_at,e,c]),m?/* @__PURE__ */d("div",{className:"price-overview--build bu-stay-price bu-stay-price-loading",children:/* @__PURE__ */d(p,{})}):_||!l?/* @__PURE__ */d("div",{className:"price-overview--build bu-stay-price bu-stay-price-error",children:ne(_ instanceof rl?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */h("div",{className:"price-overview--book bu-stay-price",children:[/* @__PURE__ */d("div",{className:"price bu-stay-price-value",children:re(Math.round(l.total_price),{style:"currency",currency:l.currency})}),/* @__PURE__ */d("div",{className:"bu-stay-price-hint",children:ne("based_on_one_person",{persons:e})})]})}function hd({house:e}){const t=e.persons>2?2:e.persons,[n,r]=u(t),{arrivalDate:s,departureDate:i}=o(Wu),a=o(Yu),c=ju(e.persons),l=Boolean(s&&i),p=s&&i?Ce(le(i.date),le(s.date)):0;/* @__PURE__ */
178
+ return h("div",{className:"calendar--picker bu-stay-bar",children:[/* @__PURE__ */h("div",{className:"bu-stay-bar-dates",children:[
179
+ /* @__PURE__ */h("div",{className:"bu-stay-slot",children:[/* @__PURE__ */d("span",{className:"bu-stay-slot-label",children:ne(`${e.house_type}.arrival`)}),/* @__PURE__ */d("span",{className:"bu-stay-slot-value"+(s?"":" bu-empty"),children:s?ue(le(s.date),Ne):ne(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})]}),
180
+ /* @__PURE__ */d("span",{className:"bu-stay-arrow","aria-hidden":"true",children:/* @__PURE__ */d(yl,{size:18})}),
181
+ /* @__PURE__ */h("div",{className:"bu-stay-slot",children:[/* @__PURE__ */d("span",{className:"bu-stay-slot-label",children:ne(`${e.house_type}.departure`)}),/* @__PURE__ */d("span",{className:"bu-stay-slot-value"+(i?"":" bu-empty"),children:i?ue(le(i.date),Ne):s?ne(`${e.house_type}.pick_your_departure_in_the_calendar`):"—"})]}),l?/* @__PURE__ */d("span",{className:"bu-pill bu-stay-nights",children:ne("nights",{count:p})}):s?/* @__PURE__ */d("span",{className:"bu-stay-nights bu-stay-nights-empty",children:ne("minimum_nights",{minimum:s.min_nights})}):null,
182
+ /* @__PURE__ */h("label",{className:"bu-stay-persons",children:[/* @__PURE__ */d("span",{className:"bu-visually-hidden",children:ne("persons")}),/* @__PURE__ */d("select",{className:"calendar--picker--persons",value:n,disabled:!l,onChange:e=>{r(Number(e.target.value))},children:c.map(e=>/* @__PURE__ */h("option",{value:e,children:[e," ",ne("persons")]},e))})]}),
183
+ /* @__PURE__ */d(Gi,{})]}),/* @__PURE__ */h("div",{className:"bu-stay-bar-actions",children:[s&&i?/* @__PURE__ */d(dd,{persons:n,variables:{starts_at:s.date,ends_at:i.date}}):/* @__PURE__ */h("div",{className:"bu-stay-price bu-empty",children:[/* @__PURE__ */d("div",{className:"bu-stay-price-value",children:"—"}),/* @__PURE__ */d("div",{className:"bu-stay-price-hint",children:ne("price_follows_dates")})]}),s&&/* @__PURE__ */d("button",{type:"button",className:"bu-link-button bu-stay-clear",onClick:()=>a({type:"reset"}),children:ne("clear_dates")}),
184
+ /* @__PURE__ */h("button",{type:"button",className:"button bu-stay-next",disabled:!l,onClick:()=>{s&&i&&a({type:"start",persons:n})},children:[ne("calculate"),/* @__PURE__ */d(yl,{})]})]})]})}function pd({house:e}){/* @__PURE__ */
185
+ return d("div",{className:"price-overview bu-stay-bar-wrap",children:/* @__PURE__ */d(hd,{house:e})})}function fd({numberOfMonths:e,house:t,numberOfMonthsInARow:n}){const[r,o]=u(/* @__PURE__ */new Date);/* @__PURE__ */
186
+ return h("div",{className:"calendar-container bu-calendar-page",children:[/* @__PURE__ */h("div",{className:"calendar-section bu-calendar-main",children:[
187
+ /* @__PURE__ */d(Pl,{house:t}),
188
+ /* @__PURE__ */d(Dl,{house:t,numberOfMonths:e,numberOfMonthsInARow:n,currentMonth:r,changeMonth:o}),
189
+ /* @__PURE__ */d(wl,{house:t})]}),/* @__PURE__ */d(pd,{house:t})]})}function md({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:i}=o(Hi),[a,c]=u({status:"loading"});if(s(()=>{let e=!1;return c({status:"loading"}),ld({apiUrl:i,locale:r,portalCode:t,objectCode:n}).then(t=>{e||c({status:"ready",house:t})}).catch(t=>{e||(t instanceof ud&&t.notFound?c({status:"not-found"}):c({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error(`The accommodation request failed: ${String(t)}`)}))}),()=>{e=!0}},[i,r,t,n]),"loading"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(qi,{errors:a.error})});const l=e.bookingFormConfiguration.show_months_amount,f=e.bookingFormConfiguration.show_months_in_a_row_amount;/* @__PURE__ */
190
+ return d("div",{id:"calendar-container",children:"not-found"===a.status?/* @__PURE__ */d("div",{children:ne("no_house_found")}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{className:"bup-16",children:a.house.name}),/* @__PURE__ */d(fd,{numberOfMonths:l,numberOfMonthsInARow:f,house:a.house})]})})}function gd({portalSite:e}){const{bookingStarted:t}=o(Wu);/* @__PURE__ */
191
+ return d(t?cd:md,{portalSite:e})}function _d({portalSite:e}){const{portalCode:t,objectCode:n,locale:r}=o(Hi);return s(()=>{id(`house_view:${n}`)&&_u({house_code:n,portal_code:t,locale:r,interaction_type:"house_view",interaction_info:{entry:wu()}})},[n,t,r]),/* @__PURE__ */d(Vu,{children:/* @__PURE__ */d(gd,{portalSite:e})})}async function yd({portalCode:e,objectCode:t,apiUrl:n="",after:r}){const o=new URLSearchParams({portal_code:e,object_code:t});r&&o.set("after",r);const s=`${n?new URL(n).origin:""}/portal_api/v1/accommodations/reviews?${o.toString()}`;try{const e=await Hc.get(s).json();return{house:{id:"",name:e.house.name,rating:Number(e.house.rating),scoreAmount:Number(e.house.score_amount),criteriaAverages:e.house.criteria_averages?.map(e=>({name:e.name,score:Number(e.score),count:Number(e.count)})),reviews:e.items.map(e=>({id:"",name:e.name,review:e.review,score:Number(e.score),createdAt:e.created_at,sourceName:e.source_name??"",reviewResponses:e.review_responses??[],reviewCriteria:(e.review_criteria??[]).map(e=>({id:0,name:e.name,score:Number(e.score)}))}))},pageInfo:e.page_info}}catch(i){if(i instanceof Qi)throw new Error(`Reviews request failed (${i.response.status})`);throw i}}function bd(e){return e>8?"best":e>7?"good":e>5.5?"medium":"low"}function vd(e){return{color:bd(e),formatted:e%1==0?String(e):e.toFixed(1)}}function wd(e){const t=/* @__PURE__ */new Map;for(const n of e)for(const e of n.reviewCriteria){if(!(e.name&&e.score>0))continue;const n=t.get(e.name)??{sum:0,count:0};n.sum+=e.score,n.count+=1,t.set(e.name,n)}return Array.from(t,([e,{sum:t,count:n}])=>({name:e,score:Math.round(t/n*10)/10}))}function kd(e){return e.filter(e=>e.reviewCriteria.some(e=>e.score>0)).length}function xd(e,t){const n=document.createElement("div");return e&&(n.className=e),t&&(n.textContent=t),n}function Sd(e,t){const n=document.createElement("span");return n.className=e,n.textContent=t,n}function Cd(e,t,n=!1){return xd(`bu_score__rating ${t}${n?" bu-score-lg":""}`,e)}function Ed(e){const t=xd("bu_reviews__overview bu-reviews-header"),n=xd("bu_score bu-reviews-header-score"),r=xd("bu-reviews-header-text");if(e.rating){const t=vd(e.rating);n.appendChild(Cd(t.formatted,t.color,!0)),r.appendChild(xd("bu-reviews-header-label",ne(function(e){switch(bd(e)){case"best":return"score_excellent";case"good":return"score_very_good";case"medium":return"score_good";default:return"score_fair"}}(e.rating))))}r.appendChild(xd("bu_reviews__overview__number",`${e.scoreAmount} ${ne("reviews")}${e.name?` · ${e.name}`:""}`)),n.appendChild(r),t.appendChild(n);const{averages:o,count:s,source:i}=function(e){return e.criteriaAverages&&e.criteriaAverages.length>0?{averages:e.criteriaAverages,count:Math.max(...e.criteriaAverages.map(e=>e.count??0)),source:"api"}:{averages:wd(e.reviews),count:kd(e.reviews),source:"loaded"}}(e);if(o.length>0){const e=xd("bu-criteria-averages");o.forEach(t=>{const n=xd("bu-criteria-average");n.appendChild(Sd("bu-criteria-average-name",t.name));const r=xd("bu-criteria-bar"),o=document.createElement("span");o.className=bd(t.score),o.style.width=`${Math.min(100,10*t.score)}%`,r.appendChild(o),n.appendChild(r),n.appendChild(Sd("bu-criteria-average-value",vd(t.score).formatted)),e.appendChild(n)}),e.appendChild(xd("bu-criteria-averages-hint",ne("api"===i?"based_on_reviews":"based_on_last_reviews",{count:s}))),t.appendChild(e)}return t}function Nd(e){const t=xd("bu_reviews bu-reviews");return t.appendChild(Ed(e)),e.reviews.forEach(e=>{const n=function(e){const t=vd(e.score);return{id:e.id,name:e.name,createdAt:e.createdAt,review:e.review,color:t.color,formatted:t.formatted,sourceName:e.sourceName,reviewResponses:e.reviewResponses,criteria:e.reviewCriteria.map(e=>{const t=vd(e.score);return{id:e.id,name:e.name,score:e.score,color:t.color,formatted:t.formatted}})}}(e),r=""!==n.review.trim(),o=xd("bu_single_review bu-review-card"+(r?"":" bu-review-card-slim")),s=xd("bu_review_summary bu-review-head"),i=xd("bu_score");e.score&&i.appendChild(Cd(n.formatted,n.color));const a=xd("bu_review_summary__date_name bu-review-who");if(a.appendChild(xd("bu_review_summary__name",n.name)),a.appendChild(xd("bu_review_summary__date",r?Re(n.createdAt):`${Re(n.createdAt)} · ${ne("score_only")}`)),i.appendChild(a),s.appendChild(i),n.sourceName&&s.appendChild(xd("bu_review_summary__source",ne("via_source",{source:n.sourceName}))),o.appendChild(s),r){const e=document.createElement("p");e.className="bu_review bu-review-text",e.textContent=n.review,o.appendChild(e)}if(n.criteria.length>0){const e=xd("bu_criteria bu-criteria-pills");n.criteria.forEach(t=>{const n=Sd("bu-criterion","");t.score&&n.appendChild(Sd(`bu-criterion-dot ${t.color}`,"")),n.appendChild(Sd("bu-criterion-name",t.name)),t.score&&n.appendChild(Sd("bu-criterion-score",t.formatted)),e.appendChild(n)}),o.appendChild(e)}if(n.reviewResponses?.length>0){const e=xd("bu_review_responses");n.reviewResponses.forEach(t=>{const n=xd("bu_review_response"),r=xd("bu_review_response__header");r.appendChild(Sd("bu-review-response-avatar",t.sender.charAt(0))),r.appendChild(xd("bu_review_response__sender",t.sender)),r.appendChild(xd("bu_review_response__label",ne("review_response_label"))),r.appendChild(xd("bu_review_response__date",Re(t.created_at)));const o=document.createElement("p");o.className="bu_review_response__message",o.textContent=t.message,n.appendChild(r),n.appendChild(o),e.appendChild(n)}),o.appendChild(e)}t.appendChild(o)}),t}function Td({house:e}){const t=c(null);return s(()=>{var n,r;if(t.current)return n=t.current,r=()=>Nd(e),n.replaceChildren(r()),()=>{n.replaceChildren()}},[e]),/* @__PURE__ */d("div",{ref:t})}function Rd({objectCode:e,portalCode:t,apiUrl:n}){const[r,o]=u({status:"loading"}),i=c(!0);if(s(()=>(i.current=!0,()=>{i.current=!1}),[]),s(()=>{let r=!0;return o({status:"loading"}),yd({portalCode:t,objectCode:e,apiUrl:n}).then(({house:e,pageInfo:t})=>{r&&o({status:"ready",house:e,endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{r&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})}),()=>{r=!1}},[t,e,n]),"loading"===r.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===r.status)/* @__PURE__ */return d("div",{className:"bukazu-error-message","data-testid":"error",children:/* @__PURE__ */d("h2",{children:ne("something_went_wrong_please_try_again")})});const a=r.house,f="ready"===r.status&&r.hasNextPage,m="loading_more"===r.status;/* @__PURE__ */
176
192
  return h(l,{children:[
177
- /* @__PURE__ */d(fd,{house:a}),m&&/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})}),!m&&f&&/* @__PURE__ */d("button",{type:"button",className:"bu_load_more",onClick:function(){if("ready"!==r.status||!r.hasNextPage)return;const i=r.house,a=r.endCursor;o({status:"loading_more",house:i,endCursor:a}),ud({portalCode:t,objectCode:e,apiUrl:n,after:a??void 0}).then(({house:e,pageInfo:t})=>{s.current&&o({status:"ready",house:{...i,reviews:[...i.reviews,...e.reviews]},endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{s.current&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})})},children:ne("load_more_reviews")}),
178
- /* @__PURE__ */d("div",{className:"bu_reviews__note",children:/* @__PURE__ */d("a",{href:"https://www.bukazu.com",target:"_blank",rel:"noopener noreferrer",children:ne("reviews_note_link")})})]})}var gd={nl:{url:"http://bukazu.com/veiligheid",label:"Beveiligd en mogelijk gemaakt door BUKAZU"},en:{url:"http://bukazu.com/en/security",label:"Secured and made possible by BUKAZU"},de:{url:"http://bukazu.com/de/sicherheit",label:"Gesichert und ermöglicht durch BUKAZU"},fr:{url:"http://bukazu.com/fr/securite",label:"Sécurisé et rendu possible par BUKAZU"},es:{url:"http://bukazu.com/es/seguridad",label:"Asegurado y hecho posible por BUKAZU"},it:{url:"http://bukazu.com/it/sicurezza",label:"Protetto e reso possibile da BUKAZU"}};function _d(e){const{url:t,label:n}=Object.prototype.hasOwnProperty.call(gd,e)?gd[e]:gd.en;return`<div class="bu-safe-booking"><a href="${t}" class="bu-safe-booking-link"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve" width="16px" height="16px" class="bu-safe-booking-icon"><path d="M75.98,41.62h-2.47L73.5,29.31C73.49,15.9,62.58,4.99,49.17,5C35.76,5.01,24.85,15.92,24.86,29.33l0.02,12.31H24 c-4.61,0.01-8.35,3.75-8.34,8.36v36.65c0,4.61,3.75,8.35,8.36,8.35L76,94.97c4.61,0,8.35-3.74,8.34-8.35V49.96 C84.34,45.35,80.59,41.62,75.98,41.62z M33.84,41.64l-0.02-12.31c0-8.47,6.88-15.36,15.35-15.37c8.47,0,15.36,6.89,15.36,15.35 l0.02,12.31L33.84,41.64z" /></svg>${n}</a></div>`}var yd=class extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){js(e)}render(){return this.state.hasError?/* @__PURE__ */d("h1",{children:"Something went wrong."}):this.props.children}};function bd(e,t,n){const r=new URL(`/portal_api/v1/config/${t}`,new URL(e).origin);return r.search=new URLSearchParams({portal_code:n}).toString(),r.toString()}async function vd(e,t){try{return await zc.get(e,{headers:{locale:t}}).json()}catch(n){if(n instanceof Xs)throw new Error(`Portal settings request failed (${n.response.status})`);throw n}}function wd({apiUrl:e,locale:t,portalCode:n}){return vd(function({apiUrl:e,portalCode:t}){return bd(e,"settings",t)}({apiUrl:e,portalCode:n}),t)}function xd({apiUrl:e,locale:t,portalCode:n}){return vd(function({apiUrl:e,portalCode:t}){return bd(e,"booking-fields",t)}({apiUrl:e,portalCode:n}),t)}function kd({apiUrl:e,locale:t,portalCode:n}){return vd(function({apiUrl:e,portalCode:t}){return bd(e,"filter-fields",t)}({apiUrl:e,portalCode:n}),t)}function Sd(e,t){const n=`_${t}`,r=e??{},o={};return Object.keys(r).forEach(e=>{e.endsWith(n)&&(o[e.slice(0,-n.length)]=r[e])}),o}function Cd(e){const{results_amount:t,no_results:n,...r}=e,o=Number(t??n);return{...r,no_results:Number.isFinite(o)&&o>0?o:20}}async function Ed({portalCode:e,isSearchPage:t,isBookingPage:n,apiUrl:r,locale:o}){const i=wd({apiUrl:r,locale:o,portalCode:e}),s=t?kd({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),a=n?xd({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),[c,u,l]=await Promise.all([i,s,a]);if(!c)throw new Error("Portal site data is missing");return function({settings:e,filterFields:t,bookingFields:n,locale:r}){const o=(n??[]??[]).map(e=>({id:e.id,label:e.label,field_type:e.field_type,type:e.field_type,options:e.field_options,required:e.required,placeholder:e.placeholder})),i=(c=t??[],(c??[]).map(e=>({id:e.id,type:e.field_type,label:e.label,...void 0!==e.max&&{max:e.max},...void 0!==e.options&&{options:e.options}}))),s=e.colors,a={filtersForm:Cd(e.filters_form),bookingFields:o,searchFields:void 0!==t?i:void 0,bookingForm:{},colors:s};var c;return{name:e.name,portal_code:e.portal_code,options:a,colorsConfiguration:s,currencies:Ys(e.currencies),bookingFormConfiguration:e.booking_form,booking_fields:o,max_persons:0,max_bedrooms:0,max_bathrooms:0,max_weekprice:0,...Sd(e.labels,r)}}({settings:c,filterFields:u,bookingFields:l,locale:o})}function Td({pageType:e,locale:t,filters:n={}}){const{portalCode:r,objectCode:s,apiUrl:a,locale:c}=o(zs),[l,f]=u({status:"loading"}),m=!s,g=!!s&&"reviews"!==e;if(i(()=>{let e=!0;f({status:"loading"});const t=te(c);return Ed({portalCode:r,isSearchPage:m,isBookingPage:g,apiUrl:a,locale:c}).then(async n=>{await t,e&&f({status:"ready",portalSite:n})}).catch(async n=>{if(await t,!e)return;const r=n instanceof Error?n:/* @__PURE__ */new Error("A portal settings request failed");f({status:"error",error:r})}),()=>{e=!1}},[r,m,g,a,c]),"loading"===l.status)/* @__PURE__ */return d(p,{});if("error"===l.status)/* @__PURE__ */return d(Ms,{errors:l.error});const _=l.portalSite;let y=_.options;const b=_.colorsConfiguration,v=document.documentElement;let w;return v.style.setProperty("--bukazu-discount",b.discount),v.style.setProperty("--bukazu-cell",b.cell),v.style.setProperty("--bukazu-arrival",b.arrival),v.style.setProperty("--bukazu-booked",b.booked),v.style.setProperty("--bukazu-departure",b.departure),v.style.setProperty("--bukazu-button",b.button),v.style.setProperty("--bukazu-button_cta",b.button_cta),w=s&&null!==s&&"reviews"!==e?/* @__PURE__ */h(yd,{children:[/* @__PURE__ */d(cd,{portalSite:_}),/* @__PURE__ */d("div",{dangerouslySetInnerHTML:{__html:_d(t)}})]}):s&&null!==s&&"reviews"===e?/* @__PURE__ */d(md,{objectCode:s,portalCode:r,apiUrl:a}):/* @__PURE__ */d(Eu,{PortalSite:_,locale:t,options:y,filters:n}),/* @__PURE__ */d(Js,{currencies:_.currencies,children:w})}function Nd({portalCode:e,objectCode:t,pageType:n,locale:r,filters:o,api_url:s="https://api.bukazu.com",sentryDsn:a}){const c=Bs(r);i(()=>{var n;a&&(n=a,void 0===On()&&Is({dsn:n,integrations:e=>e.filter(e=>"GlobalHandlers"!==e.name)})),Ds({portalCode:e,objectCode:t,locale:c})},[a,e,t,c]),i(()=>{window.__localeId__=c,async function(){}()},[c]);const u=function({portalCode:e,pageType:t,locale:n,filters:r}){let o=[];if(!e){let e="No portal code is specified, so portal is not working";o.push(e)}if(t&&"reviews"!==t){let e=`'${t}' is not a valid page`;o.push(e)}n&&(Bs(n),n.toLowerCase().split(/[-_]/)[0]);r&&Fs(r);const s=JSON.stringify(o);return i(()=>{o.forEach(e=>Ls(e))},[s]),0!==o.length&&/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("h2",{children:"Something went wrong please try again "}),/* @__PURE__ */d("ul",{children:o.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}({portalCode:e,pageType:n,locale:c,filters:o});return u||/* @__PURE__ */d(zs.Provider,{value:{portalCode:e,objectCode:t,locale:c,apiUrl:s},children:/* @__PURE__ */d("div",{className:"bu-portal",children:/* @__PURE__ */d(Td,{pageType:n,locale:c,filters:o})})})}export{Nd as default};
193
+ /* @__PURE__ */d(Td,{house:a}),m&&/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})}),!m&&f&&/* @__PURE__ */d("div",{className:"bu-reviews-more",children:/* @__PURE__ */d("button",{type:"button",className:"bu_load_more bu-button-ghost",onClick:function(){if("ready"!==r.status||!r.hasNextPage)return;const s=r.house,a=r.endCursor;o({status:"loading_more",house:s,endCursor:a}),yd({portalCode:t,objectCode:e,apiUrl:n,after:a??void 0}).then(({house:e,pageInfo:t})=>{i.current&&o({status:"ready",house:{...s,reviews:[...s.reviews,...e.reviews]},endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{i.current&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})})},children:ne("load_more_reviews")})}),
194
+ /* @__PURE__ */d("div",{className:"bu_reviews__note",children:/* @__PURE__ */d("a",{href:"https://www.bukazu.com",target:"_blank",rel:"noopener noreferrer",children:ne("reviews_note_link")})})]})}var Ad={nl:{url:"http://bukazu.com/veiligheid",label:"Beveiligd en mogelijk gemaakt door BUKAZU"},en:{url:"http://bukazu.com/en/security",label:"Secured and made possible by BUKAZU"},de:{url:"http://bukazu.com/de/sicherheit",label:"Gesichert und ermöglicht durch BUKAZU"},fr:{url:"http://bukazu.com/fr/securite",label:"Sécurisé et rendu possible par BUKAZU"},es:{url:"http://bukazu.com/es/seguridad",label:"Asegurado y hecho posible por BUKAZU"},it:{url:"http://bukazu.com/it/sicurezza",label:"Protetto e reso possibile da BUKAZU"}};function Dd(e){const{url:t,label:n}=Object.prototype.hasOwnProperty.call(Ad,e)?Ad[e]:Ad.en;return`<div class="bu-safe-booking"><a href="${t}" class="bu-safe-booking-link"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve" width="16px" height="16px" class="bu-safe-booking-icon"><path d="M75.98,41.62h-2.47L73.5,29.31C73.49,15.9,62.58,4.99,49.17,5C35.76,5.01,24.85,15.92,24.86,29.33l0.02,12.31H24 c-4.61,0.01-8.35,3.75-8.34,8.36v36.65c0,4.61,3.75,8.35,8.36,8.35L76,94.97c4.61,0,8.35-3.74,8.34-8.35V49.96 C84.34,45.35,80.59,41.62,75.98,41.62z M33.84,41.64l-0.02-12.31c0-8.47,6.88-15.36,15.35-15.37c8.47,0,15.36,6.89,15.36,15.35 l0.02,12.31L33.84,41.64z" /></svg>${n}</a></div>`}var Pd=class extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Li(e)}render(){return this.state.hasError?/* @__PURE__ */d("h1",{children:"Something went wrong."}):this.props.children}};function $d(e,t,n){const r=new URL(`/portal_api/v1/config/${t}`,new URL(e).origin);return r.search=new URLSearchParams({portal_code:n}).toString(),r.toString()}async function Id(e,t){try{return await Hc.get(e,{headers:{locale:t}}).json()}catch(n){if(n instanceof Qi)throw new Error(`Portal settings request failed (${n.response.status})`);throw n}}function jd({apiUrl:e,locale:t,portalCode:n}){return Id(function({apiUrl:e,portalCode:t}){return $d(e,"settings",t)}({apiUrl:e,portalCode:n}),t)}function Ld({apiUrl:e,locale:t,portalCode:n}){return Id(function({apiUrl:e,portalCode:t}){return $d(e,"booking-fields",t)}({apiUrl:e,portalCode:n}),t)}function Md({apiUrl:e,locale:t,portalCode:n}){return Id(function({apiUrl:e,portalCode:t}){return $d(e,"filter-fields",t)}({apiUrl:e,portalCode:n}),t)}function Od(e,t){const n=`_${t}`,r=e??{},o={};return Object.keys(r).forEach(e=>{e.endsWith(n)&&(o[e.slice(0,-n.length)]=r[e])}),o}function Ud(e){const{results_amount:t,no_results:n,...r}=e,o=Number(t??n);return{...r,no_results:Number.isFinite(o)&&o>0?o:20}}async function qd({portalCode:e,isSearchPage:t,isBookingPage:n,apiUrl:r,locale:o}){const s=jd({apiUrl:r,locale:o,portalCode:e}),i=t?Md({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),a=n?Ld({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),[c,u,l]=await Promise.all([s,i,a]);if(!c)throw new Error("Portal site data is missing");return function({settings:e,filterFields:t,bookingFields:n,locale:r}){const o=(n??[]??[]).map(e=>({id:e.id,label:e.label,field_type:e.field_type,type:e.field_type,options:e.field_options,required:e.required,placeholder:e.placeholder})),s=(c=t??[],(c??[]).map(e=>({id:e.id,type:e.field_type,label:e.label,...void 0!==e.max&&{max:e.max},...void 0!==e.options&&{options:e.options}}))),i=e.colors,a={filtersForm:Ud(e.filters_form),bookingFields:o,searchFields:void 0!==t?s:void 0,bookingForm:{},colors:i};var c;return{name:e.name,portal_code:e.portal_code,options:a,colorsConfiguration:i,currencies:Yi(e.currencies),bookingFormConfiguration:e.booking_form,booking_fields:o,max_persons:0,max_bedrooms:0,max_bathrooms:0,max_weekprice:0,...Od(e.labels,r)}}({settings:c,filterFields:u,bookingFields:l,locale:o})}function Bd({pageType:e,locale:t,filters:n={}}){const{portalCode:r,objectCode:i,apiUrl:a,locale:c}=o(Hi),[l,f]=u({status:"loading"}),m=!i,g=!!i&&"reviews"!==e;if(s(()=>{let e=!0;f({status:"loading"});const t=te(c);return qd({portalCode:r,isSearchPage:m,isBookingPage:g,apiUrl:a,locale:c}).then(async n=>{await t,e&&f({status:"ready",portalSite:n})}).catch(async n=>{if(await t,!e)return;const r=n instanceof Error?n:/* @__PURE__ */new Error("A portal settings request failed");f({status:"error",error:r})}),()=>{e=!1}},[r,m,g,a,c]),"loading"===l.status)/* @__PURE__ */return d(p,{});if("error"===l.status)/* @__PURE__ */return d(qi,{errors:l.error});const _=l.portalSite;let y=_.options;const b=_.colorsConfiguration,v=document.documentElement;let w;return v.style.setProperty("--bukazu-discount",b.discount),v.style.setProperty("--bukazu-cell",b.cell),v.style.setProperty("--bukazu-arrival",b.arrival),v.style.setProperty("--bukazu-booked",b.booked),v.style.setProperty("--bukazu-departure",b.departure),v.style.setProperty("--bukazu-button",b.button),v.style.setProperty("--bukazu-button_cta",b.button_cta),w=i&&null!==i&&"reviews"!==e?/* @__PURE__ */h(Pd,{children:[/* @__PURE__ */d(_d,{portalSite:_}),/* @__PURE__ */d("div",{dangerouslySetInnerHTML:{__html:Dd(t)}})]}):i&&null!==i&&"reviews"===e?/* @__PURE__ */d(Rd,{objectCode:i,portalCode:r,apiUrl:a}):/* @__PURE__ */d(Nu,{PortalSite:_,locale:t,options:y,filters:n}),/* @__PURE__ */d(Ji,{currencies:_.currencies,children:w})}function Fd({portalCode:e,objectCode:t,pageType:n,locale:r,filters:o,api_url:i="https://api.bukazu.com",sentryDsn:a}){const c=Fi(r);s(()=>{var n;a&&(n=a,void 0===On()&&Ii({dsn:n,integrations:e=>e.filter(e=>"GlobalHandlers"!==e.name)})),ji({portalCode:e,objectCode:t,locale:c})},[a,e,t,c]),s(()=>{window.__localeId__=c,async function(){}()},[c]);const u=function({portalCode:e,pageType:t,locale:n,filters:r}){let o=[];if(!e){let e="No portal code is specified, so portal is not working";o.push(e)}if(t&&"reviews"!==t){let e=`'${t}' is not a valid page`;o.push(e)}n&&(Fi(n),n.toLowerCase().split(/[-_]/)[0]);r&&zi(r);const i=JSON.stringify(o);return s(()=>{o.forEach(e=>Mi(e))},[i]),0!==o.length&&/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("h2",{children:"Something went wrong please try again "}),/* @__PURE__ */d("ul",{children:o.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}({portalCode:e,pageType:n,locale:c,filters:o});return u||/* @__PURE__ */d(Hi.Provider,{value:{portalCode:e,objectCode:t,locale:c,apiUrl:i},children:/* @__PURE__ */d("div",{className:"bu-portal",children:/* @__PURE__ */d(Bd,{pageType:n,locale:c,filters:o})})})}export{Fd as default};