1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,378010,e=>{"use strict";var t=e.i(155138),n=e.i(312284),r=e.i(708128),i=e.i(125829),o=e.i(85730),a=e.i(506386),s=e.i(999160),u=e.i(640488),l=e.i(548909),c=e.i(899964),d=e.i(333273),f=e.i(49765),p=e.i(235899),g=e.i(826750),h=e.i(203329),v=e.i(579714),m=e.i(151424),y=e.i(143592),b=e.i(301948),S=e.i(770576),w=e.i(367435),_=e.i(821011),E=e.i(658773),T=e.i(469056),k=e.i(899920),C=e.i(164120),I=e.i(337034),P=e.i(266825),A=e.i(837393),O=e.i(955170),x=e.i(181043),R=e.i(335687),L=e.i(84562),N=e.i(445238),D=e.i(946974),U=e.i(829192),M=e.i(231880),j=e.i(926900),q=e.i(998602),F=e.i(909021),V=e.i(104440),B=e.i(424767),z=e.i(643122),H=e.i(886316),W=e.i(2887),G=e.i(430274),K=e.i(658117),Y=e.i(357870),$=e.i(582022),Q=e.i(726933),J=e.i(882153),X=e.i(196686),Z=e.i(817062),ee=e.i(132726),et=e.i(792805),en=e.i(112547),er=e.i(440703),ei=e.i(453874),eo=e.i(325929),ea=e.i(297144),es=e.i(101325),eu=e.i(428164),el=e.i(301176),ec=e.i(869817),ed=e.i(610821),ef=e.i(637173),ep=e.i(399403),eg=e.i(35505),eh=e.i(238437),ev=e.i(253255),em=e.i(603236),ey=e.i(283258),eb=e.i(999309),eS=e.i(422205),ew=e.i(868948),e_=e.i(632458),eE=e.i(170197),eT=e.i(911422),ek=e.i(738894),eC=e.i(658484),eI=e.i(461751),eP=e.i(918278),eA=e.i(96105),eO=e.i(597746),ex=e.i(435412),eR=e.i(618377),eL=e.i(290400),eN=e.i(152033),eD=e.i(828110),eU=e.i(288928),eM=e.i(976109),ej=e.i(706544),eq=e.i(971849),eF=e.i(218747),eV=e.i(759577),eB=e.i(182036),ez=e.i(40411),eH=e.i(392292),eW=e.i(783976),eG=e.i(23302),eK=e.i(201997),eY=e.i(285760),e$=e.i(810384),eQ=e.i(751059),eJ=e.i(465530),eX=e.i(571875),eZ=e.i(706354),e0=e.i(608720),e1=e.i(989299),e2=e.i(613329),e3=e.i(712707),e4=e.i(437485),e5=e.i(383371),e8=e.i(361204),e7=e.i(632884),e6=e.i(735160),e9=e.i(697626),te=e.i(458806),tt=e.i(67823),tn=e.i(207729),tr=e.i(873963),ti=e.i(239389),to=e.i(435341),ta=e.i(734709),ts=e.i(347766),tu=e.i(292916),tl=e.i(705393),tc=e.i(87530),td=e.i(996804),tf=e.i(605586),tp=e.i(157931),tg=e.i(15646),th=e.i(277541),tv=e.i(921026),tm=e.i(563138),ty=e.i(151330),tb=e.i(982605),tS=e.i(875266),tw=e.i(88350),t_=e.i(100409),tE=e.i(790718),tT=e.i(693690),tk=e.i(448723),tC=e.i(65778),tI=e.i(659679),tP=e.i(772007),tA=e.i(903827),tO=e.i(511676),tx=e.i(470063),tR=e.i(182358),tL=e.i(510844),tN=e.i(354013),tD=e.i(179406),tU=e.i(440892),tM=e.i(327503),tj=e.i(959020),tq=e.i(681603),tF=e.i(54767),tV=e.i(917516),tB=e.i(951353),tz=e.i(719583),tH=e.i(703231),tW=e.i(561445),tG=e.i(499779),tK=e.i(735223),tY=e.i(21029),t$=e.i(852361),tQ=e.i(611411),tJ=e.i(180352),tX=e.i(814184),tZ=e.i(225238),t0=e.i(254520),t1=e.i(258022),t2=e.i(585224),t3=e.i(353440),t4=e.i(629002),t5=e.i(730452),t8=e.i(249706),t7=e.i(59726),t6=e.i(373911),t9=e.i(864625),ne=e.i(802886),nt=e.i(116958),nn=e.i(23527),nr=e.i(558992),ni=e.i(768538),no=e.i(165222),na=e.i(656779),ns=e.i(70588),nu=e.i(287142),nl=e.i(803444),nc=e.i(153020),nd=e.i(653660),nf=e.i(622806),np=e.i(133544),ng=e.i(276735),nh=e.i(241324),nv=e.i(29601),nm=e.i(37100),ny=e.i(294001),nb=e.i(277222),nS=e.i(661945),nw=e.i(497713),n_=e.i(967228),nE=e.i(622464),nT=e.i(751038),nk=e.i(247495),nC=e.i(321823),nI=e.i(881252),nP=e.i(989481),nA=e.i(743941),nO=e.i(777364),nx=e.i(430503),nR=e.i(600916),nL=e.i(751220),nN=e.i(834928),nD=e.i(378676),nU=e.i(822717),nM=e.i(870077),nj=e.i(970375),nq=e.i(824479),nF=e.i(7863),nV=e.i(295632),nB=e.i(455486),nz=e.i(580545),nH=e.i(933478),nW=e.i(533923),nG=e.i(123122),nK=e.i(410448),nY=e.i(887188),n$=e.i(601347),nQ=e.i(721263),nJ=e.i(338997),nX=e.i(445334),nZ=e.i(968417),n0=e.i(451288),n1=e.i(285007),n2=e.i(911390),n3=e.i(876802),n4=e.i(485465),n5=e.i(736593),n8=e.i(803772),n7=e.i(198823),n6=e.i(65981),n9=e.i(47171),re=e.i(30262),rt=e.i(796882),rn=e.i(309703),rr=e.i(811536),ri=e.i(409832),ro=e.i(308371),ra=e.i(128267),rs=e.i(390174),ru=e.i(907435),rl=e.i(734081),rc=e.i(873681),rd=e.i(193248),rf=e.i(348083),rp=e.i(464338),rg=e.i(344862),rh=e.i(326727),rv=e.i(678866),rm=e.i(893160),ry=e.i(151944),rb=e.i(723517);e.s(["ANCHOR_QUERY_PARAM",()=>s.l,"AiCompanionUpsellTemplateV1",()=>r.n,"AiCompanionUpsellTemplateV2",()=>rh.n,"AiCompanionUpsellTemplateV3",()=>ry.n,"BreathPractice",()=>e$.n,"BundleUpsellV2",()=>eI.n,"BundleUpsellV3",()=>t8.n,"BundleUpsellV4",()=>t6.n,"BundleUpsellV4Compl",()=>nt.n,"BundleUpsellV6",()=>nu.n,"CONFIGS",()=>t.CONFIGS,"CONFIGS_BY_TEMPLATE_ID",()=>t.CONFIGS_BY_TEMPLATE_ID,"ChartWithIconInfoBox",()=>en.n,"CreatingPlanStep",()=>a.n,"CreatingPlanStepV2",()=>ny.n,"CrossSellUpsellV1",()=>nc.n,"CrossSellUpsellV2",()=>nf.n,"CrossSellUpsellV2Compl",()=>nh.n,"DEFAULT_LAYOUT_TYPE",()=>s.a,"DEFAULT_SECTION_TYPES",()=>s.g,"DeservePresentation",()=>F.n,"EmailStep",()=>M.n,"EmailStepSocial",()=>eh.n,"EmailStepV2",()=>ep.n,"EmailStepWithSubscribe",()=>ef.n,"EventChartStep",()=>i.n,"EventChartStepV2",()=>et.n,"EventChartStepWithEventMarker",()=>er.n,"EventChartStepYellowMarker",()=>eo.n,"Footer",()=>r.W,"HarvardStep",()=>es.n,"HarvardStepV2",()=>el.n,"HaveChosenSpirioStep",()=>n.n,"HaveChosenSpirioStepV2",()=>nB.n,"Header",()=>r.K,"HealWhatHurtsUpsellV1",()=>tJ.n,"HealWhatHurtsUpsellV2",()=>rd.n,"HealWhatHurtsUpsellV3",()=>rp.n,"ImageButton",()=>s._t,"ImageInfoCardStep",()=>o.n,"ImageTeaserTemplate",()=>x.n,"ImageTeaserWithParagraphs",()=>N.n,"ImageTeaserWithParagraphsBg",()=>U.n,"InnerCriticUpsellV1",()=>rr.n,"InnerCriticUpsellV2",()=>ra.n,"InnerCriticUpsellV3",()=>ru.n,"LAYOUT_BY_ID",()=>s.o,"LAYOUT_REGISTRY",()=>s.s,"MeaningfulQuestionsTemplateV4",()=>t3.n,"MeaningfulQuestionsV2",()=>eP.n,"MeaningfulQuestionsV3",()=>t1.n,"Modal",()=>a.i,"PageBuilderTemplate",()=>s.c,"PartsTitle",()=>a.s,"PaywallPageMGMV1",()=>eW.n,"PhoneStep",()=>eg.n,"PlanChartStep",()=>ev.n,"PlanChartStepV2",()=>ey.n,"PlanPreviewBeforeAfterStep",()=>
1e_.n,"PlanPreviewCarouselStep",()=>ew.n,"PlanPreviewExpertsStep",()=>eE.n,"PlanPreviewReviewStep",()=>eT.n,"PlanPreviewStep",()=>eS.n,"PushPromptLoaderStep",()=>J.n,"QuizAgeInputStep",()=>n7.n,"QuizAgeSelect",()=>v.n,"QuizAgeSelectWithImage",()=>c.n,"QuizCollageStart",()=>n$.n,"QuizEmailStep",()=>rt.n,"QuizFrequencyEmotionsStep",()=>B.n,"QuizGenderSelect",()=>u.n,"QuizGenderSelectExtended",()=>d.n,"QuizGenderSelectExtendedV2",()=>g.n,"QuizGenderSelectWithProgress",()=>nK.n,"QuizGenderSelectWithTip",()=>n5.n,"QuizImageDescriptionSelect",()=>k.n,"QuizImageEmojiSelect",()=>w.n,"QuizImageGridSelect",()=>C.n,"QuizImageSelect",()=>E.n,"QuizImageStart",()=>n0.n,"QuizNameInputStep",()=>n9.n,"QuizOpenAnswerStep",()=>Q.n,"QuizRatingScale",()=>nz.n,"QuizRatingScaleWithImage",()=>n3.n,"QuizScaleStep",()=>nG.n,"QuizSideImageSelect",()=>I.n,"QuizStatStep",()=>nJ.n,"QuizStep",()=>P.n,"QuizStepExtended",()=>nx.n,"QuizStepLikertScale",()=>nW.n,"QuizStepWithImageMap",()=>nD.n,"QuizStepWithImageMapV2",()=>nM.n,"QuizStepWithOther",()=>nA.n,"QuizStepWithTip",()=>nL.n,"QuizTeaser",()=>O.n,"QuizYourName",()=>j.n,"SECTION_ANCHOR_PATTERN",()=>s.u,"SECTION_FEATURE_IDS",()=>s.v,"SECTION_FEATURE_REGISTRY",()=>s.y,"SECTION_REGISTRY",()=>s._,"SHOW_LOCAL_CURRENCIES_FEATURE_ID",()=>r.o,"ScratchStep",()=>nb.n,"ScratchStepV2",()=>nw.n,"ScratchStepV3",()=>nE.n,"SellingPageBreathwork",()=>eC.n,"SellingPageBreathworkCompl",()=>ej.n,"SellingPageBreathworkComplV2",()=>eJ.n,"SellingPageBreathworkComplV3",()=>eX.n,"SellingPageBreathworkV2",()=>
1eK.n,"SellingPageBreathworkV3",()=>eY.n,"SellingPageHighVibrShortCompl",()=>e6.n,"SellingPageHighVibration",()=>eO.n,"SellingPageHighVibrationEuPrice",()=>e0.n,"SellingPageHighVibrationEuPriceUpgr50",()=>e7.n,"SellingPageHighVibrationLocalCurrency",()=>e5.n,"SellingPageHighVibrationPlanUpgrComplV2",()=>eH.n,"SellingPageHighVibrationPlanUpgrComplV3",()=>eG.n,"SellingPageQigongV2",()=>tt.n,"SellingPageSleepACompl",()=>eU.n,"SellingPageSleepAComplV2",()=>eM.n,"SellingPageSleepBCompl",()=>eq.n,"SellingPageSleepBComplV2",()=>eF.n,"SellingPageSomaticYoga",()=>eZ.n,"SellingPageSomaticYogaCompl",()=>e2.n,"SellingPageStep",()=>ek.t,"SellingPageStepEmail",()=>eR.t,"SellingPageStepEmailCompl",()=>eV.n,"SellingPageStepKundaliniArchetype_15_40",()=>eL.n,"SellingPageStepKundaliniArchetype_15_40_ComplV2",()=>eB.n,"SellingPageStepKundaliniArchetype_15_40_ComplV3",()=>tf.n,"SellingPageStepKundaliniArchetype_15_40_Compl_CF",()=>tI.n,"SellingPageStepKundaliniChakra",()=>eA.n,"SellingPageStepKundaliniChakraLifetime",()=>tL.n,"SellingPageStepKundaliniChakraLifetime_Compl",()=>tN.n,"SellingPageStepKundaliniChakra_ComplV2",()=>tA.n,"SellingPageStepKundaliniChakra_ComplV3",()=>tO.n,"SellingPageStepKundaliniCommonComplV2",()=>td.n,"SellingPageStepKundaliniCommonCompl_PinnedBtn",()=>tv.n,"SellingPageStepKundaliniCommon_PinnedBtn",()=>tg.n,"SellingPageStepKundaliniHighlights_15_40_CF",()=>t_.n,"SellingPageStepKundaliniHighlights_15_40_Compl_CF",()=>tT.n,"SellingPageStepKundalini_15_40",()=>ty.n,"SellingPageStepKundalini_15_40_ComplV2",()=>tS.n,"SellingPageStepKundalini_15_40_PlanUpgr",()=>tw.n,"SellingPageStepKundalini_15_50_ComplV2",()=>tc.n,"SellingPageStepLandingHighVibr",()=>tR.n,"SellingPageStepLandingNidra",()=>tx.n,"SellingPageTaiChiC",()=>ts.n,"SellingPageTaiChiComplV2",()=>tr.n,"SellingPageTaiChiV2",()=>te.n,"SellingPageTaiChiV3",()=>to.n,"SignupMGMTemplate",()=>tU.n,"SignupTemplate",()=>tD.n,"SocialProofStep",()=>nj.n,"SoundVitalityTemplateV2",()=>tW.n,"SoundVitalityTemplateV3",()=>tY.n,"SoundVitalityTemplateV4",()=>tQ.n,"SoundVitalityTemplateV5",()=>tZ.n,"SubscribeEmailStep",()=>nk.n,"Subtitle",()=>n.r,"SubtitleWithParts",()=>o.r,"SuccessMGMStep",()=>tF.n,"SuccessStep",()=>tq.n,"SuccessStepV2",()=>tB.n,"SuccessStepV3",()=>tz.n,"SuccessStepV4",()=>tH.n,"SummaryStep",()=>H.n,"SummaryStepAI",()=>$.n,"SummaryStepManifestation",()=>G.n,"SummaryStepV2",()=>Y.n,"TEMPLATES",()=>t.TEMPLATES,"TEMPLATES_BY_TEMPLATE_ID",()=>t.TEMPLATES_BY_TEMPLATE_ID,"TeaserHeroImageStep",()=>b.n,"TeaserWithInfoCard",()=>ez.n,"TemplateLayout",()=>r.U,"Title",()=>a.o,"TrustTeaserStep",()=>nZ.n,"UniversityStep",()=>nI.n,"UpsellSellingPage",()=>nr.n,"UpsellSellingPageCompl",()=>no.n,"Web2AppLanding",()=>n2.n,"aiCompanionUpsellTemplateV1Config",()=>f.t,"aiCompanionUpsellTemplateV1InrConfig",()=>rg.t,"aiCompanionUpsellTemplateV2Config",()=>rv.t,"aiCompanionUpsellTemplateV3Config",()=>rb.t,"breathPracticeConfig",()=>eQ.t,"buildSectionAnchorOptions",()=>s.r,"bundleUpsellConfigV2",()=>t5.t,"bundleUpsellV3Config",()=>t7.t,"bundleUpsellV4ComplConfig",()=>nn.t,"bundleUpsellV4Config",()=>t9.t,"bundleUpsellV4InrConfig",()=>ne.t,"bundleUpsellV5Config",()=>na.t,"bundleUpsellV5InrConfig",()=>ns.t,"bundleUpsellV6Config",()=>nl.t,"creatingPlanStepConfig",()=>nm.t,"crossSellUpsellV1Config",()=>nd.t,"crossSellUpsellV2ComplConfig",()=>nv.t,"crossSellUpsellV2Config",()=>np.t,"crossSellUpsellV2InrConfig",()=>ng.t,"default",()=>t.default,"deservePresentationConfig",()=>V.t,"duplicateSection",()=>s.i,"emailStepConfig",()=>ed.t,"evaluateSectionVisibility",()=>s.E,"eventChartStepConfig",()=>Z.t,"eventChartStepV2Config",()=>ee.t,"eventChartStepWithEventMarkerConfig",()=>ei.t,"eventChartStepYellowMarkerConfig",()=>ea.t,"featuresForSectionType",()=>s.b,"featuresForTemplate",()=>s.x,"getFeatureConfig",()=>s.S,"harvardStepConfig",()=>eu.t,"harvardStepV2Config",()=>ec.t,"haveChosenSpirioStepConfig",()=>nF.t,"healWhatHurtsUpsellV1Config",()=>rl.t,"healWhatHurtsUpsellV1InrConfig",()=>rc.t,"healWhatHurtsUpsellV2Config",()=>rf.t,"imageInfoCardStepConfig",()=>nV.t,"imageTeaserTemplateConfig",()=>L.t,"imageTeaserWithParagraphsConfig",()=>D.t,"innerCriticUpsellV1Config",()=>
1ri.t,"innerCriticUpsellV1InrConfig",()=>ro.t,"innerCriticUpsellV2Config",()=>rs.t,"interp",()=>s.D,"isFeatureEnabled",()=>s.C,"meaningfulQuestionsConfigV2",()=>tK.t,"meaningfulQuestionsTemplateV4Config",()=>t4.t,"meaningfulQuestionsV3Config",()=>t2.t,"metadata",()=>t.metadata,"moneyFormatter",()=>s.w,"normalizeAnchor",()=>s.d,"pageBuilderTemplateConfig",()=>rm.t,"parseSectionsJson",()=>s.n,"planChartStepConfig",()=>em.t,"planChartStepV2Config",()=>eb.t,"pushPromptLoaderStepConfig",()=>X.t,"quizAgeInputStepConfig",()=>n6.t,"quizAgeSelectConfig",()=>m.t,"quizAgeSelectWithImageConfig",()=>y.t,"quizCollageStartConfig",()=>nQ.t,"quizEmailStepConfig",()=>rn.t,"quizFrequencyEmotionsStepConfig",()=>z.t,"quizGenderSelectConfig",()=>l.t,"quizGenderSelectExtendedConfig",()=>p.t,"quizGenderSelectExtendedV2Config",()=>h.t,"quizGenderSelectWithProgressConfig",()=>nY.t,"quizGenderSelectWithTipConfig",()=>n8.t,"quizImageEmojiSelectConfig",()=>_.t,"quizImageSelectConfig",()=>T.t,"quizImageStartConfig",()=>n1.t,"quizNameInputStepConfig",()=>re.t,"quizRatingScaleConfig",()=>nH.t,"quizRatingScaleWithImageConfig",()=>n4.t,"quizStatStepConfig",()=>nX.t,"quizStepConfig",()=>A.t,"quizStepExtendedConfig",()=>nR.t,"quizStepWithImageMapConfig",()=>nU.t,"quizStepWithOtherConfig",()=>nO.t,"quizStepWithTipConfig",()=>nN.t,"quizTeaserConfig",()=>R.t,"quizYourNameConfig",()=>q.t,"resolveLocalCurrencyConversion",()=>r.c,"scratchStepConfig",()=>nS.t,"scratchStepConfigV2",()=>n_.t,"scratchStepConfigV3",()=>nT.t,"sectionAnchorOf",()=>s.f,"sectionKey",()=>s.O,"sellingPageConfig",()=>ex.t,"sellingPageHighVibrShortComplConfig",()=>e9.t,"sellingPageHighVibrationConfig",()=>eD.t,"sellingPageHighVibrationEuPriceConfig",()=>e4.t,"sellingPageHighVibrationLocalCurrencyConfig",()=>e8.t,"sellingPageKundaliniArchetype_15_40Config",()=>tC.t,"sellingPageKundaliniArchetype_15_40_Compl_CFConfig",()=>tP.t,"sellingPageKundaliniCommonComplV2Config",()=>tp.t,"sellingPageKundaliniCommonCompl_PinnedBtnConfig",()=>tm.t,"sellingPageKundaliniCommon_PinnedBtnConfig",()=>th.t,"sellingPageKundaliniHighlights_15_40_CFConfig",()=>tE.t,"sellingPageKundaliniHighlights_15_40_Compl_CFConfig",()=>tk.t,"sellingPageKundalini_15_40Config",()=>tb.t,"sellingPageQigongV2Config",()=>tl.t,"sellingPageSomaticYogaComplConfig",()=>e3.t,"sellingPageSomaticYogaConfig",()=>e1.t,"sellingPageStepEmailConfig",()=>eN.t,"sellingPageTaiChiCConfig",()=>tu.t,"sellingPageTaiChiComplV2Config",()=>ti.t,"sellingPageTaiChiV2Config",()=>tn.t,"sellingPageTaiChiV3Config",()=>ta.t,"signupTemplateConfig",()=>tM.t,"slugifyAnchor",()=>s.p,"socialProofStepConfig",()=>nq.t,"soundVitalityTemplateConfigV2",()=>tG.t,"soundVitalityTemplateV3Config",()=>t$.t,"soundVitalityTemplateV4Config",()=>tX.t,"soundVitalityTemplateV5Config",()=>t0.t,"subscribeEmailStepConfig",()=>nC.t,"successStepConfig",()=>tj.t,"successStepConfigV2",()=>tV.t,"suggestAnchor",()=>s.m,"summaryStepConfig",()=>W.t,"summaryStepManifestationConfig",()=>K.t,"supportedCurrencies",()=>s.T,"teaserHeroImageStepConfig",()=>S.t,"universityStepConfig",()=>nP.t,"upsellSellingPageConfig",()=>ni.t,"validateAnchor",()=>s.h,"validateRequiredProps",()=>r.u,"withCurrencyReplacement",()=>r.d])},285051,e=>{"use strict";e.s(["reportAction",0,function(e,t){window.newrelic?window.newrelic.addPageAction(e,t):console.log(`New Relic: PageAction '${e}'`,t)},"reportError",0,function(e,t){window.newrelic?window.newrelic.noticeError(e,t):console.error("New Relic agent not available. Error:",e,t)}])},427968,(e,t,n)=>{var r=Object.prototype.hasOwnProperty;function i(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(n){if(null===n||"object"!=typeof n)return n;if(-1!==t.indexOf(n))return"[Circular]";if(t.push(n),"function"==typeof n.toJSON)try{var o=e(n.toJSON());return t.pop(),o}catch(e){return i(e)}if(Array.isArray(n)){var a=n.map(e);return t.pop(),a}var s=Object.keys(n).reduce(function(t,o){return t[o]=e(function(e,t){if(r.call(e,t))try{return e[t]}catch(e){return i(e)}return e[t]}(n,o)),t},{});return t.pop(),s}(e)}t.exports=function(e,t,n){return JSON.stringify(o(e),t,n)},t.exports.ensureProperties=o},14919,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Observable=void 0;let r=e=>!!Symbol[e],i=e=>r(e)?Symbol[e]:"@@"+e,o=i("iterator"),a=i("observable"),s=i("species");function u(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw TypeError(n+" is not a function");return n}}function l(e){let t=e.constructor;return void 0!==t&&null===(t=t[s])&&(t=void 0),void 0!==t?t:m}function c(e){c.log?c.log(e):setTimeout(()=>{throw e})}function d(e){Promise.resolve().then(()=>{try{e()}catch(e){c(e)}})}function f(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=u(t,"unsubscribe");e&&e.call(t)}}catch(e){c(e)}}function p(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,n){e._state="running";let r=e._observer;try{let i=u(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(p(e),i)i.call(r,n);else throw n;break;case"complete":p(e),i&&i.call(r)}}catch(e){c(e)}"closed"===e._state?f(e):"running"===e._state&&(e._state="ready")}function h(e,t,n){if("closed"!==e._state){if("buffering"===e._state)return void e._queue.push({type:t,value:n});if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:n}],d(()=>(function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(g(e,t[n].type,t[n].value),"closed"!==e._state);++n);}})(e));return}g(e,t,n)}}class v{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){h(n,"next",e)},error(e){h(n,"error",e)},complete(){h(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}
1unsubscribe(){"closed"!==this._state&&(p(this),f(this))}}class m{constructor(e){if(!(this instanceof m))throw TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return("object"!=typeof e||null===e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new v(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=l(this),n=arguments.length>1,r=!1,i=arguments[1],o=i;return new t(t=>this.subscribe({next(i){let a=!r;if(r=!0,!a||n)try{o=e(o,i)}catch(e){return t.error(e)}else o=i},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=l(this);return new t(n=>{let r,i=0;return!function o(a){r=a.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=l(this);return new t(n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return n.error(e)}let a=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(a);e>=0&&r.splice(e,1),o()}});r.push(a)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[a](){return this}static from(e){let t="function"==typeof this?this:m;if(null==e)throw TypeError(e+" is not an object");let n=u(e,a);if(n){let r=n.call(e);if(Object(r)!==r)throw TypeError(r+" is not an object");return r instanceof m&&r.constructor===t?r:new t(e=>r.subscribe(e))}if(r("iterator")&&(n=u(e,o)))return new t(t=>{d(()=>{if(!t.closed){for(let r of n.call(e))if(t.next(r),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{d(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})});throw TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:m)(t=>{d(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})})}static get[s](){return this}}n.Observable=m,Object.defineProperty(m,Symbol("extensions"),{value:{symbol:a,hostReportError:c},configurable:!0})},523072,(e,t,n)=>{t.exports=e.r(14919).Observable},593414,(e,t,n)=>{t.exports=e.r(381840)},352262,e=>{"use strict";let t;var n,r,i,o,a,s,u,l,c,d,f,p,g,h,v,m,y,b,S,w,_,E,T,k,C,I,P,A,O,x,R,L,N=e.i(715216),D=e.i(274739);let U=(0,D.createContext)(null);function M(){let e=(0,D.useContext)(U);if(!e)throw Error("useFunnelContext must be used within FunnelProvider");return e}var j=e.i(400341);function q(e){return"screen"===e.nodeType}function F(e){return`funnel_answers_${e}`}let V={read(e,t){if(!t)return{};let n=function(e){try{let t=localStorage.getItem(F(e));if(!t)return null;let n=JSON.parse(t);if(!n||"object"!=typeof n||Array.isArray(n))return null;let{userId:r,answers:i}=n;if("string"!=typeof r||!r||!i||"object"!=typeof i||Array.isArray(i))return null;return{userId:r,answers:Object.fromEntries(Object.entries(i).filter(([,e])=>"string"==typeof e||Array.isArray(e)&&e.every(e=>"string"==typeof e)))}}catch{return null}}(e);return n&&n.userId===t?n.answers:{}},merge(e,t,n){if(t)try{let r={userId:t,answers:{...V.read(e,t),...n}};localStorage.setItem(F(e),JSON.stringify(r))}catch{}},clear(e){try{localStorage.removeItem(F(e))}catch{}}};e.i(283018);
1var B=function(e,t){return(B=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function z(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var H=function(){return(H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function W(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function G(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}function K(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function Y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function $(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Q(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,(n=y||(y={}))[n.None=0]="None",n[n.Error=1]="Error",n[n.Warn=2]="Warn",n[n.Verbose=3]="Verbose",n[n.Debug=4]="Debug";var J=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},X=function(e){return function(){var t=H({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},Z=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=Y(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(a in e))return;e=e[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},ee=function(e,t){return function(){var n,r,i={};try{for(var o=Y(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=Z(e,s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},et=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=n(),u=s.logger,l=s.logLevel;if(l&&l<y.Debug||!l||!u)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:J(1),time:{start:new Date().toISOString()},states:{}};r&&c.states&&(c.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),u.debug(JSON.stringify(c,null,2))}):(r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),u.debug(JSON.stringify(c,null,2))),d}};(r=b||(b={})).SET="$set",r.SET_ONCE="$setOnce",r.ADD="$add",r.APPEND="$append",r.PREPEND="$prepend",r.REMOVE="$remove",r.PREINSERT="$preInsert",r.POSTINSERT="$postInsert",r.UNSET="$unset",r.CLEAR_ALL="$clearAll",(i=S||(S={})).IDENTIFY="$identify",i.GROUP_IDENTIFY="$groupidentify",i.REVENUE="revenue_amount";var en="".concat("AMP","_unsent"),er="$default_instance",ei="https://api2.amplitude.com/2/httpapi",eo="https://api.eu.amplitude.com/2/httpapi",ea="https://api2.amplitude.com/batch",es="https://api.eu.amplitude.com/batch",eu="dclid",el="fbclid",ec="gbraid",ed="gclid",ef="ko_click_id",ep="li_fat_id",eg="msclkid",eh="rdt_cid",ev="ttclid",em="twclid",ey="wbraid",eb={utm_campaign:void 0,utm_c
1ontent:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},eS=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],ew=["authorization","cookie","set-cookie"],e_=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!eE(t,n))return!1}return!0},eE=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=Y(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&e_(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return e_(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},eT=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return H({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(w.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(w.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(w.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(w.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(w.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(w.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(w.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(w.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(w.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[w.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[w.CLEAR_ALL]||this._propertySet.has(t))&&(e===w.ADD?"number"==typeof n:e===w.UNSET||e===w.REMOVE||eE(t,n))},e}();(o=w||(w={})).SET="$set",o.SET_ONCE="$setOnce",o.ADD="$add",o.APPEND="$append",o.PREPEND="$prepend",o.REMOVE="$remove",o.PREINSERT="$preInsert",o.POSTINSERT="$postInsert",o.UNSET="$unset",o.CLEAR_ALL="$clearAll";var ek=[w.CLEAR_ALL,w.UNSET,w.SET,w.SET_ONCE,w.ADD,w.APPEND,w.PREPEND,w.PREINSERT,w.POSTINSERT,w.REMOVE];(a=_||(_={})).Unknown="unknown",a.Skipped="skipped",a.Success="success",a.RateLimit="rate_limit",a.PayloadTooLarge="payload_too_large",a.Invalid="invalid",a.Failed="failed",a.Timeout="Timeout",a.SystemError="SystemError";var eC=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=_.Unknown),{event:e,code:t,message:n}},eI=function(){var t="ampIntegrationContext";return"u">typeof globalThis&&void 0!==globalThis[t]?globalThis[t]:"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof self?self:e.g},eP=Q([],$(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),eA=function(e){var t,n=eI();if(!(null==(t=null==n?void 0:n.crypto)?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,eA);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,Q([],$(r.entries()),!1).map(function(e){var t=$(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(eP[r]):eP[r]}).join("")},eO=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return G(this,void 0,void 0,function(){var i;return K(this,function(o){switch(o.label){case 0:if(void 0===e.name&&(e.name=eA(),this.loggerProvider.warn("Plugin name is undefined.\n Generating a random UUID for plugin name: ".concat(e.name,".\n Set a name for the plugin to prevent it from being added multiple times."))),i=e.name,this.pluginStatus.has(i))return this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2];return e.type=null!=(n=e.type)?n:"enrichment",this.pluginStatus.set(i,"locked"),[4,null==(r=e.setup)?void 0:r.call(e,t,this.client)];case 1:if(o.sent(),"locked"!==this.pluginStatus.get(i))return[2];return this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2]}})})},e.prototype.deregister=function(e,t){var n;return G(this,void 0,void 0,function(){var r,i;return K(this,function(o){switch(o.label){case 0:if(this.pluginStatus.delete(e),-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null==(n=i.teardown)?void 0:n.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return G(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,l,c,d,f,p,g,h;return K(this,function(v){switch(v.label){case 0:if(!e)return[2];t=$(e,1)[0],n=$(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),r=this.plugins.filter(function(e){return"before"===e.type}),v.label=1;case 1:v.trys.push([1,6,7,8]),o=(i=Y(r)).next(),v.label=2;case 2:if(o.done)return[3,5];if(!(a=o.value).execute)return[3,4];return[4,a.execute(H({},t))];case 3:if(null===(s=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),v.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:v.sent()},[3,8];
1case 7:try{o&&!o.done&&(p=i.return)&&p.call(i)}finally{if(f)throw f.error}return[7];case 8:u=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),v.label=9;case 9:v.trys.push([9,14,15,16]),c=(l=Y(u)).next(),v.label=10;case 10:if(c.done)return[3,13];if(!(a=c.value).execute)return[3,12];return[4,a.execute(H({},t))];case 11:if(null===(s=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),v.label=12;case 12:return c=l.next(),[3,10];case 13:return[3,16];case 14:return g={error:v.sent()},[3,16];case 15:try{c&&!c.done&&(h=l.return)&&h.call(l)}finally{if(g)throw g.error}return[7];case 16:return d=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(d.map(function(e){var n=H({},t);return e.execute(n).catch(function(e){return eC(n,0,String(e))})})).then(function(e){var r=$(e,1)[0]||eC(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return G(this,void 0,void 0,function(){var e,t=this;return K(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onIdentityChanged)||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onSessionIdChanged)||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onOptOutChanged)||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return G(this,void 0,void 0,function(){var t,n,r,i,o,a;return K(this,function(s){switch(s.label){case 0:s.trys.push([0,7,8,9]),n=(t=Y(this._optOutListeners)).next(),s.label=1;case 1:if(n.done)return[3,6];r=n.value,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r(e)];case 3:return s.sent(),[3,5];case 4:return i=s.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o={error:s.sent()},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),ex=function(e,t){return H(H({},t),{event_type:S.IDENTIFY,user_properties:e.getUserProperties()})},eR=function(e,t,n,r){var i;return H(H({},r),{event_type:S.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},eL=function(e,t,n){var r,i=new eT;return i.set(e,t),H(H({},n),{event_type:S.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},eN=function(e){return{promise:e||Promise.resolve()}},eD=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new eO(this),this.name=e}return e.prototype._init=function(e){return G(this,void 0,void 0,function(){return K(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return G(this,void 0,void 0,function(){var t,n,r,i,o,a;return K(this,function(s){switch(s.label){case 0:t=this[e],this[e]=[],s.label=1;case 1:s.trys.push([1,8,9,10]),r=(n=Y(t)).next(),s.label=2;case 2:if(r.done)return[3,7];if(!((i=(0,r.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return s.sent(),[3,6];case 4:return[4,i];case 5:s.sent(),s.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o={error:s.sent()},[3,10];case 9:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}
1return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:s.sent(),s.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=H(H(H({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),eN(this.dispatch(r))},e.prototype.identify=function(e,t){var n=ex(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eN(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=eR(e,t,n,r);return eN(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=eL(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),eN(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=H(H({},t),{event_type:S.REVENUE,event_properties:e.getEventProperties()});return eN(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),eN())},e.prototype._addPlugin=function(e){return eN(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),eN())},e.prototype._removePlugin=function(e){return eN(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(eC(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return G(this,void 0,void 0,function(){var t=this;return K(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!=(t=this.userProperties)?t:{},r=H({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach(function(t){Object.values(b).includes(t)||(i[t]=e[t])}),ek.forEach(function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case b.CLEAR_ALL:Object.keys(r).forEach(function(e){delete r[e]});break;case b.UNSET:Object.keys(n).forEach(function(e){delete r[e]});break;case b.SET:Object.assign(r,n)}}}),Object.assign(r,i),r},e.prototype.process=function(e){return G(this,void 0,void 0,function(){var t,n;return K(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),this.config.optOut)return[2,eC(e,0,"Event skipped due to optOut config")];return e.event_type===S.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(t=r.sent()).code?this.config.loggerProvider.log(t.message):100===t.code?this.config.loggerProvider.warn(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return n=String(r.sent()),this.config.loggerProvider.error(n),[2,t=eC(e,0,n)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,!!e))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return eN(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eU=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])},eM="Amplitude Logger ",ej=function(){function e(){this.logLevel=y.None}return e.prototype.disable=function(){this.logLevel=y.None},e.prototype.enable=function(e){void 0===e&&(e=y.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<y.Verbose||console.log("".concat(eM,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<y.Warn||console.warn("".concat(eM,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<y.Error||console.error("".concat(eM,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<y.Debug||console.log("".concat(eM,"[Debug]: ").concat(e.join(" ")))},e}(),eq=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:er,logLevel:y.Warn,loggerProvider:new ej,offline:!1,optOut:!1,serverUrl:ei,serverZone:"US",useBatch:!1}},eF=function(){function e(e){this._optOut=!1;var t,n,r,i,o=eq();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(n=e.logLevel)?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!=(r=e.optOut)?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=eV(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
1,enumerable:!1,configurable:!0}),e}(),eV=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=eq().serverZone),void 0===n&&(n=eq().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:eq().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?es:eo:r?ea:ei)}},eB=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function ez(e){return e>=200&&e<300}var eH=new Set([ei,eo,ea,es]);function eW(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var eG=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return G(this,void 0,void 0,function(){var n,r=this;return K(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(en,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=eA()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),G(this,void 0,void 0,function(){var t,n,r=this;return K(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,eU(t,this.config.flushQueueSize).reduce(function(t,n){return G(r,void 0,void 0,function(){return K(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),G(this,void 0,void 0,function(){var r,i,o,a,s;return K(this,function(u){var l,c,d;switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,W(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eB,u.label=1;case 1:return u.trys.push([1,3,,4]),l=i=eV(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(c=this.config.enableRequestBodyCompression)&&(c=!1),o=!!eH.has(l)||c,[4,this.config.transportProvider.send(i,r,o)];case 2:if(null===(a=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in a?this.fulfillRequest(e,a.statusCode,"".concat(a.status,": ").concat(eW(a))):this.fulfillRequest(e,a.statusCode,a.status),[2];return this.handleResponse(a,e),[3,4];case 3:return s=(d=u.sent())instanceof Error?d.message:String(d),this.config.loggerProvider.error(s),null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:s,stack_trace:J()}),this.handleResponse({status:_.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){ez(e.statusCode)||null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:eW(e),stack_trace:J()});var n,r=e.status;switch(r){case _.Success:this.handleSuccessResponse(e,t);break;case _.Invalid:this.handleInvalidResponse(e,t);break;case _.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case _.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var r=new Set(Q(Q(Q(Q([],$(Object.values(e.body.eventsWithInvalidFields)),!1),$(Object.values(e.body.eventsWithMissingFields)),!1),$(Object.values(e.body.eventsWithInvalidIdLengths)),!1),$(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!r.has(i)||void n.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(eW(e));
1var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(eW(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,a=new Set(r),s=new Set(i),u=new Set(o),l=t.filter(function(t,r){return t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)?void n.fulfillRequest([t],e.statusCode,e.body.error):(u.has(r)&&(t.timeout=n.throttleTimeout),!0)});l.length>0&&this.config.loggerProvider.warn(eW(e));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;ez(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(r=this.diagnosticsClient)||r.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:J()})),this.removeEvents(e),e.forEach(function(e){return e.callback(eC(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),eK=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));e_(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?H({},this.properties):{};return e[E.REVENUE_PRODUCT_ID]=this.productId,e[E.REVENUE_QUANTITY]=this.quantity,e[E.REVENUE_PRICE]=this.price,e[E.REVENUE_TYPE]=this.revenueType,e[E.REVENUE_CURRENCY]=this.currency,e[E.REVENUE]=this.revenue,e[E.RECEIPT]=this.receipt,e[E.RECEIPT_SIG]=this.receiptSig,e},e}();(s=E||(E={})).REVENUE_PRODUCT_ID="$productId",s.REVENUE_QUANTITY="$quantity",s.REVENUE_PRICE="$price",s.REVENUE_TYPE="$revenueType",s.REVENUE_CURRENCY="$currency",s.REVENUE="$revenue",s.RECEIPT="$receipt",s.RECEIPT_SIG="$receiptSig";var eY=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:e$(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),e$=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},eQ=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),eJ=function(){return(eJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function eX(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function eZ(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var e0=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=eX(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next())if(a.value===i)return e===t}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var s=Array.isArray(e),u=Array.isArray(t);if(s!==u)return!1;if(s&&u){for(var l=0;l<e.length;l++)if(!e0(e[l],t[l]))return!1}else{if(!e0(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(n){e0(e[n],t[n])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var e1=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=eJ({},this.identity.userProperties),n=eJ(eJ({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,a,s,u=n.userProperties||{};try{for(var l=eX(Object.entries(e)),c=l.next();!c.done;c=l.next()){var d=eZ(c.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var g=(i=void 0,eX(Object.entries(p))),h=g.next();!h.done;h=g.next()){var v=eZ(h.value,2),m=v[0],y=v[1];u[m]=y}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,eX(Object.keys(p))),S=b.next();!S.done;S=b.next()){var m=S.value;delete u[m]}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return n.userProperties=u,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return eJ({},this.identity)},e.prototype.setIdentity=function(e){var t=eJ({},this.identity);this.identity=eJ({},e),e0(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),e2="u">typeof globalThis?globalThis:e.g,e3=function(){function e(){this.identityStore=new e1,this.eventBridge=new eQ,this.applicationContextProvider=new eY}return e.getInstance=function(t){return e2.analyticsConnectorInstances||(e2.analyticsConnectorInstances={}),e2.analyticsConnectorInstances[t]||(e2.analyticsConnectorInstances[t]=new e),e2.analyticsConnectorInstances[t]},e}(),e4=function(e){return void 0===e&&(e=er),e3.getInstance(e)},e5=function(e,t){e4(t).identityStore.editIdentity().setUserId(e).commit()},e8=function(e,t){e4(t).identityStore.editIdentity().setDeviceId(e).commit()},e7=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},e6=function(){function e(){this.name="identity",this.type="before",this.identityStore=e4().identityStore}return e.prototype.execute=function(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return G(this,void 0,void 0,function(){return K(this,function(t){return e.instanceName&&(this.identityStore=e4(e.instanceName).identityStore),[2]})})},e}(),e9=function(){var e,t=eI();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(
1Boolean).reduce(function(e,t){var n=t.split("=",2),r=te(n[0]),i=te(n[1]);return i&&(e[r]=i),e},{}):{}},te=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},tt=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),tn=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new tt(e,t)}return e.prototype.subscribe=function(e,t,n){var r=eA(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return G(this,void 0,void 0,function(){var e,t=this;return K(this,function(n){switch(n.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null})):this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return G(this,void 0,void 0,function(){var t,n,r,i=this;return K(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending c
1allback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return G(this,void 0,void 0,function(){var n,r;return K(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),G(this,void 0,void 0,function(){var n,r,i,o,a,s,u=this;return K(this,function(l){switch(l.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,a,s,l,c,d;return K(this,function(f){switch(f.label){case 0:i=!0,a=new AbortController,s=setTimeout(function(){return a.abort()},t),f.label=1;case 1:return f.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:a.signal})];case 2:if((l=f.sent()).ok)return[3,4];return[4,l.text()];case 3:return c=f.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(c)),401===l.status||403===l.status?(o.logger.error("Remote config client fetch failed with ".concat(l.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):l.status>=400&&l.status<500&&429!==l.status&&(i=!1),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:f.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=f.sent())instanceof Error&&"AbortError"===d.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!i)return[2,"break"];if(!(r<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(n))})];case 10:f.sent(),f.label=11;case 11:return[2]}})},o=this,a=0,l.label=1;case 1:if(!(a<e))return[3,4];return[5,i(a)];case 2:if("object"==typeof(s=l.sent()))return[2,s.value];if("break"===s)return[3,4];l.label=3;case 3:return a++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),tr="tags",ti="counters",to="histograms",ta="events",ts="internal",tu="last_flush_timestamp",tl=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return(null==(e=eI())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return G(this,void 0,void 0,function(){return K(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;
1n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(tr)||e.createObjectStore(tr,{keyPath:"key"}),e.objectStoreNames.contains(ti)||e.createObjectStore(ti,{keyPath:"key"}),e.objectStoreNames.contains(to)||e.createObjectStore(to,{keyPath:"key"}),e.objectStoreNames.contains(ta)||e.createObjectStore(ta,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(ts)||e.createObjectStore(ts,{keyPath:"key"})},e.prototype.setTags=function(e){return G(this,void 0,void 0,function(){var t,n,r,i=this;return K(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tr],"readwrite")).objectStore(tr),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),r()},o.forEach(function(e){var t=$(e,2),r=t[0],o=t[1];n.put({key:r,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",r,o,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",r),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return G(this,void 0,void 0,function(){var t,n,r,i=this;return K(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([ti],"readwrite")).objectStore(ti),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),r()},o.forEach(function(e){var t=$(e,2),r=t[0],o=t[1],a=n.get(r);a.onsuccess=function(){var e=a.result,t=e?e.value:0;n.put({key:r,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},a.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",r),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return G(this,void 0,void 0,function(){var t,n,r,i=this;return K(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([to],"readwrite")).objectStore(to),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),r()},o.forEach(function(e){var t=$(e,2),r=t[0],o=t[1],a=n.get(r);a.onsuccess=function(){var e,t=a.result;e=t?{key:r,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:r,count:o.count,min:o.min,max:o.max,sum:o.sum},n.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},a.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return G(this,void 0,void 0,function(){var t,n,r,i=this;return K(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([ta],"readwrite")).objectStore(ta),[2,new Promise(function(r){t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),r()};var o=n.count();o.onsuccess=function(){var t=Math.max(0,10-o.result);t<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){n.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",r),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return G(this,void 0,void 0,function(){var n,r,i;return K(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(n=o.sent().transaction([ts],"readwrite")).objectStore(ts),[2,new Promise(function(i,o){n.onabort=function(){return o(Error("Failed to set internal value"))};var a=r.put({key:e,value:t});a.onsuccess=function(){return i()},a.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return G(this,void 0,void 0,function(){var t,n,r;return K(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(t=i.sent().transaction([ts],"readonly")).objectStore(ts),[2,new Promise(function(r,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return r(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return r=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",r),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return G(this,void 0,void 0,function(){var e,t;return K(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(tu)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(tu,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return G(this,void 0,void 0,function(){var e,t,n,r,i,o,a;return K(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=s.sent().transaction([tr,ti,to,ta],"readwrite"),[4,Promise.all([this.getAllFromStore(e,tr),this.getAllFromStore(e,ti),this.getAllFromStore(e,to),this.getAllFromStore(e,ta)])];case 2:return n=(t=$.apply(void 0,[s.sent(),4]))[0],r=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,ti),this.clearTable(e,to),this.clearTable(e,ta)])];case 3:return s.sent(),[2,{tags:n,counters:r,histogramStats:i,events:o}];case 4:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(Error("Failed to get all from ".concat(t)))}})},e}(),tc=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}
1,td=function(e,t){return 31*Math.abs(tc(e.toString()))%1e5/1e5<t},tf=function(){var e=eI();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},tp=function(e){var t=eI();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",H({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=tg({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=th(i),a=tg({filename:o,stack:i});a&&n({type:"unhandledrejection",message:null!=(t=null==r?void 0:r.message)?t:tv(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})},!0)}},tg=function(e){var t,n,r=tf();if(0!==r.length)try{for(var i=Y(r),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},th=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},tv=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},tm=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=H({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=td(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,tl.isSupported()?this.storage=new tl(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),tp(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10)return void this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},3e5))},e.prototype.saveAllDataToStorage=function(){return G(this,void 0,void 0,function(){var e,t,n,r;return K(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=H({},this.inMemoryTags),t=H({},this.inMemoryCounters),n=H({},this.inMemoryHistograms),r=Q([],$(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return G(this,void 0,void 0,function(){var e,t,n,r,i,o,a,s,u,l;return K(this,function(c){switch(c.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=c.sent()).tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),a={}
1,n.forEach(function(e){a[e.key]=e.value}),s={},r.forEach(function(e){s[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),u=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(a).length&&0===Object.keys(s).length&&0===u.length)return[2];return l={tags:o,histogram:s,counters:a,events:u},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!eI())throw Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:if(!n.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return G(this,void 0,void 0,function(){var e,t,n;return K(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=r.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(n=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-n),[2]}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=td(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),ty=e.i(427968),tb=ty.default||ty,tS=function(e,t){var n,r,i;return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1&&("string"!=typeof(null==(r=null==(n=null==(i=eI())?void 0:i.chrome)?void 0:n.runtime)?void 0:r.id)||!!(null==e?void 0:e[t]))},tw=function(e){return tS(e,"attribution")},t_=function(e){return tS(e,"formInteractions")},tE=function(e){return tS(e,"pageViews")},tT=function(e){return tS(e,"sessions")},tk=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tC=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},tI=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},tP=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;if(!0===t)return{mainThreadBlock:!0};if("object"==typeof t&&null!==t)return t}},tA=function(e){if(tC(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tO=function(e){if(tI(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},tx=function(e){var t;if(tk(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),H(H({},n),{captureRules:null==(t=null==n?void 0:n.captureRules)?void 0:t.map(function(t){var n,r,i;if((null==(n=t.urls)?void 0:n.length)&&(null==(r=t.hosts)?void 0:r.length)){var o=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),H(H({},t),{hosts:void 0})}return t})})}},tR=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return tE(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},tL=function(e){if(t_(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},tN=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,a=r.resolve,s=e&&e[i];if("function"==typeof s){var u=s.apply(e,o);"function"==typeof a&&a(null==u?void 0:u.promise)}}return e},tD=function(e){return e&&void 0!==e._q},tU=function(){if("u"<typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!=(r=null!=(n=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?n:i)?r:""},tM="2.42.5",tj="amplitude-ts",tq=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(tj,"/").concat(tM),"u">typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return G(this,void 0,void 0,function(){var r,i,o;return K(this,function(a){return r=new Date().getTime(),i=null!=(t=this.config.lastEventId)?t:-1,o=null!=(n=e.event_id)?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,H(H(H(H(H(H(H(H({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:tU()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:eA(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]})})},e}(),tF=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return G(this,void 0,void 0,function(){return K(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return G(this,void 0,void 0,function(){return K(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return G(this,void 0,void 0,function(){return K(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return G(this,void 0,void 0,function(){return K(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return G(this,void 0,void 0,function(){return K(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tV=function(){var e,t=eI();return null==(e=null==t?void 0:t.navigator)?void 0:e.locks},tB=function(){function e(e,t){void 0===t&&(t={}),this.options=H({},e),this.config=t}return e.prototype.isEnabled=function(){return G(this,void 0,void 0,function(){var t,n,r,i=this;return K(this,function(o){switch(o.label){case 0:return t="AMP_TEST",n=new e(H({},this.options)),r=String(Date.now()),[4,n.transaction(t,function(e){var n,o;try{e.set(r);var a=e.get()===r;return!a&&i.config.diagnosticsClient&&(null==(n=i.config.diagnosticsClient)||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:r,sync:!0})),a}catch(e){if(i.config.diagnosticsClient){var s=e instanceof Error?e.message:String(e);null==(o=i.config.diagnosticsClient)||o.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:r,error:s,sync:!0})}return!1}
1finally{e.set(null)}})];case 1:return[2,o.sent()]}})})},e.prototype.get=function(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=tW(t);if(void 0===n)return void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return JSON.parse(n)}catch(n){console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t));return}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,n;return G(this,void 0,void 0,function(){var r,i,o,a,s,u,l,c;return K(this,function(d){switch(d.label){case 0:r=eI(),d.label=1;case 1:if(d.trys.push([1,4,,5]),!(i=null==r?void 0:r.cookieStore))return[3,3];return[4,i.getAll(e)];case 2:if(o=d.sent()){o.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:o.map(function(e){return e.domain})}),null==(n=this.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(s=(a=Y(o)).next();!s.done;s=a.next())if(u=s.value,tG(u.domain,this.options.domain))return[2,u.value]}catch(e){l={error:e}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(l)throw l.error}}}d.label=3;case 3:return[3,5];case 4:return d.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=eI(),o=(null!=(n=null==(t=null==i?void 0:i.document)?void 0:t.cookie.split("; "))?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var n;try{var i=s(t.substring(e.length+1));return i||null==(n=r.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return G(this,void 0,void 0,function(){return K(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=null!=(n=this.options.expirationDays)?n:0,i=null!==t?r:-1,o=void 0;if(i){var a=new Date;a.setTime(a.getTime()+24*i*36e5),o=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var u=eI();(null==u?void 0:u.document)&&(u.document.cookie=s)}catch(t){var l=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},e.prototype.remove=function(e){return G(this,void 0,void 0,function(){return K(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return G(this,void 0,void 0,function(){return K(this,function(e){return[2]})})},e.isDomainWritable=function(t){return G(this,void 0,void 0,function(){var n,r;return K(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",r=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return G(this,void 0,void 0,function(){var n,r,i=this;return K(this,function(o){switch(o.label){case 0:if(n=tV(),r=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!n)return[2,r()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),r)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,r()];case 4:return[2]}})})},e.cachedTlds={},e}(),tz=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tH=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tW=function(e){var t;return null!=(t=tz(e))?t:tH(e)},tG=function(e,t){if(""===e&&""===t)return!0;
1if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},tK=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},tY=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return G(this,void 0,void 0,function(){var t,n,r;return K(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return G(this,void 0,void 0,function(){return K(this,function(n){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return G(this,void 0,void 0,function(){return K(this,function(r){try{null==(n=this.storage)||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return G(this,void 0,void 0,function(){return K(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return G(this,void 0,void 0,function(){return K(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),t$=function(e){function t(t){var n,r,i,o=this;try{i=null==(n=eI())?void 0:n.localStorage}catch(e){null==(r=null==t?void 0:t.loggerProvider)||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return z(t,e),t.prototype.set=function(t,n){var r;return G(this,void 0,void 0,function(){var i;return K(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null==(r=this.loggerProvider)||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(tY),tQ=function(e){function t(){var t;return e.call(this,null==(t=eI())?void 0:t.sessionStorage)||this}return z(t,e),t}(tY),tJ=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,a,s,u,l,c,d,f,p,g,h,v,m,y,b,S,w,E,T=e.code||0,k=this.buildStatus(T);switch(k){case _.Success:return{status:k,statusCode:T,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(n=e.payload_size_bytes)?n:0,serverUploadTime:null!=(r=e.server_upload_time)?r:0}};case _.Invalid:return{status:k,statusCode:T,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(a=e.events_with_invalid_fields)?a:{},eventsWithMissingFields:null!=(s=e.events_with_missing_fields)?s:{},eventsWithInvalidIdLengths:null!=(u=e.events_with_invalid_id_lengths)?u:{},epsThreshold:null!=(l=e.eps_threshold)?l:0,exceededDailyQuotaDevices:null!=(c=e.exceeded_daily_quota_devices)?c:{},silencedDevices:null!=(d=e.silenced_devices)?d:[],silencedEvents:null!=(f=e.silenced_events)?f:[],throttledDevices:null!=(p=e.throttled_devices)?p:{},throttledEvents:null!=(g=e.throttled_events)?g:[]}};case _.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!=(h=e.error)?h:""}};case _.RateLimit:return{status:k,statusCode:T,body:{error:null!=(v=e.error)?v:"",epsThreshold:null!=(m=e.eps_threshold)?m:0,throttledDevices:null!=(y=e.throttled_devices)?y:{},throttledUsers:null!=(b=e.throttled_users)?b:{},exceededDailyQuotaDevices:null!=(S=e.exceeded_daily_quota_devices)?S:{},exceededDailyQuotaUsers:null!=(w=e.exceeded_daily_quota_users)?w:{},throttledEvents:null!=(E=e.throttled_events)?E:[]}};case _.Timeout:default:return{status:k,statusCode:T}}},e.prototype.buildStatus=function(e){return ez(e)?_.Success:429===e?_.RateLimit:413===e?_.PayloadTooLarge:408===e?_.Timeout:e>
1=400&&e<500?_.Invalid:e>=500?_.Failed:_.Unknown},e}();function tX(){return"u">typeof CompressionStream}function tZ(e){return G(this,void 0,void 0,function(){var t;return K(this,function(n){switch(n.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,new Response(new Blob([e]).stream().pipeThrough(new t("gzip"))).arrayBuffer()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,void 0];case 4:return[2]}})})}var t0=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return z(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),G(this,void 0,void 0,function(){var r=this;return K(this,function(i){return[2,new Promise(function(i,o){"u"<typeof XMLHttpRequest&&o(Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===r.state.done){var e=a.responseText;try{i(r.buildResponse(JSON.parse(e)))}catch(e){i(r.buildResponse({code:a.status}))}}};var s={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(t),l=n&&u.length>=2048&&tX(),c=function(e){var t,n;s=H(H({},r.customHeaders),s);try{for(var i=Y(Object.entries(s)),o=i.next();!o.done;o=i.next()){var u=$(o.value,2),l=u[0],c=u[1];a.setRequestHeader(l,c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}a.send(e)};G(r,void 0,void 0,function(){var e;return K(this,function(t){switch(t.label){case 0:if(!l)return[3,2];return[4,tZ(u)];case 1:return(e=t.sent())?(s["Content-Encoding"]="gzip",c(e)):c(u),[3,3];case 2:c(u),t.label=3;case 3:return[2]}})}).catch(o)})]})})},t}(tJ),t1=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.customHeaders=t,n}return z(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),G(this,void 0,void 0,function(){var r,i,o,a,s,u,l;return K(this,function(c){switch(c.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");if(r=JSON.stringify(t),i=n&&r.length>=2048&&tX(),o=r,a={"Content-Type":"application/json",Accept:"*/*"},!i)return[3,2];return[4,tZ(r)];case 1:(s=c.sent())&&(a["Content-Encoding"]="gzip",o=s),c.label=2;case 2:return[4,fetch(e,{headers:a=H(H({},this.customHeaders),a),body:o,method:"POST"})];case 3:return[4,(u=c.sent()).text()];case 4:l=c.sent();try{return[2,this.buildResponse(JSON.parse(l))]}catch(e){return[2,this.buildResponse({code:u.status})]}}})})},t}(tJ),t2=function(e){function t(){return e.call(this)||this}return z(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),G(this,void 0,void 0,function(){var n=this;return K(this,function(r){return[2,new Promise(function(r,i){var o=eI();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);if(o.navigator.sendBeacon(e,a))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(tJ),t3=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},t4=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},t5="[Amplitude]",t8="".concat(t5," Form Started"),t7="".concat(t5," Form Submitted"),t6="".concat(t5," File Downloaded"),t9="session_start",ne="session_end",nt="".concat(t5," File Extension"),nn="".concat(t5," File Name"),nr="".concat(t5," Link ID"),ni="".concat(t5," Link Text"),no="".concat(t5," Link URL"),na="".concat(t5," Form ID"),ns="".concat(t5," Form Name"),nu="".concat(t5," Form Destination"),nl="cookie",nc={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},nd=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},nf=function(e,t,n,r,i,o){void 0===i&&(i=!0),e.referrer;var a=e.referring_domain,s=W(e,["referrer","referring_domain"]),u=t||{},l=(u.referrer,u.referring_domain),c=W(u,["referrer","referring_domain"]),d=n.excludeInternalReferrers;if(d){var f=nv(d,r);if(!(f instanceof TypeError)&&e.referring_domain&&nS(e.referring_domain,o)){if
1("always"===f)return nm(f,e.referring_domain,r),!1;else if("ifEmptyCampaign"===f&&Object.values(H(H({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e}))return nm(f,e.referring_domain,r),!1}}if(np(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var p=JSON.stringify(s)!==JSON.stringify(c),g=nd(a||"")!==nd(l||""),h=!t||p||g;return h?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),h},np=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},ng=function(e,t){var n=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(n)},nh=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},nv=function(e,t){if(!0===e)return nc.always;if("object"==typeof e){var n=e.condition;if("string"==typeof n&&Object.keys(nc).includes(n))return n;if(void 0===n)return nc.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),TypeError(r)};function nm(e,t,n){var r="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?n.debug(r):"ifEmptyCampaign"===e&&n.debug("".concat(r," with empty campaign parameters"))}var ny=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],nb=function(e){var t,n,r=e||(null==(n=null==(t=eI())?void 0:t.location)?void 0:n.hostname);if(!r)return"";var i=r.split("."),o=i[i.length-1],a=i[i.length-2];return(ny.find(function(e){return r.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],a=i[i.length-3]),a)?"".concat(a,".").concat(o):o},nS=function(e,t){var n=eI();return!!n&&ng(e,(t||"").trim()||nb(n.location.hostname))},nw=function(e){function t(t,n,r,i,o,a,s,u,l,c,d,f,p,g,h,v,m,b,S,w,_,E,T,k,C,I,P,A,O,x,R,L,N,D,U,M,j,q,F,V,B,z,H,W){void 0===r&&(r=new tF),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===l&&(l=5),void 0===c&&(c=30),void 0===d&&(d=nl),void 0===v&&(v=new ej),void 0===m&&(m=y.Warn),void 0===S&&(S=!1),void 0===w&&(w=!1),void 0===T&&(T=""),void 0===k&&(k="US"),void 0===P&&(P=18e5),void 0===A&&(A=new t$({loggerProvider:v})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===x&&(x="fetch"),void 0===R&&(R=!1),void 0===L&&(L=!0),void 0===q&&(q=!0),void 0===F&&(F=0),void 0===H&&(H=!1);var G,K=this;(K=e.call(this,{apiKey:t,storageProvider:A,transportProvider:nT(x)})||this).apiKey=t,K.appVersion=n,K.cookieOptions=i,K.defaultTracking=o,K.autocapture=a,K.flushIntervalMillis=u,K.flushMaxRetries=l,K.flushQueueSize=c,K.identityStorage=d,K.ingestionMetadata=f,K.instanceName=p,K.loggerProvider=v,K.logLevel=m,K.minIdLength=b,K.offline=S,K.partnerId=_,K.plan=E,K.serverUrl=T,K.serverZone=k,K.sessionTimeout=P,K.storageProvider=A,K.trackingOptions=O,K.transport=x,K.useBatch=R,K.fetchRemoteConfig=L,K.networkTrackingOptions=M,K.identify=j,K.enableDiagnostics=q,K.diagnosticsSampleRate=F,K.diagnosticsClient=V,K.remoteConfig=B,K.topLevelDomain=z,K.enableRequestBodyCompression=H,K.customEnrichment=W,K.version=tM,K._optOut=!1,K._cookieStorage=r,K.deviceId=s,K.lastEventId=g,K.lastEventTime=h,K.optOut=w,K.deferredSessionId=I,K.sessionId=C,K.pageCounter=D,K.userId=N,K.debugLogsEnabled=U,K.loggerProvider.enable(U?y.Debug:K.logLevel),K.networkTrackingOptions=M,K.identify=j,K.enableDiagnostics=q,K.diagnosticsSampleRate=F,K.diagnosticsClient=V;var Y=null!=(G=null==B?void 0:B.fetchRemoteConfig)?G:L;return K.remoteConfig=K.remoteConfig||{},K.remoteConfig.fetchRemoteConfig=Y,K.fetchRemoteConfig=Y,K.topLevelDomain=z||nb(),K}return z(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof tB&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(tK(this.apiKey),e)},t}(eF),n_=function(e,t,n){switch(void 0===e&&(e=nl),void 0===t&&(t={}),e){case"localStorage":return new t$;case"sessionStorage":return new tQ;case"none":return new tF;default:return new tB(H(H({},t),{expirationDays:t.expiration}),n)}},nE=function(e){var t,n;return void 0===e&&(e={}),(null==(t=e.remoteConfig)?void 0:t.fetchRemoteConfig)===!0||(null==(n=e.remoteConfig)?void 0:n.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},nT=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0;return"xhr"===t?new t0(n):"beacon"===t?new t2:new t1(n)},nk="data-amp-mask",nC="*****",nI=/\b(?:\d[ -]*?){13,16}\b/,nP=/(\d{3}-?\d{2}-?\d{4})/g,nA=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,nO=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,r,i=e;i=(i=(i=i.replace(nI,nC)).replace(nP,nC)).replace(nA,nC);try{for(var o=Y(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,nC)}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},nx=function(e){if("u"<typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(nk)?nC:e?e(document.title):document.title},nR=function(){function e(){}return e.prototype.parse=function(){return G(this,void 0,void 0,function(){return K(this,function(e){return[2,H(H(H(H({},eb),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=e9();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=e9();return(e={})[eu]=t[eu],e[el]=t[el],e[ec]=t[ec],e[ed]=t[ed],e[ef]=t[ef],e[ep]=t[ep],e[eg]=t[eg],e[eh]=t[eh],e[ev]=t[ev],e[em]=t[em],e[ey]=t[ey],e},e}(),nL=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},nN="AMP_PAGE_VIEW",nD=function(e){void 0===e&&(e={});var t,n,r,i=eI(),o=void 0,a=!1,s=e.trackOn,u=e.trackHistoryChanges,l=e.eventType,c=void 0===l?"[Amplitude] Page Viewed":l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},f=function(e){return G(void 0,void 0,void 0,function(){var t,n,r;return K(this,function(i){switch(i.label){case 0:return t=d("u">typeof location&&location.href||""),r={event_type:c},n=[{}],[4,nU()];case 1:return[2,(r.event_properties=H.apply(void 0,[H.apply(void 0,n.concat([i.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"u">typeof location&&d(location.pathname)||"","[Amplitude] Page Title":nx(nO),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),r)]}})})},p=function(){return void 0===s||"function"==typeof s&&s()},g="u">typeof location?location.href:null,h=function(){G(void 0,void 0,void 0,function(){var e,n,i,a,s;return K(this,function(l){switch(l.label){case 0:if(n=nj(u,e=location.href,g||"")&&p(),g=e,!n)return[3,4];if(i=void 0,r&&(i=eA(),r.set(nN,{pageViewId:i})),null==o||o.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return s=(a=t).track,[4,f(i)];case 2:s.apply(a,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return G(void 0,void 0,void 0,function(){var u,l,c;return K(this,function(d){switch(d.label){case 0:if(t=s,n=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,i){try{r=new tY(i.sessionStorage)}catch(e){null==o||o.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",h),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,n){var r=$(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),a&&h()}})}if(!p())return[3,2];return o.log("Tracking page view event"),u=void 0,r&&(u=eA(),r.set(nN,{pageViewId:u})),c=(l=t).track,[4,f(u)];case 1:c.apply(l,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return G(void 0,void 0,void 0,function(){var t,i,a;return K(this,function(u){switch(u.label){case 0:if(!("attribution"===s&&nM(e)))return[3,4];
1if(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,!r)return[3,2];return[4,r.get(nN)];case 1:t=null==(i=u.sent())?void 0:i.pageViewId,u.label=2;case 2:return[4,f(t)];case 3:e.event_type=(a=u.sent()).event_type,e.event_properties=H(H({},e.event_properties),a.event_properties),u.label=4;case 4:return n&&e.event_type===c&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=H(H({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(e){return i&&(i.removeEventListener("popstate",h),a=!1),[2]})})}}},nU=function(){return G(void 0,void 0,void 0,function(){var e;return K(this,function(t){switch(t.label){case 0:return e=nL,[4,new nR().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},nM=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[b.SET]||{},r=t[b.UNSET]||{},i=Q(Q([],$(Object.keys(n)),!1),$(Object.keys(r)),!1);return Object.keys(eb).every(function(e){return i.includes(e)})}return!1},nj=function(e,t,n){if("pathOnly"!==e)return t!==n;if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname},nq=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})},i=function(){n.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),n=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return G(void 0,void 0,void 0,function(){var o,a;return K(this,function(s){return t=tL(n),o=function(){if(!i)return void n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("u">typeof document){var o=new WeakSet,a=function(e){if(!o.has(e)){o.add(e);var a=!1;r(e,"change",function(){var t,n=nV(e);a||i.track(t8,((t={})[na]=nF(e.id),t[ns]=nF(e.name),t[nu]=n,t)),a=!0}),r(e,"submit",function(r){var o,s,u=nV(e);if(a||i.track(t8,((o={})[na]=nF(e.id),o[ns]=nF(e.name),o[nu]=u,o)),a=!0,(null==t?void 0:t.shouldTrackSubmit)!==void 0)if("function"==typeof t.shouldTrackSubmit&&"u">typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(e){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(t7,((s={})[na]=nF(e.id),s[ns]=nF(e.name),s[nu]=u,s)),a=!1})}};Array.from(document.getElementsByTagName("form")).forEach(a),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&a(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(a)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(a=eI())?a.addEventListener("load",o):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},nF=function(e){if("string"==typeof e)return e},nV=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},nB=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return G(void 0,void 0,void 0,function(){var i,o;return K(this,function(a){return i=function(){if(!r)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("u">typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),a=null==i?void 0:i[1];a&&n(e,"click",function(){var n;a&&r.track(t6,((n={})[nt]=a,n[nn]=t.pathname,n[nr]=e.id,n[ni]=e.text,n[no]=e.href,n))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;
1Array.from(document.getElementsByTagName("a")).forEach(i),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=eI())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nz=!1,nH=function(e){nz||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),nz=!0)},nW=function(){var e=eI(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return G(void 0,void 0,void 0,function(){return K(this,function(r){return"u"<typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,n("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(e){return r(),[2]})})}}};function nG(e,t,n){var r,i,o=[];try{for(var a=Y(null!=t?t:[]),s=a.next();!s.done;s=a.next()){var u=s.value;try{o.push(new RegExp(u))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(u),e)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return e.concat(o)}var nK=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],nY="data-amp-track-",n$=["div","span","h1","h2","h3","h4","h5","h6"],nQ="https://app.amplitude.com",nJ={US:nQ,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},nX="__AMPLITUDE_MESSENGER_INSTANCE__",nZ="__AMPLITUDE_MESSENGER__",n0=function(){function e(e){var t=(void 0===e?{}:e).origin;this[T]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=void 0===t?nQ:t}return e.prototype.notify=function(e){var t,n,r,i;null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(r=window.opener)?void 0:r.postMessage)||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){r.requestCallbacks[i]={resolve:t,reject:a},r.notify(o),n.timeout>0&&setTimeout(function(){a(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.registerActionHandler=function(e,t){this.actionHandlers.has(e)&&(null==(o=null==(i=this.logger)?void 0:i.warn)||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var n,r,i,o,a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var s=Y(a),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return G(this,void 0,void 0,function(){var t,n,r;return K(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=(document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null==(r=document.head)||r.appendChild(i)}catch(e){n(e)}})).then(function(){}),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}})})},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===nQ&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null==(n=null==(t=r.logger)?void 0:t.debug)||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var t,n,i,o,a,s=e.data,u=null==s?void 0:s.action;if(u)if("id"in s&&s.id)null==(o=null==(i=r.logger)?void 0:i.debug)||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(s);else{if("ping"===u)return void r.notify({action:"pong"});var l=r.actionHandlers.get(u);if(l)l(s.data);else{var c=null!=(a=r.pendingMessages.get(u))?a:[];c.push(s.data),r.pendingMessages.set(u,c)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=eI();(null==e?void 0:e[nZ])===this&&delete e[nZ]},e}();T=nX;var n1="__AMPLITUDE_BACKGROUND_CAPTURE__",n2=e.i(523072);
1function n3(e,t){return new n2.default(function(n){e.subscribe({next:function(e){t(e).then(function(e){return n.next(e)}).catch(function(e){return n.error(e)})},error:function(e){n.error(e)},complete:function(){n.complete()}})})}function n4(e,t){return new n2.default(function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=Y(i),o=n.next();!o.done;o=n.next()){var a=o.value;try{a.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},a=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return a(e),a(t),o})}function n5(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new n2.default(function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){try{for(var n,r,i,o=Y(t),a=o.next();!a.done;a=o.next()){var s=a.value;null==(i=s.next)||i.call(s,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){try{for(var n,i,o,a=Y(t),s=a.next();!s.done;s=a.next()){var u=s.value;null==(o=u.error)||o.call(u,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r()},complete:function(){try{for(var e,n,i,o=Y(t),a=o.next();!a.done;a=o.next()){var s=a.value;null==(i=s.complete)||i.call(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}})}var n8="1.27.2",n7="[Amplitude] Element Clicked",n6="[Amplitude] Element Tag",n9="[Amplitude] Element Text",re="[Amplitude] Page URL",rt="[Amplitude] Viewport Height",rn="[Amplitude] Viewport Width",rr="[Amplitude] Page View ID",ri="data-amp-mask-attributes",ro=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},ra=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},rs=["input","select","textarea"],ru=function(e,t){var n,r=null==(n=null==window?void 0:window.getComputedStyle)?void 0:n.call(window,e);return(null==r?void 0:r.getPropertyValue("cursor"))==="pointer"&&"click"===t},rl=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&ro(window.location.href,n))&&!!ro(window.location.href,t)},rc=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,a,s=e.shouldTrackEventResolver,u=null==(a=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:a.call(o);if(!u)return!1;if(s)return s(r,i);if(!rl(e))return!1;var l=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}var c=ru(i,r);if(n&&c)return!0;if(t&&!t.some(function(e){var t;return!!(null==(t=null==i?void 0:i.matches)?void 0:t.call(i,e))}))return!1;switch(u){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:if(c)return!0;return"click"===r}}},rd=function(e){var t,n,r,i=null==(n=null==(t=null==e?void 0:e.tagName)?void 0:t.toLowerCase)?void 0:n.call(t),o=e instanceof HTMLElement&&(null==(r=e.getAttribute("contenteditable"))?void 0:r.toLowerCase())==="true";return!rs.includes(i)&&!o},rf=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return null!=r&&("object"!=typeof r||0!==Object.keys(r).length)&&("string"!=typeof r||0!==r.trim().length)&&(t[n]=r),t},{})},rp=function(){var e;try{var t=eI(),n=null==(e=null==t?void 0:t.sessionStorage)?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(e){}},rg=function(e,t){return e?t.some(function(t){var n;return null==(n=null==e?void 0:e.matches)?void 0:n.call(e,t)})?e:rg(null==e?void 0:e.parentElement,t):null},rh=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};(u=k||(k={}))[u.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",u[u.MIDDLE=1]="MIDDLE",u[u.RIGHT=2]="RIGHT";var rv="__AMPLITUDE_VISUAL_TAGGING__",rm=n2,ry=eI(),rb=null==ry?void 0:ry.console,rS={},rw={},r_=!1,rE=function(e,t){if(!rb||"function"!=typeof rb[e]||!rw[e]&&(rw[e]=rb[e],rb[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(rS[e]&&!r_){r_=!0;var r=rS[e];r&&r.forEach(function(n){try{n(e,t)}catch(e){}})}}catch(e){}return r_=!1,rw[e].apply(rb,t)},0))return Error("Console override failed");rS[e]?rS[e].push(t):rS[e]=[t]},rT=function(e){var t,n;try{for(var r=Y(Object.values(rS)),i=r.next();!i.done;i=r.next())for(var o=i.value,a=o.length-1;a>=0;a--)if(o[a]===e){o.splice(a,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},rk=eI(),rC=function(){return new rm.default(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},rI=function(e){return void 0===e&&(e="click"),new rm.default(function(t){var n,r=function(e){t.next(e)};return null==(n=eI())||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null==(t=eI())||t.document.removeEventListener(e,r,{capture:!0})}})},rP=function(){var e=n4(new rm.default(function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=H(H({},n),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(n.message=t.error),e.next(n)}};return rk.addEventListener("error",t),function(){rk.removeEventListener("error",t)}}),new rm.default(function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return rk.addEventListener("unhandledrejection",t),function(){rk.removeEventListener("unhandledrejection",t)}}));return n4(e,new rm.default(function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return rE("error",t),function(){rT(t)}}))},rA=function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},rO=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;if(e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector)return n.querySelector(e.selector);return n}}catch(e){}},rx=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},rR={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},rL=function(e){var t,n,r,i,o=Object.values(rR).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var a=Y(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{try{for(var l=(r=void 0,Y(u.definition)),c=l.next();!c.done;c=l.next()){var d=rR[c.value.event_type];d&&o[d].add(u.id)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==u?void 0:u.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},rN=function(e){var t,n,r,i,o=new Map;try{for(var a=Y(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{for(var l=(r=void 0,Y(u.conditions)),c=l.next();!c.done;c=l.next()){var d=c.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(u)}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},rD=function(e,t){var n,r,i,o,a=new Set;try{for(var s=Y(e),u=s.next();!u.done;u=s.next()){var l=u.value,c=t.get(l.id);if(c)try{for(var d=(i=void 0,Y(c)),f=d.next();!f.done;f=d.next()){var p=f.value;a.add(p)}}catch(e){i={error:e}}
1finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return Array.from(a)},rU=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=rD(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return rR[t.event_type]===e.type&&t.filters.every(function(t){return rA(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=Y(i),a=o.next();!a.done;a=o.next()){var s=a.value;rx(s.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),rM=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",ri,nk]),rj=["type"],rq=["svg","path","g"],rF=["password","hidden"],rV=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),rB=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=rz(r,!!t,r===e);if(!i||(n.push(i),i.optimized))break;r=r.parentElement}return n.reverse(),n.join(" > ")},rz=function(e,t,n){if(e.nodeType!==Node.ELEMENT_NODE)return null;var r,i,o=e.getAttribute("id");if(t){if(o)return new rV(c(o),!0);var a=e.tagName.toLowerCase();if("body"===a||"head"===a||"html"===a)return new rV(a,!0)}var s=e.tagName.toLowerCase();if(o)return new rV(s+c(o),!0);var u=e.parentNode;if(!u||u.nodeType===Node.DOCUMENT_NODE)return new rV(s,!0);function l(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]}function c(e){return"#"+CSS.escape(e)}for(var d=l(e),f=!1,p=!1,g=-1,h=-1,v=u.children,m=0;v&&(-1===g||!p)&&m<v.length;++m){var y=v[m];if(y.nodeType===Node.ELEMENT_NODE){if(h+=1,y===e){g=h;continue}if(!p&&y.tagName.toLowerCase()===s){f=!0;var b=new Set(d);if(!b.size){p=!0;continue}for(var S=l(y),w=0;w<S.length;++w){var _=S[w];if(b.has(_)&&(b.delete(_),!b.size)){p=!0;break}}}}}var E=s;if(n&&"input"===s.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(E+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),p)E+=":nth-child("+String(g+1)+")";else if(f)try{for(var T=Y(d),k=T.next();!k.done;k=T.next()){var C=k.value;E+="."+CSS.escape(C.slice(1))}}catch(e){r={error:e}}finally{try{k&&!k.done&&(i=T.return)&&i.call(T)}finally{if(r)throw r.error}}return new rV(E,!1)},rH=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return nO(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,a=performance.now(),s=[];if(!e)return[];for(var u=function(e){var t=[];if(!e)return t;
1t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,c=u.length-1;c>=0;c--){var d=u[c];if(d){var f,p=(f=d.getAttribute(ri))?f.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],g=new Set(Q(Q([],$(c===u.length-1?[]:null!=(r=l.get(u[c+1]))?r:new Set),!1),$(p),!1));l.set(d,g)}}s=u.map(function(e){var t;return function(e,t){if(null===e)return null;var n,r,i,o,a,s,u=String(e.tagName).toLowerCase(),l={tag:u},c=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null==(s=null==(a=e.previousElementSibling)?void 0:a.tagName)?void 0:s.toLowerCase();d&&(l.prevSib=String(d));var f=e.getAttribute("id");f&&(l.id=String(f));var p=Array.from(e.classList);p.length&&(l.classes=p);var g={},h=Array.from(e.attributes).filter(function(e){return!rM.has(e.name)}),v=!rd(e);if(!rF.includes(String(e.getAttribute("type")))&&!rq.includes(u))try{for(var m=Y(h),y=m.next();!y.done;y=m.next()){var b=y.value;if(!v||rj.includes(b.name)){if(t.has(b.name)){g[b.name]=nC;continue}g[b.name]=String(b.value).substring(0,128)}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}return Object.keys(g).length&&(l.attrs=g),l}(e,null!=(t=l.get(e))?t:new Set)});var h=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=$(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))})};try{for(var v=Y(s),m=v.next();!m.done;m=v.next()){var y=m.value;h(y)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}var b=performance.now();return null==(i=o.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getElementPath=function(e){if(!e)return"";var t,n=performance.now(),r=rB(e),i=performance.now();return null==(t=o.diagnosticsClient)||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.getEventProperties=function(e,t,n){var r,i,a,s,u=null==(a=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:a.call(i),l="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=o.getHierarchy(t),d=null==(s=c[0])?void 0:s.attrs,f=o.getNearestLabel(t),p=Object.entries(null!=d?d:{}).reduce(function(e,t){var r=$(t,2),i=r[0],o=r[1];if(i.startsWith(n)){var a=i.replace(n,"");a&&(e[a]=o||"")}return e},{}),g=((r={})["[Amplitude] Element Hierarchy"]=c,r[n6]=u,r[n9]=o.getText(t),r["[Amplitude] Element Position Left"]=null==l.left?null:Math.round(l.left),r["[Amplitude] Element Position Top"]=null==l.top?null:Math.round(l.top),r["[Amplitude] Element Attributes"]=p,r["[Amplitude] Element Path"]=o.getElementPath(t),r["[Amplitude] Element Parent Label"]=f,r[re]=ra(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=nx(o.replaceSensitiveString),r[rt]=window.innerHeight,r[rn]=window.innerWidth,r),h=rp();if(h&&(g[rr]=h),g["[Amplitude] Element ID"]=t.getAttribute("id")||"",g["[Amplitude] Element Class"]=t.getAttribute("class"),g["[Amplitude] Element Aria Label"]=null==d?void 0:d["aria-label"],"a"===u&&"click"===e&&t instanceof HTMLAnchorElement){var v=t.href.substring(0,128);g["[Amplitude] Element Href"]=o.replaceSensitiveString(v)}return rf(g)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var a=o.addTypeAndTimestamp(e,t);if(("click"===a.type||"change"===a.type)&&null!==a.event.target){if(i&&ru(a.event.target,a.type))return a.closestTrackedAncestor=a.event.target,a.targetElementProperties=o.getEventProperties(a.type,a.closestTrackedAncestor,r),a;var s=rg(a.event.target,n);s&&(a.closestTrackedAncestor=s,a.targetElementProperties=o.getEventProperties(a.type,s,r))}return a},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=rO(e,t);if(n){if("TEXT"===e.elementExtractType)return o.getText(n);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return n.getAttribute(e.attribute)}}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(nk,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",a=Array.from(e.childNodes);try{for(var s=Y(a),u=s.next();!u.done;u=s.next()){var l=u.value;if(l.nodeType===Node.TEXT_NODE){i+=l.textContent||"";continue}if(l instanceof Element){if(l.hasAttribute(nk)||l.hasAttribute("contenteditable")){i+=nC;continue}i+=o.getTextWithMaskedDescendants(l)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(nk,"]")))return nC;var t="";return t=e.querySelector("[".concat(nk,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveStr
1ing(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,n,r,i=null==(r=null==(n=null==e?void 0:e.tagName)?void 0:n.toLowerCase)?void 0:r.call(n);return rf(((t={})[n6]=i,t[n9]=o.getText(e),t[re]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var a=null!=(i=e.maskTextRegex)?i:[],s=[];try{for(var u=Y(a),l=u.next();!l.done;l=u.next()){var c=l.value;if(s.length>=25)break;if(c instanceof RegExp)s.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{s.push(RegExp(c.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=s},rm=n2;(l=C||(C={})).ClickObservable="clickObservable",l.ChangeObservable="changeObservable",l.NavigateObservable="navigateObservable",l.MutationObservable="mutationObservable",l.ScrollObservable="scrollObservable",l.ExposureObservable="exposureObservable",l.BrowserErrorObservable="browserErrorObservable",l.SelectionObservable="selectionObservable",l.MouseMoveObservable="mouseMoveObservable";var rW=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",n8);var n,r,i,o,a,s,u,l,c,d,f,p,g,h=e.dataAttributePrefix,v=void 0===h?nY:h,m=e.visualTaggingOptions,y=void 0===m?{enabled:!0}:m;e.cssSelectorAllowlist=null!=(n=e.cssSelectorAllowlist)?n:nK,e.actionClickAllowlist=null!=(r=e.actionClickAllowlist)?r:n$,e.debounceTime=null!=(i=e.debounceTime)?i:0;var b=(null==(o=e.viewportContentUpdated)?void 0:o.enabled)!==!1,S=null!=(u=null!=(s=null==(a=e.viewportContentUpdated)?void 0:a.exposureDuration)?s:e.exposureDuration)?u:150;e.viewportContentUpdated=H(H({},e.viewportContentUpdated),{exposureDuration:S}),e.pageUrlExcludelist=null==(l=e.pageUrlExcludelist)?void 0:l.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var w="@amplitude/plugin-autocapture-browser",_=[],E=new rH(e,t),T=new Set,k=new Set,I=function(){var t,n,r,i=n5(rI().map(function(t){return E.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),o=n5(new rm.default(function(t){var n,r=function(n){var r=E.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,v);t.next(r)};return null==(n=eI())||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null==(e=eI())?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(r=n5(new rm.default(function(t){var n=function(n){var r=E.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,v);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var a=n5(rC().map(function(t){return E.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)})),s=new rm.default(function(e){var t,n=function(t){e.next(t)};return null==(t=eI())||t.addEventListener("scroll",n),function(){var e;null==(e=eI())||e.removeEventListener("scroll",n)}}),u=(t=e.cssSelectorAllowlist,new rm.default(function(e){var n,r=eI();if(!(null==r?void 0:r.IntersectionObserver))return function(){};var i=new IntersectionObserver(function(t){t.forEach(function(t){e.next(t)})},{root:null,rootMargin:"0px",threshold:1}),o=t.join(",");(null!=(n=null==r?void 0:r.document.querySelectorAll(o))?n:[]).forEach(function(e){i.observe(e)});var s=a.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(o)&&i.observe(e),e.querySelectorAll(o).forEach(function(e){i.observe(e)}))})})});return function(){s.unsubscribe(),i.disconnect()}}));return(n={})[C.ChangeObservable]=o,n[C.ClickObservable]=i,n[C.MutationObservable]=a,n[C.NavigateObservable]=r,n[C.ScrollObservable]=s,n[C.ExposureObservable]=u,n},P=rL(Object.values(null!=(d=null==(c=e.pageActions)?void 0:c.labeledEvents)?d:{})),A=rN(null!=(p=null==(f=e.pageActions)?void 0:f.triggers)?p:[]),O=new rU(P,A,E,e),x=function(t){var n,r;t&&(e.pageActions=H(H({},e.pageActions),t),P=rL(Object.values(null!=(n=e.pageActions.labeledEvents)?n:{})),A=rN(null!=(r=e.pageActions.triggers)?r:[]),O.update(P,A,e))};return{name:w,type:"enrichment",setup:function(t,n){return G(void 0,void 0,void 0,function(){var r,i,o,a,s,u,l,c,d,f,p,h,m,P,A,R,L,N,D,U,M;return K(this,function(j){if("u"<typeof document)return[2];if(r=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){x(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),o=rc(e,e.cssSelectorAllowlist),a=rc(e,e.actionClickAllowlist),F=(q={allObservables:s=I(),amplitude:n,shouldTrackEvent:o,evaluateTriggers:O.evaluate.bind(O)}).amplitude,V=q.allObservables,B=q.shouldTrackEvent,z=q.evaluateTriggers,u=V.clickObservable.filter(rh).filter(function(e){return B("click",e.closestTrackedAncestor)}).map(function(e){return z(e)}).subscribe(function(e){null==F||F.track(n7,e.targetElementProperties)}),_.push(u),G=(W={allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return E.getEventProperties.apply(E,Q(Q([],$(e),!1),[v],!1))},amplitude:n,shouldTrackEvent:o,evaluateTriggers:O.evaluate.bind(O)}).amplitude,K=W.allObservables,Y=W.getEventProperties,J=W.shouldTrackEvent,X=W.evaluateTriggers,l=K.changeObservable.filter(rh).filter(function(e){return J("change",e.closestTrackedAncestor)}).map(function(e){return X(e)}).subscribe(function(e){null==G||G.track("[Amplitude] Element Changed",Y("change",e.closestTrackedAncestor))}),_.push(l),ee=(Z={allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return E.getEventProperties.apply(E,Q(Q([],$(e),!1),[v],!1))},amplitude:n,shouldTrackEvent:o,shouldTrackActionClick:a}).amplitude,et=Z.allObservables,en=Z.options,er=Z.getEventProperties,ei=Z.shouldTrackEvent,eo=Z.shouldTrackActionClick,ea=et.clickObservable,es=et.mutationObservable,eu=et.navigateObservable,el=ea.filter(function(e){return!ei("click",e.closestTrackedAncestor)}).map(function(e){var t=rg(e.event.target,en.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=er(e.type,e.closestTrackedAncestor)),e}).filter(rh).filter(function(e){return eo("click",e.closestTrackedAncestor)}),ec=eu?n4(es,eu):es,ed=n4(el,ec),ef=null,ep=null,(c=n3(ed,function(e){if(ef&&(clearTimeout(ef),ef=null),"click"===e.type)ep=e,ef=setTimeout(function(){ef=null,ep=null},500);else if(ep){var t=ep;return ep=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==ee||ee.track(n7,er("click",e.closestTrackedAncestor)))}))&&_.push(c),(eg={allObservables:s,amplitude:n}).amplitude,eh=eg.allObservables.scrollObservable,ev={maxX:0,maxY:0},em=eh.subscribe(function(){var e,t,n,r,i=eI(),o=Math.floor(null!=(t=null!=(e=null==i?void 0:i.scrollX)?e:null==i?void 0:i.pageXOffset)?t:0),a=Math.floor(null!=(r=null!=(n=null==i?void 0:i.scrollY)?n:null==i?void 0:i.pageYOffset)?r:0);ev.maxX=Math.max(ev.maxX,o),ev.maxY=Math.max(ev.maxY,a)}),d={unsubscribe:function(){em.unsubscribe()},getState:function(){return ev},reset:function(){ev.maxX=0,ev.maxY=0}},_.push(d),f={},p=eI(),h=function(e){e&&r||(setTimeout(function(){r=!1},100),r=!0,function(e){var t,n,r,i,o,a,s=e.amplitude,u=e.scrollTracker,l=e.currentElementExposed,c=e.elementExposedForPage,d=e.exposureTracker,f=e.isPageEnd,p=e.lastScroll,g=u.getState(),h=eI(),v=null!=(n=null==h?void 0:h.innerWidth)?n:0,m=null!=(r=null==h?void 0:h.innerHeight)?r:0,y=((t={})[re]=ra(null!=(a=null==(o=null==(i=null==h?void 0:h.location)?void 0:i.href)?void 0:o.split("?")[0])?a:""),t["[Amplitude] Max Page X"]=g.maxX+v,t["[Amplitude] Max Page Y"]=g.maxY+m,t[rt]=m,t[rn]=v,t["[Amplitude] Element Exposed"]=Array.from(l),t),b=rp();if(b&&(y[rr]=b),0===l.size&&g.maxX===p.maxX&&g.maxY===p.maxY){f&&(u.reset(),c.clear(),null==d||d.reset());return}null==s||s.track("[Amplitude] Viewport Content Updated",y),p.maxX=g.maxX,p.maxY=g.maxY,l.clear(),f&&(u.reset(),c.clear(),null==d||d.reset())}({amplitude:n,scrollTracker:d,currentElementExposed:k,elementExposedForPage:T,exposureTracker:f.exposure,isPageEnd:e,lastScroll:i}))},m=function(e){!T.has(e)&&(T.add(e),k.add(e),JSON.stringify(Array.from(k)).length>=18e3&&h(!1))},b&&(eb=(ey={allObservables:s,onExposure:m,dataExtractor:E,exposureDuration:S}
1).allObservables,eS=ey.onExposure,ew=ey.dataExtractor,eE=void 0===(e_=ey.exposureDuration)?150:e_,eT=new Map,ek=new Map,eC=eb.exposureObservable.subscribe(function(e){var t=e.target;if(e.isIntersecting){if(!eT.get(t)){var n=setTimeout(function(){eT.set(t,!0),eS(ew.getElementPath(t)),ek.set(t,null)},eE);ek.set(t,n)}}else if(!e.isIntersecting&&e.intersectionRatio<1){var n=ek.get(t);n&&(clearTimeout(n),ek.set(t,null))}}),f.exposure={unsubscribe:function(){eC.unsubscribe()},reset:function(){ek.forEach(function(e){e&&clearTimeout(e)}),ek.clear(),eT.clear()}},f.exposure&&_.push(f.exposure),P=function(){h(!0)},null==p||p.addEventListener("beforeunload",P),g=function(){null==p||p.removeEventListener("beforeunload",P)},_.push({unsubscribe:function(){return g()}}),(A=s[C.NavigateObservable])?_.push(A.subscribe(function(){h(!0)})):p&&(R=function(){h(!0)},p.addEventListener("popstate",R),L=p.history.pushState,p.history&&L&&(p.history.pushState=new Proxy(L,{apply:function(e,t,n){var r=$(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),h(!0)}})),_.push({unsubscribe:function(){p.removeEventListener("popstate",R),p.history&&L&&(p.history.pushState=L)}}))),null==(M=null==t?void 0:t.loggerProvider)||M.log("".concat(w," has been successfully added.")),window.opener&&y.enabled){var q,F,V,B,z,W,G,K,Y,J,X,Z,ee,et,en,er,ei,eo,ea,es,eu,el,ec,ed,ef,ep,eg,eh,ev,em,ey,eb,eS,ew,e_,eE,eT,ek,eC;if(N=e.cssSelectorAllowlist,D=e.actionClickAllowlist,function(e,t){if(!0!==e[rv]){e[rv]=!0;var n=t.dataExtractor,r=t.isElementSelectable,i=t.cssSelectorAllowlist,o=t.actionClickAllowlist,a=null,s=function(t){e.notify({action:"element-selected",data:t})},u=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var l;a=null==(l=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:l.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(e){return!r||r((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:s,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:i,actionClickAllowlist:o,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:n8}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null==(t=e.logger)||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null==(e=null==a?void 0:a.close)||e.call(a)})}}(U=function(){var e=eI(),t=null==e?void 0:e[nZ];if("object"==typeof t&&null!==t&&nX in t&&!0===t[nX])return t;var n=new n0(void 0);
1return e&&(e[nZ]=n),n}(),{dataExtractor:E,isElementSelectable:rc(e,Q(Q([],$(N),!1),$(D),!1)),cssSelectorAllowlist:N,actionClickAllowlist:D}),!0!==U[n1]){U[n1]=!0;var eP="https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz",eA=null,eO=function(e,t){var n,r;"background-capture-complete"===e&&(null==(r=null==(n=U.logger)?void 0:n.debug)||r.call(n,"Background capture complete"),U.notify({action:"background-capture-complete",data:t}))};U.registerActionHandler("initialize-background-capture",function(){null==(t=null==(e=U.logger)?void 0:e.debug)||t.call(e,"Initializing background capture (external script)");var e,t,n=new URL(eP,U.endpoint).toString();U.loadScriptOnce(n).then(function(){var e,t,n;null==(t=null==(e=U.logger)?void 0:e.debug)||t.call(e,"Background capture script loaded (external)"),eA=null==(n=null==window?void 0:window.amplitudeBackgroundCapture)?void 0:n.call(window,{messenger:U,onBackgroundCapture:eO}),U.notify({action:"background-capture-loaded"})}).catch(function(){var e;null==(e=U.logger)||e.warn("Failed to initialize background capture")})}),U.registerActionHandler("close-background-capture",function(){var e;null==(e=null==eA?void 0:eA.close)||e.call(eA),eA=null})}U.setup(H({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:nJ[t.serverZone]}))}return[2]})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){var e,t,n,r;return K(this,function(i){try{for(t=(e=Y(_)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},rm=n2,rG=Q(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],$(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),rK=["*"],rY=["mutation","navigate"];function r$(e,t){var n,r,i,o,a=t.event,s=a.pageX,u=a.pageY;e.yMin=Math.min(null!=(n=e.yMin)?n:u,u),e.yMax=Math.max(null!=(r=e.yMax)?r:u,u),e.xMin=Math.min(null!=(i=e.xMin)?i:s,s),e.xMax=Math.max(null!=(o=e.xMax)?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function rQ(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:H({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}var rm=n2;(c=I||(I={})).INCREASING="increasing",c.DECREASING="decreasing",(d=P||(P={})).X="x",d.Y="y";var rJ=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new rm.default(function(e){var n=null,r=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};if(null===n){n=o;return}o.x>n.x?(r===I.DECREASING&&e.next(P.X),r=I.INCREASING):o.x<n.x&&(r===I.INCREASING&&e.next(P.X),r=I.DECREASING),o.y>n.y?(i===I.DECREASING&&e.next(P.Y),i=I.INCREASING):o.y<n.y&&(i===I.INCREASING&&e.next(P.Y),i=I.DECREASING),n=o})})};function rX(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function rZ(e){e.changes=[],e.startTime=void 0}function r0(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length&&!(i-t[r]<n);r++);0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var r1=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?20:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new rm.default(function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},a=void 0,s=null;function u(){void 0!==a&&(e.next(a),a=void 0,null!==s&&clearTimeout(s),rZ(n),rZ(i))}return t.subscribe(function(e){null!==s&&clearTimeout(s),t=e===P.X?n:i,r=+Date.now(),t.startTime=t.startTime||r,l=t.changes,c=t.changesThreshold,l.push(r),l.length>c&&l.shift();var t,r,l,c,d=function(e,t){var n=void 0;if(rX(e)&&(n=e.startTime),rX(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return d?(a=a||d,s=setTimeout(function(){u(),s=null},o)):u(),r0(n),r0(i),function(){null!==s&&(clearTimeout(s),s=null)}})})},r2=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=e.thresholdMs;return r1({mouseDirectionChangeObservable:rJ({allWindowObservables:r}),directionChanges:void 0===i?20:i,thresholdMs:void 0===o?2e3:o}).subscribe(function(e){rl(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function r3(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var r4=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,s=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(s=!1);var u=r3(e,"rageClicks",rK,a),l=r3(e,"deadClicks",rG,o),c=r3(e,"errorClicks",rG,i),d=null!=(t=e.dataAttributePrefix)?t:nY,f=new rH(e),p=Q([],$(new Set(Q(Q(Q([],$(u),!1),$(l),!1),$(c),!1))),!1),g=function(){var e,t,n=n5(rI("pointerdown").map(function(e){return f.addAdditionalEventProperties(e,"click",p,d,!0)})),r=n5(rP().map(function(e){return f.addTypeAndTimestamp(e,"error")})),i=n5(rC().map(function(e){return f.addAdditionalEventProperties(e,"mutation",p,d)}));window.navigation&&(t=n5(new rm.default(function(e){var t=function(t){e.next(H(H({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return f.addAdditionalEventProperties(e,"navigate",p,d)})));var o=n5(new rm.default(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){var n=void 0,r=void 0;try{if(n=t.selectionStart,r=t.selectionEnd,n===r)return}catch(e){return}return e.next()}var i=window.getSelection();if(i&&!i.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),a=n5(new rm.default(function(e){var t=function(t){e.next(t)},n={capture:!0};return rk.document.addEventListener("mousemove",t,n),function(){rk.document.removeEventListener("mousemove",t,n)}}));return(e={})[C.ClickObservable]=n,e[C.MutationObservable]=i,e[C.NavigateObservable]=t,e[C.BrowserErrorObservable]=r,e[C.SelectionObservable]=o,e[C.MouseMoveObservable]=a,e};return{name:n,type:"enrichment",setup:function(t,p){return G(void 0,void 0,void 0,function(){var h,v,m,y,b,S,w,_;return K(this,function(E){var T,C,I,P,A,O,x,R,L,N,D,U,M,j,q,F,V,B,z,W,Y,$;return"u"<typeof document?[2]:(h=g(),a&&(v=function(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,a=r.selectionObservable,s=[],u={},l=null;function c(e){s=[],u={},e&&(r$(u,e),s.push(e))}var d=n3(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return G(t,void 0,void 0,function(){var t;return K(this,function(n){var r,i,o,a;return(r$(u,e),t=null,0===s.length||(r=s).length>0&&r[r.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=s).length-4+1),a=i[o],e.timestamp-a.timestamp>=1e3)||u.isOutOfBounds)?(l&&(t=rQ(s)),c(e)):s.push(e),(l&&(clearTimeout(l.timerId),l.resolve(t),l=null),s.length>=4)?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(rQ(s))},1e3)}})]:[2,null]})})}),f=null==a?void 0:a.subscribe(function(){c()}),p=d.subscribe(function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}({allObservables:h,amplitude:p,shouldTrackRageClick:rc(e,u)}),r.push(v)),o&&(C=(T={amplitude:p,allObservables:h,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:rc(e,l)}).amplitude,I=T.allObservables,P=T.getEventProperties,A=T.shouldTrackDeadClick,O=I.clickObservable,x=I.mutationObservable,R=I.navigateObservable,L=O.filter(function(e){return rh(e)&&A("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===k.LEFT_OR_TOUCH_CONTACT}),N=R?n4(x,R):x,D=n4(L,N),U=null,m=n3(D,function(e){if(U&&rY.includes(e.type))clearTimeout(U),U=null;else if("click"===e.type)return U?Promise.resolve(null):new Promise(function(t){U=setTimeout(function(){t(e),U=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};C.track("[Amplitude] Dead Click",H(H({},P("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),r.push(m)),i&&(j=(M={amplitude:p,allObservables:h,shouldTrackErrorClick:rc(e,c)}).amplitude,q=M.allObservables,F=M.shouldTrackErrorClick,V=q.clickObservable,B=q.browserErrorObservable,z=V.filter(function(e){return rh(e)&&F("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===k.LEFT_OR_TOUCH_CONTACT}),W=null,Y=null,$=function(){null!==W&&(clearTimeout(W),W=null),Y=null},y=n4(z,B).subscribe(function(e){var t;if("click"===e.type){$(),Y=e,W=setTimeout($,2e3);return}"error"===e.type&&Y&&(j.track("[Amplitude] Error Click",H(((t={})["[Amplitude] Kind"]=e.event.kind,t["[Amplitude] Message"]=e.event.message,t["[Amplitude] Stack"]=e.event.stack,t["[Amplitude] Filename"]=e.event.filename,t["[Amplitude] Line Number"]=e.event.lineNumber,t["[Amplitude] Column Number"]=e.event.columnNumber,t),Y.targetElementProperties)),$())}),r.push(y)),s&&(b=void 0,S=void 0,"object"==typeof e.thrashedCursor&&(b=e.thrashedCursor.directionChanges,S=e.thrashedCursor.threshold,b&&b<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(b," is below the minimum of ").concat(5,", setting to ").concat(5)),b=5),S&&S>4e3&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(4e3,", setting to ").concat(4e3)),S=4e3)),w=r2({amplitude:p,options:e,allObservables:h,directionChanges:b,thresholdMs:S}),r.push(w)),null==(_=null==t?void 0:t.loggerProvider)||_.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){var e,t,n,i;return K(this,function(o){try{for(t=(e=Y(r)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function r5(e,t){var n=e.startTime+e.duration;return t.filter(function(t){return t.startTime<n&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}var r8=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",n=[],r=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,o){return G(void 0,void 0,void 0,function(){var a,s,u;return K(this,function(l){return"u"<typeof document||(r&&(a=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(a=e.mainThreadBlock.durationThreshold),s=function(e){var t=e.amplitude,n=e.options,r=e.durationThreshold,i=void 0===r?100:r,o=function(){if("u"<typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!o)return{unsubscribe:function(){}};var a=[],s=new PerformanceObserver(function(e){var t,n,r=performance.now();try{for(var i=Y(e.getEntries()),o=i.next();!o.done;o=i.next()){var s=o.value;a.push(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}for(var u=r-1e4;a.length>0&&a[0].startTime<u;)a.shift()});try{s.observe({entryTypes:["measure"]})}catch(e){}var u=new PerformanceObserver(function(e){var r,s;try{for(var u=Y(e.getEntries()),l=u.next();!l.done;l=u.next()){var c=l.value;if(!rl(n))return;if(!(c.duration<i)){var d="long-animation-frame"===o?function(e,t){var n,r=r5(e,t),i=null!=(n=e.scripts)?n:[],o=i.map(function(e){return e.sourceURL}
1).filter(Boolean),a=i.map(function(e){return e.sourceFunctionName}).filter(Boolean),s=i.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),u=i.map(function(e){return e.invokerType}).filter(Boolean),l=i.map(function(e){return e.invoker}).filter(Boolean);return H(H(H(H(H(H(H({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":i.length}),o.length>0&&{"[Amplitude] Main Thread Block Script URLs":o}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),s.length>0&&{"[Amplitude] Main Thread Block Script Positions":s}),u.length>0&&{"[Amplitude] Main Thread Block Invoker Types":u}),l.length>0&&{"[Amplitude] Main Thread Block Invokers":l})}(c,a):function(e,t){var n,r=r5(e,t),i=null!=(n=e.attribution)?n:[];return H(H({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(e){return e.name})})}(c,a);t.track("[Amplitude] Main Thread Block",d)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(r)throw r.error}}});try{u.observe({entryTypes:[o]})}catch(e){return s.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){u.disconnect(),s.disconnect()}}}({amplitude:o,options:e,durationThreshold:a}),n.push(s)),null==(u=null==i?void 0:i.loggerProvider)||u.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){var e,t,r,i;return K(this,function(o){try{for(t=(e=Y(n)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]})})}}};function r7(e,t,n){e&&function e(t){var n,r,i=t.json,o=t.targetObject,a=t.allowlist,s=t.excludelist,u=t.ancestors,l=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=Y(d),p=f.next();!p.done;p=f.next()){var g,h=p.value,v=Q(Q([],$(u),!1),[h],!1);(g=o[h],"string"==typeof g||"number"==typeof g||"boolean"==typeof g||null==g)?(!r9(v,a)||r9(v,s))&&delete o[h]:e({json:i,targetObject:o[h],allowlist:a,excludelist:s,ancestors:v,parentObject:o,targetKey:h})}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}0===Object.keys(o).length&&l&&c&&delete l[c]}({json:e,allowlist:t.map(r6),excludelist:n.map(r6),ancestors:[]})}function r6(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function r9(e,t){return t.some(function(t){return function e(t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=0),i===n.length)return r===t.length;if(r===t.length){for(;i<n.length&&"**"===n[i];)i++;return i===n.length}var o=n[i];if("**"===o){if(i+1===n.length)return!0;for(var a=r;a<=t.length;a++)if(e(t,n,a,i+1))return!0;return!1}return("*"===o||o===t[r])&&e(t,n,r+1,i+1)}(e,t)})}var ie=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,n,r=this.request.headers,i={};if(Array.isArray(r))r.forEach(function(e){var t=$(e,2),n=t[0],r=t[1];i[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){i[t]=e});else if("object"==typeof r&&null!==r)try{for(var o=Y(Object.entries(r)),a=o.next();!a.done;a=o.next()){var s=$(a.value,2),u=s[0],l=s[1];i[u]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return iu(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=eI();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=ir(t,100),this._bodySize}}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),G(this,void 0,void 0,function(){return K(this,function(n){return 0===e.length?[2,null]:[2,ia(this.body,e,t)]})})},e}(),it=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),iu(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return ir(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),G(this,void 0,void 0,function(){return K(this,function(n){return 0===e.length?[2,null]:[2,ia(this.body,e,t)]})})},e}();function ir(e,t){var n,r,i,o,a=eI(),s=null==a?void 0:a.TextEncoder;if(s){if("string"==typeof e)o=e,i=new s().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(e instanceof URLSearchParams)o=e,i=new s().encode(o.toString()).length;else if(ArrayBuffer.isView(e))i=(o=e).byteLength;else if(e instanceof ArrayBuffer)i=(o=e).byteLength;else if(e instanceof FormData){var u=0,l=0;try{for(var c=Y(e.entries()),d=c.next();!d.done;d=c.next()){var f=$(d.value,2),p=f[0],g=f[1];if(u+=p.length,"string"==typeof g)u+=new s().encode(g).length;else{if(!(g instanceof Blob))return;u+=g.size}if(++l>=t)return}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream){o=e;return}return i}}var ii=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null==(t=null==n?void 0:n.forEach)||t.call(n,function(e,t){r[t]=e}),iu(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,n=null==(t=null==(e=this.response.headers)?void 0:e.get)?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return G(this,void 0,void 0,function(){return K(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),G(this,void 0,void 0,function(){return K(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,ia(n.sent(),e,t)]}})})},e}(),io=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){if(void 0===e&&(e=[]),!this.headersString)return{};var t,n,r={},i=this.headersString.split("\r\n");try{for(var o=Y(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=$(s.split(": "),2),l=u[0],c=u[1];l&&c&&(r[l]=c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return iu(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),G(this,void 0,void 0,function(){var n;return K(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(r7(n,e,t),[2,n]):[2,null]})})},e}();function ia(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return r7(r,t,n),r}catch(e){return null}}(f=A||(A={})).REDACT="redact",f.REMOVE="remove";var is="[REDACTED]",iu=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,a=t.strategy,s=void 0===a?A.REMOVE:a,u=Q([],$(ew),!1),l={};try{for(var c=Y(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;!function(t){var n=t.toLowerCase();u.find(function(e){return e.toLowerCase()===n})?s===A.REDACT&&(l[t]=is):o.find(function(e){return e.toLowerCase()===n})?l[t]=e[t]:s===A.REDACT&&(l[t]=is)}(f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return l},il=function(){function e(e,t,n,r,i,o,a,s,u,l,c){void 0===a&&(a=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=a,this.duration=s,this.responseWrapper=u,this.error=l,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,n,r;
1return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null==(e=this.requestWrapper)?void 0:e.headers(Q([],$(eS),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(n=this.responseWrapper)?void 0:n.headers(Q([],$(eS),!1)),responseBodySize:null==(r=this.responseWrapper)?void 0:r.bodySize}).filter(function(e){var t=$(e,2);return void 0!==(t[0],t[1])}))},e}(),ic=function(e,t){void 0===t&&(t=eA()),this.callback=e,this.id=t};function id(e){try{e()}catch(e){}}var ip=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=eI();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=eI();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,a,s,u,l,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null==(i=null==(r=null==(n=this.globalScope)?void 0:n.XMLHttpRequest)?void 0:r.prototype)?void 0:i.open,p=null==(s=null==(a=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:a.prototype)?void 0:s.send,g=null==(c=null==(l=null==(u=this.globalScope)?void 0:u.XMLHttpRequest)?void 0:l.prototype)?void 0:c.setRequestHeader;f&&p&&g&&this.observeXhr(f,p,g);var h=null==(d=this.globalScope)?void 0:d.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){try{n.callback(e)}catch(e){id(function(){var n;null==(n=t.logger)||n.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,a){if(void 0!==o&&void 0!==a){var s,u,l,c,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(u=t.url,d=t.method):u=null==(s=null==t?void 0:t.toString)?void 0:s.call(t),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(l=r.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},l=0);var p=Math.floor(performance.now()-a),g=Math.floor(o+p),h=new il(e,d,o,o,u,n,l,p,r,c,g);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return G(t,void 0,void 0,function(){var t,i,o,a=this;return K(this,function(s){switch(s.label){case 0:try{t=this.getTimestamps()}catch(e){id(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=s.sent(),[3,4];case 3:return o=s.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new ie(r):void 0,i?new ii(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){id(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null==(n=t.globalScope)?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){n instanceof Error&&"InvalidStateError"===n.name&&id(function(){var n;return null==(n=t.logger)?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=$(n,2),a=i[0],s=i[1];try{this.$$AmplitudeAnalyticsEvent=H({method:a,url:null==(e=null==s?void 0:s.toString)?void 0:e.call(s),headers:{}},o.getTimestamps())}catch(e){id(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(this,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,a=e.createXhrJsonParser(this,o),s=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new io(i.status,e,t?parseInt(t,10):void 0,a),r=i.$$AmplitudeAnalyticsEvent.headers,l=new it(s,r);u.status=i.status,o.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},l,n,void 0,u.startTime,u.durationStart)}catch(e){id(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){id(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}r.apply(this,[e,t])}}},e}()),ig="[Amplitude] Network Request",rm=n2,ih="500-599";function iv(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function im(e,t){var n,r,i=t.split(",");try{for(var o=Y(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=$(s.split("-").map(Number),2),l=u[0],c=u[1];if(e===l&&void 0===c||e>=l&&e<=c)return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function iy(e){var t;if(e)try{var n=null==(t=eI())?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),a=r.href,s=r.host;r.hash="",r.search="";var u=r.href;return{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:u,host:s}}catch(e){return}}function ib(e){return"object"!=typeof e||null===e?e?Q([],$(eS),!1):void 0:0!==e.length?e:void 0}function iS(e){var t,n,r;return!(null==(t=null==e?void 0:e.allowlist)?void 0:t.length)&&!(null==(n=null==e?void 0:e.blocklist)?void 0:n.length)&&!(null==(r=null==e?void 0:e.excludelist)?void 0:r.length)}(O||(O={})).NetworkObservable="networkObservable";var iw=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new rm.default(function(e){var n=new ic(function(t){var n={event:t,timestamp:Date.now(),type:"network"};e.next(n)});return ip.subscribe(n,t),function(){ip.unsubscribe(n)}});return(e={})[O.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return G(void 0,void 0,void 0,function(){var a;return K(this,function(s){var u,l,c,d,f;return"u"<typeof document?[2]:(a=r(),t=null==i?void 0:i.loggerProvider,l=(u={allObservables:a,networkTrackingOptions:e,amplitude:o,loggerProvider:t}).allObservables,c=u.networkTrackingOptions,d=u.amplitude,f=u.loggerProvider,x=l.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var n,r,i=iy(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(iv(o,"*.amplitude.com")||iv(o,"amplitude.com"))||(null==(n=t.ignoreHosts)?void 0:n.find(function(e){return iv(o,e)})))&&(!!t.captureRules||void 0===e.status||!!im(e.status,ih))&&(!t.captureRules||(Q([],$(t.captureRules),!1).reverse().find(function(t){if(r=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return iv(t,e)}))&&(!r||!e.urls||ro(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!n&&0!==n||!!im(n,e.statusCodeRange||ih))&&!0}(t,o,e.status,e.url,e.method)){var n=ib(t.responseHeaders);if(e.responseWrapper&&n){var i=e.responseWrapper.headers(n);i&&(e.responseHeaders=i)}var a=ib(t.requestHeaders);if(e.requestWrapper&&a){var s=e.requestWrapper.headers(a);s&&(e.requestHeaders=s)}if(e.responseWrapper&&t.responseBody&&!iS(t.responseBody)){var u=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,u)}if(e.requestWrapper&&t.requestBody&&!iS(t.requestBody)){var u=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,u)}}return void 0!==r}),!!r))&&!(e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find(function(e){return e.event_type===ig}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,c)}).subscribe(function(e){var t,n,r,i=e.event,o=iy(i.url);if(o){var a=null==(n=i.responseWrapper)?void 0:n.bodySize,s=null==(r=i.requestWrapper)?void 0:r.bodySize;!function(e,t,n,r){G(this,void 0,void 0,function(){var i,o,a;return K(this,function(s){switch(s.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=$.apply(void 0,[s.sent(),2]))[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(e){null==r||r.debug("Failed to stringify response body")}s.label=2;case 2:return null==n||n.track(ig,e),[2]}})})}(((t={})["[Amplitude] URL"]=o.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=o.query,t["[Amplitude] URL Fragment"]=o.fragment,t["[Amplitude] Request Method"]=i.method,t["[Amplitude] Status Code"]=i.status,t["[Amplitude] Start Time"]=i.startTime,t["[Amplitude] Completion Time"]=i.endTime,t["[Amplitude] Duration"]=i.duration,t["[Amplitude] Request Body Size"]=s,t["[Amplitude] Response Body Size"]=a,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,d,f)}}),null==t||t.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(e){return x.unsubscribe(),[2]})})}}};let i_=-1,iE=e=>{addEventListener("pageshow",t=>{t.persisted&&(i_=t.timeStamp,e(t))},!0)},iT=(e,t,n,r)=>{let i,o;return a=>{let s;t.value>=0&&(a||r)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,s=t.value,t.rating=s>n[1]?"poor":s>n[0]?"needs-improvement":"good",e(t))}},ik=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},iC=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},iI=()=>{let e=iC();return e?.activationStart??0},iP=(e,t=-1)=>{let n=iC(),r="navigate";return i_>=0?r="back-forward-cache":n&&(document.prerendering||iI()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:r}},iA=new WeakMap;function iO(e,t){return iA.get(e)||iA.set(e,new t),iA.get(e)}class ix{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}let iR=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},iL=e=>{let t=!1;return()=>{t||(e(),t=!0)}},iN=-1,iD=new Set,iU=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,iM=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of iD)e();isFinite(iN)||(iN="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",iM,!0))}},ij=()=>
1{if(iN<0){let e=iI();iN=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??iU(),addEventListener("visibilitychange",iM,!0),addEventListener("prerenderingchange",iM,!0),iE(()=>{setTimeout(()=>{iN=iU()})})}return{get firstHiddenTime(){return iN},onHidden(e){iD.add(e)}}},iq=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},iF=[1800,3e3],iV=(e,t={})=>{iq(()=>{let n=ij(),r,i=iP("FCP"),o=iR("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-iI(),0),i.entries.push(t),r(!0)))});o&&(r=iT(e,i,iF,t.reportAllChanges),iE(n=>{r=iT(e,i=iP("FCP"),iF,t.reportAllChanges),ik(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},iB=[.1,.25],iz=0,iH=1/0,iW=0,iG=e=>{for(let t of e)t.interactionId&&(iH=Math.min(iH,t.interactionId),iz=(iW=Math.max(iW,t.interactionId))?(iW-iH)/7+1:0)},iK=()=>t?iz:performance.interactionCount??0,iY=0;class i${u=[];l=new Map;m;p;v(){iY=iK(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((iK()-iY)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(n)}}}let iQ=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=iL(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},iJ=[200,500];class iX{m;h(e){this.m?.(e)}}let iZ=[2500,4e3],i0=[800,1800],i1=e=>{document.prerendering?iq(()=>i1(e)):"complete"!==document.readyState?addEventListener("load",()=>i1(e),!0):setTimeout(e)};function i2(e){var t,n;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((n=(null==(t=e.entries[0])?void 0:t.startTime)||0,performance.timeOrigin+n)),navigationStart:Math.floor(performance.timeOrigin)}}var i3=function(){var e=null,n=eI(),r=null==n?void 0:n.document,i=null==n?void 0:n.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(n,o){return G(void 0,void 0,void 0,function(){var a,s;return K(this,function(u){return void 0===r||(a=ra((null==i?void 0:i.href)||"",n.loggerProvider),s={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":ra((null==i?void 0:i.pathname)||"",n.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":ra(a.split("?")[0],n.loggerProvider)},((e,t={})=>{iq(()=>{let n=ij(),r,i=iP("LCP"),o=iO(t,iX),a=e=>{for(let a of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(a),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-iI(),0),i.entries=[a],r())},s=iR("largest-contentful-paint",a);if(s){r=iT(e,i,iZ,t.reportAllChanges);let n=iL(()=>{a(s.takeRecords()),s.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(iQ(n),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});iE(n=>{r=iT(e,i=iP("LCP"),iZ,t.reportAllChanges),ik(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(function(e){s["[Amplitude] LCP"]=i2(e)}),iV(function(e){s["[Amplitude] FCP"]=i2(e)}),((e,n={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let r=ij();iq(()=>{"interactionCount"in performance||t||(t=iR("event",iG,{type:"event",buffered:!0,durationThreshold:0}));let i,o=iP("INP"),a=iO(n,i$),s=e=>{iQ(()=>{for(let t of e)a.h(t);let t=a.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},u=iR("event",s,{durationThreshold:n.durationThreshold??40});i=iT(e,o,iJ,n.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{s(u.takeRecords()),i(!0)}),iE(()=>{a.v(),i=iT(e,o=iP("INP"),iJ,n.reportAllChanges)}))})})(function(e){s["[Amplitude] INP"]=i2(e)}),((e,t={})=>{let n=ij();iV(iL(()=>{let r,i=iP("CLS",0),o=iO(t,ix),a=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},s=iR("layout-shift",a);s&&(r=iT(e,i,iB,t.reportAllChanges),n.onHidden(()=>{a(s.takeRecords()),r(!0)}),iE(()=>{o.i=0,r=iT(e,i=iP("CLS",0),iB,t.reportAllChanges),ik(()=>r())}),setTimeout(r))}))})(function(e){s["[Amplitude] CLS"]=i2(e)}),((e,t={})=>{let n=iP("TTFB"),r=iT(e,n,i0,t.reportAllChanges);i1(()=>{let i=iC();i&&(n.value=Math.max(i.responseStart-iI(),0),n.entries=[i],r(!0),iE(()=>{(r=iT(e,n=iP("TTFB",0),i0,t.reportAllChanges))(!0)}))})})(function(e){s["[Amplitude] TTFB"]=i2(e)}),e=function(){"hidden"===r.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",s),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},i4=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(
1Boolean).join("_")},i5=function(){function e(e,t){var n;this.shouldTrackNewCampaign=!1,this.options=H({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:nh((null==(n=t.cookieOptions)?void 0:n.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=i4(t.apiKey,"MKTG"),this.webExpStorageKey=i4(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eb,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return G(this,void 0,void 0,function(){var e,t;return K(this,function(n){switch(n.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=$.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||e7(this.sessionTimeout,this.lastEventTime),!nf(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return G(this,void 0,void 0,function(){var e;return K(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new nR().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,ex(Object.entries(H(H({},eb),t)).reduce(function(e,t){var r,i=$(t,2),o=i[0],a=i[1];return(e.setOnce("initial_".concat(o),null!=(r=null!=a?a:n.initialEmptyValue)?r:"EMPTY"),a)?e.set(o,a):e.unset(o)},new eT)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),i8=new Set([S.IDENTIFY,S.GROUP_IDENTIFY]),i7=function(e){void 0===e&&(e={});var t,n,r,i,o,a,s,u=null!=(t=e.fallbackAttributionEvent)&&t,l=eI(),c={},d=!1,f=!1,p=function(){return G(void 0,void 0,void 0,function(){return K(this,function(e){switch(e.label){case 0:return[4,new nR().parse()];case 1:return c=nL(e.sent()),u&&(null==r||r.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",c)),[2]}})})},g=function(){p()},h=function(e){return new Proxy(e,{apply:function(e,t,n){Reflect.apply(e,t,n),d&&g()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return G(void 0,void 0,void 0,function(){return K(this,function(u){switch(u.label){case 0:return n=t,r=e.loggerProvider,d=!0,r.log("Installing event property attribution tracking."),[4,p()];case 1:if(u.sent(),!l)return[2];if(l.addEventListener("popstate",g),!f){if(i=Reflect.get(l.history,"pushState"),o=Reflect.get(l.history,"replaceState"),!i||!o)return[2];a=h(i),l.history.pushState=a,s=h(o),l.history.replaceState=s,f=!0}return[2]}})})},execute:function(e){return G(void 0,void 0,void 0,function(){return K(this,function(t){return i8.has(e.event_type)||(e.event_properties=H(H({},c),e.event_properties)),[2,e]})})},teardown:function(){return G(void 0,void 0,void 0,function(){var e,t;return K(this,function(n){return l&&(l.removeEventListener("popstate",g),e=Reflect.get(l.history,"pushState"),t=Reflect.get(l.history,"replaceState"),f&&e===a&&i&&(l.history.pushState=i),f&&t===s&&o&&(l.history.replaceState=o)),d=!1,f=!1,i=void 0,o=void 0,a=void 0,s=void 0,c={},[2]})})}}},i6="AMP_CURRENT_PAGE",i9="AMP_PREVIOUS_PAGE",oe="AMP_URL_INFO";(p=R||(R={})).Direct="direct",p.Internal="internal",p.External="external";var ot=new Set([S.IDENTIFY,S.GROUP_IDENTIFY,S.REVENUE]),on=function(e){var t=(void 0===e?{}:e).internalDomains,n=void 0===t?[]:t,r=eI(),i=void 0,o=!1,a=void 0,s=!1,u=!1,l=function(e){var t;try{var n=ra(e,a);t=new URL(n).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t},c=function(e){var t="u">typeof location&&location.hostname||"",r=e?l(e):void 0;if(!r)return R.Direct;var i=n.some(function(e){return -1!==t.indexOf(e)}),o=n.some(function(e){return -1!==r.indexOf(e)});return t===r||o&&i?R.Internal:R.External},d=function(){return G(void 0,void 0,void 0,function(){var e,t,n,r,a;return K(this,function(s){switch(s.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(oe)];case 1:return e=s.sent(),t=ra("u">typeof location&&location.href||""),n=(null==e?void 0:e[i6])||"",r=void 0,r=t===n?(null==e?void 0:e[i9])||"":n||document.referrer||"",[4,i.set(oe,((a={})[i6]=t,a[i9]=r,a))];case 2:s.sent(),s.label=3;case 3:return[2]}})})},f=function(){d()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return G(void 0,void 0,void 0,function(){var t,n,c,p,g,h,v,m;return K(this,function(y){switch(y.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!r)return[3,7];try{i=new tY(r.sessionStorage)}catch(e){null==a||a.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:if(o=null!=(m=y.sent())&&m,!(i&&o))return[3,6];return n=(t="u">typeof document&&document.referrer||"")?l(t):void 0,c="u">typeof location&&location.hostname||"",p=ra("u">typeof location&&location.href||""),[4,i.get(oe)];case 2:if(h=(null==(g=y.sent())?void 0:g[i6])||"",!(n&&n!==c&&h!==p))return[3,4];return[4,i.set(oe,((v={})[i6]=p,v[i9]=t,v))];case 3:return y.sent(),[3,6];case 4:return[4,d()];case 5:y.sent(),y.label=6;case 6:r.addEventListener("popstate",f),s||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=$(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),u&&f()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=$(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),u&&f()}}),s=!0),y.label=7;case 7:return[2]}})})},execute:function(e){return G(void 0,void 0,void 0,function(){var t,n,r;return K(this,function(a){switch(a.label){case 0:if(t=ra("u">typeof location&&location.href||""),!(i&&o))return[3,2];return[4,i.get(oe)];case 1:if(r=(null==(n=a.sent())?void 0:n[i9])||"",ot.has(e.event_type))return[2,e];e.event_properties=H(H({},e.event_properties||{}),{"[Amplitude] Page Domain":or(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":or(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":or(e,"[Amplitude] Page Path","u">typeof location&&ra(location.pathname)||""),"[Amplitude] Page Title":or(e,"[Amplitude] Page Title",nx(nO)),"[Amplitude] Page URL":or(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":r,"[Amplitude] Previous Page Type":c(r)}),a.label=2;case 2:return[2,e]}})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(e){switch(e.label){case 0:if(r&&(r.removeEventListener("popstate",f),u=!1),!(i&&o))return[3,2];return[4,i.set(oe,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function or(e,t,n){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?n:e.event_properties[t]}var oi=function(){var e,t,n;function r(t){if(t)try{var n=Function("return "+t)();if("function"==typeof n)return n;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}return{name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return G(void 0,void 0,void 0,function(){var o,a;return K(this,function(s){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null==(a=i.remoteConfig)?void 0:a.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){n=e&&"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body?r(e.body||""):r("")}),t=function(){var e;return null==(e=i.remoteConfigClient)?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return G(void 0,void 0,void 0,function(){var r;return K(this,function(i){if(n)try{return[2,null!=(r=n(t))?r:null]}catch(t){null==e||e.error("Could not execute custom enrichment function",t)}return[2,t]})})},teardown:function(){return G(void 0,void 0,void 0,function(){return K(this,function(e){return t&&t(),[2]})})}}},oo="userProperty",oa="eventProperty",os=function(e){return e===oo||e===oa},ou=function(e){var t=Q([],$(new Set((Array.isArray(e)?e:[e]).filter(os))),!1);return t.length>0?t:[oo]},ol=function(e,t){return ou(e.trackingMethod).includes(t)},oc=function(e){return ol(e,oo)};let od={init:et((g=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return z(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>
12?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),eN(this._init(H(H({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,a,s,u,l;return G(this,void 0,void 0,function(){var c,d,f,p,g,h,v,m,b,S,w,_,E,T,k=this;return K(this,function(C){var I,P,A,O,x,R,L,N,D;switch(C.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,c=nE(t),d=null!=(n=t.loggerProvider)?n:new ej,t.loggerProvider||d.enable(null!=(r=t.logLevel)?r:y.Warn),f=null!=(i=t.serverZone)?i:"US",g=this._diagnosticsSampleRate,h=null==(o=t.enableDiagnostics)||o,!c)return[3,2];return p=new tn(t.apiKey,d,f,null==(a=t.remoteConfig)?void 0:a.serverUrl),[4,new Promise(function(e){null==p||p.subscribe("configs.diagnostics.browserSDK","all",function(t,n,r){if(d.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(g=i);var o=t.enabled;"boolean"==typeof o&&(h=o)}e()})})];case 1:C.sent(),C.label=2;case 2:return(v=new tm(t.apiKey,d,f,{enabled:h,sampleRate:g})).setTag("library","".concat(tj,"/").concat(tM)),"u">typeof navigator&&v.setTag("user_agent",navigator.userAgent),[4,(I=t.apiKey,P=t,A=this,O=v,x={loggerProvider:d,serverZone:f,enableDiagnostics:h,diagnosticsSampleRate:g},void 0===P&&(P={}),G(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a,s,u,l,c,d,f,p,g,h,v,m,y,b,S,w,_,E,T,k,C,R,L,N,D,U,M,j,q,F,V,B,z,W,Y,Q,J,X,Z,ee,et,en,er,ei,eo;return K(this,function(ea){var es,eu,el,ec;switch(ea.label){case 0:if(e=P.identityStorage||nl,t="",!(e===nl&&!(null==(w=P.cookieOptions)?void 0:w.domain)&&(null==(_=P.cookieOptions)?void 0:_.domain)!==""))return[3,2];return[4,(es=void 0,eu=O,G(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a;return K(this,function(s){switch(s.label){case 0:return[4,new tB(void 0,{diagnosticsClient:eu}).isEnabled()];case 1:if(!s.sent()||!es&&("u"<typeof location||!location.hostname)||1===(t=(e=null!=es?es:location.hostname).split(".")).length)return[2,""];for(n=[],r=1,ny.find(function(t){return e.endsWith(".".concat(t))})&&(r=2),i=t.length-r-1;i>=0;--i)n.push(t.slice(i).join("."));i=0,s.label=2;case 2:if(!(i<n.length))return[3,7];o=n[i],s.label=3;case 3:return s.trys.push([3,5,,6]),[4,tB.isDomainWritable(o)];case 4:if(s.sent())return[2,"."+o];return[3,6];case 5:return a=s.sent(),eu&&eu.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:a instanceof Error?a.message:String(a)}),[3,6];case 6:return i++,[3,2];case 7:return eu&&eu.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}})}))];case 1:t=ea.sent(),ea.label=2;case 2:return n=H({domain:null!=(T=null==(E=P.cookieOptions)?void 0:E.domain)?T:t,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},P.cookieOptions),r={duplicateResolverFn:function(e){var t=tW(e);return!!t&&tG(JSON.parse(t).cookieDomain,n.domain)},diagnosticsClient:O},[4,(el=i=n_(P.identityStorage,n,r),void 0===(ec=null==(C=null==(k=P.cookieOptions)?void 0:k.upgrade)||C)&&(ec=!0),G(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a,s,u;return K(this,function(l){switch(l.label){case 0:return e="".concat("amp","_").concat(I.substring(0,6)),[4,el.getRaw(e)];case 1:if(!(t=l.sent()))return[2,{optOut:!1}];if(!ec)return[3,3];
1return[4,el.remove(e)];case 2:l.sent(),l.label=3;case 3:return r=(n=$(t.split("."),6))[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],[2,{deviceId:r,userId:t4(i),sessionId:t3(a),lastEventId:t3(u),lastEventTime:t3(s),optOut:!!o}]}})}))];case 3:return o=ea.sent(),[4,i.get(tK(I))];case 4:return a=ea.sent(),l=!(u=(s=e9()).ampTimestamp?Number(s.ampTimestamp):void 0)||Date.now()<u,c=null!=(U=null!=(D=null!=(N=null!=(R=P.deviceId)?R:l?null!=(L=s.ampDeviceId)?L:s.deviceId:void 0)?N:null==a?void 0:a.deviceId)?D:o.deviceId)?U:eA(),d=null!=(M=null==a?void 0:a.lastEventId)?M:o.lastEventId,f=null!=(j=null==a?void 0:a.lastEventTime)?j:o.lastEventTime,p=null!=(F=null!=(q=P.optOut)?q:null==a?void 0:a.optOut)?F:o.optOut,g=null!=(V=null==a?void 0:a.sessionId)?V:o.sessionId,h=null==a?void 0:a.deferredSessionId,v=null!=(z=null!=(B=P.userId)?B:null==a?void 0:a.userId)?z:o.userId,A.previousSessionDeviceId=null!=(W=null==a?void 0:a.deviceId)?W:o.deviceId,A.previousSessionUserId=null!=(Y=null==a?void 0:a.userId)?Y:o.userId,m={ipAddress:null==(J=null==(Q=P.trackingOptions)?void 0:Q.ipAddress)||J,language:null==(Z=null==(X=P.trackingOptions)?void 0:X.language)||Z,platform:null==(et=null==(ee=P.trackingOptions)?void 0:ee.platform)||et},y=null==a?void 0:a.pageCounter,b=null==a?void 0:a.debugLogsEnabled,void 0!==P.autocapture&&(P.defaultTracking=P.autocapture),[4,(S=new nw(I,P.appVersion,i,n,P.defaultTracking,P.autocapture,c,P.flushIntervalMillis,P.flushMaxRetries,P.flushQueueSize,e,P.ingestionMetadata,P.instanceName,d,f,null!=(en=null==x?void 0:x.loggerProvider)?en:P.loggerProvider,P.logLevel,P.minIdLength,P.offline,p,P.partnerId,P.plan,P.serverUrl,null!=(er=null==x?void 0:x.serverZone)?er:P.serverZone,g,h,P.sessionTimeout,P.storageProvider,m,P.transport,P.useBatch,P.fetchRemoteConfig,v,y,b,P.networkTrackingOptions,P.identify,null!=(ei=null==x?void 0:x.enableDiagnostics)?ei:P.enableDiagnostics,null!=(eo=null==x?void 0:x.diagnosticsSampleRate)?eo:A._diagnosticsSampleRate,O,P.remoteConfig,t,P.enableRequestBodyCompression,P.customEnrichment)).storageProvider.isEnabled()];case 5:return ea.sent()||(S.loggerProvider.warn("Storage provider ".concat(S.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),S.storageProvider=new tF),[2,S]}})}))];case 3:if(m=C.sent(),!(c&&p))return[3,5];return[4,new Promise(function(e){null==p||p.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){m.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&function(e,t){if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var n,r,i,o,a,s,u,l,c,d,f,p,g=Object.keys(t);try{for(var h=Y(g),v=h.next();!v.done;v=h.next()){var m=v.value;try{var y=t[m];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(t[m]=!0)):t[m]=!1),e(y)}catch(e){}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{if(null==(c=null==(l=null==(u=t.autocapture)?void 0:u.networkTracking)?void 0:l.captureRules)?void 0:c.length)try{for(var b=Y(t.autocapture.networkTracking.captureRules),S=b.next();!S.done;S=b.next()){var w=S.value;try{for(var _=(a=void 0,Y(["responseHeaders","requestHeaders"])),E=_.next();!E.done;E=_.next()){var T=E.value,k=null!=(d=w[T])?d:{},C=k.captureSafeHeaders,I=k.allowlist;if(C||I){if(void 0!==I&&!Array.isArray(I)){delete w[T];continue}w[T]=Q(Q([],$(C?eS:[]),!1),$(null!=I?I:[]),!1)}}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{S&&!S.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}catch(e){}var P=null==(f=t.autocapture)?void 0:f.frustrationInteractions;P&&(P.rageClick&&(P.rageClicks=P.rageClick,delete P.rageClick),P.deadClick&&(P.deadClicks=P.deadClick,delete P.deadClick));try{var A=null==(p=t.autocapture)?void 0:p.elementInteractions;if(A&&"object"==typeof A&&(!0===A.viewportContentUpdated&&(A.viewportContentUpdated={}),!1===A.viewportContentUpdated&&(A.viewportContentUpdated={enabled:!1}),void 0!==A.exposureDuration)){var O=A.viewportContentUpdated;void 0===O?A.viewportContentUpdated={exposureDuration:A.exposureDuration}:"object"==typeof O&&void 0===O.exposureDuration&&!1!==O.enabled&&(O.exposureDuration=A.exposureDuration),delete A.exposureDuration}}catch(e){}}}(e);try{var n,r,i,o,a,s,u;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var l=H({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(i=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:i.length)){l.elementInteractions=H({},e.autocapture.elementInteractions);var c=l.elementInteractions,d=null!=(o=c.pageUrlAllowlist)?o:[],f=e.autocapture.elementInteractions.pageUrlAllowlistRegex;c.pageUrlAllowlist=nG(d,f,t),delete c.pageUrlAllowlistRegex}
1if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null==(a=e.autocapture.networkTracking.captureRules)?void 0:a.length)){l.networkTracking=H({},e.autocapture.networkTracking);var p=null!=(s=l.networkTracking.captureRules)?s:[];try{for(var g=Y(p),h=g.next();!h.done;h=g.next()){var v=h.value;v.urls=nG(null!=(u=v.urls)?u:[],v.urlsRegex,t),delete v.urlsRegex}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=H({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=H(H({},t.autocapture),l))}t.defaultTracking=t.autocapture}"customEnrichment"in e&&null!==e.customEnrichment&&!1!==t.customEnrichment&&(t.customEnrichment=e.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,m),e()})})];case 4:C.sent(),C.label=5;case 5:return[4,e.prototype._init.call(this,m)];case 6:if(C.sent(),this.logBrowserOptions(m),this.config.remoteConfigClient=p,b=tw((R=this.config).defaultTracking)&&R.defaultTracking&&"object"==typeof R.defaultTracking&&R.defaultTracking.attribution&&"object"==typeof R.defaultTracking.attribution?H({},R.defaultTracking.attribution):{},!(tw(this.config.defaultTracking)&&oc(b)))return[3,8];return this.config.optOut&&this.timeline.addOptOutListener(function(e){return G(k,void 0,void 0,function(){return K(this,function(t){switch(t.label){case 0:if(e)return[3,2];return this.webAttribution=new i5(b,this.config),[4,this.webAttribution.init()];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new i5(b,this.config),[4,this.webAttribution.init()];case 7:C.sent(),C.label=8;case 8:if(_=!(!(w=(S=e9()).ampTimestamp?Number(S.ampTimestamp):void 0)||Date.now()<w)||Number.isNaN(Number(S.ampSessionId))?void 0:Number(S.ampSessionId),-1!==(E=this.config.deferredSessionId)||this.config.optOut||(E=Date.now()),this.setSessionId(null!=(l=null!=(u=null!=(s=t.sessionId)?s:_)?u:E)?l:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return G(k,void 0,void 0,function(){return K(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(T=e4(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline)return[3,10];return[4,this.add(nW()).promise];case 9:C.sent(),C.label=10;case 10:return[4,this.add(new eG({diagnosticsClient:v})).promise];case 11:return C.sent(),[4,this.add(new tq).promise];case 12:return C.sent(),[4,this.add(new e6).promise];case 13:if(C.sent(),nH(this.config),!tS(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(nB()).promise];case 14:C.sent(),C.label=15;case 15:if(!t_(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(nq()).promise];case 16:C.sent(),C.label=17;case 17:if(!tE(this.config.defaultTracking))return[3,20];if(this.config.optOut)return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(nD(tR(this.config))).promise];case 18:return C.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return G(k,void 0,void 0,function(){return K(this,function(t){switch(t.label){case 0:if(e)return[2];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(nD(tR(this.config))).promise];case 1:return t.sent(),[2]}})})}),C.label=20;case 20:if(!(tw(this.config.defaultTracking)&&ol(b,oa)))return[3,22];return this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(i7(b)).promise];
1case 21:C.sent(),C.label=22;case 22:if(!tC(this.config.autocapture))return[3,24];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(rW(tA(this.config),{diagnosticsClient:v})).promise];case 23:C.sent(),C.label=24;case 24:if(!tI(this.config.autocapture))return[3,26];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(r4(tO(this.config))).promise];case 25:C.sent(),C.label=26;case 26:if(!tk(this.config.autocapture))return[3,28];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(iw(tx(this.config))).promise];case 27:C.sent(),C.label=28;case 28:if(!("boolean"==typeof(L=this.config.autocapture)?L:"object"==typeof L&&!0===L.webVitals))return[3,30];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(i3()).promise];case 29:C.sent(),C.label=30;case 30:if("object"!=typeof(N=this.config.autocapture)||!0!==N.performanceTracking&&"object"!=typeof N.performanceTracking)return[3,32];return this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(r8(tP(this.config))).promise];
1case 31:C.sent(),C.label=32;case 32:if(!tS(this.config.autocapture,"pageUrlEnrichment"))return[3,34];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(on()).promise];case 33:C.sent(),C.label=34;case 34:if(!("boolean"==typeof(D=this.config.customEnrichment)?D:"object"==typeof D&&null!==D&&!1!==D.enabled))return[3,36];return this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(oi()).promise];case 35:C.sent(),C.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return C.sent(),T.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},n=t.time,r=W(t,["time"]);k.track(e.eventType,r,"number"==typeof n?{time:n}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null==(e=this.config)?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),e5(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null==(e=this.config)?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),e8(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(eA()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null==(e=this.config)?void 0:e.deviceId,userId:null==(t=this.config)?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var t,n,r,i=new eT,o=null!=(r=e.userProperties)?r:{};try{for(var a=Y(Object.entries(o)),s=a.next();!s.done;s=a.next()){var u=$(s.value,2),l=u[0],c=u[1];i.set(l,c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null==(e=this.config)?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null==(e=this.config)?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),eN(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,eN(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return eN(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!=(t=this.config.lastEventId)?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,tT(this.config.defaultTracking)&&(r&&i&&n.push(this.track(ne,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(ex(this.config.identify)).promise),tT(this.config.defaultTracking)&&n.push(this.track(t9,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,eN(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=nT(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(tD(t)){var r=t._q;t._q=[],t=tN(new eT,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(tD(r)){var o=r._q;r._q=[],r=tN(new eT,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(tD(t)){var r=t._q;t._q=[],t=tN(new eK,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!oc(this.webAttribution.options))return!1;var n=this.webAttribution.generateCampaignEvent(e);
1return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return G(this,void 0,void 0,function(){var n,r,i;return K(this,function(o){return n=Date.now(),r=e7(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==t9&&t.event_type!==ne&&(!t.session_id||t.session_id===this.getSessionId())&&(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=H(H({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",tb(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t}(eD))).init.bind(g),"init",X(g),ee(g,["config"])),add:et(g.add.bind(g),"add",X(g),ee(g,["config.apiKey","timeline.plugins"])),remove:et(g.remove.bind(g),"remove",X(g),ee(g,["config.apiKey","timeline.plugins"])),track:et(g.track.bind(g),"track",X(g),ee(g,["config.apiKey","timeline.queue.length"])),logEvent:et(g.logEvent.bind(g),"logEvent",X(g),ee(g,["config.apiKey","timeline.queue.length"])),identify:et(g.identify.bind(g),"identify",X(g),ee(g,["config.apiKey","timeline.queue.length"])),groupIdentify:et(g.groupIdentify.bind(g),"groupIdentify",X(g),ee(g,["config.apiKey","timeline.queue.length"])),setGroup:et(g.setGroup.bind(g),"setGroup",X(g),ee(g,["config.apiKey","timeline.queue.length"])),revenue:et(g.revenue.bind(g),"revenue",X(g),ee(g,["config.apiKey","timeline.queue.length"])),flush:et(g.flush.bind(g),"flush",X(g),ee(g,["config.apiKey","timeline.queue.length"])),getUserId:et(g.getUserId.bind(g),"getUserId",X(g),ee(g,["config","config.userId"])),setUserId:et(g.setUserId.bind(g),"setUserId",X(g),ee(g,["config","config.userId"])),getDeviceId:et(g.getDeviceId.bind(g),"getDeviceId",X(g),ee(g,["config","config.deviceId"])),setDeviceId:et(g.setDeviceId.bind(g),"setDeviceId",X(g),ee(g,["config","config.deviceId"])),reset:et(g.reset.bind(g),"reset",X(g),ee(g,["config","config.userId","config.deviceId"])),getSessionId:et(g.getSessionId.bind(g),"getSessionId",X(g),ee(g,["config"])),setSessionId:et(g.setSessionId.bind(g),"setSessionId",X(g),ee(g,["config"])),extendSession:et(g.extendSession.bind(g),"extendSession",X(g),ee(g,["config"])),setOptOut:et(g.setOptOut.bind(g),"setOptOut",X(g),ee(g,["config"])),setTransport:et(g.setTransport.bind(g),"setTransport",X(g),ee(g,["config"])),getIdentity:et(g.getIdentity.bind(g),"getIdentity",X(g),ee(g,["config"])),setIdentity:et(g.setIdentity.bind(g),"setIdentity",X(g),ee(g,["config","config.userId","config.deviceId"])),getOptOut:et(g.getOptOut.bind(g),"getOptOut",X(g),ee(g,["config"])),_setDiagnosticsSampleRate:et(g._setDiagnosticsSampleRate.bind(g),"_setDiagnosticsSampleRate",X(g),ee(g,["config"]))};e.s([],268043),e.i(268043),(h=L||(L={})).US="US",h.EU="EU",h.STAGING="STAGING",e.s(["DEFAULT_ACTION_CLICK_ALLOWLIST",0,n$,"DEFAULT_CSS_SELECTOR_ALLOWLIST",0,nK,"DEFAULT_DATA_ATTRIBUTE_PREFIX",0,nY,"EXCLUDE_INTERNAL_REFERRERS_CONDITIONS",0,nc,"IdentifyOperation",0,b,"LogLevel",0,y,"OfflineDisabled",0,null,"RevenueProperty",0,E,"ServerZone",0,L,"SpecialEventType",0,S],457793),e.i(457793),od.add,od.extendSession,od.flush,od.getDeviceId,od.getIdentity,od.getOptOut,od.getSessionId;var of=od.getUserId,op=(od.groupIdentify,od.identify),og=od.init,oh=(od.logEvent,od.remove,od.reset,od.revenue,od.setDeviceId,od.setGroup,od.setIdentity,od.setOptOut,od.setSessionId,od.setTransport,od.setUserId,od.track);od._setDiagnosticsSampleRate;var ov=e.i(734804),om=e.i(990033);let oy="user_id",ob={saveUserId(e){try{localStorage.setItem(oy,e)}catch(e){console.error("Failed to save user ID:",e)}},getUserId(){try{return localStorage.getItem(oy)}catch(e){return console.error("Failed to load user ID:",e),null}}};function oS(){return function(...e){for(let t of e)if("string"==typeof t&&t.trim().length>0)return t}(new URLSearchParams(window.location.search).get(oy),ov.default.get(oy),of(),ob.getUserId())}function ow(e={}){let{syncUrl:t=!0}
1=e,n=oS()||(0,om.v4)(),r=new URL(window.location.href),i=!!r.searchParams.get(oy);return ob.saveUserId(n),ov.default.set(oy,n,{sameSite:"lax",secure:!0,expires:365}),t&&!i&&(r.searchParams.set(oy,n),window.history.replaceState(null,"",r.toString())),n}var o_=e.i(426235);function oE(e,t,n,r){if("navigation-point"===e.nodeType)return e.transitionTo?.default??null;let i=e.transitionTo;if(!i||!("default"in i))return null;if("direct"===i.type)return i.default;if("conditional"===i.type){for(let e of i.rules??[])if(function(e,t){let n=t[e.sourceScreenId],r=e.value,i=e.operator,o=Array.isArray(n)?n:n?[n]:[],a=o[0]||"";switch(i){case"eq":return a===r;case"neq":return a!==r;case"gt":return Number(a)>Number(r);case"gte":return Number(a)>=Number(r);case"lt":return Number(a)<Number(r);case"lte":return Number(a)<=Number(r);case"contains":return a.includes(r);case"not-contains":return!a.includes(r);case"starts-with":return a.startsWith(r);case"ends-with":return a.endsWith(r);case"is-empty":return 0===o.length||""===a;case"is-not-empty":return o.length>0&&""!==a;default:return!1}}(e,t))return e.to;return i.default}if("country"===i.type){let e=n?.country?.toUpperCase();if(e){let t=i.rules?.find(t=>t.country?.toUpperCase()===e);if(t)return t.to}return i.default}if("language"===i.type){let e=n?.language;if(e){let t=i.rules?.find(t=>t.language===e);if(t)return t.to}return i.default}if("os"===i.type){let e=n?.os;if(e){let t=i.rules?.find(t=>t.os===e);if(t)return t.to}return i.default}if("browser"===i.type){let e=n?.browser;if(e){let t=i.rules?.find(t=>t.browser===e);if(t)return t.to}return i.default}if("query"===i.type){let e=n?.queryParams;if(i.rules?.length)for(let t of i.rules){let n=e?.[t.param],r=t.operator??"eq",i=!1;if("is-empty"===r)i=null==n||""===n;else if("is-not-empty"===r)i=null!=n&&""!==n;else if(null!=n){let e=String(n);i="contains"===r?e.includes(t.value):e===t.value}if(i)return t.to}return i.default}if("ab-test"===i.type){let t="routing-point"===e.nodeType?e.id:null,n=t?r?.[t]:void 0;if(n?.inExperiment&&i.rules?.length){let e=i.rules.find(e=>e.branch===n.branch);if(e)return e.to}return i.default}return"default"in i?i.default:null}let oT=null,ok=null;function oC(){return oT||(oT=new Promise(e=>{if(window.OneSignalDeferred=window.OneSignalDeferred??[],window.OneSignalDeferred.push(async t=>{await t.init({appId:"a3d63a2d-d710-4f1d-bb31-56f39bed321c",promptOptions:{slidedown:{prompts:[]}}}),ok&&(await t.login(ok),ok=null),e()}),!document.getElementById("onesignal-sdk")){let e=document.createElement("script");e.id="onesignal-sdk",e.src="https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js",e.defer=!0,document.head.appendChild(e)}}))}var oI=e.i(768820);function oP(){var e;return(e={isMobile:oI.isMobile,isTablet:oI.isTablet,isAndroid:oI.isAndroid,isIOS:oI.isIOS,isDesktop:oI.isDesktop,isMacOs:oI.isMacOs,isIPad13:oI.isIPad13}).isIOS&&e.isMobile&&!e.isTablet?"mobile-iphone":e.isAndroid&&e.isMobile&&!e.isTablet?"mobile-android":e.isMacOs||e.isIPad13||e.isIOS&&e.isTablet?"desktop-ios":e.isDesktop?"desktop-other":void 0}let oA=["FBAN","FBAV","FB_IAB","FB4A","FBIOS","MessengerForiOS","Orca-Android","Instagram","Barcelona","musical_ly","BytedanceWebview","trill_","Snapchat","Pinterest/","LinkedInApp","Twitter for","Line/","MicroMessenger"],oO=/;\s*wv\)/i;function ox(e,t){try{return e().getItem(t)||void 0}catch{return}}function oR(e){return function(e){try{return ov.default.get(e)||void 0}catch{return}}(e)??ox(()=>localStorage,e)??ox(()=>sessionStorage,e)}let oL=()=>()=>{},oN=()=>void 0;function oD(e){return`funnel_nav_${e}`}function oU({initialState:e,children:t,slug:n}){let r=e.funnel.id,[i,o]=(0,D.useState)(e),{answers:a,answersRef:s,clearAnswers:u,addAnswer:l,addUserName:c,removeAnswersForScreens:d}=function({initialAnswers:e={},nodesById:t={},funnelId:n}={}){let[r,i]=(0,D.useState)(e),o=(0,D.useRef)(r),a=(0,D.useRef)(t),s=(0,j.useRouter)();(0,D.useEffect)(()=>{o.current=r},[r]),(0,D.useEffect)(()=>{n&&0!==Object.keys(r).length&&V.merge(n,oS(),r)},[n,r]),(0,D.useEffect)(()=>{a.current=t},[t]);let u=(0,D.useCallback)((e,t)=>{let n=a.current[e];if(!n||!q(n))return;let r=n.queryAlias,u=Array.isArray(t)?t:[t];if(i(t=>{let n=t[e],r=[...Array.isArray(n)?n:n?[n]:[],...u];return{...t,[e]:Array.from(new Set(r))}}
1),r&&1)try{let t=o.current[e],n=[...Array.isArray(t)?t:t?[t]:[],...u],i=new URL(window.location.href);i.searchParams.set(r,Array.from(new Set(n)).join(",")),window.history.replaceState({...window.history.state},"",i.toString()),s.replace(i.pathname+i.search+i.hash,{scroll:!1})}catch(e){console.error("Error updating query params:",e)}},[s]),l=(0,D.useCallback)(e=>{i(t=>({...t,userName:e}));{let t=new URL(window.location.href);t.searchParams.set("name",e),window.history.replaceState({...window.history.state},"",t.toString()),s.replace(t.pathname+t.search+t.hash,{scroll:!1})}},[s]),c=(0,D.useCallback)(()=>{i({}),n&&V.clear(n)},[n]),d=(0,D.useCallback)(e=>{i(t=>{let n={...t};return e.forEach(e=>{delete n[e]}),n})},[]);return{answers:r,answersRef:o,setAnswers:i,addAnswer:u,clearAnswers:c,addUserName:l,removeAnswersForScreens:d}}({initialAnswers:{},nodesById:i.nodesById,funnelId:r}),f=(0,D.useSyncExternalStore)(oL,oP,oN),p=(0,D.useMemo)(()=>f&&i.routingContext?.os!==f?{...i,routingContext:{...i.routingContext,os:f}}:i,[i,f]),g=(0,D.useCallback)(e=>{o(t=>{let n=t.nodesById[e];return n&&"screen"===n.nodeType&&n.id!==t.currentScreen.id?{...t,currentScreen:n}:t})},[]),h=function({funnelId:e,initialScreenId:t,slug:n,onNavigate:r}){let[i,o]=(0,D.useState)(()=>{let n=function(e,t){try{let n=sessionStorage.getItem(oD(e));if(!n)return null;let r=JSON.parse(n);if(r.funnelId!==e||!Array.isArray(r.stack)||0===r.stack.length)return null;let i=r.stack.findIndex(e=>e.screenId===t);if(-1===i)return null;return{...r,currentIndex:i}}catch{return null}}(e,t);return n||{stack:[{screenId:t,timestamp:0}],currentIndex:0,funnelId:e}}),a=(0,D.useRef)(null);(0,D.useEffect)(()=>{try{sessionStorage.setItem(oD(e),JSON.stringify(i))}catch{}},[e,i]),(0,D.useEffect)(()=>{let r=window.history.state;r?.screenId||window.history.replaceState({screenId:t,funnelId:e,slug:n},"",window.location.href)},[t,e,n]);let s=(0,D.useCallback)((t,r="push")=>{let i=new URL(window.location.href);i.searchParams.set("screen",t);let o={screenId:t,funnelId:e,slug:n};"push"===r?window.history.pushState(o,"",i.toString()):window.history.replaceState(o,"",i.toString())},[e,n]);(0,D.useEffect)(()=>{if(a.current){let{screenId:e,action:t}=a.current;s(e,t),a.current=null}},[i.currentIndex,s]),(0,D.useEffect)(()=>{let t=t=>{if(t.state?.screenId&&t.state?.funnelId===e){let e=i.stack.findIndex(e=>e.screenId===t.state.screenId);-1!==e&&(o(t=>({...t,currentIndex:e})),r&&r(t.state.screenId))}};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[e,i.stack,r]);let u=(0,D.useCallback)((e,t)=>{o(n=>{let r=n.stack[n.currentIndex];if(r?.screenId===e)return n;let i=n.stack.slice(0,n.currentIndex+1);return i.push({screenId:e,timestamp:Date.now(),fromScreenId:n.stack[n.currentIndex]?.screenId,...t}),a.current={screenId:e,action:"push"},{...n,stack:i,currentIndex:i.length-1}})},[]),l=(0,D.useCallback)(()=>{if(i.currentIndex<=0)return null;let e=i.currentIndex-1,t=i.stack[e];return t?(o(t=>({...t,currentIndex:e})),a.current={screenId:t.screenId,action:"replace"},t.screenId):null},[i.currentIndex,i.stack]),c=(0,D.useCallback)(()=>{if(i.currentIndex>=i.stack.length-1)return null;let e=i.currentIndex+1,t=i.stack[e];return o(t=>({...t,currentIndex:e})),a.current={screenId:t.screenId,action:"replace"},t.screenId},[i.currentIndex,i.stack]),d=(0,D.useCallback)(()=>{o({stack:[{screenId:t,timestamp:Date.now()}],currentIndex:0,funnelId:e});try{sessionStorage.removeItem(oD(e))}catch{}},[e,t]),f=(0,D.useCallback)(()=>i.stack[i.currentIndex]?.screenId||null,[i.stack,i.currentIndex]),p=(0,D.useCallback)(()=>i.stack,[i.stack]),g=i.currentIndex>0,h=i.currentIndex<i.stack.length-1,v=(0,D.useMemo)(()=>i.stack.slice(0,i.currentIndex+1),[i.stack,i.currentIndex]);return{canGoBack:g,canGoForward:h,currentScreenId:f(),visitedStack:v,push:u,pop:l,goForward:c,clear:d,getCurrentScreenId:f,getStack:p}}({funnelId:r,initialScreenId:e.currentScreen.id,slug:n,onNavigate:g}),v=(0,D.useMemo)(()=>h.visitedStack.map(e=>e.screenId),[h.visitedStack]),{isHydrated:m}=function(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{let e=setTimeout(()=>{t(!0)},0);return()=>clearTimeout(e)},[]),{isHydrated:e}}(),{goToNextScreen:y,goBack:b,goToScreen:S,canGoBack:w,canGoForward:_}=function({state:e,setState:t,answersRef:n,addAnswer:r,navigationHistory:i,removeAnswersForScreens:o}){let a=(0,D.useRef)(e);(0,D.useEffect)(()=>{a.current=e},[e]);let s=(0,D.useCallback)(e=>{let o,s,u,l,c,d=a.current,f={...n.current};if(e?.value){let t=(Array.isArray(e.value)?e.value:[e.value]).filter(e=>"string"==typeof e);if(t.length>0){r(d.currentScreen.id,t);let e=f[d.currentScreen.id],n=[...Array.isArray(e)?e:e?[e]:[],...t];f={...f,[d.currentScreen.id]:Array.from(new Set(n))}}}let p=(o=d.routingContext,s={...o?.queryParams},window.location?.search&&new URLSearchParams(window.location.search).forEac
1h((e,t)=>{s[t]=e}),u=o?.os??oP(),l=o?.browser??function(){var e=navigator.userAgent;if(!e)return"standard";let t=e.toLowerCase();return oA.some(e=>t.includes(e.toLowerCase()))||oO.test(e)?"in-app":"standard"}(),{country:o?.country,language:o?.language,queryParams:Object.keys(s).length>0?s:void 0,os:u,browser:l}),g=oE(d.currentScreen,f,p,d.experiments);if(!g)return;let h=function(e,t,n,r={}){return function e(t,n,r,i,o,a){if(o.has(n))return null;o.add(n);let s=t[n];if(!s)return null;if(q(s))return{kind:"screen",screen:s,traversed:a};let u=[...a,s],{redirectContext:l}=i;if("redirect"===s.nodeType&&l){let e=(0,o_.resolveRedirect)({targetUrl:s.url,currentHref:l.currentHref,email:l.email});if("redirect"===e.action)return{kind:"redirect",url:e.url,traversed:u}}let c=oE(s,r,i.context,i.experiments);return c?e(t,c,r,i,o,u):null}(e,t,n,r,new Set,[])}(d.nodesById,g,f,{redirectContext:(c=d.isDraft?d.funnel?.draftRevision:d.funnel?.activeRevision,{currentHref:window.location.href,email:function(e){let t=function(){try{let e=new URLSearchParams(window.location.search).get("email")?.trim();return e?e.replace(/ /g,"+"):void 0}catch{return}}();if(t)return t;if(e){let t=oR(`${e}_email`);if(t)return t}return oR("email")}(c?.externalFunnelId)}),context:p,experiments:d.experiments});if(h){if("redirect"===h.kind)return void window.location.assign(h.url);for(let e of h.traversed)"push-notification"===e.nodeType&&oC().then(async()=>{try{await window.OneSignal?.Slidedown?.promptPush()}catch{}});i.push(h.screen.id,{fromScreenId:d.currentScreen.id}),t(e=>({...e,currentScreen:h.screen}))}},[t,n,r,i]);return{goToNextScreen:s,goBack:(0,D.useCallback)(()=>{let e=i.pop();if(e){let n=i.getStack(),r=n.findIndex(t=>t.screenId===e);if(-1!==r){let t=n.slice(r+1).map(e=>e.screenId);t.push(e),o(t)}t(t=>{let n=t.nodesById[e];return n&&q(n)?{...t,currentScreen:n}:t})}},[i,t,o]),goToScreen:(0,D.useCallback)(e=>{t(t=>{let n=t.nodesById[e];return n&&q(n)?(i.push(e,{fromScreenId:t.currentScreen.id}),{...t,currentScreen:n}):t})},[t,i]),canGoBack:i.canGoBack,canGoForward:i.canGoForward}}({state:p,setState:o,answersRef:s,addAnswer:l,navigationHistory:h,removeAnswersForScreens:d}),E=(0,D.useCallback)(()=>{o({funnel:e.funnel,nodesById:e.nodesById,currentScreen:e.currentScreen,screenNodes:e.screenNodes,isDraft:e.isDraft,initialScreenFromUrl:e.initialScreenFromUrl,routingContext:e.routingContext,experiments:e.experiments,experimentsByName:e.experimentsByName}),u(),h.clear()},[r,e,u,h]);return(0,N.jsx)(U.Provider,{value:{state:p,answers:a,isHydrated:m,visitedScreenIds:v,goToNextScreen:y,goBack:b,goToScreen:S,resetFunnel:E,addAnswer:l,addUserName:c,removeAnswersForScreens:d,canGoBack:w,canGoForward:_},children:t})}var oM=e.i(758684);let oj=/\{\{([^}]+)\}\}/g,oq={EN:"en-US",ES:"es-ES",FR:"fr-FR",DE:"de-DE",IT:"it-IT",PT:"pt-PT",TR:"tr-TR",PL:"pl-PL",JA:"ja-JP",KO:"ko-KR",zhCN:"zh-CN"};function oF(e,t){return new Intl.DateTimeFormat(t,{month:"long"}).format(e)}e.i(701513);var oV=e.i(640488),oB=e.i(548909),oz=e.i(333273),oH=e.i(235899),oW=e.i(826750),oG=e.i(203329);function oK(e){let t=e.transitionTo;if(!t)return[];let n=[];for(let e of(t.default&&n.push(t.default),t.rules??[]))e.to&&n.push(e.to);return n}function oY(e){return q(e)&&"quiz"===e.category&&e.data?.isProgressVisible!==!1}let o$={},oQ="https://cf-cdn.spiriohub.com/audio/SH4_C2_compressed.m4a",oJ="https://cf-cdn.spiriohub.com/uploads/8c09199c-6afe-4d5b-846b-5a9756b2e71c-SH4-C2-compressed.m4a",oX={energy_b:oQ,kund_h:oQ,kund_g:oQ,breathwork_a:oQ,taichi_b:oQ,energy_e:oJ,energy_f:oJ};async function oZ(e,t){await fetch(`${window.ENV?.REACT_APP_API_BASE_URL||""}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}let o0=["email","language","gen_type","funnel","age","country_code","cf_country","fbp","fbc","ttp","ttclid","ip","user_agent","subscribe_emails","is_upsell_purchased","is_lms_user_created","name"];async function o1(e,t){let n=ow({syncUrl:!1}),r=Object.fromEntries(Object.entries({funnel:e,...t??{}}).map(([e,t])=>[e,"language"===e&&"string"==typeof t?t.toLowerCase():t]));if(Object.keys(r).length>0){let e=new eT;for(let t of Object.keys(r))e.set(t,r[t]);op(e).promise.catch(()=>{})}let i=function(e){let t={};for(let[n,r]of Object.entries(e))(o0.includes(n)||n.startsWith("utm_"))&&(t[n]=r);return t}(r);i&&Object.keys(i).length>0&&await oZ("/analytics/identify/properties",{userId:n,properties:i}).catch(()=>{})}async function o2(e){let t,n=ow({syncUrl:!1});op(new eT().set("email",e)).promise.catch(()=>{});ok=e,t=window.OneSignal,t?.login&&(t.login(e),ok=null),await oZ("/analytics/identify/email",{userId:n,email:e}).catch(()=>{})}function o3(){return(window.ENV?.REACT_APP_CLARITY_PROJECT_ID??"").trim()}async function o4(t){let n=o3();if(n)try{let{default:r}=await e.A(686959);"function"!=typeof window.clarity&&r.init(n),r.identify(t)}catch(e){console.error("Clarity identify failed:",e)}}let o5=!1,o8=new Set(["XX","T1"]);async function o7(e,t){let n=new URLSearchParams(window.location.search),r={funnel:e,utm_builder:!0};for(let[e,i]of(t&&!o8.has(t.toUpperCase())&&(r.cf_country=t.toUpperCase()),n.entries()))(e.startsWith("utm_")||"title"===e)&&(r[e]=i);let i=window?.navigator?.userAgent;i&&(r.user_agent=i);let o=document.querySelector('meta[name="server-identifier"]')?.getAttribute("content");o&&"__SERVER_IDENTIFIER__"!==o&&(r.server_identifier=o);let a=n.get("lang")||"";a&&(r.language=a);try{await o1(e,r)}
1catch(e){console.error("[initAmplitude] Failed to identify UTM/user properties:",e)}}async function o6(e,t={}){let n=window.ENV?.REACT_APP_AMPLITUDE_KEY||"",r=ow({syncUrl:!t.dontChangeUrl});return!o5&&n&&(og(n,{defaultTracking:!1,userId:r}),o5=!0),t.awaitUtms?await o7(e,t.country):o7(e,t.country).catch(e=>{console.error("[initAmplitude] identifyUtms failed:",e)}),o4(r),r}async function o9(e,t,n={}){let r=Object.fromEntries(Object.entries({...n,utm_builder:!0}).map(([e,t])=>"language"===e&&"string"==typeof t?[e,t.toLowerCase()]:[e,t]));oh(t,r).promise.catch(()=>{});let i=ow({syncUrl:!1});(t.includes("email_submit")||t.includes("paywall_open")||t.includes("try_to_pay")||t.includes("page_view")&&n.page_name&&["First-Page","Age-Step"].includes(n.page_name))&&oZ("/analytics/track",{userId:i,name:t,properties:r,trackAmplitude:!1}).catch(()=>{})}var ae=((v={}).PAGE_VIEW="funnel_page_view",v.BUTTON_CLICK="funnel_button_click",v.LANGUAGE_CHANGE="funnel_language_change",v.QUIZ_START="funnel_quiz_start",v.QUIZ_FINISH="funnel_quiz_finish",v.EMAIL_SUBMIT="funnel_email_submit",v.PAYWALL_OPEN="funnel_paywall_open",v.PAYWALL_CLOSE="funnel_paywall_close",v.SELLING_PAGE_EMAIL_SUBMIT="funnel_selling_page_email_submit",v.TRY_TO_PAY="funnel_try_to_pay",v.TRANSACTION="funnel_transaction",v.SOLIDGATE_CARD_MOUNT="funnel_solidgate_card_mount",v.SOLIDGATE_PAYPAL_MOUNT="funnel_solidgate_paypal_mount",v.SOLIDGATE_PAYPAL_CLICK="funnel_solidgate_paypal_click",v.SOLIDGATE_PAYPAL_CANCEL="funnel_solidgate_paypal_cancel",v.UPSELL_CHECKOUT_OPEN="funnel_upsell_checkout_open",v.CREATE_PASSWORD="funnel_create_password",v),at=((m={}).LANGUAGE_SELECTOR_OPEN="language_selector_open",m.EMAIL_DOMAIN_SELECT="email_domain_select",m.ANCHOR_SCROLL_TO_PLANS="anchor_scroll_to_plans",m.GET_PLAN="get_plan",m.COPY_EMAIL="copy_email",m.COPY_PASSWORD="copy_password",m.GET_LMS_YES="get_lms_yes",m.GET_APP_YES="get_app_yes",m.BACK_TO_LMS_FROM_SUCCESS="back_to_lms_from_success",m.BACK_TO_LMS_FROM_CREATE_PASSWORD="back_to_lms_from_create_password",m.SOUND_UPSELL_YES="sound_upsell_yes",m.SOUND_UPSELL_NO="sound_upsell_no",m.BUNDLE_UPSELL_YES="bundle_upsell_yes",m.BUNDLE_UPSELL_NO="bundle_upsell_no",m.MEANINGFUL_QUESTIONS_UPSELL_YES="meaningful_questions_upsell_yes",m.MEANINGFUL_QUESTIONS_UPSELL_NO="meaningful_questions_upsell_no",m.BACK_TO_LMS_FROM_SOUND_UPSELL="back_to_lms_from_sound_upsell",m.BACK_TO_LMS_FROM_BUNDLE_UPSELL="back_to_lms_from_bundle_upsell",m.BACK_TO_LMS_FROM_MEANINGFUL_QUESTIONS_UPSELL="back_to_lms_from_meaningful_questions_upsell",m);async function an(e,t,n,r,i){let o=new URLSearchParams(window.location.search),a=oS(),s=(0,om.v4)(),u=ov.default.get("_fbc"),l=o.get("fbclid"),c={dataSource:t,fbp:ov.default.get("_fbp"),eventName:n,eventId:s,data:r,email:i?.email,funnel:e};a&&(c.userId=a),(u||l)&&(c.fbc=u||`fb.1.${Date.now()}.${l}`),oZ("/facebook/event",c)}async function ar(e,t,n,r,i){let o=window.ttq,a=(0,om.v4)().replace(/-/g,""),s=oS();o&&(o.identify({email:i?.email,external_id:s}),o.track(n,r||{},{event_id:a}));let u=new URLSearchParams(window.location.search).get("ttclid")||void 0,l={pixel:t,ttp:ov.default.get("_ttp")||void 0,ttclid:u,eventName:n,eventId:a,data:r,email:i?.email};s&&(l.userId=s),l.page_url=window.location.href,await oZ("/tiktok/event",l)}let ai=["Purchase","InitiateCheckout"];async function ao(e,t){var n;let r,i,o,a,s,u,l,c,d,f,p;if(!ai.includes(e))return;let g=new URLSearchParams(window.location.search).get("gclid");if(!g)return;let h=oS();if(!h)return;let v=Number(t?.value),m=String(t?.currency||"USD");if(!v||v<=0)return;let y="Purchase"===e?t?.order_id:void 0,b=null==y||""===y?void 0:String(y);await oZ("/google-ads/conversion",{gclid:g,userId:h,amount:v,currency:m,conversionDateTime:(n=new Date,r=e=>String(e).padStart(2,"0"),i=n.getFullYear(),o=r(n.getMonth()+1),a=r(n.getDate()),s=r(n.getHours()),u=r(n.getMinutes()),l=r(n.getSeconds()),f=r(Math.floor((d=Math.abs(c=-n.getTimezoneOffset()))/60)),p=r(d%60),`${i}-${o}-${a} ${s}:${u}:${l}${c>=0?"+":"-"}${f}:${p}`),eventName:e,...b?{orderId:b}:{}})}let aa="spirio_utm_source";async function as(e,t,n,r,i,o){let a=window,s=new URLSearchParams(window.location.search).get("utm_source")||"unknown",u="unknown"===s?"unknown":s.includes("tt")?"tt":s.includes("fb")?"fb":"google"===s?"google":"other";a.dataLayer||(a.dataLayer=[]),a.dataLayer.push({event:t,funnel:e,...i||{},...o||{},media_source:function(){try{let e=new URLSearchParams(window.location.search).get("utm_source"),t=e?.trim().toLowerCase();if(t){try{sessionStorage.setItem(aa,t)}catch{}return t}try{return sessionStorage.getItem(aa)}catch{return null}}catch{return null}}()});let l=async()=>{await Promise.all(r.map(n=>an(e,n,t,i,o)))},c=async()=>{n&&"PageView"!==t&&await ar(e,n,t,i,o)};
1switch(u){case"fb":await l();break;case"tt":await c();break;case"google":await ao(t,i);break;case"unknown":await Promise.all([l(),c(),ao(t,i)])}}let au=!1;function al(e){return e.charAt(Math.floor(Math.random()*e.length))}var ac=e.i(251312);let ad=async({id:e,email:t,funnel:n,age:r,gen_type:i,unsubscribed:o,language:a,name:s,generatePlanId:u,order_id:l,utm_source:c,payment_method:d,manifJournal:f,phone_number:p,attributes:g})=>{let h,v,m=new URLSearchParams(window.location.search),y=m.get("fbclid")||function(){let e=ov.default.get("_fbc");if(e){let t=e.split(".");if(4===t.length)return t[3]}}(),b=m.get("gclid")??void 0,S=m.get("utm_contentdyn")??void 0,w=Intl.DateTimeFormat().resolvedOptions().timeZone,_=(0,ac.default)().format("Z"),E=oI.isTablet?"tablet":oI.isIOS&&oI.isMobile?"iphone":oI.isAndroid&&oI.isMobile?"android":oI.isDesktop?"desktop":"unknown",T={email:t,funnel:n,age:r,gen_type:i,...u?{plan_id:(v="0123456789",[al(h="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),al(v),al(h),al(v),al(v),al(v)].join(""))}:{},fbclid:y,gclid:b,language:a?.toLowerCase(),name:s,order_id:l,utm_source:c,utm_contentdyn:S,payment_method:d,timezone:w,timezone_offset:_,device:E,manif_journal:f,phone_number:p},k={...g};return delete k.email,oZ("/mails/identify",{userId:e,unsubscribed:o,attributes:{...k,...Object.fromEntries(Object.entries(T).filter(([,e])=>null!=e&&""!==e))}})},af=async({userId:e,name:t,data:n})=>{oZ("/mails/track",{userId:e,name:t,data:n||{}})};function ap(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function ag(){oC().then(async()=>{try{await window.OneSignal?.Notifications?.requestPermission()}catch{}})}var ah=e.i(887675);let av={[oB.t.templateId]:oV.n,[oH.t.templateId]:oz.n,[oG.t.templateId]:oW.n};function am(e){return e.templateId?e.templateId:e.type?e.type:null}function ay(){let{state:{currentScreen:t,experiments:n,experimentsByName:r,funnel:i,isDraft:o,nodesById:a,routingContext:s,exchangeRates:u},answers:l,isHydrated:c,goToNextScreen:d,goBack:f,addUserName:p,canGoBack:g,visitedScreenIds:h}=M(),v=(0,D.useMemo)(()=>{let e={};for(let[t,n]of Object.entries(l)){let r=a[t];r&&q(r)&&r.name&&(e[r.name]=n)}return e},[l,a]),{currentScreenNumber:m,totalScreens:y}=function({nodesById:e,currentScreenId:t,visitedScreenIds:n,routingContext:r,experiments:i}){return(0,D.useMemo)(()=>{let o=e[t];if(!o||!oY(o))return{currentScreenNumber:null,totalScreens:0};let a=new Set;for(let t of n){if(a.has(t))continue;let n=e[t];n&&oY(n)&&a.add(t)}a.add(t);let s=a.size;return{currentScreenNumber:s,totalScreens:s+function(e,t,n={}){if(!e[t])return 0;let r=new Map,i=new Map,o=[],a=t=>{r.set(t,1),i.set(t,[]);let o=(function(e,t){let n=e.transitionTo;if(!n)return[];if("conditional"===n.type||"query"===n.type||"os"===n.type&&!t.context?.os)return oK(e);let r=oE(e,o$,t.context,t.experiments);return r?[r]:[]})(e[t],n).filter(t=>t&&e[t]);return{id:t,targets:[...new Set(o)],next:0}},s=[a(t)];for(;s.length>0;){let e=s[s.length-1];if(e.next<e.targets.length){let t=e.targets[e.next++],n=r.get(t);if(1===n||(i.get(e.id)?.push(t),2===n))continue;s.push(a(t));continue}r.set(e.id,2),o.push(e.id),s.pop()}let u=new Map;for(let t of o){let n=0;for(let e of i.get(t)??[]){let t=u.get(e)??0;t>n&&(n=t)}u.set(t,+!!oY(e[t])+n)}let l=0;for(let e of i.get(t)??[]){let t=u.get(e)??0;t>l&&(l=t)}return l}(e,t,{context:r,experiments:i})}},[e,t,n,r,i])}({nodesById:a,currentScreenId:t.id,visitedScreenIds:h,routingContext:s,experiments:n}),b=o?i.draftRevision:i.activeRevision;!function({audioUrl:e,funnelName:t}){let n=(0,D.useRef)(null),r=e||t&&oX[t]||null;(0,D.useEffect)(()=>{if(!r)return;let e=new Audio(r);e.loop=!0,e.volume=1,n.current=e;let t=null;return e.play().catch(()=>{t=()=>{e.play().catch(()=>void 0),t=null},document.addEventListener("click",t,{once:!0}),document.addEventListener("touchstart",t,{once:!0})}),()=>{t&&(document.removeEventListener("click",t),document.removeEventListener("touchstart",t),t=null),e.pause(),e.src="",n.current=null}},[r])}({audioUrl:b.backgroundAudioUrl,funnelName:b.externalFunnelId??""});
1let S=(0,j.useSearchParams)(),w=(0,D.useMemo)(()=>{let e={};return S.forEach((t,n)=>{e[n]=t}),e},[S]),{trackScreenAnswer:_,analyticsApi:E}=function(t,n,r,i,o,a){let{funnelId:s,answers:u,nodesById:l,queryParams:c}=a;(0,D.useEffect)(()=>{let n;o6(t,{country:o}),function(){let e;if(au)return;let t=window.ENV?.REACT_APP_CUSTOMERIO_SITE_ID||"";if(!t)return;if(document.getElementById("cio-tracker")||window._cio&&Array.isArray(window._cio)){au=!0;return}let n=[];window._cio=n;let r=function(e){return function(...t){n.push([e].concat(t))}},i=["load","identify","sidentify","track","page","on","off"];for(e=0;e<i.length;e++)n[i[e]]=r(i[e]);let o=document.createElement("script"),a=document.getElementsByTagName("script")[0];o.async=!0,o.id="cio-tracker",o.setAttribute("data-site-id",t),o.src="https://assets.customer.io/assets/track.js",a?.parentNode?.insertBefore(o,a),au=!0}(),(n=o3())&&e.A(686959).then(({default:e})=>{e.init(n)}).catch(e=>{console.error("Clarity initialization failed:",e)})},[t,o]);let d=(0,D.useRef)(null),f=(0,D.useRef)(!1);(0,D.useEffect)(()=>{!r||d.current!==n.id&&(d.current=n.id,o9(t,ae.PAGE_VIEW,{page_name:n.name}),f.current||"quiz"!==n.category||(f.current=!0,o9(t,ae.QUIZ_START,{page_name:n.name})))},[t,n,r]);let p=(0,D.useCallback)((e,n)=>{let r=n?.value;if(!r||!e.amplitudePropertyName)return;let i=n?.isMultiple?r:String(r),o={[e.amplitudePropertyName]:i};n?.otherSelected&&n?.other&&(o[`${e.amplitudePropertyName}_other`]=n?.other||""),o1(t,o)},[t]);return(0,D.useEffect)(()=>{as(i.externalFunnelId,"PageView",i.tikTokDataSource,i.metaDataSources)},[]),{trackScreenAnswer:p,analyticsApi:{track:(0,D.useCallback)((e,n)=>o9(t,e,n),[t]),identify:(0,D.useCallback)(e=>o1(t,e),[t]),identifyEmail:(0,D.useCallback)(e=>o2(e),[]),adTrack:(0,D.useCallback)((e,t,n)=>as(i.externalFunnelId,e,i.tikTokDataSource,i.metaDataSources,t,n),[]),cioIdentify:(0,D.useCallback)(async e=>{let t={...V.read(s,e.id),...u};await ad({...e,attributes:function({answers:e,nodesById:t,queryParams:n={}}){let r={};for(let i of Object.values(t)){if(!q(i))continue;let t=i.amplitudePropertyName||i.queryAlias;if(!t)continue;let o=e[i.id]??(i.queryAlias?n[i.queryAlias]:void 0);if(void 0===o)continue;let a=ap(t),s=(Array.isArray(o)?o:o.split(",")).map(ap).filter(Boolean).join(",");a&&s&&(r[a]=s)}return r}({answers:t,nodesById:l,queryParams:c})})},[s,u,l,c]),cioTrack:(0,D.useCallback)((e,t,n)=>af({userId:e,name:t,data:n}),[])}}}(i.activeRevision.externalFunnelId,t,c,{externalFunnelId:b.externalFunnelId,tikTokDataSource:b.tikTokDataSource,metaDataSources:b.metaDataSources?.length?b.metaDataSources:b.metaDataSource?[b.metaDataSource]:[]},s?.country,{funnelId:i.id,answers:l,nodesById:a,queryParams:w}),[T,k]=(0,D.useState)(()=>({...av})),C=(0,D.useMemo)(()=>{let e=new Set;for(let t of Object.values(a))if(q(t)){let n=am(t);n&&e.add(n)}let n=am(t);return n&&e.add(n),[...e]},[a,t]);(0,D.useEffect)(()=>{let e=!1,t=()=>{(0,ah.loadTemplatesByKeys)(C).then(e=>({...e,...av})).then(t=>{e||k({...t})})};if("requestIdleCallback"in window){let n=window.requestIdleCallback(t,{timeout:1e3});return()=>{e=!0,window.cancelIdleCallback(n)}}let n=setTimeout(t,500);return()=>{e=!0,clearTimeout(n)}},[C]);let I=(0,D.useId)(),[P,A]=(0,D.useState)(!0);(0,D.useEffect)(()=>{let e=requestAnimationFrame(()=>A(!1));return()=>cancelAnimationFrame(e)},[]);let[O,x]=(0,D.useState)(!1),R=(0,D.useRef)(null),L=(0,D.useMemo)(()=>{var e;let t,n,r,i;return{...(e=w.lang,n=((t=(0,oM.normalizeLanguage)(e))&&oq[t])??"en-US",(i=new Date(r=new Date)).setDate(i.getDate()+32),{currentMonth:oF(r,n),endCourseDate:new Intl.DateTimeFormat(n,{day:"numeric",month:"long"}).format(i),endCourseMonth:oF(i,n)}),...w}},[w]),U=(0,D.useMemo)(()=>(function e(t,n){if(null==t)return t;if("string"==typeof t)return n&&Object.keys(n).length>0?t.replace(oj,(e,t)=>n[t.trim()]??`{{${t}}}`):t;if(Array.isArray(t))return t.map(t=>e(t,n));if("object"==typeof t){let r={};for(let[i,o]of Object.entries(t))r[i]=e(o,n);return r}return t})(t.data??{},L),[t.data,L]),F=function(e){let t="string"==typeof e?Number(e):e;if("number"!=typeof t||!Number.isFinite(t))return;let n=Math.floor(t);return n>0?n:void 0}(U.progressTotalValue),B=null!=m?Math.max(F??y,m):void 0;(0,D.useEffect)(()=>
1{if(!O)return;let e=setTimeout(()=>{let e=R.current;e&&(R.current=null,x(!1),e())},450);return()=>clearTimeout(e)},[O]);let z=am(t),H=z?T[z]??null:null;if(!H)return null;let W=I.replace(/:/g,"\\:");return(0,N.jsxs)(N.Fragment,{children:[P&&(0,N.jsx)("style",{children:`#${W} * { animation-duration: 0s !important; transition-duration: 0s !important; }`}),(0,N.jsx)("div",{id:I,style:{display:"contents"},children:(0,N.jsx)(H,{funnelName:b.externalFunnelId,analyticsApi:E,addUserName:p,onNext:(...e)=>{_(t,e[0]),x(!0),R.current=()=>{d(...e),R.current=null}},onBackButtonClick:f,onRequestPushPermission:ag,canGoBack:g,contentKey:t.id,isExiting:O,onExited:()=>{let e=R.current;R.current=null,x(!1),e?.()},experimentsByName:r,answersByName:v,queryParams:w,country:s?.country,os:s?.os,...U,currentLanguage:(w.lang??"EN").toUpperCase(),exchangeRates:u,availableLanguages:i.languages,onLanguageChange:e=>{let n=new URL(window.location.href);E.track(ae.LANGUAGE_CHANGE,{language:e,previous_language:(n.searchParams.get("lang")??"EN").toLowerCase(),page_name:t.name}),n.searchParams.set("lang",e),n.searchParams.set("screen",t.id),window.location.assign(n.toString())},onLanguageSelectorOpen:()=>{E.track(ae.BUTTON_CLICK,{type:at.LANGUAGE_SELECTOR_OPEN,page_name:t.name})},progressTotalValue:B,progressValue:m??void 0})})]})}av.QuizGenderSelect||(av.QuizGenderSelect=oV.n),av.QuizGenderSelectExtended||(av.QuizGenderSelectExtended=oz.n),av.QuizGenderSelectExtendedV2||(av.QuizGenderSelectExtendedV2=oW.n);let ab=()=>{document.documentElement.style.setProperty("--app-height",`${window.innerHeight}px`)};var aS=e.i(593414);function aw({container:e}){let t={container1:window.ENV?.REACT_APP_GOOGLE1_CONTAINER_ID??"GTM-M2SCVL7B"}[e]??"";return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(aS.default,{id:"google-tag-manager-script",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 2new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 3j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
4'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 5})(window,document,'script','dataLayer','${t}');`}}),(0,N.jsx)("noscript",{children:(0,N.jsx)("iframe",{src:`https://www.googletagmanager.com/ns.html?id=${t}`,height:"0",width:"0",style:{display:"none",visibility:"hidden"}})})]})}function a_({pixel:e}){if(!e)return(0,N.jsx)(N.Fragment,{});let t=window.ENV,n={pixel1:(t?.REACT_APP_TIKTOK_PIXEL1_ID??"D26DSKJC77U5781IN6KG")||"",pixel2:(t?.REACT_APP_TIKTOK_PIXEL2_ID??"D5N1J0RC77UFLMP0AD9G")||""}[e];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(aS.default,{id:"tiktok-pixel-script",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`!function (w, d, t) { 6 w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie","holdConsent","revokeConsent","grantConsent"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for( 7var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var r="https://analytics.tiktok.com/i18n/pixel/events.js",o=n&&n.partner;ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=r,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};n=document.createElement("script") 8;n.type="text/javascript",n.async=!0,n.src=r+"?sdkid="+e+"&lib="+t;e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e)}; 9 ttq.load('${n}'); 10 ttq.page(); 11}(window, document, 'ttq');`}}),(0,N.jsx)("noscript",{children:(0,N.jsx)("img",{height:"1",width:"1",style:{display:"none"},src:`https://analytics.tiktok.com/i18n/pixel/events.gif?sdkid=${n}&pixel_event=PageView`,alt:""})})]})}function aE(){return(0,N.jsx)(aS.default,{id:"hotjar",strategy:"afterInteractive",src:"https://t.contentsquare.net/uxa/af1f69a7b3362.js"})}let aT=new Set(["sellingPage","upsellSellingPage","paywall","page-builder"]);function ak(){var e,t,n;let{state:{currentScreen:r,nodesById:i,isDraft:o}}=M(),a=(0,D.useMemo)(()=>(function(e){let t=[],n=!1;for(let r of Object.values(e))"hotjar"===r.nodeType&&(n=!0,t.push(...oK(r)));if(!n)return null;let r=new Set,i=new Set;for(;t.length>0;){let n=t.shift();if(i.has(n))continue;i.add(n);let o=e[n];o&&(q(o)&&r.add(o.id),t.push(...oK(o)))}return r})(i),[i]),s=!o&&(e=r,(t=a)?t.has(e.id):null!=(n=e.category)&&aT.has(n)),[u,l]=(0,D.useState)(s);return s&&!u&&l(!0),u?(0,N.jsx)(aE,{}):null}
11e.s(["FunnelContainer",0,function({initialState:e,slug:t}){(0,D.useEffect)(()=>(window.addEventListener("resize",ab),window.addEventListener("load",ab),ab(),()=>{window.removeEventListener("resize",ab),window.removeEventListener("load",ab)}),[]);let n=e.isDraft?e.funnel.draftRevision:e.funnel.activeRevision,r=n.googleContainerId??"",i="pixel1"===n.tikTokDataSource||"pixel2"===n.tikTokDataSource?n.tikTokDataSource:null;return(0,N.jsxs)(N.Fragment,{children:[r?(0,N.jsx)(aw,{container:r}):null,i?(0,N.jsx)(a_,{pixel:i}):null,(0,N.jsxs)(oU,{initialState:e,slug:t,children:[(0,N.jsx)(ak,{}),(0,N.jsx)(ay,{})]})]})}],352262)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.