@duffel/components 3.1.6--canary.11 → 3.1.7

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,33 +1,33 @@
1
- "use strict";var Bd=Object.create;var hn=Object.defineProperty;var Ld=Object.getOwnPropertyDescriptor;var Fd=Object.getOwnPropertyNames;var Hd=Object.getPrototypeOf,Ud=Object.prototype.hasOwnProperty;var ca=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ro=(t,e)=>{for(var r in e)hn(t,r,{get:e[r],enumerable:!0})},la=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Fd(e))!Ud.call(t,o)&&o!==r&&hn(t,o,{get:()=>e[o],enumerable:!(n=Ld(e,o))||n.enumerable});return t};var D=(t,e,r)=>(r=t!=null?Bd(Hd(t)):{},la(e||!t||!t.__esModule?hn(r,"default",{value:t,enumerable:!0}):r,t)),Gd=t=>la(hn({},"__esModule",{value:!0}),t);var Ne=ca((bE,ro)=>{(function(){"use strict";var t={}.hasOwnProperty,e="[native code]";function r(){for(var n=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var a=typeof i;if(a==="string"||a==="number")n.push(i);else if(Array.isArray(i)){if(i.length){var s=r.apply(null,i);s&&n.push(s)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){n.push(i.toString());continue}for(var c in i)t.call(i,c)&&i[c]&&n.push(c)}}}return n.join(" ")}typeof ro<"u"&&ro.exports?(r.default=r,ro.exports=r):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return r}):window.classNames=r})()});var Ll=ca((So,Bl)=>{(function(t,e){typeof So=="object"&&typeof Bl<"u"?e(So,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],e):(t=t||self,e(t.ReactStripe={},t.React))})(So,function(t,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;function r(_,f){var g=Object.keys(_);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(_);f&&(E=E.filter(function(Y){return Object.getOwnPropertyDescriptor(_,Y).enumerable})),g.push.apply(g,E)}return g}function n(_){for(var f=1;f<arguments.length;f++){var g=arguments[f]!=null?arguments[f]:{};f%2?r(Object(g),!0).forEach(function(E){i(_,E,g[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(g)):r(Object(g)).forEach(function(E){Object.defineProperty(_,E,Object.getOwnPropertyDescriptor(g,E))})}return _}function o(_){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(f){return typeof f}:o=function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},o(_)}function i(_,f,g){return f in _?Object.defineProperty(_,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):_[f]=g,_}function a(_,f){return s(_)||c(_,f)||l(_,f)||d()}function s(_){if(Array.isArray(_))return _}function c(_,f){var g=_&&(typeof Symbol<"u"&&_[Symbol.iterator]||_["@@iterator"]);if(g!=null){var E=[],Y=!0,I=!1,W,re;try{for(g=g.call(_);!(Y=(W=g.next()).done)&&(E.push(W.value),!(f&&E.length===f));Y=!0);}catch(x){I=!0,re=x}finally{try{!Y&&g.return!=null&&g.return()}finally{if(I)throw re}}return E}}function l(_,f){if(_){if(typeof _=="string")return u(_,f);var g=Object.prototype.toString.call(_).slice(8,-1);if(g==="Object"&&_.constructor&&(g=_.constructor.name),g==="Map"||g==="Set")return Array.from(_);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return u(_,f)}}function u(_,f){(f==null||f>_.length)&&(f=_.length);for(var g=0,E=new Array(f);g<f;g++)E[g]=_[g];return E}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(_,f){return f={exports:{}},_(f,f.exports),f.exports}var h="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",S=h;function y(){}function M(){}M.resetWarningCache=y;var N=function(){function _(E,Y,I,W,re,x){if(x!==S){var pe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw pe.name="Invariant Violation",pe}}_.isRequired=_;function f(){return _}var g={array:_,bool:_,func:_,number:_,object:_,string:_,symbol:_,any:_,arrayOf:f,element:_,elementType:_,instanceOf:f,node:_,objectOf:f,oneOf:f,oneOfType:f,shape:f,exact:f,checkPropTypes:M,resetWarningCache:y};return g.PropTypes=g,g},C=p(function(_){_.exports=N()}),ce=function(f){var g=e.useRef(f);return e.useEffect(function(){g.current=f},[f]),g.current},j=function(f){return f!==null&&o(f)==="object"},qe=function(f){return j(f)&&typeof f.then=="function"},ye=function(f){return j(f)&&typeof f.elements=="function"&&typeof f.createToken=="function"&&typeof f.createPaymentMethod=="function"&&typeof f.confirmCardPayment=="function"},Yt="[object Object]",K=function _(f,g){if(!j(f)||!j(g))return f===g;var E=Array.isArray(f),Y=Array.isArray(g);if(E!==Y)return!1;var I=Object.prototype.toString.call(f)===Yt,W=Object.prototype.toString.call(g)===Yt;if(I!==W)return!1;if(!I&&!E)return f===g;var re=Object.keys(f),x=Object.keys(g);if(re.length!==x.length)return!1;for(var pe={},ze=0;ze<re.length;ze+=1)pe[re[ze]]=!0;for(var Ze=0;Ze<x.length;Ze+=1)pe[x[Ze]]=!0;var Me=Object.keys(pe);if(Me.length!==re.length)return!1;var Or=f,Pr=g,we=function(Wt){return _(Or[Wt],Pr[Wt])};return Me.every(we)},X=function(f,g,E){return j(f)?Object.keys(f).reduce(function(Y,I){var W=!j(g)||!K(f[I],g[I]);return E.includes(I)?(W&&console.warn("Unsupported prop change: options.".concat(I," is not a mutable property.")),Y):W?n(n({},Y||{}),{},i({},I,f[I])):Y},null):null},Ae="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",$t=function(f){if(f===null||ye(f))return f;throw new Error(Ae)},Ir=function(f){if(qe(f))return{tag:"async",stripePromise:Promise.resolve(f).then($t)};var g=$t(f);return g===null?{tag:"empty"}:{tag:"sync",stripe:g}},dn=e.createContext(null);dn.displayName="ElementsContext";var k=function(f,g){if(!f)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(g," in an <Elements> provider."));return f},le=e.createContext(null);le.displayName="CartElementContext";var xr=function(f,g){if(!f)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(g," in an <Elements> provider."));return f},Nr=function(f){var g=f.stripe,E=f.options,Y=f.children,I=e.useMemo(function(){return Ir(g)},[g]),W=e.useState(null),re=a(W,2),x=re[0],pe=re[1],ze=e.useState(null),Ze=a(ze,2),Me=Ze[0],Or=Ze[1],Pr=e.useState(function(){return{stripe:I.tag==="sync"?I.stripe:null,elements:I.tag==="sync"?I.stripe.elements(E):null}}),we=a(Pr,2),ne=we[0],Wt=we[1];e.useEffect(function(){var de=!0,mn=function(pn){Wt(function(gn){return gn.stripe?gn:{stripe:pn,elements:pn.elements(E)}})};return I.tag==="async"&&!ne.stripe?I.stripePromise.then(function(Pt){Pt&&de&&mn(Pt)}):I.tag==="sync"&&!ne.stripe&&mn(I.stripe),function(){de=!1}},[I,ne,E]);var Dr=ce(g);e.useEffect(function(){Dr!==null&&Dr!==g&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[Dr,g]);var fn=ce(E);return e.useEffect(function(){if(ne.elements){var de=X(E,fn,["clientSecret","fonts"]);de&&ne.elements.update(de)}},[E,fn,ne.elements]),e.useEffect(function(){var de=ne.stripe;!de||!de._registerWrapper||!de.registerAppInfo||(de._registerWrapper({name:"react-stripe-js",version:"2.1.0"}),de.registerAppInfo({name:"react-stripe-js",version:"2.1.0",url:"https://stripe.com/docs/stripe-js/react"}))},[ne.stripe]),e.createElement(dn.Provider,{value:ne},e.createElement(le.Provider,{value:{cart:x,setCart:pe,cartState:Me,setCartState:Or}},Y))};Nr.propTypes={stripe:C.any,options:C.object};var Ot=function(f){var g=e.useContext(dn);return k(g,f)},un=function(f){var g=e.useContext(le);return xr(g,f)},nd=function(){var f=Ot("calls useElements()"),g=f.elements;return g},od=function(){var f=Ot("calls useStripe()"),g=f.stripe;return g},id=function(){var f=un("calls useCartElement()"),g=f.cart;return g},ad=function(){var f=un("calls useCartElementState()"),g=f.cartState;return g},na=function(f){var g=f.children,E=Ot("mounts <ElementsConsumer>");return g(E)};na.propTypes={children:C.func.isRequired};var J=function(f,g,E){var Y=!!E,I=e.useRef(E);e.useEffect(function(){I.current=E},[E]),e.useEffect(function(){if(!Y||!f)return function(){};var W=function(){I.current&&I.current.apply(I,arguments)};return f.on(g,W),function(){f.off(g,W)}},[Y,g,f,I])},sd=function(f){return f.charAt(0).toUpperCase()+f.slice(1)},B=function(f,g){var E="".concat(sd(f),"Element"),Y=function(x){var pe=x.id,ze=x.className,Ze=x.options,Me=Ze===void 0?{}:Ze,Or=x.onBlur,Pr=x.onFocus,we=x.onReady,ne=x.onChange,Wt=x.onEscape,Dr=x.onClick,fn=x.onLoadError,de=x.onLoaderStart,mn=x.onNetworksChange,Pt=x.onCheckout,pn=x.onLineItemClick,gn=x.onConfirm,Nd=x.onCancel,Od=x.onShippingAddressChange,Pd=x.onShippingRateChange,Dd=Ot("mounts <".concat(E,">")),vo=Dd.elements,Ad=e.useState(null),oa=a(Ad,2),q=oa[0],Md=oa[1],Dt=e.useRef(null),Co=e.useRef(null),ia=un("mounts <".concat(E,">")),bo=ia.setCart,To=ia.setCartState;J(q,"blur",Or),J(q,"focus",Pr),J(q,"escape",Wt),J(q,"click",Dr),J(q,"loaderror",fn),J(q,"loaderstart",de),J(q,"networkschange",mn),J(q,"lineitemclick",pn),J(q,"confirm",gn),J(q,"cancel",Nd),J(q,"shippingaddresschange",Od),J(q,"shippingratechange",Pd);var _n;f==="cart"?_n=function(sa){To(sa),we&&we(sa)}:we&&(f==="expressCheckout"?_n=we:_n=function(){we(q)}),J(q,"ready",_n);var wd=f==="cart"?function(Q){To(Q),ne&&ne(Q)}:ne;J(q,"change",wd);var kd=f==="cart"?function(Q){To(Q),Pt&&Pt(Q)}:Pt;J(q,"checkout",kd),e.useLayoutEffect(function(){if(Dt.current===null&&vo&&Co.current!==null){var Q=vo.create(f,Me);f==="cart"&&bo&&bo(Q),Dt.current=Q,Md(Q),Q.mount(Co.current)}},[vo,Me,bo]);var aa=ce(Me);return e.useEffect(function(){if(Dt.current){var Q=X(Me,aa,["paymentRequest"]);Q&&Dt.current.update(Q)}},[Me,aa]),e.useLayoutEffect(function(){return function(){Dt.current&&(Dt.current.destroy(),Dt.current=null)}},[]),e.createElement("div",{id:pe,className:ze,ref:Co})},I=function(x){Ot("mounts <".concat(E,">")),un("mounts <".concat(E,">"));var pe=x.id,ze=x.className;return e.createElement("div",{id:pe,className:ze})},W=g?I:Y;return W.propTypes={id:C.string,className:C.string,onChange:C.func,onBlur:C.func,onFocus:C.func,onReady:C.func,onEscape:C.func,onClick:C.func,onLoadError:C.func,onLoaderStart:C.func,onNetworksChange:C.func,onCheckout:C.func,onLineItemClick:C.func,onConfirm:C.func,onCancel:C.func,onShippingAddressChange:C.func,onShippingRateChange:C.func,options:C.object},W.displayName=E,W.__elementType=f,W},L=typeof window>"u",cd=B("auBankAccount",L),ld=B("card",L),dd=B("cardNumber",L),ud=B("cardExpiry",L),fd=B("cardCvc",L),md=B("fpxBank",L),pd=B("iban",L),gd=B("idealBank",L),_d=B("p24Bank",L),hd=B("epsBank",L),Sd=B("payment",L),yd=B("expressCheckout",L),Ed=B("paymentRequestButton",L),vd=B("linkAuthentication",L),Cd=B("address",L),bd=B("shippingAddress",L),Td=B("cart",L),Rd=B("paymentMethodMessaging",L),Id=B("affirmMessage",L),xd=B("afterpayClearpayMessage",L);t.AddressElement=Cd,t.AffirmMessageElement=Id,t.AfterpayClearpayMessageElement=xd,t.AuBankAccountElement=cd,t.CardCvcElement=fd,t.CardElement=ld,t.CardExpiryElement=ud,t.CardNumberElement=dd,t.CartElement=Td,t.Elements=Nr,t.ElementsConsumer=na,t.EpsBankElement=hd,t.ExpressCheckoutElement=yd,t.FpxBankElement=md,t.IbanElement=pd,t.IdealBankElement=gd,t.LinkAuthenticationElement=vd,t.P24BankElement=_d,t.PaymentElement=Sd,t.PaymentMethodMessagingElement=Rd,t.PaymentRequestButtonElement=Ed,t.ShippingAddressElement=bd,t.useCartElement=id,t.useCartElementState=ad,t.useElements=nd,t.useStripe=od,Object.defineProperty(t,"__esModule",{value:!0})})});var fp={};Ro(fp,{onDuffelAncillariesPayloadReady:()=>wl,onDuffelCardFormCardIdCreated:()=>ed,onDuffelCardFormCardIdCreationError:()=>td,onDuffelPaymentsFailedPayment:()=>ql,onDuffelPaymentsSuccessfulPayment:()=>jl,renderDuffelAncillariesCustomElement:()=>Ml,renderDuffelCardFormCustomElement:()=>Ql,renderDuffelPaymentsCustomElement:()=>Vl});module.exports=Gd(fp);var Dl=require("react-dom/client");var da=Object.prototype.toString;function Ar(t){switch(da.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return ue(t,Error)}}function Vt(t,e){return da.call(t)===`[object ${e}]`}function jt(t){return Vt(t,"ErrorEvent")}function Sn(t){return Vt(t,"DOMError")}function Io(t){return Vt(t,"DOMException")}function oe(t){return Vt(t,"String")}function qt(t){return t===null||typeof t!="object"&&typeof t!="function"}function Ee(t){return Vt(t,"Object")}function At(t){return typeof Event<"u"&&ue(t,Event)}function xo(t){return typeof Element<"u"&&ue(t,Element)}function No(t){return Vt(t,"RegExp")}function Mt(t){return!!(t&&t.then&&typeof t.then=="function")}function Oo(t){return Ee(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Mr(t){return typeof t=="number"&&t!==t}function ue(t,e){try{return t instanceof e}catch{return!1}}function wr(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function ke(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function yn(t,e){if(!Array.isArray(t))return"";let r=[];for(let n=0;n<t.length;n++){let o=t[n];try{wr(o)?r.push("[VueViewModel]"):r.push(String(o))}catch{r.push("[value cannot be serialized]")}}return r.join(e)}function ua(t,e,r=!1){return oe(t)?No(e)?e.test(t):oe(e)?r?t===e:t.includes(e):!1:!1}function _t(t,e=[],r=!1){return e.some(n=>ua(t,n,r))}function kr(t,e,r=250,n,o,i,a){if(!i.exception||!i.exception.values||!a||!ue(a.originalException,Error))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=Yd(Po(t,e,o,a.originalException,n,i.exception.values,s,0),r))}function Po(t,e,r,n,o,i,a,s){if(i.length>=r+1)return i;let c=[...i];if(ue(n[o],Error)){fa(a,s);let l=t(e,n[o]),u=c.length;ma(l,o,u,s),c=Po(t,e,r,n[o],o,[l,...c],l,u)}return Array.isArray(n.errors)&&n.errors.forEach((l,u)=>{if(ue(l,Error)){fa(a,s);let d=t(e,l),p=c.length;ma(d,`errors[${u}]`,p,s),c=Po(t,e,r,l,o,[d,...c],d,p)}}),c}function fa(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function ma(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:r,parent_id:n}}function Yd(t,e){return t.map(r=>(r.value&&(r.value=ke(r.value,e)),r))}function En(t){return t&&t.Math==Math?t:void 0}var O=typeof globalThis=="object"&&En(globalThis)||typeof window=="object"&&En(window)||typeof self=="object"&&En(self)||typeof global=="object"&&En(global)||function(){return this}()||{};function ve(){return O}function Br(t,e,r){let n=r||O,o=n.__SENTRY__=n.__SENTRY__||{};return o[t]||(o[t]=e())}var vn=ve(),$d=80;function Be(t,e={}){if(!t)return"<unknown>";try{let r=t,n=5,o=[],i=0,a=0,s=" > ",c=s.length,l,u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||$d;for(;r&&i++<n&&(l=Wd(r,u),!(l==="html"||i>1&&a+o.length*c+l.length>=d));)o.push(l),a+=l.length,r=r.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function Wd(t,e){let r=t,n=[],o,i,a,s,c;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());let l=e&&e.length?e.filter(d=>r.getAttribute(d)).map(d=>[d,r.getAttribute(d)]):null;if(l&&l.length)l.forEach(d=>{n.push(`[${d[0]}="${d[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),o=r.className,o&&oe(o))for(i=o.split(/\s+/),c=0;c<i.length;c++)n.push(`.${i[c]}`);let u=["aria-label","type","name","title","alt"];for(c=0;c<u.length;c++)a=u[c],s=r.getAttribute(a),s&&n.push(`[${a}="${s}"]`);return n.join("")}function Do(){try{return vn.document.location.href}catch{return""}}function Ao(t){return vn.document&&vn.document.querySelector?vn.document.querySelector(t):null}var Vd="Sentry Logger ",Lr=["debug","info","warn","error","log","assert","trace"],zt={};function Cn(t){if(!("console"in O))return t();let e=O.console,r={},n=Object.keys(zt);n.forEach(o=>{let i=zt[o];r[o]=e[o],e[o]=i});try{return t()}finally{n.forEach(o=>{e[o]=r[o]})}}function jd(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Lr.forEach(r=>{e[r]=(...n)=>{t&&Cn(()=>{O.console[r](`${Vd}[${r}]:`,...n)})}}):Lr.forEach(r=>{e[r]=()=>{}}),e}var m=jd();var qd=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function zd(t){return t==="http"||t==="https"}function Le(t,e=!1){let{host:r,path:n,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${a}`}function pa(t){let e=qd.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}let[r,n,o="",i,a="",s]=e.slice(1),c="",l=s,u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){let d=l.match(/^\d+/);d&&(l=d[0])}return ga({host:i,pass:o,path:c,projectId:l,port:a,protocol:r,publicKey:n})}function ga(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Zd(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:e,projectId:r,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(m.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:r.match(/^\d+$/)?zd(n)?e&&isNaN(parseInt(e,10))?(m.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(m.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(m.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function bn(t){let e=typeof t=="string"?pa(t):ga(t);if(!(!e||!Zd(e)))return e}var z=class extends Error{constructor(e,r="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=r}};function F(t,e,r){if(!(e in t))return;let n=t[e],o=r(n);typeof o=="function"&&Tn(o,n),t[e]=o}function Ke(t,e,r){try{Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function Tn(t,e){try{let r=e.prototype||{};t.prototype=e.prototype=r,Ke(t,"__sentry_original__",e)}catch{}}function wt(t){return t.__sentry_original__}function wo(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function Rn(t){if(Ar(t))return{message:t.message,name:t.name,stack:t.stack,...ha(t)};if(At(t)){let e={type:t.type,target:_a(t.target),currentTarget:_a(t.currentTarget),...ha(t)};return typeof CustomEvent<"u"&&ue(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function _a(t){try{return xo(t)?Be(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function ha(t){if(typeof t=="object"&&t!==null){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}else return{}}function ko(t,e=40){let r=Object.keys(Rn(t));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=e)return ke(r[0],e);for(let n=r.length;n>0;n--){let o=r.slice(0,n).join(", ");if(!(o.length>e))return n===r.length?o:ke(o,e)}return""}function ie(t){return Mo(t,new Map)}function Mo(t,e){if(Ee(t)){let r=e.get(t);if(r!==void 0)return r;let n={};e.set(t,n);for(let o of Object.keys(t))typeof t[o]<"u"&&(n[o]=Mo(t[o],e));return n}if(Array.isArray(t)){let r=e.get(t);if(r!==void 0)return r;let n=[];return e.set(t,n),t.forEach(o=>{n.push(Mo(o,e))}),n}return t}function A(){let t=O,e=t.crypto||t.msCrypto,r=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(r=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function Sa(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Ce(t){let{message:e,event_id:r}=t;if(e)return e;let n=Sa(t);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Zt(t,e,r){let n=t.exception=t.exception||{},o=n.values=n.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=r||"Error")}function Xe(t,e){let r=Sa(t);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism={...n,...o,...e},e&&"data"in e){let i={...o&&o.data,...e.data};r.mechanism.data=i}}function In(t){if(t&&t.__sentry_captured__)return!0;try{Ke(t,"__sentry_captured__",!0)}catch{}return!1}function Fr(t){return Array.isArray(t)?t:[t]}var va=50,ya=/\(error: (.*)\)/,Ea=/captureMessage|captureException/;function xn(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{let o=[],i=r.split(`
3
- `);for(let a=n;a<i.length;a++){let s=i[a];if(s.length>1024)continue;let c=ya.test(s)?s.replace(ya,"$1"):s;if(!c.match(/\S*Error: /)){for(let l of e){let u=l(c);if(u){o.push(u);break}}if(o.length>=va)break}}return Ca(o)}}function Lo(t){return Array.isArray(t)?xn(...t):t}function Ca(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),Ea.test(e[e.length-1].function||"")&&(e.pop(),Ea.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,va).map(r=>({...r,filename:r.filename||e[e.length-1].filename,function:r.function||"?"}))}var Bo="<anonymous>";function ae(t){try{return!t||typeof t!="function"?Bo:t.name||Bo}catch{return Bo}}var Fo=ve();function Nn(){if(!("fetch"in Fo))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Hr(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Ho(){if(!Nn())return!1;if(Hr(Fo.fetch))return!0;let t=!1,e=Fo.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=Hr(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}var On=ve();function ba(){let t=On.chrome,e=t&&t.app&&t.app.runtime,r="history"in On&&!!On.history.pushState&&!!On.history.replaceState;return!e&&r}var V=ve(),Je="__sentry_xhr_v2__",Ur={},Ta={};function Kd(t){if(!Ta[t])switch(Ta[t]=!0,t){case"console":Xd();break;case"dom":Pa();break;case"xhr":Oa();break;case"fetch":Jd();break;case"history":Qd();break;case"error":ou();break;case"unhandledrejection":iu();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("unknown instrumentation type:",t);return}}function H(t,e){Ur[t]=Ur[t]||[],Ur[t].push(e),Kd(t)}function be(t,e){if(!(!t||!Ur[t]))for(let r of Ur[t]||[])try{r(e)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error(`Error while triggering instrumentation handler.
1
+ "use strict";var Tu=Object.create;var hn=Object.defineProperty;var Ru=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var xu=Object.getPrototypeOf,Nu=Object.prototype.hasOwnProperty;var oa=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),To=(t,e)=>{for(var r in e)hn(t,r,{get:e[r],enumerable:!0})},ia=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Iu(e))!Nu.call(t,o)&&o!==r&&hn(t,o,{get:()=>e[o],enumerable:!(n=Ru(e,o))||n.enumerable});return t};var A=(t,e,r)=>(r=t!=null?Tu(xu(t)):{},ia(e||!t||!t.__esModule?hn(r,"default",{value:t,enumerable:!0}):r,t)),Ou=t=>ia(hn({},"__esModule",{value:!0}),t);var Ne=oa((uE,ro)=>{(function(){"use strict";var t={}.hasOwnProperty,e="[native code]";function r(){for(var n=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var a=typeof i;if(a==="string"||a==="number")n.push(i);else if(Array.isArray(i)){if(i.length){var s=r.apply(null,i);s&&n.push(s)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){n.push(i.toString());continue}for(var c in i)t.call(i,c)&&i[c]&&n.push(c)}}}return n.join(" ")}typeof ro<"u"&&ro.exports?(r.default=r,ro.exports=r):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return r}):window.classNames=r})()});var Ml=oa((So,Dl)=>{(function(t,e){typeof So=="object"&&typeof Dl<"u"?e(So,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],e):(t=t||self,e(t.ReactStripe={},t.React))})(So,function(t,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;function r(_,f){var g=Object.keys(_);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(_);f&&(E=E.filter(function(Y){return Object.getOwnPropertyDescriptor(_,Y).enumerable})),g.push.apply(g,E)}return g}function n(_){for(var f=1;f<arguments.length;f++){var g=arguments[f]!=null?arguments[f]:{};f%2?r(Object(g),!0).forEach(function(E){i(_,E,g[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(g)):r(Object(g)).forEach(function(E){Object.defineProperty(_,E,Object.getOwnPropertyDescriptor(g,E))})}return _}function o(_){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(f){return typeof f}:o=function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},o(_)}function i(_,f,g){return f in _?Object.defineProperty(_,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):_[f]=g,_}function a(_,f){return s(_)||c(_,f)||l(_,f)||u()}function s(_){if(Array.isArray(_))return _}function c(_,f){var g=_&&(typeof Symbol<"u"&&_[Symbol.iterator]||_["@@iterator"]);if(g!=null){var E=[],Y=!0,I=!1,W,re;try{for(g=g.call(_);!(Y=(W=g.next()).done)&&(E.push(W.value),!(f&&E.length===f));Y=!0);}catch(x){I=!0,re=x}finally{try{!Y&&g.return!=null&&g.return()}finally{if(I)throw re}}return E}}function l(_,f){if(_){if(typeof _=="string")return d(_,f);var g=Object.prototype.toString.call(_).slice(8,-1);if(g==="Object"&&_.constructor&&(g=_.constructor.name),g==="Map"||g==="Set")return Array.from(_);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return d(_,f)}}function d(_,f){(f==null||f>_.length)&&(f=_.length);for(var g=0,E=new Array(f);g<f;g++)E[g]=_[g];return E}function u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m(_,f){return f={exports:{}},_(f,f.exports),f.exports}var h="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",S=h;function y(){}function M(){}M.resetWarningCache=y;var N=function(){function _(E,Y,I,W,re,x){if(x!==S){var me=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw me.name="Invariant Violation",me}}_.isRequired=_;function f(){return _}var g={array:_,bool:_,func:_,number:_,object:_,string:_,symbol:_,any:_,arrayOf:f,element:_,elementType:_,instanceOf:f,node:_,objectOf:f,oneOf:f,oneOfType:f,shape:f,exact:f,checkPropTypes:M,resetWarningCache:y};return g.PropTypes=g,g},C=m(function(_){_.exports=N()}),ce=function(f){var g=e.useRef(f);return e.useEffect(function(){g.current=f},[f]),g.current},j=function(f){return f!==null&&o(f)==="object"},qe=function(f){return j(f)&&typeof f.then=="function"},ye=function(f){return j(f)&&typeof f.elements=="function"&&typeof f.createToken=="function"&&typeof f.createPaymentMethod=="function"&&typeof f.confirmCardPayment=="function"},Yt="[object Object]",K=function _(f,g){if(!j(f)||!j(g))return f===g;var E=Array.isArray(f),Y=Array.isArray(g);if(E!==Y)return!1;var I=Object.prototype.toString.call(f)===Yt,W=Object.prototype.toString.call(g)===Yt;if(I!==W)return!1;if(!I&&!E)return f===g;var re=Object.keys(f),x=Object.keys(g);if(re.length!==x.length)return!1;for(var me={},ze=0;ze<re.length;ze+=1)me[re[ze]]=!0;for(var Ze=0;Ze<x.length;Ze+=1)me[x[Ze]]=!0;var Me=Object.keys(me);if(Me.length!==re.length)return!1;var Or=f,Pr=g,we=function(Wt){return _(Or[Wt],Pr[Wt])};return Me.every(we)},X=function(f,g,E){return j(f)?Object.keys(f).reduce(function(Y,I){var W=!j(g)||!K(f[I],g[I]);return E.includes(I)?(W&&console.warn("Unsupported prop change: options.".concat(I," is not a mutable property.")),Y):W?n(n({},Y||{}),{},i({},I,f[I])):Y},null):null},De="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",$t=function(f){if(f===null||ye(f))return f;throw new Error(De)},Ir=function(f){if(qe(f))return{tag:"async",stripePromise:Promise.resolve(f).then($t)};var g=$t(f);return g===null?{tag:"empty"}:{tag:"sync",stripe:g}},un=e.createContext(null);un.displayName="ElementsContext";var k=function(f,g){if(!f)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(g," in an <Elements> provider."));return f},le=e.createContext(null);le.displayName="CartElementContext";var xr=function(f,g){if(!f)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(g," in an <Elements> provider."));return f},Nr=function(f){var g=f.stripe,E=f.options,Y=f.children,I=e.useMemo(function(){return Ir(g)},[g]),W=e.useState(null),re=a(W,2),x=re[0],me=re[1],ze=e.useState(null),Ze=a(ze,2),Me=Ze[0],Or=Ze[1],Pr=e.useState(function(){return{stripe:I.tag==="sync"?I.stripe:null,elements:I.tag==="sync"?I.stripe.elements(E):null}}),we=a(Pr,2),ne=we[0],Wt=we[1];e.useEffect(function(){var ue=!0,pn=function(mn){Wt(function(gn){return gn.stripe?gn:{stripe:mn,elements:mn.elements(E)}})};return I.tag==="async"&&!ne.stripe?I.stripePromise.then(function(Pt){Pt&&ue&&pn(Pt)}):I.tag==="sync"&&!ne.stripe&&pn(I.stripe),function(){ue=!1}},[I,ne,E]);var Ar=ce(g);e.useEffect(function(){Ar!==null&&Ar!==g&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[Ar,g]);var fn=ce(E);return e.useEffect(function(){if(ne.elements){var ue=X(E,fn,["clientSecret","fonts"]);ue&&ne.elements.update(ue)}},[E,fn,ne.elements]),e.useEffect(function(){var ue=ne.stripe;!ue||!ue._registerWrapper||!ue.registerAppInfo||(ue._registerWrapper({name:"react-stripe-js",version:"2.1.0"}),ue.registerAppInfo({name:"react-stripe-js",version:"2.1.0",url:"https://stripe.com/docs/stripe-js/react"}))},[ne.stripe]),e.createElement(un.Provider,{value:ne},e.createElement(le.Provider,{value:{cart:x,setCart:me,cartState:Me,setCartState:Or}},Y))};Nr.propTypes={stripe:C.any,options:C.object};var Ot=function(f){var g=e.useContext(un);return k(g,f)},dn=function(f){var g=e.useContext(le);return xr(g,f)},Vl=function(){var f=Ot("calls useElements()"),g=f.elements;return g},jl=function(){var f=Ot("calls useStripe()"),g=f.stripe;return g},ql=function(){var f=dn("calls useCartElement()"),g=f.cart;return g},zl=function(){var f=dn("calls useCartElementState()"),g=f.cartState;return g},Qi=function(f){var g=f.children,E=Ot("mounts <ElementsConsumer>");return g(E)};Qi.propTypes={children:C.func.isRequired};var J=function(f,g,E){var Y=!!E,I=e.useRef(E);e.useEffect(function(){I.current=E},[E]),e.useEffect(function(){if(!Y||!f)return function(){};var W=function(){I.current&&I.current.apply(I,arguments)};return f.on(g,W),function(){f.off(g,W)}},[Y,g,f,I])},Zl=function(f){return f.charAt(0).toUpperCase()+f.slice(1)},B=function(f,g){var E="".concat(Zl(f),"Element"),Y=function(x){var me=x.id,ze=x.className,Ze=x.options,Me=Ze===void 0?{}:Ze,Or=x.onBlur,Pr=x.onFocus,we=x.onReady,ne=x.onChange,Wt=x.onEscape,Ar=x.onClick,fn=x.onLoadError,ue=x.onLoaderStart,pn=x.onNetworksChange,Pt=x.onCheckout,mn=x.onLineItemClick,gn=x.onConfirm,_u=x.onCancel,hu=x.onShippingAddressChange,Su=x.onShippingRateChange,yu=Ot("mounts <".concat(E,">")),Eo=yu.elements,Eu=e.useState(null),ea=a(Eu,2),q=ea[0],vu=ea[1],At=e.useRef(null),vo=e.useRef(null),ta=dn("mounts <".concat(E,">")),Co=ta.setCart,bo=ta.setCartState;J(q,"blur",Or),J(q,"focus",Pr),J(q,"escape",Wt),J(q,"click",Ar),J(q,"loaderror",fn),J(q,"loaderstart",ue),J(q,"networkschange",pn),J(q,"lineitemclick",mn),J(q,"confirm",gn),J(q,"cancel",_u),J(q,"shippingaddresschange",hu),J(q,"shippingratechange",Su);var _n;f==="cart"?_n=function(na){bo(na),we&&we(na)}:we&&(f==="expressCheckout"?_n=we:_n=function(){we(q)}),J(q,"ready",_n);var Cu=f==="cart"?function(Q){bo(Q),ne&&ne(Q)}:ne;J(q,"change",Cu);var bu=f==="cart"?function(Q){bo(Q),Pt&&Pt(Q)}:Pt;J(q,"checkout",bu),e.useLayoutEffect(function(){if(At.current===null&&Eo&&vo.current!==null){var Q=Eo.create(f,Me);f==="cart"&&Co&&Co(Q),At.current=Q,vu(Q),Q.mount(vo.current)}},[Eo,Me,Co]);var ra=ce(Me);return e.useEffect(function(){if(At.current){var Q=X(Me,ra,["paymentRequest"]);Q&&At.current.update(Q)}},[Me,ra]),e.useLayoutEffect(function(){return function(){At.current&&(At.current.destroy(),At.current=null)}},[]),e.createElement("div",{id:me,className:ze,ref:vo})},I=function(x){Ot("mounts <".concat(E,">")),dn("mounts <".concat(E,">"));var me=x.id,ze=x.className;return e.createElement("div",{id:me,className:ze})},W=g?I:Y;return W.propTypes={id:C.string,className:C.string,onChange:C.func,onBlur:C.func,onFocus:C.func,onReady:C.func,onEscape:C.func,onClick:C.func,onLoadError:C.func,onLoaderStart:C.func,onNetworksChange:C.func,onCheckout:C.func,onLineItemClick:C.func,onConfirm:C.func,onCancel:C.func,onShippingAddressChange:C.func,onShippingRateChange:C.func,options:C.object},W.displayName=E,W.__elementType=f,W},L=typeof window>"u",Kl=B("auBankAccount",L),Xl=B("card",L),Jl=B("cardNumber",L),Ql=B("cardExpiry",L),eu=B("cardCvc",L),tu=B("fpxBank",L),ru=B("iban",L),nu=B("idealBank",L),ou=B("p24Bank",L),iu=B("epsBank",L),au=B("payment",L),su=B("expressCheckout",L),cu=B("paymentRequestButton",L),lu=B("linkAuthentication",L),uu=B("address",L),du=B("shippingAddress",L),fu=B("cart",L),pu=B("paymentMethodMessaging",L),mu=B("affirmMessage",L),gu=B("afterpayClearpayMessage",L);t.AddressElement=uu,t.AffirmMessageElement=mu,t.AfterpayClearpayMessageElement=gu,t.AuBankAccountElement=Kl,t.CardCvcElement=eu,t.CardElement=Xl,t.CardExpiryElement=Ql,t.CardNumberElement=Jl,t.CartElement=fu,t.Elements=Nr,t.ElementsConsumer=Qi,t.EpsBankElement=iu,t.ExpressCheckoutElement=su,t.FpxBankElement=tu,t.IbanElement=ru,t.IdealBankElement=nu,t.LinkAuthenticationElement=lu,t.P24BankElement=ou,t.PaymentElement=au,t.PaymentMethodMessagingElement=pu,t.PaymentRequestButtonElement=cu,t.ShippingAddressElement=du,t.useCartElement=ql,t.useCartElementState=zl,t.useElements=Vl,t.useStripe=jl,Object.defineProperty(t,"__esModule",{value:!0})})});var Qp={};To(Qp,{onDuffelAncillariesPayloadReady:()=>Pl,onDuffelPaymentsFailedPayment:()=>$l,onDuffelPaymentsSuccessfulPayment:()=>Yl,renderDuffelAncillariesCustomElement:()=>Ol,renderDuffelPaymentsCustomElement:()=>Gl});module.exports=Ou(Qp);var xl=require("react-dom/client");var aa=Object.prototype.toString;function Dr(t){switch(aa.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return de(t,Error)}}function Vt(t,e){return aa.call(t)===`[object ${e}]`}function jt(t){return Vt(t,"ErrorEvent")}function Sn(t){return Vt(t,"DOMError")}function Ro(t){return Vt(t,"DOMException")}function oe(t){return Vt(t,"String")}function qt(t){return t===null||typeof t!="object"&&typeof t!="function"}function Ee(t){return Vt(t,"Object")}function Dt(t){return typeof Event<"u"&&de(t,Event)}function Io(t){return typeof Element<"u"&&de(t,Element)}function xo(t){return Vt(t,"RegExp")}function Mt(t){return!!(t&&t.then&&typeof t.then=="function")}function No(t){return Ee(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Mr(t){return typeof t=="number"&&t!==t}function de(t,e){try{return t instanceof e}catch{return!1}}function wr(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function ke(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function yn(t,e){if(!Array.isArray(t))return"";let r=[];for(let n=0;n<t.length;n++){let o=t[n];try{wr(o)?r.push("[VueViewModel]"):r.push(String(o))}catch{r.push("[value cannot be serialized]")}}return r.join(e)}function sa(t,e,r=!1){return oe(t)?xo(e)?e.test(t):oe(e)?r?t===e:t.includes(e):!1:!1}function _t(t,e=[],r=!1){return e.some(n=>sa(t,n,r))}function kr(t,e,r=250,n,o,i,a){if(!i.exception||!i.exception.values||!a||!de(a.originalException,Error))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=Pu(Oo(t,e,o,a.originalException,n,i.exception.values,s,0),r))}function Oo(t,e,r,n,o,i,a,s){if(i.length>=r+1)return i;let c=[...i];if(de(n[o],Error)){ca(a,s);let l=t(e,n[o]),d=c.length;la(l,o,d,s),c=Oo(t,e,r,n[o],o,[l,...c],l,d)}return Array.isArray(n.errors)&&n.errors.forEach((l,d)=>{if(de(l,Error)){ca(a,s);let u=t(e,l),m=c.length;la(u,`errors[${d}]`,m,s),c=Oo(t,e,r,l,o,[u,...c],u,m)}}),c}function ca(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function la(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:r,parent_id:n}}function Pu(t,e){return t.map(r=>(r.value&&(r.value=ke(r.value,e)),r))}function En(t){return t&&t.Math==Math?t:void 0}var O=typeof globalThis=="object"&&En(globalThis)||typeof window=="object"&&En(window)||typeof self=="object"&&En(self)||typeof global=="object"&&En(global)||function(){return this}()||{};function ve(){return O}function Br(t,e,r){let n=r||O,o=n.__SENTRY__=n.__SENTRY__||{};return o[t]||(o[t]=e())}var vn=ve(),Au=80;function Be(t,e={}){if(!t)return"<unknown>";try{let r=t,n=5,o=[],i=0,a=0,s=" > ",c=s.length,l,d=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||Au;for(;r&&i++<n&&(l=Du(r,d),!(l==="html"||i>1&&a+o.length*c+l.length>=u));)o.push(l),a+=l.length,r=r.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function Du(t,e){let r=t,n=[],o,i,a,s,c;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());let l=e&&e.length?e.filter(u=>r.getAttribute(u)).map(u=>[u,r.getAttribute(u)]):null;if(l&&l.length)l.forEach(u=>{n.push(`[${u[0]}="${u[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),o=r.className,o&&oe(o))for(i=o.split(/\s+/),c=0;c<i.length;c++)n.push(`.${i[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)a=d[c],s=r.getAttribute(a),s&&n.push(`[${a}="${s}"]`);return n.join("")}function Po(){try{return vn.document.location.href}catch{return""}}function Ao(t){return vn.document&&vn.document.querySelector?vn.document.querySelector(t):null}var Mu="Sentry Logger ",Lr=["debug","info","warn","error","log","assert","trace"],zt={};function Cn(t){if(!("console"in O))return t();let e=O.console,r={},n=Object.keys(zt);n.forEach(o=>{let i=zt[o];r[o]=e[o],e[o]=i});try{return t()}finally{n.forEach(o=>{e[o]=r[o]})}}function wu(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Lr.forEach(r=>{e[r]=(...n)=>{t&&Cn(()=>{O.console[r](`${Mu}[${r}]:`,...n)})}}):Lr.forEach(r=>{e[r]=()=>{}}),e}var p=wu();var ku=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Bu(t){return t==="http"||t==="https"}function Le(t,e=!1){let{host:r,path:n,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${a}`}function ua(t){let e=ku.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}let[r,n,o="",i,a="",s]=e.slice(1),c="",l=s,d=l.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),l=d.pop()),l){let u=l.match(/^\d+/);u&&(l=u[0])}return da({host:i,pass:o,path:c,projectId:l,port:a,protocol:r,publicKey:n})}function da(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Lu(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:e,projectId:r,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(p.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:r.match(/^\d+$/)?Bu(n)?e&&isNaN(parseInt(e,10))?(p.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(p.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(p.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function bn(t){let e=typeof t=="string"?ua(t):da(t);if(!(!e||!Lu(e)))return e}var z=class extends Error{constructor(e,r="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=r}};function F(t,e,r){if(!(e in t))return;let n=t[e],o=r(n);typeof o=="function"&&Tn(o,n),t[e]=o}function Ke(t,e,r){try{Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function Tn(t,e){try{let r=e.prototype||{};t.prototype=e.prototype=r,Ke(t,"__sentry_original__",e)}catch{}}function wt(t){return t.__sentry_original__}function Mo(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function Rn(t){if(Dr(t))return{message:t.message,name:t.name,stack:t.stack,...pa(t)};if(Dt(t)){let e={type:t.type,target:fa(t.target),currentTarget:fa(t.currentTarget),...pa(t)};return typeof CustomEvent<"u"&&de(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function fa(t){try{return Io(t)?Be(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function pa(t){if(typeof t=="object"&&t!==null){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}else return{}}function wo(t,e=40){let r=Object.keys(Rn(t));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=e)return ke(r[0],e);for(let n=r.length;n>0;n--){let o=r.slice(0,n).join(", ");if(!(o.length>e))return n===r.length?o:ke(o,e)}return""}function ie(t){return Do(t,new Map)}function Do(t,e){if(Ee(t)){let r=e.get(t);if(r!==void 0)return r;let n={};e.set(t,n);for(let o of Object.keys(t))typeof t[o]<"u"&&(n[o]=Do(t[o],e));return n}if(Array.isArray(t)){let r=e.get(t);if(r!==void 0)return r;let n=[];return e.set(t,n),t.forEach(o=>{n.push(Do(o,e))}),n}return t}function D(){let t=O,e=t.crypto||t.msCrypto,r=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(r=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function ma(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Ce(t){let{message:e,event_id:r}=t;if(e)return e;let n=ma(t);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Zt(t,e,r){let n=t.exception=t.exception||{},o=n.values=n.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=r||"Error")}function Xe(t,e){let r=ma(t);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism={...n,...o,...e},e&&"data"in e){let i={...o&&o.data,...e.data};r.mechanism.data=i}}function In(t){if(t&&t.__sentry_captured__)return!0;try{Ke(t,"__sentry_captured__",!0)}catch{}return!1}function Fr(t){return Array.isArray(t)?t:[t]}var ha=50,ga=/\(error: (.*)\)/,_a=/captureMessage|captureException/;function xn(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{let o=[],i=r.split(`
3
+ `);for(let a=n;a<i.length;a++){let s=i[a];if(s.length>1024)continue;let c=ga.test(s)?s.replace(ga,"$1"):s;if(!c.match(/\S*Error: /)){for(let l of e){let d=l(c);if(d){o.push(d);break}}if(o.length>=ha)break}}return Sa(o)}}function Bo(t){return Array.isArray(t)?xn(...t):t}function Sa(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),_a.test(e[e.length-1].function||"")&&(e.pop(),_a.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,ha).map(r=>({...r,filename:r.filename||e[e.length-1].filename,function:r.function||"?"}))}var ko="<anonymous>";function ae(t){try{return!t||typeof t!="function"?ko:t.name||ko}catch{return ko}}var Lo=ve();function Nn(){if(!("fetch"in Lo))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Hr(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Fo(){if(!Nn())return!1;if(Hr(Lo.fetch))return!0;let t=!1,e=Lo.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=Hr(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}var On=ve();function ya(){let t=On.chrome,e=t&&t.app&&t.app.runtime,r="history"in On&&!!On.history.pushState&&!!On.history.replaceState;return!e&&r}var V=ve(),Je="__sentry_xhr_v2__",Ur={},Ea={};function Fu(t){if(!Ea[t])switch(Ea[t]=!0,t){case"console":Hu();break;case"dom":Ia();break;case"xhr":Ra();break;case"fetch":Uu();break;case"history":Gu();break;case"error":ju();break;case"unhandledrejection":qu();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("unknown instrumentation type:",t);return}}function H(t,e){Ur[t]=Ur[t]||[],Ur[t].push(e),Fu(t)}function be(t,e){if(!(!t||!Ur[t]))for(let r of Ur[t]||[])try{r(e)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error(`Error while triggering instrumentation handler.
4
4
  Type: ${t}
5
5
  Name: ${ae(r)}
6
- Error:`,n)}}function Xd(){"console"in O&&Lr.forEach(function(t){t in O.console&&F(O.console,t,function(e){return zt[t]=e,function(...r){be("console",{args:r,level:t});let n=zt[t];n&&n.apply(O.console,r)}})})}function Jd(){Ho()&&F(O,"fetch",function(t){return function(...e){let{method:r,url:n}=Na(e),o={args:e,fetchData:{method:r,url:n},startTimestamp:Date.now()};return be("fetch",{...o}),t.apply(O,e).then(i=>(be("fetch",{...o,endTimestamp:Date.now(),response:i}),i),i=>{throw be("fetch",{...o,endTimestamp:Date.now(),error:i}),i})}})}function Uo(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Ra(t){return typeof t=="string"?t:t?Uo(t,"url")?t.url:t.toString?t.toString():"":""}function Na(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:Ra(r),method:Uo(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:Ra(e),method:Uo(e,"method")?String(e.method).toUpperCase():"GET"}}function Oa(){if(!V.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;F(t,"open",function(e){return function(...r){let n=Date.now(),o=r[1],i=this[Je]={method:oe(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};oe(o)&&i.method==="POST"&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let a=()=>{let s=this[Je];if(s&&this.readyState===4){try{s.status_code=this.status}catch{}be("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?F(this,"onreadystatechange",function(s){return function(...c){return a(),s.apply(this,c)}}):this.addEventListener("readystatechange",a),F(this,"setRequestHeader",function(s){return function(...c){let[l,u]=c,d=this[Je];return d&&(d.request_headers[l.toLowerCase()]=u),s.apply(this,c)}}),e.apply(this,r)}}),F(t,"send",function(e){return function(...r){let n=this[Je];return n&&r[0]!==void 0&&(n.body=r[0]),be("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),e.apply(this,r)}})}var Pn;function Qd(){if(!ba())return;let t=V.onpopstate;V.onpopstate=function(...r){let n=V.location.href,o=Pn;if(Pn=n,be("history",{from:o,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let o=n.length>2?n[2]:void 0;if(o){let i=Pn,a=String(o);Pn=a,be("history",{from:i,to:a})}return r.apply(this,n)}}F(V.history,"pushState",e),F(V.history,"replaceState",e)}var eu=1e3,Ia,Go,Yo;function tu(t){if(t.type!==Go)return!1;try{if(!t.target||t.target._sentryId!==Yo)return!1}catch{}return!0}function ru(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function nu(t){try{return t.target}catch{return null}}function xa(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=nu(r);if(ru(r.type,n))return;Ke(r,"_sentryCaptured",!0),n&&!n._sentryId&&Ke(n,"_sentryId",A());let o=r.type==="keypress"?"input":r.type;tu(r)||(t({event:r,name:o,global:e}),Go=r.type,Yo=n?n._sentryId:void 0),clearTimeout(Ia),Ia=V.setTimeout(()=>{Yo=void 0,Go=void 0},eu)}}function Pa(){if(!V.document)return;let t=be.bind(null,"dom"),e=xa(t,!0);V.document.addEventListener("click",e,!1),V.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=V[r]&&V[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(F(n,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},u=l[i]=l[i]||{refCount:0};if(!u.handler){let d=xa(t);u.handler=d,o.call(this,i,d,s)}u.refCount++}catch{}return o.call(this,i,a,s)}}),F(n,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__||{},u=l[i];u&&(u.refCount--,u.refCount<=0&&(o.call(this,i,u.handler,s),u.handler=void 0,delete l[i]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}var Dn=null;function ou(){Dn=V.onerror,V.onerror=function(t,e,r,n,o){return be("error",{column:n,error:o,line:r,msg:t,url:e}),Dn&&!Dn.__SENTRY_LOADER__?Dn.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}var An=null;function iu(){An=V.onunhandledrejection,V.onunhandledrejection=function(t){return be("unhandledrejection",t),An&&!An.__SENTRY_LOADER__?An.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function $o(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Wo(){return"npm"}function Da(){return!$o()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Aa(t,e){return t.require(e)}function Ma(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function r(o){if(t)return e.has(o)?!0:(e.add(o),!1);for(let i=0;i<e.length;i++)if(e[i]===o)return!0;return e.push(o),!1}function n(o){if(t)e.delete(o);else for(let i=0;i<e.length;i++)if(e[i]===o){e.splice(i,1);break}}return[r,n]}function Te(t,e=100,r=1/0){try{return Mn("",t,e,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function wn(t,e=3,r=100*1024){let n=Te(t,e);return lu(n)>r?wn(t,e-1,r):n}function Mn(t,e,r=1/0,n=1/0,o=Ma()){let[i,a]=o;if(e==null||["number","boolean","string"].includes(typeof e)&&!Mr(e))return e;let s=au(t,e);if(!s.startsWith("[object "))return s;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:r;if(c===0)return s.replace("object ","");if(i(e))return"[Circular ~]";let l=e;if(l&&typeof l.toJSON=="function")try{let h=l.toJSON();return Mn("",h,c-1,n,o)}catch{}let u=Array.isArray(e)?[]:{},d=0,p=Rn(e);for(let h in p){if(!Object.prototype.hasOwnProperty.call(p,h))continue;if(d>=n){u[h]="[MaxProperties ~]";break}let S=p[h];u[h]=Mn(h,S,c-1,n,o),d++}return a(e),u}function au(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(wr(e))return"[VueViewModel]";if(Oo(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${ae(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let r=su(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function su(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function cu(t){return~-encodeURI(t).split(/%..|./).length}function lu(t){return cu(JSON.stringify(t))}var Qe;(function(t){t[t.PENDING=0]="PENDING";let r=1;t[t.RESOLVED=r]="RESOLVED";let n=2;t[t.REJECTED=n]="REJECTED"})(Qe||(Qe={}));function fe(t){return new U(e=>{e(t)})}function kt(t){return new U((e,r)=>{r(t)})}var U=class{constructor(e){U.prototype.__init.call(this),U.prototype.__init2.call(this),U.prototype.__init3.call(this),U.prototype.__init4.call(this),this._state=Qe.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(r){this._reject(r)}}then(e,r){return new U((n,o)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(a){o(a)}},i=>{if(!r)o(i);else try{n(r(i))}catch(a){o(a)}}]),this._executeHandlers()})}catch(e){return this.then(r=>r,e)}finally(e){return new U((r,n)=>{let o,i;return this.then(a=>{i=!1,o=a,e&&e()},a=>{i=!0,o=a,e&&e()}).then(()=>{if(i){n(o);return}r(o)})})}__init(){this._resolve=e=>{this._setResult(Qe.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Qe.REJECTED,e)}}__init3(){this._setResult=(e,r)=>{if(this._state===Qe.PENDING){if(Mt(r)){r.then(this._resolve,this._reject);return}this._state=e,this._value=r,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Qe.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(r=>{r[0]||(this._state===Qe.RESOLVED&&r[1](this._value),this._state===Qe.REJECTED&&r[2](this._value),r[0]=!0)})}}};function Vo(t){let e=[];function r(){return t===void 0||e.length<t}function n(a){return e.splice(e.indexOf(a),1)[0]}function o(a){if(!r())return kt(new z("Not adding Promise because buffer limit was reached."));let s=a();return e.indexOf(s)===-1&&e.push(s),s.then(()=>n(s)).then(null,()=>n(s).then(null,()=>{})),s}function i(a){return new U((s,c)=>{let l=e.length;if(!l)return s(!0);let u=setTimeout(()=>{a&&a>0&&s(!1)},a);e.forEach(d=>{fe(d).then(()=>{--l||(clearTimeout(u),s(!0))},c)})})}return{$:e,add:o,drain:i}}function Gr(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}var wa=["fatal","error","warning","log","info","debug"];function jo(t){return t==="warn"?"warning":wa.includes(t)?t:"log"}var Ba=ve(),zo={nowSeconds:()=>Date.now()/1e3};function du(){let{performance:t}=Ba;if(!t||!t.now)return;let e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function uu(){try{return Aa(module,"perf_hooks").performance}catch{return}}var qo=Da()?uu():du(),ka=qo===void 0?zo:{nowSeconds:()=>(qo.timeOrigin+qo.now())/1e3},et=zo.nowSeconds.bind(zo),Re=ka.nowSeconds.bind(ka);var Yr,se=(()=>{let{performance:t}=Ba;if(!t||!t.now){Yr="none";return}let e=3600*1e3,r=t.now(),n=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+r-n):e,i=o<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+r-n):e,l=c<e;return i||l?o<=c?(Yr="timeOrigin",t.timeOrigin):(Yr="navigationStart",a):(Yr="dateNow",n)})();var $r="baggage",Zo="sentry-",Fa=/^sentry-/,Ha=8192;function Ko(t){if(!oe(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((n,o)=>{let i=La(o);return{...n,...i}},{});else{if(!t)return;e=La(t)}let r=Object.entries(e).reduce((n,[o,i])=>{if(o.match(Fa)){let a=o.slice(Zo.length);n[a]=i}return n},{});if(Object.keys(r).length>0)return r}function Wr(t){if(!t)return;let e=Object.entries(t).reduce((r,[n,o])=>(o&&(r[`${Zo}${n}`]=o),r),{});return fu(e)}function La(t){return t.split(",").map(e=>e.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((e,[r,n])=>(e[r]=n,e),{})}function fu(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[r,n],o)=>{let i=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,a=o===0?i:`${e},${i}`;return a.length>Ha?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},"")}var Ua=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Xo(t){if(!t)return;let e=t.match(Ua);if(!e)return;let r;return e[3]==="1"?r=!0:e[3]==="0"&&(r=!1),{traceId:e[1],parentSampled:r,parentSpanId:e[2]}}function Jo(t,e){let r=Xo(t),n=Ko(e),{traceId:o,parentSpanId:i,parentSampled:a}=r||{},s={traceId:o||A(),spanId:A().substring(16),sampled:a};return i&&(s.parentSpanId=i),n&&(s.dsc=n),{traceparentData:r,dynamicSamplingContext:n,propagationContext:s}}function Kt(t=A(),e=A().substring(16),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${t}-${e}${n}`}function Fe(t,e=[]){return[t,e]}function ei(t,e){let[r,n]=t;return[r,[...n,e]]}function kn(t,e){let r=t[1];for(let n of r){let o=n[0].type;if(e(n,o))return!0}return!1}function Qo(t,e){return(e||new TextEncoder).encode(t)}function ti(t,e){let[r,n]=t,o=JSON.stringify(r);function i(a){typeof o=="string"?o=typeof a=="string"?o+a:[Qo(o,e),a]:o.push(typeof a=="string"?Qo(a,e):a)}for(let a of n){let[s,c]=a;if(i(`
6
+ Error:`,n)}}function Hu(){"console"in O&&Lr.forEach(function(t){t in O.console&&F(O.console,t,function(e){return zt[t]=e,function(...r){be("console",{args:r,level:t});let n=zt[t];n&&n.apply(O.console,r)}})})}function Uu(){Fo()&&F(O,"fetch",function(t){return function(...e){let{method:r,url:n}=Ta(e),o={args:e,fetchData:{method:r,url:n},startTimestamp:Date.now()};return be("fetch",{...o}),t.apply(O,e).then(i=>(be("fetch",{...o,endTimestamp:Date.now(),response:i}),i),i=>{throw be("fetch",{...o,endTimestamp:Date.now(),error:i}),i})}})}function Ho(t,e){return!!t&&typeof t=="object"&&!!t[e]}function va(t){return typeof t=="string"?t:t?Ho(t,"url")?t.url:t.toString?t.toString():"":""}function Ta(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:va(r),method:Ho(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:va(e),method:Ho(e,"method")?String(e.method).toUpperCase():"GET"}}function Ra(){if(!V.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;F(t,"open",function(e){return function(...r){let n=Date.now(),o=r[1],i=this[Je]={method:oe(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};oe(o)&&i.method==="POST"&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let a=()=>{let s=this[Je];if(s&&this.readyState===4){try{s.status_code=this.status}catch{}be("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?F(this,"onreadystatechange",function(s){return function(...c){return a(),s.apply(this,c)}}):this.addEventListener("readystatechange",a),F(this,"setRequestHeader",function(s){return function(...c){let[l,d]=c,u=this[Je];return u&&(u.request_headers[l.toLowerCase()]=d),s.apply(this,c)}}),e.apply(this,r)}}),F(t,"send",function(e){return function(...r){let n=this[Je];return n&&r[0]!==void 0&&(n.body=r[0]),be("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),e.apply(this,r)}})}var Pn;function Gu(){if(!ya())return;let t=V.onpopstate;V.onpopstate=function(...r){let n=V.location.href,o=Pn;if(Pn=n,be("history",{from:o,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let o=n.length>2?n[2]:void 0;if(o){let i=Pn,a=String(o);Pn=a,be("history",{from:i,to:a})}return r.apply(this,n)}}F(V.history,"pushState",e),F(V.history,"replaceState",e)}var Yu=1e3,Ca,Uo,Go;function $u(t){if(t.type!==Uo)return!1;try{if(!t.target||t.target._sentryId!==Go)return!1}catch{}return!0}function Wu(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function Vu(t){try{return t.target}catch{return null}}function ba(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=Vu(r);if(Wu(r.type,n))return;Ke(r,"_sentryCaptured",!0),n&&!n._sentryId&&Ke(n,"_sentryId",D());let o=r.type==="keypress"?"input":r.type;$u(r)||(t({event:r,name:o,global:e}),Uo=r.type,Go=n?n._sentryId:void 0),clearTimeout(Ca),Ca=V.setTimeout(()=>{Go=void 0,Uo=void 0},Yu)}}function Ia(){if(!V.document)return;let t=be.bind(null,"dom"),e=ba(t,!0);V.document.addEventListener("click",e,!1),V.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=V[r]&&V[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(F(n,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=l[i]=l[i]||{refCount:0};if(!d.handler){let u=ba(t);d.handler=u,o.call(this,i,u,s)}d.refCount++}catch{}return o.call(this,i,a,s)}}),F(n,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__||{},d=l[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,s),d.handler=void 0,delete l[i]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}var An=null;function ju(){An=V.onerror,V.onerror=function(t,e,r,n,o){return be("error",{column:n,error:o,line:r,msg:t,url:e}),An&&!An.__SENTRY_LOADER__?An.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}var Dn=null;function qu(){Dn=V.onunhandledrejection,V.onunhandledrejection=function(t){return be("unhandledrejection",t),Dn&&!Dn.__SENTRY_LOADER__?Dn.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Yo(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function $o(){return"npm"}function xa(){return!Yo()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Na(t,e){return t.require(e)}function Oa(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function r(o){if(t)return e.has(o)?!0:(e.add(o),!1);for(let i=0;i<e.length;i++)if(e[i]===o)return!0;return e.push(o),!1}function n(o){if(t)e.delete(o);else for(let i=0;i<e.length;i++)if(e[i]===o){e.splice(i,1);break}}return[r,n]}function Te(t,e=100,r=1/0){try{return Mn("",t,e,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function wn(t,e=3,r=100*1024){let n=Te(t,e);return Xu(n)>r?wn(t,e-1,r):n}function Mn(t,e,r=1/0,n=1/0,o=Oa()){let[i,a]=o;if(e==null||["number","boolean","string"].includes(typeof e)&&!Mr(e))return e;let s=zu(t,e);if(!s.startsWith("[object "))return s;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:r;if(c===0)return s.replace("object ","");if(i(e))return"[Circular ~]";let l=e;if(l&&typeof l.toJSON=="function")try{let h=l.toJSON();return Mn("",h,c-1,n,o)}catch{}let d=Array.isArray(e)?[]:{},u=0,m=Rn(e);for(let h in m){if(!Object.prototype.hasOwnProperty.call(m,h))continue;if(u>=n){d[h]="[MaxProperties ~]";break}let S=m[h];d[h]=Mn(h,S,c-1,n,o),u++}return a(e),d}function zu(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(wr(e))return"[VueViewModel]";if(No(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${ae(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let r=Zu(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Zu(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function Ku(t){return~-encodeURI(t).split(/%..|./).length}function Xu(t){return Ku(JSON.stringify(t))}var Qe;(function(t){t[t.PENDING=0]="PENDING";let r=1;t[t.RESOLVED=r]="RESOLVED";let n=2;t[t.REJECTED=n]="REJECTED"})(Qe||(Qe={}));function fe(t){return new U(e=>{e(t)})}function kt(t){return new U((e,r)=>{r(t)})}var U=class{constructor(e){U.prototype.__init.call(this),U.prototype.__init2.call(this),U.prototype.__init3.call(this),U.prototype.__init4.call(this),this._state=Qe.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(r){this._reject(r)}}then(e,r){return new U((n,o)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(a){o(a)}},i=>{if(!r)o(i);else try{n(r(i))}catch(a){o(a)}}]),this._executeHandlers()})}catch(e){return this.then(r=>r,e)}finally(e){return new U((r,n)=>{let o,i;return this.then(a=>{i=!1,o=a,e&&e()},a=>{i=!0,o=a,e&&e()}).then(()=>{if(i){n(o);return}r(o)})})}__init(){this._resolve=e=>{this._setResult(Qe.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Qe.REJECTED,e)}}__init3(){this._setResult=(e,r)=>{if(this._state===Qe.PENDING){if(Mt(r)){r.then(this._resolve,this._reject);return}this._state=e,this._value=r,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Qe.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(r=>{r[0]||(this._state===Qe.RESOLVED&&r[1](this._value),this._state===Qe.REJECTED&&r[2](this._value),r[0]=!0)})}}};function Wo(t){let e=[];function r(){return t===void 0||e.length<t}function n(a){return e.splice(e.indexOf(a),1)[0]}function o(a){if(!r())return kt(new z("Not adding Promise because buffer limit was reached."));let s=a();return e.indexOf(s)===-1&&e.push(s),s.then(()=>n(s)).then(null,()=>n(s).then(null,()=>{})),s}function i(a){return new U((s,c)=>{let l=e.length;if(!l)return s(!0);let d=setTimeout(()=>{a&&a>0&&s(!1)},a);e.forEach(u=>{fe(u).then(()=>{--l||(clearTimeout(d),s(!0))},c)})})}return{$:e,add:o,drain:i}}function Gr(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}var Pa=["fatal","error","warning","log","info","debug"];function Vo(t){return t==="warn"?"warning":Pa.includes(t)?t:"log"}var Da=ve(),qo={nowSeconds:()=>Date.now()/1e3};function Ju(){let{performance:t}=Da;if(!t||!t.now)return;let e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function Qu(){try{return Na(module,"perf_hooks").performance}catch{return}}var jo=xa()?Qu():Ju(),Aa=jo===void 0?qo:{nowSeconds:()=>(jo.timeOrigin+jo.now())/1e3},et=qo.nowSeconds.bind(qo),Re=Aa.nowSeconds.bind(Aa);var Yr,se=(()=>{let{performance:t}=Da;if(!t||!t.now){Yr="none";return}let e=3600*1e3,r=t.now(),n=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+r-n):e,i=o<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+r-n):e,l=c<e;return i||l?o<=c?(Yr="timeOrigin",t.timeOrigin):(Yr="navigationStart",a):(Yr="dateNow",n)})();var $r="baggage",zo="sentry-",wa=/^sentry-/,ka=8192;function Zo(t){if(!oe(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((n,o)=>{let i=Ma(o);return{...n,...i}},{});else{if(!t)return;e=Ma(t)}let r=Object.entries(e).reduce((n,[o,i])=>{if(o.match(wa)){let a=o.slice(zo.length);n[a]=i}return n},{});if(Object.keys(r).length>0)return r}function Wr(t){if(!t)return;let e=Object.entries(t).reduce((r,[n,o])=>(o&&(r[`${zo}${n}`]=o),r),{});return ed(e)}function Ma(t){return t.split(",").map(e=>e.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((e,[r,n])=>(e[r]=n,e),{})}function ed(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[r,n],o)=>{let i=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,a=o===0?i:`${e},${i}`;return a.length>ka?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},"")}var Ba=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ko(t){if(!t)return;let e=t.match(Ba);if(!e)return;let r;return e[3]==="1"?r=!0:e[3]==="0"&&(r=!1),{traceId:e[1],parentSampled:r,parentSpanId:e[2]}}function Xo(t,e){let r=Ko(t),n=Zo(e),{traceId:o,parentSpanId:i,parentSampled:a}=r||{},s={traceId:o||D(),spanId:D().substring(16),sampled:a};return i&&(s.parentSpanId=i),n&&(s.dsc=n),{traceparentData:r,dynamicSamplingContext:n,propagationContext:s}}function Kt(t=D(),e=D().substring(16),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${t}-${e}${n}`}function Fe(t,e=[]){return[t,e]}function Qo(t,e){let[r,n]=t;return[r,[...n,e]]}function kn(t,e){let r=t[1];for(let n of r){let o=n[0].type;if(e(n,o))return!0}return!1}function Jo(t,e){return(e||new TextEncoder).encode(t)}function ei(t,e){let[r,n]=t,o=JSON.stringify(r);function i(a){typeof o=="string"?o=typeof a=="string"?o+a:[Jo(o,e),a]:o.push(typeof a=="string"?Jo(a,e):a)}for(let a of n){let[s,c]=a;if(i(`
7
7
  ${JSON.stringify(s)}
8
- `),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(Te(c))}i(l)}}return typeof o=="string"?o:mu(o)}function mu(t){let e=t.reduce((o,i)=>o+i.length,0),r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function ri(t,e){let r=typeof t.data=="string"?Qo(t.data,e):t.data;return[ie({type:"attachment",length:r.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),r]}var pu={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",statsd:"unknown"};function Bn(t){return pu[t]}function Ln(t){if(!t||!t.sdk)return;let{name:e,version:r}=t.sdk;return{name:e,version:r}}function ni(t,e,r,n){let o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!r&&n&&{dsn:Le(n)},...o&&{trace:ie({...o})}}}function oi(t,e,r){let n=[{type:"client_report"},{timestamp:r||et(),discarded_events:t}];return Fe(e?{dsn:e}:{},[n])}function Ga(t,e=Date.now()){let r=parseInt(`${t}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${t}`);return isNaN(n)?6e4:n-e}function Ya(t,e){return t[e]||t.all||0}function ii(t,e,r=Date.now()){return Ya(t,e)>r}function ai(t,{statusCode:e,headers:r},n=Date.now()){let o={...t},i=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(i)for(let s of i.trim().split(",")){let[c,l]=s.split(":",2),u=parseInt(c,10),d=(isNaN(u)?60:u)*1e3;if(!l)o.all=n+d;else for(let p of l.split(";"))o[p]=n+d}else a?o.all=n+Ga(a,n):e===429&&(o.all=n+60*1e3);return o}function $a(t,e){return t(e.stack||"",1)}function si(t,e){let r={type:e.name||e.constructor.name,value:e.message},n=$a(t,e);return n.length&&(r.stacktrace={frames:n}),r}var Xt="production";function Vr(){return Br("globalEventProcessors",()=>[])}function ci(t){Vr().push(t)}function Jt(t,e,r,n=0){return new U((o,i)=>{let a=t[n];if(e===null||typeof a!="function")o(e);else{let s=a({...e},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&s===null&&m.log(`Event processor "${a.id}" dropped event`),Mt(s)?s.then(c=>Jt(t,c,r,n+1).then(o)).then(null,i):Jt(t,s,r,n+1).then(o).then(null,i)}})}function Wa(t){let e=Re(),r={sid:A(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>gu(r)};return t&&tt(r,t),r}function tt(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Re(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:A()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Va(t,e){let r={};e?r={status:e}:t.status==="ok"&&(r={status:"exited"}),tt(t,r)}function gu(t){return ie({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}var _u=100,ge=class{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ja()}static clone(e){let r=new ge;return e&&(r._breadcrumbs=[...e._breadcrumbs],r._tags={...e._tags},r._extra={...e._extra},r._contexts={...e._contexts},r._user=e._user,r._level=e._level,r._span=e._span,r._session=e._session,r._transactionName=e._transactionName,r._fingerprint=e._fingerprint,r._eventProcessors=[...e._eventProcessors],r._requestSession=e._requestSession,r._attachments=[...e._attachments],r._sdkProcessingMetadata={...e._sdkProcessingMetadata},r._propagationContext={...e._propagationContext}),r}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&tt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,r){return this._tags={...this._tags,[e]:r},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,r){return this._extra={...this._extra,[e]:r},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,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let r=e(this);return r instanceof ge?r:this}return e instanceof ge?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Ee(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=ja(),this}addBreadcrumb(e,r){let n=typeof r=="number"?r:_u;if(n<=0)return this;let o={timestamp:et(),...e},i=this._breadcrumbs;return i.push(o),this._breadcrumbs=i.length>n?i.slice(-n):i,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}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,r={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let a=this._span.transaction;if(a){e.sdkProcessingMetadata={dynamicSamplingContext:a.getDynamicSamplingContext(),...e.sdkProcessingMetadata};let s=a.name;s&&(e.tags={transaction:s,...e.tags})}}this._applyFingerprint(e);let o=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...o];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},Jt([...n||[],...Vr(),...this._eventProcessors],e,r)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Fr(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function ja(){return{traceId:A(),spanId:A().substring(16)}}var qa=4,hu=100,Qt=class{constructor(e,r=new ge,n=qa){this._version=n,this._stack=[{scope:r}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let r=this.getStackTop();r.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=ge.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let r=this.pushScope();try{e(r)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,r){let n=this._lastEventId=r&&r.event_id?r.event_id:A(),o=new Error("Sentry syntheticException");return this._withClient((i,a)=>{i.captureException(e,{originalException:e,syntheticException:o,...r,event_id:n},a)}),n}captureMessage(e,r,n){let o=this._lastEventId=n&&n.event_id?n.event_id:A(),i=new Error(e);return this._withClient((a,s)=>{a.captureMessage(e,r,{originalException:e,syntheticException:i,...n,event_id:o},s)}),o}captureEvent(e,r){let n=r&&r.event_id?r.event_id:A();return e.type||(this._lastEventId=n),this._withClient((o,i)=>{o.captureEvent(e,{...r,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,r){let{scope:n,client:o}=this.getStackTop();if(!o)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=hu}=o.getOptions&&o.getOptions()||{};if(a<=0)return;let c={timestamp:et(),...e},l=i?Cn(()=>i(c,r)):c;l!==null&&(o.emit&&o.emit("beforeAddBreadcrumb",l,r),n.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,r){this.getScope().setTag(e,r)}setExtra(e,r){this.getScope().setExtra(e,r)}setContext(e,r){this.getScope().setContext(e,r)}configureScope(e){let{scope:r,client:n}=this.getStackTop();n&&e(r)}run(e){let r=Fn(this);try{e(this)}finally{Fn(r)}}getIntegration(e){let r=this.getClient();if(!r)return null;try{return r.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,r){let n=this._callExtensionMethod("startTransaction",e,r);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!n){let o=this.getClient();console.warn(o?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
8
+ `),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(Te(c))}i(l)}}return typeof o=="string"?o:td(o)}function td(t){let e=t.reduce((o,i)=>o+i.length,0),r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function ti(t,e){let r=typeof t.data=="string"?Jo(t.data,e):t.data;return[ie({type:"attachment",length:r.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),r]}var rd={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",statsd:"unknown"};function Bn(t){return rd[t]}function Ln(t){if(!t||!t.sdk)return;let{name:e,version:r}=t.sdk;return{name:e,version:r}}function ri(t,e,r,n){let o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!r&&n&&{dsn:Le(n)},...o&&{trace:ie({...o})}}}function ni(t,e,r){let n=[{type:"client_report"},{timestamp:r||et(),discarded_events:t}];return Fe(e?{dsn:e}:{},[n])}function La(t,e=Date.now()){let r=parseInt(`${t}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${t}`);return isNaN(n)?6e4:n-e}function Fa(t,e){return t[e]||t.all||0}function oi(t,e,r=Date.now()){return Fa(t,e)>r}function ii(t,{statusCode:e,headers:r},n=Date.now()){let o={...t},i=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(i)for(let s of i.trim().split(",")){let[c,l]=s.split(":",2),d=parseInt(c,10),u=(isNaN(d)?60:d)*1e3;if(!l)o.all=n+u;else for(let m of l.split(";"))o[m]=n+u}else a?o.all=n+La(a,n):e===429&&(o.all=n+60*1e3);return o}function Ha(t,e){return t(e.stack||"",1)}function ai(t,e){let r={type:e.name||e.constructor.name,value:e.message},n=Ha(t,e);return n.length&&(r.stacktrace={frames:n}),r}var Xt="production";function Vr(){return Br("globalEventProcessors",()=>[])}function si(t){Vr().push(t)}function Jt(t,e,r,n=0){return new U((o,i)=>{let a=t[n];if(e===null||typeof a!="function")o(e);else{let s=a({...e},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&s===null&&p.log(`Event processor "${a.id}" dropped event`),Mt(s)?s.then(c=>Jt(t,c,r,n+1).then(o)).then(null,i):Jt(t,s,r,n+1).then(o).then(null,i)}})}function Ua(t){let e=Re(),r={sid:D(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>nd(r)};return t&&tt(r,t),r}function tt(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Re(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:D()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Ga(t,e){let r={};e?r={status:e}:t.status==="ok"&&(r={status:"exited"}),tt(t,r)}function nd(t){return ie({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}var od=100,ge=class{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ya()}static clone(e){let r=new ge;return e&&(r._breadcrumbs=[...e._breadcrumbs],r._tags={...e._tags},r._extra={...e._extra},r._contexts={...e._contexts},r._user=e._user,r._level=e._level,r._span=e._span,r._session=e._session,r._transactionName=e._transactionName,r._fingerprint=e._fingerprint,r._eventProcessors=[...e._eventProcessors],r._requestSession=e._requestSession,r._attachments=[...e._attachments],r._sdkProcessingMetadata={...e._sdkProcessingMetadata},r._propagationContext={...e._propagationContext}),r}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&tt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,r){return this._tags={...this._tags,[e]:r},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,r){return this._extra={...this._extra,[e]:r},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,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let r=e(this);return r instanceof ge?r:this}return e instanceof ge?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Ee(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ya(),this}addBreadcrumb(e,r){let n=typeof r=="number"?r:od;if(n<=0)return this;let o={timestamp:et(),...e},i=this._breadcrumbs;return i.push(o),this._breadcrumbs=i.length>n?i.slice(-n):i,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}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,r={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let a=this._span.transaction;if(a){e.sdkProcessingMetadata={dynamicSamplingContext:a.getDynamicSamplingContext(),...e.sdkProcessingMetadata};let s=a.name;s&&(e.tags={transaction:s,...e.tags})}}this._applyFingerprint(e);let o=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...o];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},Jt([...n||[],...Vr(),...this._eventProcessors],e,r)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Fr(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function Ya(){return{traceId:D(),spanId:D().substring(16)}}var $a=4,id=100,Qt=class{constructor(e,r=new ge,n=$a){this._version=n,this._stack=[{scope:r}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let r=this.getStackTop();r.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=ge.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let r=this.pushScope();try{e(r)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,r){let n=this._lastEventId=r&&r.event_id?r.event_id:D(),o=new Error("Sentry syntheticException");return this._withClient((i,a)=>{i.captureException(e,{originalException:e,syntheticException:o,...r,event_id:n},a)}),n}captureMessage(e,r,n){let o=this._lastEventId=n&&n.event_id?n.event_id:D(),i=new Error(e);return this._withClient((a,s)=>{a.captureMessage(e,r,{originalException:e,syntheticException:i,...n,event_id:o},s)}),o}captureEvent(e,r){let n=r&&r.event_id?r.event_id:D();return e.type||(this._lastEventId=n),this._withClient((o,i)=>{o.captureEvent(e,{...r,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,r){let{scope:n,client:o}=this.getStackTop();if(!o)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=id}=o.getOptions&&o.getOptions()||{};if(a<=0)return;let c={timestamp:et(),...e},l=i?Cn(()=>i(c,r)):c;l!==null&&(o.emit&&o.emit("beforeAddBreadcrumb",l,r),n.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,r){this.getScope().setTag(e,r)}setExtra(e,r){this.getScope().setExtra(e,r)}setContext(e,r){this.getScope().setContext(e,r)}configureScope(e){let{scope:r,client:n}=this.getStackTop();n&&e(r)}run(e){let r=Fn(this);try{e(this)}finally{Fn(r)}}getIntegration(e){let r=this.getClient();if(!r)return null;try{return r.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,r){let n=this._callExtensionMethod("startTransaction",e,r);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!n){let o=this.getClient();console.warn(o?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
9
9
  Sentry.addTracingExtensions();
10
10
  Sentry.init({...});
11
- `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let r=this.getStackTop().scope,n=r.getSession();n&&Va(n),this._sendSessionUpdate(),r.setSession()}startSession(e){let{scope:r,client:n}=this.getStackTop(),{release:o,environment:i=Xt}=n&&n.getOptions()||{},{userAgent:a}=O.navigator||{},s=Wa({release:o,environment:i,user:r.getUser(),...a&&{userAgent:a},...e}),c=r.getSession&&r.getSession();return c&&c.status==="ok"&&tt(c,{status:"exited"}),this.endSession(),r.setSession(s),s}shouldSendDefaultPii(){let e=this.getClient(),r=e&&e.getOptions();return!!(r&&r.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:r}=this.getStackTop(),n=e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}_withClient(e){let{scope:r,client:n}=this.getStackTop();n&&e(n,r)}_callExtensionMethod(e,...r){let o=Bt().__SENTRY__;if(o&&o.extensions&&typeof o.extensions[e]=="function")return o.extensions[e].apply(this,r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function Bt(){return O.__SENTRY__=O.__SENTRY__||{extensions:{},hub:void 0},O}function Fn(t){let e=Bt(),r=jr(e);return li(e,t),r}function b(){let t=Bt();if(t.__SENTRY__&&t.__SENTRY__.acs){let e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Su(t)}function Su(t=Bt()){return(!yu(t)||jr(t).isOlderThan(qa))&&li(t,new Qt),jr(t)}function yu(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function jr(t){return Br("hub",()=>new Qt,t)}function li(t,e){if(!t)return!1;let r=t.__SENTRY__=t.__SENTRY__||{};return r.hub=e,!0}function Ie(t){return(t||b()).getScope().getTransaction()}var za=!1;function Za(){za||(za=!0,H("error",di),H("unhandledrejection",di))}function di(){let t=Ie();if(t){let e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}di.tag="sentry_tracingErrorCallback";var er=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},tr=class{constructor(e={}){this.traceId=e.traceId||A(),this.spanId=e.spanId||A().substring(16),this.startTimestamp=e.startTimestamp||Re(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let r=new tr({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(r.spanRecorder=this.spanRecorder,r.spanRecorder&&r.spanRecorder.add(r),r.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&r.transaction){let n=e&&e.op||"< unknown op >",o=r.transaction.name||"< unknown name >",i=r.transaction.spanId,a=`[Tracing] Starting '${n}' span on transaction '${o}' (${i}).`;r.transaction.metadata.spanMetadata[r.spanId]={logMessage:a},m.log(a)}return r}setTag(e,r){return this.tags={...this.tags,[e]:r},this}setData(e,r){return this.data={...this.data,[e]:r},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let r=Ka(e);return r!=="unknown_error"&&this.setStatus(r),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:r}=this.transaction.metadata.spanMetadata[this.spanId];r&&m.log(r.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:Re()}toTraceparent(){return Kt(this.traceId,this.spanId,this.sampled)}toContext(){return ie({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return ie({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return ie({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function Ka(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function ht(t,e,r){let n=e.getOptions(),{publicKey:o}=e.getDsn()||{},{segment:i}=r&&r.getUser()||{},a=ie({environment:n.environment||Xt,release:n.release,user_segment:i,public_key:o,trace_id:t});return e.emit&&e.emit("createDsc",a),a}var rr=class extends tr{constructor(e,r){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=r||b(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;let n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,r="custom"){this._name=e,this.metadata.source=r}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new er(e)),this.spanRecorder.add(this)}setContext(e,r){r===null?delete this._contexts[e]:this._contexts[e]=r}setMeasurement(e,r,n=""){this._measurements[e]={value:r,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){let r=this._finishTransaction(e);if(r)return this._hub.captureEvent(r)}toContext(){let e=super.toContext();return ie({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||b(),r=e.getClient();if(!r)return{};let n=e.getScope(),o=ht(this.traceId,r,n),i=this.metadata.sampleRate;i!==void 0&&(o.sample_rate=`${i}`);let a=this.metadata.source;return a&&a!=="url"&&(o.transaction=this.name),this.sampled!==void 0&&(o.sampled=String(this.sampled)),o}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let r=this._hub.getClient();if(r&&r.emit&&r.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),r&&r.recordDroppedEvent("sample_rate","transaction");return}let n=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((s,c)=>s.endTimestamp&&c.endTimestamp?s.endTimestamp>c.endTimestamp?s:c:s).endTimestamp);let o=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...o,dynamicSamplingContext:this.getDynamicSamplingContext()},...o.source&&{transaction_info:{source:o.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}};var or={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Eu="finishReason",nr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],ui=class extends er{constructor(e,r,n,o){super(o),this._pushActivity=e,this._popActivity=r,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=r=>{e.endTimestamp=typeof r=="number"?r:Re(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},qr=class extends rr{constructor(e,r,n=or.idleTimeout,o=or.finalTimeout,i=or.heartbeatInterval,a=!1){super(e,r),this._idleHub=r,this._idleTimeout=n,this._finalTimeout=o,this._heartbeatInterval=i,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=nr[4],a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),r.configureScope(s=>s.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=nr[3],this.finish())},this._finalTimeout)}finish(e=Re()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Eu,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let r of this._beforeFinishCallbacks)r(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanId===this.spanId)return!0;r.endTimestamp||(r.endTimestamp=e,r.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));let n=r.startTimestamp<e,o=(this._finalTimeout+this._idleTimeout)/1e3,i=r.endTimestamp-this.startTimestamp<o;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let a=JSON.stringify(r,void 0,2);n?i||m.log("[Tracing] discarding Span since it finished after Transaction final timeout",a):m.log("[Tracing] discarding Span since it happened after Transaction was finished",a)}return n&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] No active IdleTransaction");if(this._onScope){let r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let r=o=>{this._finished||this._pushActivity(o)},n=o=>{this._finished||this._popActivity(o)};this.spanRecorder=new ui(r,n,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:r}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=r===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=nr[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=nr[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let r=Re();this._idleTimeoutCanceledPermanently?(this._finishReason=nr[5],this.finish(r)):this._restartIdleTimeout(r+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=nr[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function ir(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=b().getClient(),r=t||e&&e.getOptions();return!!r&&(r.enableTracing||"tracesSampleRate"in r||"tracesSampler"in r)}function fi(t,e,r){if(!ir(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let n;return typeof e.tracesSampler=="function"?(n=e.tracesSampler(r),t.setMetadata({sampleRate:Number(n)})):r.parentSampled!==void 0?n=r.parentSampled:typeof e.tracesSampleRate<"u"?(n=e.tracesSampleRate,t.setMetadata({sampleRate:Number(n)})):(n=1,t.setMetadata({sampleRate:n})),vu(n)?n?(t.sampled=Math.random()<n,t.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function vu(t){return Mr(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function Cu(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function bu(t,e){let r=this.getClient(),n=r&&r.getOptions()||{},o=n.instrumenter||"sentry",i=t.instrumenter||"sentry";o!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${o}\` instrumenter.
12
- The transaction will not be sampled. Please use the ${o} instrumentation to start transactions.`),t.sampled=!1);let a=new rr(t,this);return a=fi(a,n,{parentSampled:t.parentSampled,transactionContext:t,...e}),a.sampled&&a.initSpanRecorder(n._experiments&&n._experiments.maxSpans),r&&r.emit&&r.emit("startTransaction",a),a}function Hn(t,e,r,n,o,i,a){let s=t.getClient(),c=s&&s.getOptions()||{},l=new qr(e,t,r,n,a,o);return l=fi(l,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),s&&s.emit&&s.emit("startTransaction",l),l}function Un(){let t=Bt();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=bu),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=Cu),Za())}function ar(t,e){return b().captureException(t,{captureContext:e})}function zr(t){b().addBreadcrumb(t)}function Gn(t,e){b().setContext(t,e)}function Yn(t){b().withScope(t)}var Tu="7";function Ru(t){let e=t.protocol?`${t.protocol}:`:"",r=t.port?`:${t.port}`:"";return`${e}//${t.host}${r}${t.path?`/${t.path}`:""}/api/`}function Iu(t){return`${Ru(t)}${t.projectId}/envelope/`}function xu(t,e){return wo({sentry_key:t.publicKey,sentry_version:Tu,...e&&{sentry_client:`${e.name}/${e.version}`}})}function Xa(t,e={}){let r=typeof e=="string"?e:e.tunnel,n=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return r||`${Iu(t)}?${xu(t,n)}`}function Nu(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function Ja(t,e,r,n){let o=Ln(r),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!n&&e&&{dsn:Le(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Fe(i,[a])}function Qa(t,e,r,n){let o=Ln(r),i=t.type&&t.type!=="replay_event"?t.type:"event";Nu(t,r&&r.sdk);let a=ni(t,o,n,e);return delete t.sdkProcessingMetadata,Fe(a,[[{type:i},t]])}var es=[];function Ou(t){let e={};return t.forEach(r=>{let{name:n}=r,o=e[n];o&&!o.isDefaultInstance&&r.isDefaultInstance||(e[n]=r)}),Object.keys(e).map(r=>e[r])}function mi(t){let e=t.defaultIntegrations||[],r=t.integrations;e.forEach(a=>{a.isDefaultInstance=!0});let n;Array.isArray(r)?n=[...e,...r]:typeof r=="function"?n=Fr(r(e)):n=e;let o=Ou(n),i=Pu(o,a=>a.name==="Debug");if(i!==-1){let[a]=o.splice(i,1);o.push(a)}return o}function ts(t,e){let r={};return e.forEach(n=>{n&&pi(t,n,r)}),r}function pi(t,e,r){if(r[e.name]=e,es.indexOf(e.name)===-1&&(e.setupOnce(ci,b),es.push(e.name)),t.on&&typeof e.preprocessEvent=="function"){let n=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,i)=>n(o,i,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){let n=e.processEvent.bind(e),o=Object.assign((i,a)=>n(i,a,t),{id:e.name});t.addEventProcessor(o)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`Integration installed: ${e.name}`)}function Pu(t,e){for(let r=0;r<t.length;r++)if(e(t[r])===!0)return r;return-1}function ns(t,e,r,n,o){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,s={...e,event_id:e.event_id||r.event_id||A(),timestamp:e.timestamp||et()},c=r.integrations||t.integrations.map(p=>p.name);Du(s,t),wu(s,c),e.type===void 0&&Au(s,t.stackParser);let l=n;r.captureContext&&(l=ge.clone(l).update(r.captureContext));let u=fe(s),d=o&&o.getEventProcessors?o.getEventProcessors():[];if(l){if(l.getAttachments){let p=[...r.attachments||[],...l.getAttachments()];p.length&&(r.attachments=p)}u=l.applyToEvent(s,r,d)}else u=Jt([...d,...Vr()],s,r);return u.then(p=>(p&&Mu(p),typeof i=="number"&&i>0?ku(p,i,a):p))}function Du(t,e){let{environment:r,release:n,dist:o,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?r:Xt),t.release===void 0&&n!==void 0&&(t.release=n),t.dist===void 0&&o!==void 0&&(t.dist=o),t.message&&(t.message=ke(t.message,i));let a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=ke(a.value,i));let s=t.request;s&&s.url&&(s.url=ke(s.url,i))}var rs=new WeakMap;function Au(t,e){let r=O._sentryDebugIds;if(!r)return;let n,o=rs.get(e);o?n=o:(n=new Map,rs.set(e,n));let i=Object.keys(r).reduce((a,s)=>{let c,l=n.get(s);l?c=l:(c=e(s),n.set(s,c));for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.filename){a[d.filename]=r[s];break}}return a},{});try{t.exception.values.forEach(a=>{a.stacktrace.frames.forEach(s=>{s.filename&&(s.debug_id=i[s.filename])})})}catch{}}function Mu(t){let e={};try{t.exception.values.forEach(n=>{n.stacktrace.frames.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let r=t.debug_meta.images;Object.keys(e).forEach(n=>{r.push({type:"sourcemap",code_file:n,debug_id:e[n]})})}function wu(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function ku(t,e,r){if(!t)return null;let n={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:Te(o.data,e,r)}}))},...t.user&&{user:Te(t.user,e,r)},...t.contexts&&{contexts:Te(t.contexts,e,r)},...t.extra&&{extra:Te(t.extra,e,r)}};return t.contexts&&t.contexts.trace&&n.contexts&&(n.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(n.contexts.trace.data=Te(t.contexts.trace.data,e,r))),t.spans&&(n.spans=t.spans.map(o=>(o.data&&(o.data=Te(o.data,e,r)),o))),n}var os="Not capturing exception because it's already been captured.",Zr=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=bn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("No DSN provided, client will not send events."),this._dsn){let r=Xa(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}}captureException(e,r,n){if(In(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(os);return}let o=r&&r.event_id;return this._process(this.eventFromException(e,r).then(i=>this._captureEvent(i,r,n)).then(i=>{o=i})),o}captureMessage(e,r,n,o){let i=n&&n.event_id,a=qt(e)?this.eventFromMessage(String(e),r,n):this.eventFromException(e,n);return this._process(a.then(s=>this._captureEvent(s,n,o)).then(s=>{i=s})),i}captureEvent(e,r,n){if(r&&r.originalException&&In(r.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(os);return}let o=r&&r.event_id;return this._process(this._captureEvent(e,r,n).then(i=>{o=i})),o}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),tt(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let r=this._transport;return r?this._isClientDoneProcessing(e).then(n=>r.flush(e).then(o=>n&&o)):fe(!0)}close(e){return this.flush(e).then(r=>(this.getOptions().enabled=!1,r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=ts(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){pi(this,e,this._integrations)}sendEvent(e,r={}){this.emit("beforeSendEvent",e,r);let n=Qa(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of r.attachments||[])n=ei(n,ri(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let o=this._sendEnvelope(n);o&&o.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let r=Ja(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(r)}recordDroppedEvent(e,r,n){if(this._options.sendClientReports){let o=`${e}:${r}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`Adding outcome: "${o}"`),this._outcomes[o]=this._outcomes[o]+1||1}}on(e,r){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(r)}emit(e,...r){this._hooks[e]&&this._hooks[e].forEach(n=>n(...r))}_updateSessionFromEvent(e,r){let n=!1,o=!1,i=r.exception&&r.exception.values;if(i){o=!0;for(let c of i){let l=c.mechanism;if(l&&l.handled===!1){n=!0;break}}}let a=e.status==="ok";(a&&e.errors===0||a&&n)&&(tt(e,{...n&&{status:"crashed"},errors:e.errors||Number(o||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new U(r=>{let n=0,o=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),r(!0)):(n+=o,e&&n>=e&&(clearInterval(i),r(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,r,n){let o=this.getOptions(),i=Object.keys(this._integrations);return!r.integrations&&i.length>0&&(r.integrations=i),this.emit("preprocessEvent",e,r),ns(o,e,r,n,this).then(a=>{if(a===null)return a;let{propagationContext:s}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&s){let{traceId:l,spanId:u,parentSpanId:d,dsc:p}=s;a.contexts={trace:{trace_id:l,span_id:u,parent_span_id:d},...a.contexts};let h=p||ht(l,this,n);a.sdkProcessingMetadata={dynamicSamplingContext:h,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,r={},n){return this._processEvent(e,r,n).then(o=>o.event_id,o=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=o;i.logLevel==="log"?m.log(i.message):m.warn(i)}})}_processEvent(e,r,n){let o=this.getOptions(),{sampleRate:i}=o,a=as(e),s=is(e),c=e.type||"error",l=`before send for type \`${c}\``;if(s&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),kt(new z(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let u=c==="replay_event"?"replay":c;return this._prepareEvent(e,r,n).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",u,e),new z("An event processor returned `null`, will not send event.","log");if(r.data&&r.data.__sentry__===!0)return d;let h=Lu(o,d,r);return Bu(h,l)}).then(d=>{if(d===null)throw this.recordDroppedEvent("before_send",u,e),new z(`${l} returned \`null\`, will not send event.`,"log");let p=n&&n.getSession();!a&&p&&this._updateSessionFromEvent(p,d);let h=d.transaction_info;if(a&&h&&d.transaction!==e.transaction){let S="custom";d.transaction_info={...h,source:S}}return this.sendEvent(d,r),d}).then(null,d=>{throw d instanceof z?d:(this.captureException(d,{data:{__sentry__:!0},originalException:d}),new z(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
13
- Reason: ${d}`))})}_process(e){this._numProcessing++,e.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,r=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error("Error while sending event:",r)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(r=>{let[n,o]=r.split(":");return{reason:n,category:o,quantity:e[r]}})}};function Bu(t,e){let r=`${e} must return \`null\` or a valid event.`;if(Mt(t))return t.then(n=>{if(!Ee(n)&&n!==null)throw new z(r);return n},n=>{throw new z(`${e} rejected with ${n}`)});if(!Ee(t)&&t!==null)throw new z(r);return t}function Lu(t,e,r){let{beforeSend:n,beforeSendTransaction:o}=t;return is(e)&&n?n(e,r):as(e)&&o?o(e,r):e}function is(t){return t.type===void 0}function as(t){return t.type==="transaction"}function gi(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?m.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let r=b();r.getScope().update(e.initialScope);let o=new t(e);r.bindClient(o)}var Fu=30;function sr(t,e,r=Vo(t.bufferSize||Fu)){let n={},o=a=>r.drain(a);function i(a){let s=[];if(kn(a,(d,p)=>{let h=Bn(p);if(ii(n,h)){let S=ss(d,p);t.recordDroppedEvent("ratelimit_backoff",h,S)}else s.push(d)}),s.length===0)return fe();let c=Fe(a[0],s),l=d=>{kn(c,(p,h)=>{let S=ss(p,h);t.recordDroppedEvent(d,Bn(h),S)})},u=()=>e({body:ti(c,t.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),n=ai(n,d),d),d=>{throw l("network_error"),d});return r.add(u).then(d=>d,d=>{if(d instanceof z)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error("Skipped sending event because buffer is full."),l("queue_overflow"),fe();throw d})}return i.__sentry__baseTransport__=!0,{send:i,flush:o}}function ss(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}var Kr="7.77.0";var Ft={};Ro(Ft,{FunctionToString:()=>St,InboundFilters:()=>yt,LinkedErrors:()=>Lt});var cs,St=class{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=St.id}setupOnce(){cs=Function.prototype.toString;try{Function.prototype.toString=function(...e){let r=wt(this)||this;return cs.apply(r,e)}}catch{}}};St.__initStatic();var Hu=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Uu=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],yt=class{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=yt.id,this._options=e}setupOnce(e,r){}processEvent(e,r,n){let o=n.getOptions(),i=Gu(this._options,o);return Yu(e,i)?null:e}};yt.__initStatic();function Gu(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:Hu],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:Uu],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function Yu(t,e){return e.ignoreInternal&&zu(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Event dropped due to being internal Sentry Error.
14
- Event: ${Ce(t)}`),!0):$u(t,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
15
- Event: ${Ce(t)}`),!0):Wu(t,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
16
- Event: ${Ce(t)}`),!0):Vu(t,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.
11
+ `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let r=this.getStackTop().scope,n=r.getSession();n&&Ga(n),this._sendSessionUpdate(),r.setSession()}startSession(e){let{scope:r,client:n}=this.getStackTop(),{release:o,environment:i=Xt}=n&&n.getOptions()||{},{userAgent:a}=O.navigator||{},s=Ua({release:o,environment:i,user:r.getUser(),...a&&{userAgent:a},...e}),c=r.getSession&&r.getSession();return c&&c.status==="ok"&&tt(c,{status:"exited"}),this.endSession(),r.setSession(s),s}shouldSendDefaultPii(){let e=this.getClient(),r=e&&e.getOptions();return!!(r&&r.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:r}=this.getStackTop(),n=e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}_withClient(e){let{scope:r,client:n}=this.getStackTop();n&&e(n,r)}_callExtensionMethod(e,...r){let o=Bt().__SENTRY__;if(o&&o.extensions&&typeof o.extensions[e]=="function")return o.extensions[e].apply(this,r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function Bt(){return O.__SENTRY__=O.__SENTRY__||{extensions:{},hub:void 0},O}function Fn(t){let e=Bt(),r=jr(e);return ci(e,t),r}function b(){let t=Bt();if(t.__SENTRY__&&t.__SENTRY__.acs){let e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return ad(t)}function ad(t=Bt()){return(!sd(t)||jr(t).isOlderThan($a))&&ci(t,new Qt),jr(t)}function sd(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function jr(t){return Br("hub",()=>new Qt,t)}function ci(t,e){if(!t)return!1;let r=t.__SENTRY__=t.__SENTRY__||{};return r.hub=e,!0}function Ie(t){return(t||b()).getScope().getTransaction()}var Wa=!1;function Va(){Wa||(Wa=!0,H("error",li),H("unhandledrejection",li))}function li(){let t=Ie();if(t){let e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}li.tag="sentry_tracingErrorCallback";var er=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},tr=class{constructor(e={}){this.traceId=e.traceId||D(),this.spanId=e.spanId||D().substring(16),this.startTimestamp=e.startTimestamp||Re(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let r=new tr({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(r.spanRecorder=this.spanRecorder,r.spanRecorder&&r.spanRecorder.add(r),r.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&r.transaction){let n=e&&e.op||"< unknown op >",o=r.transaction.name||"< unknown name >",i=r.transaction.spanId,a=`[Tracing] Starting '${n}' span on transaction '${o}' (${i}).`;r.transaction.metadata.spanMetadata[r.spanId]={logMessage:a},p.log(a)}return r}setTag(e,r){return this.tags={...this.tags,[e]:r},this}setData(e,r){return this.data={...this.data,[e]:r},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let r=ja(e);return r!=="unknown_error"&&this.setStatus(r),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:r}=this.transaction.metadata.spanMetadata[this.spanId];r&&p.log(r.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:Re()}toTraceparent(){return Kt(this.traceId,this.spanId,this.sampled)}toContext(){return ie({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return ie({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return ie({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function ja(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function ht(t,e,r){let n=e.getOptions(),{publicKey:o}=e.getDsn()||{},{segment:i}=r&&r.getUser()||{},a=ie({environment:n.environment||Xt,release:n.release,user_segment:i,public_key:o,trace_id:t});return e.emit&&e.emit("createDsc",a),a}var rr=class extends tr{constructor(e,r){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=r||b(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;let n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,r="custom"){this._name=e,this.metadata.source=r}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new er(e)),this.spanRecorder.add(this)}setContext(e,r){r===null?delete this._contexts[e]:this._contexts[e]=r}setMeasurement(e,r,n=""){this._measurements[e]={value:r,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){let r=this._finishTransaction(e);if(r)return this._hub.captureEvent(r)}toContext(){let e=super.toContext();return ie({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||b(),r=e.getClient();if(!r)return{};let n=e.getScope(),o=ht(this.traceId,r,n),i=this.metadata.sampleRate;i!==void 0&&(o.sample_rate=`${i}`);let a=this.metadata.source;return a&&a!=="url"&&(o.transaction=this.name),this.sampled!==void 0&&(o.sampled=String(this.sampled)),o}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let r=this._hub.getClient();if(r&&r.emit&&r.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),r&&r.recordDroppedEvent("sample_rate","transaction");return}let n=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((s,c)=>s.endTimestamp&&c.endTimestamp?s.endTimestamp>c.endTimestamp?s:c:s).endTimestamp);let o=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...o,dynamicSamplingContext:this.getDynamicSamplingContext()},...o.source&&{transaction_info:{source:o.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}};var or={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},cd="finishReason",nr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],ui=class extends er{constructor(e,r,n,o){super(o),this._pushActivity=e,this._popActivity=r,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=r=>{e.endTimestamp=typeof r=="number"?r:Re(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},qr=class extends rr{constructor(e,r,n=or.idleTimeout,o=or.finalTimeout,i=or.heartbeatInterval,a=!1){super(e,r),this._idleHub=r,this._idleTimeout=n,this._finalTimeout=o,this._heartbeatInterval=i,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=nr[4],a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),r.configureScope(s=>s.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=nr[3],this.finish())},this._finalTimeout)}finish(e=Re()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(cd,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let r of this._beforeFinishCallbacks)r(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanId===this.spanId)return!0;r.endTimestamp||(r.endTimestamp=e,r.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));let n=r.startTimestamp<e,o=(this._finalTimeout+this._idleTimeout)/1e3,i=r.endTimestamp-this.startTimestamp<o;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let a=JSON.stringify(r,void 0,2);n?i||p.log("[Tracing] discarding Span since it finished after Transaction final timeout",a):p.log("[Tracing] discarding Span since it happened after Transaction was finished",a)}return n&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] No active IdleTransaction");if(this._onScope){let r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let r=o=>{this._finished||this._pushActivity(o)},n=o=>{this._finished||this._popActivity(o)};this.spanRecorder=new ui(r,n,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:r}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=r===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=nr[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=nr[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let r=Re();this._idleTimeoutCanceledPermanently?(this._finishReason=nr[5],this.finish(r)):this._restartIdleTimeout(r+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=nr[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function ir(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=b().getClient(),r=t||e&&e.getOptions();return!!r&&(r.enableTracing||"tracesSampleRate"in r||"tracesSampler"in r)}function di(t,e,r){if(!ir(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let n;return typeof e.tracesSampler=="function"?(n=e.tracesSampler(r),t.setMetadata({sampleRate:Number(n)})):r.parentSampled!==void 0?n=r.parentSampled:typeof e.tracesSampleRate<"u"?(n=e.tracesSampleRate,t.setMetadata({sampleRate:Number(n)})):(n=1,t.setMetadata({sampleRate:n})),ld(n)?n?(t.sampled=Math.random()<n,t.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function ld(t){return Mr(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function ud(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function dd(t,e){let r=this.getClient(),n=r&&r.getOptions()||{},o=n.instrumenter||"sentry",i=t.instrumenter||"sentry";o!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${o}\` instrumenter.
12
+ The transaction will not be sampled. Please use the ${o} instrumentation to start transactions.`),t.sampled=!1);let a=new rr(t,this);return a=di(a,n,{parentSampled:t.parentSampled,transactionContext:t,...e}),a.sampled&&a.initSpanRecorder(n._experiments&&n._experiments.maxSpans),r&&r.emit&&r.emit("startTransaction",a),a}function Hn(t,e,r,n,o,i,a){let s=t.getClient(),c=s&&s.getOptions()||{},l=new qr(e,t,r,n,a,o);return l=di(l,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),s&&s.emit&&s.emit("startTransaction",l),l}function Un(){let t=Bt();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=dd),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=ud),Va())}function ar(t,e){return b().captureException(t,{captureContext:e})}function zr(t){b().addBreadcrumb(t)}function Gn(t,e){b().setContext(t,e)}function Yn(t){b().withScope(t)}var fd="7";function pd(t){let e=t.protocol?`${t.protocol}:`:"",r=t.port?`:${t.port}`:"";return`${e}//${t.host}${r}${t.path?`/${t.path}`:""}/api/`}function md(t){return`${pd(t)}${t.projectId}/envelope/`}function gd(t,e){return Mo({sentry_key:t.publicKey,sentry_version:fd,...e&&{sentry_client:`${e.name}/${e.version}`}})}function qa(t,e={}){let r=typeof e=="string"?e:e.tunnel,n=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return r||`${md(t)}?${gd(t,n)}`}function _d(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function za(t,e,r,n){let o=Ln(r),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!n&&e&&{dsn:Le(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Fe(i,[a])}function Za(t,e,r,n){let o=Ln(r),i=t.type&&t.type!=="replay_event"?t.type:"event";_d(t,r&&r.sdk);let a=ri(t,o,n,e);return delete t.sdkProcessingMetadata,Fe(a,[[{type:i},t]])}var Ka=[];function hd(t){let e={};return t.forEach(r=>{let{name:n}=r,o=e[n];o&&!o.isDefaultInstance&&r.isDefaultInstance||(e[n]=r)}),Object.keys(e).map(r=>e[r])}function fi(t){let e=t.defaultIntegrations||[],r=t.integrations;e.forEach(a=>{a.isDefaultInstance=!0});let n;Array.isArray(r)?n=[...e,...r]:typeof r=="function"?n=Fr(r(e)):n=e;let o=hd(n),i=Sd(o,a=>a.name==="Debug");if(i!==-1){let[a]=o.splice(i,1);o.push(a)}return o}function Xa(t,e){let r={};return e.forEach(n=>{n&&pi(t,n,r)}),r}function pi(t,e,r){if(r[e.name]=e,Ka.indexOf(e.name)===-1&&(e.setupOnce(si,b),Ka.push(e.name)),t.on&&typeof e.preprocessEvent=="function"){let n=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,i)=>n(o,i,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){let n=e.processEvent.bind(e),o=Object.assign((i,a)=>n(i,a,t),{id:e.name});t.addEventProcessor(o)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`Integration installed: ${e.name}`)}function Sd(t,e){for(let r=0;r<t.length;r++)if(e(t[r])===!0)return r;return-1}function Qa(t,e,r,n,o){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,s={...e,event_id:e.event_id||r.event_id||D(),timestamp:e.timestamp||et()},c=r.integrations||t.integrations.map(m=>m.name);yd(s,t),Cd(s,c),e.type===void 0&&Ed(s,t.stackParser);let l=n;r.captureContext&&(l=ge.clone(l).update(r.captureContext));let d=fe(s),u=o&&o.getEventProcessors?o.getEventProcessors():[];if(l){if(l.getAttachments){let m=[...r.attachments||[],...l.getAttachments()];m.length&&(r.attachments=m)}d=l.applyToEvent(s,r,u)}else d=Jt([...u,...Vr()],s,r);return d.then(m=>(m&&vd(m),typeof i=="number"&&i>0?bd(m,i,a):m))}function yd(t,e){let{environment:r,release:n,dist:o,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?r:Xt),t.release===void 0&&n!==void 0&&(t.release=n),t.dist===void 0&&o!==void 0&&(t.dist=o),t.message&&(t.message=ke(t.message,i));let a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=ke(a.value,i));let s=t.request;s&&s.url&&(s.url=ke(s.url,i))}var Ja=new WeakMap;function Ed(t,e){let r=O._sentryDebugIds;if(!r)return;let n,o=Ja.get(e);o?n=o:(n=new Map,Ja.set(e,n));let i=Object.keys(r).reduce((a,s)=>{let c,l=n.get(s);l?c=l:(c=e(s),n.set(s,c));for(let d=c.length-1;d>=0;d--){let u=c[d];if(u.filename){a[u.filename]=r[s];break}}return a},{});try{t.exception.values.forEach(a=>{a.stacktrace.frames.forEach(s=>{s.filename&&(s.debug_id=i[s.filename])})})}catch{}}function vd(t){let e={};try{t.exception.values.forEach(n=>{n.stacktrace.frames.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let r=t.debug_meta.images;Object.keys(e).forEach(n=>{r.push({type:"sourcemap",code_file:n,debug_id:e[n]})})}function Cd(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function bd(t,e,r){if(!t)return null;let n={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:Te(o.data,e,r)}}))},...t.user&&{user:Te(t.user,e,r)},...t.contexts&&{contexts:Te(t.contexts,e,r)},...t.extra&&{extra:Te(t.extra,e,r)}};return t.contexts&&t.contexts.trace&&n.contexts&&(n.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(n.contexts.trace.data=Te(t.contexts.trace.data,e,r))),t.spans&&(n.spans=t.spans.map(o=>(o.data&&(o.data=Te(o.data,e,r)),o))),n}var es="Not capturing exception because it's already been captured.",Zr=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=bn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("No DSN provided, client will not send events."),this._dsn){let r=qa(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}}captureException(e,r,n){if(In(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(es);return}let o=r&&r.event_id;return this._process(this.eventFromException(e,r).then(i=>this._captureEvent(i,r,n)).then(i=>{o=i})),o}captureMessage(e,r,n,o){let i=n&&n.event_id,a=qt(e)?this.eventFromMessage(String(e),r,n):this.eventFromException(e,n);return this._process(a.then(s=>this._captureEvent(s,n,o)).then(s=>{i=s})),i}captureEvent(e,r,n){if(r&&r.originalException&&In(r.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(es);return}let o=r&&r.event_id;return this._process(this._captureEvent(e,r,n).then(i=>{o=i})),o}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),tt(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let r=this._transport;return r?this._isClientDoneProcessing(e).then(n=>r.flush(e).then(o=>n&&o)):fe(!0)}close(e){return this.flush(e).then(r=>(this.getOptions().enabled=!1,r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=Xa(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){pi(this,e,this._integrations)}sendEvent(e,r={}){this.emit("beforeSendEvent",e,r);let n=Za(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of r.attachments||[])n=Qo(n,ti(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let o=this._sendEnvelope(n);o&&o.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let r=za(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(r)}recordDroppedEvent(e,r,n){if(this._options.sendClientReports){let o=`${e}:${r}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`Adding outcome: "${o}"`),this._outcomes[o]=this._outcomes[o]+1||1}}on(e,r){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(r)}emit(e,...r){this._hooks[e]&&this._hooks[e].forEach(n=>n(...r))}_updateSessionFromEvent(e,r){let n=!1,o=!1,i=r.exception&&r.exception.values;if(i){o=!0;for(let c of i){let l=c.mechanism;if(l&&l.handled===!1){n=!0;break}}}let a=e.status==="ok";(a&&e.errors===0||a&&n)&&(tt(e,{...n&&{status:"crashed"},errors:e.errors||Number(o||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new U(r=>{let n=0,o=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),r(!0)):(n+=o,e&&n>=e&&(clearInterval(i),r(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,r,n){let o=this.getOptions(),i=Object.keys(this._integrations);return!r.integrations&&i.length>0&&(r.integrations=i),this.emit("preprocessEvent",e,r),Qa(o,e,r,n,this).then(a=>{if(a===null)return a;let{propagationContext:s}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&s){let{traceId:l,spanId:d,parentSpanId:u,dsc:m}=s;a.contexts={trace:{trace_id:l,span_id:d,parent_span_id:u},...a.contexts};let h=m||ht(l,this,n);a.sdkProcessingMetadata={dynamicSamplingContext:h,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,r={},n){return this._processEvent(e,r,n).then(o=>o.event_id,o=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=o;i.logLevel==="log"?p.log(i.message):p.warn(i)}})}_processEvent(e,r,n){let o=this.getOptions(),{sampleRate:i}=o,a=rs(e),s=ts(e),c=e.type||"error",l=`before send for type \`${c}\``;if(s&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),kt(new z(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(e,r,n).then(u=>{if(u===null)throw this.recordDroppedEvent("event_processor",d,e),new z("An event processor returned `null`, will not send event.","log");if(r.data&&r.data.__sentry__===!0)return u;let h=Rd(o,u,r);return Td(h,l)}).then(u=>{if(u===null)throw this.recordDroppedEvent("before_send",d,e),new z(`${l} returned \`null\`, will not send event.`,"log");let m=n&&n.getSession();!a&&m&&this._updateSessionFromEvent(m,u);let h=u.transaction_info;if(a&&h&&u.transaction!==e.transaction){let S="custom";u.transaction_info={...h,source:S}}return this.sendEvent(u,r),u}).then(null,u=>{throw u instanceof z?u:(this.captureException(u,{data:{__sentry__:!0},originalException:u}),new z(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
13
+ Reason: ${u}`))})}_process(e){this._numProcessing++,e.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,r=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error("Error while sending event:",r)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(r=>{let[n,o]=r.split(":");return{reason:n,category:o,quantity:e[r]}})}};function Td(t,e){let r=`${e} must return \`null\` or a valid event.`;if(Mt(t))return t.then(n=>{if(!Ee(n)&&n!==null)throw new z(r);return n},n=>{throw new z(`${e} rejected with ${n}`)});if(!Ee(t)&&t!==null)throw new z(r);return t}function Rd(t,e,r){let{beforeSend:n,beforeSendTransaction:o}=t;return ts(e)&&n?n(e,r):rs(e)&&o?o(e,r):e}function ts(t){return t.type===void 0}function rs(t){return t.type==="transaction"}function mi(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?p.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let r=b();r.getScope().update(e.initialScope);let o=new t(e);r.bindClient(o)}var Id=30;function sr(t,e,r=Wo(t.bufferSize||Id)){let n={},o=a=>r.drain(a);function i(a){let s=[];if(kn(a,(u,m)=>{let h=Bn(m);if(oi(n,h)){let S=ns(u,m);t.recordDroppedEvent("ratelimit_backoff",h,S)}else s.push(u)}),s.length===0)return fe();let c=Fe(a[0],s),l=u=>{kn(c,(m,h)=>{let S=ns(m,h);t.recordDroppedEvent(u,Bn(h),S)})},d=()=>e({body:ei(c,t.textEncoder)}).then(u=>(u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),n=ii(n,u),u),u=>{throw l("network_error"),u});return r.add(d).then(u=>u,u=>{if(u instanceof z)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error("Skipped sending event because buffer is full."),l("queue_overflow"),fe();throw u})}return i.__sentry__baseTransport__=!0,{send:i,flush:o}}function ns(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}var Kr="7.77.0";var Ft={};To(Ft,{FunctionToString:()=>St,InboundFilters:()=>yt,LinkedErrors:()=>Lt});var os,St=class{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=St.id}setupOnce(){os=Function.prototype.toString;try{Function.prototype.toString=function(...e){let r=wt(this)||this;return os.apply(r,e)}}catch{}}};St.__initStatic();var xd=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Nd=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],yt=class{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=yt.id,this._options=e}setupOnce(e,r){}processEvent(e,r,n){let o=n.getOptions(),i=Od(this._options,o);return Pd(e,i)?null:e}};yt.__initStatic();function Od(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:xd],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:Nd],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function Pd(t,e){return e.ignoreInternal&&Bd(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Event dropped due to being internal Sentry Error.
14
+ Event: ${Ce(t)}`),!0):Ad(t,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
15
+ Event: ${Ce(t)}`),!0):Dd(t,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
16
+ Event: ${Ce(t)}`),!0):Md(t,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Event dropped due to being matched by \`denyUrls\` option.
17
17
  Event: ${Ce(t)}.
18
- Url: ${$n(t)}`),!0):ju(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.
18
+ Url: ${$n(t)}`),!0):wd(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`Event dropped due to not being matched by \`allowUrls\` option.
19
19
  Event: ${Ce(t)}.
20
- Url: ${$n(t)}`),!0)}function $u(t,e){return t.type||!e||!e.length?!1:qu(t).some(r=>_t(r,e))}function Wu(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?_t(r,e):!1}function Vu(t,e){if(!e||!e.length)return!1;let r=$n(t);return r?_t(r,e):!1}function ju(t,e){if(!e||!e.length)return!0;let r=$n(t);return r?_t(r,e):!0}function qu(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&m.error(`Could not extract message for event ${Ce(t)}`),e}function zu(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Zu(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function $n(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Zu(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error(`Cannot extract url for event ${Ce(t)}`),null}}var Ku="cause",Xu=5,Lt=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this._key=e.key||Ku,this._limit=e.limit||Xu,this.name=Lt.id}setupOnce(){}preprocessEvent(e,r,n){let o=n.getOptions();kr(si,o.stackParser,o.maxValueLength,this._key,this._limit,e,r)}};Lt.__initStatic();var T=O,_i=0;function hi(){return _i>0}function ff(){_i++,setTimeout(()=>{_i--})}function Et(t,e={},r){if(typeof t!="function")return t;try{let o=t.__sentry_wrapped__;if(o)return o;if(wt(t))return t}catch{return t}let n=function(){let o=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let i=o.map(a=>Et(a,e));return t.apply(this,i)}catch(i){throw ff(),Yn(a=>{a.addEventProcessor(s=>(e.mechanism&&(Zt(s,void 0,void 0),Xe(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),ar(i)}),i}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}catch{}Tn(n,t),Ke(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function Ei(t,e){let r=vi(t,e),n={type:e&&e.name,value:_f(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function mf(t,e,r,n){let i=b().getClient(),a=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:At(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:hf(e,{isUnhandledRejection:n})}]},extra:{__serialized__:wn(e,a)}};if(r){let c=vi(t,r);c.length&&(s.exception.values[0].stacktrace={frames:c})}return s}function Si(t,e){return{exception:{values:[Ei(t,e)]}}}function vi(t,e){let r=e.stacktrace||e.stack||"",n=gf(e);try{return t(r,n)}catch{}return[]}var pf=/Minified React error #\d+;/i;function gf(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(pf.test(t.message))return 1}return 0}function _f(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function ls(t,e,r,n){let o=r&&r.syntheticException||void 0,i=Wn(t,e,o,n);return Xe(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),fe(i)}function ds(t,e,r="info",n,o){let i=n&&n.syntheticException||void 0,a=yi(t,e,i,o);return a.level=r,n&&n.event_id&&(a.event_id=n.event_id),fe(a)}function Wn(t,e,r,n,o){let i;if(jt(e)&&e.error)return Si(t,e.error);if(Sn(e)||Io(e)){let a=e;if("stack"in e)i=Si(t,e);else{let s=a.name||(Sn(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=yi(t,c,r,n),Zt(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return Ar(e)?Si(t,e):Ee(e)||At(e)?(i=mf(t,e,r,o),Xe(i,{synthetic:!0}),i):(i=yi(t,e,r,n),Zt(i,`${e}`,void 0),Xe(i,{synthetic:!0}),i)}function yi(t,e,r,n){let o={message:e};if(n&&r){let i=vi(t,r);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}return o}function hf(t,{isUnhandledRejection:e}){let r=ko(t),n=e?"promise rejection":"exception";return jt(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:At(t)?`Event \`${Sf(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Sf(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function us(t,{metadata:e,tunnel:r,dsn:n}){let o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!r&&!!n&&{dsn:Le(n)}},i=yf(t);return Fe(o,[i])}function yf(t){return[{type:"user_report"},t]}var Vn=class extends Zr{constructor(e){let r=T.SENTRY_SDK_SOURCE||Wo();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${r}:@sentry/browser`,version:Kr}],version:Kr},super(e),e.sendClientReports&&T.document&&T.document.addEventListener("visibilitychange",()=>{T.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,r){return ls(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return ds(this._options.stackParser,e,r,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("SDK not enabled, will not capture user feedback.");return}let r=us(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(r)}_prepareEvent(e,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("Sending outcomes:",e);let r=oi(e,this._options.tunnel&&Le(this._dsn));this._sendEnvelope(r)}};var Xr;function fs(){if(Xr)return Xr;if(Hr(T.fetch))return Xr=T.fetch.bind(T);let t=T.document,e=T.fetch;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r);let n=r.contentWindow;n&&n.fetch&&(e=n.fetch),t.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return Xr=e.bind(T)}function ms(){Xr=void 0}function ps(t,e=fs()){let r=0,n=0;function o(i){let a=i.body.length;r+=a,n++;let s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15,...t.fetchOptions};try{return e(t.url,s).then(c=>(r-=a,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ms(),r-=a,n--,kt(c)}}return sr(t,o)}var Ef=4;function gs(t){function e(r){return new U((n,o)=>{let i=new XMLHttpRequest;i.onerror=o,i.onreadystatechange=()=>{i.readyState===Ef&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",t.url);for(let a in t.headers)Object.prototype.hasOwnProperty.call(t.headers,a)&&i.setRequestHeader(a,t.headers[a]);i.send(r.body)})}return sr(t,e)}var jn="?";var vf=30,Cf=40,bf=50;function Ci(t,e,r,n){let o={filename:t,function:e,in_app:!0};return r!==void 0&&(o.lineno=r),n!==void 0&&(o.colno=n),o}var Tf=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rf=/\((\S*)(?::(\d+))(?::(\d+))\)/,If=t=>{let e=Tf.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){let i=Rf.exec(e[2]);i&&(e[2]=i[1],e[3]=i[2],e[4]=i[3])}let[n,o]=hs(e[1]||jn,e[2]);return Ci(o,n,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},xf=[vf,If],Nf=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Of=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pf=t=>{let e=Nf.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=Of.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],o=e[1]||jn;return[o,n]=hs(o,n),Ci(n,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Df=[bf,Pf],Af=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Mf=t=>{let e=Af.exec(t);return e?Ci(e[2],e[1]||jn,+e[3],e[4]?+e[4]:void 0):void 0},wf=[Cf,Mf];var kf=[xf,Df,wf],_s=xn(...kf),hs=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:jn,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var xe=class{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=xe.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:Bf,onunhandledrejection:Lf}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let r in e){let n=this._installFunc[r];n&&e[r]&&(Uf(r),n(),this._installFunc[r]=void 0)}}};xe.__initStatic();function Bf(){H("error",t=>{let[e,r,n]=Es();if(!e.getIntegration(xe))return;let{msg:o,url:i,line:a,column:s,error:c}=t;if(hi()||c&&c.__sentry_own_request__)return;let l=c===void 0&&oe(o)?Hf(o,i,a,s):Ss(Wn(r,c||o,void 0,n,!1),i,a,s);l.level="error",ys(e,c,l,"onerror")})}function Lf(){H("unhandledrejection",t=>{let[e,r,n]=Es();if(!e.getIntegration(xe))return;let o=t;try{"reason"in t?o=t.reason:"detail"in t&&"reason"in t.detail&&(o=t.detail.reason)}catch{}if(hi()||o&&o.__sentry_own_request__)return!0;let i=qt(o)?Ff(o):Wn(r,o,void 0,n,!0);i.level="error",ys(e,o,i,"onunhandledrejection")})}function Ff(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function Hf(t,e,r,n){let o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=jt(t)?t.message:t,a="Error",s=i.match(o);return s&&(a=s[1],i=s[2]),Ss({exception:{values:[{type:a,value:i}]}},e,r,n)}function Ss(t,e,r,n){let o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(n,10))?void 0:n,u=isNaN(parseInt(r,10))?void 0:r,d=oe(e)&&e.length>0?e:Do();return c.length===0&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),t}function Uf(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`Global Handler attached: ${t}`)}function ys(t,e,r,n){Xe(r,{handled:!1,type:n}),t.captureEvent(r,{originalException:e})}function Es(){let t=b(),e=t.getClient(),r=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,r.stackParser,r.attachStacktrace]}var Gf=["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"],rt=class{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=rt.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&F(T,"setTimeout",vs),this._options.setInterval&&F(T,"setInterval",vs),this._options.requestAnimationFrame&&F(T,"requestAnimationFrame",Yf),this._options.XMLHttpRequest&&"XMLHttpRequest"in T&&F(XMLHttpRequest.prototype,"send",$f);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Gf).forEach(Wf)}};rt.__initStatic();function vs(t){return function(...e){let r=e[0];return e[0]=Et(r,{mechanism:{data:{function:ae(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Yf(t){return function(e){return t.apply(this,[Et(e,{mechanism:{data:{function:"requestAnimationFrame",handler:ae(t)},handled:!1,type:"instrument"}})])}}function $f(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in r&&typeof r[o]=="function"&&F(r,o,function(i){let a={mechanism:{data:{function:o,handler:ae(i)},handled:!1,type:"instrument"}},s=wt(i);return s&&(a.mechanism.data.handler=ae(s)),Et(i,a)})}),t.apply(this,e)}}function Wf(t){let e=T,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(F(r,"addEventListener",function(n){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=Et(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ae(i),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[o,Et(i,{mechanism:{data:{function:"addEventListener",handler:ae(i),target:t},handled:!1,type:"instrument"}}),a])}}),F(r,"removeEventListener",function(n){return function(o,i,a){let s=i;try{let c=s&&s.__sentry_wrapped__;c&&n.call(this,o,c,a)}catch{}return n.call(this,o,s,a)}}))}var qn=1024,nt=class{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=nt.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&H("console",qf),this.options.dom&&H("dom",jf(this.options.dom)),this.options.xhr&&H("xhr",zf),this.options.fetch&&H("fetch",Zf),this.options.history&&H("history",Kf),this.options.sentry){let e=b().getClient();e&&e.on&&e.on("beforeSendEvent",Vf)}}};nt.__initStatic();function Vf(t){b().addBreadcrumb({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:Ce(t)},{event:t})}function jf(t){function e(r){let n,o=typeof t=="object"?t.serializeAttribute:void 0,i=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;i&&i>qn&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`\`dom.maxStringLength\` cannot exceed ${qn}, but a value of ${i} was configured. Sentry will use ${qn} instead.`),i=qn),typeof o=="string"&&(o=[o]);try{let a=r.event;n=Xf(a)?Be(a.target,{keyAttrs:o,maxStringLength:i}):Be(a,{keyAttrs:o,maxStringLength:i})}catch{n="<unknown>"}n.length!==0&&b().addBreadcrumb({category:`ui.${r.name}`,message:n},{event:r.event,name:r.name,global:r.global})}return e}function qf(t){let e={category:"console",data:{arguments:t.args,logger:"console"},level:jo(t.level),message:yn(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)e.message=`Assertion failed: ${yn(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1);else return;b().addBreadcrumb(e,{input:t.args,level:t.level})}function zf(t){let{startTimestamp:e,endTimestamp:r}=t,n=t.xhr[Je];if(!e||!r||!n)return;let{method:o,url:i,status_code:a,body:s}=n,c={method:o,url:i,status_code:a},l={xhr:t.xhr,input:s,startTimestamp:e,endTimestamp:r};b().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function Zf(t){let{startTimestamp:e,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){let n=t.fetchData,o={data:t.error,input:t.args,startTimestamp:e,endTimestamp:r};b().addBreadcrumb({category:"fetch",data:n,level:"error",type:"http"},o)}else{let n={...t.fetchData,status_code:t.response&&t.response.status},o={input:t.args,response:t.response,startTimestamp:e,endTimestamp:r};b().addBreadcrumb({category:"fetch",data:n,type:"http"},o)}}function Kf(t){let e=t.from,r=t.to,n=Gr(T.location.href),o=Gr(e),i=Gr(r);o.path||(o=n),n.protocol===i.protocol&&n.host===i.host&&(r=i.relative),n.protocol===o.protocol&&n.host===o.host&&(e=o.relative),b().addBreadcrumb({category:"navigation",data:{from:e,to:r}})}function Xf(t){return!!t&&!!t.target}var Jf="cause",Qf=5,ot=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=ot.id,this._key=e.key||Jf,this._limit=e.limit||Qf}setupOnce(){}preprocessEvent(e,r,n){let o=n.getOptions();kr(Ei,o.stackParser,o.maxValueLength,this._key,this._limit,e,r)}};ot.__initStatic();var it=class{static __initStatic(){this.id="HttpContext"}constructor(){this.name=it.id}setupOnce(){}preprocessEvent(e){if(!T.navigator&&!T.location&&!T.document)return;let r=e.request&&e.request.url||T.location&&T.location.href,{referrer:n}=T.document||{},{userAgent:o}=T.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...o&&{"User-Agent":o}},a={...e.request,...r&&{url:r},headers:i};e.request=a}};it.__initStatic();var at=class{static __initStatic(){this.id="Dedupe"}constructor(){this.name=at.id}setupOnce(e,r){}processEvent(e){if(e.type)return e;try{if(em(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}};at.__initStatic();function em(t,e){return e?!!(tm(t,e)||rm(t,e)):!1}function tm(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Rs(t,e)||!Ts(t,e))}function rm(t,e){let r=Cs(e),n=Cs(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Rs(t,e)||!Ts(t,e))}function Ts(t,e){let r=bs(t),n=bs(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let o=0;o<n.length;o++){let i=n[o],a=r[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Rs(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Cs(t){return t.exception&&t.exception.values&&t.exception.values[0]}function bs(t){let e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}var xs=[new Ft.InboundFilters,new Ft.FunctionToString,new rt,new nt,new xe,new ot,new at,new it];function bi(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=xs),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),T.SENTRY_RELEASE&&T.SENTRY_RELEASE.id&&(t.release=T.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);let e={...t,stackParser:Lo(t.stackParser||_s),integrations:mi(t),transport:t.transport||(Nn()?ps:gs)};gi(Vn,e),t.autoSessionTracking&&nm()}function Is(t){t.startSession({ignoreDuration:!0}),t.captureSession()}function nm(){if(typeof T.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}let t=b();t.captureSession&&(Is(t),H("history",({from:e,to:r})=>{e===void 0||e===r||Is(b())}))}var Ti={};Ro(Ti,{Breadcrumbs:()=>nt,Dedupe:()=>at,GlobalHandlers:()=>xe,HttpContext:()=>it,LinkedErrors:()=>ot,TryCatch:()=>rt});var R=O;function Ns(){R&&R.document?R.document.addEventListener("visibilitychange",()=>{let t=Ie();if(R.document.hidden&&t){let e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var cr=(t,e,r)=>{let n,o;return i=>{e.value>=0&&(i||r)&&(o=e.value-(n||0),(o||n===void 0)&&(n=e.value,e.delta=o,t(e)))}};var Os=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var om=()=>{let t=R.performance.timing,e=R.performance.navigation.type,r={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(let n in t)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(t[n]-t.navigationStart,0));return r},zn=()=>R.__WEB_VITALS_POLYFILL__?R.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||om()):R.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];var Zn=()=>{let t=zn();return t&&t.activationStart||0};var lr=(t,e)=>{let r=zn(),n="navigate";return r&&(R.document.prerendering||Zn()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:Os(),navigationType:n}};var vt=(t,e,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let n=new PerformanceObserver(o=>{e(o.getEntries())});return n.observe(Object.assign({type:t,buffered:!0},r||{})),n}}catch{}};var Ct=(t,e)=>{let r=n=>{(n.type==="pagehide"||R.document.visibilityState==="hidden")&&(t(n),e&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)};var Ps=t=>{let e=lr("CLS",0),r,n=0,o=[],i=s=>{s.forEach(c=>{if(!c.hadRecentInput){let l=o[0],u=o[o.length-1];n&&o.length!==0&&c.startTime-u.startTime<1e3&&c.startTime-l.startTime<5e3?(n+=c.value,o.push(c)):(n=c.value,o=[c]),n>e.value&&(e.value=n,e.entries=o,r&&r())}})},a=vt("layout-shift",i);if(a){r=cr(t,e);let s=()=>{i(a.takeRecords()),r(!0)};return Ct(s),s}};var Kn=-1,im=()=>R.document.visibilityState==="hidden"&&!R.document.prerendering?0:1/0,am=()=>{Ct(({timeStamp:t})=>{Kn=t},!0)},dr=()=>(Kn<0&&(Kn=im(),am()),{get firstHiddenTime(){return Kn}});var Ds=t=>{let e=dr(),r=lr("FID"),n,o=s=>{s.startTime<e.firstHiddenTime&&(r.value=s.processingStart-s.startTime,r.entries.push(s),n(!0))},i=s=>{s.forEach(o)},a=vt("first-input",i);n=cr(t,r),a&&Ct(()=>{i(a.takeRecords()),a.disconnect()},!0)};var As={},Ms=t=>{let e=dr(),r=lr("LCP"),n,o=a=>{let s=a[a.length-1];if(s){let c=Math.max(s.startTime-Zn(),0);c<e.firstHiddenTime&&(r.value=c,r.entries=[s],n())}},i=vt("largest-contentful-paint",o);if(i){n=cr(t,r);let a=()=>{As[r.id]||(o(i.takeRecords()),i.disconnect(),As[r.id]=!0,n(!0))};return["keydown","click"].forEach(s=>{addEventListener(s,a,{once:!0,capture:!0})}),Ct(a,!0),a}};var Jr={},Xn={},ws,ks,Bs;function Ls(t){return Ri("cls",t,sm,ws)}function Fs(t){return Ri("lcp",t,lm,Bs)}function Hs(t){return Ri("fid",t,cm,ks)}function Qr(t,e){return Us(t,e),Xn[t]||(dm(t),Xn[t]=!0),Gs(t,e)}function Jn(t,e){let r=Jr[t];if(!(!r||!r.length))for(let n of r)try{n(e)}catch(o){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.error(`Error while triggering instrumentation handler.
20
+ Url: ${$n(t)}`),!0)}function Ad(t,e){return t.type||!e||!e.length?!1:kd(t).some(r=>_t(r,e))}function Dd(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?_t(r,e):!1}function Md(t,e){if(!e||!e.length)return!1;let r=$n(t);return r?_t(r,e):!1}function wd(t,e){if(!e||!e.length)return!0;let r=$n(t);return r?_t(r,e):!0}function kd(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&p.error(`Could not extract message for event ${Ce(t)}`),e}function Bd(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Ld(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function $n(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Ld(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error(`Cannot extract url for event ${Ce(t)}`),null}}var Fd="cause",Hd=5,Lt=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this._key=e.key||Fd,this._limit=e.limit||Hd,this.name=Lt.id}setupOnce(){}preprocessEvent(e,r,n){let o=n.getOptions();kr(ai,o.stackParser,o.maxValueLength,this._key,this._limit,e,r)}};Lt.__initStatic();var T=O,gi=0;function _i(){return gi>0}function Qd(){gi++,setTimeout(()=>{gi--})}function Et(t,e={},r){if(typeof t!="function")return t;try{let o=t.__sentry_wrapped__;if(o)return o;if(wt(t))return t}catch{return t}let n=function(){let o=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let i=o.map(a=>Et(a,e));return t.apply(this,i)}catch(i){throw Qd(),Yn(a=>{a.addEventProcessor(s=>(e.mechanism&&(Zt(s,void 0,void 0),Xe(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),ar(i)}),i}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}catch{}Tn(n,t),Ke(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function yi(t,e){let r=Ei(t,e),n={type:e&&e.name,value:nf(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function ef(t,e,r,n){let i=b().getClient(),a=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:Dt(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:of(e,{isUnhandledRejection:n})}]},extra:{__serialized__:wn(e,a)}};if(r){let c=Ei(t,r);c.length&&(s.exception.values[0].stacktrace={frames:c})}return s}function hi(t,e){return{exception:{values:[yi(t,e)]}}}function Ei(t,e){let r=e.stacktrace||e.stack||"",n=rf(e);try{return t(r,n)}catch{}return[]}var tf=/Minified React error #\d+;/i;function rf(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(tf.test(t.message))return 1}return 0}function nf(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function is(t,e,r,n){let o=r&&r.syntheticException||void 0,i=Wn(t,e,o,n);return Xe(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),fe(i)}function as(t,e,r="info",n,o){let i=n&&n.syntheticException||void 0,a=Si(t,e,i,o);return a.level=r,n&&n.event_id&&(a.event_id=n.event_id),fe(a)}function Wn(t,e,r,n,o){let i;if(jt(e)&&e.error)return hi(t,e.error);if(Sn(e)||Ro(e)){let a=e;if("stack"in e)i=hi(t,e);else{let s=a.name||(Sn(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=Si(t,c,r,n),Zt(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return Dr(e)?hi(t,e):Ee(e)||Dt(e)?(i=ef(t,e,r,o),Xe(i,{synthetic:!0}),i):(i=Si(t,e,r,n),Zt(i,`${e}`,void 0),Xe(i,{synthetic:!0}),i)}function Si(t,e,r,n){let o={message:e};if(n&&r){let i=Ei(t,r);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}return o}function of(t,{isUnhandledRejection:e}){let r=wo(t),n=e?"promise rejection":"exception";return jt(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:Dt(t)?`Event \`${af(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function af(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function ss(t,{metadata:e,tunnel:r,dsn:n}){let o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!r&&!!n&&{dsn:Le(n)}},i=sf(t);return Fe(o,[i])}function sf(t){return[{type:"user_report"},t]}var Vn=class extends Zr{constructor(e){let r=T.SENTRY_SDK_SOURCE||$o();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${r}:@sentry/browser`,version:Kr}],version:Kr},super(e),e.sendClientReports&&T.document&&T.document.addEventListener("visibilitychange",()=>{T.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,r){return is(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return as(this._options.stackParser,e,r,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("SDK not enabled, will not capture user feedback.");return}let r=ss(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(r)}_prepareEvent(e,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("Sending outcomes:",e);let r=ni(e,this._options.tunnel&&Le(this._dsn));this._sendEnvelope(r)}};var Xr;function cs(){if(Xr)return Xr;if(Hr(T.fetch))return Xr=T.fetch.bind(T);let t=T.document,e=T.fetch;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r);let n=r.contentWindow;n&&n.fetch&&(e=n.fetch),t.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return Xr=e.bind(T)}function ls(){Xr=void 0}function us(t,e=cs()){let r=0,n=0;function o(i){let a=i.body.length;r+=a,n++;let s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15,...t.fetchOptions};try{return e(t.url,s).then(c=>(r-=a,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ls(),r-=a,n--,kt(c)}}return sr(t,o)}var cf=4;function ds(t){function e(r){return new U((n,o)=>{let i=new XMLHttpRequest;i.onerror=o,i.onreadystatechange=()=>{i.readyState===cf&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",t.url);for(let a in t.headers)Object.prototype.hasOwnProperty.call(t.headers,a)&&i.setRequestHeader(a,t.headers[a]);i.send(r.body)})}return sr(t,e)}var jn="?";var lf=30,uf=40,df=50;function vi(t,e,r,n){let o={filename:t,function:e,in_app:!0};return r!==void 0&&(o.lineno=r),n!==void 0&&(o.colno=n),o}var ff=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pf=/\((\S*)(?::(\d+))(?::(\d+))\)/,mf=t=>{let e=ff.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){let i=pf.exec(e[2]);i&&(e[2]=i[1],e[3]=i[2],e[4]=i[3])}let[n,o]=ps(e[1]||jn,e[2]);return vi(o,n,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},gf=[lf,mf],_f=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,hf=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Sf=t=>{let e=_f.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=hf.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],o=e[1]||jn;return[o,n]=ps(o,n),vi(n,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},yf=[df,Sf],Ef=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vf=t=>{let e=Ef.exec(t);return e?vi(e[2],e[1]||jn,+e[3],e[4]?+e[4]:void 0):void 0},Cf=[uf,vf];var bf=[gf,yf,Cf],fs=xn(...bf),ps=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:jn,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var xe=class{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=xe.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:Tf,onunhandledrejection:Rf}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let r in e){let n=this._installFunc[r];n&&e[r]&&(Nf(r),n(),this._installFunc[r]=void 0)}}};xe.__initStatic();function Tf(){H("error",t=>{let[e,r,n]=_s();if(!e.getIntegration(xe))return;let{msg:o,url:i,line:a,column:s,error:c}=t;if(_i()||c&&c.__sentry_own_request__)return;let l=c===void 0&&oe(o)?xf(o,i,a,s):ms(Wn(r,c||o,void 0,n,!1),i,a,s);l.level="error",gs(e,c,l,"onerror")})}function Rf(){H("unhandledrejection",t=>{let[e,r,n]=_s();if(!e.getIntegration(xe))return;let o=t;try{"reason"in t?o=t.reason:"detail"in t&&"reason"in t.detail&&(o=t.detail.reason)}catch{}if(_i()||o&&o.__sentry_own_request__)return!0;let i=qt(o)?If(o):Wn(r,o,void 0,n,!0);i.level="error",gs(e,o,i,"onunhandledrejection")})}function If(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function xf(t,e,r,n){let o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=jt(t)?t.message:t,a="Error",s=i.match(o);return s&&(a=s[1],i=s[2]),ms({exception:{values:[{type:a,value:i}]}},e,r,n)}function ms(t,e,r,n){let o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(n,10))?void 0:n,d=isNaN(parseInt(r,10))?void 0:r,u=oe(e)&&e.length>0?e:Po();return c.length===0&&c.push({colno:l,filename:u,function:"?",in_app:!0,lineno:d}),t}function Nf(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`Global Handler attached: ${t}`)}function gs(t,e,r,n){Xe(r,{handled:!1,type:n}),t.captureEvent(r,{originalException:e})}function _s(){let t=b(),e=t.getClient(),r=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,r.stackParser,r.attachStacktrace]}var Of=["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"],rt=class{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=rt.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&F(T,"setTimeout",hs),this._options.setInterval&&F(T,"setInterval",hs),this._options.requestAnimationFrame&&F(T,"requestAnimationFrame",Pf),this._options.XMLHttpRequest&&"XMLHttpRequest"in T&&F(XMLHttpRequest.prototype,"send",Af);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Of).forEach(Df)}};rt.__initStatic();function hs(t){return function(...e){let r=e[0];return e[0]=Et(r,{mechanism:{data:{function:ae(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Pf(t){return function(e){return t.apply(this,[Et(e,{mechanism:{data:{function:"requestAnimationFrame",handler:ae(t)},handled:!1,type:"instrument"}})])}}function Af(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in r&&typeof r[o]=="function"&&F(r,o,function(i){let a={mechanism:{data:{function:o,handler:ae(i)},handled:!1,type:"instrument"}},s=wt(i);return s&&(a.mechanism.data.handler=ae(s)),Et(i,a)})}),t.apply(this,e)}}function Df(t){let e=T,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(F(r,"addEventListener",function(n){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=Et(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ae(i),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[o,Et(i,{mechanism:{data:{function:"addEventListener",handler:ae(i),target:t},handled:!1,type:"instrument"}}),a])}}),F(r,"removeEventListener",function(n){return function(o,i,a){let s=i;try{let c=s&&s.__sentry_wrapped__;c&&n.call(this,o,c,a)}catch{}return n.call(this,o,s,a)}}))}var qn=1024,nt=class{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=nt.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&H("console",kf),this.options.dom&&H("dom",wf(this.options.dom)),this.options.xhr&&H("xhr",Bf),this.options.fetch&&H("fetch",Lf),this.options.history&&H("history",Ff),this.options.sentry){let e=b().getClient();e&&e.on&&e.on("beforeSendEvent",Mf)}}};nt.__initStatic();function Mf(t){b().addBreadcrumb({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:Ce(t)},{event:t})}function wf(t){function e(r){let n,o=typeof t=="object"?t.serializeAttribute:void 0,i=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;i&&i>qn&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`\`dom.maxStringLength\` cannot exceed ${qn}, but a value of ${i} was configured. Sentry will use ${qn} instead.`),i=qn),typeof o=="string"&&(o=[o]);try{let a=r.event;n=Hf(a)?Be(a.target,{keyAttrs:o,maxStringLength:i}):Be(a,{keyAttrs:o,maxStringLength:i})}catch{n="<unknown>"}n.length!==0&&b().addBreadcrumb({category:`ui.${r.name}`,message:n},{event:r.event,name:r.name,global:r.global})}return e}function kf(t){let e={category:"console",data:{arguments:t.args,logger:"console"},level:Vo(t.level),message:yn(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)e.message=`Assertion failed: ${yn(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1);else return;b().addBreadcrumb(e,{input:t.args,level:t.level})}function Bf(t){let{startTimestamp:e,endTimestamp:r}=t,n=t.xhr[Je];if(!e||!r||!n)return;let{method:o,url:i,status_code:a,body:s}=n,c={method:o,url:i,status_code:a},l={xhr:t.xhr,input:s,startTimestamp:e,endTimestamp:r};b().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function Lf(t){let{startTimestamp:e,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){let n=t.fetchData,o={data:t.error,input:t.args,startTimestamp:e,endTimestamp:r};b().addBreadcrumb({category:"fetch",data:n,level:"error",type:"http"},o)}else{let n={...t.fetchData,status_code:t.response&&t.response.status},o={input:t.args,response:t.response,startTimestamp:e,endTimestamp:r};b().addBreadcrumb({category:"fetch",data:n,type:"http"},o)}}function Ff(t){let e=t.from,r=t.to,n=Gr(T.location.href),o=Gr(e),i=Gr(r);o.path||(o=n),n.protocol===i.protocol&&n.host===i.host&&(r=i.relative),n.protocol===o.protocol&&n.host===o.host&&(e=o.relative),b().addBreadcrumb({category:"navigation",data:{from:e,to:r}})}function Hf(t){return!!t&&!!t.target}var Uf="cause",Gf=5,ot=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=ot.id,this._key=e.key||Uf,this._limit=e.limit||Gf}setupOnce(){}preprocessEvent(e,r,n){let o=n.getOptions();kr(yi,o.stackParser,o.maxValueLength,this._key,this._limit,e,r)}};ot.__initStatic();var it=class{static __initStatic(){this.id="HttpContext"}constructor(){this.name=it.id}setupOnce(){}preprocessEvent(e){if(!T.navigator&&!T.location&&!T.document)return;let r=e.request&&e.request.url||T.location&&T.location.href,{referrer:n}=T.document||{},{userAgent:o}=T.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...o&&{"User-Agent":o}},a={...e.request,...r&&{url:r},headers:i};e.request=a}};it.__initStatic();var at=class{static __initStatic(){this.id="Dedupe"}constructor(){this.name=at.id}setupOnce(e,r){}processEvent(e){if(e.type)return e;try{if(Yf(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}};at.__initStatic();function Yf(t,e){return e?!!($f(t,e)||Wf(t,e)):!1}function $f(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!vs(t,e)||!Es(t,e))}function Wf(t,e){let r=Ss(e),n=Ss(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!vs(t,e)||!Es(t,e))}function Es(t,e){let r=ys(t),n=ys(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let o=0;o<n.length;o++){let i=n[o],a=r[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function vs(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Ss(t){return t.exception&&t.exception.values&&t.exception.values[0]}function ys(t){let e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}var bs=[new Ft.InboundFilters,new Ft.FunctionToString,new rt,new nt,new xe,new ot,new at,new it];function Ci(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=bs),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),T.SENTRY_RELEASE&&T.SENTRY_RELEASE.id&&(t.release=T.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);let e={...t,stackParser:Bo(t.stackParser||fs),integrations:fi(t),transport:t.transport||(Nn()?us:ds)};mi(Vn,e),t.autoSessionTracking&&Vf()}function Cs(t){t.startSession({ignoreDuration:!0}),t.captureSession()}function Vf(){if(typeof T.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}let t=b();t.captureSession&&(Cs(t),H("history",({from:e,to:r})=>{e===void 0||e===r||Cs(b())}))}var bi={};To(bi,{Breadcrumbs:()=>nt,Dedupe:()=>at,GlobalHandlers:()=>xe,HttpContext:()=>it,LinkedErrors:()=>ot,TryCatch:()=>rt});var R=O;function Ts(){R&&R.document?R.document.addEventListener("visibilitychange",()=>{let t=Ie();if(R.document.hidden&&t){let e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var cr=(t,e,r)=>{let n,o;return i=>{e.value>=0&&(i||r)&&(o=e.value-(n||0),(o||n===void 0)&&(n=e.value,e.delta=o,t(e)))}};var Rs=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var jf=()=>{let t=R.performance.timing,e=R.performance.navigation.type,r={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(let n in t)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(t[n]-t.navigationStart,0));return r},zn=()=>R.__WEB_VITALS_POLYFILL__?R.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||jf()):R.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];var Zn=()=>{let t=zn();return t&&t.activationStart||0};var lr=(t,e)=>{let r=zn(),n="navigate";return r&&(R.document.prerendering||Zn()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:Rs(),navigationType:n}};var vt=(t,e,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let n=new PerformanceObserver(o=>{e(o.getEntries())});return n.observe(Object.assign({type:t,buffered:!0},r||{})),n}}catch{}};var Ct=(t,e)=>{let r=n=>{(n.type==="pagehide"||R.document.visibilityState==="hidden")&&(t(n),e&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)};var Is=t=>{let e=lr("CLS",0),r,n=0,o=[],i=s=>{s.forEach(c=>{if(!c.hadRecentInput){let l=o[0],d=o[o.length-1];n&&o.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(n+=c.value,o.push(c)):(n=c.value,o=[c]),n>e.value&&(e.value=n,e.entries=o,r&&r())}})},a=vt("layout-shift",i);if(a){r=cr(t,e);let s=()=>{i(a.takeRecords()),r(!0)};return Ct(s),s}};var Kn=-1,qf=()=>R.document.visibilityState==="hidden"&&!R.document.prerendering?0:1/0,zf=()=>{Ct(({timeStamp:t})=>{Kn=t},!0)},ur=()=>(Kn<0&&(Kn=qf(),zf()),{get firstHiddenTime(){return Kn}});var xs=t=>{let e=ur(),r=lr("FID"),n,o=s=>{s.startTime<e.firstHiddenTime&&(r.value=s.processingStart-s.startTime,r.entries.push(s),n(!0))},i=s=>{s.forEach(o)},a=vt("first-input",i);n=cr(t,r),a&&Ct(()=>{i(a.takeRecords()),a.disconnect()},!0)};var Ns={},Os=t=>{let e=ur(),r=lr("LCP"),n,o=a=>{let s=a[a.length-1];if(s){let c=Math.max(s.startTime-Zn(),0);c<e.firstHiddenTime&&(r.value=c,r.entries=[s],n())}},i=vt("largest-contentful-paint",o);if(i){n=cr(t,r);let a=()=>{Ns[r.id]||(o(i.takeRecords()),i.disconnect(),Ns[r.id]=!0,n(!0))};return["keydown","click"].forEach(s=>{addEventListener(s,a,{once:!0,capture:!0})}),Ct(a,!0),a}};var Jr={},Xn={},Ps,As,Ds;function Ms(t){return Ti("cls",t,Zf,Ps)}function ws(t){return Ti("lcp",t,Xf,Ds)}function ks(t){return Ti("fid",t,Kf,As)}function Qr(t,e){return Bs(t,e),Xn[t]||(Jf(t),Xn[t]=!0),Ls(t,e)}function Jn(t,e){let r=Jr[t];if(!(!r||!r.length))for(let n of r)try{n(e)}catch(o){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.error(`Error while triggering instrumentation handler.
21
21
  Type: ${t}
22
22
  Name: ${ae(n)}
23
- Error:`,o)}}function sm(){Ps(t=>{Jn("cls",{metric:t}),ws=t})}function cm(){Ds(t=>{Jn("fid",{metric:t}),ks=t})}function lm(){Ms(t=>{Jn("lcp",{metric:t}),Bs=t})}function Ri(t,e,r,n){return Us(t,e),Xn[t]||(r(),Xn[t]=!0),n&&e({metric:n}),Gs(t,e)}function dm(t){let e={};t==="event"&&(e.durationThreshold=0),vt(t,r=>{Jn(t,{entries:r})},e)}function Us(t,e){Jr[t]=Jr[t]||[],Jr[t].push(e)}function Gs(t,e){return()=>{let r=Jr[t];if(!r)return;let n=r.indexOf(e);n!==-1&&r.splice(n,1)}}function Qn(t){return typeof t=="number"&&isFinite(t)}function Ht(t,{startTimestamp:e,...r}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...r})}function $(t){return t/1e3}function $s(){return R&&R.addEventListener&&R.performance}var Ys=0,w={},He,en;function Ws(){let t=$s();if(t&&se){t.mark&&R.performance.mark("sentry-tracing-init");let e=mm(),r=um(),n=fm();return()=>{e(),r(),n()}}return()=>{}}function Vs(){Qr("longtask",({entries:t})=>{for(let e of t){let r=Ie();if(!r)return;let n=$(se+e.startTime),o=$(e.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+o})}})}function js(){Qr("event",({entries:t})=>{for(let e of t){let r=Ie();if(!r)return;if(e.name==="click"){let n=$(se+e.startTime),o=$(e.duration);r.startChild({description:Be(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+o})}}})}function um(){return Ls(({metric:t})=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding CLS"),w.cls={value:t.value,unit:""},en=e)})}function fm(){return Fs(({metric:t})=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding LCP"),w.lcp={value:t.value,unit:"millisecond"},He=e)})}function mm(){return Hs(({metric:t})=>{let e=t.entries.pop();if(!e)return;let r=$(se),n=$(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding FID"),w.fid={value:t.value,unit:"millisecond"},w["mark.fid"]={value:r+n,unit:"second"}})}function qs(t){let e=$s();if(!e||!R.performance.getEntries||!se)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Tracing] Adding & adjusting spans using Performance API");let r=$(se),n=e.getEntries(),o,i;if(n.slice(Ys).forEach(a=>{let s=$(a.startTime),c=$(a.duration);if(!(t.op==="navigation"&&r+s<t.startTimestamp))switch(a.entryType){case"navigation":{gm(t,a,r),o=r+$(a.responseStart),i=r+$(a.requestStart);break}case"mark":case"paint":case"measure":{pm(t,a,s,c,r);let l=dr(),u=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding FP"),w.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding FCP"),w.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let l=a.name.replace(R.location.origin,"");hm(t,a,l,s,c,r);break}}}),Ys=Math.max(n.length-1,0),Sm(t),t.op==="pageload"){typeof o=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding TTFB"),w.ttfb={value:(o-t.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=o&&(w["ttfb.requestTime"]={value:(o-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(s=>{if(!w[s]||r>=t.startTimestamp)return;let c=w[s].value,l=r+$(c),u=Math.abs((l-t.startTimestamp)*1e3),d=u-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Measurements] Normalized ${s} from ${c} to ${u} (${d})`),w[s].value=u});let a=w["mark.fid"];a&&w.fid&&(Ht(t,{description:"first input delay",endTimestamp:a.value+$(w.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:a.value}),delete w["mark.fid"]),"fcp"in w||delete w.cls,Object.keys(w).forEach(s=>{t.setMeasurement(s,w[s].value,w[s].unit)}),ym(t)}He=void 0,en=void 0,w={}}function pm(t,e,r,n,o){let i=o+r,a=i+n;return Ht(t,{description:e.name,endTimestamp:a,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function gm(t,e,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{eo(t,e,n,r)}),eo(t,e,"secureConnection",r,"TLS/SSL","connectEnd"),eo(t,e,"fetch",r,"cache","domainLookupStart"),eo(t,e,"domainLookup",r,"DNS"),_m(t,e,r)}function eo(t,e,r,n,o,i){let a=i?e[i]:e[`${r}End`],s=e[`${r}Start`];!s||!a||Ht(t,{op:"browser",origin:"auto.browser.browser.metrics",description:o||r,startTimestamp:n+$(s),endTimestamp:n+$(a)})}function _m(t,e,r){Ht(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:r+$(e.requestStart),endTimestamp:r+$(e.responseEnd)}),Ht(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:r+$(e.responseStart),endTimestamp:r+$(e.responseEnd)})}function hm(t,e,r,n,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let a={};"transferSize"in e&&(a["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(a["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(a["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus);let s=i+n,c=s+o;Ht(t,{description:r,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:s,data:a})}function Sm(t){let e=R.navigator;if(!e)return;let r=e.connection;r&&(r.effectiveType&&t.setTag("effectiveConnectionType",r.effectiveType),r.type&&t.setTag("connectionType",r.type),Qn(r.rtt)&&(w["connection.rtt"]={value:r.rtt,unit:"millisecond"})),Qn(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Qn(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function ym(t){He&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding LCP Data"),He.element&&t.setTag("lcp.element",Be(He.element)),He.id&&t.setTag("lcp.id",He.id),He.url&&t.setTag("lcp.url",He.url.trim().slice(0,200)),t.setTag("lcp.size",He.size)),en&&en.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log("[Measurements] Adding CLS Data"),en.sources.forEach((e,r)=>t.setTag(`cls.source.${r+1}`,Be(e.node))))}var Ii=["localhost",/^\/(?!\/)/],tn={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Ii,tracePropagationTargets:Ii};function xi(t){let{traceFetch:e,traceXHR:r,tracePropagationTargets:n,tracingOrigins:o,shouldCreateSpanForRequest:i,enableHTTPTimings:a}={traceFetch:tn.traceFetch,traceXHR:tn.traceXHR,...t},s=typeof i=="function"?i:u=>!0,c=u=>bm(u,n||o),l={};e&&H("fetch",u=>{let d=Tm(u,s,c,l);a&&d&&zs(d)}),r&&H("xhr",u=>{let d=Im(u,s,c,l);a&&d&&zs(d)})}function Em(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function zs(t){let e=t.data.url;if(!e)return;let r=Qr("resource",({entries:n})=>{n.forEach(o=>{Em(o)&&o.name.endsWith(e)&&(Cm(o).forEach(a=>t.setData(...a)),setTimeout(r))})})}function vm(t){let e="unknown",r="unknown",n="";for(let o of t){if(o==="/"){[e,r]=t.split("/");break}if(!isNaN(Number(o))){e=n==="h"?"http":n,r=t.split(n)[1];break}n+=o}return n===t&&(e=n),{name:e,version:r}}function Ue(t=0){return((se||performance.timeOrigin)+t)/1e3}function Cm(t){let{name:e,version:r}=vm(t.nextHopProtocol),n=[];return n.push(["network.protocol.version",r],["network.protocol.name",e]),se?[...n,["http.request.redirect_start",Ue(t.redirectStart)],["http.request.fetch_start",Ue(t.fetchStart)],["http.request.domain_lookup_start",Ue(t.domainLookupStart)],["http.request.domain_lookup_end",Ue(t.domainLookupEnd)],["http.request.connect_start",Ue(t.connectStart)],["http.request.secure_connection_start",Ue(t.secureConnectionStart)],["http.request.connection_end",Ue(t.connectEnd)],["http.request.request_start",Ue(t.requestStart)],["http.request.response_start",Ue(t.responseStart)],["http.request.response_end",Ue(t.responseEnd)]]:n}function bm(t,e){return _t(t,e||Ii)}function Tm(t,e,r,n){if(!ir()||!t.fetchData)return;let o=e(t.fetchData.url);if(t.endTimestamp&&o){let p=t.fetchData.__span;if(!p)return;let h=n[p];if(h){if(t.response){h.setHttpStatus(t.response.status);let S=t.response&&t.response.headers&&t.response.headers.get("content-length"),y=parseInt(S);y>0&&h.setData("http.response_content_length",y)}else t.error&&h.setStatus("internal_error");h.finish(),delete n[p]}return}let i=b(),a=i.getScope(),s=i.getClient(),c=a.getSpan(),{method:l,url:u}=t.fetchData,d=o&&c?c.startChild({data:{url:u,type:"fetch","http.method":l},description:`${l} ${u}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(t.fetchData.__span=d.spanId,n[d.spanId]=d),r(t.fetchData.url)&&s){let p=t.args[0];t.args[1]=t.args[1]||{};let h=t.args[1];h.headers=Rm(p,s,a,h,d)}return d}function Rm(t,e,r,n,o){let i=o||r.getSpan(),a=i&&i.transaction,{traceId:s,sampled:c,dsc:l}=r.getPropagationContext(),u=i?i.toTraceparent():Kt(s,void 0,c),d=a?a.getDynamicSamplingContext():l||ht(s,e,r),p=Wr(d),h=typeof Request<"u"&&ue(t,Request)?t.headers:n.headers;if(h)if(typeof Headers<"u"&&ue(h,Headers)){let S=new Headers(h);return S.append("sentry-trace",u),p&&S.append($r,p),S}else if(Array.isArray(h)){let S=[...h,["sentry-trace",u]];return p&&S.push([$r,p]),S}else{let S="baggage"in h?h.baggage:void 0,y=[];return Array.isArray(S)?y.push(...S):S&&y.push(S),p&&y.push(p),{...h,"sentry-trace":u,baggage:y.length>0?y.join(","):void 0}}else return{"sentry-trace":u,baggage:p}}function Im(t,e,r,n){let o=t.xhr,i=o&&o[Je];if(!ir()||o&&o.__sentry_own_request__||!o||!i)return;let a=e(i.url);if(t.endTimestamp&&a){let d=o.__sentry_xhr_span_id__;if(!d)return;let p=n[d];p&&(p.setHttpStatus(i.status_code),p.finish(),delete n[d]);return}let s=b(),c=s.getScope(),l=c.getSpan(),u=a&&l?l.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(u&&(o.__sentry_xhr_span_id__=u.spanId,n[o.__sentry_xhr_span_id__]=u),o.setRequestHeader&&r(i.url))if(u){let d=u&&u.transaction,p=d&&d.getDynamicSamplingContext(),h=Wr(p);Zs(o,u.toTraceparent(),h)}else{let d=s.getClient(),{traceId:p,sampled:h,dsc:S}=c.getPropagationContext(),y=Kt(p,void 0,h),M=S||(d?ht(p,d,c):void 0),N=Wr(M);Zs(o,y,N)}return u}function Zs(t,e,r){try{t.setRequestHeader("sentry-trace",e),r&&t.setRequestHeader($r,r)}catch{}}function Ks(t,e=!0,r=!0){if(!R||!R.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn("Could not initialize routing instrumentation due to invalid location");return}let n=R.location.href,o;e&&(o=t({name:R.location.pathname,startTimestamp:se?se/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),r&&H("history",({to:i,from:a})=>{if(a===void 0&&n&&n.indexOf(i)!==-1){n=void 0;return}a!==i&&(n=void 0,o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Finishing current transaction with op: ${o.op}`),o.finish()),o=t({name:R.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}var Js="BrowserTracing",xm={...or,markBackgroundTransactions:!0,routingInstrumentation:Ks,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...tn},ur=class{constructor(e){this.name=Js,this._hasSetTracePropagationTargets=!1,Un(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...xm,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Ws(),this.options.enableLongTask&&Vs(),this.options._experiments.enableInteractions&&js()}setupOnce(e,r){this._getCurrentHub=r;let o=r().getClient(),i=o&&o.getOptions(),{routingInstrumentation:a,startTransactionOnLocationChange:s,startTransactionOnPageLoad:c,markBackgroundTransactions:l,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:p,enableHTTPTimings:h,_experiments:S}=this.options,y=i&&i.tracePropagationTargets,M=y||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&y&&m.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),a(N=>{let C=this._createRouteTransaction(N);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(C,N,r),C},c,s),l&&Ns(),S.enableInteractions&&this._registerInteractionListener(),xi({traceFetch:u,traceXHR:d,tracePropagationTargets:M,shouldCreateSpanForRequest:p,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let r=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:o,finalTimeout:i,heartbeatInterval:a}=this.options,s=e.op==="pageload",c=s?Xs("sentry-trace"):"",l=s?Xs("baggage"):"",{traceparentData:u,dynamicSamplingContext:d,propagationContext:p}=Jo(c,l),h={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!d?{}:d},trimEnd:!0},S=typeof n=="function"?n(h):h,y=S===void 0?{...h,sampled:!1}:S;y.metadata=y.name!==h.name?{...y.metadata,source:"custom"}:y.metadata,this._latestRouteName=y.name,this._latestRouteSource=y.metadata&&y.metadata.source,y.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Will not send ${y.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.log(`[Tracing] Starting ${y.op} transaction on scope`);let{location:M}=R,N=Hn(r,y,o,i,!0,{location:M},a),C=r.getScope();return s&&u?C.setPropagationContext(p):C.setPropagationContext({traceId:N.traceId,spanId:N.spanId,parentSpanId:N.parentSpanId,sampled:N.sampled}),N.registerBeforeFinishCallback(ce=>{this._collectWebVitals(),qs(ce)}),N}_registerInteractionListener(){let e,r=()=>{let{idleTimeout:n,finalTimeout:o,heartbeatInterval:i}=this.options,a="ui.action.click",s=Ie();if(s&&s.op&&["navigation","pageload"].includes(s.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:l}=R,u={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Hn(c,u,n,o,!0,{location:l},i)};["click"].forEach(n=>{addEventListener(n,r,{once:!1,capture:!0})})}};function Xs(t){let e=Ao(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}var Qs={};T.Sentry&&T.Sentry.Integrations&&(Qs=T.Sentry.Integrations);var fE={...Qs,...Ft,...Ti};var Nm=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Nm.SENTRY_RELEASE={id:"3.1.6--canary.11"};var ec=!1;function Om(){bi({dsn:"https://903950caba7d4802afe6c1e985ad5ebd@o128085.ingest.sentry.io/4504854496149504",release:"3.1.6--canary.11",integrations:[new ur],tracesSampleRate:1}),ec=!0}var _e=t=>(ec||Om(),ar(t));var sc=D(require("react"));var Oi="[Duffel Ancillaries] ",rc="duffel-ancillaries-logger-state",tc=!1,Pm=t=>{localStorage.setItem(rc,t.toString())},nc=()=>localStorage.getItem(rc)==="true",to=t=>{Pm(t),t&&!tc&&console.info(Oi,`
23
+ Error:`,o)}}function Zf(){Is(t=>{Jn("cls",{metric:t}),Ps=t})}function Kf(){xs(t=>{Jn("fid",{metric:t}),As=t})}function Xf(){Os(t=>{Jn("lcp",{metric:t}),Ds=t})}function Ti(t,e,r,n){return Bs(t,e),Xn[t]||(r(),Xn[t]=!0),n&&e({metric:n}),Ls(t,e)}function Jf(t){let e={};t==="event"&&(e.durationThreshold=0),vt(t,r=>{Jn(t,{entries:r})},e)}function Bs(t,e){Jr[t]=Jr[t]||[],Jr[t].push(e)}function Ls(t,e){return()=>{let r=Jr[t];if(!r)return;let n=r.indexOf(e);n!==-1&&r.splice(n,1)}}function Qn(t){return typeof t=="number"&&isFinite(t)}function Ht(t,{startTimestamp:e,...r}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...r})}function $(t){return t/1e3}function Hs(){return R&&R.addEventListener&&R.performance}var Fs=0,w={},He,en;function Us(){let t=Hs();if(t&&se){t.mark&&R.performance.mark("sentry-tracing-init");let e=tp(),r=Qf(),n=ep();return()=>{e(),r(),n()}}return()=>{}}function Gs(){Qr("longtask",({entries:t})=>{for(let e of t){let r=Ie();if(!r)return;let n=$(se+e.startTime),o=$(e.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+o})}})}function Ys(){Qr("event",({entries:t})=>{for(let e of t){let r=Ie();if(!r)return;if(e.name==="click"){let n=$(se+e.startTime),o=$(e.duration);r.startChild({description:Be(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+o})}}})}function Qf(){return Ms(({metric:t})=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding CLS"),w.cls={value:t.value,unit:""},en=e)})}function ep(){return ws(({metric:t})=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding LCP"),w.lcp={value:t.value,unit:"millisecond"},He=e)})}function tp(){return ks(({metric:t})=>{let e=t.entries.pop();if(!e)return;let r=$(se),n=$(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding FID"),w.fid={value:t.value,unit:"millisecond"},w["mark.fid"]={value:r+n,unit:"second"}})}function $s(t){let e=Hs();if(!e||!R.performance.getEntries||!se)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Tracing] Adding & adjusting spans using Performance API");let r=$(se),n=e.getEntries(),o,i;if(n.slice(Fs).forEach(a=>{let s=$(a.startTime),c=$(a.duration);if(!(t.op==="navigation"&&r+s<t.startTimestamp))switch(a.entryType){case"navigation":{np(t,a,r),o=r+$(a.responseStart),i=r+$(a.requestStart);break}case"mark":case"paint":case"measure":{rp(t,a,s,c,r);let l=ur(),d=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding FP"),w.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding FCP"),w.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let l=a.name.replace(R.location.origin,"");ip(t,a,l,s,c,r);break}}}),Fs=Math.max(n.length-1,0),ap(t),t.op==="pageload"){typeof o=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding TTFB"),w.ttfb={value:(o-t.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=o&&(w["ttfb.requestTime"]={value:(o-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(s=>{if(!w[s]||r>=t.startTimestamp)return;let c=w[s].value,l=r+$(c),d=Math.abs((l-t.startTimestamp)*1e3),u=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Measurements] Normalized ${s} from ${c} to ${d} (${u})`),w[s].value=d});let a=w["mark.fid"];a&&w.fid&&(Ht(t,{description:"first input delay",endTimestamp:a.value+$(w.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:a.value}),delete w["mark.fid"]),"fcp"in w||delete w.cls,Object.keys(w).forEach(s=>{t.setMeasurement(s,w[s].value,w[s].unit)}),sp(t)}He=void 0,en=void 0,w={}}function rp(t,e,r,n,o){let i=o+r,a=i+n;return Ht(t,{description:e.name,endTimestamp:a,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function np(t,e,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{eo(t,e,n,r)}),eo(t,e,"secureConnection",r,"TLS/SSL","connectEnd"),eo(t,e,"fetch",r,"cache","domainLookupStart"),eo(t,e,"domainLookup",r,"DNS"),op(t,e,r)}function eo(t,e,r,n,o,i){let a=i?e[i]:e[`${r}End`],s=e[`${r}Start`];!s||!a||Ht(t,{op:"browser",origin:"auto.browser.browser.metrics",description:o||r,startTimestamp:n+$(s),endTimestamp:n+$(a)})}function op(t,e,r){Ht(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:r+$(e.requestStart),endTimestamp:r+$(e.responseEnd)}),Ht(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:r+$(e.responseStart),endTimestamp:r+$(e.responseEnd)})}function ip(t,e,r,n,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let a={};"transferSize"in e&&(a["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(a["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(a["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus);let s=i+n,c=s+o;Ht(t,{description:r,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:s,data:a})}function ap(t){let e=R.navigator;if(!e)return;let r=e.connection;r&&(r.effectiveType&&t.setTag("effectiveConnectionType",r.effectiveType),r.type&&t.setTag("connectionType",r.type),Qn(r.rtt)&&(w["connection.rtt"]={value:r.rtt,unit:"millisecond"})),Qn(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Qn(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function sp(t){He&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding LCP Data"),He.element&&t.setTag("lcp.element",Be(He.element)),He.id&&t.setTag("lcp.id",He.id),He.url&&t.setTag("lcp.url",He.url.trim().slice(0,200)),t.setTag("lcp.size",He.size)),en&&en.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log("[Measurements] Adding CLS Data"),en.sources.forEach((e,r)=>t.setTag(`cls.source.${r+1}`,Be(e.node))))}var Ri=["localhost",/^\/(?!\/)/],tn={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Ri,tracePropagationTargets:Ri};function Ii(t){let{traceFetch:e,traceXHR:r,tracePropagationTargets:n,tracingOrigins:o,shouldCreateSpanForRequest:i,enableHTTPTimings:a}={traceFetch:tn.traceFetch,traceXHR:tn.traceXHR,...t},s=typeof i=="function"?i:d=>!0,c=d=>dp(d,n||o),l={};e&&H("fetch",d=>{let u=fp(d,s,c,l);a&&u&&Ws(u)}),r&&H("xhr",d=>{let u=mp(d,s,c,l);a&&u&&Ws(u)})}function cp(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Ws(t){let e=t.data.url;if(!e)return;let r=Qr("resource",({entries:n})=>{n.forEach(o=>{cp(o)&&o.name.endsWith(e)&&(up(o).forEach(a=>t.setData(...a)),setTimeout(r))})})}function lp(t){let e="unknown",r="unknown",n="";for(let o of t){if(o==="/"){[e,r]=t.split("/");break}if(!isNaN(Number(o))){e=n==="h"?"http":n,r=t.split(n)[1];break}n+=o}return n===t&&(e=n),{name:e,version:r}}function Ue(t=0){return((se||performance.timeOrigin)+t)/1e3}function up(t){let{name:e,version:r}=lp(t.nextHopProtocol),n=[];return n.push(["network.protocol.version",r],["network.protocol.name",e]),se?[...n,["http.request.redirect_start",Ue(t.redirectStart)],["http.request.fetch_start",Ue(t.fetchStart)],["http.request.domain_lookup_start",Ue(t.domainLookupStart)],["http.request.domain_lookup_end",Ue(t.domainLookupEnd)],["http.request.connect_start",Ue(t.connectStart)],["http.request.secure_connection_start",Ue(t.secureConnectionStart)],["http.request.connection_end",Ue(t.connectEnd)],["http.request.request_start",Ue(t.requestStart)],["http.request.response_start",Ue(t.responseStart)],["http.request.response_end",Ue(t.responseEnd)]]:n}function dp(t,e){return _t(t,e||Ri)}function fp(t,e,r,n){if(!ir()||!t.fetchData)return;let o=e(t.fetchData.url);if(t.endTimestamp&&o){let m=t.fetchData.__span;if(!m)return;let h=n[m];if(h){if(t.response){h.setHttpStatus(t.response.status);let S=t.response&&t.response.headers&&t.response.headers.get("content-length"),y=parseInt(S);y>0&&h.setData("http.response_content_length",y)}else t.error&&h.setStatus("internal_error");h.finish(),delete n[m]}return}let i=b(),a=i.getScope(),s=i.getClient(),c=a.getSpan(),{method:l,url:d}=t.fetchData,u=o&&c?c.startChild({data:{url:d,type:"fetch","http.method":l},description:`${l} ${d}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(u&&(t.fetchData.__span=u.spanId,n[u.spanId]=u),r(t.fetchData.url)&&s){let m=t.args[0];t.args[1]=t.args[1]||{};let h=t.args[1];h.headers=pp(m,s,a,h,u)}return u}function pp(t,e,r,n,o){let i=o||r.getSpan(),a=i&&i.transaction,{traceId:s,sampled:c,dsc:l}=r.getPropagationContext(),d=i?i.toTraceparent():Kt(s,void 0,c),u=a?a.getDynamicSamplingContext():l||ht(s,e,r),m=Wr(u),h=typeof Request<"u"&&de(t,Request)?t.headers:n.headers;if(h)if(typeof Headers<"u"&&de(h,Headers)){let S=new Headers(h);return S.append("sentry-trace",d),m&&S.append($r,m),S}else if(Array.isArray(h)){let S=[...h,["sentry-trace",d]];return m&&S.push([$r,m]),S}else{let S="baggage"in h?h.baggage:void 0,y=[];return Array.isArray(S)?y.push(...S):S&&y.push(S),m&&y.push(m),{...h,"sentry-trace":d,baggage:y.length>0?y.join(","):void 0}}else return{"sentry-trace":d,baggage:m}}function mp(t,e,r,n){let o=t.xhr,i=o&&o[Je];if(!ir()||o&&o.__sentry_own_request__||!o||!i)return;let a=e(i.url);if(t.endTimestamp&&a){let u=o.__sentry_xhr_span_id__;if(!u)return;let m=n[u];m&&(m.setHttpStatus(i.status_code),m.finish(),delete n[u]);return}let s=b(),c=s.getScope(),l=c.getSpan(),d=a&&l?l.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(o.__sentry_xhr_span_id__=d.spanId,n[o.__sentry_xhr_span_id__]=d),o.setRequestHeader&&r(i.url))if(d){let u=d&&d.transaction,m=u&&u.getDynamicSamplingContext(),h=Wr(m);Vs(o,d.toTraceparent(),h)}else{let u=s.getClient(),{traceId:m,sampled:h,dsc:S}=c.getPropagationContext(),y=Kt(m,void 0,h),M=S||(u?ht(m,u,c):void 0),N=Wr(M);Vs(o,y,N)}return d}function Vs(t,e,r){try{t.setRequestHeader("sentry-trace",e),r&&t.setRequestHeader($r,r)}catch{}}function js(t,e=!0,r=!0){if(!R||!R.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn("Could not initialize routing instrumentation due to invalid location");return}let n=R.location.href,o;e&&(o=t({name:R.location.pathname,startTimestamp:se?se/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),r&&H("history",({to:i,from:a})=>{if(a===void 0&&n&&n.indexOf(i)!==-1){n=void 0;return}a!==i&&(n=void 0,o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Finishing current transaction with op: ${o.op}`),o.finish()),o=t({name:R.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}var zs="BrowserTracing",gp={...or,markBackgroundTransactions:!0,routingInstrumentation:js,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...tn},dr=class{constructor(e){this.name=zs,this._hasSetTracePropagationTargets=!1,Un(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...gp,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Us(),this.options.enableLongTask&&Gs(),this.options._experiments.enableInteractions&&Ys()}setupOnce(e,r){this._getCurrentHub=r;let o=r().getClient(),i=o&&o.getOptions(),{routingInstrumentation:a,startTransactionOnLocationChange:s,startTransactionOnPageLoad:c,markBackgroundTransactions:l,traceFetch:d,traceXHR:u,shouldCreateSpanForRequest:m,enableHTTPTimings:h,_experiments:S}=this.options,y=i&&i.tracePropagationTargets,M=y||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&y&&p.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),a(N=>{let C=this._createRouteTransaction(N);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(C,N,r),C},c,s),l&&Ts(),S.enableInteractions&&this._registerInteractionListener(),Ii({traceFetch:d,traceXHR:u,tracePropagationTargets:M,shouldCreateSpanForRequest:m,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let r=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:o,finalTimeout:i,heartbeatInterval:a}=this.options,s=e.op==="pageload",c=s?qs("sentry-trace"):"",l=s?qs("baggage"):"",{traceparentData:d,dynamicSamplingContext:u,propagationContext:m}=Xo(c,l),h={...e,...d,metadata:{...e.metadata,dynamicSamplingContext:d&&!u?{}:u},trimEnd:!0},S=typeof n=="function"?n(h):h,y=S===void 0?{...h,sampled:!1}:S;y.metadata=y.name!==h.name?{...y.metadata,source:"custom"}:y.metadata,this._latestRouteName=y.name,this._latestRouteSource=y.metadata&&y.metadata.source,y.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Will not send ${y.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.log(`[Tracing] Starting ${y.op} transaction on scope`);let{location:M}=R,N=Hn(r,y,o,i,!0,{location:M},a),C=r.getScope();return s&&d?C.setPropagationContext(m):C.setPropagationContext({traceId:N.traceId,spanId:N.spanId,parentSpanId:N.parentSpanId,sampled:N.sampled}),N.registerBeforeFinishCallback(ce=>{this._collectWebVitals(),$s(ce)}),N}_registerInteractionListener(){let e,r=()=>{let{idleTimeout:n,finalTimeout:o,heartbeatInterval:i}=this.options,a="ui.action.click",s=Ie();if(s&&s.op&&["navigation","pageload"].includes(s.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&p.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:l}=R,d={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Hn(c,d,n,o,!0,{location:l},i)};["click"].forEach(n=>{addEventListener(n,r,{once:!1,capture:!0})})}};function qs(t){let e=Ao(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}var Zs={};T.Sentry&&T.Sentry.Integrations&&(Zs=T.Sentry.Integrations);var Qy={...Zs,...Ft,...bi};var _p=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};_p.SENTRY_RELEASE={id:"3.1.7"};var Ks=!1;function hp(){Ci({dsn:"https://903950caba7d4802afe6c1e985ad5ebd@o128085.ingest.sentry.io/4504854496149504",release:"3.1.7",integrations:[new dr],tracesSampleRate:1}),Ks=!0}var _e=t=>(Ks||hp(),ar(t));var nc=A(require("react"));var Ni="[Duffel Ancillaries] ",Js="duffel-ancillaries-logger-state",Xs=!1,Sp=t=>{localStorage.setItem(Js,t.toString())},Qs=()=>localStorage.getItem(Js)==="true",to=t=>{Sp(t),t&&!Xs&&console.info(Ni,`
24
24
 
25
25
  Debug mode is enabled. Information about your setup will be printed to the console.
26
26
 
27
27
  If you do not want to enable debug mode (for example in a production environment), pass "debug: false" when initializing this component.
28
28
 
29
29
  Learn more about the Ancillaries component:
30
- http://duffel.com/docs/guides/ancillaries-component`),tc=!0},oc=t=>{nc()?console.info(Oi,t):zr({category:"log",message:t})};function st(t,e){let r=[];Array.isArray(e)?r=e:r=Object.entries(e).map(([n,o])=>({property:n,value:o})),nc()?(console.groupCollapsed(Oi,t),r.forEach(n=>{console.info(n)}),console.groupEnd()):zr({category:"log.group",message:t,data:e})}var v=require("react/jsx-runtime"),ic={add:(0,v.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}),apartment:(0,v.jsx)("path",{d:"M3.8496 19.9752V7.2744H7.4496V3.6744H15.9504V10.8744H20.1504V19.9752H13.4496V16.3752H10.5504V19.9752H3.8496ZM5.1504 18.6744H7.4496V16.3752H5.1504V18.6744ZM5.1504 14.7744H7.4496V12.4752H5.1504V14.7744ZM5.1504 10.8744H7.4496V8.5752H5.1504V10.8744ZM8.7504 14.7744H11.0496V12.4752H8.7504V14.7744ZM8.7504 10.8744H11.0496V8.5752H8.7504V10.8744ZM8.7504 7.2744H11.0496V4.9752H8.7504V7.2744ZM12.3504 14.7744H14.6496V12.4752H12.3504V14.7744ZM12.3504 10.8744H14.6496V8.5752H12.3504V10.8744ZM12.3504 7.2744H14.6496V4.9752H12.3504V7.2744ZM16.5504 18.6744H18.8496V16.3752H16.5504V18.6744ZM16.5504 14.7744H18.8496V12.4752H16.5504V14.7744Z"}),arrow_forward:(0,v.jsx)("path",{d:"M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z"}),arrow_left:(0,v.jsx)("path",{d:"M9 19L2 12L9 5L10.425 6.4L5.825 11H22V13H5.825L10.4 17.6L9 19Z"}),arrow_right:(0,v.jsx)("path",{d:"M15 19L13.6 17.6L18.2 13H2V11H18.2L13.6 6.4L15 5L22 12L15 19Z"}),autorenew:(0,v.jsx)("path",{d:"M5.69728 14.4104C5.49326 13.9833 5.32604 13.5257 5.19562 13.0374C5.06521 12.5492 5 12.0367 5 11.5C5 9.56481 5.69083 7.91679 7.07249 6.55591C8.45416 5.19504 10.147 4.53946 12.1511 4.58918H12.7613L11.0742 2.92359L12.0097 2L15.2869 5.23549L12.0097 8.47099L11.0742 7.54739L12.7613 5.88181H12.1511C10.5021 5.84866 9.11624 6.38632 7.99347 7.49479C6.87069 8.60326 6.30931 9.93833 6.30931 11.5C6.30931 11.8455 6.33804 12.1824 6.3955 12.5106C6.45296 12.8389 6.53915 13.1573 6.65407 13.4658L5.69728 14.4104ZM11.9903 21L8.71309 17.7645L11.9903 14.529L12.9258 15.4526L11.2387 17.1182H11.8489C13.4979 17.1513 14.8838 16.6137 16.0065 15.5052C17.1293 14.3967 17.6907 13.0617 17.6907 11.5C17.6907 11.1545 17.662 10.8176 17.6045 10.4894C17.547 10.1611 17.4609 9.84273 17.3459 9.53421L18.3027 8.58959C18.5067 9.01665 18.674 9.47431 18.8044 9.96256C18.9348 10.4508 19 10.9633 19 11.5C19 13.4186 18.3092 15.0625 16.9275 16.4317C15.5458 17.8008 13.853 18.4605 11.8489 18.4108H11.2387L12.9258 20.0764L11.9903 21Z"}),bassinet:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M19 12C19 14.1217 18.1571 16.1566 16.6569 17.6569C15.1566 19.1571 13.1217 20 11 20C8.87827 20 6.84344 19.1571 5.34315 17.6569C3.84286 16.1566 3 14.1217 3 12L11 12H19Z"}),(0,v.jsx)("path",{d:"M16.1347 5.86529L11 11V4C12.0506 4 13.0909 4.20693 14.0615 4.60896C14.8136 4.92052 15.5125 5.34451 16.1347 5.86529ZM16.8602 6.55405L12.4142 11H18.9373C18.8482 10.293 18.6649 9.59962 18.391 8.93853C18.0264 8.05823 17.5077 7.25087 16.8602 6.55405Z"})]}),cabin_bag:(0,v.jsx)("path",{d:"M7.3077 20.5C6.81058 20.5 6.38502 20.323 6.03102 19.969C5.67701 19.615 5.5 19.1894 5.5 18.6923V8.25007C5.5 7.76417 5.67019 7.35103 6.01057 7.01065C6.35096 6.67027 6.7641 6.50007 7.25 6.50007H9.25V3.6924C9.25 3.43631 9.33622 3.22166 9.50865 3.04842C9.68108 2.87519 9.89773 2.78857 10.1586 2.78857H13.8414C14.1022 2.78857 14.3189 2.87519 14.4913 3.04842C14.6637 3.22166 14.75 3.43631 14.75 3.6924V6.50007H16.6922C17.1894 6.50007 17.6149 6.67708 17.9689 7.0311C18.3229 7.3851 18.5 7.81066 18.5 8.30777V18.6923C18.5 19.1894 18.3229 19.615 17.9689 19.969C17.6149 20.323 17.1894 20.5 16.6922 20.5C16.6922 20.7507 16.6074 20.9608 16.4377 21.1303C16.2681 21.2999 16.0578 21.3846 15.807 21.3846C15.5561 21.3846 15.3461 21.2999 15.1769 21.1303C15.0077 20.9608 14.923 20.7507 14.923 20.5H9.0769C9.0769 20.7513 8.99206 20.9615 8.82237 21.1308C8.65271 21.3 8.44246 21.3846 8.19162 21.3846C7.94079 21.3846 7.73076 21.2999 7.56153 21.1303C7.39231 20.9608 7.3077 20.7507 7.3077 20.5ZM10.4423 6.50007H13.5577V3.98085H10.4423V6.50007ZM7.3077 19H16.6922C16.782 19 16.8557 18.9712 16.9134 18.9135C16.9711 18.8558 17 18.7821 17 18.6923V8.30777C17 8.21802 16.9711 8.1443 16.9134 8.0866C16.8557 8.0289 16.782 8.00005 16.6922 8.00005H7.3077C7.21795 8.00005 7.14423 8.0289 7.08652 8.0866C7.02882 8.1443 6.99997 8.21802 6.99997 8.30777V18.6923C6.99997 18.7821 7.02882 18.8558 7.08652 18.9135C7.14423 18.9712 7.21795 19 7.3077 19ZM8.15382 17.1539C8.15382 17.3261 8.21009 17.4685 8.32262 17.5811C8.43514 17.6937 8.57744 17.75 8.74952 17.75C8.92161 17.75 9.06407 17.6937 9.1769 17.5811C9.28972 17.4685 9.34613 17.3261 9.34613 17.1539V9.8462C9.34613 9.67398 9.28986 9.53157 9.17732 9.41897C9.06481 9.30637 8.92251 9.25007 8.75043 9.25007C8.57834 9.25007 8.43588 9.30637 8.32305 9.41897C8.21023 9.53157 8.15382 9.67398 8.15382 9.8462V17.1539ZM11.4038 17.1539C11.4038 17.3261 11.4601 17.4685 11.5726 17.5811C11.6851 17.6937 11.8274 17.75 11.9995 17.75C12.1716 17.75 12.3141 17.6937 12.4269 17.5811C12.5397 17.4685 12.5961 17.3261 12.5961 17.1539V9.8462C12.5961 9.67398 12.5399 9.53157 12.4273 9.41897C12.3148 9.30637 12.1725 9.25007 12.0004 9.25007C11.8283 9.25007 11.6859 9.30637 11.5731 9.41897C11.4602 9.53157 11.4038 9.67398 11.4038 9.8462V17.1539ZM14.6538 17.1539C14.6538 17.3261 14.7101 17.4685 14.8226 17.5811C14.9351 17.6937 15.0774 17.75 15.2495 17.75C15.4216 17.75 15.5641 17.6937 15.6769 17.5811C15.7897 17.4685 15.8461 17.3261 15.8461 17.1539V9.8462C15.8461 9.67398 15.7899 9.53157 15.6773 9.41897C15.5648 9.30637 15.4225 9.25007 15.2504 9.25007C15.0783 9.25007 14.9359 9.30637 14.823 9.41897C14.7102 9.53157 14.6538 9.67398 14.6538 9.8462V17.1539Z"}),check:(0,v.jsx)("path",{d:"M10.3333 15.8646L7 12.5313L8.0625 11.4688L10.3333 13.7396L15.9375 8.13544L17 9.19794L10.3333 15.8646Z"}),checked_bag:(0,v.jsx)("path",{d:"M22 19H2V21H22V19M4 15C4 15.5 4.2 16 4.6 16.4C5 16.8 5.5 17 6 17V6C5.5 6 5 6.2 4.6 6.6C4.2 7 4 7.5 4 8V15M13.5 6H10.5C10.5 5.6 10.6 5.2 10.9 4.9C11.2 4.6 11.5 4.5 12 4.5C12.4 4.5 12.8 4.6 13.1 4.9C13.3 5.2 13.5 5.6 13.5 6M7 6V17H17V6H15C15 5.2 14.7 4.5 14.1 3.9S12.8 3 12 3C11.2 3 10.5 3.3 9.9 3.9C9.3 4.5 9 5.2 9 6H7M18 17C18.5 17 19 16.8 19.4 16.4C19.8 16 20 15.5 20 15V8C20 7.5 19.8 7 19.4 6.6C19 6.2 18.5 6 18 6V17Z"}),chevron:(0,v.jsx)("path",{d:"M5 13H16.17L11.29 17.88C10.9 18.27 10.9 18.91 11.29 19.3C11.68 19.69 12.31 19.69 12.7 19.3L19.29 12.71C19.68 12.32 19.68 11.69 19.29 11.3L12.71 4.7C12.32 4.31 11.69 4.31 11.3 4.7C10.91 5.09 10.91 5.72 11.3 6.11L16.17 11H5C4.45 11 4 11.45 4 12C4 12.55 4.45 13 5 13Z"}),close:(0,v.jsx)("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}),closet:(0,v.jsx)("path",{d:"M12 4C11.0717 4 10.1815 4.36875 9.52513 5.02513C8.86875 5.6815 8.5 6.57174 8.5 7.5H10.5C10.5 7.10218 10.658 6.72064 10.9393 6.43934C11.2206 6.15804 11.6022 6 12 6C12.3978 6 12.7794 6.15804 13.0607 6.43934C13.342 6.72064 13.5 7.10218 13.5 7.5C13.5 7.89782 13.342 8.27936 13.0607 8.56066C12.7794 8.84196 12.3978 9 12 9C11.45 9 11 9.45 11 10V11.75L2.4 18.2C2.23209 18.3259 2.10807 18.5015 2.04549 18.7018C1.98291 18.9022 1.98495 19.1171 2.05132 19.3162C2.11769 19.5153 2.24502 19.6885 2.41529 19.8112C2.58556 19.934 2.79012 20 3 20H21C21.2099 20 21.4144 19.934 21.5847 19.8112C21.755 19.6885 21.8823 19.5153 21.9487 19.3162C22.0151 19.1171 22.0171 18.9022 21.9545 18.7018C21.8919 18.5015 21.7679 18.3259 21.6 18.2L13 11.75V10.85C13.7216 10.6349 14.3546 10.1927 14.805 9.58919C15.2554 8.98569 15.4991 8.25303 15.5 7.5C15.5 6.57174 15.1313 5.6815 14.4749 5.02513C13.8185 4.36875 12.9283 4 12 4ZM12 13.5L18 18H6L12 13.5Z"}),exit_row:(0,v.jsx)("path",{d:"M20 11H6.83001L9.71001 8.12001C10.1 7.73001 10.1 7.10001 9.71001 6.71001C9.32001 6.32001 8.69001 6.32001 8.30001 6.71001L3.71001 11.3C3.32001 11.69 3.32001 12.32 3.71001 12.71L8.30001 17.3C8.69001 17.69 9.32001 17.69 9.71001 17.3C10.1 16.91 10.1 16.28 9.71001 15.89L6.83001 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11Z"}),exit_row_right:(0,v.jsx)("path",{d:"M4 11H17.17L14.29 8.12001C13.9 7.73001 13.9 7.10001 14.29 6.71001C14.68 6.32001 15.31 6.32001 15.7 6.71001L20.29 11.3C20.68 11.69 20.68 12.32 20.29 12.71L15.7 17.3C15.31 17.69 14.68 17.69 14.29 17.3C13.9 16.91 13.9 16.28 14.29 15.89L17.17 13H4C3.45 13 3 12.55 3 12C3 11.45 3.45 11 4 11Z"}),expand_content:(0,v.jsx)("path",{d:"M5 19V13H7V17H11V19H5ZM17 11V7H13V5H19V11H17Z"}),flight_class:(0,v.jsx)("path",{d:"M14.2596 12.5C13.7737 12.5 13.3606 12.3298 13.0202 11.9894C12.6798 11.649 12.5096 11.2359 12.5096 10.75V6.25C12.5096 5.7641 12.6798 5.35096 13.0202 5.01058C13.3606 4.67019 13.7737 4.5 14.2596 4.5H15.75C16.2359 4.5 16.649 4.67019 16.9894 5.01058C17.3298 5.35096 17.5 5.7641 17.5 6.25V10.75C17.5 11.2359 17.3298 11.649 16.9894 11.9894C16.649 12.3298 16.2359 12.5 15.75 12.5H14.2596ZM14.2596 11H15.75C15.8205 11 15.8798 10.9759 15.9278 10.9279C15.9759 10.8798 16 10.8205 16 10.75V6.25C16 6.17948 15.9759 6.12018 15.9278 6.0721C15.8798 6.02402 15.8205 5.99998 15.75 5.99998H14.2596C14.1891 5.99998 14.1298 6.02402 14.0817 6.0721C14.0336 6.12018 14.0096 6.17948 14.0096 6.25V10.75C14.0096 10.8205 14.0336 10.8798 14.0817 10.9279C14.1298 10.9759 14.1891 11 14.2596 11ZM9.5673 17.5C9.21345 17.5 8.89678 17.398 8.6173 17.1942C8.33782 16.9903 8.14423 16.7198 8.03655 16.3827L5.5 8.02883V4.5H6.99997V7.99998L9.49997 16H17.7596V17.5H9.5673ZM8.25 20.5V19H17.75V20.5H8.25ZM14.2596 5.99998H16H14.0096H14.2596Z"}),flight_takeoff:(0,v.jsx)("path",{d:"M3.77521 20.1498V18.849H20.0748V20.1498H3.77521ZM5.45041 15.2742L2.94961 11.0994L4.05001 10.8246L5.90041 12.399L10.05 11.2998L6.27481 4.89902L7.72561 4.62422L14.1 10.1994L19.4004 8.77382C19.75 8.67462 20.0832 8.72062 20.4 8.91182C20.7168 9.10382 20.9252 9.37462 21.0252 9.72422C21.1084 10.0746 21.0624 10.4038 20.8872 10.7118C20.7128 11.0198 20.4504 11.2242 20.1 11.325L5.45041 15.2742Z"}),galley:(0,v.jsx)("path",{d:"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z"}),lavatory:(0,v.jsx)("path",{d:"M5.5 22v-7.5H4V9c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v5.5H9.5V22h-4zM18 22v-6h3l-2.54-7.63C18.18 7.55 17.42 7 16.56 7h-.12c-.86 0-1.63.55-1.9 1.37L12 16h3v6h3zM7.5 6c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2zm9 0c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2z"}),lie_flat_seat:(0,v.jsx)("path",{d:"M6.16667 12.8333C6.81667 12.8333 7.45834 12.5833 7.95001 12.0833C8.91667 11.0916 8.90001 9.51659 7.91667 8.54992C7.42501 8.07492 6.79167 7.83325 6.16667 7.83325C5.51667 7.83325 4.87501 8.08325 4.38334 8.58325C3.41667 9.57492 3.43334 11.1499 4.41667 12.1166C4.90834 12.5916 5.54167 12.8333 6.16667 12.8333ZM5.57501 9.74992C5.73334 9.59159 5.94167 9.49992 6.16667 9.49992C6.38334 9.49992 6.59167 9.58325 6.75001 9.73325C7.08334 10.0583 7.08334 10.5749 6.76667 10.9083C6.60001 11.0749 6.39167 11.1666 6.16667 11.1666C5.95001 11.1666 5.74167 11.0833 5.58334 10.9333C5.25001 10.5999 5.25001 10.0833 5.57501 9.74992ZM17 7.83325H9.50001V12.8333H20.3333V11.1666C20.3333 9.32492 18.8417 7.83325 17 7.83325ZM11.1667 11.1666V9.49992H17C17.9167 9.49992 18.6667 10.2499 18.6667 11.1666H11.1667ZM3.66667 15.3333H8.66667V16.9999H15.3333V15.3333H20.3333V13.6666H3.66667V15.3333Z"}),minus:(0,v.jsx)("path",{d:"M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1z"}),no_airplane:(0,v.jsx)("path",{d:"M14.6674 10.0001V2.66675C14.6674 1.56008 13.7741 0.666748 12.6674 0.666748C11.5607 0.666748 10.6674 1.56008 10.6674 2.66675V7.57341L21.1074 18.0134L25.3341 19.3334V16.6667L14.6674 10.0001ZM1.33407 5.02675L7.9874 11.6801L0.000732422 16.6667V19.3334L10.6674 16.0001V23.3334L8.00073 25.3334V27.3334L12.6674 26.0001L17.3341 27.3334V25.3334L14.6674 23.3334V18.3601L22.3074 26.0001L24.0007 24.3067L3.0274 3.33341L1.33407 5.02675Z"}),no_bag:(0,v.jsx)("path",{d:"M16.8992 6.12037H14.9392V3.18101C14.9385 2.92148 14.8351 2.67278 14.6516 2.48926C14.4681 2.30574 14.2194 2.20234 13.9599 2.20166H10.0399C9.78034 2.20234 9.53163 2.30574 9.34811 2.48926C9.16459 2.67278 9.06119 2.92148 9.06051 3.18101V6.12037H8.20711L8.34715 6.25804L14.3973 12.0871V9.06102H15.9676V13.6L17.3022 14.8859L18.8592 16.4748V8.08037C18.8579 7.56096 18.6509 7.06322 18.2836 6.69594C17.9164 6.32867 17.4186 6.12173 16.8992 6.12037ZM5.14051 8.09559L3.77173 6.71825L5.00821 5.48945L7.16586 7.6606L13.9581 14.4953L15.8932 16.4426L19.7441 20.3175L20.2279 20.8043L18.9914 22.0331L17.635 20.6683C17.4035 20.7625 17.154 20.8126 16.8992 20.8133C16.904 20.945 16.8822 21.0763 16.8351 21.1993C16.788 21.3224 16.7166 21.4347 16.6251 21.5296C16.5336 21.6244 16.424 21.6999 16.3027 21.7514C16.1814 21.8029 16.051 21.8295 15.9192 21.8295C15.7874 21.8295 15.657 21.8029 15.5357 21.7514C15.4145 21.6999 15.3048 21.6244 15.2133 21.5296C15.1219 21.4347 15.0504 21.3224 15.0034 21.1993C14.9563 21.0763 14.9344 20.945 14.9392 20.8133H9.06051C9.06529 20.945 9.04348 21.0763 8.99638 21.1993C8.94929 21.3224 8.87787 21.4347 8.7864 21.5296C8.69492 21.6244 8.58527 21.6999 8.46399 21.7514C8.34271 21.8029 8.21229 21.8295 8.08051 21.8295C7.94874 21.8295 7.81832 21.8029 7.69703 21.7514C7.57575 21.6999 7.4661 21.6244 7.37463 21.5296C7.28316 21.4347 7.21174 21.3224 7.16464 21.1993C7.11754 21.0763 7.09573 20.945 7.10051 20.8133C6.58222 20.8119 6.08545 20.6059 5.71835 20.24C5.35126 19.8741 5.14357 19.378 5.14051 18.8597V8.09559ZM14.8632 17.8791L14.3973 17.4103V17.8791H14.8632ZM9.596 12.579V17.8791H8.03083V11.004L9.596 12.579ZM10.5302 3.67134H13.4695V6.12295H10.5302V3.67134Z"}),no_seat:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M25.1667 21.9733L23.4733 23.6667L2.5 2.69333L4.19333 1L7.16667 3.97333L16.5267 13.3333L19.1933 16L24.5 21.3067L25.1667 21.9733Z"}),(0,v.jsx)("path",{d:"M7.16667 24H3.16667V16H19.1933L24.5 21.3067V24H20.5V20H7.16667V24ZM27.1667 9.33333H23.1667V13.3333H27.1667V9.33333ZM4.5 9.33333H0.5V13.3333H4.5V9.33333ZM20.3333 13.3333H20.5V2.66667C20.5 1.2 19.3 0 17.8333 0H9.83333C9.05784 0 8.3569 0.335483 7.86848 0.868484L20.3333 13.3333ZM16.5267 13.3333L7.16667 3.97333V13.3333H16.5267Z"})]}),north_east:(0,v.jsx)("path",{d:"M4.69999 19.3C4.51665 19.1167 4.42499 18.8833 4.42499 18.6C4.42499 18.3167 4.51665 18.0833 4.69999 17.9L15.6 7H9.99999C9.71665 7 9.47915 6.90417 9.28749 6.7125C9.09582 6.52083 8.99999 6.28333 8.99999 6C8.99999 5.71667 9.09582 5.47917 9.28749 5.2875C9.47915 5.09583 9.71665 5 9.99999 5H18C18.2833 5 18.5208 5.09583 18.7125 5.2875C18.9042 5.47917 19 5.71667 19 6V14C19 14.2833 18.9042 14.5208 18.7125 14.7125C18.5208 14.9042 18.2833 15 18 15C17.7167 15 17.4792 14.9042 17.2875 14.7125C17.0958 14.5208 17 14.2833 17 14V8.4L6.09999 19.3C5.91665 19.4833 5.68332 19.575 5.39999 19.575C5.11665 19.575 4.88332 19.4833 4.69999 19.3Z"}),seat:(0,v.jsx)("path",{d:"M7.59 5.41012C6.81 4.63012 6.81 3.36012 7.59 2.58012C8.37 1.80012 9.64 1.80012 10.42 2.58012C11.2 3.36012 11.2 4.63012 10.42 5.41012C9.63 6.20012 8.37 6.20012 7.59 5.41012ZM6 16.0001V8.00012C6 7.45012 5.55 7.00012 5 7.00012C4.45 7.00012 4 7.45012 4 8.00012V16.0001C4 18.7601 6.24 21.0001 9 21.0001H14C14.55 21.0001 15 20.5501 15 20.0001C15 19.4501 14.55 19.0001 14 19.0001H9C7.34 19.0001 6 17.6601 6 16.0001ZM19.28 19.3501L15.51 15.5801C15.14 15.2101 14.63 15.0001 14.1 15.0001H11.5V11.3201C12.59 12.2101 14.16 13.0201 15.7 13.3401C16.37 13.4801 17 12.9801 17 12.3001C17 11.7701 16.61 11.3401 16.08 11.2501C14.66 11.0101 13.2 10.2401 12.33 9.28012L10.93 7.73012C10.74 7.52012 10.5 7.35012 10.24 7.23012C9.95 7.09012 9.62 7.00012 9.28 7.00012H9.25C8.01 7.00012 7 8.01012 7 9.25012V15.0001C7 16.6601 8.34 18.0001 10 18.0001H15.07L17.85 20.7801C18.24 21.1701 18.89 21.1701 19.28 20.7801C19.68 20.3901 19.68 19.7501 19.28 19.3501Z"}),seat_paid_indicator:(0,v.jsx)("path",{d:"M11.7686 0.731368C12.7766 -0.276576 14.5 0.437294 14.5 1.86274V10.8C14.5 12.5673 13.0673 14 11.3 14H2.36274C0.937294 14 0.223427 12.2766 1.23137 11.2686L11.7686 0.731368Z"}),shield_with_moon:(0,v.jsx)("path",{d:"M12.525 15.75C13.0814 15.75 13.6269 15.6408 14.1615 15.4222C14.6961 15.2036 15.166 14.8757 15.5711 14.4385C15.6749 14.3244 15.7032 14.2033 15.6557 14.0751C15.6083 13.9469 15.5077 13.8629 15.3538 13.8232C14.7269 13.6783 14.1477 13.4183 13.6163 13.0433C13.0849 12.6683 12.6474 12.1789 12.3038 11.5751C11.9769 11.0046 11.7682 10.393 11.6778 9.74048C11.5874 9.08791 11.6589 8.45458 11.8923 7.84048C11.9525 7.68663 11.9301 7.55586 11.8249 7.44817C11.7198 7.34049 11.5916 7.30332 11.4403 7.33665C10.4442 7.59177 9.65927 8.1142 9.08555 8.90395C8.51185 9.69368 8.225 10.5591 8.225 11.5001C8.225 12.6796 8.64519 13.6828 9.48558 14.5097C10.3259 15.3366 11.3391 15.75 12.525 15.75ZM12 21.4808C9.83716 20.8911 8.04646 19.618 6.62787 17.6616C5.20929 15.7052 4.5 13.518 4.5 11.1001V5.34625L12 2.53857L19.5 5.34625V11.1001C19.5 13.518 18.7907 15.7052 17.3721 17.6616C15.9535 19.618 14.1628 20.8911 12 21.4808ZM12 19.9001C13.7333 19.3501 15.1666 18.2501 16.3 16.6001C17.4333 14.9501 18 13.1167 18 11.1001V6.37507L12 4.1347L5.99997 6.37507V11.1001C5.99997 13.1167 6.56664 14.9501 7.69997 16.6001C8.83331 18.2501 10.2666 19.3501 12 19.9001Z"}),stairs:(0,v.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M18,8h-2.42v3.33H13v3.33h-2.58 V18H6v-2h2.42v-3.33H11V9.33h2.58V6H18V8z"}),warning:(0,v.jsx)("path",{d:"M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM8.21071 9.25592L10.9548 12L8.21071 14.7441L9.38922 15.9226L12.1333 13.1785L14.8774 15.9226L16.0559 14.7441L13.3118 12L16.0559 9.25592L14.8774 8.07741L12.1333 10.8215L9.38922 8.07741L8.21071 9.25592Z"}),wifi:(0,v.jsx)("path",{d:"M2.83333 9.50005L4.49999 11.1667C8.64166 7.02505 15.3583 7.02505 19.5 11.1667L21.1667 9.50005C16.1083 4.44172 7.89999 4.44172 2.83333 9.50005ZM9.49999 16.1667L12 18.6667L14.5 16.1667C13.125 14.7834 10.8833 14.7834 9.49999 16.1667ZM6.16666 12.8334L7.83333 14.5C10.1333 12.2 13.8667 12.2 16.1667 14.5L17.8333 12.8334C14.6167 9.61672 9.39166 9.61672 6.16666 12.8334Z"})},Dm=t=>t in ic?ic[t]:(oc(`The icon "${t}" is missing from ICON_MAP`),null),P=({name:t,size:e,className:r,viewBox:n,style:o})=>(0,v.jsx)("svg",{className:r,width:e||24,height:e||24,viewBox:n||"0 0 24 24","aria-label":t,"data-testid":t,style:{display:"block",fill:"currentColor",...o},children:Dm(t)});var ac=D(Ne());var no=require("react/jsx-runtime"),Am={primary:"button--primary",outlined:"button--outlined",destructive:"button--destructive"},Mm={32:"button--32",40:"button--40",48:"button--48"},ee=({iconBefore:t,variant:e="primary",size:r=40,children:n,className:o,type:i="button",...a})=>(0,no.jsxs)("button",{type:i,className:(0,ac.default)("button",Am[e],Mm[r],o),...a,children:[t&&(0,no.jsx)(P,{className:"duffel-button__icon duffel-button__icon--before",name:t}),n]});var Pi=require("react/jsx-runtime"),fr=({style:t,children:e})=>(0,Pi.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",border:"dashed 1px var(--GREY-300)",borderRadius:"4px",paddingBlock:"32px",...t},children:(0,Pi.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"470px"},children:e})});var Ut=require("react/jsx-runtime"),mr=class extends sc.default.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){_e(e)}render(){return this.state.hasError?(0,Ut.jsxs)(fr,{children:[(0,Ut.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"We ran into an error"}),(0,Ut.jsx)("p",{className:"p1--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:"Please try reloading. If the problem persists reach out to our support team."}),(0,Ut.jsx)("div",{children:(0,Ut.jsx)(ee,{variant:"outlined",iconBefore:"autorenew",onClick:()=>location.reload(),children:"Try again"})})]}):this.props.children}};var Gt=require("react/jsx-runtime"),cc=({height:t,message:e})=>(0,Gt.jsxs)(fr,{style:{minHeight:t},children:[(0,Gt.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"Failed to load extras"}),(0,Gt.jsx)("p",{className:"p2--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:e||"Please try reloading. If the problem persists reach out to our support team."}),(0,Gt.jsx)("div",{children:(0,Gt.jsx)(ee,{variant:"outlined",onClick:()=>location.reload(),iconBefore:"autorenew",children:"Try again"})})]});var pr=t=>t.reduce((e,{id:r,total_amount:n,total_currency:o})=>({[r]:{total_amount:n,total_currency:o},...e}),{});var bt=(t,e,r)=>{if(!t||!e||e.length===0)return 0;let n=pr(t.available_services);return rn(n,e,r)},rn=(t,e,r)=>(e||[]).reduce((n,{quantity:o,id:i})=>{let a=n;return i in t?a+=o*+t[i].total_amount:r?a+=o*wm(i,r):_e(new Error(`The service id (${i}) provided could not be found in neither the offer nor the seat maps.`)),a},0),wm=(t,e)=>{for(let r of e)for(let n of r.cabins)for(let o of n.rows)for(let i of o.sections)for(let a of i.elements)if(a.type==="seat"&&Array.isArray(a.available_services)){let s=a.available_services.find(c=>c.id===t);if(s)return+s.total_amount}return 0};var lc=({baggageSelectedServices:t,seatSelectedServices:e,cfarSelectedServices:r,offer:n,seatMaps:o,passengers:i})=>{let a=[...t||[],...e||[],...r||[]],s=+n.total_amount+bt(n,a,o);return{...n&&{selected_offers:[n.id]},passengers:i,services:km(a),...n&&{payments:[{type:"balance",amount:`${s}`,currency:n.total_currency}]},type:"instant",metadata:{source:"duffel-ancillaries@3.1.6--canary.11"}}},km=t=>Array.isArray(t)?t.filter(({quantity:e})=>e>0).map(({id:e,quantity:r})=>({id:e,quantity:r})):[];var Di=t=>(e,r)=>{let{rate:n,amount:o}=t;return{amount:e*(1+n)+o,currency:r}},Ai="You cannot supply both markup and priceFormatters for the same service.",dc=(t,e)=>{let r={};if(e&&(e.bags&&(r.bags=e.bags),e.seats&&(r.seats=e.seats),e.cancel_for_any_reason&&(r.cancel_for_any_reason=e.cancel_for_any_reason)),t){if(t.bags){if(e&&e.bags)throw new Error(Ai);r.bags=Di(t.bags)}if(t.seats){if(e&&e.seats)throw new Error(Ai);r.seats=Di(t.seats)}if(t.cancel_for_any_reason){if(e&&e.cancel_for_any_reason)throw new Error(Ai);r.cancel_for_any_reason=Di(t.cancel_for_any_reason)}}return r};var oo=t=>t.type==="baggage";var gr=t=>t.type==="cancel_for_any_reason";var Bm=(t,e)=>`${t} must all have the same currency, but they have ${e.size} different currencies (${[...e].join(", ")}). Check the price formatters passed into the component's render function.`,uc=(t,e)=>{if(!e)return t;let r=t.available_services,n=new Set,o={baggage:e?.bags,cancel_for_any_reason:e?.cancel_for_any_reason},i=r.map(a=>{let s={...a};if(a.type in o&&o[a.type]){let{total_amount:c,total_currency:l}=a;if(oo(a)){let{amount:u,currency:d}=o[a.type](+a.total_amount,a.total_currency,a);c=u.toString(),d&&(l=d)}if(gr(a)){let{amount:u,currency:d}=o[a.type](+a.total_amount,a.total_currency,a);c=u.toString(),d&&(l=d)}if(n.add(l),n.size>1)throw new Error(Bm(a.type,n));s.total_amount=c,s.total_currency=l}return s});return{...t,available_services:i}};function io(t){return t.type==="seat"}var Lm=t=>`Seats must all have the same currency, but they have ${t.size} different currencies (${[...t].join(", ")}). Check the price formatters passed into the component's render function.`,Fm=(t,e,r)=>{let n={...t};if(io(n)&&n.available_services.length>0){let o=n.available_services.map(i=>{let a={...i},{amount:s,currency:c}=e(+i.total_amount,i.total_currency,i);if(a.total_amount=s.toString(),c&&(a.total_currency=c,r.add(c),r.size>1))throw new Error(Lm(r));return a});n.available_services=o}return n},fc=(t,e)=>{if(!e)return t;let r=new Set;return t.map(o=>{let i=o.cabins.map(a=>{let s=a.rows.map(c=>{let l=c.sections.map(u=>{let d=u.elements.map(p=>Fm(p,e,r));return{...u,elements:d}});return{...c,sections:l}});return{...a,rows:s}});return{...o,cabins:i}})};var ao=t=>{let e=t.split(", ").map(n=>parseInt(n));return(.2126*e[0]+.7152*e[1]+.0722*e[2])/255>.5};var mc=t=>"selected_offers"in t&&"passengers"in t&&"services"in t&&"payments"in t&&"type"in t&&"metadata"in t;var pc=t=>t.expires_at&&new Date(t.expires_at)<new Date;var nn=t=>"data"in t&&Array.isArray(t.data.errors),Hm="https://api.duffel.com",Um="3.1.6--canary.11";async function so(t,e,r="GET",n){st("Making request to the Duffel API",{path:e,method:r});let o=`${Hm}/ancillaries-component/${e}`,i=null;try{i=await fetch(o,{method:r,body:n,headers:{"Duffel-Version":"v1",Authorization:`Bearer ${t}`,"User-Agent":`Duffel/ancillaries-component@${Um}`}})}catch(s){throw st("Failed to make request to the Duffel API",{error:s}),s}let a=await i.json();if(Array.isArray(a.errors))throw st("Request to the Duffel API failed",{operation:`${r} ${o}`,method:r,request_id:a?.meta?.request_id,errors:a.errors,status:i.status}),{...i,data:a};return st("Request to the Duffel succeeded",{request_id:a?.meta?.request_id}),a}var gc="https://assets.duffel.com/components/3.1.6--canary.11",_c=async t=>await(await fetch(gc+`/fixtures/offers/${t}.json`)).json(),hc=async t=>await(await fetch(gc+`/fixtures/seat-maps/${t}.json`)).json();var co=t=>t.startsWith("fixture_off_");async function Sc(t,e){return(await so(e,`offers/${t}?return_available_services=true`)).data}async function yc(t,e,r,n,o){n(!0);let i=co(t);if(t=i?t.replace("fixture_",""):t,i)return _c(t).then(a=>{n(!1),o(a)});if(!e)throw new Error("Attempted to retrieve seat maps but the client key is missing.");try{let a=await Sc(t,e);o(a)}catch(a){let s="An unknown error occurred while retrieving the offer.";a instanceof Error?(s=a.message,a.message.includes("Load failed")&&(s="The Duffel API is not available. Please try again later.")):nn(a)&&a.status===404&&(s="The offer you are looking for does not exist or has expired."),nn(a)&&a.status>=500&&a.status<600&&_e(new Error(s)),r(s)}finally{n(!1)}}async function Ec(t,e){return(await so(e,`offers/${t}/seat_maps`)).data}async function vc(t,e,r,n,o){n(!0);let i=co(t);if(t=i?t.replace("fixture_",""):t,i)return hc(t).then(a=>{n(!1),o(a)});if(!e)throw new Error("Attemptted to retrieve seat maps but the client key is missing.");try{let a=await Ec(t,e);o(a)}catch(a){let s="An unknown error occurred while retrieving the seat maps.";a instanceof Error?(s=a.message,a.message.includes("Load failed")&&(s="The Duffel API is not available. Please try again later.")):nn(a)&&(s=a.data.errors[0]?.message||"Received an unknown error from the Duffel API."),_e(new Error(s)),r()}finally{n(!1)}}var Mi=t=>Gm(t)&&(wi(t)||ki(t)||Bi(t)||Li(t)),Gm=t=>"onPayloadReady"in t&&"passengers"in t&&"services"in t,wi=t=>"offer_id"in t&&t.offer_id.startsWith("fixture_"),ki=t=>"offer_id"in t&&"client_key"in t,Bi=t=>"offer"in t&&"seat_maps"in t,Li=t=>"offer"in t&&"client_key"in t;var me=D(require("react"));var Cc=require("react/jsx-runtime"),_r=()=>(0,Cc.jsx)("span",{className:"textual-loading-indicator","aria-hidden":"true"});var bc=require("react/jsx-runtime"),ct=({backgroundColor:t,color:e,children:r})=>(0,bc.jsx)("div",{style:{backgroundColor:t,color:e,padding:"2px 8px",whiteSpace:"nowrap",borderRadius:"4px",fontWeight:"600",fontSize:"14px",lineHeight:"20px",textAlign:"center"},children:r});var hr=(t,e)=>{if(t.available_services.length===0)throw new Error("No services available");let r=t.available_services.find(n=>n.type===e);if(!r)throw new Error(`No ${e} services available`);return r.total_currency};var Ge=t=>(t||[]).reduce((e,{quantity:r})=>e+r,0);var Ym={baggage:oo,cancel_for_any_reason:gr},Sr=(t,e)=>{let r=Ym[e];if(!r)throw new Error(`Unknown service type: ${e}`);return t&&Array.isArray(t.available_services)&&t.available_services.some(n=>r(n)&&n.maximum_quantity>0)};var G=(t,e="en-GB",r={})=>n=>{try{let i=new Intl.NumberFormat(e,{style:"currency",currency:t,...r}).format(n);return r&&r.signDisplay&&(r.signDisplay==="always"||r.signDisplay==="exceptZero"&&n!==0)?i.replace(/^([+-])/,"$1 "):i}catch{return`${n} ${t}`}};var Oe=(t,e,r)=>t==1?`${t} ${e}`:`${t} ${r}`;var Gc=D(require("react"));var Tc=D(Ne()),Rc=D(require("react"));var he=require("react/jsx-runtime"),yr=({buttonTitle:t,title:e,icon:r,copy:n,onClick:o,children:i,isLoading:a,disabled:s,isSelected:c})=>{let l=Rc.Children.toArray(i).length>0;return(0,he.jsxs)("button",{title:t,...o&&{onClick:o},disabled:s,className:(0,Tc.default)("ancillary-card",a&&"ancillary-card--loading"),style:{cursor:"pointer",background:"transparent",color:"var(--GREY-900)",border:"solid 1px rgba(226, 226, 232, 1)",display:"flex",rowGap:"4px",padding:"20px",borderRadius:"8px",justifyContent:"space-between",flexWrap:"wrap",flexDirection:"column",width:"100%",boxSizing:"border-box",fontSize:"16px",fontWeight:"400",lineHeight:"24px",letterSpacing:"0em",transition:"border-color 0.3s var(--TRANSITION-CUBIC-BEZIER) background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)"},children:[(0,he.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",marginBlock:"0",textAlign:"start",marginTop:"2px",columnGap:"12px",width:"100%"},children:[(0,he.jsx)("div",{children:c?(0,he.jsx)(P,{name:"check",className:"ancillary-card__selected-icon"}):(0,he.jsx)(P,{name:r})}),(0,he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",width:"100%"},children:[(0,he.jsx)("p",{className:"p1--semibold",style:{marginBlock:"0"},children:e}),(0,he.jsx)("div",{className:"ancillary-card__children",children:l?i:(0,he.jsx)(P,{name:"expand_content",className:"ancillary-card__expand-icon"})})]})]}),(0,he.jsx)("p",{className:"p1--regular",style:{textAlign:"start",color:"var(--GREY-600)",marginLeft:"34px",marginBlock:"0"},children:n})]})};var Fi=t=>{t?document.body.style.overflow="":document.body.style.overflow="hidden"};var xc=D(Ne()),Nc=D(require("react"));var Ic=D(Ne());var Hi=require("react/jsx-runtime"),$m={primary:"icon-button--primary",outlined:"icon-button--outlined"},on=({icon:t,variant:e="primary",className:r,...n})=>(0,Hi.jsx)("button",{type:"button",className:(0,Ic.default)("icon-button",$m[e],r),...n,children:(0,Hi.jsx)(P,{name:t})});var Er=require("react/jsx-runtime"),vr=({children:t,onClose:e,isOpen:r})=>(Nc.useEffect(()=>(Fi(!r),()=>Fi(!0)),[r]),(0,Er.jsx)("div",{className:(0,xc.default)("modal",r&&"modal--open"),style:{opacity:0},children:(0,Er.jsxs)("div",{role:"presentation",className:"modal--content",children:[t,(0,Er.jsx)(on,{icon:"close",onClick:e,title:"Close modal",className:"modal--close-button"})]})})),Cr=({children:t})=>(0,Er.jsx)("div",{className:"modal-body",children:t});var lo=t=>t.reduce((e,r)=>({[r.id]:r,...e}),{});var uo=t=>t.slices.reduce((e,r)=>[...e,...r.segments],new Array);var po=D(require("react"));var fo=(t,e,r)=>t?t.given_name&&t.family_name?`${t.given_name} ${t.family_name}`:t.given_name?t.given_name:t.family_name?t.family_name:e?.given_name&&e?.family_name?`${e.given_name} ${e.family_name}`:e?.given_name?e.given_name:e?.family_name?e.family_name:`Passenger ${r}`:`Passenger ${r}`;var Oc=t=>{if(!t)return _e(new Error("getBaggageServiceDescription was not given any metadata")),null;if(!t.maximum_weight_kg&&!t.maximum_length_cm&&!t.maximum_height_cm&&!t.maximum_depth_cm)return null;let e=t.maximum_length_cm&&t.maximum_height_cm&&t.maximum_depth_cm,r="";e&&(r=` / ${t.maximum_height_cm} x ${t.maximum_length_cm} x ${t.maximum_depth_cm} cm`);let n="";return t.maximum_weight_kg&&(n=`Up to ${t.maximum_weight_kg}kg`),`${n}${r}`};var Pc=(t,e,r,n)=>t.some(o=>o.id===n.id||o.serviceInformation?.type!=="carry_on"&&o.serviceInformation?.type!=="checked"||o.serviceInformation?.segmentId!==e||o.serviceInformation?.passengerId!==r?!1:o.serviceInformation?.type===n.metadata.type);var br=require("react/jsx-runtime"),Dc=({id:t,min:e,max:r,value:n,onChange:o})=>(0,br.jsxs)("div",{className:"counter",id:t,children:[(0,br.jsx)(on,{icon:"minus",title:"Remove one",id:`${t}-minus`,"data-testid":`${t}-minus`,variant:"outlined",disabled:n<=e,onClick:()=>o(Math.max(n-1,e))}),(0,br.jsx)("div",{className:"counter__count-label",children:n}),(0,br.jsx)(on,{icon:"add",title:"Add one",id:`${t}-plus`,"data-testid":`${t}-plus`,variant:"outlined",disabled:n>=r,onClick:()=>o(Math.min(n+1,r))})]});var lt=require("react/jsx-runtime"),Ac=({segmentId:t,passengerId:e,availableService:r,quantity:n,onQuantityChanged:o,selectedServices:i})=>{let a=r.metadata.type==="carry_on"?"Cabin bag":"Checked bag",s=G(r.total_currency)(+r.total_amount),c=Oc(r.metadata),l=Pc(i,t,e,r);return(0,lt.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,lt.jsxs)("div",{children:[(0,lt.jsxs)("p",{style:{margin:0},className:"p2--regular",children:[a,(0,lt.jsx)("span",{style:{marginInline:"4px",color:"var(--GREY-400)"},children:"\u2022"}),(0,lt.jsx)("span",{className:"p2--semibold","data-testid":`price-label--${r.id}--${e}`,children:s})]}),(0,lt.jsx)("p",{style:{margin:0,color:"var(--GREY-600)"},className:"p3--regular",children:c})]}),(0,lt.jsx)(Dc,{id:`counter--${r.id}--${e}`,min:0,value:n,onChange:o,max:l?0:r.maximum_quantity})]})};var wc=require("react/jsx-runtime"),Mc=({includedBaggage:t})=>{let{carryOnBagsQuantity:e,checkedBagsQuantity:r}=t.reduce((o,{type:i,quantity:a})=>({carryOnBagsQuantity:o.carryOnBagsQuantity+(i==="carry_on"?a:0),checkedBagsQuantity:o.checkedBagsQuantity+(i==="checked"?a:0)}),{carryOnBagsQuantity:0,checkedBagsQuantity:0}),n=new Array;return e>0&&n.push(Oe(e,"cabin bag","cabin bags")),r>0&&n.push(Oe(r,"checked bag","checked bags")),(0,wc.jsxs)("div",{style:{marginBlock:"8px",padding:"8px 12px",color:" var(--GREEN-300)",backgroundColor:" var(--GREEN-100)",borderRadius:"6px"},className:"p2--regular",children:[n.join(" and ")," included with ticket"]})};var Tt=require("react/jsx-runtime"),kc=({segmentId:t,passengerId:e,passengerName:r,includedBaggage:n,passengerServicesForSegment:o,selectedServices:i,setSelectedServices:a})=>{let s=n.reduce((c,l)=>c+l.quantity,0);return(0,Tt.jsxs)("div",{style:{marginTop:"24px"},children:[(0,Tt.jsx)("h3",{style:{margin:0},className:"p1--semibold",children:r}),s?(0,Tt.jsx)(Mc,{includedBaggage:n}):null,(0,Tt.jsx)("div",{style:{display:"flex",rowGap:"8px",flexDirection:"column"},children:o.map(c=>(0,Tt.jsx)(Ac,{passengerId:e,segmentId:t,availableService:c,selectedServices:i,quantity:i.find(({id:l})=>l==c.id)?.quantity||0,onQuantityChanged:l=>Wm(l,t,e,r,c,i,a)},c.id))}),o.length===0&&(0,Tt.jsx)("p",{style:{color:"var(--GREY-700)",margin:0},children:"Extra baggage is not available for this passenger on this flight"})]})},Wm=(t,e,r,n,o,i,a)=>{let s=i.findIndex(({id:l})=>o.id===l),c=Array.from(i);s<0?c.push({id:o.id,quantity:t,serviceInformation:{segmentId:e,passengerId:r,passengerName:n,total_amount:o.total_amount,total_currency:o.total_currency,...o.metadata}}):c[s].quantity=t,a(c.filter(({quantity:l})=>l!==0))};var Ui=require("react/jsx-runtime"),Bc=({offer:t,segment:e,passengersById:r,selectedServices:n,setSelectedServices:o})=>(0,Ui.jsx)(Cr,{children:e.passengers.map(({passenger_id:i,baggages:a},s)=>(0,Ui.jsx)(kc,{segmentId:e.id,passengerId:i,passengerName:fo(r[i],t.passengers.find(({id:c})=>c===i),s+1),includedBaggage:a,passengerServicesForSegment:t.available_services.filter(({type:c,passenger_ids:l,segment_ids:u})=>c==="baggage"&&l.includes(i)&&u.includes(e.id)),selectedServices:n,setSelectedServices:o},i))});var dt=require("react/jsx-runtime"),Lc=({selectedServices:t,servicePrices:e,currency:r,isFirstSegment:n,isLastSegment:o,onNextSegmentButtonClicked:i,onPreviousSegmentButtonClicked:a,onClose:s})=>{let c=Ge(t),l=rn(e,t),u=G(r)(l),d=n&&n;return(0,dt.jsxs)("div",{style:{padding:"16px 24px 24px"},children:[(0,dt.jsxs)("div",{className:"flex--space-between",children:[(0,dt.jsxs)("div",{children:["Price for ",Oe(c,"extra bag","extra bags")]}),(0,dt.jsxs)("div",{className:"h3--semibold","data-testid":"baggage-total-amount-label",children:["+ ",u]})]}),(0,dt.jsxs)("div",{style:d?{marginTop:"16px",display:"grid"}:{marginTop:"16px",display:"grid",columnGap:"12px",gridTemplateColumns:"repeat(2, 1fr)"},children:[!d&&(0,dt.jsx)(ee,{size:48,variant:"outlined",disabled:n,onClick:()=>a(),children:"Back"}),(0,dt.jsx)(ee,{size:48,"data-testid":"confirm-selection-for-baggage",onClick:()=>o?s():i(),children:o?"Confirm":"Next"})]})]})};var mo=t=>{let e=new Date(t);if(isNaN(e.valueOf()))_e(new Error(`formatDateString attempted to parse an invalid date string: ${t}`));else return Vm(e)},Vm=t=>{let{format:e}=new Intl.DateTimeFormat(void 0,{dateStyle:"medium"});return e(t)};var Ye=require("react/jsx-runtime"),Fc=({segmentCount:t,currentSegmentIndex:e,currentSegment:r,setCurrentSegmentIndex:n})=>(0,Ye.jsxs)("div",{style:{padding:"24px 24px 16px"},children:[t>1&&(0,Ye.jsx)("div",{style:{display:"flex",columnGap:"4px"},children:Array(t).fill(0).map((o,i)=>i===e?(0,Ye.jsx)(jm,{},`segment_${i}`):(0,Ye.jsx)(Hc,{onClick:()=>n(i)},`segment_${i}`))}),(0,Ye.jsxs)("h2",{className:"h3--semibold",style:t>1?{marginTop:"12px"}:{},children:["Flight to ",r.destination.iata_code,(0,Ye.jsx)("span",{className:"p2--regular",style:{color:"var(--GREY-600)",marginLeft:"8px"},children:mo(r.departing_at)})]})]}),Hc=({onClick:t,style:e})=>(0,Ye.jsx)("button",{onClick:t,style:{border:"none",width:"4px",height:"4px",padding:"0",borderRadius:"4px",backgroundColor:"var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)))",transition:"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)",...e}}),jm=()=>(0,Ye.jsx)(Hc,{onClick:void 0,style:{backgroundColor:"var(--SECONDARY, rgb(var(--ACCENT)))"}});var Tr=require("react/jsx-runtime"),Uc=({isOpen:t,offer:e,passengers:r,onClose:n,selectedServices:o})=>{let[i,a]=(0,po.useState)(0),[s,c]=po.default.useState(o);if(!e)return null;let l=uo(e),u=l[i],d=lo(r),p=pr(e.available_services),h=e.base_currency;return Sr(e,"baggage")&&(h=hr(e,"baggage")),(0,Tr.jsxs)(vr,{isOpen:t,onClose:()=>n(o),children:[(0,Tr.jsx)(Fc,{segmentCount:l.length,currentSegment:u,currentSegmentIndex:i,setCurrentSegmentIndex:S=>a(S)}),(0,Tr.jsx)(Bc,{offer:e,selectedServices:s,passengersById:d,segment:u,setSelectedServices:c}),(0,Tr.jsx)(Lc,{currency:h,selectedServices:s,servicePrices:p,isFirstSegment:i===0,isLastSegment:i+1===l.length,onNextSegmentButtonClicked:()=>a(i+1),onPreviousSegmentButtonClicked:()=>a(i-1),onClose:()=>n(s)})]})};var $e=require("react/jsx-runtime"),Yc=({isLoading:t,offer:e,passengers:r,selectedServices:n,setSelectedServices:o})=>{let[i,a]=Gc.default.useState(!1),s=Sr(e,"baggage"),c=Ge(n),l=c>0,u=bt(e,n),d=e?.base_currency||"";s&&(d=hr(e,"baggage"));let p=e?G(d)(u):"0",h=s&&l?`${Oe(c,"bag","bags")} added for ${p}`:"Add any extra baggage you need for your trip";return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)(yr,{buttonTitle:"Select extra baggage",title:"Extra baggage",copy:h,icon:"cabin_bag",onClick:s?()=>a(!0):null,isLoading:t,disabled:!t&&!s,isSelected:l,children:[t&&(0,$e.jsxs)(ct,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,$e.jsx)(_r,{})]}),!t&&!s&&(0,$e.jsx)(ct,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,$e.jsx)(Uc,{isOpen:!!(i&&e),offer:e,passengers:r,onClose:S=>{let y=JSON.parse(JSON.stringify(S));o(y),a(!1)},selectedServices:n})]})};var qc=D(require("react"));var an=require("react/jsx-runtime"),go=({children:t})=>(0,an.jsxs)("li",{className:"cfar-modal-list-item",children:[(0,an.jsx)(P,{name:"check"}),(0,an.jsx)("p",{children:t})]});var ut=require("react/jsx-runtime"),$c=({offerCurrency:t,service:e})=>(0,ut.jsxs)(Cr,{children:[(0,ut.jsxs)("ul",{style:{padding:0},children:[(0,ut.jsx)(go,{children:"Cancel your trip for any reason"}),(0,ut.jsxs)(go,{children:["Guaranteed refund of"," ",G(t)(+e.metadata.refund_amount)]}),(0,ut.jsx)(go,{children:"Redeemable up to 24 hours before first flight departure"})]}),(0,ut.jsxs)("a",{href:e.metadata.terms_and_conditions_url,rel:"noopener noreferrer",target:"_blank",className:"p2--regular",style:{color:"var(--GREY-600)"},children:["Terms and conditions",(0,ut.jsx)(P,{name:"north_east",size:16,style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}})]})]});var Rt=require("react/jsx-runtime"),Wc=({service:t,selectedServices:e,onAddCfarService:r,onRemoveCfarService:n,onClose:o})=>{let i=e.some(({id:s})=>s==t.id),a=G(t.total_currency)(+t.total_amount);return(0,Rt.jsxs)("div",{className:"cfar-modal-footer",children:[(0,Rt.jsx)(ee,{size:48,variant:i?"destructive":"outlined",onClick:i?n:o,children:i?"Remove protection":"Don\u2019t protect trip"}),!i&&(0,Rt.jsxs)(ee,{size:48,"data-testid":"confirm-selection-for-cfar",onClick:r,children:["Add protection for ",a]}),i&&(0,Rt.jsx)(qm,{})]})},qm=()=>(0,Rt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",columnGap:"8px",backgroundColor:"var(--GREY-100)",padding:"var(--space-12)",borderRadius:"var(--BUTTON-RADIUS)"},children:[(0,Rt.jsx)(P,{size:20,name:"shield_with_moon",style:{fill:"var(--SECONDARY, rgb(var(--ACCENT)))"}}),"Your trip is protected"]});var Gi=require("react/jsx-runtime"),Vc=()=>(0,Gi.jsx)("div",{style:{padding:"24px 24px 16px"},children:(0,Gi.jsx)("h2",{className:"h3--semibold",style:{marginBlock:0},children:"Cancel for any reason"})});var ft=require("react/jsx-runtime"),jc=({isOpen:t,offerCurrency:e,service:r,onClose:n,selectedServices:o})=>(0,ft.jsxs)(vr,{isOpen:t,onClose:()=>n(o),children:[(0,ft.jsx)(Vc,{}),r&&e&&(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)($c,{service:r,offerCurrency:e}),(0,ft.jsx)(Wc,{service:r,selectedServices:o,onAddCfarService:()=>n([{id:r.id,quantity:1,serviceInformation:{total_amount:r.total_amount,total_currency:r.total_currency,...r.metadata}}]),onRemoveCfarService:()=>n([]),onClose:()=>n(o)})]})]});var We=require("react/jsx-runtime"),zc=({isLoading:t,offer:e,selectedServices:r,setSelectedServices:n})=>{let[o,i]=qc.default.useState(!1),a=Sr(e,"cancel_for_any_reason"),c=Ge(r)>0,l=e?.base_currency||"";a&&(l=hr(e,"cancel_for_any_reason"));let u=bt(e,r),d=e?G(l)(u):"0",p=e?.available_services.find(gr),h=a&&c?`Your trip is protected for ${d}`:"Protect your purchase if you decide to cancel";return(0,We.jsxs)(We.Fragment,{children:[(0,We.jsxs)(yr,{buttonTitle:"Add cancel for any reason",title:"Cancel for any reason",copy:h,icon:"shield_with_moon",onClick:a?()=>i(!0):null,isLoading:t,disabled:!t&&!a,isSelected:c,children:[t&&(0,We.jsxs)(ct,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,We.jsx)(_r,{})]}),!t&&!a&&(0,We.jsx)(ct,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,We.jsx)(jc,{isOpen:!!(o&&e&&p),offerCurrency:e?.base_currency,service:p,onClose:S=>{i(!1),n(S)},selectedServices:r})]})};var Zc=(t,e)=>{for(let r of t)for(let n of r.cabins)for(let o of n.rows)for(let i of o.sections)for(let a of i.elements)if(e(a))return a};var _o=t=>Zc(t,r=>r.type==="seat"&&r.available_services.length>0)?.available_services[0]?.total_currency;var Nl=D(require("react"));var Kc=t=>t.flatMap(e=>e.passengers.map((r,n)=>({passenger:r,passengerIndex:n,segment:e})));var zi=D(require("react"));var Xc=(t,e)=>e.cabins.filter(r=>r.deck===t);var Jc=t=>{let e=new Set;for(let r of t)for(let n of r.rows)for(let o of n.sections)for(let i of o.elements)i.type!=="seat"&&i.type!=="empty"&&e.add(i.type);return e};var Qc=(t,e)=>!!(t.wings&&t.wings.first_row_index<=e&&t.wings.last_row_index>=e);var El=D(Ne()),vl=D(require("react"));var el=D(Ne());var Yi=require("react/jsx-runtime"),tl=({value:t,onChange:e,options:r})=>(0,Yi.jsx)("div",{className:"seat-map__tab-select",children:r.map(n=>(0,Yi.jsx)("button",{type:"button",className:(0,el.default)("seat-map__tab-select-option",{"seat-map__tab-select-option--selected":n===t}),onClick:()=>t!==n&&e(n),children:n},n))});var nl=require("react/jsx-runtime"),rl=({value:t,setValue:e})=>{let r=["Lower deck","Upper deck"];return(0,nl.jsx)(tl,{options:r,value:r[t],onChange:n=>e(r.indexOf(n))})};var te=require("react/jsx-runtime"),ol=({symbols:t})=>(0,te.jsxs)("div",{className:"seat-map__legend",children:[(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--fee-payable","aria-label":"Additional cost for seat",children:(0,te.jsx)(P,{name:"seat_paid_indicator",className:"seat-map__legend-seat--fee-payable-indicator",size:12})}),"Additional Cost"]}),(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--included","aria-label":"Included seat"}),"Included"]}),(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--selected","aria-label":"Selected seat"}),"Selected"]}),(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat","aria-label":"Unavailable seat",children:(0,te.jsx)(P,{name:"close",size:14})}),"Unavailable"]}),[...t].map(e=>(0,te.jsxs)("span",{className:"seat-map__legend-item seat-map__legend-item--symbol",children:[(0,te.jsx)(P,{name:e,size:20}),e.split("_")[0]]},e))]});var il=t=>{let e=Object.values(t.sections).map(r=>r.elements).reduce((r,n)=>r.concat(n),[]).filter(r=>r.type==="seat");return e.length>0?e[0].designator.substring(0,e[0].designator.length-1):null};var hl=D(Ne()),Vi=D(require("react"));var al=D(Ne());var $i=require("react/jsx-runtime"),zm=["bassinet","exit_row"],sl=({type:t})=>(0,$i.jsx)("div",{className:(0,al.default)("map-element map-element--amenity",{"map-element--wrapped":!zm.includes(t)}),"aria-label":t.toString(),children:(0,$i.jsx)(P,{name:t,size:16})});var cl=require("react/jsx-runtime"),sn=()=>(0,cl.jsx)("div",{className:"map-element map-element--empty"});var ll=D(Ne());var ho=require("react/jsx-runtime"),dl=({isRight:t})=>(0,ho.jsx)("div",{className:(0,ll.default)("map-element map-element--exit",{"map-element--exit--right":t}),children:t?(0,ho.jsx)(P,{name:"exit_row_right"}):(0,ho.jsx)(P,{name:"exit_row"})});var ul=(t="")=>t.split(" ").map(e=>e[0]).slice(0,2).join("");var pl=D(Ne());var It=require("react/jsx-runtime"),fl=({seat:t,service:e})=>{let r=e?G(e.total_currency)(+e.total_amount):"";return(0,It.jsxs)("div",{className:"seat-info",children:[(0,It.jsxs)("div",{className:"seat-info__details",children:[(0,It.jsx)("strong",{children:t?.designator}),(0,It.jsxs)("span",{children:[t?.name||"Seat"," "]}),(0,It.jsx)("strong",{children:r})]}),t?.disclosures.map((n,o)=>(0,It.jsx)("div",{className:"seat-info__disclosure",children:n},o))]})};var Wi=require("react/jsx-runtime"),ml=({seat:t})=>(0,Wi.jsx)("span",{className:"map-element map-element__seat","aria-label":`${t.designator} ${t.name||"Seat"} Unavailable`,children:(0,Wi.jsx)(P,{name:"close",size:14})});var mt=require("react/jsx-runtime"),gl=({element:t,currentPassengerId:e,currentSegmentId:r,currentPassengerName:n,onSeatToggled:o,selectedServicesMap:i})=>{let a=t.available_services.find(M=>M.passenger_id===e);if(!a)return(0,mt.jsx)(ml,{seat:t});let s=Object.values(i).find(M=>M.serviceInformation?.designator===t.designator&&M.serviceInformation?.segmentId===r),c=s!=null,l=c?ul(s.serviceInformation?.passengerName):t.designator.charAt(t.designator.length-1),u=!isNaN(+a?.total_amount)&&+a?.total_amount!=0,d=!c&&a.passenger_id===e,p=!c||c&&r===s.serviceInformation?.segmentId&&e===s.serviceInformation?.passengerId,h=(0,pl.default)("map-element","map-element__seat",{"map-element--available":d,"map-element--selected":c,"map-element--actionable":p}),S=G(a.total_currency)(+a.total_amount),y=c&&r===s.serviceInformation?.segmentId&&e===s.serviceInformation?.passengerId;return(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsxs)("button",{"data-testid":`seat-${t.designator}`,id:t.designator,className:h,onClick:()=>{p&&o({quantity:c?0:1,id:a.id,serviceInformation:{type:"seat",segmentId:r,passengerId:e,passengerName:n,designator:t.designator,disclosures:t.disclosures,total_amount:a.total_amount,total_currency:a.total_currency}})},"aria-label":`${t.designator} ${t.name||"Seat"} ${S}`,children:[u&&(0,mt.jsx)(P,{name:"seat_paid_indicator",className:"map-element--fee-payable",size:16}),l]}),y&&(0,mt.jsx)(fl,{seat:t,service:a})]})};var xt=require("react/jsx-runtime"),_l=({element:t,elementIndex:e,sectionIndex:r,onSeatToggled:n,selectedServicesMap:o,currentPassengerId:i,currentSegmentId:a,currentPassengerName:s})=>(0,xt.jsx)(xt.Fragment,{children:io(t)?(0,xt.jsx)(gl,{currentSegmentId:a,currentPassengerId:i,currentPassengerName:s,selectedServicesMap:o,element:t,onSeatToggled:n},e):t.type==="empty"?(0,xt.jsx)(sn,{},e):t.type==="exit_row"?(0,xt.jsx)(dl,{isRight:r>0},e):(0,xt.jsx)(sl,{type:t.type},e)});var pt=require("react/jsx-runtime"),Sl=({row:t,rowNumber:e,hasWings:r,section:n,sectionIndex:o,onSeatToggled:i,selectedServicesMap:a,currentPassengerId:s,currentPassengerName:c,currentSegmentId:l})=>{let u=Object.keys(t.sections).length,d=u===1;return(0,pt.jsxs)(Vi.Fragment,{children:[(0,pt.jsx)("div",{className:(0,hl.default)("map-section",{"map-section--left":o===0,"map-section--right":d?!1:o===u-1,"map-section--wing":r}),children:n.elements.length>0?n.elements.map((p,h)=>(0,pt.jsx)(Vi.Fragment,{children:(0,pt.jsx)(_l,{sectionIndex:o,elementIndex:h,element:p,selectedServicesMap:a,onSeatToggled:i,currentPassengerId:s,currentSegmentId:l,currentPassengerName:c})},h)):(0,pt.jsx)(sn,{})}),(o<u-1||d&&o<u)&&(0,pt.jsx)("span",{className:"map-section__aisle",children:e}),d&&o===t.sections.length-1&&(0,pt.jsx)(sn,{})]},o)};var cn=require("react/jsx-runtime"),yl=({row:t,hasWings:e,onSeatToggled:r,selectedServicesMap:n,currentPassengerId:o,currentPassengerName:i,currentSegmentId:a})=>{let s=il(t);return(0,cn.jsx)(cn.Fragment,{children:t.sections.map((c,l)=>(0,cn.jsx)(Sl,{row:t,rowNumber:s,hasWings:e,section:c,sectionIndex:l,selectedServicesMap:n,onSeatToggled:r,currentPassengerId:o,currentPassengerName:i,currentSegmentId:a},l))})};var ln=require("react/jsx-runtime"),ji=()=>(0,ln.jsxs)(fr,{children:[(0,ln.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"Seat selection unavailable"}),(0,ln.jsx)("p",{className:"p1--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:"Unfortunately seat selection is not available for this flight. A seat will be allocated by the airline."})]});var Ve=require("react/jsx-runtime"),Cl=({seatMap:t,onSeatToggled:e,selectedServicesMap:r,currentPassengerId:n,currentPassengerName:o,currentSegmentId:i})=>{let[a,s]=vl.useState(0);if(!t||!t.cabins||!t.cabins.length)return(0,Ve.jsx)(ji,{});let c=Xc(a,t),l=c.length!==t.cabins.length,u=t.cabins.some(p=>p.wings);if(!c||!c.length)return(0,Ve.jsx)(ji,{});let d=Jc(c);return(0,Ve.jsxs)("div",{className:(0,El.default)("seat-map",{"seat-map--wings":u}),children:[l&&(0,Ve.jsx)(rl,{value:a,setValue:p=>{s(p)}}),(0,Ve.jsx)("div",{className:"seat-map__legend-container",children:(0,Ve.jsx)(ol,{symbols:d})}),c.map((p,h)=>(0,Ve.jsx)("div",{className:"seat-map__map-container",style:{"--CABIN-AISLES":p.aisles},children:p.rows.map((S,y)=>(0,Ve.jsx)(yl,{row:S,hasWings:Qc(p,y),onSeatToggled:e,selectedServicesMap:r,currentPassengerId:n,currentPassengerName:o,currentSegmentId:i},y))},`cabin-${h}`))]})};var qi=require("react/jsx-runtime"),bl=t=>(0,qi.jsx)(Cr,{children:(0,qi.jsx)(Cl,{...t})});var gt=require("react/jsx-runtime"),Tl=({selectedServices:t,servicePrices:e,currency:r,isFirstSegment:n,isLastSegment:o,onNextSegmentButtonClicked:i,onPreviousSegmentButtonClicked:a,onClose:s,seatMaps:c})=>{let l=Ge(t),u=rn(e,t,c),d=G(r)(u),p=n&&o;return(0,gt.jsxs)("div",{style:{padding:"16px 24px 24px"},children:[(0,gt.jsxs)("div",{className:"flex--space-between",children:[(0,gt.jsxs)("div",{children:["Price for ",Oe(l,"seat","seats")]}),(0,gt.jsxs)("div",{className:"h3--semibold",children:["+ ",d]})]}),(0,gt.jsxs)("div",{style:p?{marginTop:"16px",display:"grid"}:{marginTop:"16px",display:"grid",columnGap:"12px",gridTemplateColumns:"repeat(2, 1fr)"},children:[!p&&(0,gt.jsx)(ee,{size:48,disabled:n,variant:"outlined",onClick:()=>a(),children:"Back"}),(0,gt.jsx)(ee,{size:48,"data-testid":"confirm-selection-for-seats",onClick:()=>o?s():i(),children:o?"Confirm":"Next"})]})]})};var Pe=require("react/jsx-runtime"),Rl=({segmentAndPassengerPermutationsCount:t,currentSegmentAndPassengerPermutationsIndex:e,currentSegment:r,currentPassengerName:n,setCurrentSegmentAndPassengerPermutationsIndex:o})=>(0,Pe.jsxs)("div",{style:{padding:"24px 24px 16px"},children:[t>1&&(0,Pe.jsx)("div",{style:{display:"flex",columnGap:"4px"},children:Array(t).fill(0).map((i,a)=>a===e?(0,Pe.jsx)(Zm,{},`segment_${a}`):(0,Pe.jsx)(Il,{onClick:()=>o(a)},`segment_${a}`))}),(0,Pe.jsxs)("h2",{className:"h3--semibold",style:t>1?{marginBlock:"12px 0px"}:{},children:["Flight to ",r.destination.iata_code,(0,Pe.jsx)("span",{className:"p2--regular",style:{color:"var(--GREY-600)",marginLeft:"8px"},children:mo(r.departing_at)})]}),(0,Pe.jsx)("p",{className:"h3--semibold",style:{color:"var(--GREY-600)",marginBlock:"0 4px"},children:n})]}),Il=({onClick:t,style:e})=>(0,Pe.jsx)("button",{onClick:t,style:{border:"none",width:"4px",height:"4px",padding:"0",borderRadius:"4px",backgroundColor:"var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)))",transition:"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)",...e}}),Zm=()=>(0,Pe.jsx)(Il,{onClick:void 0,style:{backgroundColor:"var(--SECONDARY, rgb(var(--ACCENT)))"}});var Rr=require("react/jsx-runtime"),xl=({isOpen:t,offer:e,passengers:r,seatMaps:n,selectedServices:o,onClose:i})=>{let[a,s]=zi.default.useState(0),[c,l]=zi.default.useState(o),u=c.reduce((K,X)=>({...K,[X.id]:X}),{});if(!e||!n)return null;let d=uo(e),p=lo(r),h=pr(e.available_services),S=Kc(d),{passenger:{passenger_id:y},passengerIndex:M,segment:{id:N}}=S[a],C=d.find(({id:K})=>K===N),ce=p[y],j=n.find(K=>K.segment_id===N),qe=fo(ce,e.passengers[M],M+1),ye=K=>{let X=new Array;for(let Ae of c){let $t=Ae.id===K.id&&K.quantity===0,Ir=Ae.serviceInformation?.segmentId===N&&Ae.serviceInformation?.passengerId===y;!$t&&!Ir&&(X=[...X,Ae])}K.quantity>0&&(X=[...X,K]),l(X)},Yt=_o(n)??e.total_currency;return(0,Rr.jsxs)(vr,{isOpen:t,onClose:()=>i(o),children:[(0,Rr.jsx)(Rl,{segmentAndPassengerPermutationsCount:S.length,currentSegment:C,currentPassengerName:qe,currentSegmentAndPassengerPermutationsIndex:a,setCurrentSegmentAndPassengerPermutationsIndex:s}),(0,Rr.jsx)(bl,{selectedServicesMap:u,seatMap:j,onSeatToggled:ye,currentPassengerId:y,currentPassengerName:qe,currentSegmentId:N}),(0,Rr.jsx)(Tl,{seatMaps:n,currency:Yt,selectedServices:c,servicePrices:h,isFirstSegment:a===0,isLastSegment:a+1===S.length,onNextSegmentButtonClicked:()=>{s(a+1)},onPreviousSegmentButtonClicked:()=>{s(a-1)},onClose:()=>i(c)})]})};var je=require("react/jsx-runtime"),Ol=({isLoading:t,offer:e,seatMaps:r,passengers:n,selectedServices:o,setSelectedServices:i})=>{let[a,s]=Nl.default.useState(!1),c=Array.isArray(r)&&r.length>0,l=Ge(o),u=l>0,d=bt(e,o,r),p=e?.base_currency??"";r&&(p=_o(r)??p);let h=e?G(p)(d):"0",S=c&&u?`${Oe(l,"seat","seats")} selected for ${h}`:"Specify where on the plane you\u2019d like to sit";return(0,je.jsxs)(je.Fragment,{children:[(0,je.jsxs)(yr,{buttonTitle:"Select seats",title:"Seat selection",copy:S,icon:"flight_class",onClick:c?()=>s(!0):null,isLoading:t,disabled:t&&!c,isSelected:u,children:[t&&(0,je.jsxs)(ct,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,je.jsx)(_r,{})]}),!t&&!c&&(0,je.jsx)(ct,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,je.jsx)(xl,{isOpen:!!(e&&r&&a),seatMaps:r,offer:e,passengers:n,selectedServices:o,onClose:y=>{i(y),s(!1)}})]})};var Se=require("react/jsx-runtime"),Km="https://assets.duffel.com/components/3.1.6--canary.11",Xm=`${Km}/global.css`,Pl=t=>{if(to(t.debug||!1),st("Properties passed into the component:",t),!Mi(t))throw new Error(`The props (${Object.keys(t)}) passed to DuffelAncillaries are invalid. \`onPayloadReady\`, \`passengers\` and \`services\` are always required. Then, depending on your use case you may have one of the following combinations of required props: \`offer_id\` and \`client_key\`, \`offer\` and \`seat_maps\` or \`offer\` and \`client_key\`.Please refer to the documentation for more information and working examples: https://duffel.com/docs/guides/ancillaries-component`);if(t.services.length===0)throw new Error('You must provide at least one service in the "services" prop. Valid services: ["bags", "seats", "cancel_for_any_reason"]');let e=wi(t),r=ki(t),n=Bi(t),o=Li(t),i=t.services.includes("seats")&&!("seat_maps"in t)&&(e||r||o),[a,s]=me.useState(t.passengers),[c,l]=me.useState(t.offer),[u,d]=me.useState(r),[p,h]=me.useState(n?t.seat_maps:void 0),[S,y]=me.useState(i),[M,N]=me.useState(null),[C,ce]=me.useState([]),[j,qe]=me.useState([]),[ye,Yt]=me.useState([]),K=dc(t.markup,t.priceFormatters),X=k=>{let le="This offer has expired.";if(pc(k)){N(le);return}else{let Nr=new Date(k?.expires_at)?.getTime()-Date.now(),Ot=1e3*60*60*24;Nr<Ot&&setTimeout(()=>N(le),Nr)}let xr=uc(k,K);l(xr)},Ae=k=>{let le=fc(k,K.seats);h(le)};if(me.useEffect(()=>{Gn("props",{"props.services":t.services,"props.passengers.length":t.passengers.length,"props.offer_id":t.offer_id,"props.client_key":t.client_key,"props.offer?.id":t.offer?.id,"props.seat_maps?.[0]?.id":t.seat_maps?.[0]?.id}),(r||e)&&yc(t.offer_id,e?null:t.client_key,N,d,k=>{if(X(k),k.passengers.length!==a.length)throw new Error(`The number of passengers given to \`duffel-ancillaries\` (${t.passengers.length}) doesn't match the number of passengers on the given offer (${k.passengers.length}).`);e&&s(t.passengers.map((le,xr)=>({...le,id:k.passengers[xr].id})))}),i&&vc(r||e?t.offer_id:t.offer.id,e?null:t.client_key,()=>Ae([]),y,Ae),o&&X(t.offer),n&&(X(t.offer),Ae(t.seat_maps))},[t.offer_id,t.client_key,t.offer?.id,t.seat_maps?.[0]?.id]),me.useEffect(()=>{if(!c)return;let k=lc({baggageSelectedServices:C,seatSelectedServices:j,cfarSelectedServices:ye,offer:c,passengers:a,seatMaps:p});if(mc(k)){let le={offer_total_amount:c.total_amount,offer_total_currency:c.total_currency,offer_tax_amount:c.tax_amount,offer_tax_currency:c.tax_currency,baggage_services:C,seat_services:j,cancel_for_any_reason_services:ye};st("Payload ready",{"Order creation payload":k,"Services metadata":le}),t.onPayloadReady(k,le)}},[C,j,ye]),!Mi(t))return null;let $t=`${72*t.services.length+32*(t.services.length-1)}px`,Ir={display:"flex",width:"100%",flexDirection:"column",rowGap:"12px",...t.styles?.accentColor&&{"--ACCENT":t.styles.accentColor},...t.styles?.accentColor&&ao(t.styles.accentColor)&&{"--SECONDARY":"var(--GREY-900)","--TERTIARY":"var(--GREY-400)"},...t.styles?.fontFamily&&{"--FONT-FAMILY":t.styles.fontFamily},...t.styles?.buttonCornerRadius&&{"--BUTTON-RADIUS":t.styles.buttonCornerRadius}};return st("Component's internal state:",{isOfferLoading:u,isSeatMapLoading:S,baggageSelectedServices:C,seatSelectedServices:j,cfarSelectedServices:ye,offer:c,seatMaps:p,error:M}),(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)("link",{rel:"stylesheet",href:Xm}),(0,Se.jsx)("div",{className:"duffel-components",style:Ir,children:(0,Se.jsxs)(mr,{children:[M&&(0,Se.jsx)(cc,{height:$t,message:M}),!M&&t.services.map(k=>{if(k==="bags")return(0,Se.jsx)(Yc,{isLoading:u,offer:c,passengers:a,selectedServices:C,setSelectedServices:ce},"bags");if(k==="seats")return(0,Se.jsx)(Ol,{isLoading:u||S,seatMaps:p,offer:c,passengers:a,selectedServices:j,setSelectedServices:qe},"seats");if(k==="cancel_for_any_reason")return(0,Se.jsx)(zc,{isLoading:u,offer:c,selectedServices:ye,setSelectedServices:Yt},"cancel_for_any_reason")})]})})]})};var kl=require("react/jsx-runtime"),Zi="duffel-ancillaries",Ki=class extends HTMLElement{root;connectedCallback(){let e=document.createElement("div");this.attachShadow({mode:"open"}).appendChild(e),this.root=(0,Dl.createRoot)(e)}render(e){if(!this.root)throw"It was not possible to render `duffel-ancillaries` because `this.root` is missing.";this.root.render((0,kl.jsx)(Pl,{...e,onPayloadReady:(r,n)=>{this.dispatchEvent(new CustomEvent("onPayloadReady",{detail:{data:r,metadata:n},composed:!0}))}}))}};window.customElements.get(Zi)||window.customElements.define(Zi,Ki);function Al(t){let e=document.querySelector(Zi);if(!e)throw new Error(`Could not find duffel-ancillaries element in the DOM. Maybe you need to call ${t} after 'window.onload'?`);return e}function Ml(t){Al("renderDuffelAncillariesCustomElement").render(t)}function wl(t){let e=Al("onDuffelAncillariesPayloadReady"),r=n=>{t(n.detail.data,n.detail.metadata)};e.addEventListener("onPayloadReady",r)}var Wl=require("react-dom/client");var Nt=D(Ll());var Hl="https://js.stripe.com/v3",Jm=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Fl="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Qm=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Hl,'"]')),r=0;r<e.length;r++){var n=e[r];if(Jm.test(n.src))return n}return null},ep=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Hl).concat(r);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},tp=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"1.54.0",startTime:r})},yo=null,rp=function(e){return yo!==null||(yo=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(Fl),window.Stripe){r(window.Stripe);return}try{var o=Qm();o&&e?console.warn(Fl):o||(o=ep(e)),o.addEventListener("load",function(){window.Stripe?r(window.Stripe):n(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){n(new Error("Failed to load Stripe.js"))})}catch(i){n(i);return}})),yo},np=function(e,r,n){if(e===null)return null;var o=e.apply(void 0,r);return tp(o,n),o},Ul=Promise.resolve().then(function(){return rp(null)}),Gl=!1;Ul.catch(function(t){Gl||console.warn(t)});var Yl=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Gl=!0;var o=Date.now();return Ul.then(function(i){return np(i,r,o)})};var De=D(require("react"));var Z=require("react/jsx-runtime"),op="https://assets.duffel.com/components/3.1.6--canary.11",ip=`${op}/global.css`,ap="card",sp="3.1.6--canary.11",cp={color:"var(--GREY-900)",fontFamily:'"-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "sans-serif"',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#ababb4"}},lp={color:"#ef4444",iconColor:"#ef4444"},dp=({styles:t,paymentIntentClientToken:e,onSuccessfulPayment:r,onFailedPayment:n})=>{let[o,i]=De.useState(null),[a,s]=De.useState(!1),[c,l]=De.useState(!1),[u,d]=De.useState(!1),[p,h]=De.useState(""),S=(0,Nt.useStripe)(),y=(0,Nt.useElements)();return De.useEffect(()=>{if(y&&!o){let N=y?.getElement(ap);N&&i(N)}},[y,o]),De.useEffect(()=>{o&&o.on("change",N=>{let{error:C,complete:ce}=N;C?(l(!0),h(C.message)):l(!1),s(!!ce)})},[o]),e?(0,Z.jsx)("div",{className:"card-payment__container",children:(0,Z.jsxs)("form",{onSubmit:async N=>{if(N.preventDefault(),!(!S||!y)&&o){d(!0);let C=atob(e),ce=JSON.parse(C),{client_secret:j}=ce,qe=await S.confirmCardPayment(j,{payment_method:{card:o,metadata:{duffel_components_version:sp||"failed-to-get-version"}}});if(d(!1),qe.error){let{error:ye}=qe;n(ye)}else r()}},children:[u&&(0,Z.jsx)("div",{className:"card-payment--in-progress","aria-live":"polite","aria-busy":"true"}),(0,Z.jsx)(Nt.CardElement,{className:"card-details",options:{style:{base:{...cp,...t?.fontFamily&&{fontFamily:t.fontFamily}},invalid:{...lp}}}}),(0,Z.jsx)("div",{className:"card-payment__container--invalid",role:"alert",children:c&&p}),(0,Z.jsx)(ee,{className:"card-payment__pay-button",type:"submit",disabled:!a||u,"aria-label":"Pay",children:u?"Processing...":"Pay"})]})}):null},$l=t=>{let[e,r]=De.useState(null);to(t.debug||!1);let n=atob(t.paymentIntentClientToken),o;try{o=JSON.parse(n)}catch{throw new Error("Invalid Duffel payment intent client token provided")}let{publishable_key:i}=o;De.useEffect(()=>{if(!e&&i){let s=Yl(i);s&&r(s)}},[e,i]);let a={...t.styles?.accentColor&&{"--ACCENT":t.styles.accentColor},...t.styles?.accentColor&&ao(t.styles.accentColor)&&{"--SECONDARY":"black","--TERTIARY":"grey"},...t.styles?.fontFamily&&{"--FONT-FAMILY":t.styles.fontFamily},...t.styles?.buttonCornerRadius&&{"--BUTTON-RADIUS":t.styles.buttonCornerRadius}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("link",{rel:"stylesheet",href:ip}),(0,Z.jsx)("div",{className:"duffel-components",style:a,children:(0,Z.jsx)(mr,{children:(0,Z.jsx)(Nt.Elements,{stripe:e,children:(0,Z.jsx)(dp,{...t})})})})]})};var zl=require("react/jsx-runtime"),Xi="duffel-payments",Ji=class extends HTMLElement{root;connectedCallback(){let e=document.createElement("div");this.appendChild(e),this.root=(0,Wl.createRoot)(e)}render(e){if(!this.root)throw"It was not possible to render `duffel-payments` because `this.root` is missing.";this.root.render((0,zl.jsx)($l,{...e,onSuccessfulPayment:()=>{this.dispatchEvent(new CustomEvent("onSuccessfulPayment",{composed:!0}))},onFailedPayment:r=>{this.dispatchEvent(new CustomEvent("onFailedPayment",{detail:{error:r},composed:!0}))}}))}};window.customElements.get(Xi)||window.customElements.define(Xi,Ji);function Qi(t){let e=document.querySelector(Xi);if(!e)throw new Error(`Could not find duffel-payments element in the DOM. Maybe you need to call ${t} after 'window.onload'?`);return e}function Vl(t){Qi("renderDuffelPaymentsCustomElement").render(t)}function jl(t){Qi("onDuffelPaymentsSuccessfulPayment").addEventListener("onSuccessfulPayment",t)}function ql(t){let e=Qi("onDuffelPaymentsFailedPayment"),r=n=>{t(n.detail.error)};e.addEventListener("onFailedPayment",r)}var Jl=require("react-dom/client");var Eo=D(require("react"));function Zl(t){if(t.split(".").length!==3)throw new Error("Invalid clientKey attribute in DuffelCardForm. It must be a valid JWT.");let e=t.split(".")[1];try{return JSON.parse(atob(e)).token}catch{throw new Error("Invalid clientKey attribute in DuffelCardForm. It was not possible to read the payload.")}}var Xl=require("react/jsx-runtime"),up="https://localhost:8000/iframe.html",Kl=({clientKey:t,styles:e,onCardIdCreated:r,onCardIdCreationError:n,shouldUseLocalTokenProxy:o})=>{let[i,a]=Eo.useState("0px"),s=o?up:"https://api.duffel.cards/iframe.html",c={token:Zl(t),...e?.fontFamily&&{font:e?.fontFamily},...e?.stylesheetUrl&&{stylesheet:e?.stylesheetUrl}},l=`${s}?${new URLSearchParams(c).toString()}`;return Eo.useEffect(()=>{function u(d){s?.startsWith(d.origin)&&(d?.data?.type==="iframe-loaded"?a(d.data.height):d.data.data?.id?r(d.data.data):"error"in d.data&&n(d.data.error))}return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[]),(0,Xl.jsx)("iframe",{title:"Card Payment Form",src:l,style:{width:"100%",border:"none",height:i}})};var rd=require("react/jsx-runtime"),ea="duffel-card-form",ta=class extends HTMLElement{root;connectedCallback(){let e=document.createElement("div");this.attachShadow({mode:"open"}).appendChild(e),this.root=(0,Jl.createRoot)(e)}render(e){if(!this.root)throw"It was not possible to render `duffel-card-form` because `this.root` is missing.";this.root.render((0,rd.jsx)(Kl,{...e,onCardIdCreated:()=>this.dispatchEvent(new CustomEvent("onCardIdCreated",{composed:!0})),onCardIdCreationError:()=>this.dispatchEvent(new CustomEvent("onCardIdCreationError",{composed:!0}))}))}};window.customElements.get(ea)||window.customElements.define(ea,ta);function ra(t){let e=document.querySelector(ea);if(!e)throw new Error(`Could not find duffel-card-form element in the DOM. Maybe you need to call ${t} after 'window.onload'?`);return e}function Ql(t){ra("renderDuffelCardFormCustomElement").render(t)}function ed(t){let e=ra("onDuffelCardFormCardIdCreated"),r=n=>{t(n.detail.data)};e.addEventListener("onCardIdCreated",r)}function td(t){let e=ra("onDuffelCardFormCardIdCreationError"),r=n=>{t(n.detail.data)};e.addEventListener("onCardIdCreationError",r)}
30
+ http://duffel.com/docs/guides/ancillaries-component`),Xs=!0},ec=t=>{Qs()?console.info(Ni,t):zr({category:"log",message:t})};function st(t,e){let r=[];Array.isArray(e)?r=e:r=Object.entries(e).map(([n,o])=>({property:n,value:o})),Qs()?(console.groupCollapsed(Ni,t),r.forEach(n=>{console.info(n)}),console.groupEnd()):zr({category:"log.group",message:t,data:e})}var v=require("react/jsx-runtime"),tc={add:(0,v.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}),apartment:(0,v.jsx)("path",{d:"M3.8496 19.9752V7.2744H7.4496V3.6744H15.9504V10.8744H20.1504V19.9752H13.4496V16.3752H10.5504V19.9752H3.8496ZM5.1504 18.6744H7.4496V16.3752H5.1504V18.6744ZM5.1504 14.7744H7.4496V12.4752H5.1504V14.7744ZM5.1504 10.8744H7.4496V8.5752H5.1504V10.8744ZM8.7504 14.7744H11.0496V12.4752H8.7504V14.7744ZM8.7504 10.8744H11.0496V8.5752H8.7504V10.8744ZM8.7504 7.2744H11.0496V4.9752H8.7504V7.2744ZM12.3504 14.7744H14.6496V12.4752H12.3504V14.7744ZM12.3504 10.8744H14.6496V8.5752H12.3504V10.8744ZM12.3504 7.2744H14.6496V4.9752H12.3504V7.2744ZM16.5504 18.6744H18.8496V16.3752H16.5504V18.6744ZM16.5504 14.7744H18.8496V12.4752H16.5504V14.7744Z"}),arrow_forward:(0,v.jsx)("path",{d:"M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z"}),arrow_left:(0,v.jsx)("path",{d:"M9 19L2 12L9 5L10.425 6.4L5.825 11H22V13H5.825L10.4 17.6L9 19Z"}),arrow_right:(0,v.jsx)("path",{d:"M15 19L13.6 17.6L18.2 13H2V11H18.2L13.6 6.4L15 5L22 12L15 19Z"}),autorenew:(0,v.jsx)("path",{d:"M5.69728 14.4104C5.49326 13.9833 5.32604 13.5257 5.19562 13.0374C5.06521 12.5492 5 12.0367 5 11.5C5 9.56481 5.69083 7.91679 7.07249 6.55591C8.45416 5.19504 10.147 4.53946 12.1511 4.58918H12.7613L11.0742 2.92359L12.0097 2L15.2869 5.23549L12.0097 8.47099L11.0742 7.54739L12.7613 5.88181H12.1511C10.5021 5.84866 9.11624 6.38632 7.99347 7.49479C6.87069 8.60326 6.30931 9.93833 6.30931 11.5C6.30931 11.8455 6.33804 12.1824 6.3955 12.5106C6.45296 12.8389 6.53915 13.1573 6.65407 13.4658L5.69728 14.4104ZM11.9903 21L8.71309 17.7645L11.9903 14.529L12.9258 15.4526L11.2387 17.1182H11.8489C13.4979 17.1513 14.8838 16.6137 16.0065 15.5052C17.1293 14.3967 17.6907 13.0617 17.6907 11.5C17.6907 11.1545 17.662 10.8176 17.6045 10.4894C17.547 10.1611 17.4609 9.84273 17.3459 9.53421L18.3027 8.58959C18.5067 9.01665 18.674 9.47431 18.8044 9.96256C18.9348 10.4508 19 10.9633 19 11.5C19 13.4186 18.3092 15.0625 16.9275 16.4317C15.5458 17.8008 13.853 18.4605 11.8489 18.4108H11.2387L12.9258 20.0764L11.9903 21Z"}),bassinet:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M19 12C19 14.1217 18.1571 16.1566 16.6569 17.6569C15.1566 19.1571 13.1217 20 11 20C8.87827 20 6.84344 19.1571 5.34315 17.6569C3.84286 16.1566 3 14.1217 3 12L11 12H19Z"}),(0,v.jsx)("path",{d:"M16.1347 5.86529L11 11V4C12.0506 4 13.0909 4.20693 14.0615 4.60896C14.8136 4.92052 15.5125 5.34451 16.1347 5.86529ZM16.8602 6.55405L12.4142 11H18.9373C18.8482 10.293 18.6649 9.59962 18.391 8.93853C18.0264 8.05823 17.5077 7.25087 16.8602 6.55405Z"})]}),cabin_bag:(0,v.jsx)("path",{d:"M7.3077 20.5C6.81058 20.5 6.38502 20.323 6.03102 19.969C5.67701 19.615 5.5 19.1894 5.5 18.6923V8.25007C5.5 7.76417 5.67019 7.35103 6.01057 7.01065C6.35096 6.67027 6.7641 6.50007 7.25 6.50007H9.25V3.6924C9.25 3.43631 9.33622 3.22166 9.50865 3.04842C9.68108 2.87519 9.89773 2.78857 10.1586 2.78857H13.8414C14.1022 2.78857 14.3189 2.87519 14.4913 3.04842C14.6637 3.22166 14.75 3.43631 14.75 3.6924V6.50007H16.6922C17.1894 6.50007 17.6149 6.67708 17.9689 7.0311C18.3229 7.3851 18.5 7.81066 18.5 8.30777V18.6923C18.5 19.1894 18.3229 19.615 17.9689 19.969C17.6149 20.323 17.1894 20.5 16.6922 20.5C16.6922 20.7507 16.6074 20.9608 16.4377 21.1303C16.2681 21.2999 16.0578 21.3846 15.807 21.3846C15.5561 21.3846 15.3461 21.2999 15.1769 21.1303C15.0077 20.9608 14.923 20.7507 14.923 20.5H9.0769C9.0769 20.7513 8.99206 20.9615 8.82237 21.1308C8.65271 21.3 8.44246 21.3846 8.19162 21.3846C7.94079 21.3846 7.73076 21.2999 7.56153 21.1303C7.39231 20.9608 7.3077 20.7507 7.3077 20.5ZM10.4423 6.50007H13.5577V3.98085H10.4423V6.50007ZM7.3077 19H16.6922C16.782 19 16.8557 18.9712 16.9134 18.9135C16.9711 18.8558 17 18.7821 17 18.6923V8.30777C17 8.21802 16.9711 8.1443 16.9134 8.0866C16.8557 8.0289 16.782 8.00005 16.6922 8.00005H7.3077C7.21795 8.00005 7.14423 8.0289 7.08652 8.0866C7.02882 8.1443 6.99997 8.21802 6.99997 8.30777V18.6923C6.99997 18.7821 7.02882 18.8558 7.08652 18.9135C7.14423 18.9712 7.21795 19 7.3077 19ZM8.15382 17.1539C8.15382 17.3261 8.21009 17.4685 8.32262 17.5811C8.43514 17.6937 8.57744 17.75 8.74952 17.75C8.92161 17.75 9.06407 17.6937 9.1769 17.5811C9.28972 17.4685 9.34613 17.3261 9.34613 17.1539V9.8462C9.34613 9.67398 9.28986 9.53157 9.17732 9.41897C9.06481 9.30637 8.92251 9.25007 8.75043 9.25007C8.57834 9.25007 8.43588 9.30637 8.32305 9.41897C8.21023 9.53157 8.15382 9.67398 8.15382 9.8462V17.1539ZM11.4038 17.1539C11.4038 17.3261 11.4601 17.4685 11.5726 17.5811C11.6851 17.6937 11.8274 17.75 11.9995 17.75C12.1716 17.75 12.3141 17.6937 12.4269 17.5811C12.5397 17.4685 12.5961 17.3261 12.5961 17.1539V9.8462C12.5961 9.67398 12.5399 9.53157 12.4273 9.41897C12.3148 9.30637 12.1725 9.25007 12.0004 9.25007C11.8283 9.25007 11.6859 9.30637 11.5731 9.41897C11.4602 9.53157 11.4038 9.67398 11.4038 9.8462V17.1539ZM14.6538 17.1539C14.6538 17.3261 14.7101 17.4685 14.8226 17.5811C14.9351 17.6937 15.0774 17.75 15.2495 17.75C15.4216 17.75 15.5641 17.6937 15.6769 17.5811C15.7897 17.4685 15.8461 17.3261 15.8461 17.1539V9.8462C15.8461 9.67398 15.7899 9.53157 15.6773 9.41897C15.5648 9.30637 15.4225 9.25007 15.2504 9.25007C15.0783 9.25007 14.9359 9.30637 14.823 9.41897C14.7102 9.53157 14.6538 9.67398 14.6538 9.8462V17.1539Z"}),check:(0,v.jsx)("path",{d:"M10.3333 15.8646L7 12.5313L8.0625 11.4688L10.3333 13.7396L15.9375 8.13544L17 9.19794L10.3333 15.8646Z"}),checked_bag:(0,v.jsx)("path",{d:"M22 19H2V21H22V19M4 15C4 15.5 4.2 16 4.6 16.4C5 16.8 5.5 17 6 17V6C5.5 6 5 6.2 4.6 6.6C4.2 7 4 7.5 4 8V15M13.5 6H10.5C10.5 5.6 10.6 5.2 10.9 4.9C11.2 4.6 11.5 4.5 12 4.5C12.4 4.5 12.8 4.6 13.1 4.9C13.3 5.2 13.5 5.6 13.5 6M7 6V17H17V6H15C15 5.2 14.7 4.5 14.1 3.9S12.8 3 12 3C11.2 3 10.5 3.3 9.9 3.9C9.3 4.5 9 5.2 9 6H7M18 17C18.5 17 19 16.8 19.4 16.4C19.8 16 20 15.5 20 15V8C20 7.5 19.8 7 19.4 6.6C19 6.2 18.5 6 18 6V17Z"}),chevron:(0,v.jsx)("path",{d:"M5 13H16.17L11.29 17.88C10.9 18.27 10.9 18.91 11.29 19.3C11.68 19.69 12.31 19.69 12.7 19.3L19.29 12.71C19.68 12.32 19.68 11.69 19.29 11.3L12.71 4.7C12.32 4.31 11.69 4.31 11.3 4.7C10.91 5.09 10.91 5.72 11.3 6.11L16.17 11H5C4.45 11 4 11.45 4 12C4 12.55 4.45 13 5 13Z"}),close:(0,v.jsx)("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}),closet:(0,v.jsx)("path",{d:"M12 4C11.0717 4 10.1815 4.36875 9.52513 5.02513C8.86875 5.6815 8.5 6.57174 8.5 7.5H10.5C10.5 7.10218 10.658 6.72064 10.9393 6.43934C11.2206 6.15804 11.6022 6 12 6C12.3978 6 12.7794 6.15804 13.0607 6.43934C13.342 6.72064 13.5 7.10218 13.5 7.5C13.5 7.89782 13.342 8.27936 13.0607 8.56066C12.7794 8.84196 12.3978 9 12 9C11.45 9 11 9.45 11 10V11.75L2.4 18.2C2.23209 18.3259 2.10807 18.5015 2.04549 18.7018C1.98291 18.9022 1.98495 19.1171 2.05132 19.3162C2.11769 19.5153 2.24502 19.6885 2.41529 19.8112C2.58556 19.934 2.79012 20 3 20H21C21.2099 20 21.4144 19.934 21.5847 19.8112C21.755 19.6885 21.8823 19.5153 21.9487 19.3162C22.0151 19.1171 22.0171 18.9022 21.9545 18.7018C21.8919 18.5015 21.7679 18.3259 21.6 18.2L13 11.75V10.85C13.7216 10.6349 14.3546 10.1927 14.805 9.58919C15.2554 8.98569 15.4991 8.25303 15.5 7.5C15.5 6.57174 15.1313 5.6815 14.4749 5.02513C13.8185 4.36875 12.9283 4 12 4ZM12 13.5L18 18H6L12 13.5Z"}),exit_row:(0,v.jsx)("path",{d:"M20 11H6.83001L9.71001 8.12001C10.1 7.73001 10.1 7.10001 9.71001 6.71001C9.32001 6.32001 8.69001 6.32001 8.30001 6.71001L3.71001 11.3C3.32001 11.69 3.32001 12.32 3.71001 12.71L8.30001 17.3C8.69001 17.69 9.32001 17.69 9.71001 17.3C10.1 16.91 10.1 16.28 9.71001 15.89L6.83001 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11Z"}),exit_row_right:(0,v.jsx)("path",{d:"M4 11H17.17L14.29 8.12001C13.9 7.73001 13.9 7.10001 14.29 6.71001C14.68 6.32001 15.31 6.32001 15.7 6.71001L20.29 11.3C20.68 11.69 20.68 12.32 20.29 12.71L15.7 17.3C15.31 17.69 14.68 17.69 14.29 17.3C13.9 16.91 13.9 16.28 14.29 15.89L17.17 13H4C3.45 13 3 12.55 3 12C3 11.45 3.45 11 4 11Z"}),expand_content:(0,v.jsx)("path",{d:"M5 19V13H7V17H11V19H5ZM17 11V7H13V5H19V11H17Z"}),flight_class:(0,v.jsx)("path",{d:"M14.2596 12.5C13.7737 12.5 13.3606 12.3298 13.0202 11.9894C12.6798 11.649 12.5096 11.2359 12.5096 10.75V6.25C12.5096 5.7641 12.6798 5.35096 13.0202 5.01058C13.3606 4.67019 13.7737 4.5 14.2596 4.5H15.75C16.2359 4.5 16.649 4.67019 16.9894 5.01058C17.3298 5.35096 17.5 5.7641 17.5 6.25V10.75C17.5 11.2359 17.3298 11.649 16.9894 11.9894C16.649 12.3298 16.2359 12.5 15.75 12.5H14.2596ZM14.2596 11H15.75C15.8205 11 15.8798 10.9759 15.9278 10.9279C15.9759 10.8798 16 10.8205 16 10.75V6.25C16 6.17948 15.9759 6.12018 15.9278 6.0721C15.8798 6.02402 15.8205 5.99998 15.75 5.99998H14.2596C14.1891 5.99998 14.1298 6.02402 14.0817 6.0721C14.0336 6.12018 14.0096 6.17948 14.0096 6.25V10.75C14.0096 10.8205 14.0336 10.8798 14.0817 10.9279C14.1298 10.9759 14.1891 11 14.2596 11ZM9.5673 17.5C9.21345 17.5 8.89678 17.398 8.6173 17.1942C8.33782 16.9903 8.14423 16.7198 8.03655 16.3827L5.5 8.02883V4.5H6.99997V7.99998L9.49997 16H17.7596V17.5H9.5673ZM8.25 20.5V19H17.75V20.5H8.25ZM14.2596 5.99998H16H14.0096H14.2596Z"}),flight_takeoff:(0,v.jsx)("path",{d:"M3.77521 20.1498V18.849H20.0748V20.1498H3.77521ZM5.45041 15.2742L2.94961 11.0994L4.05001 10.8246L5.90041 12.399L10.05 11.2998L6.27481 4.89902L7.72561 4.62422L14.1 10.1994L19.4004 8.77382C19.75 8.67462 20.0832 8.72062 20.4 8.91182C20.7168 9.10382 20.9252 9.37462 21.0252 9.72422C21.1084 10.0746 21.0624 10.4038 20.8872 10.7118C20.7128 11.0198 20.4504 11.2242 20.1 11.325L5.45041 15.2742Z"}),galley:(0,v.jsx)("path",{d:"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z"}),lavatory:(0,v.jsx)("path",{d:"M5.5 22v-7.5H4V9c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v5.5H9.5V22h-4zM18 22v-6h3l-2.54-7.63C18.18 7.55 17.42 7 16.56 7h-.12c-.86 0-1.63.55-1.9 1.37L12 16h3v6h3zM7.5 6c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2zm9 0c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2z"}),lie_flat_seat:(0,v.jsx)("path",{d:"M6.16667 12.8333C6.81667 12.8333 7.45834 12.5833 7.95001 12.0833C8.91667 11.0916 8.90001 9.51659 7.91667 8.54992C7.42501 8.07492 6.79167 7.83325 6.16667 7.83325C5.51667 7.83325 4.87501 8.08325 4.38334 8.58325C3.41667 9.57492 3.43334 11.1499 4.41667 12.1166C4.90834 12.5916 5.54167 12.8333 6.16667 12.8333ZM5.57501 9.74992C5.73334 9.59159 5.94167 9.49992 6.16667 9.49992C6.38334 9.49992 6.59167 9.58325 6.75001 9.73325C7.08334 10.0583 7.08334 10.5749 6.76667 10.9083C6.60001 11.0749 6.39167 11.1666 6.16667 11.1666C5.95001 11.1666 5.74167 11.0833 5.58334 10.9333C5.25001 10.5999 5.25001 10.0833 5.57501 9.74992ZM17 7.83325H9.50001V12.8333H20.3333V11.1666C20.3333 9.32492 18.8417 7.83325 17 7.83325ZM11.1667 11.1666V9.49992H17C17.9167 9.49992 18.6667 10.2499 18.6667 11.1666H11.1667ZM3.66667 15.3333H8.66667V16.9999H15.3333V15.3333H20.3333V13.6666H3.66667V15.3333Z"}),minus:(0,v.jsx)("path",{d:"M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1z"}),no_airplane:(0,v.jsx)("path",{d:"M14.6674 10.0001V2.66675C14.6674 1.56008 13.7741 0.666748 12.6674 0.666748C11.5607 0.666748 10.6674 1.56008 10.6674 2.66675V7.57341L21.1074 18.0134L25.3341 19.3334V16.6667L14.6674 10.0001ZM1.33407 5.02675L7.9874 11.6801L0.000732422 16.6667V19.3334L10.6674 16.0001V23.3334L8.00073 25.3334V27.3334L12.6674 26.0001L17.3341 27.3334V25.3334L14.6674 23.3334V18.3601L22.3074 26.0001L24.0007 24.3067L3.0274 3.33341L1.33407 5.02675Z"}),no_bag:(0,v.jsx)("path",{d:"M16.8992 6.12037H14.9392V3.18101C14.9385 2.92148 14.8351 2.67278 14.6516 2.48926C14.4681 2.30574 14.2194 2.20234 13.9599 2.20166H10.0399C9.78034 2.20234 9.53163 2.30574 9.34811 2.48926C9.16459 2.67278 9.06119 2.92148 9.06051 3.18101V6.12037H8.20711L8.34715 6.25804L14.3973 12.0871V9.06102H15.9676V13.6L17.3022 14.8859L18.8592 16.4748V8.08037C18.8579 7.56096 18.6509 7.06322 18.2836 6.69594C17.9164 6.32867 17.4186 6.12173 16.8992 6.12037ZM5.14051 8.09559L3.77173 6.71825L5.00821 5.48945L7.16586 7.6606L13.9581 14.4953L15.8932 16.4426L19.7441 20.3175L20.2279 20.8043L18.9914 22.0331L17.635 20.6683C17.4035 20.7625 17.154 20.8126 16.8992 20.8133C16.904 20.945 16.8822 21.0763 16.8351 21.1993C16.788 21.3224 16.7166 21.4347 16.6251 21.5296C16.5336 21.6244 16.424 21.6999 16.3027 21.7514C16.1814 21.8029 16.051 21.8295 15.9192 21.8295C15.7874 21.8295 15.657 21.8029 15.5357 21.7514C15.4145 21.6999 15.3048 21.6244 15.2133 21.5296C15.1219 21.4347 15.0504 21.3224 15.0034 21.1993C14.9563 21.0763 14.9344 20.945 14.9392 20.8133H9.06051C9.06529 20.945 9.04348 21.0763 8.99638 21.1993C8.94929 21.3224 8.87787 21.4347 8.7864 21.5296C8.69492 21.6244 8.58527 21.6999 8.46399 21.7514C8.34271 21.8029 8.21229 21.8295 8.08051 21.8295C7.94874 21.8295 7.81832 21.8029 7.69703 21.7514C7.57575 21.6999 7.4661 21.6244 7.37463 21.5296C7.28316 21.4347 7.21174 21.3224 7.16464 21.1993C7.11754 21.0763 7.09573 20.945 7.10051 20.8133C6.58222 20.8119 6.08545 20.6059 5.71835 20.24C5.35126 19.8741 5.14357 19.378 5.14051 18.8597V8.09559ZM14.8632 17.8791L14.3973 17.4103V17.8791H14.8632ZM9.596 12.579V17.8791H8.03083V11.004L9.596 12.579ZM10.5302 3.67134H13.4695V6.12295H10.5302V3.67134Z"}),no_seat:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M25.1667 21.9733L23.4733 23.6667L2.5 2.69333L4.19333 1L7.16667 3.97333L16.5267 13.3333L19.1933 16L24.5 21.3067L25.1667 21.9733Z"}),(0,v.jsx)("path",{d:"M7.16667 24H3.16667V16H19.1933L24.5 21.3067V24H20.5V20H7.16667V24ZM27.1667 9.33333H23.1667V13.3333H27.1667V9.33333ZM4.5 9.33333H0.5V13.3333H4.5V9.33333ZM20.3333 13.3333H20.5V2.66667C20.5 1.2 19.3 0 17.8333 0H9.83333C9.05784 0 8.3569 0.335483 7.86848 0.868484L20.3333 13.3333ZM16.5267 13.3333L7.16667 3.97333V13.3333H16.5267Z"})]}),north_east:(0,v.jsx)("path",{d:"M4.69999 19.3C4.51665 19.1167 4.42499 18.8833 4.42499 18.6C4.42499 18.3167 4.51665 18.0833 4.69999 17.9L15.6 7H9.99999C9.71665 7 9.47915 6.90417 9.28749 6.7125C9.09582 6.52083 8.99999 6.28333 8.99999 6C8.99999 5.71667 9.09582 5.47917 9.28749 5.2875C9.47915 5.09583 9.71665 5 9.99999 5H18C18.2833 5 18.5208 5.09583 18.7125 5.2875C18.9042 5.47917 19 5.71667 19 6V14C19 14.2833 18.9042 14.5208 18.7125 14.7125C18.5208 14.9042 18.2833 15 18 15C17.7167 15 17.4792 14.9042 17.2875 14.7125C17.0958 14.5208 17 14.2833 17 14V8.4L6.09999 19.3C5.91665 19.4833 5.68332 19.575 5.39999 19.575C5.11665 19.575 4.88332 19.4833 4.69999 19.3Z"}),seat:(0,v.jsx)("path",{d:"M7.59 5.41012C6.81 4.63012 6.81 3.36012 7.59 2.58012C8.37 1.80012 9.64 1.80012 10.42 2.58012C11.2 3.36012 11.2 4.63012 10.42 5.41012C9.63 6.20012 8.37 6.20012 7.59 5.41012ZM6 16.0001V8.00012C6 7.45012 5.55 7.00012 5 7.00012C4.45 7.00012 4 7.45012 4 8.00012V16.0001C4 18.7601 6.24 21.0001 9 21.0001H14C14.55 21.0001 15 20.5501 15 20.0001C15 19.4501 14.55 19.0001 14 19.0001H9C7.34 19.0001 6 17.6601 6 16.0001ZM19.28 19.3501L15.51 15.5801C15.14 15.2101 14.63 15.0001 14.1 15.0001H11.5V11.3201C12.59 12.2101 14.16 13.0201 15.7 13.3401C16.37 13.4801 17 12.9801 17 12.3001C17 11.7701 16.61 11.3401 16.08 11.2501C14.66 11.0101 13.2 10.2401 12.33 9.28012L10.93 7.73012C10.74 7.52012 10.5 7.35012 10.24 7.23012C9.95 7.09012 9.62 7.00012 9.28 7.00012H9.25C8.01 7.00012 7 8.01012 7 9.25012V15.0001C7 16.6601 8.34 18.0001 10 18.0001H15.07L17.85 20.7801C18.24 21.1701 18.89 21.1701 19.28 20.7801C19.68 20.3901 19.68 19.7501 19.28 19.3501Z"}),seat_paid_indicator:(0,v.jsx)("path",{d:"M11.7686 0.731368C12.7766 -0.276576 14.5 0.437294 14.5 1.86274V10.8C14.5 12.5673 13.0673 14 11.3 14H2.36274C0.937294 14 0.223427 12.2766 1.23137 11.2686L11.7686 0.731368Z"}),shield_with_moon:(0,v.jsx)("path",{d:"M12.525 15.75C13.0814 15.75 13.6269 15.6408 14.1615 15.4222C14.6961 15.2036 15.166 14.8757 15.5711 14.4385C15.6749 14.3244 15.7032 14.2033 15.6557 14.0751C15.6083 13.9469 15.5077 13.8629 15.3538 13.8232C14.7269 13.6783 14.1477 13.4183 13.6163 13.0433C13.0849 12.6683 12.6474 12.1789 12.3038 11.5751C11.9769 11.0046 11.7682 10.393 11.6778 9.74048C11.5874 9.08791 11.6589 8.45458 11.8923 7.84048C11.9525 7.68663 11.9301 7.55586 11.8249 7.44817C11.7198 7.34049 11.5916 7.30332 11.4403 7.33665C10.4442 7.59177 9.65927 8.1142 9.08555 8.90395C8.51185 9.69368 8.225 10.5591 8.225 11.5001C8.225 12.6796 8.64519 13.6828 9.48558 14.5097C10.3259 15.3366 11.3391 15.75 12.525 15.75ZM12 21.4808C9.83716 20.8911 8.04646 19.618 6.62787 17.6616C5.20929 15.7052 4.5 13.518 4.5 11.1001V5.34625L12 2.53857L19.5 5.34625V11.1001C19.5 13.518 18.7907 15.7052 17.3721 17.6616C15.9535 19.618 14.1628 20.8911 12 21.4808ZM12 19.9001C13.7333 19.3501 15.1666 18.2501 16.3 16.6001C17.4333 14.9501 18 13.1167 18 11.1001V6.37507L12 4.1347L5.99997 6.37507V11.1001C5.99997 13.1167 6.56664 14.9501 7.69997 16.6001C8.83331 18.2501 10.2666 19.3501 12 19.9001Z"}),stairs:(0,v.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M18,8h-2.42v3.33H13v3.33h-2.58 V18H6v-2h2.42v-3.33H11V9.33h2.58V6H18V8z"}),warning:(0,v.jsx)("path",{d:"M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM8.21071 9.25592L10.9548 12L8.21071 14.7441L9.38922 15.9226L12.1333 13.1785L14.8774 15.9226L16.0559 14.7441L13.3118 12L16.0559 9.25592L14.8774 8.07741L12.1333 10.8215L9.38922 8.07741L8.21071 9.25592Z"}),wifi:(0,v.jsx)("path",{d:"M2.83333 9.50005L4.49999 11.1667C8.64166 7.02505 15.3583 7.02505 19.5 11.1667L21.1667 9.50005C16.1083 4.44172 7.89999 4.44172 2.83333 9.50005ZM9.49999 16.1667L12 18.6667L14.5 16.1667C13.125 14.7834 10.8833 14.7834 9.49999 16.1667ZM6.16666 12.8334L7.83333 14.5C10.1333 12.2 13.8667 12.2 16.1667 14.5L17.8333 12.8334C14.6167 9.61672 9.39166 9.61672 6.16666 12.8334Z"})},yp=t=>t in tc?tc[t]:(ec(`The icon "${t}" is missing from ICON_MAP`),null),P=({name:t,size:e,className:r,viewBox:n,style:o})=>(0,v.jsx)("svg",{className:r,width:e||24,height:e||24,viewBox:n||"0 0 24 24","aria-label":t,"data-testid":t,style:{display:"block",fill:"currentColor",...o},children:yp(t)});var rc=A(Ne());var no=require("react/jsx-runtime"),Ep={primary:"button--primary",outlined:"button--outlined",destructive:"button--destructive"},vp={32:"button--32",40:"button--40",48:"button--48"},ee=({iconBefore:t,variant:e="primary",size:r=40,children:n,className:o,type:i="button",...a})=>(0,no.jsxs)("button",{type:i,className:(0,rc.default)("button",Ep[e],vp[r],o),...a,children:[t&&(0,no.jsx)(P,{className:"duffel-button__icon duffel-button__icon--before",name:t}),n]});var Oi=require("react/jsx-runtime"),fr=({style:t,children:e})=>(0,Oi.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",border:"dashed 1px var(--GREY-300)",borderRadius:"4px",paddingBlock:"32px",...t},children:(0,Oi.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"470px"},children:e})});var Ut=require("react/jsx-runtime"),pr=class extends nc.default.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){_e(e)}render(){return this.state.hasError?(0,Ut.jsxs)(fr,{children:[(0,Ut.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"We ran into an error"}),(0,Ut.jsx)("p",{className:"p1--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:"Please try reloading. If the problem persists reach out to our support team."}),(0,Ut.jsx)("div",{children:(0,Ut.jsx)(ee,{variant:"outlined",iconBefore:"autorenew",onClick:()=>location.reload(),children:"Try again"})})]}):this.props.children}};var Gt=require("react/jsx-runtime"),oc=({height:t,message:e})=>(0,Gt.jsxs)(fr,{style:{minHeight:t},children:[(0,Gt.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"Failed to load extras"}),(0,Gt.jsx)("p",{className:"p2--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:e||"Please try reloading. If the problem persists reach out to our support team."}),(0,Gt.jsx)("div",{children:(0,Gt.jsx)(ee,{variant:"outlined",onClick:()=>location.reload(),iconBefore:"autorenew",children:"Try again"})})]});var mr=t=>t.reduce((e,{id:r,total_amount:n,total_currency:o})=>({[r]:{total_amount:n,total_currency:o},...e}),{});var bt=(t,e,r)=>{if(!t||!e||e.length===0)return 0;let n=mr(t.available_services);return rn(n,e,r)},rn=(t,e,r)=>(e||[]).reduce((n,{quantity:o,id:i})=>{let a=n;return i in t?a+=o*+t[i].total_amount:r?a+=o*Cp(i,r):_e(new Error(`The service id (${i}) provided could not be found in neither the offer nor the seat maps.`)),a},0),Cp=(t,e)=>{for(let r of e)for(let n of r.cabins)for(let o of n.rows)for(let i of o.sections)for(let a of i.elements)if(a.type==="seat"&&Array.isArray(a.available_services)){let s=a.available_services.find(c=>c.id===t);if(s)return+s.total_amount}return 0};var ic=({baggageSelectedServices:t,seatSelectedServices:e,cfarSelectedServices:r,offer:n,seatMaps:o,passengers:i})=>{let a=[...t||[],...e||[],...r||[]],s=+n.total_amount+bt(n,a,o);return{...n&&{selected_offers:[n.id]},passengers:i,services:bp(a),...n&&{payments:[{type:"balance",amount:`${s}`,currency:n.total_currency}]},type:"instant",metadata:{source:"duffel-ancillaries@3.1.7"}}},bp=t=>Array.isArray(t)?t.filter(({quantity:e})=>e>0).map(({id:e,quantity:r})=>({id:e,quantity:r})):[];var Pi=t=>(e,r)=>{let{rate:n,amount:o}=t;return{amount:e*(1+n)+o,currency:r}},Ai="You cannot supply both markup and priceFormatters for the same service.",ac=(t,e)=>{let r={};if(e&&(e.bags&&(r.bags=e.bags),e.seats&&(r.seats=e.seats),e.cancel_for_any_reason&&(r.cancel_for_any_reason=e.cancel_for_any_reason)),t){if(t.bags){if(e&&e.bags)throw new Error(Ai);r.bags=Pi(t.bags)}if(t.seats){if(e&&e.seats)throw new Error(Ai);r.seats=Pi(t.seats)}if(t.cancel_for_any_reason){if(e&&e.cancel_for_any_reason)throw new Error(Ai);r.cancel_for_any_reason=Pi(t.cancel_for_any_reason)}}return r};var oo=t=>t.type==="baggage";var gr=t=>t.type==="cancel_for_any_reason";var Tp=(t,e)=>`${t} must all have the same currency, but they have ${e.size} different currencies (${[...e].join(", ")}). Check the price formatters passed into the component's render function.`,sc=(t,e)=>{if(!e)return t;let r=t.available_services,n=new Set,o={baggage:e?.bags,cancel_for_any_reason:e?.cancel_for_any_reason},i=r.map(a=>{let s={...a};if(a.type in o&&o[a.type]){let{total_amount:c,total_currency:l}=a;if(oo(a)){let{amount:d,currency:u}=o[a.type](+a.total_amount,a.total_currency,a);c=d.toString(),u&&(l=u)}if(gr(a)){let{amount:d,currency:u}=o[a.type](+a.total_amount,a.total_currency,a);c=d.toString(),u&&(l=u)}if(n.add(l),n.size>1)throw new Error(Tp(a.type,n));s.total_amount=c,s.total_currency=l}return s});return{...t,available_services:i}};function io(t){return t.type==="seat"}var Rp=t=>`Seats must all have the same currency, but they have ${t.size} different currencies (${[...t].join(", ")}). Check the price formatters passed into the component's render function.`,Ip=(t,e,r)=>{let n={...t};if(io(n)&&n.available_services.length>0){let o=n.available_services.map(i=>{let a={...i},{amount:s,currency:c}=e(+i.total_amount,i.total_currency,i);if(a.total_amount=s.toString(),c&&(a.total_currency=c,r.add(c),r.size>1))throw new Error(Rp(r));return a});n.available_services=o}return n},cc=(t,e)=>{if(!e)return t;let r=new Set;return t.map(o=>{let i=o.cabins.map(a=>{let s=a.rows.map(c=>{let l=c.sections.map(d=>{let u=d.elements.map(m=>Ip(m,e,r));return{...d,elements:u}});return{...c,sections:l}});return{...a,rows:s}});return{...o,cabins:i}})};var ao=t=>{let e=t.split(", ").map(n=>parseInt(n));return(.2126*e[0]+.7152*e[1]+.0722*e[2])/255>.5};var lc=t=>"selected_offers"in t&&"passengers"in t&&"services"in t&&"payments"in t&&"type"in t&&"metadata"in t;var uc=t=>t.expires_at&&new Date(t.expires_at)<new Date;var nn=t=>"data"in t&&Array.isArray(t.data.errors),xp="https://api.duffel.com",Np="3.1.7";async function so(t,e,r="GET",n){st("Making request to the Duffel API",{path:e,method:r});let o=`${xp}/ancillaries-component/${e}`,i=null;try{i=await fetch(o,{method:r,body:n,headers:{"Duffel-Version":"v1",Authorization:`Bearer ${t}`,"User-Agent":`Duffel/ancillaries-component@${Np}`}})}catch(s){throw st("Failed to make request to the Duffel API",{error:s}),s}let a=await i.json();if(Array.isArray(a.errors))throw st("Request to the Duffel API failed",{operation:`${r} ${o}`,method:r,request_id:a?.meta?.request_id,errors:a.errors,status:i.status}),{...i,data:a};return st("Request to the Duffel succeeded",{request_id:a?.meta?.request_id}),a}var dc="https://assets.duffel.com/components/3.1.7",fc=async t=>await(await fetch(dc+`/fixtures/offers/${t}.json`)).json(),pc=async t=>await(await fetch(dc+`/fixtures/seat-maps/${t}.json`)).json();var co=t=>t.startsWith("fixture_off_");async function mc(t,e){return(await so(e,`offers/${t}?return_available_services=true`)).data}async function gc(t,e,r,n,o){n(!0);let i=co(t);if(t=i?t.replace("fixture_",""):t,i)return fc(t).then(a=>{n(!1),o(a)});if(!e)throw new Error("Attempted to retrieve seat maps but the client key is missing.");try{let a=await mc(t,e);o(a)}catch(a){let s="An unknown error occurred while retrieving the offer.";a instanceof Error?(s=a.message,a.message.includes("Load failed")&&(s="The Duffel API is not available. Please try again later.")):nn(a)&&a.status===404&&(s="The offer you are looking for does not exist or has expired."),nn(a)&&a.status>=500&&a.status<600&&_e(new Error(s)),r(s)}finally{n(!1)}}async function _c(t,e){return(await so(e,`offers/${t}/seat_maps`)).data}async function hc(t,e,r,n,o){n(!0);let i=co(t);if(t=i?t.replace("fixture_",""):t,i)return pc(t).then(a=>{n(!1),o(a)});if(!e)throw new Error("Attemptted to retrieve seat maps but the client key is missing.");try{let a=await _c(t,e);o(a)}catch(a){let s="An unknown error occurred while retrieving the seat maps.";a instanceof Error?(s=a.message,a.message.includes("Load failed")&&(s="The Duffel API is not available. Please try again later.")):nn(a)&&(s=a.data.errors[0]?.message||"Received an unknown error from the Duffel API."),_e(new Error(s)),r()}finally{n(!1)}}var Di=t=>Op(t)&&(Mi(t)||wi(t)||ki(t)||Bi(t)),Op=t=>"onPayloadReady"in t&&"passengers"in t&&"services"in t,Mi=t=>"offer_id"in t&&t.offer_id.startsWith("fixture_"),wi=t=>"offer_id"in t&&"client_key"in t,ki=t=>"offer"in t&&"seat_maps"in t,Bi=t=>"offer"in t&&"client_key"in t;var pe=A(require("react"));var Sc=require("react/jsx-runtime"),_r=()=>(0,Sc.jsx)("span",{className:"textual-loading-indicator","aria-hidden":"true"});var yc=require("react/jsx-runtime"),ct=({backgroundColor:t,color:e,children:r})=>(0,yc.jsx)("div",{style:{backgroundColor:t,color:e,padding:"2px 8px",whiteSpace:"nowrap",borderRadius:"4px",fontWeight:"600",fontSize:"14px",lineHeight:"20px",textAlign:"center"},children:r});var hr=(t,e)=>{if(t.available_services.length===0)throw new Error("No services available");let r=t.available_services.find(n=>n.type===e);if(!r)throw new Error(`No ${e} services available`);return r.total_currency};var Ge=t=>(t||[]).reduce((e,{quantity:r})=>e+r,0);var Pp={baggage:oo,cancel_for_any_reason:gr},Sr=(t,e)=>{let r=Pp[e];if(!r)throw new Error(`Unknown service type: ${e}`);return t&&Array.isArray(t.available_services)&&t.available_services.some(n=>r(n)&&n.maximum_quantity>0)};var G=(t,e="en-GB",r={})=>n=>{try{let i=new Intl.NumberFormat(e,{style:"currency",currency:t,...r}).format(n);return r&&r.signDisplay&&(r.signDisplay==="always"||r.signDisplay==="exceptZero"&&n!==0)?i.replace(/^([+-])/,"$1 "):i}catch{return`${n} ${t}`}};var Oe=(t,e,r)=>t==1?`${t} ${e}`:`${t} ${r}`;var Lc=A(require("react"));var Ec=A(Ne()),vc=A(require("react"));var he=require("react/jsx-runtime"),yr=({buttonTitle:t,title:e,icon:r,copy:n,onClick:o,children:i,isLoading:a,disabled:s,isSelected:c})=>{let l=vc.Children.toArray(i).length>0;return(0,he.jsxs)("button",{type:"button",title:t,...o&&{onClick:o},disabled:s,className:(0,Ec.default)("ancillary-card",a&&"ancillary-card--loading"),style:{cursor:"pointer",background:"transparent",color:"var(--GREY-900)",border:"solid 1px rgba(226, 226, 232, 1)",display:"flex",rowGap:"4px",padding:"20px",borderRadius:"8px",justifyContent:"space-between",flexWrap:"wrap",flexDirection:"column",width:"100%",boxSizing:"border-box",fontSize:"16px",fontWeight:"400",lineHeight:"24px",letterSpacing:"0em",transition:"border-color 0.3s var(--TRANSITION-CUBIC-BEZIER) background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)"},children:[(0,he.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",marginBlock:"0",textAlign:"start",marginTop:"2px",columnGap:"12px",width:"100%"},children:[(0,he.jsx)("div",{children:c?(0,he.jsx)(P,{name:"check",className:"ancillary-card__selected-icon"}):(0,he.jsx)(P,{name:r})}),(0,he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",width:"100%"},children:[(0,he.jsx)("p",{className:"p1--semibold",style:{marginBlock:"0"},children:e}),(0,he.jsx)("div",{className:"ancillary-card__children",children:l?i:(0,he.jsx)(P,{name:"expand_content",className:"ancillary-card__expand-icon"})})]})]}),(0,he.jsx)("p",{className:"p1--regular",style:{textAlign:"start",color:"var(--GREY-600)",marginLeft:"34px",marginBlock:"0"},children:n})]})};var Li=t=>{t?document.body.style.overflow="":document.body.style.overflow="hidden"};var bc=A(Ne()),Tc=A(require("react"));var Cc=A(Ne());var Fi=require("react/jsx-runtime"),Ap={primary:"icon-button--primary",outlined:"icon-button--outlined"},on=({icon:t,variant:e="primary",className:r,...n})=>(0,Fi.jsx)("button",{type:"button",className:(0,Cc.default)("icon-button",Ap[e],r),...n,children:(0,Fi.jsx)(P,{name:t})});var Er=require("react/jsx-runtime"),vr=({children:t,onClose:e,isOpen:r})=>(Tc.useEffect(()=>(Li(!r),()=>Li(!0)),[r]),(0,Er.jsx)("div",{className:(0,bc.default)("modal",r&&"modal--open"),style:{opacity:0},children:(0,Er.jsxs)("div",{role:"presentation",className:"modal--content",children:[t,(0,Er.jsx)(on,{icon:"close",onClick:e,title:"Close modal",className:"modal--close-button"})]})})),Cr=({children:t})=>(0,Er.jsx)("div",{className:"modal-body",children:t});var lo=t=>t.reduce((e,r)=>({[r.id]:r,...e}),{});var uo=t=>t.slices.reduce((e,r)=>[...e,...r.segments],new Array);var mo=A(require("react"));var fo=(t,e,r)=>t?t.given_name&&t.family_name?`${t.given_name} ${t.family_name}`:t.given_name?t.given_name:t.family_name?t.family_name:e?.given_name&&e?.family_name?`${e.given_name} ${e.family_name}`:e?.given_name?e.given_name:e?.family_name?e.family_name:`Passenger ${r}`:`Passenger ${r}`;var Rc=t=>{if(!t)return _e(new Error("getBaggageServiceDescription was not given any metadata")),null;if(!t.maximum_weight_kg&&!t.maximum_length_cm&&!t.maximum_height_cm&&!t.maximum_depth_cm)return null;let e=t.maximum_length_cm&&t.maximum_height_cm&&t.maximum_depth_cm,r="";e&&(r=` / ${t.maximum_height_cm} x ${t.maximum_length_cm} x ${t.maximum_depth_cm} cm`);let n="";return t.maximum_weight_kg&&(n=`Up to ${t.maximum_weight_kg}kg`),`${n}${r}`};var Ic=(t,e,r,n)=>t.some(o=>o.id===n.id||o.serviceInformation?.type!=="carry_on"&&o.serviceInformation?.type!=="checked"||o.serviceInformation?.segmentId!==e||o.serviceInformation?.passengerId!==r?!1:o.serviceInformation?.type===n.metadata.type);var br=require("react/jsx-runtime"),xc=({id:t,min:e,max:r,value:n,onChange:o})=>(0,br.jsxs)("div",{className:"counter",id:t,children:[(0,br.jsx)(on,{icon:"minus",title:"Remove one",id:`${t}-minus`,"data-testid":`${t}-minus`,variant:"outlined",disabled:n<=e,onClick:()=>o(Math.max(n-1,e))}),(0,br.jsx)("div",{className:"counter__count-label",children:n}),(0,br.jsx)(on,{icon:"add",title:"Add one",id:`${t}-plus`,"data-testid":`${t}-plus`,variant:"outlined",disabled:n>=r,onClick:()=>o(Math.min(n+1,r))})]});var lt=require("react/jsx-runtime"),Nc=({segmentId:t,passengerId:e,availableService:r,quantity:n,onQuantityChanged:o,selectedServices:i})=>{let a=r.metadata.type==="carry_on"?"Cabin bag":"Checked bag",s=G(r.total_currency)(+r.total_amount),c=Rc(r.metadata),l=Ic(i,t,e,r);return(0,lt.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,lt.jsxs)("div",{children:[(0,lt.jsxs)("p",{style:{margin:0},className:"p2--regular",children:[a,(0,lt.jsx)("span",{style:{marginInline:"4px",color:"var(--GREY-400)"},children:"\u2022"}),(0,lt.jsx)("span",{className:"p2--semibold","data-testid":`price-label--${r.id}--${e}`,children:s})]}),(0,lt.jsx)("p",{style:{margin:0,color:"var(--GREY-600)"},className:"p3--regular",children:c})]}),(0,lt.jsx)(xc,{id:`counter--${r.id}--${e}`,min:0,value:n,onChange:o,max:l?0:r.maximum_quantity})]})};var Pc=require("react/jsx-runtime"),Oc=({includedBaggage:t})=>{let{carryOnBagsQuantity:e,checkedBagsQuantity:r}=t.reduce((o,{type:i,quantity:a})=>({carryOnBagsQuantity:o.carryOnBagsQuantity+(i==="carry_on"?a:0),checkedBagsQuantity:o.checkedBagsQuantity+(i==="checked"?a:0)}),{carryOnBagsQuantity:0,checkedBagsQuantity:0}),n=new Array;return e>0&&n.push(Oe(e,"cabin bag","cabin bags")),r>0&&n.push(Oe(r,"checked bag","checked bags")),(0,Pc.jsxs)("div",{style:{marginBlock:"8px",padding:"8px 12px",color:" var(--GREEN-300)",backgroundColor:" var(--GREEN-100)",borderRadius:"6px"},className:"p2--regular",children:[n.join(" and ")," included with ticket"]})};var Tt=require("react/jsx-runtime"),Ac=({segmentId:t,passengerId:e,passengerName:r,includedBaggage:n,passengerServicesForSegment:o,selectedServices:i,setSelectedServices:a})=>{let s=n.reduce((c,l)=>c+l.quantity,0);return(0,Tt.jsxs)("div",{style:{marginTop:"24px"},children:[(0,Tt.jsx)("h3",{style:{margin:0},className:"p1--semibold",children:r}),s?(0,Tt.jsx)(Oc,{includedBaggage:n}):null,(0,Tt.jsx)("div",{style:{display:"flex",rowGap:"8px",flexDirection:"column"},children:o.map(c=>(0,Tt.jsx)(Nc,{passengerId:e,segmentId:t,availableService:c,selectedServices:i,quantity:i.find(({id:l})=>l==c.id)?.quantity||0,onQuantityChanged:l=>Dp(l,t,e,r,c,i,a)},c.id))}),o.length===0&&(0,Tt.jsx)("p",{style:{color:"var(--GREY-700)",margin:0},children:"Extra baggage is not available for this passenger on this flight"})]})},Dp=(t,e,r,n,o,i,a)=>{let s=i.findIndex(({id:l})=>o.id===l),c=Array.from(i);s<0?c.push({id:o.id,quantity:t,serviceInformation:{segmentId:e,passengerId:r,passengerName:n,total_amount:o.total_amount,total_currency:o.total_currency,...o.metadata}}):c[s].quantity=t,a(c.filter(({quantity:l})=>l!==0))};var Hi=require("react/jsx-runtime"),Dc=({offer:t,segment:e,passengersById:r,selectedServices:n,setSelectedServices:o})=>(0,Hi.jsx)(Cr,{children:e.passengers.map(({passenger_id:i,baggages:a},s)=>(0,Hi.jsx)(Ac,{segmentId:e.id,passengerId:i,passengerName:fo(r[i],t.passengers.find(({id:c})=>c===i),s+1),includedBaggage:a,passengerServicesForSegment:t.available_services.filter(({type:c,passenger_ids:l,segment_ids:d})=>c==="baggage"&&l.includes(i)&&d.includes(e.id)),selectedServices:n,setSelectedServices:o},i))});var ut=require("react/jsx-runtime"),Mc=({selectedServices:t,servicePrices:e,currency:r,isFirstSegment:n,isLastSegment:o,onNextSegmentButtonClicked:i,onPreviousSegmentButtonClicked:a,onClose:s})=>{let c=Ge(t),l=rn(e,t),d=G(r)(l),u=n&&n;return(0,ut.jsxs)("div",{style:{padding:"16px 24px 24px"},children:[(0,ut.jsxs)("div",{className:"flex--space-between",children:[(0,ut.jsxs)("div",{children:["Price for ",Oe(c,"extra bag","extra bags")]}),(0,ut.jsxs)("div",{className:"h3--semibold","data-testid":"baggage-total-amount-label",children:["+ ",d]})]}),(0,ut.jsxs)("div",{style:u?{marginTop:"16px",display:"grid"}:{marginTop:"16px",display:"grid",columnGap:"12px",gridTemplateColumns:"repeat(2, 1fr)"},children:[!u&&(0,ut.jsx)(ee,{size:48,variant:"outlined",disabled:n,onClick:()=>a(),children:"Back"}),(0,ut.jsx)(ee,{size:48,"data-testid":"confirm-selection-for-baggage",onClick:()=>o?s():i(),children:o?"Confirm":"Next"})]})]})};var po=t=>{let e=new Date(t);if(isNaN(e.valueOf()))_e(new Error(`formatDateString attempted to parse an invalid date string: ${t}`));else return Mp(e)},Mp=t=>{let{format:e}=new Intl.DateTimeFormat(void 0,{dateStyle:"medium"});return e(t)};var Ye=require("react/jsx-runtime"),wc=({segmentCount:t,currentSegmentIndex:e,currentSegment:r,setCurrentSegmentIndex:n})=>(0,Ye.jsxs)("div",{style:{padding:"24px 24px 16px"},children:[t>1&&(0,Ye.jsx)("div",{style:{display:"flex",columnGap:"4px"},children:Array(t).fill(0).map((o,i)=>i===e?(0,Ye.jsx)(wp,{},`segment_${i}`):(0,Ye.jsx)(kc,{onClick:()=>n(i)},`segment_${i}`))}),(0,Ye.jsxs)("h2",{className:"h3--semibold",style:t>1?{marginTop:"12px"}:{},children:["Flight to ",r.destination.iata_code,(0,Ye.jsx)("span",{className:"p2--regular",style:{color:"var(--GREY-600)",marginLeft:"8px"},children:po(r.departing_at)})]})]}),kc=({onClick:t,style:e})=>(0,Ye.jsx)("button",{onClick:t,style:{border:"none",width:"4px",height:"4px",padding:"0",borderRadius:"4px",backgroundColor:"var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)))",transition:"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)",...e}}),wp=()=>(0,Ye.jsx)(kc,{onClick:void 0,style:{backgroundColor:"var(--SECONDARY, rgb(var(--ACCENT)))"}});var Tr=require("react/jsx-runtime"),Bc=({isOpen:t,offer:e,passengers:r,onClose:n,selectedServices:o})=>{let[i,a]=(0,mo.useState)(0),[s,c]=mo.default.useState(o);if(!e)return null;let l=uo(e),d=l[i],u=lo(r),m=mr(e.available_services),h=e.base_currency;return Sr(e,"baggage")&&(h=hr(e,"baggage")),(0,Tr.jsxs)(vr,{isOpen:t,onClose:()=>n(o),children:[(0,Tr.jsx)(wc,{segmentCount:l.length,currentSegment:d,currentSegmentIndex:i,setCurrentSegmentIndex:S=>a(S)}),(0,Tr.jsx)(Dc,{offer:e,selectedServices:s,passengersById:u,segment:d,setSelectedServices:c}),(0,Tr.jsx)(Mc,{currency:h,selectedServices:s,servicePrices:m,isFirstSegment:i===0,isLastSegment:i+1===l.length,onNextSegmentButtonClicked:()=>a(i+1),onPreviousSegmentButtonClicked:()=>a(i-1),onClose:()=>n(s)})]})};var $e=require("react/jsx-runtime"),Fc=({isLoading:t,offer:e,passengers:r,selectedServices:n,setSelectedServices:o})=>{let[i,a]=Lc.default.useState(!1),s=Sr(e,"baggage"),c=Ge(n),l=c>0,d=bt(e,n),u=e?.base_currency||"";s&&(u=hr(e,"baggage"));let m=e?G(u)(d):"0",h=s&&l?`${Oe(c,"bag","bags")} added for ${m}`:"Add any extra baggage you need for your trip";return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)(yr,{buttonTitle:"Select extra baggage",title:"Extra baggage",copy:h,icon:"cabin_bag",onClick:s?()=>a(!0):null,isLoading:t,disabled:!t&&!s,isSelected:l,children:[t&&(0,$e.jsxs)(ct,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,$e.jsx)(_r,{})]}),!t&&!s&&(0,$e.jsx)(ct,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,$e.jsx)(Bc,{isOpen:!!(i&&e),offer:e,passengers:r,onClose:S=>{let y=JSON.parse(JSON.stringify(S));o(y),a(!1)},selectedServices:n})]})};var $c=A(require("react"));var an=require("react/jsx-runtime"),go=({children:t})=>(0,an.jsxs)("li",{className:"cfar-modal-list-item",children:[(0,an.jsx)(P,{name:"check"}),(0,an.jsx)("p",{children:t})]});var dt=require("react/jsx-runtime"),Hc=({offerCurrency:t,service:e})=>(0,dt.jsxs)(Cr,{children:[(0,dt.jsxs)("ul",{style:{padding:0},children:[(0,dt.jsx)(go,{children:"Cancel your trip for any reason"}),(0,dt.jsxs)(go,{children:["Guaranteed refund of"," ",G(t)(+e.metadata.refund_amount)]}),(0,dt.jsx)(go,{children:"Redeemable up to 24 hours before first flight departure"})]}),(0,dt.jsxs)("a",{href:e.metadata.terms_and_conditions_url,rel:"noopener noreferrer",target:"_blank",className:"p2--regular",style:{color:"var(--GREY-600)"},children:["Terms and conditions",(0,dt.jsx)(P,{name:"north_east",size:16,style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}})]})]});var Rt=require("react/jsx-runtime"),Uc=({service:t,selectedServices:e,onAddCfarService:r,onRemoveCfarService:n,onClose:o})=>{let i=e.some(({id:s})=>s==t.id),a=G(t.total_currency)(+t.total_amount);return(0,Rt.jsxs)("div",{className:"cfar-modal-footer",children:[(0,Rt.jsx)(ee,{size:48,variant:i?"destructive":"outlined",onClick:i?n:o,children:i?"Remove protection":"Don\u2019t protect trip"}),!i&&(0,Rt.jsxs)(ee,{size:48,"data-testid":"confirm-selection-for-cfar",onClick:r,children:["Add protection for ",a]}),i&&(0,Rt.jsx)(kp,{})]})},kp=()=>(0,Rt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",columnGap:"8px",backgroundColor:"var(--GREY-100)",padding:"var(--space-12)",borderRadius:"var(--BUTTON-RADIUS)"},children:[(0,Rt.jsx)(P,{size:20,name:"shield_with_moon",style:{fill:"var(--SECONDARY, rgb(var(--ACCENT)))"}}),"Your trip is protected"]});var Ui=require("react/jsx-runtime"),Gc=()=>(0,Ui.jsx)("div",{style:{padding:"24px 24px 16px"},children:(0,Ui.jsx)("h2",{className:"h3--semibold",style:{marginBlock:0},children:"Cancel for any reason"})});var ft=require("react/jsx-runtime"),Yc=({isOpen:t,offerCurrency:e,service:r,onClose:n,selectedServices:o})=>(0,ft.jsxs)(vr,{isOpen:t,onClose:()=>n(o),children:[(0,ft.jsx)(Gc,{}),r&&e&&(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(Hc,{service:r,offerCurrency:e}),(0,ft.jsx)(Uc,{service:r,selectedServices:o,onAddCfarService:()=>n([{id:r.id,quantity:1,serviceInformation:{type:"cancel_for_any_reason",total_amount:r.total_amount,total_currency:r.total_currency,...r.metadata}}]),onRemoveCfarService:()=>n([]),onClose:()=>n(o)})]})]});var We=require("react/jsx-runtime"),Wc=({isLoading:t,offer:e,selectedServices:r,setSelectedServices:n})=>{let[o,i]=$c.default.useState(!1),a=Sr(e,"cancel_for_any_reason"),c=Ge(r)>0,l=e?.base_currency||"";a&&(l=hr(e,"cancel_for_any_reason"));let d=bt(e,r),u=e?G(l)(d):"0",m=e?.available_services.find(gr),h=a&&c?`Your trip is protected for ${u}`:"Protect your purchase if you decide to cancel";return(0,We.jsxs)(We.Fragment,{children:[(0,We.jsxs)(yr,{buttonTitle:"Add cancel for any reason",title:"Cancel for any reason",copy:h,icon:"shield_with_moon",onClick:a?()=>i(!0):null,isLoading:t,disabled:!t&&!a,isSelected:c,children:[t&&(0,We.jsxs)(ct,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,We.jsx)(_r,{})]}),!t&&!a&&(0,We.jsx)(ct,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,We.jsx)(Yc,{isOpen:!!(o&&e&&m),offerCurrency:e?.base_currency,service:m,onClose:S=>{i(!1),n(S)},selectedServices:r})]})};var Vc=(t,e)=>{for(let r of t)for(let n of r.cabins)for(let o of n.rows)for(let i of o.sections)for(let a of i.elements)if(e(a))return a};var _o=t=>Vc(t,r=>r.type==="seat"&&r.available_services.length>0)?.available_services[0]?.total_currency;var Tl=A(require("react"));var jc=t=>t.flatMap(e=>e.passengers.map((r,n)=>({passenger:r,passengerIndex:n,segment:e})));var qi=A(require("react"));var qc=(t,e)=>e.cabins.filter(r=>r.deck===t);var zc=t=>{let e=new Set;for(let r of t)for(let n of r.rows)for(let o of n.sections)for(let i of o.elements)i.type!=="seat"&&i.type!=="empty"&&e.add(i.type);return e};var Zc=(t,e)=>!!(t.wings&&t.wings.first_row_index<=e&&t.wings.last_row_index>=e);var _l=A(Ne()),hl=A(require("react"));var Kc=A(Ne());var Gi=require("react/jsx-runtime"),Xc=({value:t,onChange:e,options:r})=>(0,Gi.jsx)("div",{className:"seat-map__tab-select",children:r.map(n=>(0,Gi.jsx)("button",{type:"button",className:(0,Kc.default)("seat-map__tab-select-option",{"seat-map__tab-select-option--selected":n===t}),onClick:()=>t!==n&&e(n),children:n},n))});var Qc=require("react/jsx-runtime"),Jc=({value:t,setValue:e})=>{let r=["Lower deck","Upper deck"];return(0,Qc.jsx)(Xc,{options:r,value:r[t],onChange:n=>e(r.indexOf(n))})};var te=require("react/jsx-runtime"),el=({symbols:t})=>(0,te.jsxs)("div",{className:"seat-map__legend",children:[(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--fee-payable","aria-label":"Additional cost for seat",children:(0,te.jsx)(P,{name:"seat_paid_indicator",className:"seat-map__legend-seat--fee-payable-indicator",size:12})}),"Additional Cost"]}),(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--included","aria-label":"Included seat"}),"Included"]}),(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--selected","aria-label":"Selected seat"}),"Selected"]}),(0,te.jsxs)("span",{className:"seat-map__legend-item",children:[(0,te.jsx)("span",{className:"seat-map__legend-seat","aria-label":"Unavailable seat",children:(0,te.jsx)(P,{name:"close",size:14})}),"Unavailable"]}),[...t].map(e=>(0,te.jsxs)("span",{className:"seat-map__legend-item seat-map__legend-item--symbol",children:[(0,te.jsx)(P,{name:e,size:20}),e.split("_")[0]]},e))]});var tl=t=>{let e=Object.values(t.sections).map(r=>r.elements).reduce((r,n)=>r.concat(n),[]).filter(r=>r.type==="seat");return e.length>0?e[0].designator.substring(0,e[0].designator.length-1):null};var pl=A(Ne()),Wi=A(require("react"));var rl=A(Ne());var Yi=require("react/jsx-runtime"),Bp=["bassinet","exit_row"],nl=({type:t})=>(0,Yi.jsx)("div",{className:(0,rl.default)("map-element map-element--amenity",{"map-element--wrapped":!Bp.includes(t)}),"aria-label":t.toString(),children:(0,Yi.jsx)(P,{name:t,size:16})});var ol=require("react/jsx-runtime"),sn=()=>(0,ol.jsx)("div",{className:"map-element map-element--empty"});var il=A(Ne());var ho=require("react/jsx-runtime"),al=({isRight:t})=>(0,ho.jsx)("div",{className:(0,il.default)("map-element map-element--exit",{"map-element--exit--right":t}),children:t?(0,ho.jsx)(P,{name:"exit_row_right"}):(0,ho.jsx)(P,{name:"exit_row"})});var sl=(t="")=>t.split(" ").map(e=>e[0]).slice(0,2).join("");var ul=A(Ne());var It=require("react/jsx-runtime"),cl=({seat:t,service:e})=>{let r=e?G(e.total_currency)(+e.total_amount):"";return(0,It.jsxs)("div",{className:"seat-info",children:[(0,It.jsxs)("div",{className:"seat-info__details",children:[(0,It.jsx)("strong",{children:t?.designator}),(0,It.jsxs)("span",{children:[t?.name||"Seat"," "]}),(0,It.jsx)("strong",{children:r})]}),t?.disclosures.map((n,o)=>(0,It.jsx)("div",{className:"seat-info__disclosure",children:n},o))]})};var $i=require("react/jsx-runtime"),ll=({seat:t})=>(0,$i.jsx)("span",{className:"map-element map-element__seat","aria-label":`${t.designator} ${t.name||"Seat"} Unavailable`,children:(0,$i.jsx)(P,{name:"close",size:14})});var pt=require("react/jsx-runtime"),dl=({element:t,currentPassengerId:e,currentSegmentId:r,currentPassengerName:n,onSeatToggled:o,selectedServicesMap:i})=>{let a=t.available_services.find(M=>M.passenger_id===e);if(!a)return(0,pt.jsx)(ll,{seat:t});let s=Object.values(i).find(M=>M.serviceInformation?.designator===t.designator&&M.serviceInformation?.segmentId===r),c=s!=null,l=c?sl(s.serviceInformation?.passengerName):t.designator.charAt(t.designator.length-1),d=!isNaN(+a?.total_amount)&&+a?.total_amount!=0,u=!c&&a.passenger_id===e,m=!c||c&&r===s.serviceInformation?.segmentId&&e===s.serviceInformation?.passengerId,h=(0,ul.default)("map-element","map-element__seat",{"map-element--available":u,"map-element--selected":c,"map-element--actionable":m}),S=G(a.total_currency)(+a.total_amount),y=c&&r===s.serviceInformation?.segmentId&&e===s.serviceInformation?.passengerId;return(0,pt.jsxs)(pt.Fragment,{children:[(0,pt.jsxs)("button",{"data-testid":`seat-${t.designator}`,id:t.designator,className:h,onClick:()=>{m&&o({quantity:c?0:1,id:a.id,serviceInformation:{type:"seat",segmentId:r,passengerId:e,passengerName:n,designator:t.designator,disclosures:t.disclosures,total_amount:a.total_amount,total_currency:a.total_currency}})},"aria-label":`${t.designator} ${t.name||"Seat"} ${S}`,children:[d&&(0,pt.jsx)(P,{name:"seat_paid_indicator",className:"map-element--fee-payable",size:16}),l]}),y&&(0,pt.jsx)(cl,{seat:t,service:a})]})};var xt=require("react/jsx-runtime"),fl=({element:t,elementIndex:e,sectionIndex:r,onSeatToggled:n,selectedServicesMap:o,currentPassengerId:i,currentSegmentId:a,currentPassengerName:s})=>(0,xt.jsx)(xt.Fragment,{children:io(t)?(0,xt.jsx)(dl,{currentSegmentId:a,currentPassengerId:i,currentPassengerName:s,selectedServicesMap:o,element:t,onSeatToggled:n},e):t.type==="empty"?(0,xt.jsx)(sn,{},e):t.type==="exit_row"?(0,xt.jsx)(al,{isRight:r>0},e):(0,xt.jsx)(nl,{type:t.type},e)});var mt=require("react/jsx-runtime"),ml=({row:t,rowNumber:e,hasWings:r,section:n,sectionIndex:o,onSeatToggled:i,selectedServicesMap:a,currentPassengerId:s,currentPassengerName:c,currentSegmentId:l})=>{let d=Object.keys(t.sections).length,u=d===1;return(0,mt.jsxs)(Wi.Fragment,{children:[(0,mt.jsx)("div",{className:(0,pl.default)("map-section",{"map-section--left":o===0,"map-section--right":u?!1:o===d-1,"map-section--wing":r}),children:n.elements.length>0?n.elements.map((m,h)=>(0,mt.jsx)(Wi.Fragment,{children:(0,mt.jsx)(fl,{sectionIndex:o,elementIndex:h,element:m,selectedServicesMap:a,onSeatToggled:i,currentPassengerId:s,currentSegmentId:l,currentPassengerName:c})},h)):(0,mt.jsx)(sn,{})}),(o<d-1||u&&o<d)&&(0,mt.jsx)("span",{className:"map-section__aisle",children:e}),u&&o===t.sections.length-1&&(0,mt.jsx)(sn,{})]},o)};var cn=require("react/jsx-runtime"),gl=({row:t,hasWings:e,onSeatToggled:r,selectedServicesMap:n,currentPassengerId:o,currentPassengerName:i,currentSegmentId:a})=>{let s=tl(t);return(0,cn.jsx)(cn.Fragment,{children:t.sections.map((c,l)=>(0,cn.jsx)(ml,{row:t,rowNumber:s,hasWings:e,section:c,sectionIndex:l,selectedServicesMap:n,onSeatToggled:r,currentPassengerId:o,currentPassengerName:i,currentSegmentId:a},l))})};var ln=require("react/jsx-runtime"),Vi=()=>(0,ln.jsxs)(fr,{children:[(0,ln.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"Seat selection unavailable"}),(0,ln.jsx)("p",{className:"p1--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:"Unfortunately seat selection is not available for this flight. A seat will be allocated by the airline."})]});var Ve=require("react/jsx-runtime"),Sl=({seatMap:t,onSeatToggled:e,selectedServicesMap:r,currentPassengerId:n,currentPassengerName:o,currentSegmentId:i})=>{let[a,s]=hl.useState(0);if(!t||!t.cabins||!t.cabins.length)return(0,Ve.jsx)(Vi,{});let c=qc(a,t),l=c.length!==t.cabins.length,d=t.cabins.some(m=>m.wings);if(!c||!c.length)return(0,Ve.jsx)(Vi,{});let u=zc(c);return(0,Ve.jsxs)("div",{className:(0,_l.default)("seat-map",{"seat-map--wings":d}),children:[l&&(0,Ve.jsx)(Jc,{value:a,setValue:m=>{s(m)}}),(0,Ve.jsx)("div",{className:"seat-map__legend-container",children:(0,Ve.jsx)(el,{symbols:u})}),c.map((m,h)=>(0,Ve.jsx)("div",{className:"seat-map__map-container",style:{"--CABIN-AISLES":m.aisles},children:m.rows.map((S,y)=>(0,Ve.jsx)(gl,{row:S,hasWings:Zc(m,y),onSeatToggled:e,selectedServicesMap:r,currentPassengerId:n,currentPassengerName:o,currentSegmentId:i},y))},`cabin-${h}`))]})};var ji=require("react/jsx-runtime"),yl=t=>(0,ji.jsx)(Cr,{children:(0,ji.jsx)(Sl,{...t})});var gt=require("react/jsx-runtime"),El=({selectedServices:t,servicePrices:e,currency:r,isFirstSegment:n,isLastSegment:o,onNextSegmentButtonClicked:i,onPreviousSegmentButtonClicked:a,onClose:s,seatMaps:c})=>{let l=Ge(t),d=rn(e,t,c),u=G(r)(d),m=n&&o;return(0,gt.jsxs)("div",{style:{padding:"16px 24px 24px"},children:[(0,gt.jsxs)("div",{className:"flex--space-between",children:[(0,gt.jsxs)("div",{children:["Price for ",Oe(l,"seat","seats")]}),(0,gt.jsxs)("div",{className:"h3--semibold",children:["+ ",u]})]}),(0,gt.jsxs)("div",{style:m?{marginTop:"16px",display:"grid"}:{marginTop:"16px",display:"grid",columnGap:"12px",gridTemplateColumns:"repeat(2, 1fr)"},children:[!m&&(0,gt.jsx)(ee,{size:48,disabled:n,variant:"outlined",onClick:()=>a(),children:"Back"}),(0,gt.jsx)(ee,{size:48,"data-testid":"confirm-selection-for-seats",onClick:()=>o?s():i(),children:o?"Confirm":"Next"})]})]})};var Pe=require("react/jsx-runtime"),vl=({segmentAndPassengerPermutationsCount:t,currentSegmentAndPassengerPermutationsIndex:e,currentSegment:r,currentPassengerName:n,setCurrentSegmentAndPassengerPermutationsIndex:o})=>(0,Pe.jsxs)("div",{style:{padding:"24px 24px 16px"},children:[t>1&&(0,Pe.jsx)("div",{style:{display:"flex",columnGap:"4px"},children:Array(t).fill(0).map((i,a)=>a===e?(0,Pe.jsx)(Lp,{},`segment_${a}`):(0,Pe.jsx)(Cl,{onClick:()=>o(a)},`segment_${a}`))}),(0,Pe.jsxs)("h2",{className:"h3--semibold",style:t>1?{marginBlock:"12px 0px"}:{},children:["Flight to ",r.destination.iata_code,(0,Pe.jsx)("span",{className:"p2--regular",style:{color:"var(--GREY-600)",marginLeft:"8px"},children:po(r.departing_at)})]}),(0,Pe.jsx)("p",{className:"h3--semibold",style:{color:"var(--GREY-600)",marginBlock:"0 4px"},children:n})]}),Cl=({onClick:t,style:e})=>(0,Pe.jsx)("button",{onClick:t,style:{border:"none",width:"4px",height:"4px",padding:"0",borderRadius:"4px",backgroundColor:"var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)))",transition:"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)",...e}}),Lp=()=>(0,Pe.jsx)(Cl,{onClick:void 0,style:{backgroundColor:"var(--SECONDARY, rgb(var(--ACCENT)))"}});var Rr=require("react/jsx-runtime"),bl=({isOpen:t,offer:e,passengers:r,seatMaps:n,selectedServices:o,onClose:i})=>{let[a,s]=qi.default.useState(0),[c,l]=qi.default.useState(o),d=c.reduce((K,X)=>({...K,[X.id]:X}),{});if(!e||!n)return null;let u=uo(e),m=lo(r),h=mr(e.available_services),S=jc(u),{passenger:{passenger_id:y},passengerIndex:M,segment:{id:N}}=S[a],C=u.find(({id:K})=>K===N),ce=m[y],j=n.find(K=>K.segment_id===N),qe=fo(ce,e.passengers[M],M+1),ye=K=>{let X=new Array;for(let De of c){let $t=De.id===K.id&&K.quantity===0,Ir=De.serviceInformation?.segmentId===N&&De.serviceInformation?.passengerId===y;!$t&&!Ir&&(X=[...X,De])}K.quantity>0&&(X=[...X,K]),l(X)},Yt=_o(n)??e.total_currency;return(0,Rr.jsxs)(vr,{isOpen:t,onClose:()=>i(o),children:[(0,Rr.jsx)(vl,{segmentAndPassengerPermutationsCount:S.length,currentSegment:C,currentPassengerName:qe,currentSegmentAndPassengerPermutationsIndex:a,setCurrentSegmentAndPassengerPermutationsIndex:s}),(0,Rr.jsx)(yl,{selectedServicesMap:d,seatMap:j,onSeatToggled:ye,currentPassengerId:y,currentPassengerName:qe,currentSegmentId:N}),(0,Rr.jsx)(El,{seatMaps:n,currency:Yt,selectedServices:c,servicePrices:h,isFirstSegment:a===0,isLastSegment:a+1===S.length,onNextSegmentButtonClicked:()=>{s(a+1)},onPreviousSegmentButtonClicked:()=>{s(a-1)},onClose:()=>i(c)})]})};var je=require("react/jsx-runtime"),Rl=({isLoading:t,offer:e,seatMaps:r,passengers:n,selectedServices:o,setSelectedServices:i})=>{let[a,s]=Tl.default.useState(!1),c=Array.isArray(r)&&r.length>0,l=Ge(o),d=l>0,u=bt(e,o,r),m=e?.base_currency??"";r&&(m=_o(r)??m);let h=e?G(m)(u):"0",S=c&&d?`${Oe(l,"seat","seats")} selected for ${h}`:"Specify where on the plane you\u2019d like to sit";return(0,je.jsxs)(je.Fragment,{children:[(0,je.jsxs)(yr,{buttonTitle:"Select seats",title:"Seat selection",copy:S,icon:"flight_class",onClick:c?()=>s(!0):null,isLoading:t,disabled:t&&!c,isSelected:d,children:[t&&(0,je.jsxs)(ct,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,je.jsx)(_r,{})]}),!t&&!c&&(0,je.jsx)(ct,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,je.jsx)(bl,{isOpen:!!(e&&r&&a),seatMaps:r,offer:e,passengers:n,selectedServices:o,onClose:y=>{i(y),s(!1)}})]})};var Se=require("react/jsx-runtime"),Fp="https://assets.duffel.com/components/3.1.7",Hp=`${Fp}/global.css`,Il=t=>{if(to(t.debug||!1),st("Properties passed into the component:",t),!Di(t))throw new Error(`The props (${Object.keys(t)}) passed to DuffelAncillaries are invalid. \`onPayloadReady\`, \`passengers\` and \`services\` are always required. Then, depending on your use case you may have one of the following combinations of required props: \`offer_id\` and \`client_key\`, \`offer\` and \`seat_maps\` or \`offer\` and \`client_key\`.Please refer to the documentation for more information and working examples: https://duffel.com/docs/guides/ancillaries-component`);if(t.services.length===0)throw new Error('You must provide at least one service in the "services" prop. Valid services: ["bags", "seats", "cancel_for_any_reason"]');let e=Mi(t),r=wi(t),n=ki(t),o=Bi(t),i=t.services.includes("seats")&&!("seat_maps"in t)&&(e||r||o),[a,s]=pe.useState(t.passengers),[c,l]=pe.useState(t.offer),[d,u]=pe.useState(r),[m,h]=pe.useState(n?t.seat_maps:void 0),[S,y]=pe.useState(i),[M,N]=pe.useState(null),[C,ce]=pe.useState([]),[j,qe]=pe.useState([]),[ye,Yt]=pe.useState([]),K=ac(t.markup,t.priceFormatters),X=k=>{let le="This offer has expired.";if(uc(k)){N(le);return}else{let Nr=new Date(k?.expires_at)?.getTime()-Date.now(),Ot=1e3*60*60*24;Nr<Ot&&setTimeout(()=>N(le),Nr)}let xr=sc(k,K);l(xr)},De=k=>{let le=cc(k,K.seats);h(le)};if(pe.useEffect(()=>{Gn("props",{"props.services":t.services,"props.passengers.length":t.passengers.length,"props.offer_id":t.offer_id,"props.client_key":t.client_key,"props.offer?.id":t.offer?.id,"props.seat_maps?.[0]?.id":t.seat_maps?.[0]?.id}),(r||e)&&gc(t.offer_id,e?null:t.client_key,N,u,k=>{if(X(k),k.passengers.length!==a.length)throw new Error(`The number of passengers given to \`duffel-ancillaries\` (${t.passengers.length}) doesn't match the number of passengers on the given offer (${k.passengers.length}).`);e&&s(t.passengers.map((le,xr)=>({...le,id:k.passengers[xr].id})))}),i&&hc(r||e?t.offer_id:t.offer.id,e?null:t.client_key,()=>De([]),y,De),o&&X(t.offer),n&&(X(t.offer),De(t.seat_maps))},[t.offer_id,t.client_key,t.offer?.id,t.seat_maps?.[0]?.id]),pe.useEffect(()=>{if(!c)return;let k=ic({baggageSelectedServices:C,seatSelectedServices:j,cfarSelectedServices:ye,offer:c,passengers:a,seatMaps:m});if(lc(k)){let le={offer_total_amount:c.total_amount,offer_total_currency:c.total_currency,offer_tax_amount:c.tax_amount,offer_tax_currency:c.tax_currency,baggage_services:C,seat_services:j,cancel_for_any_reason_services:ye};st("Payload ready",{"Order creation payload":k,"Services metadata":le}),t.onPayloadReady(k,le)}},[C,j,ye]),!Di(t))return null;let $t=`${72*t.services.length+32*(t.services.length-1)}px`,Ir={display:"flex",width:"100%",flexDirection:"column",rowGap:"12px",...t.styles?.accentColor&&{"--ACCENT":t.styles.accentColor},...t.styles?.accentColor&&ao(t.styles.accentColor)&&{"--SECONDARY":"var(--GREY-900)","--TERTIARY":"var(--GREY-400)"},...t.styles?.fontFamily&&{"--FONT-FAMILY":t.styles.fontFamily},...t.styles?.buttonCornerRadius&&{"--BUTTON-RADIUS":t.styles.buttonCornerRadius}};return st("Component's internal state:",{isOfferLoading:d,isSeatMapLoading:S,baggageSelectedServices:C,seatSelectedServices:j,cfarSelectedServices:ye,offer:c,seatMaps:m,error:M}),(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)("link",{rel:"stylesheet",href:Hp}),(0,Se.jsx)("div",{className:"duffel-components",style:Ir,children:(0,Se.jsxs)(pr,{children:[M&&(0,Se.jsx)(oc,{height:$t,message:M}),!M&&t.services.map(k=>{if(k==="bags")return(0,Se.jsx)(Fc,{isLoading:d,offer:c,passengers:a,selectedServices:C,setSelectedServices:ce},"bags");if(k==="seats")return(0,Se.jsx)(Rl,{isLoading:d||S,seatMaps:m,offer:c,passengers:a,selectedServices:j,setSelectedServices:qe},"seats");if(k==="cancel_for_any_reason")return(0,Se.jsx)(Wc,{isLoading:d,offer:c,selectedServices:ye,setSelectedServices:Yt},"cancel_for_any_reason")})]})})]})};var Al=require("react/jsx-runtime"),zi="duffel-ancillaries",Zi=class extends HTMLElement{root;connectedCallback(){let e=document.createElement("div");this.attachShadow({mode:"open"}).appendChild(e),this.root=(0,xl.createRoot)(e)}render(e){if(!this.root)throw"It was not possible to render `duffel-ancillaries` because `this.root` is missing.";this.root.render((0,Al.jsx)(Il,{...e,onPayloadReady:(r,n)=>{this.dispatchEvent(new CustomEvent("onPayloadReady",{detail:{data:r,metadata:n},composed:!0}))}}))}};window.customElements.get(zi)||window.customElements.define(zi,Zi);function Nl(t){let e=document.querySelector(zi);if(!e)throw new Error(`Could not find duffel-ancillaries element in the DOM. Maybe you need to call ${t} after 'window.onload'?`);return e}function Ol(t){Nl("renderDuffelAncillariesCustomElement").render(t)}function Pl(t){let e=Nl("onDuffelAncillariesPayloadReady"),r=n=>{t(n.detail.data,n.detail.metadata)};e.addEventListener("onPayloadReady",r)}var Ul=require("react-dom/client");var Nt=A(Ml());var kl="https://js.stripe.com/v3",Up=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,wl="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Gp=function(){for(var e=document.querySelectorAll('script[src^="'.concat(kl,'"]')),r=0;r<e.length;r++){var n=e[r];if(Up.test(n.src))return n}return null},Yp=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(kl).concat(r);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},$p=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"1.54.0",startTime:r})},yo=null,Wp=function(e){return yo!==null||(yo=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(wl),window.Stripe){r(window.Stripe);return}try{var o=Gp();o&&e?console.warn(wl):o||(o=Yp(e)),o.addEventListener("load",function(){window.Stripe?r(window.Stripe):n(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){n(new Error("Failed to load Stripe.js"))})}catch(i){n(i);return}})),yo},Vp=function(e,r,n){if(e===null)return null;var o=e.apply(void 0,r);return $p(o,n),o},Bl=Promise.resolve().then(function(){return Wp(null)}),Ll=!1;Bl.catch(function(t){Ll||console.warn(t)});var Fl=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Ll=!0;var o=Date.now();return Bl.then(function(i){return Vp(i,r,o)})};var Ae=A(require("react"));var Z=require("react/jsx-runtime"),jp="https://assets.duffel.com/components/3.1.7",qp=`${jp}/global.css`,zp="card",Zp="3.1.7",Kp={color:"var(--GREY-900)",fontFamily:'"-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "sans-serif"',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#ababb4"}},Xp={color:"#ef4444",iconColor:"#ef4444"},Jp=({styles:t,paymentIntentClientToken:e,onSuccessfulPayment:r,onFailedPayment:n})=>{let[o,i]=Ae.useState(null),[a,s]=Ae.useState(!1),[c,l]=Ae.useState(!1),[d,u]=Ae.useState(!1),[m,h]=Ae.useState(""),S=(0,Nt.useStripe)(),y=(0,Nt.useElements)();return Ae.useEffect(()=>{if(y&&!o){let N=y?.getElement(zp);N&&i(N)}},[y,o]),Ae.useEffect(()=>{o&&o.on("change",N=>{let{error:C,complete:ce}=N;C?(l(!0),h(C.message)):l(!1),s(!!ce)})},[o]),e?(0,Z.jsx)("div",{className:"card-payment__container",children:(0,Z.jsxs)("form",{onSubmit:async N=>{if(N.preventDefault(),!(!S||!y)&&o){u(!0);let C=atob(e),ce=JSON.parse(C),{client_secret:j}=ce,qe=await S.confirmCardPayment(j,{payment_method:{card:o,metadata:{duffel_components_version:Zp||"failed-to-get-version"}}});if(u(!1),qe.error){let{error:ye}=qe;n(ye)}else r()}},children:[d&&(0,Z.jsx)("div",{className:"card-payment--in-progress","aria-live":"polite","aria-busy":"true"}),(0,Z.jsx)(Nt.CardElement,{className:"card-details",options:{style:{base:{...Kp,...t?.fontFamily&&{fontFamily:t.fontFamily}},invalid:{...Xp}}}}),(0,Z.jsx)("div",{className:"card-payment__container--invalid",role:"alert",children:c&&m}),(0,Z.jsx)(ee,{className:"card-payment__pay-button",type:"submit",disabled:!a||d,"aria-label":"Pay",children:d?"Processing...":"Pay"})]})}):null},Hl=t=>{let[e,r]=Ae.useState(null);to(t.debug||!1);let n=atob(t.paymentIntentClientToken),o;try{o=JSON.parse(n)}catch{throw new Error("Invalid Duffel payment intent client token provided")}let{publishable_key:i}=o;Ae.useEffect(()=>{if(!e&&i){let s=Fl(i);s&&r(s)}},[e,i]);let a={...t.styles?.accentColor&&{"--ACCENT":t.styles.accentColor},...t.styles?.accentColor&&ao(t.styles.accentColor)&&{"--SECONDARY":"black","--TERTIARY":"grey"},...t.styles?.fontFamily&&{"--FONT-FAMILY":t.styles.fontFamily},...t.styles?.buttonCornerRadius&&{"--BUTTON-RADIUS":t.styles.buttonCornerRadius}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("link",{rel:"stylesheet",href:qp}),(0,Z.jsx)("div",{className:"duffel-components",style:a,children:(0,Z.jsx)(pr,{children:(0,Z.jsx)(Nt.Elements,{stripe:e,children:(0,Z.jsx)(Jp,{...t})})})})]})};var Wl=require("react/jsx-runtime"),Ki="duffel-payments",Xi=class extends HTMLElement{root;connectedCallback(){let e=document.createElement("div");this.appendChild(e),this.root=(0,Ul.createRoot)(e)}render(e){if(!this.root)throw"It was not possible to render `duffel-payments` because `this.root` is missing.";this.root.render((0,Wl.jsx)(Hl,{...e,onSuccessfulPayment:()=>{this.dispatchEvent(new CustomEvent("onSuccessfulPayment",{composed:!0}))},onFailedPayment:r=>{this.dispatchEvent(new CustomEvent("onFailedPayment",{detail:{error:r},composed:!0}))}}))}};window.customElements.get(Ki)||window.customElements.define(Ki,Xi);function Ji(t){let e=document.querySelector(Ki);if(!e)throw new Error(`Could not find duffel-payments element in the DOM. Maybe you need to call ${t} after 'window.onload'?`);return e}function Gl(t){Ji("renderDuffelPaymentsCustomElement").render(t)}function Yl(t){Ji("onDuffelPaymentsPayloadReady").addEventListener("onPayloadReady",t)}function $l(t){let e=Ji("onDuffelPaymentsPayloadReady"),r=n=>{t(n.detail.error)};e.addEventListener("onPayloadReady",r)}
31
31
  /*! Bundled license information:
32
32
 
33
33
  classnames/index.js: