From 38d6c901ff59374331bc3036383631e7970f344a Mon Sep 17 00:00:00 2001 From: zyqunix Date: Tue, 18 Mar 2025 16:53:49 +0100 Subject: [PATCH] add local plinko files --- plinko/Plinko_files/bundle.js | 1 + plinko/Plinko_files/css.css | 162 + plinko/Plinko_files/loader.js | 41 + plinko/Plinko_files/replays.js | 82 + plinko/Plinko_files/sentry.js | 36512 +++++++++++++++++++++++++++++++ plinko/Plinko_files/wrapper.js | 74 + plinko/index.html | 78 +- plinko/style.css | 17 - 8 files changed, 36932 insertions(+), 35 deletions(-) create mode 100644 plinko/Plinko_files/bundle.js create mode 100644 plinko/Plinko_files/css.css create mode 100644 plinko/Plinko_files/loader.js create mode 100644 plinko/Plinko_files/replays.js create mode 100644 plinko/Plinko_files/sentry.js create mode 100644 plinko/Plinko_files/wrapper.js delete mode 100644 plinko/style.css diff --git a/plinko/Plinko_files/bundle.js b/plinko/Plinko_files/bundle.js new file mode 100644 index 0000000..8946035 --- /dev/null +++ b/plinko/Plinko_files/bundle.js @@ -0,0 +1 @@ +(()=>{var t,e,i,r={2679:(t,e,i)=>{var r={"./bg":[4444,444],"./bg.js":[4444,444],"./de":[1572,572],"./de.js":[1572,572],"./el":[4870,870],"./el.js":[4870,870],"./en":[6412,412],"./en.js":[6412,412],"./es":[8335,335],"./es.js":[8335,335],"./fi":[1198,198],"./fi.js":[1198,198],"./fr":[4115,115],"./fr.js":[4115,115],"./id":[9218,218],"./id.js":[9218,218],"./it":[1970,970],"./it.js":[1970,970],"./ja":[1570,570],"./ja.js":[1570,570],"./kde":[189,189],"./kde.js":[189,189],"./ko":[5121,121],"./ko.js":[5121,121],"./nl":[89,89],"./nl.js":[89,89],"./nn":[4215,215],"./nn.js":[4215,215],"./pl":[1407,407],"./pl.js":[1407,407],"./pt":[6983,983],"./pt.js":[6983,983],"./ro":[6900,900],"./ro.js":[6900,900],"./ru":[6214,214],"./ru.js":[6214,214],"./ses":[5306,306],"./ses.js":[5306,306],"./sv":[1650,650],"./sv.js":[1650,650],"./th":[5079,79],"./th.js":[5079,79],"./tr":[3201,201],"./tr.js":[3201,201],"./vi":[638,638],"./vi.js":[638,638],"./zh":[8185,185],"./zh.js":[8185,185]};function n(t){if(!i.o(r,t))return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=r[t],n=e[0];return i.e(e[1]).then((()=>i.t(n,23)))}n.keys=()=>Object.keys(r),n.id=2679,t.exports=n},230:t=>{t.exports={scenes:{main:{c:"MainMenu",p:{backgroundColor:1713247},":":[{c:"Resizer",p:{name:"middle",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"OrientationTrigger",p:{name:"bg",portraitX:-183,portraitScaleX:.53},":":[{c:"BG",p:{name:"bg",x:-1,y:1,"scale.x":4.76,"scale.y":5.47,image:"bg/bg.jpg"}}]},{c:"Trigger",p:{dataPath:"game.currentScene.isLeftPanelTurnedOn",invert:!0,pow:.05,damp:.7,alphaShift:0,xShift:76,isApplyInteractivity:!1},":":[{c:"Sprite",p:{x:-348,y:-308,rotation:-.756,alpha:.09,image:"bg/bg-flowers.png"}}]},{c:"Resizer",p:{name:"left-panel-btn",relativeX:!0,xPos:-.5},":":[{c:"Trigger",p:{x:9,dataPath:"game.currentScene.isLeftPanelVisible",invert:!0,pow:.04,damp:.7,xShift:-30},":":[{c:"Button",p:{name:"open-table-btn",x:21,y:3,image:"ui/arrow-tabl-left.png",hoverImage:"ui/arrow-tabl-left.png",pressImage:"ui/arrow-tabl-left.png",disabledImage:"ui/arrow-tabl-left.png",onClick:"game.currentScene.toggleTableView",sndClick:"click",sndOver:"over"}}]}]},{c:"Resizer",p:{name:"right-panel-btn",y:-1,relativeX:!0,xPos:.5},":":[{c:"Trigger",p:{x:-9,"scale.x":-1,"scale.y":-1,dataPath:"game.currentScene.isRightPanelVisible",invert:!0,pow:.04,damp:.7,xShift:30},":":[{c:"Button",p:{name:"open-table-btn",x:21,y:3,image:"ui/arrow-tabl-left.png",hoverImage:"ui/arrow-tabl-left.png",pressImage:"ui/arrow-tabl-left.png",disabledImage:"ui/arrow-tabl-left.png",onClick:"game.currentScene.toggleTableView",sndClick:"click",sndOver:"over"}}]}]},{c:"Trigger",p:{name:"left-panel-switcher",x:1,y:1,dataPath:"game.currentScene.isLeftPanelVisible",pow:.05,damp:.7,alphaShift:-.97,xShift:-900},":":[{c:"OrientationTrigger",p:{name:"left-part",portraitX:525,portraitY:17},":":[{c:"Text",p:{x:-774,y:-345,translatableText:"plinko.time","style.fontSize":22,verticalAlign:"center","style.fontWeight":"bold",maxWidth:108}},{c:"Text",p:{x:-638,y:-345,translatableText:"plinko.bet_history","style.fontSize":22,verticalAlign:"center","style.fontWeight":"bold",maxWidth:108}},{c:"Text",p:{x:-496,y:-345,translatableText:"plinko.payout","style.fontSize":22,verticalAlign:"center","style.fontWeight":"bold",maxWidth:108}},{c:"Text",p:{x:-335,y:-345,translatableText:"plinko.profit","style.fontSize":22,verticalAlign:"center","style.fontWeight":"bold",maxWidth:108}},{c:"Sprite",p:{x:-821,y:-323,"scale.x":5.4,image:"ui/line.png"}},{c:"ResultList",p:{name:"resultList",x:-892,y:-293}},{c:"OrientationTrigger",p:{landscapeY:16,landscapeAlpha:0,portraitX:-539,portraitY:-484},":":[{c:"Sprite",p:{y:57,"scale.x":.5,"scale.y":.5,"pivot.x":204,"pivot.y":118,image:"ui/logo.png"},":":[{c:"Trigger",p:{dataPath:"game.casinoOptions.ui.logo_visible",isApplyInteractivity:!1},":":[{c:"Sprite",p:{x:104,y:182,alpha:.4,"scale.x":.5,"scale.y":.5,image:"ui/brand-logo.png"}}]}]}]}]}]},{c:"Trigger",p:{name:"right-panel-switcher",dataPath:"game.currentScene.isRightPanelVisible",pow:.05,damp:.7,alphaShift:-.97,xShift:900},":":[{c:"Trigger",p:{name:"ios-safari-fix",dataPath:"game.isLandscapeSafariIos",invert:!0,pow:1,alphaShift:0,yShift:-70,isApplyInteractivity:!1},":":[{c:"OrientationTrigger",p:{name:"right-part",portraitX:-505},":":[{c:"Trigger",p:{x:682,y:350,dataPath:"game.data.autoPanelActiveted",pow:.06,damp:.7,alphaShift:0,yShift:45,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{name:"autoplayPanel",x:-65,y:-64,image:"ui/panel-ui.png",width:130,height:146,leftWidth:14,rightWidth:14,topHeight:14,bottomHeight:14},":":[{c:"Text",p:{x:68,y:-1,translatableText:"plinko.bet_mode","style.fontSize":16,verticalAlign:"bottom","style.fill":"#b79dee",maxWidth:128}},{c:"Sprite",p:{x:11,y:41,image:"ui/line.png",tint:9926111}},{c:"Button",p:{name:"manualGameBtn",x:32,y:24,interactive:!1,image:"ui/small-btn.png",hoverImage:"ui/small-btn.png",pressImage:"ui/small-btn.png",disabledImage:"ui/small-btn-d.png",onClick:"game.currentScene.deactivateAutoPanel",sndClick:"click",sndOver:"over"},":":[{c:"DSprite",p:{image:"ui/manual-icon.png"}},{c:"MovieClip",p:{timeline:{l:{"btn-out":3,"btn-over":42},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:13,m:1,a:"this.stop"},{v:1,t:47,m:1}]}]}},":":[{c:"Text",p:{x:14,translatableText:"plinko.manual","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.strokeThickness":1,"style.stroke":"#fff","style.padding":1,maxWidth:74}}]},{c:"Shape",p:{x:-23,y:-20,visible:!1,width:113,height:39,isItHitArea:!0}},{c:"Text",p:{x:15,translatableText:"plinko.manual","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.padding":1,maxWidth:74}}]},{c:"Button",p:{name:"autoGameBtn",x:32,y:65,image:"ui/small-btn.png",hoverImage:"ui/small-btn.png",pressImage:"ui/small-btn.png",disabledImage:"ui/small-btn-d.png",onClick:"game.currentScene.activateAutoPanel",sndClick:"click",sndOver:"over"},":":[{c:"DSprite",p:{image:"ui/auto-icon.png"}},{c:"MovieClip",p:{timeline:{l:{"btn-out":3,"btn-over":42},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:13,m:1,a:"this.stop"},{v:1,t:47,m:1}]}]}},":":[{c:"Text",p:{x:14,translatableText:"plinko.auto","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.strokeThickness":1,"style.stroke":"#fff","style.padding":1,maxWidth:73}}]},{c:"Shape",p:{x:-23,y:-20,visible:!1,width:113,height:39,isItHitArea:!0}},{c:"Text",p:{x:15,translatableText:"plinko.auto","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.padding":1,maxWidth:73}}]},{c:"Trigger",p:{name:"auto-game-counter",dataPath:"game.data.autoPanelActiveted",pow:.06,damp:.7},":":[{c:"Sprite",p:{x:47,y:98,image:"ui/counter-bg.png"},":":[{c:"NumberInput",p:{name:"autoplayNumberInput",x:19,y:12,textView:"counter-text",dataPath:"game.data.autoplayCount",valuesList:"10,20,30,50,70,100,150,200,250,300,400,500,600,700,800,900,1000"},":":[{c:"Shape",p:{x:-23,y:-25,alpha:.71,visible:!1,width:45,height:44,isItHitArea:!0}}]},{c:"Sprite",p:{name:"number-mask",x:1,y:-23,"scale.x":2.2,"scale.y":1.52,image:"WHITE",tint:6440096}},{c:"Sprite",p:{name:"number-mask",x:1,y:22,"scale.x":2.2,"scale.y":1.5,image:"WHITE",tint:6440096}},{c:"Trigger",p:{dataPath:"this.parent.#autoplayNumberInput.canIncrease",alphaShift:-.65},":":[{c:"Button",p:{x:59,y:12,image:"ui/counter-btn.png",hoverImage:"ui/counter-btn-h.png",onClick:"this.parent.parent.#autoplayNumberInput.increase",sndClick:"click",sndOver:"over",repeatDelay:20,repeatInterval:6},":":[{c:"Text",p:{y:-1,text:"+","style.fontSize":18,verticalAlign:"center","style.fontWeight":"bold"}}]}]},{c:"Trigger",p:{dataPath:"this.parent.#autoplayNumberInput.canDecrease",alphaShift:-.65},":":[{c:"Button",p:{x:-21,y:12,image:"ui/counter-btn.png",hoverImage:"ui/counter-btn-h.png",onClick:"this.parent.parent.#autoplayNumberInput.decrease",sndClick:"click",sndOver:"over",repeatDelay:20,repeatInterval:6},":":[{c:"Text",p:{y:-1,text:"—","style.fontSize":18,verticalAlign:"center","style.fontWeight":"bold"}}]}]}]},{c:"Text",p:{x:66,y:96,translatableText:"plinko.autoplay_count",verticalAlign:"bottom",maxWidth:115}}]}]}]},{c:"Container",p:{name:"gameUI"},":":[{c:"NineSlicePlane",p:{x:252,y:286,image:"ui/panel-ui.png",width:130,height:146,leftWidth:14,rightWidth:14,topHeight:14,bottomHeight:14},":":[{c:"Text",p:{x:65,y:-1,translatableText:"plinko.risk_level","style.fontSize":16,verticalAlign:"bottom","style.fill":"#b79dee",maxWidth:128}},{c:"Sprite",p:{x:11,y:41,image:"ui/line.png",tint:9926111}},{c:"Sprite",p:{x:11,y:85,image:"ui/line.png",tint:9926111}},{c:"Button",p:{name:"high-risk-btn",x:32,y:24,image:"ui/small-btn.png",hoverImage:"ui/small-btn.png",disabledImage:"ui/small-btn-d.png",onClick:"all.gameTable.setRiskMode`high",sndClick:"click",sndOver:"over"},":":[{c:"DSprite",p:{image:"ui/lvl-high-icon.png"}},{c:"MovieClip",p:{timeline:{l:{"btn-out":3,"btn-over":42},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:13,m:1,a:"this.stop"},{v:1,t:47,m:1}]}]}},":":[{c:"Text",p:{x:14,translatableText:"plinko.high","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.strokeThickness":1,"style.stroke":"#fff","style.padding":1,maxWidth:73}}]},{c:"Shape",p:{x:-23,y:-20,visible:!1,width:113,height:39,isItHitArea:!0}},{c:"Text",p:{x:15,translatableText:"plinko.high","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.padding":1,maxWidth:73}}]},{c:"Button",p:{name:"medium-risk-btn",x:32,y:65,image:"ui/small-btn.png",hoverImage:"ui/small-btn.png",disabledImage:"ui/small-btn-d.png",onClick:"all.gameTable.setRiskMode`medium",sndClick:"click",sndOver:"over"},":":[{c:"DSprite",p:{image:"ui/lvl-mid-icon.png"}},{c:"MovieClip",p:{timeline:{l:{"btn-out":3,"btn-over":42},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:13,m:1,a:"this.stop"},{v:1,t:47,m:1}]}]}},":":[{c:"Text",p:{x:14,translatableText:"plinko.normal","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.strokeThickness":1,"style.stroke":"#fff","style.padding":1,maxWidth:73}}]},{c:"Shape",p:{x:-23,y:-20,visible:!1,width:113,height:39,isItHitArea:!0}},{c:"Text",p:{x:15,translatableText:"plinko.normal","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.padding":1,maxWidth:73}}]},{c:"Button",p:{name:"low-risk-btn",x:32,y:107,image:"ui/small-btn.png",hoverImage:"ui/small-btn.png",disabledImage:"ui/small-btn-d.png",onClick:"all.gameTable.setRiskMode`low",sndClick:"click",sndOver:"over"},":":[{c:"DSprite",p:{image:"ui/lvl-low-icon.png"}},{c:"MovieClip",p:{timeline:{l:{"btn-out":3,"btn-over":42},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:13,m:1,a:"this.stop"},{v:1,t:47,m:1}]}]}},":":[{c:"Text",p:{x:14,translatableText:"plinko.low","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.strokeThickness":1,"style.stroke":"#fff","style.padding":1,maxWidth:73}}]},{c:"Shape",p:{x:-23,y:-20,visible:!1,width:113,height:39,isItHitArea:!0}},{c:"Text",p:{x:15,translatableText:"plinko.low","style.fontSize":15,"style.align":"left",verticalAlign:"center","style.padding":1,maxWidth:73}}]}]},{c:"Sprite",p:{name:"bet-panel",x:250,y:408,image:"bg/bg-ui.png"},":":[{c:"Trigger",p:{dataPath:"game.currentScene.isBetCanBeDecreased",pow:1,alphaShift:-.65},":":[{c:"Button",p:{x:34,y:43,image:"ui/bet-btn.png",hoverImage:"ui/bet-btn-h.png",onClick:"game.currentScene.minimizeBet",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{translatableText:"plinko.min","style.fontSize":18,verticalAlign:"center",maxWidth:54}}]},{c:"Button",p:{x:100,y:43,image:"ui/bet-btn.png",hoverImage:"ui/bet-btn-h.png",onClick:"game.currentScene.decreaseBet",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{text:"—","style.fontSize":18,verticalAlign:"center","style.fontWeight":"bold"}}]}]},{c:"Trigger",p:{dataPath:"game.currentScene.isBetCanBeIncreased",pow:1,alphaShift:-.65},":":[{c:"Button",p:{x:399,y:43,image:"ui/bet-btn.png",hoverImage:"ui/bet-btn-h.png",onClick:"game.currentScene.increaseBet",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{text:"+","style.fontSize":18,verticalAlign:"center","style.fontWeight":"bold"}}]},{c:"Button",p:{x:465,y:43,image:"ui/bet-btn.png",hoverImage:"ui/bet-btn-h.png",onClick:"game.currentScene.maximizeBet",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{translatableText:"plinko.max","style.fontSize":18,verticalAlign:"center",maxWidth:54}}]}]},{c:"MoneyLabel",p:{name:"bet-label",x:249,y:49,translatableText:"plinko.bet","style.fontSize":27,verticalAlign:"center","style.fontWeight":"bold","style.letterSpacing":1,maxWidth:225,dataPath:"game.data.bet",refreshInterval:0,decimalsCount:2,dataPath2:"game.data.currency"}},{c:"MoneyLabel",p:{name:"balance-label",x:247,y:100,translatableText:"plinko.balance","style.fontSize":27,verticalAlign:"center","style.fill":"#7a79b2","style.fontWeight":"bold","style.letterSpacing":1,textTransform:1,maxWidth:225,dataPath:"game.data.balance",refreshInterval:0,decimalsCount:2,dataPath2:"game.data.currency",decimalsCountPath:"game.data.balanceDigitsCount"}}]},{c:"Trigger",p:{name:"ios-safari-fix",dataPath:"game.isLandscapeSafariIos",invert:!0,pow:1,alphaShift:0,xShift:50,yShift:130,isApplyInteractivity:!1},":":[{c:"Button",p:{name:"lines-button",x:737,y:-399,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`8",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"8","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-367.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`9",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"9","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-336.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`10",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"10","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-305.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`11",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"11","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-274.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`12",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"12","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-243.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`13",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"13","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-212.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`14",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"14","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-181.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`15",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"15","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"Button",p:{name:"lines-button",x:737,y:-150.99999999999994,image:"ui/select-btn.png",hoverImage:"ui/select-btn-h.png",disabledImage:"ui/select-btn-d.png",onClick:"all.gameTable.setLinesCount`16",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",y:-1,text:"16","style.fontSize":18,verticalAlign:"center","style.fill":"#c6d6e3"}}]},{c:"TextInput",p:{x:736,y:-416,translatableText:"plinko.lines","style.fontSize":18,verticalAlign:"bottom","style.fill":"#ace0f4",maxWidth:344}}]}]},{c:"Button",p:{name:"playButton",x:500,y:328,"pivot.x":-15,"pivot.y":-15,image:"ui/play-btn.png",hoverImage:"ui/play-btn-h.png",onClick:"game.currentScene.playButtonClick",sndClick:"play",sndOver:"over"},":":[{c:"Trigger",p:{x:-17,y:-16,dataPath:"game.currentScene.isAutoplayStarted",invert:!0},":":[{c:"Text",p:{x:1,translatableText:"plinko.play","style.fontSize":46,verticalAlign:"center","style.fill":"#f29d1d","style.fontWeight":"bold",textTransform:1,maxWidth:126}}]},{c:"Trigger",p:{x:-17,y:-16,dataPath:"game.currentScene.isAutoplayStarted"},":":[{c:"Text",p:{x:1,translatableText:"plinko.stop","style.fontSize":46,verticalAlign:"center","style.fill":"#f29d1d","style.fontWeight":"bold",textTransform:1,maxWidth:126}},{c:"Label",p:{y:39,text:"22","style.fontSize":25,verticalAlign:"center","style.fill":"#f29d1d","style.fontWeight":"bold",dataPath:"game.data.autoplayCurrentCount"}}]},{c:"Shape",p:{x:-15,y:-15,alpha:0,shape:2,shapeRadius:82,isItHitArea:!0}}]},{c:"MovieClip",p:{name:"win-panel",x:500,isPlaying:!1,timeline:{l:{"on-win":9,hide:262},p:.2,d:.85,f:[{n:"y",t:[{v:214,t:0},{v:214,t:14,s:5},{v:214,t:120}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:17,m:1},{v:1,t:254,m:1},{v:0,t:269,m:1}]},{n:"scale.x",t:[{v:0,t:0},{v:1,t:17,m:1},{v:1,t:254,m:1},{v:0,t:269,m:1}]}]}},":":[{c:"NineSlicePlane",p:{x:-250,y:-25,image:"ui/win-panel.png",width:500,height:50,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25},":":[{c:"Fill",p:{x:10,y:10,"scale.x":3.74,"scale.y":.23,image:"ui/stars-pattern.png",tint:16764160,verticesX:4,xRepeat:3.74,yRepeat:.23,xShiftSpeed:.010480000000000001,yShiftSpeed:.0039900000000000005,xWaveAmp:1.012,xWaveStep:3.357,xWaveSpeed:.01312,yWaveAmp:-.034,yWaveStep:2.064,yWaveSpeed:.0753}},{c:"MoneyLabel",p:{name:"bet-label",x:251,y:24,translatableText:"plinko.win","style.fontSize":27,verticalAlign:"center","style.fill":"#4a2c01","style.fontWeight":"bold","style.letterSpacing":1,maxWidth:225,dataPath:"game.data.winToShow",refreshInterval:0,decimalsCount:2,dataPath2:"game.data.currency"}}]}]},{c:"GameTable",p:{name:"gameTable",x:500,y:-394},":":[{c:"DSprite",p:{name:"hole",image:"ui/hole.png"}},{c:"Container",p:{name:"ballsContainer"}},{c:"Container",p:{name:"pinsContainer"}},{c:"Container",p:{name:"particlesContainer"}},{c:"DSprite",p:{name:"tooltip",x:-185,y:478,"pivot.x":-1,"pivot.y":-2,image:"ui/tooltip.png"},":":[{c:"Sprite",p:{name:"pointer",x:-52,y:56,"pivot.x":10,image:"ui/tooltip-pointer.png"}},{c:"Text",p:{y:-40,translatableText:"plinko.tooltip_win","style.fontSize":22,verticalAlign:"center","style.fill":"#1c3966",maxWidth:98}},{c:"Text",p:{y:18,translatableText:"plinko.chance","style.fontSize":22,verticalAlign:"center","style.fill":"#1c3966",maxWidth:98}},{c:"MoneyLabel",p:{name:"profit",x:1,y:-14,text:"%d %s","style.fontSize":20,verticalAlign:"center","style.fill":"#1c3966","style.letterSpacing":1,maxWidth:141,dataPath:"this.parent.profit",refreshInterval:0,template:"%d %s",decimalsCount:2,dataPath2:"game.data.currency"}},{c:"Label",p:{name:"chance",x:1,y:44,text:"0.123123","style.fontSize":20,verticalAlign:"center","style.fill":"#1c3966",maxWidth:141,dataPath:"this.parent.chance",refreshInterval:0}}]}]},{c:"OrientationTrigger",p:{landscapeY:16,landscapeAlpha:0,portraitX:212,portraitY:-314,portraitR:-1.5707963267948966},":":[{c:"Sprite",p:{y:57,"scale.x":.5,"scale.y":.5,"pivot.x":204,"pivot.y":118,image:"ui/logo.png"},":":[{c:"Trigger",p:{dataPath:"game.casinoOptions.ui.logo_visible",isApplyInteractivity:!1},":":[{c:"Sprite",p:{x:104,y:182,alpha:.4,"scale.x":.5,"scale.y":.5,image:"ui/brand-logo.png"}}]}]}]}]}]}]}]},{c:"PrefabReference",p:{name:"ui",prefabName:"ui/ui-panel"}},{c:"BgMusic",p:{name:"bgMusic",loop:"mus/bg"}}]},paytable:{c:"PaytablePreloaderScene",p:{backgroundColor:0},":":[{c:"PrefabReference",p:{prefabName:"paytable-preloader"}},{c:"Container",p:{name:"slot-UI"}}]},root:{c:"BaseRootScene",p:{backgroundColor:0}}},prefabs:{ball:{c:"Ball",p:{name:"ball","pivot.x":-3,"pivot.y":-5,image:"ui/ball.png"},":":[{c:"MovieClip",p:{x:-3,y:-5,rotation:-.712,timeline:{l:{},p:.02,d:.85,f:[{n:"rotation",t:[{v:-.712,t:0},{v:.768,t:10,m:1},{v:-.712,t:19,m:1},{v:.768,t:26,m:1},{v:-.712,t:33,m:1},{v:.768,t:39,m:1,j:4}]}]}},":":[{c:"Spawner",p:{name:"particles-spawner",x:-1,y:-15,rotation:-1.5707963267948966,prefabToSpawn:"spark",enabled:!1,interval:2,speed:0,speedRandom:0,container:"game.currentScene.all.particlesContainer"}}]}]},"ball-target":{c:"Button",p:{name:"ball-target",hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY",sndClick:"click",sndOver:"over"},":":[{c:"MovieClip",p:{name:"body",image:"ui/target.png",tint:16776960,isPlaying:!1,timeline:{l:{"ball-touch":12},p:.2,d:.85,f:[{n:"y",t:[{v:0,t:0},{v:0,t:13,s:2.3000000000000003},{v:0,t:80}]},{n:"tintB",t:[{v:0,t:0,m:1},{v:0,t:12,m:1},{v:255,t:15,m:1},{v:0,t:34,m:1}]}]},y:0,tintB:0},":":[{c:"Sprite",p:{x:-31,y:-19,image:"ui/target-overlay.png"}},{c:"Text",p:{name:"label",y:1,alpha:.85,text:"---","style.fontSize":20,verticalAlign:"center","style.fill":"#000022","style.fontWeight":"bold",maxWidth:47}},{c:"SpawnerRing",p:{name:"spawner",rotation:1.5707963267948966,prefabToSpawn:"spark",speed:2,speedRandom:2,count:15,countRandom:5,container:"all.particlesContainer"}}]},{c:"Shape",p:{x:-28,y:-37,width:57,height:76,isItHitArea:!0}}]},container:{c:"Container",p:{name:"container"}},"counter-text":{c:"Text",p:{name:"counter-text",x:640,y:360,text:"100","style.fontSize":20,verticalAlign:"center",maxWidth:34}},"fader/curtains":{c:"Resizer",p:{name:"fader/curtains",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"MovieClip",p:{timeline:{l:{},p:.02,d:.85,f:[{n:"visible",t:[{v:!0,t:0,m:2},{v:!0,t:121,m:2,a:"this.playRecursive"}]}]}},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{"scale.y":8.4375,image:"WHITE_FOR_CANVAS.jpg",tint:0,isPlaying:!1,timeline:{l:{"hide fader":81},p:.02,d:.85,f:[{n:"x",t:[{v:-960,t:0},{v:-480,t:70,m:3,b:.4,g:2,a:"game.faderShoot"},{v:-480,t:74,m:1,a:"this.stop"},{v:-480,t:83,m:1},{v:-960,t:120,m:1,a:"game.faderEnd"}]},{n:"scale.x",t:[{v:0,t:0},{v:7.5,t:15,m:1},{v:7.5,t:70,m:1},{v:7.5,t:74,m:1},{v:7.5,t:83,m:1},{v:.1,t:120,m:1}]}]}}},{c:"MovieClip",p:{"scale.y":8.4375,image:"WHITE_FOR_CANVAS.jpg",tint:0,isPlaying:!1,timeline:{l:{"hide fader":81},p:.02,d:.85,f:[{n:"x",t:[{v:960,t:0},{v:480,t:70,m:4,b:.4,g:2},{v:480,t:74,m:1},{v:480,t:83,m:1},{v:966,t:120,m:1}]},{n:"scale.x",t:[{v:.625,t:0},{v:7.5,t:15,m:1},{v:7.5,t:70,m:1},{v:7.5,t:74,m:1,a:"this.stop"},{v:7.5,t:83,m:1},{v:.1,t:120,m:1}]}]}}}]},{c:"MovieClip",p:{isPlaying:!1,timeline:{l:{"hide fader":180},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:123,m:1},{v:1,t:130,m:1},{v:.8200000000000001,t:139,m:1},{v:1,t:150,m:1},{v:.4,t:161,m:1},{v:1,t:173,m:1,j:122}]}]}},":":[{c:"Text",p:{y:26,translatableText:"loading","style.fontSize":35,maxWidth:688}},{c:"MovieClip",p:{y:-22,image:"ui/spinner.png",rSpeed:.03,timeline:{l:{},p:.048,d:.81,f:[{n:"scale.y",t:[{v:.66,t:0},{v:.5499999999999999,t:13},{v:.66,t:60,j:0}]},{n:"scale.x",t:[{v:.66,t:0},{v:.55,t:13},{v:.66,t:60,j:0}]}]}}}]}]}]},"fader/default":{c:"Container",p:{name:"fader/default"},":":[{c:"Resizer",p:{name:"fader/default",resizeX:!0,resizeY:!0,relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"MovieClip",p:{name:"fader/default","scale.x":15,"scale.y":8.4375,image:"WHITE_FOR_CANVAS.jpg",tint:0,timeline:{l:{"hide fader":74},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:1,t:12,m:1,a:"game.faderShoot"},{v:1,t:23,m:1,a:"this.stop"},{v:1,t:74,m:1},{v:0,t:88,m:1,a:"game.faderEnd"}]}]}}}]},{c:"Resizer",p:{relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"MovieClip",p:{timeline:{l:{"hide fader":324},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:209,m:1},{v:1,t:217,m:1},{v:.8200000000000001,t:228,m:1},{v:1,t:241,m:1},{v:.4,t:255,m:1},{v:1,t:267,m:1,j:213},{v:0,t:335,m:1}]}]}},":":[{c:"Text",p:{y:26,translatableText:"loading","style.fontSize":35,maxWidth:795}},{c:"MovieClip",p:{y:-22,image:"ui/spinner.png",rSpeed:.03,timeline:{l:{},p:.048,d:.81,f:[{n:"scale.y",t:[{v:.66,t:0},{v:.5499999999999999,t:13},{v:.66,t:60,j:0}]},{n:"scale.x",t:[{v:.66,t:0},{v:.55,t:13},{v:.66,t:60,j:0}]}]}}}]}]}]},"fader/default-slow":{c:"Container",p:{name:"fader/default-slow"},":":[{c:"Resizer",p:{name:"fader/default",resizeX:!0,resizeY:!0,relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"MovieClip",p:{name:"fader/default","scale.x":15,"scale.y":8.4375,image:"WHITE_FOR_CANVAS.jpg",tint:0,timeline:{l:{"hide fader":122},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:1,t:60,m:1,a:"game.faderShoot"},{v:1,t:70,m:1,a:"this.stop"},{v:1,t:123,m:1},{v:0,t:187,m:1,a:"game.faderEnd"}]}]}}}]},{c:"Resizer",p:{relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"MovieClip",p:{timeline:{l:{"hide fader":324},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:0,t:209,m:1},{v:1,t:217,m:1},{v:.8200000000000001,t:228,m:1},{v:1,t:241,m:1},{v:.4,t:255,m:1},{v:1,t:267,m:1,j:212},{v:0,t:335,m:1}]}]}},":":[{c:"Text",p:{y:26,translatableText:"loading","style.fontSize":35,maxWidth:824}},{c:"MovieClip",p:{y:-22,image:"ui/spinner.png",rSpeed:.03,timeline:{l:{},p:.048,d:.81,f:[{n:"scale.y",t:[{v:.66,t:0},{v:.5499999999999999,t:13},{v:.66,t:60,j:0}]},{n:"scale.x",t:[{v:.66,t:0},{v:.55,t:13},{v:.66,t:60,j:0}]}]}}}]}]}]},flytext:{c:"FlyText",p:{name:"flytext",x:513,y:295,text:"qwdqwdqwd","style.fontSize":28,verticalAlign:"center","style.fill":"#ffff00","style.strokeThickness":4,"style.stroke":"#773300"}},logo:{c:"DSprite",p:{name:"logo",x:1,y:61,"scale.x":.666,"scale.y":.666,image:"ui/logo.png"},":":[{c:"MovieClip",p:{timeline:{l:{},p:.02,d:.85,f:[{n:"x",t:[{v:122,t:0,m:1},{v:-30,t:9,m:1},{v:122.9661363162408,t:42,m:1,j:0}]},{n:"y",t:[{v:48,t:0,m:1},{v:-80,t:16,m:1},{v:50.41431393721814,t:35,m:1,j:0}]}]}},":":[{c:"MovieClip",p:{image:"ui/particle.png",timeline:{l:{},p:.06,d:.8,f:[{n:"scale.x",t:[{v:0,t:0},{v:0,t:61,a:"this.parent.stop"},{v:1,t:82},{v:0,t:116,j:0,a:"this.parent.play"}]},{n:"scale.y",t:[{v:0,t:0},{v:0,t:61},{v:1,t:83},{v:0,t:116,j:0}]}]}}}]},{c:"MovieClip",p:{timeline:{l:{},p:.02,d:.85,f:[{n:"x",t:[{v:126,t:0,m:1},{v:-31,t:15,m:1},{v:123,t:30,m:1,j:0}]},{n:"y",t:[{v:77,t:0,m:1},{v:-75,t:10,m:1},{v:82,t:23,m:1,j:0}]}]}},":":[{c:"MovieClip",p:{image:"ui/particle.png",timeline:{l:{},p:.06,d:.8,f:[{n:"scale.x",t:[{v:0,t:0},{v:0,t:61,a:"this.parent.stop"},{v:1,t:82},{v:0,t:108,j:0,a:"this.parent.play"}]},{n:"scale.y",t:[{v:0,t:0},{v:0,t:61},{v:1,t:83},{v:0,t:108,j:0}]}]}}}]},{c:"MovieClip",p:{x:-33,y:-36,image:"ui/particle.png",timeline:{l:{},p:.06,d:.8,f:[{n:"scale.x",t:[{v:0,t:0},{v:0,t:29},{v:1.44,t:49},{v:0,t:136,j:0}]},{n:"scale.y",t:[{v:0,t:0},{v:0,t:29},{v:1.44,t:49},{v:0,t:136,j:0}]}]}}},{c:"MovieClip",p:{x:123,y:-66,image:"ui/particle.png",timeline:{l:{},p:.06,d:.8,f:[{n:"scale.x",t:[{v:0,t:0},{v:0,t:87},{v:1.58,t:112},{v:0,t:186,j:0}]},{n:"scale.y",t:[{v:0,t:0},{v:0,t:87},{v:1.67,t:112},{v:0,t:185,j:0}]}]}}},{c:"Trigger",p:{dataPath:"game.casinoOptions.ui.logo_visible"},":":[{c:"Sprite",p:{x:135,y:37,alpha:.4,"scale.x":.37,"scale.y":.37,image:"ui/brand-logo.png"}}]}]},"paytable-preloader":{c:"Container",p:{name:"paytable-preloader"},":":[{c:"Resizer",p:{name:"button",relativeX:!0,xPos:.5,relativeY:!0,yPos:1},":":[{c:"OrientationTrigger",p:{landscapeY:-75,portraitY:-170},":":[{c:"Button",p:{disabledAlpha:.5,onClick:"closeCurrentScene`"},":":[{c:"Shape",p:{x:-150,y:-50,shape:1,width:300,shapeFillColor:8421504}},{c:"Text",p:{y:-3,translatableText:"settings.labels.accept","style.fontSize":46,verticalAlign:"center","style.stroke":"#ad0014","style.fontWeight":"bold",textTransform:1,maxWidth:392}},{c:"Trigger",p:{interactive:!0,dataPath:"isMobile.any"},":":[{c:"Shape",p:{x:-250,y:-100,alpha:.8,visible:!1,width:500,height:200,isItHitArea:!0}}]}]}]}]},{c:"Container",p:{name:"rules"},":":[{c:"AlignedScrollArea",p:{name:"rules-scroll-area",x:110,y:200,scrollLayerPath:"this.#rules-html-overlay",bgNineSlicePlanePath:"this.#bg",scrollBarPath:"this.#scroll-bar",marginLeftRight:50,marginTop:200,marginBottom:150,marginLeftRightPortrait:30,marginTopPortrait:200,marginBottomPortrait:285,maxWidthMobile:2e3,containerMargin:0,scrollBarBottomMargin:200,maxWidthDesktop:1700},":":[{c:"NineSlicePlane",p:{name:"bg",alpha:.7,interactive:!0,image:"WHITE",tint:0,width:1700,height:730,leftWidth:30,rightWidth:30,topHeight:30,bottomHeight:30}},{c:"HTMLOverlay",p:{name:"rules-html-overlay",visibleArea:{x:0,y:0,w:1700,h:730},fullArea:{x:0,y:0,w:1700,h:1916},mouseHandler:"this.parent.#bg",desktopInertia:.99,mobileInertia:.99,className:"casino-modal"}},{c:"ProgressBar",p:{name:"scroll-bar",x:1700,interactive:!0,dataPath:"this.parent.#rules-html-overlay.relativeScrollY",height:530,capMargin:268,refreshInterval:0,max:1,step:1e-5},":":[{c:"Shape",p:{name:"bg",x:-30,alpha:0,"pivot.x":5,shape:1,width:10,height:530,shapeRadius:5,shapeFillAlpha:.5,shapeFillColor:4013902}},{c:"Trigger",p:{x:-30,dataPath:"this.parent.parent.#rules-html-overlay.isYScrollAvailable",onEnable:"setValueByPath`this.parent.#bg.visible,1",onDisable:"setValueByPath`this.parent.#bg.visible,0"},":":[{c:"Button",p:{name:"cap",tint:4276031,hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY"}}]}]}]},{c:"Resizer",p:{name:"loader-resizer",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Trigger",p:{name:"loader-trigger",dataPath:"all.rules-html-overlay.innerHTML",invert:!0},":":[{c:"DSprite",p:{name:"loader-sprite",x:-3,y:2,"scale.x":2,"scale.y":2,image:"ui/spinner.png",tint:0,rSpeed:.02}}]}]}]},{c:"Resizer",p:{name:"logo",y:50,relativeX:!0,xPos:.5},":":[{c:"OrientationTrigger",p:{name:"logo",landscapeX:1,landscapeY:42,landscapeScaleX:.97,landscapeScaleY:.97,portraitY:40},":":[{c:"DSprite",p:{image:"ui/logo.png"}}]}]}]},pin:{c:"DSprite",p:{name:"pin","pivot.x":-1,"pivot.y":-2,image:"ui/pin.png"}},"pin-light":{c:"MovieClip",p:{name:"pin-light",alpha:1,"scale.x":1,"scale.y":1,"pivot.x":1,"pivot.y":2,image:"ui/light.png",timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:1,t:0,m:1},{v:1,t:3,m:1},{v:0,t:14,m:1,a:"this.remove"}]},{n:"scale.x",t:[{v:1,t:0,m:1},{v:1.5,t:14,m:1}]},{n:"scale.y",t:[{v:1,t:0,m:1},{v:1.5,t:14,m:1}]}]}}},"provability-count-text":{c:"Text",p:{name:"provability-count-text",x:640,y:360,text:"100","style.fontSize":30,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"bold"}},"result-list-item":{c:"ListItem",p:{name:"result-list-item","pivot.x":222,timeline:{l:{remove:69,"no-animation":66},p:.05,d:.74,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:1,t:23,m:1},{v:1,t:67,m:1},{v:0,t:86,m:1,a:"this.remove"}]},{n:"pivot.x",t:[{v:222,t:0},{v:0,t:61},{v:0,t:67,a:"this.stop",m:1},{v:199,t:86,m:1}]}]},alpha:0},":":[{c:"Sprite",p:{name:"lose-bg",x:447,y:-16,image:"ui/profit-bg.png",tint:2527919},":":[{c:"MoneyLabel",p:{name:"win",x:105,y:15,text:"%d %s","style.fontSize":21,verticalAlign:"center","style.letterSpacing":1,maxWidth:170,dataPath:"this.parent.parent.data.win",refreshInterval:1e5,template:"%d %s",isNumeric:!0,plusMinus:!0,decimalsCount:2,dataPath2:"game.data.currency"}}]},{c:"Sprite",p:{name:"win-bg",x:447,y:-16,image:"ui/profit-bg.png",tint:16292380},":":[{c:"MoneyLabel",p:{name:"win",x:105,y:15,text:"%d %s","style.fontSize":21,verticalAlign:"center","style.fill":"#1c3662","style.letterSpacing":1,maxWidth:171,dataPath:"this.parent.parent.data.win",refreshInterval:1e5,template:"%d %s",isNumeric:!0,plusMinus:!0,decimalsCount:2,dataPath2:"game.data.currency"}}]},{c:"Label",p:{name:"payout",x:397,"scale.x":.9090909090909091,"scale.y":.9090909090909091,text:"1235.88×","style.fontSize":21,verticalAlign:"center",maxWidth:80,dataPath:"this.parent.data.payout",refreshInterval:1e5,template:"%d×",isNumeric:!0,decimalsCount:1}},{c:"Label",p:{name:"time",x:113,text:"12:28:03","style.fontSize":21,verticalAlign:"center",dataPath:"this.parent.data.time",refreshInterval:1e5}},{c:"MoneyLabel",p:{name:"bet",x:258,y:-1,"scale.x":.8294930875576036,"scale.y":.8294930875576036,text:"123123123123%d %s","style.fontSize":21,verticalAlign:"center","style.letterSpacing":1,maxWidth:180,dataPath:"this.parent.data.bet",refreshInterval:1e5,template:"%d %s",isNumeric:!0,decimalsCount:2,dataPath2:"game.data.currency"}}]},spark:{c:"ParticleSimple",p:{name:"spark",x:640,y:360,image:"ui/spark.png"}},"thing-games-utils/api-message":{c:"Resizer",p:{name:"thing-games-utils/api-message",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop","scale.x":192,"scale.y":108,image:"WHITE",tint:40,timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:.7,t:7,m:1}]}]}}}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]}]}},":":[{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{x:-300,y:-173,alpha:.9,interactive:!0,image:"ui/panel.png",width:600,height:271,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25}},{c:"Text",p:{name:"title",y:-138,alpha:.8,text:"TITLE","style.fontSize":26,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:540}},{c:"MultilineText",p:{name:"message",y:-62,alpha:.7,text:"qw qwe qwe q weq weqwe qweqwe eqwe qwe qwe qwe qwe qwe qw eqw e","style.fontSize":22,verticalAlign:"center","style.fontWeight":"lighter",maxWidthLandscape:540,maxWidthPortrait:540,maxHeightLandscape:130,maxHeightPortrait:130}},{c:"Button",p:{name:"btn",x:-170,y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"btn",y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"btn",x:170,y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"close-btn",x:270,y:-140,image:"ui/close-btn.png",hoverImage:"ui/close-btn-h.png",pressImage:"ui/close-btn-p.png",onClick:"all.popupsLayer.hideAll",hotkey:27,sndClick:"click",sndOver:"over"},":":[{c:"Shape",p:{x:-25,y:-25,alpha:.8,visible:!1,width:50,height:50,isItHitArea:!0}}]}]}]}]},"thing-games-utils/html-popup":{c:"Resizer",p:{name:"thing-games-utils/html-popup",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop","scale.x":192,"scale.y":108,timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:1,t:7,m:1}]}]}},":":[{c:"Button",p:{name:"easyCloseBtn",alpha:.7000000000000001,"scale.x":.625,"scale.y":.625,image:"WHITE",tint:40,hoverImage:"WHITE",pressImage:"WHITE",disabledImage:"WHITE",onClick:"game.hideModal",hotkey:27,sndClick:"click"}}]}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:25}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:25}]}]}},":":[{c:"Resizer",p:{relativeX:!0,xPos:-.5,relativeY:!0,yPos:-.5},":":[{c:"FullscreenPopup",p:{name:"POPUP-SIZER",x:510,y:110,scrollLayerPath:"this.#html",bgNineSlicePlanePath:"this.#bg",scrollBarPath:"this.#scroll-bar",marginLeftRight:30,marginTopBottom:60,containerMargin:50,scrollBarBottomMargin:120,maxWidthDesktop:1e3},":":[{c:"NineSlicePlane",p:{name:"bg",x:-50,y:-50,alpha:.9,interactive:!0,image:"ui/panel.png",width:1e3,height:960,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25}},{c:"HTMLOverlay",p:{name:"html",visibleArea:{x:0,y:0,w:900,h:860},fullArea:{x:0,y:0,w:1200,h:3283.8832668486248},className:"casino-modal"}},{c:"ProgressBar",p:{name:"scroll-bar",x:950,y:25,interactive:!0,dataPath:"this.parent.#html.relativeScrollY",height:840,capMargin:30,refreshInterval:0,max:1,step:1e-5},":":[{c:"NineSlicePlane",p:{name:"bg",x:-21,alpha:0,"scale.x":.625,"scale.y":.625,image:"WHITE",width:17.1,height:840}},{c:"Trigger",p:{dataPath:"this.parent.parent.#html.isYScrollAvailable"},":":[{c:"Button",p:{name:"cap",x:-11,y:20,image:"ui/scroller.png",hoverImage:"ui/scroller.png",pressImage:"ui/scroller.png",disabledImage:"ui/scroller.png"}}]},{c:"Trigger",p:{x:-26,y:-47,dataPath:"this.parent.parent.isMobileLandscape",invert:!0,pow:1,alphaShift:0,scaleShift:.5,isApplyInteractivity:!1},":":[{c:"Button",p:{name:"close-btn",x:-4,y:4,image:"ui/close-btn.png",onClick:"game.hideModal",hotkey:27,sndClick:"click",sndOver:"over"},":":[{c:"Shape",p:{x:-37,y:-35,alpha:.31,width:70,height:70,isItHitArea:!0}}]}]}]},{c:"Trigger",p:{name:"ios-safari-fix",dataPath:"game.isLandscapeSafariIos",pow:.12,damp:.75,alphaShift:0,isApplyInteractivity:!1,onEnable:"setValueByPath`this.parent.marginTopBottom,120",onDisable:"setValueByPath`this.parent.marginTopBottom,60"}}]}]}]}]},"thing-games-utils/offer-question":{c:"Resizer",p:{name:"thing-games-utils/offer-question",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop","scale.x":192,"scale.y":108,timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:1,t:7,m:1}]}]}},":":[{c:"Button",p:{name:"easyCloseBtn",alpha:.7000000000000001,"scale.x":.625,"scale.y":.625,image:"WHITE",tint:40,hoverImage:"WHITE",pressImage:"WHITE",disabledImage:"WHITE",hotkey:27,sndClick:"click",sndOver:"over"}},{c:"Trigger",p:{dataPath:"isMobile.any",pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"OrientationTrigger",p:{landscapeX:-2.5,landscapeScaleY:1.5,landscapeR:-1.57,portraitY:-4,portraitScaleY:1.8},":":[{c:"DSprite",p:{name:"easyCloseDisable",y:4.5,alpha:1e-5,interactive:!0,"scale.x":.625,"scale.y":.065,image:"WHITE",tint:0}}]}]},{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"DSprite",p:{name:"easyCloseDisable",y:4.5,alpha:1e-5,interactive:!0,"scale.x":.625,"scale.y":.065,image:"WHITE",tint:0}}]}]}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]}]}},":":[{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{x:-257,y:-190,interactive:!0,image:"ui/panel.png",width:514,height:345,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25}},{c:"Text",p:{name:"title",y:-110,translatableText:"slot.popups.enable_quick_spin_question","style.fontSize":78,verticalAlign:"center","style.strokeThickness":3,"style.stroke":"#ffffff","style.fontWeight":"lighter",maxWidth:300}},{c:"MultilineText",p:{name:"message",y:-20,translatableText:"slot.popups.enable_quick_spin_description","style.fontSize":30,verticalAlign:"center","style.fill":"#848484","style.fontWeight":"lighter",maxWidthLandscape:380,maxWidthPortrait:380,maxHeightLandscape:130,maxHeightPortrait:130}},{c:"Button",p:{name:"okBtn",x:115,y:80,"scale.x":.9,"scale.y":.9,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"slot.popups.buy_bonus.enable","style.fontSize":45,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"noBtn",x:-115,y:80,"scale.x":.9,"scale.y":.9,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"slot.popups.buy_bonus.no","style.fontSize":45,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"close-btn",x:225,y:-160,image:"ui/close-btn.png",hoverImage:"ui/close-btn-h.png",pressImage:"ui/close-btn-p.png",onClick:"all.popupsLayer.hideAll",hotkey:27,sndClick:"click",sndOver:"over"},":":[{c:"Shape",p:{x:-25,y:-25,alpha:.8,visible:!1,width:50,height:50,isItHitArea:!0}}]}]}]}]},"thing-games-utils/pause-popup":{c:"Resizer",p:{name:"thing-games-utils/pause-popup",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop","scale.x":120,"scale.y":67.5,image:"WHITE",tint:0,timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:.7,t:7,m:1}]}]}}}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]}]}},":":[{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{x:-300,y:-173,alpha:.9,interactive:!0,image:"ui/panel.png",width:600,height:271,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25}},{c:"Text",p:{name:"title",y:-138,alpha:.8,translatableText:"buttons.pause","style.fontSize":26,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:540}},{c:"Button",p:{name:"close-btn",y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.resume","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:174}}]}]}]}]},"thing-games-utils/provability-panel":{c:"ProvabilityPanel",p:{name:"thing-games-utils/provability-panel",pow:.1,damp:.64,xShift:-100},":":[{c:"Trigger",p:{name:"shift-for-spin",dataPath:"this.parent.isHidedForSpin",invert:!0,alphaShift:0,xShift:-130,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{name:"provability-background",interactive:!0,"pivot.x":100,image:"ui/panel.png",width:540,height:1080}},{c:"Container",p:{name:"provability-container",x:220,y:540},":":[{c:"Trigger",p:{name:"orientation-trigger",state:!0,pow:1,alphaShift:0,yShift:160,isApplyInteractivity:!1},":":[{c:"Text",p:{name:"provability-title",y:-419,translatableText:"provability.title","style.fontSize":34,verticalAlign:"center","style.fontWeight":"lighter","style.padding":7,maxWidth:376}}]},{c:"Trigger",p:{name:"orientation-trigger",y:54,state:!0,pow:1,damp:.999,alphaShift:0,xShift:-200,yShift:142,isApplyInteractivity:!1},":":[{c:"Container",p:{name:"next-game-container",y:-309},":":[{c:"Text",p:{y:-110,tint:8684676,translatableText:"provability.next_game","style.fontSize":30,verticalAlign:"center","style.fontWeight":"lighter",textTransform:1,maxWidth:134}},{c:"Text",p:{name:"hash-result-secret-label",y:107,alpha:.5,text:"Hash (Result + Secret)","style.fontSize":17,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:377}},{c:"Button",p:{name:"next-game-hash-btn",y:143,hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY",sndClick:"click",sndOver:"over"},":":[{c:"NineSlicePlane",p:{x:-189,y:-22,image:"ui/provability/input-gray.png",width:378,height:44,leftWidth:7,rightWidth:52,topHeight:7,bottomHeight:7},":":[{c:"Scissors",p:{rect:{x:0,y:0,w:325,h:41}},":":[{c:"Label",p:{name:"label",x:13,y:13,text:"01234567890123456789012345678901234567890123","style.fontSize":16,"style.align":"left","style.fill":"#000000","style.fontWeight":"lighter"}}]},{c:"Sprite",p:{x:248,y:3,"scale.x":5,"scale.y":.9,image:"ui/provability/input-fade.png"}}]}]},{c:"PrefabReference",p:{name:"provability-seed",prefabName:"ui/game-provability"}}]}]},{c:"Trigger",p:{y:54,dataPath:"this.parent.parent.parent.data.1",pow:.06,damp:.7},":":[{c:"Trigger",p:{name:"orientation-trigger",state:!0,pow:1,damp:.999,yShift:160,isApplyInteractivity:!1},":":[{c:"Sprite",p:{x:-189,y:-116,alpha:.3,"scale.x":23.625,"scale.y":.1875,image:"WHITE"}}]},{c:"Trigger",p:{name:"orientation-trigger",state:!0,pow:1,damp:.999,alphaShift:0,xShift:200,yShift:-198,isApplyInteractivity:!1},":":[{c:"Container",p:{name:"last-game-container",y:13},":":[{c:"Text",p:{y:-93,tint:8684676,translatableText:"provability.last_game","style.fontSize":29,verticalAlign:"center","style.fontWeight":"lighter",textTransform:1,maxWidth:134}},{c:"Text",p:{name:"hash-result-secret-label2",x:67,y:63,alpha:.5,text:"Hash (Result + Secret)","style.fontSize":17,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:271}},{c:"Text",p:{x:-128,y:63,alpha:.5,translatableText:"provability.client_seed","style.fontSize":17,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:175}},{c:"Text",p:{name:"result-secret-label",y:-56,alpha:.5,text:"Result + Secret","style.fontSize":17,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:376}},{c:"Text",p:{y:142,alpha:.5,translatableText:"provability.final_result","style.fontSize":17,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:376}},{c:"Button",p:{name:"last-game-hash-btn",x:26,y:100,hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY",sndClick:"click",sndOver:"over"},":":[{c:"NineSlicePlane",p:{x:-82,y:-23,image:"ui/provability/input-gray.png",width:245,height:44,leftWidth:7,rightWidth:52,topHeight:7,bottomHeight:7},":":[{c:"Scissors",p:{rect:{x:0,y:0,w:193,h:50}},":":[{c:"Label",p:{name:"label",x:13,y:13,text:"012345678901234567890123456","style.fontSize":16,"style.align":"left","style.fill":"#000000","style.fontWeight":"lighter"}}]},{c:"Sprite",p:{x:115,y:3,"scale.x":5,"scale.y":.9,image:"ui/provability/input-fade.png"}}]}]},{c:"Button",p:{name:"last-game-final-result-btn",y:179,hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY",sndClick:"click",sndOver:"over"},":":[{c:"NineSlicePlane",p:{x:-189,y:-23,image:"ui/provability/input-yellow.png",width:378,height:80,leftWidth:7,rightWidth:52,topHeight:40,bottomHeight:6},":":[{c:"Scissors",p:{rect:{x:0,y:0,w:329,h:69}},":":[{c:"MultilineText",p:{name:"label",x:13,y:11,text:'{dymbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j",',"style.fontSize":16,"style.align":"left","style.fill":"#000000","style.fontWeight":"lighter",maxWidthLandscape:307,maxWidthPortrait:307,breakWords:!0}}]},{c:"Sprite",p:{x:242,y:48,"scale.x":5,"scale.y":.54,image:"ui/provability/input-fade-yellow.png"}}]}]},{c:"Button",p:{name:"last-game-result-btn",x:-107,y:-19,hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY",sndClick:"click",sndOver:"over"},":":[{c:"NineSlicePlane",p:{x:-82,y:-23,image:"ui/provability/input-gray.png",width:378,height:80,leftWidth:7,rightWidth:52,topHeight:40,bottomHeight:6},":":[{c:"Scissors",p:{rect:{x:0,y:0,w:329,h:66}},":":[{c:"MultilineText",p:{name:"label",x:13,y:11,text:'{dymbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j","a",2{"symbols":["j",',"style.fontSize":16,"style.align":"left","style.fill":"#000000","style.fontWeight":"lighter",maxWidthLandscape:307,maxWidthPortrait:307,breakWords:!0}}]},{c:"Sprite",p:{x:242,y:48,"scale.x":5,"scale.y":.54,image:"ui/provability/input-fade.png"}}]}]},{c:"NineSlicePlane",p:{name:"last-game-client-seed",x:-189,y:77,image:"ui/provability/label-gray.png",width:120,height:44,leftWidth:7,rightWidth:7,topHeight:7,bottomHeight:7},":":[{c:"Label",p:{name:"label",x:13,y:13,text:"3454","style.fontSize":16,"style.align":"left","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:100}}]}]}]},{c:"Trigger",p:{name:"orientation-trigger",state:!0,pow:1,damp:.999,alphaShift:0,yShift:-198,isApplyInteractivity:!1},":":[{c:"Trigger",p:{dataPath:"this.parent.parent.parent.parent.parent.isVerified",invert:!0,alphaShift:0,xShift:-105,isApplyInteractivity:!1},":":[{c:"Button",p:{name:"provability-verify",y:300,image:"ui/provability/verify-btn.png",hoverImage:"ui/provability/verify-btn-h.png",onClick:"this.parent.parent.parent.parent.parent.parent.onVerifyClick",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{verticalAlign:"center","style.fontWeight":"lighter"},":":[{c:"Text",p:{translatableText:"provability.verify","style.fontSize":23,verticalAlign:"center","style.fontWeight":"lighter",textTransform:1,maxWidth:149}}]}]}]},{c:"Trigger",p:{dataPath:"this.parent.parent.parent.parent.parent.isVerified"},":":[{c:"Trigger",p:{dataPath:"this.parent.parent.parent.parent.parent.parent.isVerificationSuccess"},":":[{c:"Text",p:{x:95,y:260,translatableText:"provability.messages.successful_verification","style.fontSize":17,"style.fill":"#0edc17","style.fontWeight":"lighter",textTransform:1,maxWidth:185}},{c:"MultilineText",p:{x:95,y:281,translatableText:"provability.messages.success_message","style.fontSize":15,"style.fontWeight":"lighter",maxWidthLandscape:186,maxWidthPortrait:186}}]},{c:"Trigger",p:{dataPath:"this.parent.parent.parent.parent.parent.parent.isVerificationSuccess",invert:!0},":":[{c:"Text",p:{x:95,y:260,translatableText:"provability.messages.failed_verification","style.fontSize":17,"style.fill":"#ff0303","style.fontWeight":"lighter",textTransform:1,maxWidth:185}},{c:"MultilineText",p:{x:95,y:281,translatableText:"provability.messages.error_message","style.fontSize":15,"style.fontWeight":"lighter",maxWidthLandscape:186,maxWidthPortrait:186}}]}]}]}]}]},{c:"Button",p:{name:"provability-close-btn-container",x:440,"pivot.x":32,"pivot.y":-32,image:"ui/close-btn.png",hoverImage:"ui/close-btn-h.png",pressImage:"ui/close-btn-p.png",disabledImage:"EMPTY",onClick:"this.parent.parent.hide",hotkey:27,sndClick:"click",sndOver:"over"}}]}]},"thing-games-utils/provability-seed":{c:"Container",p:{name:"thing-games-utils/provability-seed"},":":[{c:"Container",p:{name:"client-seed-controls","scale.x":.8,"scale.y":.8},":":[{c:"Container",p:{name:"1",x:-200,y:25},":":[{c:"Label",p:{y:-62,alpha:.5,translatableText:"provability.reel_count","style.fontSize":25,verticalAlign:"bottom",maxWidth:94,dataPath:"this.parent.name"}},{c:"NumberInput",p:{name:"clien-seed-input",max:9,textView:"provability-count-text",dataPath:"game.data.provability.clientSeed.0",wrapValue:!0},":":[{c:"Sprite",p:{"pivot.x":30,"pivot.y":22,image:"ui/provability/counter-bg.png"}}]},{c:"Button",p:{name:"provability-seed-decrease",y:40,rotation:-3.141592653589793,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.decrease",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}},{c:"Button",p:{name:"provability-seed-increase",y:-40,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.increase",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}}]},{c:"Container",p:{name:"2",x:-100,y:25},":":[{c:"Label",p:{y:-62,alpha:.5,translatableText:"provability.reel_count","style.fontSize":25,verticalAlign:"bottom",maxWidth:94,dataPath:"this.parent.name"}},{c:"NumberInput",p:{name:"clien-seed-input",max:9,textView:"provability-count-text",dataPath:"game.data.provability.clientSeed.1",wrapValue:!0},":":[{c:"Sprite",p:{"pivot.x":30,"pivot.y":22,image:"ui/provability/counter-bg.png"}}]},{c:"Button",p:{name:"provability-seed-decrease",y:40,rotation:-3.141592653589793,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.decrease",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}},{c:"Button",p:{name:"provability-seed-increase",y:-40,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.increase",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}}]},{c:"Container",p:{name:"3",y:25},":":[{c:"Label",p:{y:-62,alpha:.5,translatableText:"provability.reel_count","style.fontSize":25,verticalAlign:"bottom",maxWidth:94,dataPath:"this.parent.name"}},{c:"NumberInput",p:{name:"clien-seed-input",max:9,textView:"provability-count-text",dataPath:"game.data.provability.clientSeed.2",wrapValue:!0},":":[{c:"Sprite",p:{"pivot.x":30,"pivot.y":22,image:"ui/provability/counter-bg.png"}}]},{c:"Button",p:{name:"provability-seed-decrease",y:40,rotation:-3.141592653589793,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.decrease",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}},{c:"Button",p:{name:"provability-seed-increase",y:-40,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.increase",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}}]},{c:"Container",p:{name:"4",x:100,y:25},":":[{c:"Label",p:{y:-62,alpha:.5,translatableText:"provability.reel_count","style.fontSize":25,verticalAlign:"bottom",maxWidth:94,dataPath:"this.parent.name"}},{c:"NumberInput",p:{name:"clien-seed-input",max:9,textView:"provability-count-text",dataPath:"game.data.provability.clientSeed.3",wrapValue:!0},":":[{c:"Sprite",p:{"pivot.x":30,"pivot.y":22,image:"ui/provability/counter-bg.png"}}]},{c:"Button",p:{name:"provability-seed-decrease",y:40,rotation:-3.141592653589793,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.decrease",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}},{c:"Button",p:{name:"provability-seed-increase",y:-40,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.increase",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}}]},{c:"Container",p:{name:"5",x:200,y:25},":":[{c:"Label",p:{y:-62,alpha:.5,translatableText:"provability.reel_count","style.fontSize":25,verticalAlign:"bottom",maxWidth:94,dataPath:"this.parent.name"}},{c:"NumberInput",p:{name:"clien-seed-input",max:9,textView:"provability-count-text",dataPath:"game.data.provability.clientSeed.4",wrapValue:!0},":":[{c:"Sprite",p:{"pivot.x":30,"pivot.y":22,image:"ui/provability/counter-bg.png"}}]},{c:"Button",p:{name:"provability-seed-decrease",y:40,rotation:-3.141592653589793,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.decrease",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}},{c:"Button",p:{name:"provability-seed-increase",y:-40,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.increase",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}}]}]},{c:"Label",p:{name:"game-provability-tip",y:-70,alpha:.5,translatableText:"provability.enter_client_seed","style.fontSize":22,verticalAlign:"center","style.fontWeight":"lighter","style.leading":4,maxWidth:376,dataPath:"game.data.provability.seedLimits",refreshInterval:1e3}}]},"thing-games-utils/reality-check-popup":{c:"RealityCheckPopup",p:{name:"thing-games-utils/reality-check-popup",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop",interactive:!0,"scale.x":120,"scale.y":67.5,image:"WHITE",tint:0,timeline:{l:{close:15},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:.7,t:7,m:1,a:"this.stop"},{v:.7,t:15,m:1},{v:0,t:23,m:1,a:"this.stop"}]}]}}}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{close:20},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1,a:"this.stop"},{v:1,t:20},{v:0,t:30,a:"this.parent.hidePopup"}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1},{v:1,t:20},{v:0,t:30,a:"this.stop"}]}]}},":":[{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.4,isApplyInteractivity:!1},":":[{c:"Shape",p:{x:-255,y:-380,width:510,height:755,shapeFillColor:5460819}},{c:"Shape",p:{x:-255,y:-380,width:510,height:15,shapeFillColor:10987431}},{c:"Text",p:{y:-292,translatableText:"reality_check.reality_check","style.fontSize":41,verticalAlign:"center",maxWidth:446}},{c:"MultilineText",p:{y:-242,translatableText:"reality_check.description","style.fontSize":23,"style.leading":4,maxWidthLandscape:450,maxWidthPortrait:450,maxHeightLandscape:135,maxHeightPortrait:135}},{c:"Text",p:{x:-221,y:-90,translatableText:"reality_check.session_time","style.fontSize":29,"style.align":"left",verticalAlign:"center",maxWidth:233}},{c:"Label",p:{name:"sessionTimeLable",x:220,y:-90,translatableText:"reality_check.minutes","style.fontSize":29,"style.align":"right",verticalAlign:"center","style.fontWeight":"bold",maxWidth:200,dataPath:"this.parent.parent.parent.sessionTime",isNumeric:!0}},{c:"Shape",p:{x:-221,y:-60,width:440,height:2,shapeFillColor:10987431}},{c:"Text",p:{x:-221,y:-30,translatableText:"reality_check.bets","style.fontSize":29,"style.align":"left",verticalAlign:"center",maxWidth:135}},{c:"MoneyLabel",p:{name:"sessionBetsLable",x:220,y:-30,text:"%d %s","style.fontSize":29,"style.align":"right",verticalAlign:"center","style.fontWeight":"bold",maxWidth:200,dataPath:"this.parent.parent.parent.sessionBets",template:"%d %s",dataPath2:"data.currency",decimalsCountPath:"data.balanceDigitsCount"}},{c:"Shape",p:{x:-221,y:1,width:440,height:2,shapeFillColor:10987431}},{c:"Text",p:{x:-221,y:33,translatableText:"reality_check.win","style.fontSize":29,"style.align":"left",verticalAlign:"center",maxWidth:135}},{c:"MoneyLabel",p:{name:"sessionWonLable",x:220,y:32,text:"%d %s","style.fontSize":29,"style.align":"right",verticalAlign:"center","style.fontWeight":"bold",maxWidth:200,dataPath:"this.parent.parent.parent.sessionWin",template:"%d %s",dataPath2:"data.currency",decimalsCountPath:"data.balanceDigitsCount"}},{c:"Shape",p:{x:-221,y:65,width:440,height:2,shapeFillColor:10987431}},{c:"Text",p:{x:-221,y:94,translatableText:"reality_check.lose","style.fontSize":29,"style.align":"left",verticalAlign:"center",maxWidth:135}},{c:"MoneyLabel",p:{name:"sessionLoseLable",x:220,y:93,text:"%d %s","style.fontSize":29,"style.align":"right",verticalAlign:"center","style.fontWeight":"bold",maxWidth:200,dataPath:"this.parent.parent.parent.sessionLose",template:"%d %s",dataPath2:"data.currency",decimalsCountPath:"data.balanceDigitsCount"}},{c:"Button",p:{name:"rc-close-button",x:217,y:-327,image:"reality-check/rc-popup-close-btn.png",onClick:"this.parent.parent.parent.onContinue",sndClick:"click",sndOver:"over"}},{c:"Trigger",p:{y:-18,dataPath:"casinoOptions.history_url",pow:1,damp:0},":":[{c:"Button",p:{name:"rc-history-button",y:153,onClick:"SharedAPI.openHistory",sndClick:"click",sndOver:"over"},":":[{c:"Shape",p:{x:-220,width:440,height:61,shapeFillColor:10987431}},{c:"Text",p:{y:30,translatableText:"reality_check.view_history","style.fontSize":30,verticalAlign:"center",textTransform:1,maxWidth:420}}]}]},{c:"Button",p:{name:"rc-leave-button",y:215,onClick:"this.parent.parent.parent.onLeaveTheGame",sndClick:"click",sndOver:"over"},":":[{c:"Shape",p:{x:-220,width:440,height:61,shapeFillColor:10987431}},{c:"Text",p:{y:30,translatableText:"reality_check.leave_the_game","style.fontSize":30,verticalAlign:"center",textTransform:1,maxWidth:420}}]},{c:"Button",p:{name:"rc-continue-button",y:291,onClick:"this.parent.parent.parent.onContinue",sndClick:"click",sndOver:"over"},":":[{c:"Shape",p:{x:-220,width:440,height:66}},{c:"Text",p:{y:30,translatableText:"reality_check.continue","style.fontSize":30,verticalAlign:"center",textTransform:1,maxWidth:420}}]}]}]}]},"thing-games-utils/safari-arrow-up":{c:"SafariArrowUp",p:{name:"thing-games-utils/safari-arrow-up"},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"Sprite",p:{alpha:.75,interactive:!0,"scale.x":120,"scale.y":67.5,image:"WHITE",tint:0}}]},{c:"Resizer",p:{"scale.x":1.5,"scale.y":1.5,relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"MovieClip",p:{image:"ui/arrow-up.png",timeline:{l:{},p:.02,d:.85,f:[{n:"y",t:[{v:-35,t:0},{v:-35,t:25},{v:-57,t:36},{v:-57,t:52},{v:-35,t:72,j:0}]}]}}},{c:"MovieClip",p:{x:56,image:"ui/hand.png",timeline:{l:{},p:.012,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:1,t:13,m:1},{v:1,t:45,m:1},{v:0,t:59,m:1},{v:0,t:72,m:1,j:0}]},{n:"scale.y",t:[{v:2,t:0},{v:1,t:14,m:1},{v:1,t:47,m:1},{v:2,t:72,j:0,m:1}]},{n:"scale.x",t:[{v:2,t:0},{v:1,t:14,m:1},{v:1,t:47,m:1},{v:2,t:72,j:0,m:1}]},{n:"y",t:[{v:130,t:0},{v:130,t:1,m:2},{v:130,t:21},{v:-99,t:60},{v:130,t:72,j:0}]}]}}}]}]},"thing-games-utils/snd-mus-button":{c:"ClickOutsideTrigger",p:{name:"thing-games-utils/snd-mus-button",x:-45,y:45,onClickOutside:"this.#volume-show.hide"},":":[{c:"Trigger",p:{name:"volume-show","scale.x":1.3,"scale.y":1.3,pow:.10200000000000002,damp:.749,scaleShift:-.5100000000000003},":":[{c:"NineSlicePlane",p:{x:-141,y:-32,alpha:.96,interactive:!0,"scale.x":.8,"scale.y":.8,image:"ui/panel.png",width:215,height:420,leftWidth:38,rightWidth:38,topHeight:38,bottomHeight:38}},{c:"ProgressBar",p:{x:9,y:241,rotation:-3.141592653589793,interactive:!0,dataPath:"game.Sound.soundsVol",refreshInterval:1,afterSlide:"game.Sound.play`click",max:1,step:.01},":":[{c:"Sprite",p:{name:"bg",x:-22,alpha:.2,"scale.y":1.0101010101010102,image:"ui/bar-mask.png"}},{c:"Fill",p:{name:"bar",x:-22,image:"ui/bar-mask.png"}},{c:"Container",p:{name:"cap",x:14,y:-200}}]},{c:"ProgressBar",p:{x:-69,y:241,rotation:-3.141592653589793,interactive:!0,dataPath:"game.Sound.musicVol",refreshInterval:1,afterSlide:"game.Sound.play`click",max:1,step:.01},":":[{c:"Sprite",p:{name:"bg",x:-22,alpha:.2,"scale.y":1.0101010101010102,image:"ui/bar-mask.png"}},{c:"Fill",p:{name:"bar",x:-22,image:"ui/bar-mask.png"}},{c:"Container",p:{name:"cap",x:14,y:-200}}]},{c:"Trigger",p:{x:-13,y:271,dataPath:"game.Sound.soundEnabled",invert:!0,pow:.06,damp:.8,scaleShift:-.5},":":[{c:"Button",p:{name:"snd toggle btn",hoverImage:"EMPTY",pressImage:"EMPTY",onClick:"game.Sound.toggleSounds",sndClick:"click",sndOver:"over"},":":[{c:"MovieClip",p:{alpha:.6900000000000001,image:"ui/snd-off.png",isPlaying:!1,timeline:{l:{"btn-over":2,"btn-out":53},p:.02,d:.85,f:[{n:"alpha",t:[{v:.6900000000000001,t:0,m:1},{v:1,t:7,m:1,a:"this.stop"},{v:1,t:49,m:1},{v:.7,t:59,m:1,a:"this.stop"}]}]}}}]}]},{c:"Trigger",p:{x:-13,y:271,dataPath:"game.Sound.soundEnabled",pow:.06,damp:.8,scaleShift:-.5},":":[{c:"Button",p:{name:"snd toggle btn",hoverImage:"EMPTY",pressImage:"EMPTY",onClick:"game.Sound.toggleSounds",sndClick:"click",sndOver:"over"},":":[{c:"MovieClip",p:{alpha:.6900000000000001,image:"ui/snd-on.png",isPlaying:!1,timeline:{l:{"btn-over":2,"btn-out":53},p:.02,d:.85,f:[{n:"alpha",t:[{v:.6900000000000001,t:0,m:1},{v:1,t:7,m:1,a:"this.stop"},{v:1,t:49,m:1},{v:.7,t:59,m:1,a:"this.stop"}]}]}}}]}]},{c:"Trigger",p:{x:-91,y:271,dataPath:"game.Sound.musicEnabled",invert:!0,pow:.06,damp:.8,scaleShift:-.5},":":[{c:"Button",p:{name:"snd toggle btn",hoverImage:"EMPTY",pressImage:"EMPTY",onClick:"game.Sound.toggleMusic",sndClick:"click",sndOver:"over"},":":[{c:"MovieClip",p:{alpha:.6900000000000001,image:"ui/mus-off.png",isPlaying:!1,timeline:{l:{"btn-over":2,"btn-out":53},p:.02,d:.85,f:[{n:"alpha",t:[{v:.6900000000000001,t:0,m:1},{v:1,t:7,m:1,a:"this.stop"},{v:1,t:49,m:1},{v:.7,t:59,m:1,a:"this.stop"}]}]}}}]}]},{c:"Trigger",p:{x:-91,y:271,dataPath:"game.Sound.musicEnabled",pow:.06,damp:.8,scaleShift:-.5},":":[{c:"Button",p:{name:"snd toggle btn",hoverImage:"EMPTY",pressImage:"EMPTY",onClick:"game.Sound.toggleMusic",sndClick:"click",sndOver:"over"},":":[{c:"MovieClip",p:{alpha:.6900000000000001,image:"ui/mus-on.png",isPlaying:!1,timeline:{l:{"btn-over":2,"btn-out":53},p:.02,d:.85,f:[{n:"alpha",t:[{v:.6900000000000001,t:0,m:1},{v:1,t:7,m:1,a:"this.stop"},{v:1,t:49,m:1},{v:.7,t:59,m:1,a:"this.stop"}]}]}}}]}]}]},{c:"Button",p:{hoverImage:"EMPTY",pressImage:"EMPTY",disabledImage:"EMPTY",onClick:"all.volume-show.toggle",sndClick:"click",sndOver:"over"},":":[{c:"Trigger",p:{dataPath:"classes.MainMenu.anySoundEnabled",invert:!0,pow:.06,damp:.8,scaleShift:-.5},":":[{c:"MovieClip",p:{image:"ui/snd-b-off.png",isPlaying:!1,timeline:{l:{"btn-over":7,"btn-out":44},p:.02,d:.85,f:[{n:"image",t:[{v:"ui/snd-b-off.png",t:0,m:2},{v:"ui/snd-b-off-h.png",t:8,m:2,a:"this.stop"},{v:"ui/snd-b-off.png",t:45,m:2}]}]}}}]},{c:"Trigger",p:{dataPath:"classes.MainMenu.anySoundEnabled",pow:.06,damp:.8,scaleShift:-.5},":":[{c:"MovieClip",p:{image:"ui/snd-b-on.png",isPlaying:!1,timeline:{l:{"btn-out":44,"btn-over":7},p:.02,d:.85,f:[{n:"image",t:[{v:"ui/snd-b-on.png",t:0,m:2},{v:"ui/snd-b-on-h.png",t:8,m:2,a:"this.stop"},{v:"ui/snd-b-on.png",t:45,m:2}]}]}}}]},{c:"Shape",p:{name:"hit-area",x:-66,y:-56,alpha:.46,width:121,height:119,isItHitArea:!0}}]}]},"thing-games-utils/sure-question":{c:"Resizer",p:{name:"thing-games-utils/sure-question",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop","scale.x":192,"scale.y":108,timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:.01,t:0,m:1},{v:1,t:7,m:1}]}]}},":":[{c:"Button",p:{name:"easyCloseBtn",alpha:.7000000000000001,interactive:!1,"scale.x":.625,"scale.y":.625,image:"WHITE",tint:40,hoverImage:"WHITE",pressImage:"WHITE",disabledImage:"WHITE",hotkey:27,sndClick:"click",sndOver:"over"}}]}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]}]}},":":[{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{x:-200,y:-173,interactive:!0,image:"ui/panel.png",width:400,height:271,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25}},{c:"Text",p:{name:"title",y:-138,alpha:.8,text:"TITLE","style.fontSize":26,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:250}},{c:"MultilineText",p:{name:"message",y:-62,alpha:.7,text:"qw qwe qwe q weq weqwe qweqwe eqwe qwe qwe qwe qwe qwe qw eqw e","style.fontSize":22,verticalAlign:"center","style.fontWeight":"lighter",maxWidthLandscape:340,maxWidthPortrait:340,maxHeightLandscape:130,maxHeightPortrait:130}},{c:"Button",p:{name:"okBtn",x:100,y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"noBtn",x:-100,y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",text:"--","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Sprite",p:{name:"alert-icon",x:-197,y:-182,image:"ui/alert-icon.png"}}]}]}]},"thing-games-utils/sure-question700":{c:"Resizer",p:{name:"thing-games-utils/sure-question700",relativeX:!0,xPos:.5,relativeY:!0,yPos:.5},":":[{c:"Resizer",p:{resizeX:!0,resizeY:!0},":":[{c:"MovieClip",p:{name:"backdrop","scale.x":192,"scale.y":108,image:"WHITE",tint:40,timeline:{l:{},p:.02,d:.85,f:[{n:"alpha",t:[{v:0,t:0,m:1},{v:.7,t:7,m:1}]}]}}}]},{c:"MovieClip",p:{name:"main",tint:0,timeline:{l:{},p:.06,d:.73,f:[{n:"scale.x",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]},{n:"scale.y",t:[{v:0,t:0},{v:1,t:12},{v:1,t:16,m:1}]}]}},":":[{c:"Trigger",p:{dataPath:"isMobile.any",invert:!0,pow:1,alphaShift:0,scaleShift:.7,isApplyInteractivity:!1},":":[{c:"NineSlicePlane",p:{x:-300,y:-173,alpha:.9,interactive:!0,image:"ui/panel.png",width:600,height:271,leftWidth:25,rightWidth:25,topHeight:25,bottomHeight:25}},{c:"Text",p:{name:"title",y:-138,alpha:.8,text:"TITLE","style.fontSize":26,verticalAlign:"center","style.fontWeight":"lighter",maxWidth:540}},{c:"MultilineText",p:{name:"message",y:-62,alpha:.7,text:"qw qwe qwe q weq weqwe qweqwe eqwe qwe qwe qwe qwe qwe qw eqw e","style.fontSize":22,verticalAlign:"center","style.fontWeight":"lighter",maxWidthLandscape:540,maxWidthPortrait:540,maxHeightLandscape:130,maxHeightPortrait:130}},{c:"Button",p:{name:"btn",x:-170,y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"btn",y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]},{c:"Button",p:{name:"btn",x:170,y:40,"scale.x":.666666,"scale.y":.666666,image:"ui/btn-long.png",hoverImage:"ui/btn-long-h.png",pressImage:"ui/btn-long.png",disabledImage:"ui/btn-long.png",sndClick:"click",sndOver:"over"},":":[{c:"Text",p:{name:"label",translatableText:"buttons.ok","style.fontSize":45,verticalAlign:"center","style.fill":"#000000","style.fontWeight":"lighter",maxWidth:173}}]}]}]}]},"ui/game-provability":{c:"Container",p:{name:"ui/game-provability"},":":[{c:"Container",p:{name:"client-seed-controls"},":":[{c:"Container",p:{},":":[{c:"NumberInput",p:{name:"clien-seed-input",y:35,max:16,textView:"provability-count-text",dataPath:"game.data.provability.clientSeed.0",wrapValue:!0},":":[{c:"Sprite",p:{"pivot.x":30,"pivot.y":22,image:"ui/provability/counter-bg.png"}}]},{c:"Button",p:{x:-43,y:35,rotation:-1.5707963267948966,"scale.x":.72,"scale.y":.72,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.decrease",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}},{c:"Button",p:{x:43,y:35,rotation:1.5707963267948966,"scale.x":.72,"scale.y":.72,image:"ui/provability/counter-btn.png",hoverImage:"ui/provability/counter-btn-h.png",disabledImage:"ui/provability/counter-btn-d.png",onClick:"this.parent.#clien-seed-input.increase",sndClick:"click",sndOver:"over",repeatDelay:21,repeatInterval:7}}]}]},{c:"Label",p:{name:"game-provability-tip",y:-26,translatableText:"plinko.provability","style.fontSize":20,verticalAlign:"center","style.leading":4,maxWidth:376,dataPath:"game.data.provability.seedLimits",refreshInterval:1e3}}]},"ui/html-popup":{c:"PrefabReference",p:{name:"ui/html-popup",prefabName:"thing-games-utils/html-popup"}},"ui/sure-question":{c:"PrefabReference",p:{name:"ui/sure-question",prefabName:"thing-games-utils/sure-question"}},"ui/ui-panel":{c:"Container",p:{name:"ui/ui-panel"},":":[{c:"Resizer",p:{name:"top-middle",relativeX:!0,xPos:.5},":":[{c:"OrientationTrigger",p:{landscapeY:16,portraitY:16,portraitAlpha:0},":":[{c:"Sprite",p:{y:57,"scale.x":.5,"scale.y":.5,"pivot.x":204,"pivot.y":118,image:"ui/logo.png"},":":[{c:"Trigger",p:{dataPath:"game.casinoOptions.ui.logo_visible",isApplyInteractivity:!1},":":[{c:"Sprite",p:{x:284,y:188,alpha:.4,"scale.x":.5,"scale.y":.5,image:"ui/brand-logo.png"}}]}]}]}]},{c:"Trigger",p:{name:"ios-safari-fix",dataPath:"game.isLandscapeSafariIos",invert:!0,pow:1,alphaShift:0,yShift:80,isApplyInteractivity:!1},":":[{c:"Trigger",p:{x:44,y:44,dataPath:"game.casinoOptions.ui.home_button",pow:1},":":[{c:"Button",p:{image:"ui/home.png",hoverImage:"ui/home-h.png",pressImage:"ui/home.png",disabledImage:"ui/home.png",onClick:"SharedAPI.gotoHome",sndClick:"click",sndOver:"over"}},{c:"Label",p:{name:"time-label",x:62,y:-3,text:"15:46","style.fontSize":22,"style.align":"left",verticalAlign:"center","style.letterSpacing":1,dataPath:"game.currentScene.currentTime",refreshInterval:120,counterSpeed:.259,decimalsCount:2}}]},{c:"Resizer",p:{name:"right-top",relativeX:!0,xPos:1,relativeY:!0},":":[{c:"Button",p:{x:-134,y:44,image:"ui/help-btn.png",hoverImage:"ui/help-btn-h.png",pressImage:"ui/help-btn.png",disabledImage:"EMPTY",onClick:"game.currentScene.showRules",sndClick:"click",sndOver:"over"}},{c:"Trigger",p:{dataPath:"all.provability-panel.data"},":":[{c:"Trigger",p:{x:-90,dataPath:"casinoOptions.history_url",pow:1,damp:0,alphaShift:0,xShift:90,isApplyInteractivity:!1},":":[{c:"Button",p:{name:"provability-btn",x:-224,y:44,image:"ui/provability/provability-btn.png",hoverImage:"ui/provability/provability-btn-h.png",pressImage:"ui/provability/provability-btn.png",disabledImage:"EMPTY",onClick:"all.provability-panel.toggle",sndClick:"click",sndOver:"over"}}]}]},{c:"Trigger",p:{dataPath:"casinoOptions.history_url",pow:1,damp:0},":":[{c:"Button",p:{name:"provability-btn",x:-224,y:44,image:"ui/history-btn.png",hoverImage:"ui/history-btn-h.png",pressImage:"ui/history-btn.png",disabledImage:"EMPTY",onClick:"SharedAPI.openHistory",sndClick:"click",sndOver:"over"}}]},{c:"PrefabReference",p:{x:-44,y:44,prefabName:"thing-games-utils/snd-mus-button"}}]}]},{c:"PrefabReference",p:{name:"provability-panel",y:5684341886080802e-29,prefabName:"thing-games-utils/provability-panel"}}]}},images:{"ui/provability/counter-bg.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/provability/counter-btn-d.png":{e:".png_90_90.webp",f_e:".f.png_80_90.png"},"ui/provability/counter-btn-h.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/counter-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/input-fade-yellow.png":{e:".png_80_90.png"},"ui/provability/input-fade.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/input-gray.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/input-yellow.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/label-gray.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/provability/verify-btn-h.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/verify-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"distortion_map.png":{e:".png_100_100.webp",f_e:".f.png"},"reality-check/rc-popup-close-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"round_gradient.png":{e:".png_100_100.webp",f_e:".f.png_80_90.png"},"ui/alert-icon.png":{e:".png_80_90.png"},"ui/arrow-up.png":{e:".png_80_80.webp",f_e:".f.png_80_90.png"},"ui/bar-mask.png":{e:".png_100_100.webp",f_e:".f.png_80_90.png"},"ui/brand-logo.png":{e:".png_80_90.png"},"ui/close-btn-h.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/close-btn-p.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/close-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/hand.png":{e:".png_80_90.png"},"ui/mus-off.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/mus-on.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/panel.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/scroller.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/snd-off.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/snd-on.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/spinner.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"WHITE_FOR_CANVAS.jpg":{e:".jpg_100_100.webp",f_e:".f.jpg"},"ui/play-btn-h.png":{e:".png_80_80.webp",f_e:".f.png_80_90.png"},"ui/play-btn.png":{e:".png_80_80.webp",f_e:".f.png_90_100.png"},"ui/profit-bg.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/provability/provability-btn-h.png":{e:".png_80_90.png"},"ui/provability/provability-btn.png":{e:".png_80_90.png"},"ui/select-btn-d.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/select-btn-h.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/select-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/small-btn-d.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/small-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/snd-b-off-h.png":{e:".png_80_90.png"},"ui/snd-b-off.png":{e:".png_80_90.png"},"ui/snd-b-on-h.png":{e:".png_80_90.png"},"ui/snd-b-on.png":{e:".png_80_90.png"},"ui/spark.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/star.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/stars-pattern.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/target-overlay.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/target.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/tooltip-pointer.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/tooltip.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/win-panel.png":{e:".png_80_90.png"},"bg/bg.jpg":{e:".jpg_80_80.webp",f_e:".f.jpg"},"ui/arrow-tabl-left.png":{e:".png_80_80.webp",f_e:".f.png_80_90.png"},"ui/auto-icon.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/ball.png":{e:".png_80_80.webp",f_e:".f.png_80_90.png"},"ui/bet-btn-h.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/bet-btn.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/btn-long-h.png":{e:".png_80_80.webp",f_e:".f.png_80_90.png"},"ui/btn-long.png":{e:".png_80_80.webp",f_e:".f.png_80_90.png"},"ui/close.png":{e:".png_100_100.webp",f_e:".f.png_80_90.png"},"ui/counter-bg.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/counter-btn-h.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/counter-btn.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/fullscreen.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/help-btn-h.png":{e:".png_80_90.png"},"ui/help-btn.png":{e:".png_80_90.png"},"ui/history-btn-h.png":{e:".png_80_90.png"},"ui/history-btn.png":{e:".png_80_90.png"},"ui/hole.png":{e:".png_80_90.png"},"ui/home-h.png":{e:".png_80_90.png"},"ui/home.png":{e:".png_80_90.png"},"ui/light.png":{e:".png_80_90.png"},"ui/line.png":{e:".png_100.webp",f_e:".f.png_90_100.png"},"ui/logo.png":{e:".png_90_100.png"},"ui/lvl-high-icon.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/lvl-low-icon.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/lvl-mid-icon.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/manual-icon.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/panel-ui.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/particle.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"ui/pin.png":{e:".png_100.webp",f_e:".f.png_80_90.png"},"bg/bg-flowers.png":{e:".png_80_90.png"},"bg/bg-ui.png":{e:".png_100.webp",f_e:".f.png_90_100.png"}},resources:{},sounds:{"ball2/2":["ball2/2.ogg","ball2/2.aac",.320862],big_win:["big_win.ogg","big_win.aac",.56449],click:["click.ogg","click.aac"],"mus/bg":["mus/bg.ogg","mus/bg.aac",99.548367],over:["over.ogg","over.aac"],play:["play.ogg","play.aac",.771338],win_sound:["win_sound.ogg","win_sound.aac",.469093]},projectDesc:{mainScene:"root",renderResolution:2,renderResolutionMobile:1,dynamicStageSize:!0,preventUpscale:!1,screenOrientation:"auto",defaultFont:"'Roboto', Arial",soundFormats:["ogg","aac"],width:1920,height:1080,portraitWidth:607,portraitHeight:1080,webfontloader:{google:{families:["Roboto:400,700:cyrillic"]},timeout:6e3},loadOnDemandSounds:{},muteOnFocusLost:!0,version:"0.0.1",framesSkipLimit:10,embedLocales:!1,loadOnDemandTextures:{"ui/stars-pattern.png":8},autoFullscreenDesktop:!1,autoFullscreenMobile:!0,soundDefaultBitrate:64,soundBitrates:{},defaultLanguage:"en",fontHolderText:"ЯSфz",mipmap:!1,defaultMusVol:1,defaultSoundsVol:1,keepSoundWhilePageUpdate:!1,slotPhrasesPrefix:"phrases.",jpgQuality:95,pngQuality:[.95,1],errorPhrasesPrefix:"errors.",title:"plinko",id:"plinko.softswiss.com",icon:"../../shared/img/ui/logo.png",assetsDelimiter:"\t",libs:["thing-games-utils/common","thing-games-utils/casual","thing-games-utils/provability","../../shared"]},resourceImages:{}}},7119:(t,e,i)=>{"use strict";var r=i(9135),n=i(5222),a=i(2468),s=i(9443),o=i(9080),l=i(1233);class h extends l.NineSlicePlane{constructor(){super(r.A.getTexture("WHITE"),3,3,3,3)}}var u=i(4222),c=i(1233),p=2*Math.PI,d="\n\n\tprecision mediump float;\n\n\tattribute vec2 aVertexPosition;\n\tattribute float aColor;\n\tattribute vec2 aTextureCoord;\n\n\tuniform mat3 translationMatrix;\n\tuniform mat3 projectionMatrix;\n\tuniform vec4 uColor;\n\n\tvarying vec2 vUvs;\n\tvarying vec4 vColor;\n\n\tvoid main() {\n\n\tvUvs = aTextureCoord;\n\tvColor = uColor * aColor;\n\tgl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n}",f="\n\n\tprecision mediump float;\n\n\tvarying vec4 vColor;\n\tvarying vec2 vUvs;\n\n\tuniform sampler2D uSampler;\n\n\tvoid main() {\n\n\tgl_FragColor = texture2D(uSampler, vUvs) * vColor;\n}";class g extends c.Mesh{constructor(t){t||(t=new c.MeshMaterial(c.Texture.WHITE,{program:c.Program.from(d,f)})),super(new c.PlaneGeometry(2,2,2,2),t),this.geometry.addAttribute("aColor",[0,0,1,1],1)}refreshSize(){var t=this.geometry;t.segWidth=this.verticesX,t.segHeight=this.verticesY,t.width=this.texture.width,t.height=this.texture.height,t.build(),this._applied_verticesX=this.verticesX,this._applied_verticesY=this.verticesY,this.updateFilling(),this.fillUpdated=!1,this.updateTransparency()}cropLeftRight(t,e){var i=this.texture.width;(t/=i)<0&&(t=0),(e/=i)<0&&(e=0),this.scale.x=Math.min(1,1-t-e),this.xRepeat=this.scale.x,this.xShift=t}cropTopBottom(t,e){var i=this.texture.height;(t/=i)<0&&(t=0),(e/=i)<0&&(e=0),this.scale.y=Math.min(1,1-t-e),this.yRepeat=this.scale.y,this.yShift=t}update(){0!==this.xShiftSpeed&&(this.xShift+=this.xShiftSpeed,s.A.isCanvasMode&&(this._xShift>2?this._xShift-=2:this._xShift<-2&&(this._xShift+=2))),0!==this.yShiftSpeed&&(this.yShift+=this.yShiftSpeed,s.A.isCanvasMode&&(this._yShift>2?this._yShift-=2:this._yShift<-2&&(this._yShift+=2))),0!==this.xWaveSpeed&&(this.xWavePhase+=this.xWaveSpeed,this._xWavePhase>p?this._xWavePhase-=p:this._xWavePhase<0&&(this._xWavePhase+=p)),0!==this.yWaveSpeed&&(this.yWavePhase+=this.yWaveSpeed,this._yWavePhase>p?this._yWavePhase-=p:this._yWavePhase<0&&(this._yWavePhase+=p)),super.update()}set texture(t){t!==super.texture&&(this.meshResized=this.meshResized||super.texture.width!==t.width||super.texture.height!==t.height,super.texture=t)}get texture(){return super.texture}render(t){this.validateFill(),super.render(t)}_renderCanvas(t){this.validateFill(),super._renderCanvas(t)}validateFill(){this.meshResized&&(this.refreshSize(),this.meshResized=!1),this.fillUpdated&&(this.updateFilling(),this.fillUpdated=!1),this.transparencyUpdated&&this.updateTransparency()}calculateVertices(){this.meshResized&&(this.refreshSize(),this.meshResized=!1),super.calculateVertices()}set transparentTop(t){this._transparentTop!==t&&(this._transparentTop=t,this.transparencyUpdated=!0)}get transparentTop(){return this._transparentTop}set transparentBottom(t){this._transparentBottom!==t&&(this._transparentBottom=t,this.transparencyUpdated=!0)}get transparentBottom(){return this._transparentBottom}set transparentLeft(t){this._transparentLeft!==t&&(this._transparentLeft=t,this.transparencyUpdated=!0)}get transparentLeft(){return this._transparentLeft}set transparentRight(t){this._transparentRight!==t&&(this._transparentRight=t,this.transparencyUpdated=!0)}get transparentRight(){return this._transparentRight}set alpha(t){super.alpha!==t&&(this.transparencyUpdated=!0,super.alpha=t)}get alpha(){return super.alpha}set tintR(t){super.tintR!==t&&(this.transparencyUpdated=!0,super.tintR=t)}get tintR(){return super.tintR}set verticesX(t){this._verticesX!==t&&(this._verticesX=t,this.meshResized=!0)}get verticesX(){return this._verticesX}set verticesY(t){this._verticesY!==t&&(this._verticesY=t,this.meshResized=!0)}get verticesY(){return this._verticesY}updateTransparency(){var t=this.verticesX*this.verticesY,e=this.geometry.buffers[3];e.data.length!==t&&(e.data=new Float32Array(t));for(var i=e.data,r=0;r=0;n--)i[n]=0;if(this.transparentBottom)for(var a=t-this.verticesX;a2){for(var e of(t=[],this._shapePoints))t.push(e.x,e.y);this.drawPolygon(t)}}}getHitareaShape(){if(!this._hitAreaCache)switch(this.shape){case v:this._hitAreaCache=new m.RoundedRectangle(this.x,this.y,this.width,this.height,this.shapeRadius);break;case A:this._hitAreaCache=new m.Rectangle(this.x,this.y,this.width,this.height);break;case y:this._hitAreaCache=new m.Circle(this.x,this.y,this.shapeRadius);break;case _:this._hitAreaCache=new m.Ellipse(this.x,this.y,this.width,this.height);break;case b:if(this._shapePoints.length>2){var t=[];for(var e of this._shapePoints)t.push(e.x+this.x,e.y+this.y);this._hitAreaCache=new m.Polygon(t)}}return this._hitAreaCache}applyHitAreaToParent(){this.parent.hitArea=this.getHitareaShape(),this.visible=!1}onRemove(){super.onRemove(),this.clear(),this.isItHitArea&&this.parent&&(this.parent.hitArea=null)}set shape(t){this._shape=t,this.__deserialized&&this._drawThing()}get shape(){return this._shape}set width(t){this._width=t,this.__deserialized&&this._drawThing()}get width(){return this._width}set height(t){this._height=t,this.__deserialized&&this._drawThing()}get height(){return this._height}set shapeRadius(t){this._shapeRadius=t,this.__deserialized&&this._drawThing()}get shapeRadius(){return this._shapeRadius}set shapeLineColor(t){this._lColor=t,this.__deserialized&&this._drawThing()}get shapeLineColor(){return this._lColor}set shapeFillColor(t){this._fColor=t,this.__deserialized&&this._drawThing()}get shapeFillColor(){return this._fColor}set shapeFillAlpha(t){this._fAlpha=t,this.__deserialized&&this._drawThing()}get shapeFillAlpha(){return this._fAlpha}set shapeLineAlpha(t){this._lAlpha=t,this.__deserialized&&this._drawThing()}get shapeLineAlpha(){return this._lAlpha}set shapeLineWidth(t){this._lWidth=t,this.__deserialized&&this._drawThing()}get shapeLineWidth(){return this._lWidth}set shapeLineAlignment(t){this._lAlignment=t,this.__deserialized&&this._drawThing()}get shapeLineAlignment(){return this._lAlignment}}var T=new(i(1233).Point);function E(t,e){t instanceof x||t instanceof h?t.height=e:t.texture&&(t.scale.y=e/t.texture.height,t instanceof g&&(t.yRepeat=t.scale.y))}class S extends n.A{constructor(){super()}init(){super.init(),this.scrolling=!1,this.currentInterval=0,this.showedVal=void 0,this.bar=this.findChildByName("bar"),this.cap=this.findChildByName("cap"),this.buttonMode=this.interactive,this.on("pointerdown",this.onDown),this._applyBgHeight()}get height(){return this._height||200}set height(t){this._height!==t&&(this._height=t,this.applyValue(this.showedVal||0),this._applyBgHeight())}_applyBgHeight(){var t=this.getChildByName("bg");t&&E(t,this._height)}onRemove(){super.onRemove(),this._height=void 0,this.bar=null,this.cap=null,this.removeListener("pointerdown",this.onDown)}onDown(){this.isCanBePressed&&(this.scrolling=!0)}update(){if(this.scrolling)if(s.A.mouse.click){var t=this.toLocal(s.A.mouse,s.A.stage,T,!0).y/this._height;t<0?t=0:t>1&&(t=1);var e=this.min+t*(this.max-this.min);this.step>0&&(e=Math.round(e/this.step)*this.step),this.applyValue(e),this.dataPath&&(0,a.W)(this.dataPath,e,this)}else this.scrolling=!1,this.afterSlide&&(0,u.A)(this.afterSlide,this);else if(this.currentInterval<=0&&this.dataPath){var i=(0,a.A)(this.dataPath,this);i||0===i?(i>this.max&&(i=this.max),i0&&e>r&&(i+=Math.round((e-r)/2),e=r);var n=s.A.H-this.getMarginTop()-this.getMarginBottom();if(this.x=i+this.containerMargin||0,this.y=this.getMarginTop()+this.containerMargin||0,this.bgNineSlicePlanePath){var o=(0,a.A)(this.bgNineSlicePlanePath,this);o&&(o.x=-this.containerMargin,o.y=-this.containerMargin,o.width=e,o.height=n)}if(this.scrollBarPath){var l=(0,a.A)(this.scrollBarPath,this);l&&(l.x=e-this.containerMargin,l.height=n-this.scrollBarBottomMargin)}if(this.scrollLayerPath){var h=(0,a.A)(this.scrollLayerPath,this);if(h){var u=h.visibleArea;if(u.w=e-2*this.containerMargin,u.h=n-2*this.containerMargin,h.fullArea.w=u.w,h.parent instanceof R){var c=h.parent.rect;c.w=u.w,c.h=u.h}var p=h.getChildByName("centralized-content");if(p&&(p.x=Math.round(u.w/2)),t){var d=h.findChildByName("bottom-edge");d&&(d.visible=!1,h.fullArea.h=h.toLocal(d,d.parent).y)}}}}getMarginLeftRight(){return(s.A.isPortrait?this.marginLeftRightPortrait:this.marginLeftRight)||0}getMarginTop(){return(s.A.isPortrait?this.marginTopPortrait:this.marginTop)||0}getMarginBottom(){return(s.A.isPortrait?this.marginBottomPortrait:this.marginBottom)||0}_onRenderResize(){this._applyLayout(),this.needApplyLayout=!0}}var O=i(6711),M=i(5622);class B{init(t,e,i,r){this.target=t,this.fieldName=e.n,this.timeline=e.t,this.pow=i,this.damper=r,this.reset()}reset(){this.time=0,this.currentFrame=this.timeline[0],this.currentFrame.hasOwnProperty("r")&&(this.time+=Math.round(Math.random()*this.currentFrame.r)),this.val=this.currentFrame.v,this.targetVal=this.val,this.speed=0,this.target[this.fieldName]=this.val}goto(t,e){if(this.time=t,this.currentFrame=e,1===e.m){var i=e.t-this.time;this.speed=i>0?(e.v-this.val)/i:0}else 2===e.m&&(this.speed=0)}update(){var t=this.currentFrame;if(this.time===t.t){var e;if(t.hasOwnProperty("a")&&(e=t.a),1!==t.m&&2!==t.m||(this.val=t.v),this.time=t.j,t.hasOwnProperty("r")&&(this.time+=Math.round(Math.random()*t.r)),0===t.m&&(this.speed+=(t.v-this.val)*this.pow,this.val+=this.speed,this.speed*=this.damper),t.hasOwnProperty("s")&&(this.speed=t.s),this.currentFrame=t=t.n,1===t.m){var i=t.t-this.time;this.speed=i>0?(t.v-this.val)/i:0}!!e&&(0,u.A)(e,this.target)}else 0===t.m?(this.speed+=(t.v-this.val)*this.pow,this.val+=this.speed,this.speed*=this.damper):1===t.m?this.val+=this.speed:3===t.m?(this.speed+=t.g,this.val+=this.speed,this.val>=t.v&&(this.val=t.v,this.speed*=-t.b)):4===t.m&&(this.speed-=t.g,this.val+=this.speed,this.val<=t.v&&(this.val=t.v,this.speed*=-t.b));this.time++,this.target[this.fieldName]=this.val}}class D extends O.A{constructor(){super(),this.fieldPlayers=[]}update(){if(this.isPlaying)if(this.delay>0)this.delay--;else{if(this._goToLabelNextFrame){var t=this._timelineData.l[this._goToLabelNextFrame];this._goToLabelNextFrame=!1;for(var e=this.fieldPlayers.length,i=0;ie)return r;i=r}return i}static _findPreviousKeyframe(t,e){var i;for(var r of t){if(r.t>e)return i;i=r}return i}static _deserializeTimelineData(t){var e=t.f.map((t=>{var e=t.t.map((t=>{var e=Object.assign({},t);return e.hasOwnProperty("j")||(e.j=e.t),e.hasOwnProperty("m")||(e.m=0),e}));for(var i of e)i.n=D._findNextKeyframe(e,i.j);return{n:t.n,t:e}})),i={},r=function(){var r=t.l[n],a=e.map((t=>D._findNextKeyframe(t.t,r-1)));i[n]={t:r,n:a}};for(var n in t.l)r();return{l:i,p:t.p,d:t.d,f:e}}_disposePlayers(){for(;this.fieldPlayers.length>0;)M.A.dispose(this.fieldPlayers.pop())}set timeline(t){if(this._goToLabelNextFrame=!1,this._disposePlayers(),null!==t){if(!L.has(t)){var e=D._deserializeTimelineData(t);!0&&L.set(t,e),t=e}else t=L.get(t);this._timelineData=t;for(var i=t.p,r=t.d,n=t.f,a=0;a1&&(this.appearingPhase=1),this.alpha=this.appearingPhase,this.scale.x=this.scale.y=this.ballSize*(.5+.5*this.appearingPhase),this.y=(j-X)*this.scale.x):this.path&&this.processBallLogic()}processBallLogic(){if(this.keepBallInServerPath(),this.processPinCollisions(),this.y>this.table.targets[0].y){var t,e=1e5,i=this.path[this.path.length-1],r=(i.min+i.max)/2;for(var n of this.table.targets){var a=Math.abs(r-n.x);athis.y){t=this.path[e];break}e++}t=t||this.path[this.path.length-1],this.xt.max&&(this.xSpeed=0,this.x=t.max)}}_playBallSound(t=1,e=1){this.ballId>=Q&&(Q=this.ballId),this.ballId>=Q-1&&(this.ballId===Q-1&&(t/=2),H.A.play("ball2/2",t,1,0,!0))}processPinCollisions(){var t=1;for(var e of this.table.lines){var i=e.y-this.y;if(Math.abs(i)5&&n.addChild(r.A.loadPrefab("pin-light")),c>1&&this._playBallSound(.07*c,t);var p=Math.sqrt(s),d=this.pinToBallCollizionRadius-p;d>0&&(c-=Math.min(V,d));var f=c*(1-Math.max(0,Math.abs(Math.cos(h)))*(1-Y));this.xSpeed=-Math.cos(u)*f,this.ySpeed=-Math.sin(u)*f;var g=Math.cos(o),m=Math.sin(o);if(this.x=n.x-g*this.pinToBallCollizionRadius,this.y=e.y-m*this.pinToBallCollizionRadius,e.y>this.y)return this.ySpeed+=g*g*V,void(this.xSpeed-=m*g*V)}return void(this.ySpeed+=V)}}t*=1.0594}this.ySpeed+=V,this.finalPitch=t}setBallData(t){this.findChildByName("particles-spawner").enable(),this.rollResult=t;var e=1;this.path=t.game.outcome.map(((t,i)=>{var r,n=this.table.lines[i];return r=t?{min:n.children[e].x+.2+Math.random(),max:n.children[e+1].x-.2-Math.random()}:{max:n.children[e].x-.2-Math.random(),min:n.children[e-1].x+.2+Math.random()},e+=t?1:0,r}))}}var K,J,$,tt=i(874),et=i(1232),it=i(808),rt=i(1707),nt=i(5055);function at(t){return t.type===J.literal}function st(t){return t.type===J.argument}function ot(t){return t.type===J.number}function lt(t){return t.type===J.date}function ht(t){return t.type===J.time}function ut(t){return t.type===J.select}function ct(t){return t.type===J.plural}function pt(t){return t.type===J.pound}function dt(t){return t.type===J.tag}function ft(t){return!(!t||"object"!=typeof t||t.type!==$.number)}function gt(t){return!(!t||"object"!=typeof t||t.type!==$.dateTime)}(function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(K||(K={})),function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(J||(J={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}($||($={}));var mt=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,At=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function vt(t){var e={};return t.replace(At,(function(t){var i=t.length;switch(t[0]){case"G":e.era=4===i?"long":5===i?"narrow":"short";break;case"y":e.year=2===i?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===i?"short":5===i?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][i-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][i-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][i-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][i-1];break;case"s":e.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}var yt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function _t(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=t.split(yt).filter((function(t){return t.length>0})),i=[],r=0,n=e;r1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(Et,(function(t,i,r,n,a,s){if(i)e.minimumIntegerDigits=r.length;else{if(n&&a)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(St.test(n.stem))e.minimumIntegerDigits=n.stem.length;else if(xt.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(xt,(function(t,i,r,n,a,s){return"*"===r?e.minimumFractionDigits=i.length:n&&"#"===n[0]?e.maximumFractionDigits=n.length:a&&s?(e.minimumFractionDigits=a.length,e.maximumFractionDigits=a.length+s.length):(e.minimumFractionDigits=i.length,e.maximumFractionDigits=i.length),""}));var a=n.options[0];"w"===a?e=(0,nt.__assign)((0,nt.__assign)({},e),{trailingZeroDisplay:"stripIfInteger"}):a&&(e=(0,nt.__assign)((0,nt.__assign)({},e),wt(a)))}else if(Tt.test(n.stem))e=(0,nt.__assign)((0,nt.__assign)({},e),wt(n.stem));else{var s=Pt(n.stem);s&&(e=(0,nt.__assign)((0,nt.__assign)({},e),s));var o=It(n.stem);o&&(e=(0,nt.__assign)((0,nt.__assign)({},e),o))}}return e}var Ot,Mt={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Bt(t,e){for(var i="",r=0;r>1),l="a",h=Dt(e);for("H"!=h&&"k"!=h||(o=0);o-- >0;)i+=l;for(;s-- >0;)i=h+i}else i+="J"===n?"H":n}return i}function Dt(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var i,r=t.language;return"root"!==r&&(i=t.maximize().region),(Mt[i||""]||Mt[r||""]||Mt["".concat(r,"-001")]||Mt["001"])[0]}var Lt=new RegExp("^".concat(mt.source,"*")),kt=new RegExp("".concat(mt.source,"*$"));function Nt(t,e){return{start:t,end:e}}var Ft=!!String.prototype.startsWith,Gt=!!String.fromCodePoint,Ut=!!Object.fromEntries,Ht=!!String.prototype.codePointAt,Xt=!!String.prototype.trimStart,jt=!!String.prototype.trimEnd,Wt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},Vt=!0;try{Vt="a"===(null===(Ot=$t("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Ot?void 0:Ot[0])}catch(Va){Vt=!1}var Yt,zt=Ft?function(t,e,i){return t.startsWith(e,i)}:function(t,e,i){return t.slice(i,i+e.length)===e},qt=Gt?String.fromCodePoint:function(){for(var t=[],e=0;ea;){if((i=t[a++])>1114111)throw RangeError(i+" is not a valid code point");r+=i<65536?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),i%1024+56320)}return r},Qt=Ut?Object.fromEntries:function(t){for(var e={},i=0,r=t;i=i)){var r,n=t.charCodeAt(e);return n<55296||n>56319||e+1===i||(r=t.charCodeAt(e+1))<56320||r>57343?n:r-56320+(n-55296<<10)+65536}},Kt=Xt?function(t){return t.trimStart()}:function(t){return t.replace(Lt,"")},Jt=jt?function(t){return t.trimEnd()}:function(t){return t.replace(kt,"")};function $t(t,e){return new RegExp(t,e)}if(Vt){var te=$t("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Yt=function(t,e){var i;return te.lastIndex=e,null!==(i=te.exec(t)[1])&&void 0!==i?i:""}}else Yt=function(t,e){for(var i=[];;){var r=Zt(t,e);if(void 0===r||ae(r)||se(r))break;i.push(r),e+=r>=65536?2:1}return qt.apply(void 0,i)};var ee=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,i){for(var r=[];!this.isEOF();){var n=this.char();if(123===n){if((a=this.parseArgument(t,i)).err)return a;r.push(a.val)}else{if(125===n&&t>0)break;if(35!==n||"plural"!==e&&"selectordinal"!==e){if(60===n&&!this.ignoreTag&&47===this.peek()){if(i)break;return this.error(K.UNMATCHED_CLOSING_TAG,Nt(this.clonePosition(),this.clonePosition()))}if(60===n&&!this.ignoreTag&&ie(this.peek()||0)){if((a=this.parseTag(t,e)).err)return a;r.push(a.val)}else{var a;if((a=this.parseLiteral(t,e)).err)return a;r.push(a.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:J.pound,location:Nt(s,this.clonePosition())})}}}return{val:r,err:null}},t.prototype.parseTag=function(t,e){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:J.literal,value:"<".concat(r,"/>"),location:Nt(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var n=this.parseMessage(t+1,e,!0);if(n.err)return n;var a=n.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:J.tag,value:r,children:a,location:Nt(i,this.clonePosition())},err:null}:this.error(K.INVALID_TAG,Nt(s,this.clonePosition())))}return this.error(K.UNCLOSED_TAG,Nt(i,this.clonePosition()))}return this.error(K.INVALID_TAG,Nt(i,this.clonePosition()))},t.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ne(this.char());)this.bump();return this.message.slice(t,this.offset())},t.prototype.parseLiteral=function(t,e){for(var i=this.clonePosition(),r="";;){var n=this.tryParseQuote(e);if(n)r+=n;else{var a=this.tryParseUnquoted(t,e);if(a)r+=a;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var o=Nt(i,this.clonePosition());return{val:{type:J.literal,value:r,location:o},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&re(this.peek()||0)?null:(this.bump(),"<")},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(39===i){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(i);this.bump()}return qt.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var i=this.char();return 60===i||123===i||35===i&&("plural"===e||"selectordinal"===e)||125===i&&t>0?null:(this.bump(),qt(i))},t.prototype.parseArgument=function(t,e){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(i,this.clonePosition()));if(125===this.char())return this.bump(),this.error(K.EMPTY_ARGUMENT,Nt(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(K.MALFORMED_ARGUMENT,Nt(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:J.argument,value:r,location:Nt(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(i,this.clonePosition())):this.parseArgumentOptions(t,e,r,i);default:return this.error(K.MALFORMED_ARGUMENT,Nt(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),i=Yt(this.message,e),r=e+i.length;return this.bumpTo(r),{value:i,location:Nt(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,i,r){var n,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(s){case"":return this.error(K.EXPECT_ARGUMENT_TYPE,Nt(a,o));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition();if((A=this.parseSimpleArgStyleIfPossible()).err)return A;if(0===(d=Jt(A.val)).length)return this.error(K.EXPECT_ARGUMENT_STYLE,Nt(this.clonePosition(),this.clonePosition()));l={style:d,styleLocation:Nt(h,this.clonePosition())}}if((v=this.tryParseArgumentClose(r)).err)return v;var u=Nt(r,this.clonePosition());if(l&&zt(null==l?void 0:l.style,"::",0)){var c=Kt(l.style.slice(2));if("number"===s)return(A=this.parseNumberSkeletonFromString(c,l.styleLocation)).err?A:{val:{type:J.number,value:i,location:u,style:A.val},err:null};if(0===c.length)return this.error(K.EXPECT_DATE_TIME_SKELETON,u);var p=c;this.locale&&(p=Bt(c,this.locale));var d={type:$.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?vt(p):{}};return{val:{type:"date"===s?J.date:J.time,value:i,location:u,style:d},err:null}}return{val:{type:"number"===s?J.number:"date"===s?J.date:J.time,value:i,location:u,style:null!==(n=null==l?void 0:l.style)&&void 0!==n?n:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(K.EXPECT_SELECT_ARGUMENT_OPTIONS,Nt(f,(0,nt.__assign)({},f)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(K.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Nt(this.clonePosition(),this.clonePosition()));var A;if(this.bumpSpace(),(A=this.tryParseDecimalInteger(K.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,K.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return A;this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=A.val}var v,y=this.tryParsePluralOrSelectOptions(t,s,e,g);if(y.err)return y;if((v=this.tryParseArgumentClose(r)).err)return v;var _=Nt(r,this.clonePosition());return"select"===s?{val:{type:J.select,value:i,options:Qt(y.val),location:_},err:null}:{val:{type:J.plural,value:i,options:Qt(y.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:_},err:null};default:return this.error(K.INVALID_ARGUMENT_TYPE,Nt(a,o))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(K.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Nt(i,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var i=[];try{i=_t(t)}catch(Ir){return this.error(K.INVALID_NUMBER_SKELETON,e)}return{val:{type:$.number,tokens:i,location:e,parsedOptions:this.shouldParseSkeletons?Ct(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(t,e,i,r){for(var n,a=!1,s=[],o=new Set,l=r.value,h=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===e||!this.bumpIf("="))break;var c=this.tryParseDecimalInteger(K.EXPECT_PLURAL_ARGUMENT_SELECTOR,K.INVALID_PLURAL_ARGUMENT_SELECTOR);if(c.err)return c;h=Nt(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(o.has(l))return this.error("select"===e?K.DUPLICATE_SELECT_ARGUMENT_SELECTOR:K.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===l&&(a=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?K.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:K.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Nt(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,e,i);if(d.err)return d;var f=this.tryParseArgumentClose(p);if(f.err)return f;s.push([l,{value:d.val,location:Nt(p,this.clonePosition())}]),o.add(l),this.bumpSpace(),l=(n=this.parseIdentifierIfPossible()).value,h=n.location}return 0===s.length?this.error("select"===e?K.EXPECT_SELECT_ARGUMENT_SELECTOR:K.EXPECT_PLURAL_ARGUMENT_SELECTOR,Nt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(K.MISSING_OTHER_CLAUSE,Nt(this.clonePosition(),this.clonePosition())):{val:s,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var n=!1,a=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;n=!0,a=10*a+(s-48),this.bump()}var o=Nt(r,this.clonePosition());return n?Wt(a*=i)?{val:a,err:null}:this.error(e,o):this.error(t,o)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=Zt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(zt(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&ae(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),i=this.message.charCodeAt(e+(t>=65536?2:1));return null!=i?i:null},t}();function ie(t){return t>=97&&t<=122||t>=65&&t<=90}function re(t){return ie(t)||47===t}function ne(t){return 45===t||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function ae(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function se(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function oe(t){t.forEach((function(t){if(delete t.location,ut(t)||ct(t))for(var e in t.options)delete t.options[e].location,oe(t.options[e].value);else ot(t)&&ft(t.style)||(lt(t)||ht(t))&>(t.style)?delete t.style.location:dt(t)&&oe(t.children)}))}function le(t,e){void 0===e&&(e={}),e=(0,nt.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var i=new ee(t,e).parse();if(i.err){var r=SyntaxError(K[i.err.kind]);throw r.location=i.err.location,r.originalMessage=i.err.message,r}return(null==e?void 0:e.captureLocation)||oe(i.val),i.val}function he(t,e){var i=e&&e.cache?e.cache:_e,r=e&&e.serializer?e.serializer:Ae;return(e&&e.strategy?e.strategy:fe)(t,{cache:i,serializer:r})}function ue(t){return null==t||"number"==typeof t||"boolean"==typeof t}function ce(t,e,i,r){var n=ue(r)?r:i(r),a=e.get(n);return void 0===a&&(a=t.call(this,r),e.set(n,a)),a}function pe(t,e,i){var r=Array.prototype.slice.call(arguments,3),n=i(r),a=e.get(n);return void 0===a&&(a=t.apply(this,r),e.set(n,a)),a}function de(t,e,i,r,n){return i.bind(e,t,r,n)}function fe(t,e){return de(t,this,1===t.length?ce:pe,e.cache.create(),e.serializer)}function ge(t,e){return de(t,this,pe,e.cache.create(),e.serializer)}function me(t,e){return de(t,this,ce,e.cache.create(),e.serializer)}var Ae=function(){return JSON.stringify(arguments)};function ve(){this.cache=Object.create(null)}ve.prototype.get=function(t){return this.cache[t]},ve.prototype.set=function(t,e){this.cache[t]=e};var ye,_e={create:function(){return new ve}},be={variadic:ge,monadic:me};(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(ye||(ye={}));var xe,Te=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.code=i,n.originalMessage=r,n}return(0,nt.__extends)(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Ee=function(t){function e(e,i,r,n){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(i,'". Options are "').concat(Object.keys(r).join('", "'),'"'),ye.INVALID_VALUE,n)||this}return(0,nt.__extends)(e,t),e}(Te),Se=function(t){function e(e,i,r){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(i),ye.INVALID_VALUE,r)||this}return(0,nt.__extends)(e,t),e}(Te),we=function(t){function e(e,i){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(i,'"'),ye.MISSING_VALUE,i)||this}return(0,nt.__extends)(e,t),e}(Te);function Pe(t){return t.length<2?t:t.reduce((function(t,e){var i=t[t.length-1];return i&&i.type===xe.literal&&e.type===xe.literal?i.value+=e.value:t.push(e),t}),[])}function Ie(t){return"function"==typeof t}function Re(t,e,i,r,n,a,s){if(1===t.length&&at(t[0]))return[{type:xe.literal,value:t[0].value}];for(var o=[],l=0,h=t;l0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])},t.__parse=le,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();var Le,ke,Ne;function Fe(t){return t.type===ke.number}function Ge(t){return t.type===ke.date}function Ue(t){return t.type===ke.time}function He(t){return t.type===ke.select}function Xe(t){return t.type===ke.plural}function je(t){return t.type===ke.tag}function We(t){return!(!t||"object"!=typeof t||t.type!==Ne.number)}function Ve(t){return!(!t||"object"!=typeof t||t.type!==Ne.dateTime)}(function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Le||(Le={})),function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(ke||(ke={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(Ne||(Ne={}));var Ye=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,ze=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function qe(t){var e={};return t.replace(ze,(function(t){var i=t.length;switch(t[0]){case"G":e.era=4===i?"long":5===i?"narrow":"short";break;case"y":e.year=2===i?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===i?"long":5===i?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][i-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][i-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][i-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][i-1];break;case"s":e.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}var Qe=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Ze(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=t.split(Qe).filter((function(t){return t.length>0})),i=[],r=0,n=e;r1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(ti,(function(t,i,r,n,a,s){if(i)e.minimumIntegerDigits=r.length;else{if(n&&a)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(ei.test(n.stem))e.minimumIntegerDigits=n.stem.length;else if(Je.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(Je,(function(t,i,r,n,a,s){return"*"===r?e.minimumFractionDigits=i.length:n&&"#"===n[0]?e.maximumFractionDigits=n.length:a&&s?(e.minimumFractionDigits=a.length,e.maximumFractionDigits=a.length+s.length):(e.minimumFractionDigits=i.length,e.maximumFractionDigits=i.length),""}));var a=n.options[0];"w"===a?e=(0,nt.__assign)((0,nt.__assign)({},e),{trailingZeroDisplay:"stripIfInteger"}):a&&(e=(0,nt.__assign)((0,nt.__assign)({},e),ii(a)))}else if($e.test(n.stem))e=(0,nt.__assign)((0,nt.__assign)({},e),ii(n.stem));else{var s=ri(n.stem);s&&(e=(0,nt.__assign)((0,nt.__assign)({},e),s));var o=ni(n.stem);o&&(e=(0,nt.__assign)((0,nt.__assign)({},e),o))}}return e}var oi,li={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function hi(t,e){for(var i="",r=0;r>1),l="a",h=ui(e);for("H"!=h&&"k"!=h||(o=0);o-- >0;)i+=l;for(;s-- >0;)i=h+i}else i+="J"===n?"H":n}return i}function ui(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var i,r=t.language;return"root"!==r&&(i=t.maximize().region),(li[i||""]||li[r||""]||li["".concat(r,"-001")]||li["001"])[0]}var ci=new RegExp("^".concat(Ye.source,"*")),pi=new RegExp("".concat(Ye.source,"*$"));function di(t,e){return{start:t,end:e}}var fi=!!String.prototype.startsWith&&"_a".startsWith("a",1),gi=!!String.fromCodePoint,mi=!!Object.fromEntries,Ai=!!String.prototype.codePointAt,vi=!!String.prototype.trimStart,yi=!!String.prototype.trimEnd,_i=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},bi=!0;try{bi="a"===(null===(oi=Ri("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===oi?void 0:oi[0])}catch(Va){bi=!1}var xi,Ti=fi?function(t,e,i){return t.startsWith(e,i)}:function(t,e,i){return t.slice(i,i+e.length)===e},Ei=gi?String.fromCodePoint:function(){for(var t=[],e=0;ea;){if((i=t[a++])>1114111)throw RangeError(i+" is not a valid code point");r+=i<65536?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),i%1024+56320)}return r},Si=mi?Object.fromEntries:function(t){for(var e={},i=0,r=t;i=i)){var r,n=t.charCodeAt(e);return n<55296||n>56319||e+1===i||(r=t.charCodeAt(e+1))<56320||r>57343?n:r-56320+(n-55296<<10)+65536}},Pi=vi?function(t){return t.trimStart()}:function(t){return t.replace(ci,"")},Ii=yi?function(t){return t.trimEnd()}:function(t){return t.replace(pi,"")};function Ri(t,e){return new RegExp(t,e)}if(bi){var Ci=Ri("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");xi=function(t,e){var i;return Ci.lastIndex=e,null!==(i=Ci.exec(t)[1])&&void 0!==i?i:""}}else xi=function(t,e){for(var i=[];;){var r=wi(t,e);if(void 0===r||Li(r)||ki(r))break;i.push(r),e+=r>=65536?2:1}return Ei.apply(void 0,i)};var Oi=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,i){for(var r=[];!this.isEOF();){var n=this.char();if(123===n){if((a=this.parseArgument(t,i)).err)return a;r.push(a.val)}else{if(125===n&&t>0)break;if(35!==n||"plural"!==e&&"selectordinal"!==e){if(60===n&&!this.ignoreTag&&47===this.peek()){if(i)break;return this.error(Le.UNMATCHED_CLOSING_TAG,di(this.clonePosition(),this.clonePosition()))}if(60===n&&!this.ignoreTag&&Mi(this.peek()||0)){if((a=this.parseTag(t,e)).err)return a;r.push(a.val)}else{var a;if((a=this.parseLiteral(t,e)).err)return a;r.push(a.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:ke.pound,location:di(s,this.clonePosition())})}}}return{val:r,err:null}},t.prototype.parseTag=function(t,e){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ke.literal,value:"<".concat(r,"/>"),location:di(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var n=this.parseMessage(t+1,e,!0);if(n.err)return n;var a=n.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:ke.tag,value:r,children:a,location:di(i,this.clonePosition())},err:null}:this.error(Le.INVALID_TAG,di(s,this.clonePosition())))}return this.error(Le.UNCLOSED_TAG,di(i,this.clonePosition()))}return this.error(Le.INVALID_TAG,di(i,this.clonePosition()))},t.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Di(this.char());)this.bump();return this.message.slice(t,this.offset())},t.prototype.parseLiteral=function(t,e){for(var i=this.clonePosition(),r="";;){var n=this.tryParseQuote(e);if(n)r+=n;else{var a=this.tryParseUnquoted(t,e);if(a)r+=a;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var o=di(i,this.clonePosition());return{val:{type:ke.literal,value:r,location:o},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&Bi(this.peek()||0)?null:(this.bump(),"<")},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(39===i){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(i);this.bump()}return Ei.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var i=this.char();return 60===i||123===i||35===i&&("plural"===e||"selectordinal"===e)||125===i&&t>0?null:(this.bump(),Ei(i))},t.prototype.parseArgument=function(t,e){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Le.EXPECT_ARGUMENT_CLOSING_BRACE,di(i,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Le.EMPTY_ARGUMENT,di(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Le.MALFORMED_ARGUMENT,di(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Le.EXPECT_ARGUMENT_CLOSING_BRACE,di(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ke.argument,value:r,location:di(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Le.EXPECT_ARGUMENT_CLOSING_BRACE,di(i,this.clonePosition())):this.parseArgumentOptions(t,e,r,i);default:return this.error(Le.MALFORMED_ARGUMENT,di(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),i=xi(this.message,e),r=e+i.length;return this.bumpTo(r),{value:i,location:di(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,i,r){var n,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(s){case"":return this.error(Le.EXPECT_ARGUMENT_TYPE,di(a,o));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition();if((A=this.parseSimpleArgStyleIfPossible()).err)return A;if(0===(d=Ii(A.val)).length)return this.error(Le.EXPECT_ARGUMENT_STYLE,di(this.clonePosition(),this.clonePosition()));l={style:d,styleLocation:di(h,this.clonePosition())}}if((v=this.tryParseArgumentClose(r)).err)return v;var u=di(r,this.clonePosition());if(l&&Ti(null==l?void 0:l.style,"::",0)){var c=Pi(l.style.slice(2));if("number"===s)return(A=this.parseNumberSkeletonFromString(c,l.styleLocation)).err?A:{val:{type:ke.number,value:i,location:u,style:A.val},err:null};if(0===c.length)return this.error(Le.EXPECT_DATE_TIME_SKELETON,u);var p=c;this.locale&&(p=hi(c,this.locale));var d={type:Ne.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?qe(p):{}};return{val:{type:"date"===s?ke.date:ke.time,value:i,location:u,style:d},err:null}}return{val:{type:"number"===s?ke.number:"date"===s?ke.date:ke.time,value:i,location:u,style:null!==(n=null==l?void 0:l.style)&&void 0!==n?n:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Le.EXPECT_SELECT_ARGUMENT_OPTIONS,di(f,(0,nt.__assign)({},f)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(Le.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,di(this.clonePosition(),this.clonePosition()));var A;if(this.bumpSpace(),(A=this.tryParseDecimalInteger(Le.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Le.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return A;this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=A.val}var v,y=this.tryParsePluralOrSelectOptions(t,s,e,g);if(y.err)return y;if((v=this.tryParseArgumentClose(r)).err)return v;var _=di(r,this.clonePosition());return"select"===s?{val:{type:ke.select,value:i,options:Si(y.val),location:_},err:null}:{val:{type:ke.plural,value:i,options:Si(y.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:_},err:null};default:return this.error(Le.INVALID_ARGUMENT_TYPE,di(a,o))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(Le.EXPECT_ARGUMENT_CLOSING_BRACE,di(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Le.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,di(i,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var i=[];try{i=Ze(t)}catch(Ir){return this.error(Le.INVALID_NUMBER_SKELETON,e)}return{val:{type:Ne.number,tokens:i,location:e,parsedOptions:this.shouldParseSkeletons?si(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(t,e,i,r){for(var n,a=!1,s=[],o=new Set,l=r.value,h=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===e||!this.bumpIf("="))break;var c=this.tryParseDecimalInteger(Le.EXPECT_PLURAL_ARGUMENT_SELECTOR,Le.INVALID_PLURAL_ARGUMENT_SELECTOR);if(c.err)return c;h=di(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(o.has(l))return this.error("select"===e?Le.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Le.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===l&&(a=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?Le.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Le.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,di(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,e,i);if(d.err)return d;var f=this.tryParseArgumentClose(p);if(f.err)return f;s.push([l,{value:d.val,location:di(p,this.clonePosition())}]),o.add(l),this.bumpSpace(),l=(n=this.parseIdentifierIfPossible()).value,h=n.location}return 0===s.length?this.error("select"===e?Le.EXPECT_SELECT_ARGUMENT_SELECTOR:Le.EXPECT_PLURAL_ARGUMENT_SELECTOR,di(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(Le.MISSING_OTHER_CLAUSE,di(this.clonePosition(),this.clonePosition())):{val:s,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var n=!1,a=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;n=!0,a=10*a+(s-48),this.bump()}var o=di(r,this.clonePosition());return n?_i(a*=i)?{val:a,err:null}:this.error(e,o):this.error(t,o)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=wi(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(Ti(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&Li(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),i=this.message.charCodeAt(e+(t>=65536?2:1));return null!=i?i:null},t}();function Mi(t){return t>=97&&t<=122||t>=65&&t<=90}function Bi(t){return Mi(t)||47===t}function Di(t){return 45===t||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function Li(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function ki(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function Ni(t){t.forEach((function(t){if(delete t.location,He(t)||Xe(t))for(var e in t.options)delete t.options[e].location,Ni(t.options[e].value);else Fe(t)&&We(t.style)||(Ge(t)||Ue(t))&&Ve(t.style)?delete t.style.location:je(t)&&Ni(t.children)}))}function Fi(t,e){void 0===e&&(e={}),e=(0,nt.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var i=new Oi(t,e).parse();if(i.err){var r=SyntaxError(Le[i.err.kind]);throw r.location=i.err.location,r.originalMessage=i.err.message,r}return(null==e?void 0:e.captureLocation)||Ni(i.val),i.val}var Gi=i(4497),Ui=i.n(Gi);async function Hi(t,e){(0,it.shouldPolyfill)()&&await Promise.all([i.e(553),i.e(182)]).then(i.bind(i,2182)),(0,rt.shouldPolyfill)()&&await Promise.all([i.e(553),i.e(31)]).then(i.bind(i,7031));var r=tt.A.getCurrentLanguageId().split("-")[0];(0,et.shouldPolyfill)(r)&&(await i.e(854).then(i.bind(i,1854)),/bg|de|el|en|es|fi|fr|id|it|ja|ko|nl|nn|pl|pt|ro|ru|sv|th|tr|vi|zh$/.test(r)?await i(2679)(`./${r}`):await i.e(412).then(i.t.bind(i,6412,23))),Xi(t,e)}function Xi(t,e){var i={getNumberFormat:Ui()(((t,e)=>new Intl.NumberFormat(t,e))),getDateTimeFormat:Ui()(((t,e)=>new Intl.DateTimeFormat(t,e))),getPluralRules:Ui()(((t,e)=>new Intl.PluralRules(t,e)))},r=Ui()(e);tt.A.messageProcessor=(e,n,a)=>{var s="object"==typeof n&&null!==n?n:{count:isNaN(n)?10:n};return new t(r(e),tt.A.getCurrentLanguageId(),void 0,{formatters:i}).format(s)}}Hi(De,Fi);var ji=i(9649),Wi=i(4894),Vi=i(3800),Yi=i(4381),zi=i(4051),qi=i(4418),Qi=i(1233),Zi=60;class Ki{init(){s.A.pixiApp.renderer.textureGC&&(s.A.pixiApp.renderer.textureGC.mode=Qi.GC_MODES.AUTO,s.A.pixiApp.renderer.textureGC.maxIdle=Zi,s.A.pixiApp.renderer.textureGC.run())}}const Ji=new Ki;var $i=i(2449),tr=i.n($i),er=i(230);s.A.isMobile.any||(er.projectDesc.screenOrientation="landscape");class ir extends ji.A{init(){if(super.init(),Ji.init(),location.href.includes("enableSeleniumInterface")&&i.e(338).then(i.bind(i,5338)).then((t=>{t.default(s.A)})),s.A.isMobile.any){var t=new(tr()),e=0;function r(){var i=Date.now();i-4e3>e&&(e=i,t.enable())}function n(){s.A.addOnClickOnce(r)}document.addEventListener("touchend",n),document.addEventListener("click",n)}}onShow(){var t=s.A.isMobile.any?"main-mobile":"main-desktop";s.A.showScene(r.A.hasScene(t)?t:"main");var e=s.A.settings.getItem("isIntroShowedBefore");qi.A.isReplayMode()||!r.A.hasScene("intro")||e&&!s.A.Sound.isSoundsLockedByBrowser||(s.A.showScene("intro"),s.A.settings.setItem("isIntroShowedBefore",!0)),s.A.casinoOptions.show_paytable&&r.A.hasScene("paytable")&&s.A.showScene("paytable")}}var rr,nr=i(684),ar=i(9401);class sr extends n.A{init(){if(rr=s.A.pixiApp.renderer.plugins.interaction,super.init(),this.onStageDown=this.onStageDown.bind(this),this.handlerAdded=!1,this._insideContainers=[this],this.additionalContainers)for(var t of this.additionalContainers.split(",")){var e=(0,a.A)(t,this);this._insideContainers.push(e)}}onRemove(){super.onRemove(),this.removeHandler()}onStageDown(t){if(s.A.time-this.time>1)this.removeHandler();else if(t.target)for(var e=t.target;e;){if(this._insideContainers.indexOf(e)>=0)return;if(e===s.A.stage)return void this.fire();e=e.parent}else this.fire()}fire(){this.onClickOutside&&(0,u.A)(this.onClickOutside,this)}_onDisableByTrigger(){this.removeHandler()}update(){this.handlerAdded||(this.handlerAdded=!0,rr.on("pointerdown",this.onStageDown)),this.time=s.A.time,super.update()}removeHandler(){this.handlerAdded&&(this.handlerAdded=!1,rr.removeListener("pointerdown",this.onStageDown))}}class or extends Wi.A{init(){super.init(),this.phase=0}hide(){this.phase=0}update(){super.update(),this.y-=1,this.phase--,this.phase<=0?(this.alpha-=.05,this.alpha<=0&&this.remove()):this.alpha<.95&&(this.alpha+=.2)}static flyText(t,e=null,i=null,n="flytext",o=0,l){"number"!=typeof e&&(e=s.A.W/2),"number"!=typeof i&&(i=s.A.H/2);var h=r.A.loadPrefab(n);h.text=t,h.phase=6*t.length+o;var u=h.width/2+5;return es.A.W-u&&(e=s.A.W-u),h.alpha=0,h.x=e,h.y=i,l?"string"==typeof l&&(l=(0,a.A)(l,s.A.currentContainer)):l=s.A.currentContainer,l.addChild(h),h}}class lr extends n.A{init(){super.init(),this.needApplyLayout=!0,this._applyLayout()}update(){super.update(),this.needApplyLayout&&(this._applyLayout(),this.needApplyLayout=!1)}_applyLayout(){var t=s.A.W-2*this.marginLeftRight,e=this.marginLeftRight,i=s.A.isMobile.any?this.maxWidthMobile:this.maxWidthDesktop;i>0&&t>i&&(e+=Math.round((t-i)/2),t=i);var r=s.A.H-2*this.marginTopBottom;if(this.bgNineSlicePlanePath){var n=(0,a.A)(this.bgNineSlicePlanePath,this);this.x=e+this.containerMargin,this.y=this.marginTopBottom+this.containerMargin,n&&(n.x=-this.containerMargin,n.y=-this.containerMargin,n.width=t,n.height=r)}if(this.scrollBarPath){var o=(0,a.A)(this.scrollBarPath,this);o&&(o.x=t-this.containerMargin,o.height=r-this.scrollBarBottomMargin)}if(this.scrollLayerPath){var l=(0,a.A)(this.scrollLayerPath,this);if(l){var h=l.visibleArea;h.w=t-2*this.containerMargin,h.h=r-2*this.containerMargin}}}_onRenderResize(){this._applyLayout(),this.isMobileLandscape=!s.A.isPortrait&&s.A.isMobile.any}}var hr=560,ur=500,cr=30,pr=52,dr=174;class fr extends n.A{init(){super.init(),this.riskButtons=[s.A.currentScene.all["high-risk-btn"],s.A.currentScene.all["medium-risk-btn"],s.A.currentScene.all["low-risk-btn"]],this.lines=[],this.targets=[],this.tooltip=this.getChildByName("tooltip"),this.pinsContainer=this.getChildByName("pinsContainer"),this.hole=this.getChildByName("hole"),this.linesButtons=s.A.currentScene.findChildrenByName("lines-button"),this.hideTooltip(),this.colors={center:{r:this.centerR,g:this.centerG},low:{r:this.lowR,g:this.lowG},medium:{r:this.mediumR,g:this.mediumG},high:{r:this.highR,g:this.highG}}}update(){super.update(),this.targets.indexOf(ar.A.overredButton||ar.A.downedButton)>=0?this.showTooltip(ar.A.overredButton||ar.A.downedButton):s.A.isMobile.any&&!s.A.mouse.click||this.hideTooltip()}showTooltip(t){this.tooltip.target!==t&&(this.tooltip.visible=!0,this.tooltip.x=t.x,this.tooltip.x<-dr&&(this.tooltip.x=-dr),this.tooltip.x>dr&&(this.tooltip.x=dr),this.tooltip.profit=t.payout*s.A.currentScene.getBet(),this.tooltip.chance=t.chance,this.tooltip.getChildByName("pointer").x=t.x-this.tooltip.x)}hideTooltip(){this.tooltip.visible=!1,this.tooltip.target=null}initializePaytable(){this.setRiskMode(s.A.settings.getItem("riskMode","low")),this.setLinesCount(s.A.settings.getItem("linesCount",8))}setRiskMode(t){for(var e of(this.riskMode=t,s.A.settings.setItem("riskMode",t),this._applyPaytable(),this.riskButtons))e.name.startsWith(t)?e.disable():e.enable()}setLinesCount(t){for(var e of(this._releaseTable(),this.linesCount=t,s.A.settings.setItem("linesCount",t),this.linesButtons)){var i=e.getChildByName("label");i.text==t?(e.disable(),i.style.fill="#1e4e79"):(e.enable(),i.style.fill="#c6d6e3")}this._generateTable()}launchBall(){this.ballWaitingPath=r.A.loadPrefab("ball"),this.ballWaitingPath.setPinsDistance(this.pinsDistance,this.pinRadius,this),this.getChildByName("ballsContainer").addChildAt(this.ballWaitingPath,0)}setBallData(t){var e=this.ballWaitingPath.ballId;return this.ballWaitingPath.setBallData(t),this.ballWaitingPath=null,e}onRemove(){super.onRemove(),this._releaseTable()}_generateTable(){var t=ur/(this.linesCount+1),e=t,i=(hr-e-cr)/(this.linesCount-.5);this.pinsDistance=t,this.pinRadius=Math.max(.5,Math.min(1,.02*t));var n=Z.getBallSize(this.pinsDistance,this.pinRadius);this.hole.scale.x=n,this.hole.scale.y=n;for(var a=0;a0;l--){var h=r.A.loadPrefab("pin");h.x=Math.round(o),h.scale.x=this.pinRadius,h.scale.y=this.pinRadius,o+=t,s.addChild(h)}this.lines.push(s),this.pinsContainer.addChild(s)}for(var u=Math.min(1,t/pr),c=-(ur-pr*u)/2,p=this.linesCount;p>=0;p--){var d=r.A.loadPrefab("ball-target");d.x=Math.round(c),c+=t,d.y=hr,d.scale.x=u,d.scale.y=u,this.pinsContainer.addChild(d),this.targets.push(d)}this._applyPaytable()}_applyPaytable(){for(var t=this.targets.length-1;t>=0;t--){var e=this.targets[t],i=e.findChildByName("label"),r=e.findChildByName("body"),n=s.A.data.initData.paytable[this.linesCount],a=n[this.riskMode][t];i.text="×"+a,e.payout=a,e.chance=n.chances[t];var o=2*Math.abs(e.x)/ur;r.tintR=Math.min(255,this.colors[this.riskMode].r*o+this.colors.center.r*(1-o)),r.tintG=Math.min(255,this.colors[this.riskMode].g*o+this.colors.center.g*(1-o))}}_releaseTable(){for(;this.lines.length>0;)this.lines.pop().remove();for(;this.targets.length>0;)this.targets.pop().remove()}}var gr=i(4319),mr=null,Ar=1;function vr(){mr||(mr=s.A.pixiApp.view.getBoundingClientRect(),Ar=mr.width/s.A.W)}class yr extends o.A{init(){this.bouncingBounds=!1,super.init(),this.currentHtmlScale=0,this.currentHtmlOpacity=0,this.interactive=!0,this._overlayIntervalUpdate=this._overlayIntervalUpdate.bind(this),this._scripts=[]}onRemove(){super.onRemove(),this._releaseHtmlDiv()}update(){mr=null,vr(),this.handleScroll&&this._htmlDiv&&(this._htmlDiv.scrollHeight>this._htmlDiv.clientHeight?this.fullArea.h=Math.max(this.visibleArea.h,Math.floor(this._htmlDiv.scrollHeight/Ar-1)):this.fullArea.h=this.visibleArea.h),super.update(),this.latestTime=s.A.time,this.handleScroll&&this._htmlDiv&&(this._htmlDiv.scrollTop=-this.y*Ar,this.y=-Math.round(this._htmlDiv.scrollTop/Ar)),this._updateHtmlOpacity()}_updateHtmlOpacity(){var t=this.worldVisible&&this._htmlContent&&this.isCanBePressed&&Math.abs(this.worldTransform.a)>.1&&!this._isHtmlContentInvalidated?this.worldAlpha:0;this.currentHtmlOpacity=(0,gr.CR)(this.currentHtmlOpacity,t,this.fadeSpeed)}_overlayIntervalUpdate(){s.A.time-this.latestTime>1&&this._updateHtmlOpacity(),this.worldVisible||this._releaseHtmlDiv()}_releaseHtmlDiv(){this._htmlDiv&&(this._htmlDiv.remove(),this._htmlDiv=null,clearInterval(this._overlayInterval),this._isHtmlContentInvalidated=!1,this.currentHtmlScale=0,this.currentHtmlOpacity=0);for(var t=0;t<(null===(e=this._scripts)||void 0===e?void 0:e.length);t++){var e;this._scripts[t].remove()}this._scripts=[]}render(t){this._renderHtmlContainer(),super.render(t)}_renderCanvas(t){this._renderHtmlContainer(),super._renderCanvas(t)}_renderHtmlContainer(){if(this.currentHtmlOpacity>.001){if(!this._htmlDiv){this._htmlDiv=document.createElement("div"),this._htmlDiv.style.position="fixed",this._htmlDiv.innerHTML=this._htmlContent,this._htmlDiv.style.overflow="hidden",this._htmlDiv.style.zIndex=this.zIndex,this._htmlDiv.style.transformOrigin="0 0",this._applyClassName(),this.handleScroll&&(this._htmlDiv.style.pointerEvents="none",this._htmlDiv.style.overflow="auto");for(var t=0;t<(null===(e=this.domScripts)||void 0===e?void 0:e.length);t++){var e,i=this.domScripts[t],r=document.createElement("script");r.textContent=i,this._scripts.push(r)}document.body.appendChild(this._htmlDiv);for(var n=0;n.001&&(this.currentHtmlScale=this.worldTransform.a,this._htmlDiv.style.transform="scale("+(this.currentHtmlScale/s.A.stage.scale.x).toFixed(3)+")")}else this._releaseHtmlDiv()}_onRenderResize(){this._applyClassName()}_applyClassName(){this._htmlDiv&&(this._htmlDiv.className=this.className+(s.A.isPortrait?" portrait-":" landscape-")+this.className,this.handleScroll&&this._htmlDiv.classList.add("casino-modal-scroll"))}get innerHTML(){return this._htmlContent}set innerHTML(t){this._htmlContent!==t&&(this._isHtmlContentInvalidated=!!this._htmlDiv,this._htmlContent=t)}get domScripts(){return this._domScripts}set domScripts(t){this._domScripts!==t&&(this._domScripts=t)}}class _r extends D{setY(t,e=!1){this.yTo=t,e&&(this.y=t,this.gotoLabelRecursive("no-animation"))}update(){this.ySpeed+=.05*(this.yTo-this.y),this.ySpeed*=.74,super.update()}getData(){return this.data}setData(t){this.data=t,t.win>0?this.getChildByName("lose-bg").remove():(0===t.win&&(this.getChildByName("lose-bg").image="EMPTY"),this.getChildByName("win-bg").remove())}startRemoving(){this.gotoLabelRecursive("remove")}}class br extends n.A{static delay(t,e,i=s.A.currentContainer){if(!(e<=0)){var r=M.A.create(br);return r.delay=e,r.callback=t,i.addChild(r),r}t()}constructor(){super(),this.visible=!1}skip(){this.callback(),this.callback=null,this.remove()}update(){this.delay--,this.delay<1&&(this.callback(),this.remove())}}class xr extends n.A{constructor(){super(),this._removedChildren=[]}init(){super.init(),this.initialAlpha=this.alpha,this.initialScale=this.scale.x,this.initialX=this.x,this.initialY=this.y,this.qSpeed=0,this.triggering=!1,this._processedState=void 0,this.applyInstantly(),this.lastUpdateTime=s.A.time}getState(){return!!this.invert==!(0,a.A)(this.dataPath,this)}applyInstantly(){this.dataPath?this._state=this.getState():this._state=!!this.invert,this._state?this.q=0:this.q=1,this.qSpeed=0,this.updatePhase(),this.interactiveChildren=this._state||!this.isApplyInteractivity}show(){this._state=!0,this.interactiveChildren=!0,this.triggering=!0}set state(t){t?this.show():this.hide()}get state(){return this._state}hide(){this._state=!1,this.isApplyInteractivity&&(this.interactiveChildren=!1),this.triggering=!0,this.forAllChildren(Tr)}toggle(){this._state?this.hide():this.show()}updatePhase(){var t=this._state?0:1;if(1===this.pow||Math.abs(t-this.q)<.002&&Math.abs(this.qSpeed)<.002?(this.triggering=!1,this.q=t):(this.qSpeed+=(t-this.q)*this.pow,this.qSpeed*=this.damp,this.q+=this.qSpeed),this.alpha=this.initialAlpha+this.q*this.alphaShift,0!==this.scaleShift){var e=this.initialScale+this.q*this.scaleShift;this.scale.x=e,this.scale.y=e}this.visible=this.alpha>.015&&Math.abs(this.scale.x)>.0015,!this.visible&&!this._state&&this.initialAlpha+this.alphaShift<=.015&&(this.triggering=!1,this.q=t),0!==this.xShift&&(this.x=this.initialX+this.q*this.xShift),0!==this.yShift&&(this.y=this.initialY+this.q*this.yShift)}update(){if(this.dataPath){var t=this.getState();this._state!==t&&this.toggle()}this.triggering&&(this.updatePhase(),!this._state&&s.A.time-this.lastUpdateTime>1&&this.applyInstantly()),this.visible&&super.update(),this._processedState!==this._state&&(this._processedState=this._state,this._processedState?this.onEnable&&(0,u.A)(this.onEnable,this):this.onDisable&&(0,u.A)(this.onDisable,this)),this.lastUpdateTime=s.A.time}}var Tr=t=>{t._onDisableByTrigger&&t._onDisableByTrigger()},Er=i(9087);class Sr{static fetch(t,e,i="json",r){var n=Er.A.promise(((t,n)=>{fetch(e,r).then((t=>t[i]())).then(t).catch(n)}),t);return n.name="Request: "+e,n}}class wr extends n.A{constructor(){super(),this.onWheel=this.onWheel.bind(this)}onWheel(t){if(this.isCanBePressed){var e=0,i=s.A.mouseEventToGlobalXY(t);this.hitArea?(this.toLocal(i,void 0,i),this.hitArea.contains(i.x,i.y)&&(e=t.deltaY,t.stopPropagation(),t.preventDefault())):this.getBounds().contains(i.x,i.y)&&(e=t.deltaY,t.stopPropagation(),t.preventDefault()),e<0?this.canIncrease?this.increase():this.ySpeed=-1:e>0&&(this.canDecrease?this.decrease():this.ySpeed=1)}}init(){super.init(),this.currentInterval=0,this.showedVal=void 0,this.defaultValue=this.value,this.on("pointerdown",this.onDown),this.buttonMode=!0,this.cursor="ns-resize",this.dragging=!1,this.ySpeed=0,this._currentTextField=null,this._prevTextField=null,this.valuesList?this.setValuesList(this.valuesList.split(",").map((t=>parseFloat(t)))):this._values=null,this.resetValue(),document.addEventListener("wheel",this.onWheel,!0)}onRemove(){super.onRemove(),this._prevTextField=null,this._currentTextField=null,document.removeEventListener("wheel",this.onWheel,!0)}get canDecrease(){return this.value>this.min||this.wrapValue}get canIncrease(){return this.valuethis.min||this.wrapValue)&&this.isCanBePressed}get canIncreaseVisual(){return(this.valuen;){if(!this.canDecrease){this.startDragY=s.A.mouse.y;break}this.decrease(),o-=2*n,this.startDragY+=2*n}for(;o<-n;){if(!this.canIncrease){this.startDragY=s.A.mouse.y;break}this.increase(),o+=2*n,this.startDragY-=2*n}this.ySpeed+=.1*(s.A.mouse.y-this.prevDragY),this.prevDragY=s.A.mouse.y}else this.dragging=!1;this._currentTextField&&(this.ySpeed+=-.15*this._currentTextField.y,this.ySpeed*=.7,this._currentTextField.y+=this.ySpeed,this._currentTextField.alpha=1-Math.abs(this._currentTextField.y/this._currentTextField.height)),this._prevTextField&&(this._prevTextField.y+=this.ySpeed,this._prevTextField.alpha=1-this._currentTextField.alpha,Math.abs(this._prevTextField.y)>=this._prevTextField.height-4&&(this._prevTextField.remove(),this._prevTextField=null)),super.update()}onDown(){this.dragging=!0,this.prevDragY=s.A.mouse.y,this.startDragY=this.prevDragY}resetValue(){this.setValue(this.defaultValue)}increase(t){if(this._values){var e=this._values;this.wrapValue?this.setValue(e[(e.indexOf(this.value)+1)%e.length]):this.setValue(e[Math.min(e.indexOf(this.value)+1,e.length-1)])}else this.setValue(this.value+(t||this.step))}decrease(t){if(this._values){var e=this._values;this.wrapValue?this.setValue(e[(e.indexOf(this.value)-1)%e.length]):this.setValue(e[Math.max(e.indexOf(this.value)-1,0)])}else this.setValue(this.value-(t||this.step))}_modValue(t){var e=this.max-this.min+1;return((t-this.min)%e+e)%e+this.min}setValue(t){tthis.max&&(t=this.wrapValue?this._modValue(t):this.max),t!==this.value&&(this.dataPath&&(0,a.W)(this.dataPath,t,this),this.value=t,this.onChanged&&(0,u.A)(this.onChanged,this))}refreshNow(){this.currentInterval=0}}function Pr(t,e,i,r){return new(i||(i=Promise))((function(n,a){function s(t){try{l(r.next(t))}catch(t){a(t)}}function o(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((r=r.apply(t,e||[])).next())}))}function Ir(t,e){var i,r,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]-1?(Cr('UA "Edge" => assuming success'),[2,!0]):Wr(document.body,t)?(Cr("copyUsingTempSelection worked"),[2,!0]):function(t){var e=document.createElement("div");e.setAttribute("style","-webkit-user-select: text !important"),e.textContent="temporary element",document.body.appendChild(e);var i=Wr(e,t);return document.body.removeChild(e),i}(t)?(Cr("copyUsingTempElem worked"),[2,!0]):function(t){Cr("copyTextUsingDOM");var e=document.createElement("div");e.setAttribute("style","-webkit-user-select: text !important");var i=e;e.attachShadow&&(Cr("Using shadow DOM."),i=e.attachShadow({mode:"open"}));var r=document.createElement("span");r.innerText=t,i.appendChild(r),document.body.appendChild(e),Vr(r);var n=document.execCommand("copy");return Yr(),document.body.removeChild(e),n}(t["text/plain"])?(Cr("copyTextUsingDOM worked"),[2,!0]):[2,!1]}))}))}function qr(t){return Pr(this,void 0,void 0,(function(){return Ir(this,(function(e){if(Nr)return Cr("Using `navigator.clipboard.writeText()`."),[2,Nr(t)];if(!zr(function(t){var e={};return e["text/plain"]=t,e}(t)))throw new Error("writeText() failed");return[2]}))}))}(function(){function t(t,e){var i;for(var r in void 0===e&&(e={}),this.types=Object.keys(t),this._items={},t){var n=t[r];this._items[r]="string"==typeof n?Qr(r,n):n}this.presentationStyle=null!==(i=null==e?void 0:e.presentationStyle)&&void 0!==i?i:"unspecified"}t.prototype.getType=function(t){return Pr(this,void 0,void 0,(function(){return Ir(this,(function(e){return[2,this._items[t]]}))}))}})();function Qr(t,e){return new Blob([e],{type:t})}class Zr extends xr{get isItMobile(){return s.A.isMobile.any}init(){s.A.data.provability={clientSeed:[]},this.data=null;var t=this.findChildByName("client-seed-controls");this.clientSeedInputs=t.findChildrenByType(wr),this.slotLeftBorder=this.findChildByName("slot-left-border"),this.randomizeClientSeed(),super.init()}onRemove(){super.onRemove(),this.shiftForSpinTrigger=null,this.clientSeedInputs=null,this.slotLeftBorder=null}show(){super.show(),this._applyLayout(),this.isHidedForSpin=!1}hideProvabilityForSpin(){this.isItMobile?s.A.all.popupsLayer.hideAll():this.isHidedForSpin=!0}showProvabilityAfterSpin(){this.isItMobile?s.A.all.popupsLayer.showProvability():this.isHidedForSpin=!1}get isProvabilityEnabled(){return this.data}_applyTextToButton(t,e){var i=this.findChildByName(t);i.findChildByName("label").text=e,i instanceof ar.A&&(i.callback=()=>{this.copyTextToClipboard(e)})}copyTextToClipboard(t){qr(t).then((()=>{or.flyText((0,tt.A)("provability.copied_to_clipboard"),s.A.mouse.x,s.A.mouse.y-30,void 0,-90)}))}applyResult(t){t&&t.extra_data&&t.extra_data.provable_data&&(this.randomizeClientSeed(),this.data=t.extra_data.provable_data,this.isVerified=!1,this._applyTextToButton("next-game-hash-btn",this.data[0].hash),this.data[1]&&(this._applyTextToButton("last-game-hash-btn",this.data[1].hash),this._applyTextToButton("last-game-final-result-btn",this.data[1].result),this._applyTextToButton("last-game-result-btn",this.data[1].secret),this._applyTextToButton("last-game-client-seed",this.data[1].client_seed)))}randomizeClientSeed(){for(var t of(s.A.data.provability.clientSeed=[],this.clientSeedInputs))(0,a.W)(t.dataPath,Math.floor(t.min+Math.random()*(t.max-t.min)),t)}onVerifyClick(){Sr.fetch(this,s.A.casinoOptions.provable_fair.verify_url,"json",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:this.data[1].secret,client_seed:this.data[1].client_seed})}).then((t=>{t&&(this.isVerified=!0,this.isVerificationSuccess=t.hash===this.data[1].hash)}))}_applyLayout(){var t=s.A.W,e=s.A.H,i=this.isItMobile&&!s.A.isPortrait;this.pow=this.isItMobile?1:.1,this.isItMobile||(t=Math.round(.5*e)-100);var r=this.findChildrenByName("orientation-trigger");for(var n of r)i?n.hide():n.show();this.findChildByName("provability-close-btn-container").x=t;var a=this.findChildByName("provability-background");a&&(a.pivot.x=100,a.width=t+100,a.height=e);var o,l=this.findChildByName("provability-container");l&&(l.x=Math.round(t/2),l.y=Math.round(e/2),o=i?Math.min((t-600)/800,e/600):this.isItMobile?Math.min(t/440,(e-310)/1080):Math.min(t/440,e/1080),l.scale.x=o,l.scale.y=o);var h=(0,tt.A)("provability.hash"),u=(0,tt.A)("provability.result"),c=(0,tt.A)("provability.secret"),p=this.findChildByName("hash-result-secret-label"),d=this.findChildByName("hash-result-secret-label2"),f=this.findChildByName("result-secret-label");p.text=d.text=h+" ("+u+" + "+c+")",f.text=u+" + "+c;var g=this.findChildByName("shift-for-spin");if(g&&!this.isItMobile&&a){var m=s.A.W/2-650;g.xShift=Math.min(m-(a.width-a.pivot.x),0),g.state=!!g.state}}static getCurrentClientSeed(){return Number(s.A.data.provability.clientSeed.join(""))||0}_onRenderResize(){this._applyLayout()}}var Kr=i(6113),Jr=!1,$r="application/json",tn={};class en{constructor(t){this.setCasinoOptions(t)}setCasinoOptions(t){tn={},this.currentGameId=t.identifier,this.apiUrl=t.api,this.rulesUrl=t.rules_url,this.lobbyUrl=t.lobby_launch_url,this.headers={"Content-Type":$r},this.headers[t.csrfTokenHeaderName]=t.csrfTokenHeaderValue,on()&&Jr&&Jr.initialize()}requestRules(){return fetch(this.rulesUrl,{headers:{Accept:$r}}).then(rn)}addRoundSeriesId(t){var e,i=null===(e=window)||void 0===e||null===(e=e.extraData)||void 0===e?void 0:e.round_series_id;return i&&(t&&t.extra_data?(t.extra_data=t.extra_data||{},t.extra_data.round_series_id=i):t.extra_data={round_series_id:i}),t}requestURL(t,e,i){var r={method:e?"POST":"GET",headers:this.headers};if(e&&(null==Jr||!Jr.isPlaybackActive)){if(this.addRoundSeriesId(e),r.body=JSON.stringify(e),tn[r.body]){var n=Promise.resolve(tn[r.body]);return tn[r.body]=null,n}tn[r.body]=null}if(on()&&null!=Jr&&Jr.isPlaybackActive){var a=null==Jr?void 0:Jr.getItem(e);return Promise.resolve(a)}return new Promise(((n,a)=>{sn(t,r,(s=>(this.additionalResponseProcessing(s,t,e,i),rn(s).then((async e=>{if(!i&&on()&&Jr){var n={command:"init"};this.addRoundSeriesId(n);var a=JSON.stringify(n);await(null==Jr?void 0:Jr.addItem(r,e,t,{method:"POST",headers:this.headers,body:a}))}return e})).then(n).catch(a))),a)}))}request(t,e){return this.requestURL(this.apiUrl,t,e)}prepareRequest(t){var e=JSON.stringify(t);tn.hasOwnProperty(e)||(this.request(t).then((t=>{tn.hasOwnProperty(e)||(tn[e]=t)})),delete tn[e])}additionalResponseProcessing(t,e,i,r){this.verifyDigest(t,e),r||this.addSentryBreadcrumb(t,e,i)}async addSentryBreadcrumb(t,e,i){try{if(!Kr.T||!Sentry)return;var r=await t.clone().json();r.options&&(r.options="{...}"),Sentry.addBreadcrumb({type:"info",category:"api.response",data:{url:e,request:JSON.stringify(i),response:JSON.stringify(r)},level:Sentry.Severity.Info})}catch(n){return}}async verifyDigest(t,e){if(t.headers.has("digest"))try{var i=t.headers.get("digest"),[r,n]=i.split("=");if(!n)return;var a=atob(n),s=await t.clone().text();a!==await this.generateDigest(r,s)&&Kr.T&&Sentry.withScope((i=>{i.setExtra("request-url",e),i.setExtra("x-request-id",t.headers.get("x-request-id")),i.setExtra("responseText",s.substring(0,199e3)),Sentry.captureException(new Error("Response checksum mismatch"))}))}catch(Ir){return}}async generateDigest(t,e){var i=(new TextEncoder).encode(e),r=await crypto.subtle.digest(t,i),n=Array.from(new Uint8Array(r)).map((t=>t.toString(16).padStart(2,"0"))).join("");return n}}var rn=t=>t.json(),nn=!1,an=[];function sn(t,e,i,r){if(nn)an.push(Array.from(arguments));else{nn=!0;var n=!1,a=()=>{n||(nn=!1,an.length&&sn.apply(null,an.shift()),n=!0)};fetch(t,e).then((t=>{a(),i(t)})).catch((t=>{a(),r(t)}))}}function on(){return window.location.origin.indexOf("dev.bgaming-system")>-1||!1}var ln=(s.A.isMobile.apple.phone||s.A.isMobile.apple.ipod)&&navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");function hn(){try{return window.self!==window.top}catch(Ir){return!0}}s.A.isIosSafari=ln;var un,cn,pn,dn=hn(),fn="",gn=!s.A.isPortrait,mn=document.body.style,An=.9;function vn(){un=document.createElement("div"),cn=Math.min(screen.width,screen.height),un.style.height=cn+3e3+"px",un.style.width="100%",un.style.position="absolute",document.body.appendChild(un),window.addEventListener("touchend",(function(){s.A.isPortrait&&!s.A.isNeedScrollTopIosSafari&&(clearTimeout(pn),pn=setTimeout((()=>{un.style.height=window.innerHeight+"px",this.setTimeout((()=>s.A.onResize()))}),100))}))}ln&&setInterval((function(){if(s.A.currentContainer&&s.A.casinoOptions.ui.full_screen_prompt){s.A.isLandscapeSafariIos=!s.A.isPortrait,(s.A.isLandscapeSafariIos||gn)&&(cn=Math.min(screen.width,screen.height),s.A.isNeedScrollTopIosSafari=window.innerHeight{window.scrollTo(0,2),window.scrollTo(0,0)}),80)):(s.A.pixiApp.renderer.plugins.interaction.autoPreventDefault=!0,un.style.zIndex=-1,mn.overflow="hidden",mn.height="100%",document.documentElement.style.height="100%",document.documentElement.style.overflow="hidden"),un.style.display=s.A.isPortrait?"none":"inline")),s.A.isPortrait&&0!==window.scrollY&&window.scrollTo(0,0),!dn&&s.A.isNeedScrollTopIosSafari&&(s.A.currentFader||s.A.isPortrait||"thing-games-utils/safari-arrow-up"===s.A.currentContainer.name||s.A.showModal("thing-games-utils/safari-arrow-up"))}}),100);class yn{isLogOutEnabled=!1;logOutTriggerInterval=0;isPopupActive=!1;popupTriggeredTime=0;sessionStart=Date.now();get isNeedToShowPopup(){var t=wn.isActive();return!(this.isPopupActive||!this.isLogOutEnabled||t)&&(0!==this.logOutTriggerInterval&&(this.sessionTime>this.logOutTriggerInterval&&this.timeFromLastPopupShown>=this.logOutTriggerInterval))}get sessionTime(){return Date.now()-this.sessionStart}get timeFromLastPopupShown(){return Date.now()-this.popupTriggeredTime}get timeToNextTrigger(){var t=Math.max(this.logOutTriggerInterval-this.timeFromLastPopupShown,0);return this.isLogOutEnabled?t:-1}}const _n=yn;class bn{constructor(){this.model=new _n,this.checkTimeoutId=void 0}isActive(){return this.model.isPopupActive}initialize(){this.checkBounded=this.checkForReality.bind(this),Yi.A.addListener(((t,e,i)=>this._gameEventHandler(t,e,i)))}startSession(t=216e6){this.model.sessionStart=Date.now(),this.model.popupTriggeredTime=Date.now(),this.model.logOutTriggerInterval=t,this.model.isLogOutEnabled=void 0!==t&&t>0,this._scheduleLogOutCheck()}updateLogOutLastPopupTriggeredTime(){this.model.popupTriggeredTime=Date.now()}clearLogOutSchedule(){var t;void 0!==this.checkTimeoutId&&null!==(t=this.model)&&void 0!==t&&t.isLogOutEnabled&&clearTimeout(this.checkTimeoutId)}checkForReality(){if(this.model.isNeedToShowPopup){this.model.isPopupActive=!0;var t=(0,tt.A)("log_out");s.A.showQuestion("",t,"buttons.ok",(()=>{s.A.SharedAPI.gotoHome()}))}this._scheduleLogOutCheck()}_scheduleLogOutCheck(){if(this.clearLogOutSchedule(),this.model.isLogOutEnabled){var t=this.model.timeToNextTrigger;this.checkTimeoutId=setTimeout(this.checkBounded,t)}}_gameEventHandler(t,e,i){switch(t){case Vi.A.GAME_INITIALIZED:this.startSession(this._logOutInterval);break;case Vi.A.FINISH_SPIN_ANIMATIONS:case Vi.A.FINISH_ROUND_ANIMATIONS:this.checkForReality();break;case Vi.A.PRE_PLAY:this.clearLogOutSchedule(),this.updateLogOutLastPopupTriggeredTime()}}get _logOutInterval(){var t;return(null===(t=s.A.casinoOptions)||void 0===t||null===(t=t.license_rules)||void 0===t||null===(t=t.log_out)||void 0===t?void 0:t.interval)||0}}const xn=new bn;class Tn{isRealityCheckEnabled=!1;realityCheckTriggerInterval=0;isPopupActive=!1;popupTriggeredTime=0;sessionStart=Date.now();userOverallBet=0;userOverallWin=0;get isNeedToShowPopup(){var t=xn.isActive();return!(this.isPopupActive||!this.isRealityCheckEnabled||t)&&(0!==this.realityCheckTriggerInterval&&(this.sessionTime>this.realityCheckTriggerInterval&&this.timeFromLastPopupShown>=this.realityCheckTriggerInterval))}get userOverallLose(){return Math.max(this.userOverallBet-this.userOverallWin,0)}get sessionTime(){return Date.now()-this.sessionStart}get timeFromLastPopupShown(){return Date.now()-this.popupTriggeredTime}get timeToNextTrigger(){var t=Math.max(this.realityCheckTriggerInterval-this.timeFromLastPopupShown,0);return this.isRealityCheckEnabled?t:-1}}const En=Tn;class Sn{constructor(){this.model=new En,this.checkTimeoutId=void 0}isActive(){return this.model.isPopupActive}initialize(){this.checkBounded=this.checkForReality.bind(this),Yi.A.addListener(((t,e,i)=>this._gameEventHandler(t,e,i)))}startSession(t=216e6){this.model.sessionStart=Date.now(),this.model.popupTriggeredTime=Date.now(),this.model.userOverallBet=0,this.model.userOverallWin=0,this.model.realityCheckTriggerInterval=t,this.model.isRealityCheckEnabled=void 0!==t&&t>0,this._scheduleRealityCheck()}restartRealityCheckSession(){this.model.sessionStart=Date.now(),this.model.popupTriggeredTime=Date.now(),this._scheduleRealityCheck()}updateRealityCheckLastPopupTriggeredTime(){this.model.popupTriggeredTime=Date.now()}clearRealityCheckSchedule(){var t;void 0!==this.checkTimeoutId&&null!==(t=this.model)&&void 0!==t&&t.isRealityCheckEnabled&&clearTimeout(this.checkTimeoutId)}checkForReality(){this.model.isNeedToShowPopup&&(this.model.isPopupActive=!0,s.A.showModal("thing-games-utils/reality-check-popup",(()=>{this.model.isPopupActive=!1,xn.checkForReality(),this.model.popupTriggeredTime=Date.now()}))),this._scheduleRealityCheck()}updateSessionBet(t){t>0&&(this.model.userOverallBet+=t)}updateSessionWin(t){t>0&&(this.model.userOverallWin+=t)}_scheduleRealityCheck(){if(this.clearRealityCheckSchedule(),this.model.isRealityCheckEnabled){var t=this.model.timeToNextTrigger;this.checkTimeoutId=setTimeout(this.checkBounded,t)}}_gameEventHandler(t,e,i){switch(t){case Vi.A.GAME_INITIALIZED:this.startSession(this._realityCheckInterval);break;case Vi.A.FINISH_SPIN_ANIMATIONS:case Vi.A.FINISH_ROUND_ANIMATIONS:this.checkForReality();break;case Vi.A.PRE_PLAY:this.clearRealityCheckSchedule(),this.updateRealityCheckLastPopupTriggeredTime();break;case Vi.A.PLAY:this.updateSessionBet(s.A.data.balanceChargedForSpin),this.updateSessionWin(i.win)}}get _realityCheckInterval(){var t;return(null===(t=s.A.casinoOptions)||void 0===t||null===(t=t.license_rules)||void 0===t||null===(t=t.reality_check)||void 0===t?void 0:t.interval)||0}}const wn=new Sn;var Pn=i(1233),In=i(230),Rn={finish:"close",check_card:"gamble"},Cn={command:"init"},On=new URLSearchParams(window.location.search).get("lang");function Mn(){s.A.casinoOptions=window.__OPTIONS__,On&&(s.A.casinoOptions.rules_url=s.A.casinoOptions.rules_url.replace("/"+s.A.casinoOptions.locale+"/","/"+On+"/"),s.A.casinoOptions.locale=On),s.A.casinoOptions.ui.logo_visible="hidden"!==s.A.casinoOptions.ui.logo,s.A.casinoOptions.ui.isTinyAutospinsDialog="tiny"===s.A.casinoOptions.ui.autospins_dialog,s.A.casinoOptions.ui.isAutospinAvailable="disable"!==s.A.casinoOptions.ui.autospins_dialog,Pn.utils.isMobile.any&&(s.A.casinoOptions.ui.home_button=!0),s.A.casinoOptions.actions.return||(s.A.casinoOptions.ui.home_button=!1),s.A.casinoOptions.history_url=s.A.casinoOptions.actions.history&&s.A.casinoOptions.actions.history.link}Mn(),wn.initialize(),xn.initialize();var Bn,Dn,Ln,kn=new en(s.A.casinoOptions);function Nn(){Dn=Date.now()}var Fn=5e3;function Gn(){if(s.A.casinoOptions.replay)return!1;if(Ln)Nn();else if(Date.now()>Dn+Fn-500)return!0}function Un(t){s.A.data.lastDataWithBalanceForBalanceChecking&&(isNaN(s.A.data.lastDataWithBalanceForBalanceChecking.balance)?"object"!=typeof s.A.data.lastDataWithBalanceForBalanceChecking.balance||isNaN(s.A.data.lastDataWithBalanceForBalanceChecking.balance.wallet)||(s.A.data.lastDataWithBalanceForBalanceChecking.balance.wallet=t):s.A.data.lastDataWithBalanceForBalanceChecking.balance=t,s.A.data.latestReceivedBalance=t,s.A.currentScene&&s.A.currentScene.refreshBalanceFast&&s.A.currentScene.refreshBalanceFast())}function Hn(t){var e=t.balance;return"object"==typeof e&&(e=e.wallet),e}function Xn(t){return t&&!isNaN(Hn(t))}class jn{constructor(){jn.instance=this,s.A.SharedAPI=this,this.isRequestCommandAvailable=this.isRequestCommandAvailable.bind(this),s.A.__APIBalanceUpdateInterval&&clearInterval(s.A.__APIBalanceUpdateInterval),s.A.__APIBalanceUpdateInterval=setInterval((()=>{Gn()&&this.request({command:"init",options:{balance:!0}},null,!0).then((t=>{if(Gn()&&t){var e=Hn(t);"number"==typeof e&&e!==s.A.data.latestReceivedBalance&&Un(e)}})).finally((()=>{Nn()}))}),1e3),this.onApiReady()}restartGame(t){Vn(t)}initCurrency(t,e){var i=t.options.currency,r=i.subunits,n=Math.log10(r);this.subUnits=r,jn.subunitsDigitsCount=n;var o,l=t=>{var e=(t/r).toString(),i=e.split("."),n=e.split("e");return i.length>1&&n.length>1?i[1].split("e")[0].replace(/0+$/gm,"").length+Math.abs(+n[1]):i.length>1?i[1].replace(/0+$/gm,"").length:n.length>1?Math.abs(+n[1]):0};Array.isArray(e)||(e=[e]);var h=(()=>{var e=t.options.paytable||t.options.paytables||t.paytable||{},i=Object.values(e).flat(1/0);return i.length&&isNaN(i[0])&&(i=i.map((t=>Object.values(t))).flat(1/0)),i})(),u=h.map((t=>e.map((e=>(e||0)*t)))).flat().filter((t=>t>0)).map(l);o=Math.max.apply(null,u),o=Math.min(n,o),s.A.data.currencyDigits=Math.max(i.exponent||0,o),s.A.data.currency=(0,a.A)("this.options.currency.code",t)||"BTC";var c,p=(t.balance/this.subUnits).toString().split(".");c=p.length>1?p[1].replace(/0+$/gm,"").length:0,c=Math.min(jn.subunitsDigitsCount,c),s.A.data.balanceDigitsCount=Math.max(s.A.data.currencyDigits,c)}openHistory(){Yi.A.track("go_history"),jn.actionExec(s.A.casinoOptions.actions.history)}globalDataHandler(t){if(t&&(s.A.data.latestData=t,t.options&&(s.A.data.currencyDivider=t.options.currency.subunits),t.flow||(t.flow={state:t.game.state,available_actions:t.available_commands,command:t.requested_command}),t.hasOwnProperty("balance")&&(isNaN(t.balance)&&(t.gameTotalWin=t.balance.game,t.balance.game>0&&"closed"===t.flow.state&&(t.balance.hasOwnProperty("free_rounds")?t.balance.free_rounds+=t.balance.game:t.balance.wallet+=t.balance.game,t.balance.game=0),t.free_rounds&&(t.free_rounds.win=t.balance.free_rounds,"played"===t.free_rounds.status&&(t.balance.wallet+=t.balance.free_rounds,t.balance.free_rounds=0)),t.balance=t.balance.wallet),s.A.data.latestReceivedBalance=t.balance),t.flow.available_actions)){var e={};for(var i of t.flow.available_actions)Rn.hasOwnProperty(i)&&(i=Rn[i]),e[i]=!0;t.available_commands=e}}setGameId(t){kn.currentGameId!==t&&this.request(kn.lobbyUrl+(kn.lobbyUrl.indexOf("?")>0?"&":"?")+"game="+t+"&from="+kn.currentGameId,s.A.currentFader).then((e=>{kn.setCasinoOptions(e),Bn=null,window.initializeCasinoOptions(e),Mn();try{window.history.replaceState(t,t,e.game_page_url)}catch(i){}})).catch((()=>{this.showError()}))}request(t,e=null,i=!1){i||Nn();var r=this.currentRequestInProgress,n="string"==typeof t,a=Er.A.promise(((e,a)=>{var s=()=>{if(qi.A.isReplayMode())return e(qi.A.getNextResponse());(n?kn.requestURL(t,null,i):kn.request(t,i)).then(e).catch(a)};r?r.finally(s):s()}),e||s.A.currentContainer).then((e=>{if(this.currentRequestInProgress===a&&(this.currentRequestInProgress=null,Ln=!1),!n){if(this.handleDataErrors(e,i))return s.A.data.lastDataWithBalanceForBalanceChecking&&Un(Hn(s.A.data.lastDataWithBalanceForBalanceChecking)),null;e.requested_command=t.command,Xn(e)&&(s.A.data.lastDataWithBalanceForBalanceChecking=e),i||(this.checkForMessagesToShow(e),this.globalDataHandler(e)),i||t!==Cn||(Yi.A.track(Vi.A.BALANCE_UPDATE,null,{amount:e.balance}),Yi.A.track(Vi.A.GAME_LOADED,s.A.casinoOptions.identifier)),Yi.A.track(Vi.A.API_RESPONSE,e.requested_command,{responseData:e,isBalanceCheckRequest:i})}})).catch((()=>{this.currentRequestInProgress===a&&(this.currentRequestInProgress=null,Ln=!1),s.A.data.lastDataWithBalanceForBalanceChecking&&Un(Hn(s.A.data.lastDataWithBalanceForBalanceChecking)),i||this.showError()})).finally((()=>{this.currentRequestInProgress===a&&(this.currentRequestInProgress=null,Ln=!1),i||Nn()}));return this.currentRequestInProgress=a,Ln=!0,a}isRequestCommandAvailable(t){return!t.command||"init"===t.command||this.isCommandAvailable(t.command)}initGame(t=s.A.currentFader){return qi.A.initGame(),this.request(Cn,t)}onApiReady(){In.projectDesc.disableInitDataPreparing||kn.prepareRequest(Cn)}showRules(t=""){var e=s.A.showModal("ui/html-popup").findChildByName("html");Bn?(e.domScripts=Bn.scripts,e.innerHTML=Bn.content):(e.domScripts=[],e.innerHTML=(0,tt.A)("loading"),this.requestRulesContent(t).then((({content:t,scripts:i})=>{e.domScripts=i,e.innerHTML=t})))}requestRulesContent(t=""){if(Bn)return Er.A.resolve(Bn);var e=s.A.all.hasOwnProperty("slot-UI")?s.A.all["slot-UI"]:void 0;return Er.A.promise((e=>{kn.requestRules().then((i=>{var r=i?i.content:"";if(i&&i.contentUpdateScript)try{r=new Function("content",i.contentUpdateScript)(r)}catch(Ir){}Bn={content:r=""+r+"

",scripts:(null==i?void 0:i.domScripts)||[]},e(Bn)}))}),e)}isCommandAvailable(t){return s.A.data.available_commands&&s.A.data.available_commands[t]}playGame(t,e,i){return this.request({command:"play",options:{bet:t,risk_level:e,rows:i}})}handleDataErrors(t,e){if(!t)return e||this.showError(),!0;if(t.errors&&t.errors.length>0){if(!e){var i=t.errors[0],r=null==i?void 0:i.code;700===r?this.showCustomButtonsMessage(i):this.showError(r,null==i?void 0:i.text,i)}return!0}}showCustomButtonsMessage(t){var e=r.A.loadPrefab("thing-games-utils/sure-question700");e.findChildByName("title").text=t.desc,e.findChildByName("message").text=t.text;var i=e.findChildrenByName("btn"),n=[],a=t.buttons.filter((t=>"history"!==t.action||s.A.casinoOptions.actions.history));i.forEach(((t,e)=>{var i=a[e];t.visible=i&&!0,t.visible&&(n.push(t),t.findChildByName("label").text=i.text,t.callback=()=>{switch(Yi.A.track(Vi.A.DIALOG_BUTTON_CLICK,i.action,i),i.action){case"home":this.gotoHome();break;case"history":this.openHistory();break;case"deposit":Wn(),Vn();break;default:Vn()}})}));var o=i[1].x-i[0].x,l=-Math.round(o*(n.length-1)/2);for(var h of n)h.x=l,l+=o;s.A.showModal(e)}static actionExec(t,e=(()=>{})){if(t)switch(Yi.A.track(Vi.A.ACTION_EXEC,t.mode),t.mode){case"continue":e();break;case"open":s.A.openUrl(t.link),e();break;case"redirect":s.A.openUrl(t.link,"_top"),e();break;case"request":kn.requestURL(t.link),e();break;case"request_with_response":kn.requestURL(t.link).finally((()=>e()));break;case"back":window.history.go(-1),e();break;default:t.link&&s.A.openUrl(t.link),e()}}checkForMessagesToShow(t){t&&t.messages&&t.messages.forEach((t=>{var e=r.A.loadPrefab("thing-games-utils/api-message");e.findChildByName("title").text=t.title,e.findChildByName("message").text=t.text;var i,n=e.findChildByName("close-btn"),a=e.findChildrenByName("btn"),o=[],l=()=>{t.intrusive||s.A.hideModal(i)};n.visible=!t.intrusive,n.callback=l,a.forEach(((e,i)=>{var r=t.actions?t.actions[i]:null;e.visible=!!r,e.visible&&(o.push(e),e.findChildByName("label").text=r.text,e.callback=()=>{jn.actionExec(r,l)})}));var h=a[1].x-a[0].x,u=-Math.round(h*(o.length-1)/2);for(var c of o)c.x=u,u+=h;i=s.A.showModal(e)}))}setFatalErrorWithExpiry(t,e=36e5){var i={value:t,expiery:(new Date).getTime()+e};localStorage.setItem("fatalError",JSON.stringify(i))}getFatalErrorWithExpiry(){var t=localStorage.getItem("fatalError");if(!t)return null;var e=JSON.parse(t);return(new Date).getTime()>e.expiry?(localStorage.removeItem(key),null):e.value}showError(t="some_error",e=null,i=null){var r=s.A.projectDesc.errorPhrasesPrefix+t;tt.A.has(r)||(r="errors.default");var n=301==t,a=s.A.casinoOptions.actions.deposit,o=103===t,l=104===t,h=201==t,u=110===t,c=[101,202,203,204,600].includes(t);n&&!a&&(r+="nodep");var p="",d=e||(0,tt.A)(r,{code:t||0});if(Yi.A.track(Vi.A.ERROR,t,{messageText:d,sourceError:i}),n&&a)s.A.showQuestion(p,d,"buttons.deposit",(()=>{Wn(),Yn(t)}),"buttons.ok",Yn);else if(o||l||h||u)s.A.showQuestion(p,d,"buttons.ok",(()=>{Yi.A.track(Vi.A.GO_HOME),jn.actionExec(s.A.casinoOptions.actions.return)}),void 0,(()=>{Yn(t)}));else if(c){var f=this.getFatalErrorWithExpiry(),g=Number(localStorage.getItem("fatalErrorCount"));if(!f||f&&f!==t)return this.setFatalErrorWithExpiry(t),void s.A.showQuestion(p,d,"buttons.ok",(()=>{localStorage.setItem("fatalErrorCount",1),Yn(t)}),void 0,(()=>{Yn(t)}));if(f&&g<=3&&f===t){var m=g+1;localStorage.setItem("fatalErrorCount",m),s.A.showQuestion(p,d,"buttons.ok",(()=>{Yn(t)}),void 0,(()=>{Yn(t)}))}else localStorage.removeItem("fatalErrorCount"),localStorage.removeItem("fatalError"),s.A.showQuestion(p,d,"buttons.home",(()=>{this.gotoHome()}),void 0,(()=>{Yn(t)}))}else s.A.showQuestion(p,d,"buttons.ok",(()=>{Yn(t)}),void 0,(()=>{Yn(t)}))}static sendSentryError(t){var e=new Error(t);setTimeout((()=>{throw e}),0)}gotoHome(){Yi.A.track(Vi.A.GO_HOME),jn.actionExec(s.A.casinoOptions.actions.return)}}function Wn(){Yi.A.track("go_deposit",null,{target:s.A.casinoOptions.actions.deposit.link}),jn.actionExec(s.A.casinoOptions.actions.deposit)}function Vn(t){s.A.closeAllScenes(t)}function Yn(){Vn()}var zn="\n.casino-modal h1 {\n\ttext-align: center;\n\tfont-size: 120%;\n\tmargin:9px 0;\n\tmargin-top: 30px;\n\tcolor: #ffffff;\n}\n.casino-modal h2 {\n\ttext-align: center;\n\tfont-size: 110%;\n\tmargin:7px 0;\n\tmargin-top: 20px;\n\tcolor: #ffffff;\n}\n\n.casino-modal {\n\tline-height: 1.6;\n\tfont-family: Arial;\n\t-webkit-text-size-adjust: 100%;\n\tcolor: #b2b2b2;\n\t-webkit-mask-image:linear-gradient( to bottom, rgba(0,0,0,0), rgba(0,0,0,1) 40px, rgba(0,0,0,1) calc(100% - 40px), rgba(0,0,0,0) );\n\tmask-image:linear-gradient( to bottom, rgba(0,0,0,0), rgba(0,0,0,1) 40px, rgba(0,0,0,1) calc(100% - 40px), rgba(0,0,0,0) );\n}\n\n.casino-modal th, .casino-modal td {\n\tcolor: #b2b2b2;\n\tpadding: 5px 5px;\n\tborder: 2px solid #333333;\n}\n\n.casino-modal table {\n\ttext-align: center;\n\twidth: 100%;\n\tmargin: 20px 0;\n\tborder-collapse: collapse;\n}\n\n.casino-modal-scroll {\n\tscrollbar-width: none;\n\t-ms-overflow-style: none;\n}\n\n.casino-modal-scroll::-webkit-scrollbar {\n\tdisplay: none;\n}\n";class qn extends jn{playGame(t,e,i){var r=s.A.data.bet;return Yi.A.track(Vi.A.PRE_PLAY,null,{totalBet:r,bet:r,isAutoSpin:!!s.A.currentScene.isAutoplayStarted,isFreeSpin:!1,isRespin:!1,purchasedFeature:{}}),this.request({command:"play",extra_data:{client_seed:Zr.getCurrentClientSeed()},options:{bet:t,risk_level:e,rows:i}}).then((t=>{t&&Yi.A.track(Vi.A.PLAY,null,{win:t.result,totalBet:r,bet:r,isFreeSpin:!1,isRespin:!1,isAutoSpin:!!s.A.currentScene.isAutoplayStarted,purchasedFeature:{}})}))}}const Qn=new qn;var Zn,Kn,Jn=[1,2,3,5,10,15,20,30,50,75,100,150,200,300,500,750,1e3,2e3,3e3,5e3,1e4,15e3,2e4,3e4,5e4,75e3,1e5,15e4,2e5,3e5,5e5,75e4,1e6],$n=.06,ta=60,ea="(0-16)",ia=["switzerland","danish","swedish","italian"];function ra(t){return t>9?t:"0"+t}function na(t,e){var i;return(null===(i=s.A.casinoOptions)||void 0===i||null===(i=i.license_rules)||void 0===i?void 0:i.license)===e&&(t.all.autoplayPanel.visible=!1,!0)}class aa extends ji.A{MIN_SPIN_TIME=0;MIN_SPIN_TIME_AUTOPLAY_DELAY=0;spinStartTime=0;rollInProgress=!1;constructor(){super(),this.onPlayResultReceived=this.onPlayResultReceived.bind(this)}init(){var t;super.init(),s.A.data={},this.gameTable=this.all.gameTable,Kn={},s.A.data.autoplayCount=s.A.settings.getItem("autoplayCount",10),Qn.initGame().then((t=>{if(t){Yi.A.track(Vi.A.GAME_INITIALIZED,s.A.casinoOptions.identifier),this.loadAutoplaySettings(),s.A.data.initData=t;var e=t.paytable[8].high[4]*t.options.min_bet;Qn.initCurrency(t,e);var i=s.A.data.initData.options.max_bet,r=s.A.data.initData.options.min_bet;for(var n of(Zn=[],Jn)){var o=n*r;if(o>i&&(o=i),Zn.push(o),o===i)break}this.loadDefauiltBet(),s.A.data.balance=t.balance,s.A.data.currency=(0,a.A)("game.data.initData.options.currency.symbol",this)||"BTC";var l=s.A.settings.getItem("restoringData");for(var h in this.restoringDataArray=[],l){var u=l[h];this.restoringDataArray.push(u),s.A.data.balance-=u.result,s.A.data.balance+=u.bets.bet}this.restoreDelay=20,s.A.casinoOptions.ui.max_autospin_value&&(this.all.autoplayNumberInput.max=s.A.casinoOptions.ui.max_autospin_value),this.gameTable.initializePaytable(),this.all["provability-panel"].applyResult(t),s.A.data.provability.seedLimits=ea,na(this,"netherlands")}}));var e=s.A.data.balance;Object.defineProperty(s.A.data,"balance",{get:()=>e,set(t){e!==t&&Yi.A.track(Vi.A.BALANCE_UPDATE,null,{amount:t}),e=t},configurable:!0}),this.spinStartTime=0,this.MIN_SPIN_TIME=(null===(t=s.A.casinoOptions)||void 0===t||null===(t=t.license_rules)||void 0===t?void 0:t.min_spin_time)||0,this.MIN_SPIN_TIME_AUTOPLAY_DELAY=Math.round(this.MIN_SPIN_TIME*$n),this.rollInProgress=!1}enablePlayButton(t=!0){if(t){var e;if(ia.includes(null===(e=s.A.casinoOptions)||void 0===e||null===(e=e.license_rules)||void 0===e?void 0:e.license)||na(this,"netherlands"))return;var i=this.getFramesToToNextSpin();i>1?br.delay((()=>this.all.playButton.enable()),i):this.all.playButton.enable()}else this.all.playButton.disable()}enableGameUI(t=!0){var e;for(var i of(this.all.gameUI.interactiveChildren=t,this.all.gameUI.findChildrenByType(ar.A)))i.parent.alpha>.99&&(i.alpha=t?1:.35);(ia.includes(null===(e=s.A.casinoOptions)||void 0===e||null===(e=e.license_rules)||void 0===e?void 0:e.license)||na(this,"netherlands"))&&(t?(this.all.playButton.enable(),this.rollInProgress=!1):s.A.data.autoplayCurrentCount||this.all.playButton.disable())}loadAutoplaySettings(){s.A.data.autoplayCount=s.A.settings.getItem("autoplayCount",this.all.autoplayNumberInput._values[0])}saveAutoplaySettings(){s.A.settings.setItem("autoplayCount",s.A.data.autoplayCount)}get isRightPanelVisible(){return!s.A.isPortrait||!this.isLeftPanelTurnedOn}get isLeftPanelVisible(){return!s.A.isPortrait||this.isLeftPanelTurnedOn}toggleTableView(){this.isLeftPanelTurnedOn=!this.isLeftPanelTurnedOn}showRules(){Qn.showRules()}getPreloadingProgress(){return 1/(Qn.requestsInProgressCount+1)}getBet(){return s.A.data.bet}chargeBetFromBalance(){s.A.data.balance-=this.getBet(),s.A.data.balance<0&&(s.A.data.balance=0),this.all["balance-label"].refreshNow()}get isAutoplayStarted(){return s.A.data.autoplayCurrentCount}stopAutoplay(){var t;s.A.data.autoplayCurrentCount=0,ia.includes(null===(t=s.A.casinoOptions)||void 0===t||null===(t=t.license_rules)||void 0===t?void 0:t.license)||na(this,"netherlands")?this.rollInProgress&&this.enablePlayButton(!1):this.all.playButton.interactive&&this.rollInProgress&&(this.enablePlayButton(!1),this.enablePlayButton())}playButtonClick(){this.isAutoplayStarted?this.stopAutoplay():this.gameTable.ballWaitingPath||this.rollInProgress||(s.A.data.autoPanelActiveted&&(s.A.data.autoplayCurrentCount=s.A.data.autoplayCount-1,s.A.settings.setItem("autoplayCount",s.A.data.autoplayCount)),this.saveBetAsDefault(),this.startRoll(),this.all["win-panel"].gotoLabelRecursive("hide"))}isRestoringDataAwaiting(){return this.restoringDataArray&&this.restoringDataArray.length>0}update(){super.update(),this.isRestoringDataAwaiting()?this.restoreDelay>0?this.restoreDelay--:(this.startRoll(this.restoringDataArray.shift()),this.restoreDelay=ta):this.delayToNextAutoreplay>0?this.delayToNextAutoreplay--:s.A.data.autoplayCurrentCount>0&&(s.A.data.balance1,this.rollInProgress&&br.delay((()=>this.rollInProgress=!1),r)}}getFramesToToNextSpin(){return this.MIN_SPIN_TIME>0?Math.round((this.MIN_SPIN_TIME-(Date.now()-this.spinStartTime))*$n):0}onBallFinish(t,e,i){var r=t.result;delete Kn[i],s.A.settings.setItem("restoringData",Kn),0===e&&this.enableGameUI();var n=new Date,a=this.getBet();this.all.resultList.addEntry({bet:a,win:r-a,payout:r/a,time:ra(n.getHours())+":"+ra(n.getMinutes())+":"+ra(n.getSeconds())}),s.A.data.balance=0===e?s.A.data.latestData.balance:Math.max(0,t.balance-e*this.getBet()),s.A.data.winToShow=r,this.all["provability-panel"].applyResult(t),this.all["win-panel"].gotoLabelRecursive("on-win"),r/a>1.00001?H.A.play("big_win"):H.A.play("win_sound"),Yi.A.track(Vi.A.FINISH_ROUND_ANIMATIONS)}refreshBalanceFast(){s.A.data.balance=s.A.data.latestReceivedBalance,this.all["balance-label"].refreshNow(),this.all["balance-label"].update()}setBet(t){for(var e of Zn)if(e>=t)return void(s.A.data.bet=e);s.A.data.bet=Zn[Zn.length-1]}saveBetAsDefault(){s.A.settings.setItem("bet",s.A.data.bet)}loadDefauiltBet(){this.setBet(s.A.settings.getItem("bet",s.A.data.initData.options.default_bet||s.A.data.initData.options.min_bet))}increaseBet(){var t=Zn.indexOf(this.getBet())+1;t=Math.max(0,t),t=Math.min(Zn.length-1,t),this.setBet(Zn[t]),this.saveBetAsDefault()}decreaseBet(){var t=Zn.indexOf(this.getBet())-1;t=Math.max(0,t),t=Math.min(Zn.length-1,t),this.setBet(Zn[t]),this.saveBetAsDefault()}maximizeBet(){this.setBet(Zn[Zn.length-1]),this.saveBetAsDefault()}minimizeBet(){this.setBet(Zn[0]),this.saveBetAsDefault()}get isBetCanBeIncreased(){return!s.A.data.autoplayStarted&&Zn&&this.getBet()Zn[0]}_onRenderResize(){this.switchPanelsInstantly(),this.isLeftPanelTurnedOn=!1}switchPanelsInstantly(){this.all["left-panel-switcher"].applyInstantly(),this.all["right-panel-switcher"].applyInstantly()}activateAutoPanel(){s.A.data.autoPanelActiveted=!0,this.all.manualGameBtn.enable(),this.all.autoGameBtn.disable()}deactivateAutoPanel(){s.A.data.autoPanelActiveted=!1,this.all.manualGameBtn.disable(),this.all.autoGameBtn.enable()}static get anySoundEnabled(){return s.A.Sound.soundEnabled||s.A.Sound.musicEnabled}}const sa=aa;var oa=i(4581);class la extends Wi.A{init(){super.init(),this.applyForceWordsBreaking(),this.applyWorldWrapping()}applyForceWordsBreaking(){tt.A.isCurrentLanguageHieroglyphic()&&(this.breakWords=!0)}applyWorldWrapping(){this.style&&(this.style.wordWrapWidth=s.A.isPortrait?this.maxWidthPortrait:this.maxWidthLandscape,this.style.wordWrap=!0,this.updateSize())}_onRenderResize(){this.applyWorldWrapping()}get maxHeightLandscape(){return this._maxHeightLandscape}set maxHeightLandscape(t){this._maxHeightLandscape=t,s.A.isPortrait||0===t||this.updateSize()}get maxHeightPortrait(){return this._maxHeightPortrait}set maxHeightPortrait(t){this._maxHeightPortrait=t,s.A.isPortrait&&0!==t&&this.updateSize()}get breakWords(){return this.style.breakWords}set breakWords(t){this.style.breakWords=t}recalculateTextSize(){this.style&&(this.maxWidth=this.style.wordWrapWidth);var{scale:t,_texture:e}=this,i=t.x,r=t.y,n=super.recalculateTextSize(),a=s.A.isPortrait?this._maxHeightPortrait:this._maxHeightLandscape;if(a>0&&t.y*e.height>a){var o=a/e.height;if(t.x!==o||t.y!==o)return t.set(o),(i!==o||r!==o)&&!!this.parent}return n}}class ha extends n.A{init(){super.init(),this.applyOrientation()}applyOrientation(){this.__currentOrientationIsPortrait=s.A.isPortrait,s.A.isPortrait?(this.x=this.portraitX,this.y=this.portraitY,this["scale.x"]=this.portraitScaleX,this["scale.y"]=this.portraitScaleY,super.alpha=this.portraitAlpha,this.rotation=this.portraitR,this._callHandler(this.onPortrait)):(this.x=this.landscapeX,this.y=this.landscapeY,this["scale.x"]=this.landscapeScaleX,this["scale.y"]=this.landscapeScaleY,this.alpha=this.landscapeAlpha,this.rotation=this.landscapeR,this._callHandler(this.onLandscape))}_callHandler(t){this.visible=this.alpha>.015&&Math.abs(this.scale.x)>.0015&&Math.abs(this.scale.y)>.0015,!!t&&(0,u.A)(t,this)}update(){this.visible&&super.update()}_onRenderResize(){this.__currentOrientationIsPortrait!==s.A.isPortrait&&this.applyOrientation()}}class ua extends O.A{init(){super.init(),this.rSpeed=Math.random()-.5,this.rotation=Math.random(),this.life=3+Math.random(),this.scl=.6*Math.random()+.2,this.scale.x=this.scl,this.scale.y=this.scl}update(){this.xSpeed+=.3*(Math.random()-.5),this.ySpeed+=.3*(Math.random()-.6),this.xSpeed*=.95,this.ySpeed*=.95,super.update(),this.life-=.1,this.life<.001?this.remove():this.life<=1&&(this.scale.x=this.scl*this.life,this.scale.y=this.scl*this.life)}}const ca=i(9372).A;var pa=i(1233),da=new pa.Point(0,0),fa=new pa.Point(1,1),ga=new pa.Point,ma=new pa.Point;class Aa extends n.A{init(){super.init(),this.recalculateSize()}_onRenderResize(){this.recalculateSize()}recalculateSize(){this.fixed&&this.parent?((this.relativeX||this.relativeY)&&(ga.x=Math.round(this._xPos*s.A.W),ga.y=Math.round(this._yPos*s.A.H),this.parent.toLocal(ga,s.A.stage,ga,!1),this.relativeX&&(this.x=ga.x),this.relativeY&&(this.y=ga.y)),(this.resizeX||this.resizeY)&&(this.parent.toLocal(da,s.A.stage,ga,!1),this.parent.toLocal(fa,s.A.stage,ma,!1),this.resizeX&&(this.scale.x=s.A.W/s.A.projectDesc.width*(ma.x-ga.x||1e-6)),this.resizeY&&(this.scale.y=s.A.H/s.A.projectDesc.height*(ma.y-ga.y||1e-6)))):(this.resizeX&&(this.scale.x=s.A.W/s.A.projectDesc.width),this.resizeY&&(this.scale.y=s.A.H/s.A.projectDesc.height),this.relativeX&&(this.x=Math.round(s.A.W*this._xPos)),this.relativeY&&(this.y=Math.round(s.A.H*this._yPos)))}update(){this.fixed&&this.recalculateSize(),super.update()}set xPos(t){this._xPos=t,this.relativeX&&this.recalculateSize()}get xPos(){return this._xPos}set yPos(t){this._yPos=t,this.relativeY&&this.recalculateSize()}get yPos(){return this._yPos}}var va={INIT:"init",PLAY:"play",ON_RESPONSE:"on_response",ROUND_FINISHED:"round_finished",ON_INIT_RESPONSE:"on_init_response",UNLOCK_FLOW:"unlock_flow",LOCK_FLOW:"lock_flow"};var ya={ON_RESPONSE:"api_on_response",ON_INIT_RESPONSE:"api_on_init_response"};class _a extends jn{constructor(){super(),this.extensions=[]}init(){ca.on(va.INIT,this.initGame,this),ca.on(va.PLAY,this.playGame,this),this.playCommand="spin",this.freeSpinCommand="freespin",this.extensions.forEach((t=>t.init()))}initGame(t=s.A.currentFader){super.initGame(t).then((t=>{s.A.data.initData=t,s.A.data.latestRecievedBalance=t.balance,s.A.data.balance=t.balance,s.A.data.latestData=null,ca.emit(ya.ON_INIT_RESPONSE,t),ca.emit(va.ON_INIT_RESPONSE,t)}))}globalDataHandler(t){isNaN(t.balance)&&(s.A.data.balance_game=t.balance.game,s.A.data.balance_free_rounds=t.balance.free_rounds),super.globalDataHandler(t)}playGame(){this.request({command:s.A.data.isFreeSpin?this.freeSpinCommand:this.playCommand,options:{bet:s.A.data.totalBet,bonus:!!s.A.data.currentFreeRounds,...s.A.data.additionalPlayData}}).then((t=>{s.A.data.latestData=t,s.A.data.latestRecievedBalance=t.balance,s.A.data.balance=t.balance,ca.emit(ya.ON_RESPONSE,t),ca.emit(va.ON_RESPONSE,t)}))}}var ba=new _a;s.A.api=ba;class xa extends ji.A{init(){super.init(),ba.init(),ba.requestRulesContent().then((t=>{s.A.all["rules-html-overlay"].domScripts=t.scripts,s.A.all["rules-html-overlay"].innerHTML=t.content}))}}const Ta=xa;class Ea extends n.A{}class Sa extends Aa{onContinue(){this.gotoLabelRecursive("close")}onLeaveTheGame(){this.gotoLabelRecursive("close"),s.A.SharedAPI.gotoHome()}hidePopup(){s.A.hideModal(this)}get sessionTime(){return Math.round(wn.model.sessionTime/60/1e3)}get sessionBets(){return wn.model.userOverallBet}get sessionWin(){return wn.model.userOverallWin}get sessionLose(){return wn.model.userOverallLose}}var wa=i(1233),Pa=16,Ia=50;class Ra extends wa.Container{init(){super.init(),this.entries=[],this.entriesMap=new WeakMap;var t=s.A.settings.getItem("history");if(t)for(var e of(t.reverse(),t))this.addEntry(e,!0)}addEntry(t,e=!1){for(this.entries.unshift(t);this.entries.length>Pa;)this.entriesMap.get(this.entries.pop()).startRemoving();var i=r.A.loadPrefab("result-list-item");i.setData(t),this.entriesMap.set(t,i),this.addChild(i);var n=0;for(var a of this.entries)(i=this.entriesMap.get(a)).setY(n,e),n+=Ia;s.A.settings.setItem("history",this.entries)}}class Ca extends n.A{update(){super.update(),s.A.isNeedScrollTopIosSafari&&!s.A.isPortrait||s.A.hideModal(this)}}var Oa=i(1233),Ma=new Oa.Point;class Ba extends n.A{init(){super.init(),this.curInterval=Math.round(Math.random()*this.intervalRandom)}enable(){this.enabled=!0}disable(){this.enabled=!1}setSpeed(t){this.speed=t}update(){this.enabled&&this.worldVisible&&(this.delay>0?this.delay--:this.curInterval>0?this.curInterval--:(this.spawn(),this.curInterval=this.getNextInterval())),super.update()}getNextInterval(){return this.intervalRandom>0?this.interval+Math.round(Math.random()*this.intervalRandom):this.interval}setTargetContainer(t){this._container=t?t instanceof n.A?t:(0,a.A)(t,this):s.A.currentContainer}spawn(){this._container||this.setTargetContainer(this.container);var t=r.A.loadPrefab(this.prefabToSpawn);if(this.applyRotation&&(t.rotation=this.getGlobalRotation()),this._container.addChild(t),t.parent.toLocal(Ma,this,t),0!==this.speed||0!==this.speedRandom){var e=this.speed+Math.random()*this.speedRandom;Da.x=e,t.parent.toLocal(Da,this,La,!0),t.xSpeed=La.x-t.x,t.ySpeed=La.y-t.y}}}var Da=new Oa.Point,La=new Oa.Point,ka=i(1233),Na=new ka.Point,Fa=2*Math.PI;class Ga extends n.A{init(){super.init(),this.curInterval=this.interval}spawn(){this._container||(this.container?this._container=(0,a.A)(this.container,this):this._container=s.A.currentContainer),this._container.toLocal(Na,this,Ua);for(var t=Fa/(this.count+this.countRandom*Math.random()),e=0;e2&&(e.length=2,t=e.join("."))}return t}update(){if(this.htmlInput){if(this.text!=this.htmlInput.value){var t=this.filterText(this.htmlInput.value);this.htmlInput.value=t,this.text=t,"number"!==this.inputType&&(this.htmlInput.selectionEnd=this.htmlInput.selectionStart=this.htmlInput.value.length),this.onChange&&(0,u.A)(this.onChange,this)}(!this.worldVisible||this.worldAlpha<.01)&&this.blurInput()}this.cursorObject&&(this.cursorObject.x="center"===this.style.align?this.texture.width/2:this.texture.width,this.cursorObject.visible=this.isFocused),super.update()}set text(t){this.maxInputLen&&(t=t.substr(0,this.maxInputLen)),super.text=t,this.htmlInput&&(this.htmlInput.value=this.filterText(t))}get text(){return super.text}get isEmpty(){return!this.text.trim()}focus(){s.A.addOnClickOnce((t=>{this.htmlInput||(this.htmlInput=document.createElement("input"),this.htmlInput.style.opacity=0,"number"===this.inputType&&(this.htmlInput.pattern="d*"),this.htmlInput.style.position="absolute",this.htmlInput.style.pointerEvents="none",this.htmlInput.addEventListener("keydown",(t=>{13===t.keyCode&&this.blurInput()})),document.body.appendChild(this.htmlInput)),this.htmlInput.value=this.filterText(this.text),this.htmlInput.focus(),t.stopPropagation(),t.preventDefault()}))}static prompt(t,e,i="",n=16,a,o=null,l=null,h=null,u=!0,c="ui/prompt"){if(ja.latestPromptText=void 0,r.A.hasPrefab(c)){var p,d=s.A.showQuestion(t,e,a,(()=>{ja.latestPromptText=p.text.trim(),o&&o(ja.latestPromptText)}),l,(()=>{h&&h()}),u,c);return(p=d.findChildrenByType(ja)[0]).text=i,p.maxInputLen=n,p.focus(),d}var f=window.prompt(t,i)||"";(f=f.trim()).length>n&&(f=f.substr(0,n)),f?o(f):h&&h()}}var Wa={};Wa.AlignedScrollArea=C,Wa.BG=U,Wa.Ball=Z,Wa.BaseRootScene=ir,Wa.BgMusic=nr.A,Wa.Button=ar.A,Wa.ClickOutsideTrigger=sr,Wa.Container=n.A,Wa.DSprite=O.A,Wa.Fill=g,Wa.FlyText=or,Wa.FullscreenPopup=lr,Wa.GameTable=fr,Wa.HTMLOverlay=yr,Wa.Label=zi.A,Wa.ListItem=_r,Wa.MainMenu=sa,Wa.MoneyLabel=oa.A,Wa.MovieClip=D,Wa.MultilineText=la,Wa.NineSlicePlane=h,Wa.NumberInput=wr,Wa.OrientationTrigger=ha,Wa.ParticleSimple=ua,Wa.PaytablePreloaderScene=Ta,Wa.PrefabReference=Ea,Wa.ProgressBar=S,Wa.ProvabilityPanel=Zr,Wa.RealityCheckPopup=Sa,Wa.Resizer=Aa,Wa.ResultList=Ra,Wa.SafariArrowUp=Ca,Wa.Scene=ji.A,Wa.Scissors=R,Wa.ScrollLayer=o.A,Wa.Shape=x,Wa.Spawner=Ba,Wa.SpawnerRing=Ga,Wa.Sprite=Ha.A,Wa.Text=Wi.A,Wa.TextInput=ja,Wa.Trigger=xr,r.A._setClasses(Wa,{AlignedScrollArea:{maxWidthDesktop:700,scrollBarBottomMargin:10,containerMargin:10,maxWidthMobile:0,marginBottomPortrait:10,marginTopPortrait:10,marginLeftRightPortrait:10,marginBottom:10,marginTop:10,marginLeftRight:10,scrollBarPath:null,bgNineSlicePlanePath:null,scrollLayerPath:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},BG:{timeline:null,delay:0,isPlaying:!0,rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Ball:{table:null,rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},BaseRootScene:{faderType:null,backgroundColor:16777215,isNoStackable:!1,isStatic:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0},BgMusic:{dynamicPreloading:!1,onIntroFinish:null,volumeUnderModals:.25,fadeOut:.2,fadeIn:.2,globalVolumePath:null,volume:1,resetPositionOnPlay:!0,isPlaying:!0,loop:null,visible:!1,intro:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,alpha:1,rotation:0,y:0,x:0,name:null},Button:{interactive:!0,repeatInterval:0,repeatDelay:0,scrollable:!1,sndOver:null,sndClick:null,hotkey:0,afterClick:null,onClick:null,disabledAlpha:.76,disabledImage:"",pressImage:"",hoverImage:"",rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},ClickOutsideTrigger:{additionalContainers:null,onClickOutside:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Container:{"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},DSprite:{rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Fill:{transparentRight:!1,transparentLeft:!1,transparentBottom:!1,transparentTop:!1,yWaveSpeed:0,yWavePhase:0,yWaveStep:1,yWaveAmp:0,xWaveSpeed:0,xWavePhase:0,xWaveStep:1,xWaveAmp:0,yShiftSpeed:0,xShiftSpeed:0,yShift:0,xShift:0,yRepeat:1,xRepeat:1,verticesY:2,verticesX:2,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},FlyText:{maxWidth:0,textTransform:0,"style.letterSpacing":0,"style.padding":0,"style.leading":0,"style.fontWeight":"normal","style.fontFamily":null,"style.drShDistance":5,"style.drShBlur":0,"style.drShAngle":.524,"style.drShAlpha":1,"style.drShColor":"#000000","style.dropShadow":!1,"style.stroke":"#000000","style.strokeThickness":0,"style.fillGradientStops":null,"style.fill":"#ffffff",verticalAlign:"top","style.align":"center","style.fontSize":12,translatableText:null,text:"",image:null,blendMode:0,tint:16777215,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},FullscreenPopup:{maxWidthDesktop:700,scrollBarBottomMargin:10,containerMargin:10,maxWidthMobile:0,marginTopBottom:10,marginLeftRight:10,scrollBarPath:null,bgNineSlicePlanePath:null,scrollLayerPath:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},GameTable:{highG:0,highR:455,mediumG:122,mediumR:455,lowG:255,lowR:255,centerG:455,centerR:0,ballWaitingPath:null,pinsContainer:null,tooltip:null,hole:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},HTMLOverlay:{bouncingBounds:!1,fadeSpeed:.1,className:null,zIndex:1e4,handleScroll:!0,innerHTML:null,_mouseHandlerContainer:null,mobileInertia:.92,desktopInertia:.8,mouseHandler:null,fullArea:null,visibleArea:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Label:{onCounterFinish:null,onCounter:null,onChanged:null,decimalsCount:0,counterSpeed:1,plusMinus:!1,isNumeric:!1,template:null,refreshInterval:10,dataPath:null,maxWidth:0,textTransform:0,"style.letterSpacing":0,"style.padding":0,"style.leading":0,"style.fontWeight":"normal","style.fontFamily":null,"style.drShDistance":5,"style.drShBlur":0,"style.drShAngle":.524,"style.drShAlpha":1,"style.drShColor":"#000000","style.dropShadow":!1,"style.stroke":"#000000","style.strokeThickness":0,"style.fillGradientStops":null,"style.fill":"#ffffff",verticalAlign:"top","style.align":"center","style.fontSize":12,translatableText:null,text:"",image:null,blendMode:0,tint:16777215,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},ListItem:{timeline:null,delay:0,isPlaying:!0,rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},MainMenu:{gameTable:null,faderType:null,backgroundColor:16777215,isNoStackable:!1,isStatic:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0},MoneyLabel:{countOnStart:!1,isNumeric:!0,maxWidthLandscape:0,maxWidthPortrait:0,decimalsCountPath:null,dataPath2:null,onCounterFinish:null,onCounter:null,onChanged:null,decimalsCount:0,counterSpeed:1,plusMinus:!1,template:null,refreshInterval:10,dataPath:null,maxWidth:0,textTransform:0,"style.letterSpacing":0,"style.padding":0,"style.leading":0,"style.fontWeight":"normal","style.fontFamily":null,"style.drShDistance":5,"style.drShBlur":0,"style.drShAngle":.524,"style.drShAlpha":1,"style.drShColor":"#000000","style.dropShadow":!1,"style.stroke":"#000000","style.strokeThickness":0,"style.fillGradientStops":null,"style.fill":"#ffffff",verticalAlign:"top","style.align":"center","style.fontSize":12,translatableText:null,text:"",image:null,blendMode:0,tint:16777215,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},MovieClip:{timeline:null,delay:0,isPlaying:!0,rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},MultilineText:{breakWords:!1,maxHeightPortrait:0,maxHeightLandscape:0,maxWidthPortrait:400,maxWidthLandscape:400,maxWidth:0,textTransform:0,"style.letterSpacing":0,"style.padding":0,"style.leading":0,"style.fontWeight":"normal","style.fontFamily":null,"style.drShDistance":5,"style.drShBlur":0,"style.drShAngle":.524,"style.drShAlpha":1,"style.drShColor":"#000000","style.dropShadow":!1,"style.stroke":"#000000","style.strokeThickness":0,"style.fillGradientStops":null,"style.fill":"#ffffff",verticalAlign:"top","style.align":"center","style.fontSize":12,translatableText:null,text:"",image:null,blendMode:0,tint:16777215,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},NineSlicePlane:{bottomHeight:5,topHeight:5,rightWidth:5,leftWidth:5,height:200,width:200,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},NumberInput:{wrapValue:!1,_currentTextField:null,interactive:!0,valuesList:null,onChanged:null,refreshInterval:10,dataPath:null,textView:null,decimalsCount:0,step:1,min:0,max:100,value:0,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},OrientationTrigger:{portraitR:0,portraitScaleX:1,portraitScaleY:1,portraitAlpha:1,portraitY:0,portraitX:0,landscapeR:0,landscapeScaleY:1,landscapeScaleX:1,landscapeAlpha:1,landscapeY:0,landscapeX:0,onLandscape:null,onPortrait:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},ParticleSimple:{rSpeed:0,ySpeed:0,xSpeed:0,blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},PaytablePreloaderScene:{faderType:null,backgroundColor:16777215,isNoStackable:!1,isStatic:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0},PrefabReference:{inheritProps:!0,dynamicPrefabName:null,prefabName:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},ProgressBar:{cap:null,bar:null,step:1,max:100,min:0,afterSlide:null,onChanged:null,refreshInterval:10,capMargin:5,height:200,dataPath:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},ProvabilityPanel:{onDisable:null,onEnable:null,isApplyInteractivity:!0,yShift:0,xShift:0,scaleShift:0,alphaShift:-1,damp:.85,pow:.02,invert:!1,dataPath:null,state:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},RealityCheckPopup:{fixed:!1,yPos:0,relativeY:!1,xPos:0,relativeX:!1,resizeY:!1,resizeX:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Resizer:{fixed:!1,yPos:0,relativeY:!1,xPos:0,relativeX:!1,resizeY:!1,resizeX:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},ResultList:{"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},SafariArrowUp:{"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Scissors:{enabled:!0,rect:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Shape:{_shapePoints:null,_spriteRect:null,shapeLineAlignment:1,shapeLineAlpha:1,shapeLineColor:16777215,shapeLineWidth:0,isItHitArea:!1,shapeFillColor:0,shapeFillAlpha:1,shapeRadius:10,height:100,width:100,shape:0,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Spawner:{_container:null,container:null,applyRotation:!1,speedRandom:10,speed:10,intervalRandom:0,interval:0,delay:0,enabled:!0,prefabToSpawn:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},SpawnerRing:{_container:null,container:null,radius:10,countRandom:10,count:10,speedRandom:10,speed:10,prefabToSpawn:null,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Sprite:{blendMode:0,tint:16777215,image:"EMPTY","pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Text:{maxWidth:0,textTransform:0,"style.letterSpacing":0,"style.padding":0,"style.leading":0,"style.fontWeight":"normal","style.fontFamily":null,"style.drShDistance":5,"style.drShBlur":0,"style.drShAngle":.524,"style.drShAlpha":1,"style.drShColor":"#000000","style.dropShadow":!1,"style.stroke":"#000000","style.strokeThickness":0,"style.fillGradientStops":null,"style.fill":"#ffffff",verticalAlign:"top","style.align":"center","style.fontSize":12,translatableText:null,text:"",image:null,blendMode:0,tint:16777215,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},TextInput:{cursorObject:null,onChange:null,inputType:"text",maxInputLen:0,maxWidth:0,textTransform:0,"style.letterSpacing":0,"style.padding":0,"style.leading":0,"style.fontWeight":"normal","style.fontFamily":null,"style.drShDistance":5,"style.drShBlur":0,"style.drShAngle":.524,"style.drShAlpha":1,"style.drShColor":"#000000","style.dropShadow":!1,"style.stroke":"#000000","style.strokeThickness":0,"style.fillGradientStops":null,"style.fill":"#ffffff",verticalAlign:"top","style.align":"center","style.fontSize":12,translatableText:null,text:"",image:null,blendMode:0,tint:16777215,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null},Trigger:{onDisable:null,onEnable:null,isApplyInteractivity:!0,yShift:0,xShift:0,scaleShift:0,alphaShift:-1,damp:.85,pow:.02,invert:!1,dataPath:null,state:!1,"pivot.y":0,"pivot.x":0,"skew.y":0,"skew.x":0,"scale.y":1,"scale.x":1,interactive:!1,visible:!0,alpha:1,rotation:0,y:0,x:0,name:null}})},1469:(t,e,i)=>{"use strict";var r,n=i(9443),a=i(874),s=new Promise((t=>{r=t}));const o=(t,e,i,n,a,s)=>{function o(e){return new Promise((i=>{var r=new Image;r.src=e.indexOf("//")>0?e:t+e,r.onload=i}))}var l;a&&(n=n.concat(s?["preloader-assets/split.png","preloader-assets/spin.gif","preloader-assets/spin2.gif","preloader-assets/spin3.gif","preloader-assets/b.png","preloader-assets/i.png","preloader-assets/g.png","preloader-assets/a.png","preloader-assets/m.png","preloader-assets/i.png","preloader-assets/n.png"]:["preloader-assets/logo.png"])),window.__OPTIONS__.ui.brand_logo?(n.push(window.__OPTIONS__.ui.brand_logo),l=300):l=150;var h=400+l;function u(){var t=document.querySelector(".preloader");if(t){var e=Math.min(window.innerWidth/700,window.innerHeight/h,1);t.style.transform="scale("+e+")",t.style.left=Math.round(window.innerWidth/2-350)+"px",t.style.top=Math.round(window.innerHeight/2-h/2)+"px"}else window.removeEventListener("resize",u)}function c(){var n=document.getElementsByClassName("preloader")[0];n&&(n.innerHTML=(`\n\t\t\t\n\t
\n'+e+'
\n\t
'+(a?`
`+(s?'
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t':"")+"
":"")+'
\n\t\t\t
\n\t\t
'+(window.__OPTIONS__.ui.brand_logo?'':"")+"
").replace(/_resourcesPath_/g,t)),r(),u(),window.addEventListener("resize",u)}Promise.all(n.map(o)).then(c)},l=t=>{o(t,u,c,h,n.A.casinoOptions.ui.logo_visible)};var h=["preloader-assets/loader-img.png"],u='\n
\n',c='\n.game-image {\n\t\theight: 400px;\n\t\tmax-width: 700px;\n\t\tbackground-image: url("_resourcesPath_preloader-assets/loader-img.png");\n\t\tbackground-size: contain;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t}\n',p=(i(6113),i(4381)),d=i(4051),f=i(3800),g=-1!==window.location.origin.indexOf("bgaming-system");window.addEventListener("keydown",(t=>{g&&80===t.keyCode&&t.ctrlKey&&(t.preventDefault(),y.toggleGame(!0))}));var m,A,v={PAUSE:"pause_gameplay",PAUSE_SAFE:"pause_safe_gameplay",RESUME:"resume_gameplay"};window.addEventListener("message",(t=>{if(t.data){var e=t.data;if("string"==typeof e)try{e=JSON.parse(e)}catch(i){return}switch((e.name||e.Name||"").toLowerCase()){case v.PAUSE:y.pauseGame(!0);break;case v.PAUSE_SAFE:y.pauseGameSafe(!0,(()=>{t.source.postMessage(e.callback||"game_paused",t.origin)}));break;case v.RESUME:y.resumeGame()}}}),!1),p.A.addListener((t=>{switch(t){case f.A.GAME_LOADED:case f.A.FINISH_ROUND_ANIMATIONS:y._onGameRoundAnimationsFinish()}}));var y={game:n.A,toggleGame(t){m?y.resumeGame():y.pauseGame(t)},pauseGame(t){m||((m=n.A.showModal("thing-games-utils/pause-popup")).alpha=t?0:1,m.findChildByName("close-btn").callback=()=>{n.A.hideModal(m),m=null})},pauseGameSafe(t,e=(()=>{})){var i=A||(()=>y.pauseGame(t));A=()=>{i(),e()},(m||n.A.currentScene&&!n.A.currentScene.flowLocked)&&(A(),A=null)},resumeGame(){m&&(n.A.hideModal(m),m=null),A=null},stopAutospins(){n.A.currentScene&&n.A.currentScene.autospinPanel?n.A.currentScene.autospinPanel.stopAutospins():n.A.currentScene.stopAutoplay&&n.A.currentScene.stopAutoplay()},setAudioSfx(t){n.A.Sound.soundEnabled=t},setAudioMusic(t){n.A.Sound.musicEnabled=t},formatMoney:t=>d.A.formatMoney(t/n.A.data.currencyDivider,n.A.data.currencyDigits),formatMoneyToNumber:t=>t/n.A.data.currencyDivider,_onGameRoundAnimationsFinish(){A&&(A(),A=null)},showPaytable(){var t;null===(t=this.game.all.popupsLayer)||void 0===t||t.showPaytable()},hidePaytable(){var t;null===(t=this.game.all.popupsLayer)||void 0===t||t.togglePaytable()},showRules(){var t;null===(t=this.game.all.popupsLayer)||void 0===t||t.showRules()},hideRules(){var t;null===(t=this.game.all.popupsLayer)||void 0===t||t.toggleRules()}};const _=y;var b=i(4581),x=i(4418),T=i(9372),E=i(8201),S=i(230);class w{static initGame(t,e,i,r=s){function n(){var e="\n\t\tbody, html, canvas {\n\t\t\tposition: absolute;\n\t\t\ttop: 0; \n\t\t\tbottom: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\toverflow: visible;\n\t\t\twidth:100%;\n\t\t}\n\n\t\thtml {\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tcanvas {\n\t\t\theight:100%;\n\t\t\tposition: fixed;\n\t\t\t-webkit-touch-callout: none; /* iOS Safari */\n\t\t\t-webkit-user-select: none; /* Safari */\n\t\t\tuser-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */\n\t\t}\n\n\t\t.preloader{\n\t\t\tz-index: 20;\n\t\t}\n\t\t";t.applyCSS(e)}window.addEventListener("load",(()=>{x.A.beforeGameInit();var a=t.casinoOptions;n();var s=a.resources_path+"/",o=S.projectDesc,l=o.imagesToRemove||[],h=o.mobileUIPath||"ui/mobile-slot/",u=o.desktopUIPath||"ui/desktop-slot/";l.push(t.isMobile.any?u:h);var c=function(t){l.some((e=>t.startsWith(e)))&&delete S.images[t]};for(var d in S.images)c(d);S.projectDesc.localeResourcesPath="https://translations.bgaming-network.com/Plinko",e.setCurrentLanguage(a.locale,{isHieroglyphic:/ja|zh$/.test(a.locale)}),b.A.initMoneyFormatter(a.locale),console.log(o.title+" v"+o.version),p.A.track(f.A.START_LOADING,null,_),T.A.once(E.k.GAME_PRELOADER_COMPLETE,(()=>{p.A.track(f.A.GAME_RESOURCES_LOADED)})),T.A.on(E.k.GAME_SHOW_MODAL,(()=>{p.A.track(f.A.SHOW_MODAL)})),i(s),r.then((()=>{t.init(void 0,o.id+a.cache_player_id,s)}))}))}}w.initGame(n.A,a.A,l)},684:(t,e,i)=>{"use strict";i.d(e,{A:()=>f});var r,n=i(9443),a=i(4049),s=i(9135),o=i(5222),l=i(4222),h=i(2468),u=i(2982),c=.0101,p=[],d=!1;class f extends o.A{constructor(){super(),this._externalVolume=0}init(){this._externalVolume=0,super.init(),p.push(this),f._recalculateMusic(),this.dynamicPreloading||(s.A.preloadSound(this.intro),s.A.preloadSound(this.loop)),this._musInitialized=!0,this.applyResetPosition(),f._recalculateMusic(),this._initIosSoundFix()}onRemove(){super.onRemove();var t=p.indexOf(this);t>=0&&p.splice(t,1),f._recalculateMusic(),u.A.onMusicRemove(this),this.musicFragmentHash=void 0,this._externalVolume=0,this._musInitialized=!1,this.customFade=null,this.onIntroFinish=null,this._removeIosSoundFix()}setVolume(t){this.volume=t}update(){super.update(),this._isPlaying&&this.globalVolumePath&&this._appliedPathVol!==(0,h.A)(this.globalVolumePath,this)&&f._recalculateMusic()}applyResetPosition(){this.isPlaying&&this.resetPositionOnPlay&&this.resetPosition()}get isPlaying(){return this._isPlaying}set isPlaying(t){this._isPlaying!==t&&(this._isPlaying=t,this.applyResetPosition(),f._recalculateMusic())}get intro(){return this._intro}set intro(t){this._intro!==t&&(this._intro=t,this.musicFragmentHash=(this._intro||"")+"#"+(this._loop||""),f._recalculateMusic())}get loop(){return this._loop}set loop(t){this._loop!==t&&(this._loop=t,this.musicFragmentHash=(this._intro||"")+"#"+(this._loop||""),f._recalculateMusic())}get volume(){return this._volume}set volume(t){this._volume!==t&&(this._volume=t,f._recalculateMusic())}_getTargetVol(){return this._isPlaying&&this._musInitialized?(this.globalVolumePath?(this._appliedPathVol=(0,h.A)(this.globalVolumePath,this),t=this._appliedPathVol):t=a.A.musicVol,this._volume*this._externalVolume*t||0):0;var t}play(t){this.customFade=t,this.isPlaying=!0}stop(t){this.customFade=t,this.isPlaying=!1}_getFade(t){return"number"==typeof this.customFade?this.customFade:t?this.fadeOut:this.fadeIn}resetPosition(){u.A.resetPosition(this.musicFragmentHash)}_onIntroFinish(){this.onIntroFinish&&(0,l.A)(this.onIntroFinish,this)}_touchStartHandler(){"suspended"!==Howler.ctx.state&&"interrupted"!==Howler.ctx.state||Howler.ctx.resume().then((()=>{f._recalculateMusic()}))}_initIosSoundFix(){(n.A.isMobile.apple.phone||n.A.isMobile.apple.ipod)&&!d&&(document.addEventListener("touchstart",this._touchStartHandler),d=!0)}_removeIosSoundFix(){d&&(document.removeEventListener("touchstart",this._touchStartHandler),d=!1)}static _recalculateMusic(){r||(setTimeout(A,1),r=!0)}static _clearCustomFades(t=null){for(var e of p)e.customFade=t;u.A._applyFadeForAll(t)}set fade(t){this.fadeIn=t,this.fadeOut=t}}var g=1e6,m=1e5;function A(){if(r=!1,!n.A._isWaitingToHideFader){var t=[],e=new Map,i=n.A.currentFader;for(var s of(i&&(e.set(g,[]),t.push(g)),p)){var o=s.getRootContainer(),l=void 0;if(o===n.A.currentContainer)l=m;else if(o===i)l=g;else{if(!o.parent){s._externalVolume=0;continue}l=o.parent.getChildIndex(o)}e.has(l)||(t.push(l),e.set(l,[])),e.get(l).push(s)}t.sort(v);var h=a.A.isSoundsLockedByBrowser||n.A._loadingErrorIsDisplayed||!n.A.isVisible;for(var d of t){var f=e.get(d);for(var A of f)A._externalVolume=h?0:d=c&&(_._loop||_._intro)&&(_._cachedTargetVol=b,y.push(_))}u.A.setPlayingBGMusics(y)}}var v=(t,e)=>e-t},9401:(t,e,i)=>{"use strict";i.d(e,{A:()=>u});var r,n=i(9443),a=i(4222),s=i(6711),o=i(4049),l=(i(9135),0),h=30;class u extends s.A{init(){super.init(),this.on("pointerdown",this.onDown),this.on("pointerup",this.onUp),this.on("pointerover",this.onOver),this.on("pointerout",this.onOut),c.unshift(this),this.buttonMode=!0,this.initialScale=this.scale.x,this.initialImage=this.image,this.interactive?this.enable():this.disable(),this.scrollable&&(this.pointerStartPos=null)}onRemove(){super.onRemove(),this.onOut(),this.removeListener("pointerdown",this.onDown),this.removeListener("pointerup",this.onUp),this.removeListener("pointerover",this.onOver),this.removeListener("pointerout",this.onOut);var t=c.indexOf(this);t>=0&&c.splice(t,1),r===this&&(r=null),this.initialImage=null,this.interactive=!1,this.buttonMode=!1,this.hasOwnProperty("callback")&&delete this.callback}disable(){this.initialImage&&(this.onUp(),this.onOut(),this.disabledImage?this.image=this.disabledImage:this.alpha=this.disabledAlpha),this.interactive=!1}enable(){this.initialImage&&(this.disabledImage?this.image=this.initialImage:this.alpha=1),this.interactive=!0}get isOvered(){return this===u.overredButton}get isDowned(){return this===u.downedButton}callClick(){this.isCanBePressed&&this._executeOnClick("invoke")}_executeOnClick(t){u.globalOnClick&&u.globalOnClick(this,t),u.clickedButton=this,this.callback&&this.callback(),this.onClick&&(0,a.A)(this.onClick,this),this.afterClick&&(0,a.A)(this.afterClick,this),u.clickedButton=null,this.sndClick&&o.A.play(this.sndClick),l=n.A.time}onDown(t,e="pointerdown"){if(o.A._unlockSound(),!(n.A.time===l)){if(t){if(1!==t.data.buttons)return;n.A._mouseHandlerGlobal(t)}this.isCanBePressed&&Math.abs(l-n.A.time)>1&&u.downedButton!==this&&(u.downedButton&&u.downedButton.onUp(),this.pressImage?this.image=this.pressImage:this.scale.x=this.scale.y=this.initialScale*(this.isOvered?1:.9),u.downedButton=this,this.curDelay=this.repeatDelay,this.scrollable?this.pointerStartPos={x:n.A.mouse.x,y:n.A.mouse.y}:this._executeOnClick(e))}}update(){this.isDowned&&(n.A.mouse.click||r===this?this.curDelay>0&&(this.curDelay--,0===this.curDelay&&(this.isCanBePressed&&Math.abs(l-n.A.time)>1&&this._executeOnClick("autorepeat"),this.curDelay=this.repeatInterval)):this.onUp()),super.update()}onUp(){u.downedButton===this&&(this.interactive&&(this.pressImage?this.initialImage&&(this.image=this.initialImage):this.scale.x=this.scale.y=this.initialScale*(this.isOvered?1.05:1)),u.downedButton=null,this.scrollable&&Math.hypot(n.A.mouse.x-this.pointerStartPos.x,n.A.mouse.y-this.pointerStartPos.y)<=h&&this._executeOnClick("pointerup"))}onOver(){n.A.isTouchscreen||u.overredButton!==this&&(u.overredButton&&u.overredButton.onOut(),u.overredButton=this,this.hoverImage?this.image=this.hoverImage:this.scale.x=this.scale.y=1.05*this.initialScale,this.sndOver&&o.A.play(this.sndOver),this.gotoLabelRecursive("btn-over"))}_onDisableByTrigger(){this.onOut()}onOut(){u.overredButton===this&&(u.overredButton=null,this.interactive&&(this.hoverImage?this.initialImage&&(this.image=this.initialImage):this.scale.x=this.scale.y=this.initialScale),this.onUp(),this.gotoLabelRecursive("btn-out"))}static _tryToClickByKeycode(t){for(var e of c)if(e.hotkey===t&&e.isCanBePressed)return e.onDown(null,"hotkey"),e}}var c=[];function p(){var t;null!==(t=r)&&void 0!==t&&t.isDowned&&(r.onUp(),r=null)}window.addEventListener("keydown",(t=>{t.repeat||(r=u._tryToClickByKeycode(t.keyCode))})),window.addEventListener("blur",p),window.addEventListener("visibilitychange",p),window.addEventListener("keyup",(t=>{r&&r.hotkey===t.keyCode&&(r.onUp(),r=null)}))},5222:(t,e,i)=>{"use strict";i.d(e,{A:()=>d});var r,n,a=i(9443),s=(i(3951),i(1233).Container);s.prototype.update=function(){for(var t of this.children)t.update()},s.prototype.init=()=>{},s.prototype.onRemove=()=>{};var o,l,h=t=>{t.name===r&&(n=t)};s.prototype.findChildByName=function(t){return r=t,n=null,this.forAllChildren(h),n};var u,c=t=>{t instanceof l&&o.push(t)};s.prototype.findChildrenByType=function(t){return l=t,o=[],this.forAllChildren(c),o};var p=t=>{t.name===u&&o.push(t)};s.prototype.findChildrenByName=function(t){return u=t,o=[],this.forAllChildren(p),o},s.prototype.forAllChildren=function(t){for(var e of this.children)t(e),e.forAllChildren(t)},Object.defineProperty(s.prototype,"isCanBePressed",{get:function(){if(!this.interactive||a.A.disableAllButtons)return!1;for(var t=this.parent;t!==a.A.stage&&t.interactiveChildren&&t.visible;)t=t.parent;return t.interactiveChildren&&t.visible},enumerable:!0});const d=s},6711:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});var r=i(1220);class n extends r.A{constructor(){super(),this.anchor.set(.5)}angleBySpeed(){this.rotation=Math.atan2(this.ySpeed,this.xSpeed)}update(){this.x+=this.xSpeed,this.y+=this.ySpeed,this.rotation+=this.rSpeed,super.update()}}},3951:(t,e,i)=>{"use strict";var r=i(9135),n=i(9443),a=i(1233).DisplayObject;a.prototype.getGlobalRotation=function(){for(var t=this.rotation,e=this.parent;e&&e!==n.A.stage;)t+=e.rotation,e=e.parent;return t},a.prototype.getScenePosition=function(t,e=!1){return n.A.stage.toLocal(this,this.parent,t,e)},a.prototype.getRootContainer=function(){for(var t=this;t&&t.parent!==n.A.stage&&t.parent;)t=t.parent;return t},a.prototype.detachFromParent=function(){this.parent&&this.parent.removeChild(this)},a.prototype.init=()=>{},a.prototype.onRemove=()=>{},a.prototype.remove=function(){r.A.destroyObjectAndChildren(this,!0)},a.prototype.removeWithoutHolder=function(){r.A.destroyObjectAndChildren(this)},a.prototype.findParentByType=function(t){for(var e=this.parent;e&&!(e instanceof t);)e=e.parent;return e},a.prototype.findParentByName=function(t){for(var e=this.parent;e&&e.name!==t;)e=e.parent;return e},a.prototype.addFilter=function(t){this.filters?this.filters.push(t):this.filters=[t]},a.prototype.removeFilter=function(t){var e=this.filters.indexOf(t);e>=0&&this.filters.splice(e,1)};Object.defineProperties(a.prototype,{___info:{get:function(){for(var t=getObjectName(this),e=this.parent;e&&e!==n.A.stage;)t+=" > "+getObjectName(e),e=e.parent;return t}},"scale.x":{get:function(){return this.transform.scale.x},set:function(t){this.transform.scale.x=t},configurable:!0},"scale.y":{get:function(){return this.transform.scale.y},set:function(t){this.transform.scale.y=t},configurable:!0},"skew.x":{get:function(){return this.transform.skew.x},set:function(t){this.transform.skew.x=t},configurable:!0},"skew.y":{get:function(){return this.transform.skew.y},set:function(t){this.transform.skew.y=t},configurable:!0},"pivot.x":{get:function(){return this.transform.pivot.x},set:function(t){this.transform.pivot.x=t},configurable:!0},"pivot.y":{get:function(){return this.transform.pivot.y},set:function(t){this.transform.pivot.y=t},configurable:!0}})},4051:(t,e,i)=>{"use strict";i.d(e,{A:()=>u});var r=i(2468),n=i(4222),a=i(874),s=i(4894),o=i(9443),l=i(4319);function h(t,e=0){var i,r=t<0;if(r&&(t=-t),e>0){var n=t.toFixed(e).split(".");n[0].length>3&&(n[0]=n[0].replace(/(.)(?=(.{3})+$)/g,"$1 ")),i=n.join(".")}else i=t.toFixed(0).replace(/(.)(?=(.{3})+$)/g,"$1 ");return r?"-"+i:i}class u extends s.A{init(){super.init(),this.currentInterval=0,this.text="",this.showedVal=void 0,this.processedVal=void 0,this.lastUpdateTime=o.A.time}onLanguageChanged(){this._translatableText&&(this.showedVal=void 0,this.refreshNow(),o.A.__paused&&super.onLanguageChanged())}customizeVal(t){return t}update(){if(o.A.time-this.lastUpdateTime>1&&this.refreshNow(),this.lastUpdateTime=o.A.time,this.currentInterval<=0&&this.dataPath){var t=(0,r.A)(this.dataPath,this);(t=this.customizeVal(t))||0===t?(t!==this.processedVal&&(this.onChanged&&(0,n.A)(this.onChanged,this),this.processedVal=t),t!==this.showedVal&&(this.visible=!0,this.applyValue(t))):(this.processedVal=void 0,this.showedVal=void 0,this.visible=!1),this.currentInterval=this.refreshInterval}else this.currentInterval--;super.update()}applyValue(t){if(this.isNumeric){if(this.counterSpeed<1&&void 0!==this.showedVal){var e=Math.max(1/Math.pow(10,this.decimalsCount),Math.abs((t-(this.showedVal||0))*this.counterSpeed));this.showedVal=(0,l.CR)(this.showedVal||0,t,e),this.showedVal===t?this.onCounterFinish&&(0,n.A)(this.onCounterFinish,this):this.onCounter&&(0,n.A)(this.onCounter,this)}else this.showedVal=t;t=this.plusMinus&&t>0?"+"+u.formatMoney(this.showedVal,this.decimalsCount):u.formatMoney(this.showedVal,this.decimalsCount)}else this.showedVal=t;this.template?this.text=this.template.replace("%d",t):this._translatableText?this.text=(0,a.A)(this._translatableText,t):this.text=t}freezeCounter(){this.currentInterval=1e9}unfreezeCounter(){this.currentInterval=0}refreshNow(){this.currentInterval=0}}u.formatMoney=h},9087:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var r=i(5222),n=i(5622),a=i(9443),s={},o=0;class l extends r.A{static promise(t,e=a.A.currentContainer){var i=n.A.create(l);e.addChild(i),i._promiseWaitForResult=!0;var r=o++;return i._promiseId=r,t((t=>{i._promiseId===r&&(i._promiseResultWaiting=t)}),(t=>{i._promiseId===r&&(i._promiseErrorWaiting=t)}),i),i}static resolve(t){return l.promise((e=>{e(t)}))}static all(t,e=a.A.currentContainer){var i=[],r=t.length;return l.promise(((e,n,a)=>{t.some(((t,s)=>{a.addChild(t),t.then((t=>{i[s]=t})),t.catch((t=>{(i=[])[s]=t,n(i),i=null})),t.finally((()=>{0===--r&&i&&e(i)}))}))}),e)}onRemove(){super.onRemove(),this._promiseWaitForResult&&(this._promiseWaitForResult=!1,this._handleFinally()),this._promiseId=-1,this._rejectHandlers.length=0,this._resolveHandlers.length=0,this._finallyHandlers.length=0,this._promiseResultWaiting=s,this._promiseErrorWaiting=s}then(t){return this._resolveHandlers.push(t),this}catch(t){return this._rejectHandlers.push(t),this}finally(t){return this._finallyHandlers.push(t),this}constructor(){super(),this._resolveHandlers=[],this._finallyHandlers=[],this._rejectHandlers=[],this.visible=!1,this._promiseResultWaiting=s,this._promiseErrorWaiting=s}_handleFinally(){for(var t,e=this,i=function(){try{e._finallyHandlers.shift()()}catch(t){return setTimeout((()=>{throw t}),0),e._turnPromiseRejected(t),{v:void 0}}};this._finallyHandlers.length>0;)if(t=i())return t.v;this._promiseWaitForResult=!1}_turnPromiseRejected(t){this._promiseErrorWaiting===s&&(this._resolveHandlers.length=0,this._promiseResultWaiting=s,this._promiseErrorWaiting=t)}update(){var t=this;if(this._promiseResultWaiting!==s&&(this.getRootContainer()===a.A.currentContainer||this.getRootContainer()===a.A.currentFader)){for(var e,i=this._promiseResultWaiting,r=function(){try{var e=t._resolveHandlers.shift()(i);void 0!==e&&(i=e)}catch(r){return 0===t._rejectHandlers.length&&setTimeout((()=>{throw r}),0),t._turnPromiseRejected(r),{v:void 0}}};this._resolveHandlers.length>0;)if(e=r())return e.v;this._handleFinally()}if(this._promiseErrorWaiting!==s){for(var n=this._promiseErrorWaiting,o=function(){try{var e=t._rejectHandlers.shift()(n);void 0!==e&&(n=e)}catch(i){0===t._rejectHandlers.length&&setTimeout((()=>{throw i}),0)}};this._rejectHandlers.length>0;)o();this._handleFinally()}super.update(),this._promiseWaitForResult||this.remove()}}},9649:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});i(3951);var r,n=i(5222),a=i(9443);class s extends n.A{constructor(){super(),this.backgroundColor=0}get name(){return this.__libSceneName}onShow(){}onHide(){}onMouseDown(t,e){}onMouseMove(t,e){}onMouseUp(t,e){}init(){super.init(),this._refreshAllObjectRefs(),a.A.__savedCurrentSceneForInitTime=a.A.currentScene,a.A._setCurrentScene(this)}_refreshAllObjectRefs(){this.all={},r=this.all,this.forAllChildren(o),a.A.currentScene===this&&(a.A.all=this.all)}}var o=t=>{t.name&&(r[t.name]=t)}},9080:(t,e,i)=>{"use strict";i.d(e,{A:()=>c});var r,n,a,s=i(5222),o=i(9443),l=i(4319),h=i(2468),u={passive:!1,capture:!0};class c extends s.A{constructor(){super(),this.onDown=this.onDown.bind(this),this.onWheel=this.onWheel.bind(this)}init(){super.init(),this.mouseHandler?this._mouseHandlerContainer=(0,h.A)(this.mouseHandler,this):this._mouseHandlerContainer=o.A.pixiApp.renderer.plugins.interaction,this._mouseHandlerContainer.on("pointerdown",this.onDown),document.addEventListener("wheel",this.onWheel,u),this.autoScrolling=!1,this.xSpeed=0,this.ySpeed=0,this._virtualScrollX=this.x,this._virtualScrollY=this.y}onWheel(t){if(!this.autoScrolling){var e=0;if(this._mouseHandlerContainer!==o.A.pixiApp.renderer.plugins.interaction){if(this._mouseHandlerContainer.isCanBePressed){var i=o.A.mouseEventToGlobalXY(t);this._mouseHandlerContainer.getBounds().contains(i.x,i.y)&&(e=t.deltaY,t.stopPropagation(),t.preventDefault())}}else this.isCanBePressed&&(e=t.deltaY,t.stopPropagation(),t.preventDefault());e&&(1===t.deltaMode&&(e*=60),e=Math.min(60,Math.max(-60,e)),this.isYScrollAvailable?this.ySpeed=-e:this.isXScrollAvailable&&(this.xSpeed=e))}}onDown(t){this.worldVisible&&(o.A._mouseHandlerGlobal(t),r=this,n=o.A.mouse.x,a=o.A.mouse.y)}static updateGlobal(){r&&(r.autoScrolling||r.updateGlobal())}updateGlobal(){o.A.mouse.click&&(this.fullArea.w>this.visibleArea.w&&(this.xSpeed=o.A.mouse.x-n,this._virtualScrollX+=this.xSpeed),this.fullArea.h>this.visibleArea.h&&(this.ySpeed=o.A.mouse.y-a,this._virtualScrollY+=this.ySpeed),n=o.A.mouse.x,a=o.A.mouse.y)}onRemove(){r===this&&(r=null),document.removeEventListener("wheel",this.onWheel,u),this._mouseHandlerContainer.removeListener("pointerdown",this.onDown),super.onRemove()}update(){if(this.visible){o.A.mouse.click||(this._virtualScrollX+=this.xSpeed,this._virtualScrollY+=this.ySpeed,this.autoScrolling?(this.xSpeed*=.98,this.ySpeed*=.98):(o.A.isMobile.any?(this.xSpeed*=this.mobileInertia,this.ySpeed*=this.mobileInertia):(this.xSpeed*=this.desktopInertia,this.ySpeed*=this.desktopInertia),this.xSpeed=(0,l.CR)(this.xSpeed,0,.1),this.ySpeed=(0,l.CR)(this.ySpeed,0,.1)));var t=this.visibleArea,e=this.fullArea;this.autoScrolling&&(this._checkScrollToBounds(),this.xSpeed+=.06*(this.scrollToX-this._virtualScrollX),this.ySpeed+=.06*(this.scrollToY-this._virtualScrollY),this.xSpeed*=.7,this.ySpeed*=.7,Math.abs(this.scrollToX-this._virtualScrollX)<=1&&Math.abs(this.xSpeed)<.5&&Math.abs(this.scrollToY-this._virtualScrollY)<=1&&Math.abs(this.ySpeed)<.5&&(this.xSpeed=0,this.ySpeed=0,this.callAfterScroll&&this.callAfterScroll(),this._virtualScrollX=this.scrollToX,this._virtualScrollY=this.scrollToY,this.callAfterScroll=!1,this.autoScrolling=!1));var i=0;t.x+t.w-this._virtualScrollX>e.x+e.w&&(i=t.x+t.w-this._virtualScrollX-(e.x+e.w)),t.x-this._virtualScrollX-ie.y+e.h&&(i=t.y+t.h-this._virtualScrollY-(e.y+e.h)),t.y-this._virtualScrollY-i-e.x?this.scrollToX=-e.x:this.scrollToX<-(e.x+e.w-t.w)&&(this.scrollToX=-(e.x+e.w-t.w)),this.scrollToY>-e.y?this.scrollToY=-e.y:this.scrollToY<-(e.y+e.h-t.h)&&(this.scrollToY=-(e.y+e.h-t.h))}scrollTo(t,e,i=!1){if(!t)return this.autoScrolling=!1,this.xSpeed=0,void(this.ySpeed=0);"string"==typeof t&&(t=this.getChildByName(t)),this.autoScrolling=!0,this.scrollToX=this.visibleArea.w/2-t.x,this.scrollToY=this.visibleArea.h/2-t.y,this._checkScrollToBounds(),i&&(this._virtualScrollX=this.scrollToX,this._virtualScrollY=this.scrollToY),this.callAfterScroll=e}}},1220:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var r=i(9135),n=i(1233),a=n.Sprite,s=n.Mesh;const o=a;var l={get:function(){return this._imageID},set:function(t){this._imageID!==t&&(this._imageID=t,this.texture=r.A.getTexture(t))}};Object.defineProperty(a.prototype,"image",l),Object.defineProperty(s.prototype,"image",l),a.imagePropertyDescriptor=l;var h={get:function(){return this.tint>>16},set:function(t){this.tint=65535&this.tint|t<<16},configurable:!0};Object.defineProperty(a.prototype,"tintR",h),Object.defineProperty(s.prototype,"tintR",h);var u={get:function(){return(65280&this.tint)>>8},set:function(t){this.tint=16711935&this.tint|t<<8},configurable:!0};Object.defineProperty(a.prototype,"tintG",u),Object.defineProperty(s.prototype,"tintG",u);var c={get:function(){return 255&this.tint},set:function(t){this.tint=16776960&this.tint|t},configurable:!0};Object.defineProperty(a.prototype,"tintB",c),Object.defineProperty(s.prototype,"tintB",c)},4894:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var r=i(874),n=i(9443),a=i(2468),s=i(1233).Text;const o=s;var l="center",h=!("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype),u={center:.5,left:0,right:1,top:0,bottom:1},c={none:0,uppercase:1,capitalize:2,lowercase:3},p=(t,e)=>e===c.none?t:e===c.uppercase?t.toUpperCase():e===c.lowercase?t.toLowerCase():e===c.capitalize?t.replace(/(?:^|\s)\S/g,(t=>t.toUpperCase())):void 0;Object.defineProperties(s.prototype,{translatableText:{get:function(){return this._translatableText},set:function(t){this._translatableText!==t&&(t&&(this.text=(0,r.A)(t)),this._translatableText=t)}},image:{get:function(){},set:function(){}},"style.align":{get:function(){return this.style.align},set:function(t){this.style.align!=t&&(this.style.align=t,this._refreshAnchor(),this.checkAlignBlur())},configurable:!0},verticalAlign:{get:function(){return this._verticalAlign},set:function(t){this._verticalAlign!=t&&(this._verticalAlign=t,this._refreshAnchor(),this.checkAlignBlur())},configurable:!0},"style.fill":{get:function(){return this._styleFill},set:function(t){if(t&&t.indexOf(",")>=0){var e=t.split(",");this.style.fill=e}else this.style.fill=t;this._styleFill=t},configurable:!0},"style.fillGradientStops":{get:function(){return this._styleFillGradientStops},set:function(t){t?(t=t.replace(/\s/g,""),this.style.fillGradientStops=t.split(",").map((t=>t?parseFloat(t):1))):this.style.fillGradientStops.length=0,this._styleFillGradientStops=t},configurable:!0},"style.fontFamily":{get:function(){return this._fontFamily},set:function(t){this.style.fontFamily=t||n.A.projectDesc.defaultFont,this._fontFamily=t},configurable:!0},"style.fontWeight":{get:function(){return this.style.fontWeight},set:function(t){this.style.fontWeight=t},configurable:!0},"style.fontSize":{get:function(){return this.style.fontSize},set:function(t){this.style.fontSize=t},configurable:!0},"style.leading":{get:function(){return this.style.leading},set:function(t){this.style.leading=t},configurable:!0},"style.padding":{get:function(){return this.style.padding},set:function(t){this.style.padding=t},configurable:!0},"style.letterSpacing":{get:function(){return this.style.letterSpacing},set:function(t){this.style.letterSpacing=0===t&&h?.001:t},configurable:!0},"style.stroke":{get:function(){return this.style.stroke},set:function(t){this.style.stroke=t},configurable:!0},"style.strokeThickness":{get:function(){return this.style.strokeThickness},set:function(t){this.style.strokeThickness=t,this.style.lineJoin="round"},configurable:!0},"style.dropShadow":{get:function(){return this.style.dropShadow},set:function(t){this.style.dropShadow=t},configurable:!0},"style.drShColor":{get:function(){return this.style.dropShadowColor},set:function(t){this.style.dropShadowColor=t},configurable:!0},"style.drShAlpha":{get:function(){return this.style.dropShadowAlpha},set:function(t){this.style.dropShadowAlpha=t},configurable:!0},"style.drShAngle":{get:function(){return this.style.dropShadowAngle},set:function(t){this.style.dropShadowAngle=t},configurable:!0},"style.drShBlur":{get:function(){return this.style.dropShadowBlur},set:function(t){this.style.dropShadowBlur=t},configurable:!0},"style.drShDistance":{get:function(){return this.style.dropShadowDistance},set:function(t){this.style.dropShadowDistance=t},configurable:!0},textTransform:{get:function(){return this._textTransform},set:function(t){t!==this._textTransform&&(this._textTransform=t,t&&this._text&&(this._text=p(this._text,this.textTransform),this.dirty=!0))},configurable:!0},maxWidth:{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.updateSize())},configurable:!0}});var d=Object.getOwnPropertyDescriptor(s.prototype,"text"),f=d.set;d.set=function(t){this.textTransform&&t?f.call(this,p(t,this.textTransform)):f.call(this,t)},Object.defineProperty(s.prototype,"text",d);var g=s.prototype._onTextureUpdate;s.prototype._onTextureUpdate=function(t=!1){this.checkAlignBlur(),g.call(this);var e=this.recalculateTextSize();t||e&&this.updateTransform()},s.prototype.updateSize=function(){this.recalculateTextSize()&&this.updateTransform()},s.prototype.onRemove=function(){this._maxWidth=0},s.prototype.setTextByPath=function(t){this.text=(0,a.A)(t,this)},s.prototype.setAlign=function(t){this["style.align"]=t},s.prototype.checkAlignBlur=function(){var t=this.texture.width;if(t>0){this.style.align===l&&(this.anchor.x=Math.round(.5*t)/t);var e=this.texture.height;this.style._verticalAlign===l&&(this.anchor.y=Math.round(.5*e)/e)}},s.prototype.onLanguageChanged=function(){if(this._translatableText){var t=this._translatableText;this._translatableText=null,this.translatableText=t}},s.prototype._refreshAnchor=function(){this.anchor.set(u[this.style.align],u[this._verticalAlign])},s.prototype.recalculateTextSize=function(){var{scale:t,_texture:e,_maxWidth:i}=this;if(0===this._maxWidth)return!1;var r=e.width>i?i/e.width:1;return(r!==t.x||r!==t.y)&&(t.set(r),!!this.parent)}},8201:(t,e,i)=>{"use strict";i.d(e,{k:()=>r});var r={GAME_PRELOADER_PROGRESS:"CommonEvent.GAME_PRELOADER_PROGRESS",GAME_PRELOADER_START:"CommonEvent.GAME_PRELOADER_START",GAME_PRELOADER_COMPLETE:"CommonEvent.GAME_PRELOADER_COMPLETE",GAME_SHOW_MODAL:"CommonEvent.GAME_SHOW_MODAL",GAME_CLOSE_MODAL:"CommonEvent.GAME_CLOSE_MODAL"}},9372:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var r=i(1233);class n extends r.utils.EventEmitter{isLoggingEnabled=!1;emit(t,e){if("string"==typeof e)try{e=JSON.parse(e)}catch(i){}this.isLoggingEnabled&&console.log(`%c ${t} `,"background: #c00; color: #fff",e),super.emit(t,e)}}const a=new n},9443:(t,e,i)=>{"use strict";i.d(e,{A:()=>dt});var r=i(4319),n=i(7781),a=i(9135),s=i(5222),o=i(9372),l=i(8201),h=(i(6711),i(9649)),u=i(9062);class c{constructor(){this.updatePreloader=this.updatePreloader.bind(this),this.currentProgress=0,this.updateInterval=setInterval(this.updatePreloader),u.A.preloader=this,this.complete=!1,this.maxCount=0,this.progressGroupItems=[],this.progressGroup=Array.from(document.querySelectorAll(".progress-group")),this.progressGroup.length&&this.progressGroup.forEach((t=>this.progressGroupItems.push(Array.from(t.querySelectorAll(".progress-item"))))),this.progressItems=Array.from(document.querySelectorAll(":not(.progress-group) > .progress-item")),this.progressItems.length&&this.progressGroupItems.push(this.progressItems)}updatePreloader(){this.preloaderText=this.preloaderText||document.getElementsByClassName("preloader-text")[0],this.preloaderBar=this.preloaderBar||document.getElementsByClassName("preloader-bar")[0],this.preloader=this.preloader||document.getElementsByClassName("preloader")[0];var t=dt.getLoadingCount();this.maxCount=Math.max(1,this.maxCount,t);var e=(this.maxCount-t)/this.maxCount*100;this.currentProgress=(0,r.CR)(this.currentProgress,e,2),this.preloaderText&&(this.preloaderText.innerHTML="Loading "+Math.round(this.currentProgress)+"%"),this.preloaderBar&&(this.preloaderBar.style.width=this.currentProgress+"%"),this.progressGroupItems.length&&this.progressGroupItems.forEach((t=>{for(var e=t.length*this.currentProgress/100,i=0;i=100&&this.started&&this.currentProgress>=100}destroy(){this.preloader&&this.preloader.parentElement.removeChild(this.preloader),clearInterval(this.updateInterval),this.callback(),o.A.emit(l.k.GAME_PRELOADER_COMPLETE)}onComplete(){this.texturesCompleted=!0}start(t){this.callback=t,this.started=!0,o.A.emit(l.k.GAME_PRELOADER_START)}}var p=i(874),d=i(4049),f={},g=[],m=window;try{for(;m&&(m.addEventListener("keydown",(t=>{f[t.keyCode]=!0,t.keyCode>=37&&t.keyCode<=40&&t.preventDefault()})),m.addEventListener("keyup",(t=>{g.push(t.keyCode)})),m.parent!==m);)m=m.parent}catch(wt){}class A{static update(){for(;g.length>0;)f[g.pop()]=!1}static get all(){return f}static get up(){return f[38]||f[87]}static set up(t){t?f[38]=!0:(f[38]=!1,f[87]=!1)}static get down(){return f[40]||f[83]}static set down(t){t?f[40]=!0:(f[40]=!1,f[83]=!1)}static get shiftKey(){return f[16]}static get altKey(){return f[18]}static get ctrlKey(){return f[17]}static get left(){return f[37]||f[65]}static set left(t){t?f[37]=!0:(f[37]=!1,f[65]=!1)}static get right(){return f[39]||f[68]}static set right(t){t?f[39]=!0:(f[39]=!1,f[68]=!1)}static isKeycodePressed(t){return f[t]}static resetAll(){f={}}}var v=i(4222);class y{static init(t,e,i,r,n,a,s,o){var l=()=>{dt.hideModal(t),n&&("string"==typeof n?(0,v.A)(n,this):n())},h=()=>{dt.hideModal(t),s&&("string"==typeof s?(0,v.A)(s,this):s())},u=t.findChildByName("easyCloseBtn");if(u&&(o?u.callback=h:u.disable()),"string"==typeof e){var c=t.findChildByName("title");c&&(c.text=e)}if("string"==typeof i){var d=t.findChildByName("message");d&&(d.text=i)}var f=t.findChildByName("okBtn");if(f){if(r){var g=f.findChildByName("label");g&&(p.A.has(r)?g.translatableText=r:(g.translatableText=null,g.text=r))}f.callback=l}var m=t.findChildByName("noBtn");if(m){if(a){var A=m.findChildByName("label");A&&(p.A.has(a)?A.translatableText=a:(A.translatableText=null,A.text=a))}a||s&&!o?m.callback=h:(m.visible=!1,f.x=(f.x+m.x)/2)}}}var _=document.documentElement;class b{static get isFullscreen(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}static open(){dt.addOnClickOnce(b._openInner)}static _openInner(){try{_.requestFullscreen?_.requestFullscreen():_.mozRequestFullScreen?_.mozRequestFullScreen():_.webkitRequestFullscreen?_.webkitRequestFullscreen():_.msRequestFullscreen&&_.msRequestFullscreen(),dt._fireNextOnResizeImmediately()}catch(t){}}static toggle(){b.isFullscreen?b.close():b.open()}static close(){dt.addOnClickOnce(b._closeInner),dt.projectDesc.autoFullscreenMobile=dt.projectDesc.autoFullscreenDesktop=!1}static _closeInner(){dt._fireNextOnResizeImmediately(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}}b.isAvailable=(_.requestFullscreen||_.mozRequestFullScreen||_.webkitRequestFullscreen||_.msRequestFullscreen)&&!window.cordova;var x=i(9080),T=i(684),E=i(9401),S=i(1220),w=i(5622),P=i(1233),I=new P.Point;class R extends s.A{constructor(){super(),this.tiles=new Map,this.autoUpdate=!1}init(){super.init(),this.renewAllMap()}set tilemap(t){this._tileMapData=t}get tilemap(){return this.map}set texture(t){if(this._texture!==t)for(var e of(this._texture=t,this.children))e instanceof O&&(e.texture=t)}get texture(){return this._texture}getTile(t,e){return this.map[t+e*this.columns]}setTile(t,e,i){var r=t+e*this.columns;this.map[r]!==i&&(this.map[r]=i,this.getTile8x8(t,e).setTile(t%8,e%8,i))}getTile8x8(t,e){var i=(e>>=3)+32*(t>>=3);if(!this.tiles.has(i)){var r=w.A.create(O);return r.clearMap(),r.x=(8*t+4)*this.tileW-this.wField,r.y=(8*e+4)*this.tileH-this.hField,r.xRandomShift=t<<3,r.yRandomShift=e<<3,r.verticesRandomization=this.verticesRandomization,r.verticesRandomizationMod=2*this.verticesRandomization+1,this.tiles.set(i,r),this.addChild(r),r.setProps(),r}return this.tiles.get(i)}updateView(){this.getScenePosition(I);var t,e,i=dt.W/2,r=dt.H/2,n=I.x-i,a=I.y-r,s=i+4*this.tileW,o=r+4*this.tileH;for(var l of this.children)t=n+l.x,e=a+l.y,l.visible=t-s&&e-o,l.visible&&l.updateView()}dispose8x8Tiles(){this.tiles.forEach(C),this.tiles=new Map}onRemove(){super.onRemove(),this.dispose8x8Tiles(),this.map=null}clear(){for(var t=0;tt);return(this._tileMapData||this.map).map(t)}renewAllMap(){if(a.A.hasTexture(this.image)){var t=this.texture.width,e=this.texture.height;if(this.srcTileW=this.tileW+2*this.wField,this.srcTileH=this.tileH+2*this.hField,this.tilesOnTextureW=Math.floor(t/this.srcTileW),this.tilesOnTextureH=Math.floor(e/this.srcTileH),this.uvTileW=this.srcTileW/t,this.uvTileH=this.srcTileH/e,this.resizeMapIfNeed(),this.__maxTileIndex=this.tilesOnTextureH*this.tilesOnTextureW-1,this._tileMapData){for(var i=this.columns*this.rows-1,r=this._tileMapData,n=this.rows-1;n>=0;n--)for(var s=this.columns-1;s>=0;s--)this.setTile(s,n,r[i--]);this._tileMapData=null}}}}Object.defineProperty(R.prototype,"image",S.A.imagePropertyDescriptor);var C=t=>{a.A.destroyObjectAndChildren(t)};class O extends P.SimpleMesh{constructor(){super(),this.drawMode=P.DRAW_MODES.TRIANGLES,this.map=[]}setProps(){this.texture=this.parent.texture,this.pivot.x=4*this.parent.tileW,this.pivot.y=4*this.parent.tileH,this.tileW=this.parent.tileW,this.tileH=this.parent.tileH,this.pureTileW=this.tileW,this.srcTileW=this.parent.srcTileW,this.srcTileH=this.parent.srcTileH,this.uvTileW=this.parent.uvTileW,this.uvTileH=this.parent.uvTileH,this.tilesOnTextureW=this.parent.tilesOnTextureW}setTile(t,e,i){this.needRefresh=!0,this.map[t+(e<<3)]=i}clearMap(){for(var t=0;t<64;t++)this.map[t]=-1;this.needRefresh=!0}updateView(){this.needRefresh&&(this.refreshTiles(),this.needRefresh=!1)}rndX(t,e){return this.verticesRandomization?(12347*(t+=this.xRandomShift)+7323*(e+=this.yRandomShift)^123949)%this.verticesRandomizationMod-this.verticesRandomization:0}rndY(t,e){return this.verticesRandomization?(27389*(t+=this.xRandomShift)+12765*(e+=this.yRandomShift)^123949)%this.verticesRandomizationMod-this.verticesRandomization:0}refreshTiles(){for(var t,e=[],i=[],r=[],n=this.tileW,a=this.tileH,s=this.srcTileW,o=this.srcTileH,l=this.uvTileW,h=this.uvTileH,u=0,c=0,p=0;p<8;p++)for(var d=0;d<8;d++)if((t=this.map[u++])>=0){var f=d*n,g=p*a;e.push(f+this.rndX(d,p),g+this.rndY(d,p)),f+=s,e.push(f+this.rndX(d+1,p),g+this.rndY(d+1,p)),g+=o,e.push(f+this.rndX(d+1,p+1),g+this.rndY(d+1,p+1)),f-=s,e.push(f+this.rndX(d,p+1),g+this.rndY(d,p+1)),f=t%this.tilesOnTextureW*l,g=Math.floor(t/this.tilesOnTextureW)*h,i.push(f,g),f+=l,i.push(f,g),g+=h,i.push(f,g),f-=l,i.push(f,g),r.push(c,c+1,c+2),r.push(c,c+2,c+3),c+=4}this.verticesBuffer.data=new Float32Array(e),this.uvBuffer.data=new Float32Array(i),this.geometry.buffers[2].data=new Uint16Array(r),this.uvBuffer._updateID++,this.verticesBuffer._updateID++,this.geometry.buffers[2]._updateID++}}var M,B,D,L,k,N,F,G,U,H,X,j=i(2468),W=i(9087),V=i(1233),Y=i(230),z=0,q=4,Q=1,Z=0,K=[],J=[],$=[],tt=[],et=1,it=[];class rt{constructor(){this.data={},this.isMobile=V.utils.isMobile,this.all=null,this.isVisible=!1,this.isFocused=!1}get modalsCount(){return K.length}get currentContainer(){return K.length>0?K[K.length-1]:this.currentScene}get currentFader(){return k}onResize(){var t,e;if(F){F===document.body?(t=window.innerWidth,e=window.innerHeight):(t=F.clientWidth,e=F.clientHeight);var i,r,n,a=pt.projectDesc.dynamicStageSize;switch("auto"===(i=this.projectDesc.screenOrientation)&&(i=te,pt.isPortrait=!0;break;case"auto":pt.isPortrait=tt,pt.isPortrait=!1}if(!V.utils.isMobile.any&&(r=!1),pt.isPortrait?(this.W=this.projectDesc.portraitWidth||408,this.H=this.projectDesc.portraitHeight||720):(this.W=this.projectDesc.width||1280,this.H=this.projectDesc.height||720),!a)pt.projectDesc.preventUpscale&&(r?(t=Math.min(this.H,t),e=Math.min(this.W,e)):(t=Math.min(this.W,t),e=Math.min(this.H,e)));n=r?Math.min(e/this.W,t/this.H):Math.min(t/this.W,e/this.H),a&&(pt.projectDesc.preventUpscale?(n<1&&(t/=n,e/=n),n=1):(t/=n,e/=n));var s,o,l=1;if(this.isMobile.any?pt.projectDesc.renderResolutionMobile&&(l=pt.projectDesc.renderResolutionMobile):pt.projectDesc.renderResolution&&(l=pt.projectDesc.renderResolution),n*=l=Math.max(window.devicePixelRatio||1,l),n=Math.min(3,n),this.pixiApp&&this.pixiApp.renderer&&(pt.isCanvasMode=!this.pixiApp.renderer.gl,!pt.isCanvasMode)){var h=this.pixiApp.renderer.gl,u=h.getParameter(h.MAX_TEXTURE_SIZE);u<3e3&&(n=Math.min(1,n)),t*n>u&&(n=u/t),e*n>u&&(n=u/e)}a&&(r?(this.H=t,this.W=e):(this.W=t,this.H=e)),r?(s=this.H,o=this.W):(s=this.W,o=this.H),this.W=Math.round(this.W),this.H=Math.round(this.H),1&this.W&&this.W++,1&this.H&&this.H++;var c=G!==s||U!==o||et!==n;if(pt.pixiApp){G=s,U=o,et=n;var p=pt.stage;if(pt._isCanvasRotated=r,r?(p.rotation=Math.PI/2,p.x=this.H):(p.rotation=0,p.x=0),c){if(!0){var d=pt.pixiApp.renderer;d.resolution=et,V.InteractionManager.resolution=et,d.plugins.interaction.resolution=et,d.rootRenderTarget&&(d.rootRenderTarget.resolution=et),d.resize(G+1e-4,U+1e-4)}this.forAllChildrenEverywhere(at)}}}}openUrl(t,e="_blank"){var i=()=>{window.open(t,e)};Object.defineProperty(i,"openNewTab",{get:()=>!0}),pt.addOnClickOnce(i)}init(t,e,r=""){pt.additionalLoadingsInProgress=0,this.getValueByPath=j.A,pt.Lib=a.A,this.game=pt,this.Sound=d.A,this.L=p.A,this.setValueByPath=j.W,this.classes=a.A.classes,this.onResize=this.onResize.bind(this),this.time=0,this.projectDesc=this.projectDesc||{};this.fullscreen=b,!0,this.keys=A,e||(e=Y.projectDesc.id),this.settings=new n.A(e),this.gameId=e,this._updateGlobal=this._updateGlobal.bind(this),this.mouse=new V.Point,this.resourcesPath=r;var s=new Promise((t=>{this._gameInitializedResolve=t}));return F=t||document.body,D=Y,this.applyProjectDesc(D.projectDesc),V.utils.isWebGLSupported()?this._initInner():i.e(69).then(i.bind(i,2069)).then((()=>this._initInner())),s}_getTextureSettingsBits(t,e){var i=pt.projectDesc.loadOnDemandTextures;return i.hasOwnProperty(t)?i[t]&e:0}addOnClickOnce(t){it.push(t)}applyProjectDesc(t){var e={defaultFont:"Arial",screenOrientation:"landscape",width:1280,height:720,portraitWidth:408,portraitHeight:720,renderResolution:1,renderResolutionMobile:1,framesSkipLimit:4,dynamicStageSize:!1,preventUpscale:!1,webfontloader:null,fontHolderText:"ЯSфz",mipmap:!1,version:"0.0.1",soundFormats:["ogg","aac"],soundDefaultBitrate:96,soundBitrates:{},loadOnDemandSounds:{},loadOnDemandTextures:{},__loadOnDemandTexturesFolders:{},defaultMusVol:1,defaultSoundsVol:1,embedLocales:!0,__localesNewKeysPrefix:"",__externalTranslations:[],autoFullscreenDesktop:!1,autoFullscreenMobile:!1,__proxyFetchesViaNodeServer:!1,__group:"",__webpack:{debug:"config/webpack.debug.js",production:"config/webpack.prod.js"},jpgQuality:95,pngQuality:[.95,1]},i=!1;for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r],i=!0);t.screenOrientation;return V.settings.MIPMAP_TEXTURES=t.mipmap?V.MIPMAP_MODES.ON:V.MIPMAP_MODES.OFF,this.projectDesc=t,this.onResize(),i}_initInner(){pt.additionalLoadingsInProgress++;Promise.all([_t(),bt(),xt()]).then((()=>{pt.additionalLoadingsInProgress--}));this.onResize();var t=yt();B=new V.Application({width:G,height:U,backgroundColor:0,preserveDrawingBuffer:t}),this.pixiApp=B,F.appendChild(B.view);var e=t=>{for(var e=it.some((t=>t.openNewTab));it.length>0;){var i=it.shift();e&&!i.openNewTab||i(t)}var r=pt.isMobile.any?pt.projectDesc.autoFullscreenMobile:pt.projectDesc.autoFullscreenDesktop;!e&&r&&pt.fullscreen.isAvailable&&!pt.fullscreen.isFullscreen&&pt.fullscreen._openInner()};B.view.addEventListener("click",e),B.view.addEventListener("touchend",e);var i=pt.pixiApp.renderer.plugins.interaction;i.on("pointerdown",st),i.on("pointermove",lt),i.on("pointerup",ot),this._mouseHandlerGlobal=ct,(M=new s.A).name="stage",this.stage=M,this.onResize(),B.stage.addChild(M),B.ticker.add(this._updateGlobal),d.A.init(),this._gameInitializedResolve(),delete this._gameInitializedResolve,this._startGame(),B.view.addEventListener("wheel",(t=>t.preventDefault())),window.addEventListener("resize",this._onContainerResize.bind(this))}_fireNextOnResizeImmediately(){X=!0}_onContainerResize(){if(H&&clearTimeout(H),X)X=!1,this.onResize();else{var t=pt.isMobile.any;H=setTimeout((()=>{if(H=!1,t)for(var e of[20,40,80,200,500,1e3,1500,2e3,3e3])setTimeout(this.onResize,e);this.onResize()}),t?1:200)}}_startGame(){var t=new c;if(a.A._setPrefabs(D.prefabs),a.A._setScenes(D.scenes),a.A._setSounds(D.sounds),D.resources)for(var e in D.resources)a.A.addResource(e,{metadata:{...D.resourceImages,...D.resources[e]}});V.Texture.WHITE.baseTexture.resource.source.getContext("2d").fillRect(0,0,1,1),a.A.addTexture("EMPTY",V.Texture.EMPTY),a.A.addTexture("WHITE",V.Texture.WHITE);var i=new u.A;for(var r in D.images)pt._getTextureSettingsBits(r,3)||i.add(Tt(r),void 0,{metadata:D.images[r]});i.load(),t.start((()=>{for(var t in D.sounds&&Object.keys(D.sounds).length&&d.A.checkSoundLockByBrowser(),D.images){var e=V.utils.TextureCache[Tt(t)];e&&a.A.addTexture(t,e)}Object.values(D.prefabs).forEach(a.A._filterStaticTriggersRecursive),Object.values(D.scenes).forEach(a.A._filterStaticTriggersRecursive),this.showScene(D.projectDesc.mainScene||"main"),a.A._preCacheSoundsAndTextures()}))}_setCurrentScene(t){pt.all=t?t.all:null,pt.currentScene=t}_setCurrentSceneContent(t){return t=ft(t),this._setCurrentScene(t),t.interactiveChildren=!1,M.addChildAt(t,0),t._onShowCalled=!1,t}get disableAllButtons(){return!!k}faderShoot(){for(;L.length>0;){var t=L.pop(),e=K.indexOf(t);e>=0&&(K.splice(e,1),a.A.destroyObjectAndChildren(t))}for(;J.length>0;){var i=J.pop();a.A.destroyObjectAndChildren(i)}pt._isWaitingToHideFader=!0}_processScenesStack(){for(;;){var t=tt[tt.length-1];if(t===pt.currentScene)break;pt.currentScene&&(pt.currentScene._onShowCalled&&pt.currentScene.onHide(),gt()),t=tt[tt.length-1],tt[tt.length-1]=pt._setCurrentSceneContent(t)}}faderEnd(){if(N){var t=$.indexOf(N);$.splice(t,1),a.A.destroyObjectAndChildren(N),N=null}}replaceScene(t,e){mt(tt.pop()),tt.push(t),pt._startFaderIfNeed(e)}showScene(t,e){tt.push(t),pt._startFaderIfNeed(e)}closeAllScenes(t){for(;tt.length>1;)pt.closeCurrentScene(t)}closeCurrentScene(t){mt(tt.pop()),pt._startFaderIfNeed(t)}_startFaderIfNeed(t){tt[tt.length-1]!==pt.currentScene&&(L=K.slice(),k||(t||(t=this.currentScene&&this.currentScene.faderType?this.currentScene.faderType:"fader/default"),k=a.A.loadPrefab(t),this.stage.addChild(k),T.A._recalculateMusic()))}_getScenesStack(){return tt}showQuestion(t,e,i=null,r=null,n=null,s=null,o=!0,l="ui/sure-question"){var h=a.A.loadPrefab(l);return y.init(h,t,e,i,r,n,s,o),pt.showModal(h)}showModal(t,e){return"string"==typeof t&&(t=a.A.loadPrefab(t)),o.A.emit(l.k.GAME_SHOW_MODAL),K.push(t),t._onModalHide=e,t.interactiveChildren=!1,pt.stage.addChild(t),T.A._recalculateMusic(),t}hideModal(t=null,e=!1){var i;if(t){var r=K.indexOf(t);if(r<0)return;i=K[r],K.splice(r,1)}else i=K.pop();o.A.emit(l.k.GAME_CLOSE_MODAL),!!i._onModalHide&&(i._onModalHide(),delete i._onModalHide),e?a.A.destroyObjectAndChildren(i):(i.interactiveChildren=!1,J.push(i)),T.A._recalculateMusic()}mouseEventToGlobalXY(t){var e=B.view.getBoundingClientRect(),i=t.clientX-e.left;return nt.x=i*(pt.W/e.width),i=t.clientY-e.top,nt.y=i*(pt.H/e.height),nt}_updateGlobal(t){if(!0)for(x.A.updateGlobal(),t=Math.min(t,q),Z+=t,Z=Math.min(Z,Q*pt.projectDesc.framesSkipLimit);Z>Q;)Z-=Q,pt.isUpdateBeforeRender=!(Z>Q),this._updateFrame();if(this.currentScene){B.renderer.backgroundColor=this.currentScene.backgroundColor,this.currentScene.interactiveChildren=0===this.modalsCount&&!k;for(var e=this.modalsCount-1,i=!k;e>=0;)K[e].interactiveChildren=i,i=!1,e--}}forAllChildrenEverywhereBack(t){for(var e of tt)"string"!=typeof e&&(t(e),e.parent||(t(e),e.forAllChildren(t)));var i=a.A._getStaticScenes();for(var r in i){var n=i[r];n.parent||(t(n),n.forAllChildren(t))}}getLoadingCount(){var t=a.A.getSoundsLoadingCount();return t+=u.A.getLoadingCount(),pt.additionalLoadingsInProgress&&(t+=pt.additionalLoadingsInProgress),!!k&&(t+=k.findChildrenByType(W.A).length),t}forAllChildrenEverywhere(t){pt.stage.forAllChildren(t),pt.forAllChildrenEverywhereBack(t)}_hideCurrentFaderAndStartScene(){k.gotoLabelRecursive("hide fader"),$.unshift(k),k=null,T.A._recalculateMusic()}_updateFrame(){if(!pt._loadingErrorIsDisplayed){if(!pt.isCanvasMode){if(pt.pixiApp.renderer.gl.isContextLost())return void(pt.isVisible&&60===++z&&pt._reloadGame());z=0}pt._isWaitingToHideFader?0===pt.getLoadingCount()&&(pt._processScenesStack(),pt.currentScene._onShowCalled?(pt._hideCurrentFaderAndStartScene(),pt._isWaitingToHideFader=!1):(pt.currentScene._onShowCalled=!0,pt.currentScene.onShow(),St())):this.currentContainer&&(!k||this.currentContainer!==this.currentScene||J.length<1)&&this.currentContainer.update(),k&&k.update();for(var t=$.length-1;t>=0;){var e=$[t];N=e,e.update(),t--}if(!k)for(var i=J.length-1;i>=0;){var r=J[i];r.alpha-=.1,r.alpha<=.01&&(a.A.destroyObjectAndChildren(r),J.splice(i,1)),i--}this.keys.update(),a.A._cleanupRemoveHolders(),this.time++}}fetchResource(t){return new Promise((e=>{var i=new u.A;i.add(t,t),i.load(((i,r)=>{e(r[t].data)}))}))}_onLoadingError(t){if(!pt._loadingErrorIsDisplayed){u.A.destroyAllLoaders(),pt._loadingErrorIsDisplayed=!0,T.A._recalculateMusic();var e=document.createElement("div");e.innerHTML='\n\n
\n\t
\n\t\t
'+pt.projectDesc.title+'
\n\t\t
\n\t\t\tLOADING ERROR
\n\t\t
(click to reload)
\n\t
\n
',document.body.appendChild(e),document.addEventListener("click",(()=>{pt._reloadGame()}))}}_reloadGame(){pt.onGameReload&&pt.onGameReload(),window.location.reload()}applyCSS(t){var e=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),e.appendChild(i)}}var nt=new V.Point,at=t=>{t._onRenderResize&&t._onRenderResize()},st=t=>{if(!ut.hasOwnProperty(t.data.pointerId)){var e={x:t.data.global.x,y:t.data.global.y};ut[t.data.pointerId]=e,ht.unshift(e)}pt.isFocused||vt(!0),pt.mouse.click=!0,ct(t),pt.currentContainer&&pt.currentContainer.onMouseDown&&pt.currentContainer.interactiveChildren&&(d.A._unlockSound(),pt.currentContainer.onMouseDown(pt.mouse,t))},ot=t=>{var e=t.data.global.x,i=t.data.global.y;ut.hasOwnProperty(t.data.pointerId)&&(ht.splice(ht.indexOf(ut[t.data.pointerId]),1),delete ut[t.data.pointerId]),ht.length>0?(t.data.global.x=ht[0].x,t.data.global.y=ht[0].y):pt.mouse.click=!1,ct(t),t.data.global.x=e,t.data.global.y=i,pt.currentContainer&&pt.currentContainer.onMouseUp&&pt.currentContainer.interactiveChildren&&pt.currentContainer.onMouseUp(pt.mouse,t)},lt=t=>{var e=t.data.global.x,i=t.data.global.y,r=ut[t.data.pointerId];r&&(r.x=t.data.global.x,r.y=t.data.global.y),(r=ht[0])&&(t.data.global.x=r.x,t.data.global.y=r.y),0===t.data.buttons&&(pt.mouse.click=!1),ct(t),t.data.global.x=e,t.data.global.y=i,pt.currentContainer&&pt.currentContainer.onMouseMove&&pt.currentContainer.interactiveChildren&&pt.currentContainer.onMouseMove(pt.mouse,t)},ht=[],ut={},ct=t=>{if(isFinite(t.data.global.x)){var e=pt.mouse,i=pt.stage.toLocal(t.data.global,pt.pixiApp.stage),r=Math.round(i.x),n=Math.round(i.y);r>pt.W?r=pt.W:r<0&&(r=0),n>pt.H?n=pt.H:n<0&&(n=0),e.x=r,e.y=n}},pt=new rt;pt.globalEventDispatcher=o.A;const dt=pt;function ft(t){return"string"==typeof t&&(t=a.A.loadScene(t)),t}function gt(){var t=pt.currentScene;pt._setCurrentScene(null),mt(t)}function mt(t){t instanceof h.A&&t!==pt.currentScene&&(!t.isStatic&&tt.indexOf(t)<0?a.A.destroyObjectAndChildren(t):t.detachFromParent())}window.cordova&&(document.addEventListener("backbutton",(function(){E.A._tryToClickByKeycode(27)}),!1),pt.exitApp=(t=!1)=>{t?navigator.app.exitApp():pt.showQuestion((0,p.A)("SUREEXIT_TITLE"),(0,p.A)("SUREEXIT_TEXT"),void 0,(()=>{pt.exitApp(!0)}))}),window.addEventListener("focus",(()=>vt(!0))),window.addEventListener("blur",(()=>vt(!1))),document.addEventListener("visibilitychange",(()=>At()));var At=()=>{var t="visible"===document.visibilityState;pt.isVisible!==t&&(pt.isVisible=t,pt.pixiApp&&setTimeout((()=>{T.A._clearCustomFades(.2),T.A._recalculateMusic()}),10),vt(t))},vt=t=>{pt.isFocused!==t&&(pt.isFocused=t,pt.pixiApp&&setTimeout((()=>pt.keys.resetAll()),10))};function yt(){try{var t=document.createElement("canvas");t.setAttribute("width","1"),t.setAttribute("height","1"),document.body.appendChild(t);var e=t.getContext("webgl",{stencil:!0});if(t.parentNode.removeChild(t),!e)return!1;var i=e.getExtension("WEBGL_debug_renderer_info");return null!=i&&-1!=e.getParameter(i.UNMASKED_RENDERER_WEBGL).search("Mali-400")}catch(r){}}function _t(){return pt.projectDesc.webfontloader?new Promise((t=>{setTimeout((()=>{if(pt.projectDesc.fontHolderText){var e=document.createElement("span");for(var r in e.style.opacity=0,e.style.color="rgba(0,0,0,0.01)",e.style.position="absolute",e.style.zIndex=-1,pt.projectDesc.webfontloader){var n=pt.projectDesc.webfontloader[r].families;if(n)for(var a of n){if("custom"===r){var s=pt.resourcesPath+"fonts/"+a.replace(/ /g,"");pt.applyCSS("\n\t\t\t\t\t\t\t\t\t\t@font-face {\n\t\t\t\t\t\t\t\t\t\t\tfont-family: '"+a+"';\n\t\t\t\t\t\t\t\t\t\t\tsrc: url('"+s+".woff2') format('woff2'),\n\t\t\t\t\t\t\t\t\t\t\turl('"+s+".woff') format('woff');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t")}var o=a.split(":"),l=o[0],h=o[1]?o[1].split(","):["normal"];for(var u of h){var c=document.createElement("span");c.style.fontFamily=`"${l}"`,c.style.fontWeight=u,c.innerHTML=pt.projectDesc.fontHolderText,e.appendChild(c)}}}document.body.appendChild(e)}setTimeout((()=>{if(!window.WebFont)try{window.WebFont=i(1537)}catch(n){}var e=pt.projectDesc.webfontloader;e.timeout=e.timeout||6e3;var r=!1;e.inactive=e.active=()=>{r||(r=!0,t())},window.WebFont.load(e)}),1)}),1)})):Promise.resolve()}function bt(){if(pt.projectDesc.embedLocales)return p.A.setLanguagesAssets(D.text),Promise.resolve(D.text);var t=pt.projectDesc.localeResourcesPath||pt.resourcesPath+"i18n";return p.A.loadLanguages(void 0,t)}async function xt(){var{lossy:t,lossless:e}=await(0,r.kT)();pt.isWebpAvailable=t&&e}vt(!0),At();var Tt=t=>t?pt.resourcesPath+"img/"+t:null;pt._textureNameToPath=Tt,pt.getImageMetadata=t=>D.images[t]||{};var Et=t=>t.replace(pt.resourcesPath+"img/","");function St(){var t,e,i,r={};pt.stage.forAllChildren((n=>{if(n instanceof S.A||n instanceof V.Mesh||n instanceof R){var s=n.image;if(s&&!a.A.hasTexture(s)&&pt._getTextureSettingsBits(s,3)){if(n.texture=a.A.getTexture("EMPTY"),t||(e={},i=[],t=new u.A),!e.hasOwnProperty(s)){e[s]=!0;var o=Tt(s),l={metadata:D&&D.images?D.images[s]:{}};t.add(o,void 0,l)}i.push(n)}else pt._getTextureSettingsBits(s,3)&&(n.texture.baseTexture||(n.texture=a.A.getTexture(s)),r[s]=!0)}})),t&&t.load(((t,e)=>{for(var r in e){var n=Et(r);a.A.addTexture(n,e[r].texture)}for(var s of i){var o=s.image;s.image="EMPTY",s.image=o}}))}},9135:(t,e,i)=>{"use strict";i.d(e,{A:()=>R});var r,n,a=i(5622),s=(i(9649),i(3951),i(9443)),o=i(2468),l=i(9062),h=i(1233),u={},c={},p={},d={},f={},g={};class m extends h.Container{constructor(){super(),this.visible=!1}onRemove(){super.onRemove();var t=A.indexOf(this);t>=0&&A.splice(t,1)}update(){}}var A=[],v=t=>{if(!t._thing_initialized){t._thing_initialized=!0,t.init();for(var e=t.children,i=e.length,r=0;r{var r=i[t];if(_.resources[t]=r,r.textures)for(var n in r.textures)_.addTexture(n,r.textures[n])}))}}addTexture(t,e){"EMPTY"!==t&&"WHITE"!==t&&_.hasTexture(t)&&_._unloadTexture(t),P(t),p[t]=e;var i=p[t].baseTexture;switch(s.A._getTextureSettingsBits(t,24)){case 0:i.wrapMode=h.WRAP_MODES.CLAMP;break;case 8:i.wrapMode=h.WRAP_MODES.REPEAT;break;default:i.wrapMode=h.WRAP_MODES.MIRRORED_REPEAT}s.A._getTextureSettingsBits(t,4)&&(i.mipmap=h.MIPMAP_MODES.ON),s.A.isCanvasMode||s.A.pixiApp.renderer.texture.updateTexture(i)}_unloadTexture(t){var e=p[t];e&&(h.Texture.removeFromCache(e),e.destroy(!0),delete p[t])}_filterStaticTriggers(t){return"StaticTrigger"===t.c?t.p.invert!==!(0,o.A)(t.p.dataPath||n.StaticTrigger.dataPath,s.A):!t[":"]||!t[":"].some((t=>"StaticTrigger"===t.c&&!!t.p.invert!=!(0,o.A)(t.p.dataPath||n.StaticTrigger.dataPath,s.A)))}_filterStaticTriggersRecursive(t){if(t[":"]){var e=t[":"].filter(_._filterStaticTriggers);t[":"]=e,e.forEach(_._filterStaticTriggersRecursive)}}_setSounds(t,e=!1){for(var i in d=t,f)f[i].unload();var r=!0;for(var n in r&&(f={}),d){var a=d[n],o=void 0;if("number"==typeof a[a.length-1]&&(o=a.pop()),!0){var l=b({src:a.map(T),preload:!s.A.projectDesc.loadOnDemandSounds.hasOwnProperty(n)},o);l.lastPlayStartFrame=0,f[n]=l}}}_preCacheSoundsAndTextures(){var t,e={};t=setInterval((()=>{if(0===s.A.getLoadingCount()){for(var i in d)if(2===s.A.projectDesc.loadOnDemandSounds[i]&&_.preloadSound(i))return;for(var r in s.A.projectDesc.loadOnDemandTextures)if(2===s.A._getTextureSettingsBits(r,3)&&!e[r])return e[r]=!0,void l.A.easyPreloadImage(r);clearInterval(t)}}),1e3)}getSoundsLoadingCount(){var t=0;for(var e in f){E(f[e])||t++}return t}hasSound(t){return d.hasOwnProperty(t)}getSound(t,e){return f[t]}preloadSound(t){if(t){var e=f[t];if("unloaded"===e.state())return e.load(),!0}}__clearAssetsLists(){p={},_.resources={},_.__texturesList=[],__allTextures={},_.__resourcesList=[]}_loadClassInstanceById(t){var e=a.A.create(c[t]);return Object.assign(e,n[t]),v(e),e}hasTexture(t){return p.hasOwnProperty(t)}getTextureEndingWith(t){var e=Object.keys(p).find((e=>e.endsWith(t)));return e&&_.getTexture(e)}getTexture(t){return!p.hasOwnProperty(t)&&s.A._getTextureSettingsBits(t,3)?h.Texture.WHITE:p[t]}destroyObjectAndChildren(t,e){if(t.onRemove(),t._thing_initialized=!1,e){var i=a.A.create(m),r=t.parent.children;r[r.indexOf(t)]=i,i.parent=t.parent,A.push(i),t.parent=null}else t.detachFromParent();for(;t.children.length>0;)_.destroyObjectAndChildren(t.getChildAt(t.children.length-1));a.A.dispose(t),t.interactiveChildren=!0}_deserializeObject(t){var e,i;"PrefabReference"===t.c?(i=t.p.hasOwnProperty("dynamicPrefabName")?(0,o.A)(t.p.dynamicPrefabName,this):t.p.prefabName,e=_._deserializeObject(u[i]),t.p.hasOwnProperty("inheritProps")||Object.assign(e,n[t.c],t.p)):(e=a.A.create(c[t.c]),Object.assign(e,n[t.c],t.p));if(t.hasOwnProperty(":")){var r=t[":"];for(var s of r)e.addChild(_._deserializeObject(s))}return e}loadScene(t){if(g.hasOwnProperty(t))return g[t];r.hasOwnProperty(t)||(t=Object.keys(r)[0]);var e=r[t];e.p.__libSceneName=t;var i=x(e);return delete e.p.__libSceneName,s.A.hasOwnProperty("__savedCurrentSceneForInitTime")&&(s.A._setCurrentScene(s.A.__savedCurrentSceneForInitTime),delete s.A.__savedCurrentSceneForInitTime),i.isStatic&&(g[t]=i),i}_cleanupRemoveHolders(){for(;A.length>0;)_.destroyObjectAndChildren(A.pop())}hasPrefab(t){return u.hasOwnProperty(t)}hasScene(t){return r.hasOwnProperty(t)}_getStaticScenes(){return g}}var _=new y;function b(t,e){var i=new Howl(t);return i.once("loaderror",(t=>{i.loadedWithError=!0})),i.once("load",(()=>{e&&(i._duration=e,i._sprite.__default[1]=1e3*e)})),i}var x=t=>{var e=_._deserializeObject(t);return v(e),e};function T(t){return s.A.resourcesPath+"snd/"+t}function E(t){return"loading"!==t.state()||t.loadedWithError}var S,w=new Set;function P(t){S&&clearTimeout(S),S=setTimeout(I,10),w.add(t)}function I(){S=null,s.A.forAllChildrenEverywhere((t=>{if(t.image&&w.has(t.image)){var e=t.image;t.image="EMPTY",t.image=e}})),w.clear()}_.resources={},_.loadPrefab=function(t){return x(u[t])};const R=_},4222:(t,e,i)=>{"use strict";i.d(e,{A:()=>c,t:()=>o});var r=i(2468),n=i(9443),a=(t,e)=>{var i,a=o(t),s=a.p,l=s[0];i="this"===l?e:n.A[l];for(var h,u=1;u{if(s.hasOwnProperty(t))return s[t];var e={},i=t.split("`");return e.p=i[0].split(".").map(u),i.length>1&&(e.v=i[1].split(",").map(h)),s[t]=e,e},l=/^\-?[\.0-9]+$/,h=t=>t.match(l)?parseFloat(t):t,u=t=>35===t.charCodeAt(0)?{s:t.substr(1)}:t;const c=a},2468:(t,e,i)=>{"use strict";i.d(e,{A:()=>s,W:()=>a});var r=i(9443),n=(i(3951),i(4222)),a=(t,e,i)=>{var a,s=(0,n.t)(t).p,o=s[0];a="this"===o?i:r.A[o];for(var l=1;l{var i,a=(0,n.t)(t),s=a.p,o=s[0];i="this"===o?e:r.A[o];for(var l,h=1;h{"use strict";i.d(e,{A:()=>f});var r,n=i(9443),a={},s={},o=window.navigator&&navigator.language?navigator.language.split("-")[0]:"en",l=!1,h=!1;function u(t,e=void 0,i=void 0){var r;return a.hasOwnProperty(t)?(r=a[t],u.messageProcessor&&(r=u.messageProcessor(r,e,i))):r=t,void 0!==e&&(r=r.replace("%d",e),void 0!==i&&(r=r.replace("%s",i))),r}function c(t,e){if(!h)return r=t,void(l=!(null==e||!e.isHieroglyphic));if(o!==t){if(s.hasOwnProperty(t))o=t;else if(o=n.A.projectDesc.defaultLanguage,window.navigator&&navigator.languages)for(var i of navigator.languages)if(i=i.split("-")[0],s.hasOwnProperty(i)){o=i;break}a=s[o],u.fefreshAllTextEverywhere()}}function p(t){t.onLanguageChanged&&t.onLanguageChanged()}function d(t,e,i){for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];"string"==typeof n?i?e[i+r]=t[r]:e[r]=t[r]:d(n,e,i?i+r+".":r+".")}}u.setLanguagesAssets=t=>{h=!0,s=t;var e=r||o;r=null,o=null,c(e)},u.loadLanguages=function(t,e){return t||(t=r),new Promise((i=>{var r=e+"/"+t+".json";return n.A.fetchResource(r).then((e=>{e=u._deserializeLanguage(e),s[t]=e,this.setLanguagesAssets(s),i(e)}))}))},u.has=t=>a.hasOwnProperty(t),u.fefreshAllTextEverywhere=function(){n.A.stage&&n.A.forAllChildrenEverywhere(p)},u.getCurrentLanguageId=()=>o,u.getLanguagesList=()=>Object.keys(s),u.setCurrentLanguage=c,u._deserializeLanguage=function(t){var e={};return d(t,e),e},u.isCurrentLanguageHieroglyphic=()=>l;const f=u},2982:(t,e,i)=>{"use strict";i.d(e,{A:()=>u});var r=i(4319),n=i(9135),a=(i(9443),.0101),s=40,o=1/s,l={},h={};setInterval((()=>{for(var t in h)h[t]._updateFading()}),s);class u{constructor(t){t.dynamicPreloading&&(t.loop&&n.A.preloadSound(t.loop),t.intro&&n.A.preloadSound(t.intro)),this.onIntroEnd=this.onIntroEnd.bind(this),this.intro=t.intro,this.loop=t.loop,this.musicFragmentHash=t.musicFragmentHash}_updateFading(){var t=this.getVolume();this._fadeToVol!==t&&((t=(0,r.CR)(t,this._fadeToVol,1/(this._fadeSpeed+1e-4)*o)){"use strict";i.d(e,{A:()=>n});var r=new Map;class n{static clearAll(){r.clear()}static create(t){if(!r.has(t))return new t;var e=r.get(t);return 0===e.length?new t:e.pop()}static dispose(t){var e=t.constructor;r.has(e)||r.set(e,[]),r.get(e).push(t)}}},9062:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var r=i(9443),n=i(1233),a=[],s=n.Spritesheet.prototype.parse;n.Spritesheet.prototype.parse=function(){try{return s.apply(this,arguments)}catch(t){r.A._onLoadingError("Spritesheet parsing error ("+this.data.meta.image+"): "+t.message)}};var o=new RegExp(/\.[^.]+$/);class l{constructor(){this._createNewLoader(),this.attempt=0,this.count=1,this.resources={}}static pre(t,e){var i=t.url.slice(t.url.indexOf("/img/")+5),n=t.metadata&&t.metadata[i]?t.metadata[i]:t.metadata,a=n.e||t.extension;n.f_e&&a.endsWith("webp")&&!r.A.isWebpAvailable&&(a=n.f_e),a!==t.extension&&(t.orig_url=t.url,t.url=t.url.replace(o,a),t.extension=a.slice(a.lastIndexOf(".")+1)),e()}static easyPreloadImage(t){var e={url:r.A._textureNameToPath(t),metadata:r.A.getImageMetadata(t),extension:t.slice(t.lastIndexOf(".")+1)};l.pre(e,(()=>{})),(new Image).src=e.url}add(t,e=t,i={}){var r=i.metadata||{};i.metadata={...r,imageMetadata:r,spineAtlas:r.s_a},this.loader.add(t,e,i),this.resources[t]=!0,this.count++}static getLoadingCount(){var t=0;for(var e of a)t+=e.count;return t}static destroyAllLoaders(){for(var t of a)t.loader.destroy()}load(t,e){var i;e||a.push(this),this.loader.onLoad.add(((t,e)=>{this.resources[e.name]&&this.count--})),this.loader.load((()=>{if(!r.A._loadingErrorIsDisplayed){for(var e of Object.values(this.loader.resources))if(e.error){if(i||(i=[]),!this.resources[e.name]){i=i.concat(Object.keys(this.resources).map((t=>this.loader.resources[t])));break}i.push(e)}if(i)this.attempt++<3?setTimeout((()=>{for(var e of(this._createNewLoader(),this.count=1,i))e.metadata&&(e.metadata.f_e&&(e.metadata.e=e.metadata.f_e),Object.values(e.metadata).forEach((t=>{t&&t.f_e&&(t.e=t.f_e)}))),this.add(e.name,e.orig_url||e.url,{metadata:e.metadata});this.load(t,!0)}),1e3*this.attempt):r.A._onLoadingError(i[0].url);else{this.resources=Object.assign(this.resources,this.loader.resources);var n=a.indexOf(this);a.splice(n,1),r.A._loadingErrorIsDisplayed||(t&&t(this,this.resources),0===a.length&&l.preloader&&(l.preloader.onComplete(),l.preloader=null))}}}))}_createNewLoader(){this.loader=new n.Loader("",1e3),this.loader.pre(l.pre)}}},7781:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});i(9443);class r{constructor(t){this._storageId=t;try{"undefined"!=typeof Storage&&localStorage.hasOwnProperty(t)&&(this.data=JSON.parse(localStorage[t]))}catch(e){this.data={}}this.hasOwnProperty("data")||(this.data={}),this.flush=this.flush.bind(this)}getItem(t,e){return this.data.hasOwnProperty(t)?this.data[t]:e}setItem(t,e){e===this.data[t]&&"object"!=typeof e||(this.data[t]=e,this.changed(),r.globalOnChanged&&r.globalOnChanged(t,e))}removeItem(t){this.data.hasOwnProperty(t)&&(delete this.data[t],this.changed())}changed(){this.hasOwnProperty("__flushInterval")||(this.__flushInterval=setTimeout(this.flush,10,this))}clear(){this.data={},this.changed()}flush(){if("undefined"!=typeof Storage){delete this.__flushInterval;try{localStorage.setItem(this._storageId,JSON.stringify(this.data))}catch(t){this.data=this.data||{}}}}}const n=r},4049:(t,e,i)=>{"use strict";i.d(e,{A:()=>p});var r,n,a,s=i(9443),o=i(9135),l=i(684),h=(i(2982),.005),u=.05;function c(t,e){return t>u?t:e}class p{static get soundsVol(){return f}static setSoundsVol(t){p.soundsVol=t}static set soundsVol(t){t=Math.max(0,Math.min(1,t)),f=t,s.A.settings.setItem("soundsVol",f)}static get musicVol(){return g}static setMusicVol(t){p.musicVol=t}static set musicVol(t){t=Math.max(0,Math.min(1,t)),g!==t&&l.A._clearCustomFades(.2),g=t,s.A.settings.setItem("musicVol",g),l.A._recalculateMusic()}static get fullVol(){return Math.max(f,g)}static set fullVol(t){var e=s.A.settings.getItem("musicEnabled",!0),i=s.A.settings.getItem("soundEnabled",!0);e||i||(e=i=!0),e?p.musicVol=t:s.A.settings.setItem("musicVolEnabling",t),i?p.soundsVol=t:s.A.settings.setItem("soundsVolEnabling",t)}static get musicEnabled(){return g>=h}static set musicEnabled(t){p.musicEnabled!==t&&(l.A._clearCustomFades(.2),t?p.musicVol=c(s.A.settings.getItem("musicVolEnabling"),s.A.projectDesc.defaultMusVol):(s.A.settings.setItem("musicVolEnabling",g),p.musicVol=0),p.rememberEnablings())}static rememberEnablings(){d||(d=setTimeout(y,10))}static toggleMusic(){p.musicEnabled=!p.musicEnabled}static get soundEnabled(){return f>=h}static set soundEnabled(t){p.soundEnabled!==t&&(t?p.soundsVol=c(s.A.settings.getItem("soundsVolEnabling"),s.A.projectDesc.defaultSoundsVol):(s.A.settings.setItem("soundsVolEnabling",f),p.soundsVol=0),p.rememberEnablings())}static toggleSounds(){p.soundEnabled=!p.soundEnabled}static toggleFullSound(){p.soundEnabled||p.musicEnabled?(p.soundEnabled=!1,p.musicEnabled=!1):(p.musicEnabled=!0,p.soundEnabled=!0)}static init(){f=s.A.settings.getItem("soundsVol",s.A.projectDesc.defaultSoundsVol),g=s.A.settings.getItem("musicVol",s.A.projectDesc.defaultMusVol)}static play(t,e=1,i=1,r=0,n=!1){if(!(p.isSoundsLockedByBrowser||!s.A.isVisible)){var a=o.A.getSound(t);if(a){if(a.lastPlayStartFrame.01))try{n?(a.soundIdSaved=a.play(),a.volume(e,a.soundIdSaved),a.rate(i,a.soundIdSaved),0!==r&&a.seek(r,a.soundIdSaved)):(a.volume(e),a.rate(i),0!==r&&a.seek(r),a.soundIdSaved=a.play(a.soundIdSaved)),a.lastPlayStartFrame=s.A.time+2}catch(l){}}else{var l=new Error('Attempt to play unknown sound "'+t+'"');setTimeout((()=>{throw l}))}}}static playPitched(t,e=200,i=1.0594630943592953,r=3){var n,a=v[t],o=s.A.time-a;o<2||(n=om(!0),e=()=>m(!1);(r=new Howl({src:"data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU2LjM2LjEwMAAAAAAAAAAAAAAA//OEAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAEAAABIADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV6urq6urq6urq6urq6urq6urq6urq6urq6v////////////////////////////////8AAAAATGF2YzU2LjQxAAAAAAAAAAAAAAAAJAAAAAAAAAAAASDs90hvAAAAAAAAAAAAAAAAAAAA//MUZAAAAAGkAAAAAAAAA0gAAAAATEFN//MUZAMAAAGkAAAAAAAAA0gAAAAARTMu//MUZAYAAAGkAAAAAAAAA0gAAAAAOTku//MUZAkAAAGkAAAAAAAAA0gAAAAANVVV"})).once("playerror",t),r.once("end",e),n=setTimeout(t,500);try{r.play()}catch(i){m(!0)}}static _unlockSound(){p.isSoundsLockedByBrowser&&m(!1)}}var d,f,g,m=t=>{a||(s.A.additionalLoadingsInProgress--,a=!0,clearTimeout(n)),t||(r.off("playerror"),r.off("play"),r.unload(),p.isSoundsLockedByBrowser=!1,s.A.classes.BgMusic&&s.A.classes.BgMusic._recalculateMusic())},A={},v={};function y(){d=null,(p.soundEnabled||p.musicEnabled)&&(s.A.settings.setItem("soundEnabled",p.soundEnabled),s.A.settings.setItem("musicEnabled",p.musicEnabled))}},4319:(t,e,i)=>{"use strict";i.d(e,{CR:()=>r,Go:()=>n,kT:()=>a});i(9443),Math.PI;var r=(t,e,i)=>Math.abs(t-e)<=i?e:t>e?t-i:t+i;function n(t){return JSON.parse(JSON.stringify(t))}async function a(){var t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return await Promise.all(Object.entries(t).map((([t,e])=>new Promise((i=>{var r=new Image;r.onload=()=>i([t,r.width>0&&r.height>0]),r.onerror=()=>i([t,!1]),r.src=`data:image/webp;base64,${e}`}))))).then((t=>t.reduce(((t,[e,i])=>(t[e]=i,t)),{})))}},3800:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});const r={START_LOADING:"start_loading",GAME_RESOURCES_LOADED:"game_resources_loaded",GAME_LOADED:"game_loaded",GAME_INITIALIZED:"game_initialized",ACTION_EXEC:"action_exec",BET_CHANGED:"bet_changed",FINISH_SPIN_ANIMATIONS:"finish_spin_animations",FINISH_ROUND_ANIMATIONS:"finish_round_animations",API_RESPONSE:"api_response",BALANCE_UPDATE:"balance_update",BUTTON_CLICK:"button-click",DIALOG_BUTTON_CLICK:"dialog_button_click",PRE_PLAY:"pre_play",PLAY:"play",AUTOSPINS_STARTED:"autospins_started",AUTOSPINS_STOPPED:"autospins_stopped",GO_HOME:"go_home",SET_SKIN:"set_skin",ERROR:"game_error",SET_LINES_COUNT:"set_lines_count",SET_VOLATILITY:"set_volatility",SHOW_MODAL:"show_modal",CUSTOM_EVENT:"custom_event",GAME_UI_BET_PANEL_OPENED:"game_ui_bet_panel_opened",GAME_UI_BET_PANEL_CLOSED:"game_ui_bet_panel_closed",GAME_UI_SETTINGS_OPENED:"game_ui_settings_opened",GAME_UI_SETTINGS_CLOSED:"game_ui_settings_closed",GAME_UI_RULES_OPENED:"game_ui_rules_opened",GAME_UI_RULES_CLOSED:"game_ui_rules_closed",GAME_UI_PAYTABLE_OPENED:"game_ui_paytable_opened",GAME_UI_PAYTABLE_CLOSED:"game_ui_paytable_closed",GAME_UI_AUTOSPINS_PANEL_OPENED:"game_ui_autospins_panel_opened",GAME_UI_AUTOSPINS_PANEL_CLOSED:"game_ui_autospins_panel_closed",GAME_UI_QUICK_SPIN_OFFER_OPENED:"game_ui_quick_spin_offer_opened",GAME_UI_QUICK_SPIN_OFFER_CLOSED:"game_ui_quick_spin_offer_closed"}},4581:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var r=i(4051),n=i(2468),a=i(874),s=i(9443);class o extends r.A{init(){super.init(),this.showedVal2=void 0,this.countOnStart&&(this.showedVal=0),this.template&&(this.template=this.template.replace("\\n","\n")),this.savedTemplate=null,s.A.data&&this.refreshDecimalsCount(),this.applyMaxWidth()}refreshDecimalsCount(){var t;"number"==typeof(t=this.decimalsCountPath?(0,n.A)(this.decimalsCountPath,this):s.A.data.currencyDigits)&&(this.decimalsCount=t)}update(){if(this.refreshDecimalsCount(),this.dataPath2&&this.currentInterval===this.refreshInterval){var t=(0,n.A)(this.dataPath2,this);void 0!==t&&t!==this.showedVal2&&(this.showedVal2=t,this.setSymbol(t))}super.update()}refreshNow(){this.showedVal=void 0,super.refreshNow()}customizeVal(t){return t?t/s.A.data.currencyDivider:t}setSymbol(t){this.translatableText?this.template=(0,a.A)(this.translatableText):this.savedTemplate?this.template=this.savedTemplate:this.savedTemplate=this.template,this.template=this.template.replace("%s",t),this.symbol=t,this.currentInterval=0,this.showedVal=void 0}onLanguageChanged(){this.symbol&&this.translatableText&&this.setSymbol(this.symbol),super.onLanguageChanged()}_onRenderResize(){this.applyMaxWidth()}applyMaxWidth(){var t=s.A.isPortrait?this.maxWidthPortrait:this.maxWidthLandscape;t>0&&(this.maxWidth=t)}static initMoneyFormatter(t){"object"==typeof Intl&&(r.A.formatMoney=(e,i)=>{var r=l[i];return r||(r=Intl.NumberFormat(t.substr(0,2),{maximumFractionDigits:i,minimumFractionDigits:i}).format,l[i]=r),r(e)})}}var l={}},4381:(t,e,i)=>{"use strict";i.d(e,{A:()=>g});var r=i(9401),n=i(7781),a=i(9443),s=i(9135),o=i(3800),l=i(4049);window.trackGameEventListeners||(window.trackGameEventListeners=[]);var h={QUICK_SPIN_SETTINGS:"quick_spin_default",QUICK_SPINS_POPUP_OFFER:"quick_spins_popup_offer",SOUND_VALUE:"sound_value"},u=[{name:h.QUICK_SPIN_SETTINGS,handler:t=>{var e;if(void 0!==(null===(e=a.A.casinoOptions)||void 0===e||null===(e=e.license_rules)||void 0===e?void 0:e.min_spin_time))return!1;var i=a.A.settings.getItem("quickSpin",!1),r=a.A.settings.getItem("growthbook_quickSpin");return void 0===r&&(r=t.value,a.A.settings.setItem("growthbook_quickSpin",r)),i!==r&&(a.A.data.quickSpin=r,a.A.settings.setItem("quickSpin",a.A.data.quickSpin)),window.trackGameEventListeners.push(((t,e,i)=>{"settings-change"===t&&"quickSpin"===e&&a.A.settings.setItem("growthbook_quickSpin",i)})),!0}},{name:h.SOUND_VALUE,handler:t=>{if(a.A.settings.getItem("gb_sound_value_applied"))return!0;var e=.01*t.value;return l.A.soundEnabled=l.A.musicEnabled=!!e,0!==e&&(l.A.fullVol=e),a.A.settings.setItem("gb_sound_value_applied",!0),!0}}],c=[],p={game_loaded:!0,game_initialized:!0,render_resize:!0},d=(t,e,i)=>{if(t===o.A.GAME_LOADED&&y(),p[t]&&(i={width:a.A.W,height:a.A.H,isPortrait:a.A.isPortrait,isMobile:a.A.isMobile.any,isGambleAvailable:a.A.projectDesc.libs.indexOf("thing-games-utils/gamble")>0||s.A.hasScene("gamble"),isProvabilityAvailable:s.A.hasPrefab("thing-games-utils/provability-panel"),isBuyFeaturesAvailable:a.A.data.initData&&a.A.data.initData.options&&a.A.data.initData.options.feature_options&&a.A.data.initData.options.feature_options.feature_multipliers,ignoreOrientationEvents:!1}),window.trackGameEventListeners&&window.trackGameEventListeners.length)for(var r=window.trackGameEventListeners.length;r--;)window.trackGameEventListeners[r]&&window.trackGameEventListeners[r](t,e,i);try{c.forEach((r=>r(t,e,i)))}catch(n){}},f={addListener:t=>{c.push(t)},track:d,trackCustom:(t,e,i,r)=>{d(o.A.CUSTOM_EVENT,null,{action:t,label:e,value:i,isNonInteraction:r})}};const g=f;var m={cap:!0,"space to skip button":!0,"debug-button":!0};r.A.globalOnClick=(t,e)=>{for(var i,r=t;r;){if(r.name){i=r.name;break}r=r.parent}m.hasOwnProperty(i)||d("button-click",i,e)};var A=["latestSpinResultV2","__allSymbolsIds","latestSpinResultTimeV2","last-spins-indexes","growthbook_"],v={},y=()=>{v={},n.A.globalOnChanged=(t,e)=>{A.every((e=>-1===t.indexOf(e)))&&("object"==typeof t&&null!==t||(void 0===e&&(e="undefined"),v[t]=e))},d("initial-settings",null,a.A.settings.data)};setInterval((()=>{if(a.A.mouse&&!a.A.mouse.click)for(var t of Object.keys(v))d("settings-change",t,v[t]),delete v[t]}),200),a.A.onGameReload=()=>{d("game_reloading")},f.addListener((t=>{t===o.A.SET_SKIN&&d("game_reloading")}));var _=!1;function b({detail:t}){"initialized"===t.type&&console.log("[thing-games-utils] Analytics available in window.analytics",window.analytics),console.log("[thing-games-utils] Received message from analytics: ",t)}function x(t){window.dispatchEvent(new CustomEvent("experiment/incoming",{detail:{type:"addFeature",payload:{name:t.name,handler:t.handler}}}))}window.dispatchEvent(new CustomEvent("analytics/incoming",{detail:{type:"start",payload:{isEditor:_}}})),window.addEventListener("analytics/outgoing",b),window.addEventListener("experiment/outgoing",(({detail:t})=>{if("ready"===t.type)for(var e of(console.log("[Utils Analytics] ExperimentManager Ready!",t),u))console.log("[Utils Analytics] Add Feature",e),x(e)}))},4418:(t,e,i)=>{"use strict";i.d(e,{A:()=>c});var r=i(9443),n=i(874),a=i(4319),s=i(230);class o{initGame(){this.initReplayData(),this.isReplayMode()&&(r.A.all["spin-button"].hotkey=0,this.speed||(this.speed=1),this.started=!1,this.replayData&&(this.initView(),r.A.settings.clear()),this.clickToContinueDelay=0,this.refreshView())}isReplayMode(){return Boolean(this.replayData)}getNextResponse(){return this.replayData.shift()}beforeGameInit(){this.replayData&&(s.projectDesc.id="replay-mode")}initView(){if(!this.viewInitialized){setInterval(this.update.bind(this),1e3/60*10),this.viewInitialized=!0;var t=document.createElement("div");t.id="replay-panel",r.A.pixiApp.view.parentElement.appendChild(t);var e=document.createElement("button");e.addEventListener("pointerdown",(()=>{this.setSpeed(1)})),e.innerText="×1",t.appendChild(e),this.x1btn=e;var i=document.createElement("button");i.addEventListener("pointerdown",(()=>{this.setSpeed(2)})),i.innerText="×2",t.appendChild(i),this.x2btn=i;var a=document.createElement("button");a.addEventListener("pointerdown",(()=>{this.setSpeed(4)})),a.innerText="×4",t.appendChild(a),this.x4btn=a,t.appendChild(document.createTextNode((0,n.A)("replay")));var s=document.createElement("button");s.addEventListener("pointerdown",(()=>{this.paused=!0,r.A.pixiApp.ticker.speed=0,r.A.SharedAPI.restartGame()})),s.innerText="⏮",t.appendChild(s),this.restartButton=s;var o=document.createElement("button");o.addEventListener("pointerdown",(()=>{this.started?(this.paused=!this.paused,r.A.pixiApp.ticker.speed=this.paused?0:this.speed,this.refreshView()):this.clickSpin()})),t.appendChild(o),this.playBtn=o;var l=document.createElement("div");l.id="pause-message",t.appendChild(l),l.innerText="P A U S E",this.pauseMessage=l;var h=document.createElement("button");h.style.position="absolute",h.style.right="10px",h.addEventListener("pointerdown",(()=>{this.clickSpin()})),h.innerText="Help",t.appendChild(h),this.helpMessage=h,this.refreshView()}}clickSpin(){var t=r.A.all["spin-button"];t&&t.isCanBePressed&&(t.callClick(),this.started=!0,this.refreshView())}skipClickToContinuePopups(){var t=!1;r.A.currentContainer&&r.A.currentContainer.forAllChildren((e=>{e instanceof r.A.classes.Text&&(e.worldVisible&&e.worldAlpha||this.clickToContinueDelay>0)&&e.translatableText&&(e.translatableText.includes("tap_to_continue")||e.translatableText.includes("click_to_continue")||e.translatableText.includes("push_to_continue")||e.translatableText.includes("tap_to_start")||e.translatableText.includes("push_to_start")||e.translatableText.includes("click_to_start")||e.translatableText.includes("tap_to_spin")||e.translatableText.includes("push_to_spin")||e.translatableText.includes("click_to_spin")||e.translatableText.includes("tap_to_play")||e.translatableText.includes("push_to_play")||e.translatableText.includes("click_to_play"))&&(this.clickToContinueDelay++,12===this.clickToContinueDelay&&this.clickSpin(),t=!0)})),t||(this.clickToContinueDelay=0)}chooseFeature(){if(this.replayData.length&&r.A.currentContainer){var t=l(this.replayData[0]);if(t){var e=r.A.currentContainer.findChildByName("choose-btn-"+t);e&&this.clickButton(e)}}}gamblePlay(){if(this.replayData.length&&r.A.currentContainer){var t=h(this.replayData[0]);if(t){var e=r.A.currentContainer.findChildByName("gamble-btn");if(e&&e.isCanBePressed)return this.clickButton(e),!0;e=null;var i="currentScene.playGamble`"+t;r.A.currentContainer.forAllChildren((t=>{t instanceof r.A.classes.Button&&t.onClick===i&&(e=t)})),e&&this.clickButton(e)}}}update(){this.paused||(this.buttonClickWaits?this.processClickWaitingButton():(this.skipClickToContinuePopups(),this.chooseFeature()||this.gamblePlay()))}clickButton(t){this.buttonClickWaits=t,this.clickButtonDelay=0}processClickWaitingButton(){if(this.buttonClickWaits)return this.buttonClickWaits.isCanBePressed&&(this.clickButtonDelay++,6===this.clickButtonDelay&&this.buttonClickWaits.onOver(),12===this.clickButtonDelay&&(this.buttonClickWaits.callClick(),this.buttonClickWaits=null)),!0}setSpeed(t){this.speed=t,r.A.pixiApp.ticker.speed=t,this.refreshView()}refreshView(){this.playBtn.innerText=!this.started||this.paused?"⏵":"⏸",this.pauseMessage.style.display=!this.started||this.paused?"block":"none",this.started?this.playBtn.classList.remove("highlight"):this.playBtn.classList.add("highlight"),this.restartButton.disabled=!this.started,this.x1btn.disabled=1===this.speed,this.x2btn.disabled=2===this.speed,this.x4btn.disabled=4===this.speed}initStyles(){this.initReplayData(),this.replayData&&r.A.applyCSS("\ncanvas {\n\tpointer-events: none;\n\tborder: #ffcc29 3px solid;\n\tbox-sizing: border-box;\n\tborder-top-width: 45px;\n}\n\n#replay-panel {\n\theight: 45px;\n z-index: 100;\n position: absolute;\n top: 0;\n font-family: 'Arial';\n color: #000000;\n display: flex;\n\twidth: 100%;\n align-items: baseline;\n justify-content: center;\n\tfont-size: 20px;\n\tfont-weight: 700;\n}\n\n#replay-panel button {\n\tcursor: pointer;\n padding: 6px 13px;\n background: #ff8f00;\n margin: 5px;\n border-radius: 5px;\n font-size: 17px;\n\tfont-weight: 700;\n}\n\n#replay-panel button:hover {\n\toutline: 1px solid #774400;\n\toutline-offset: 2px;\n}\n\n#replay-panel button:disabled {\n\tpointer-events: none;\n\tcursor: unset;\n\topacity: 0.5;\n}\n\n.highlight {\n\tanimation: highlight 1s ease 0s infinite normal forwards;\n\toutline-offset: 2px;\n\toutline: 3px solid #ff0000;\n}\n\n#pause-message {\n\tanimation: flash 1s ease 0s infinite normal forwards;\n position: absolute;\n\tfont-family: 'Arial';\n color: #ffffff;\n\ttop: 43vh;\n font-size: 400%;\n text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;\n}\n\n@keyframes highlight {\n\t0%,\n\t100% {\n\t\toutline-color: #ff0000;\n\t}\n\t50% {\n\t\toutline-color: #ffcc29;\n\t}\n}\n\n@keyframes flash {\n\t0%,\n\t100% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n}\n\n")}initReplayData(){this.replayData=(0,a.Go)(window.__OPTIONS__.replay||null),this.replayData&&this.replayData.some((t=>{if(t&&t.outcome&&t.outcome.bet){var e=t.outcome.bet,i=this.replayData[0].options;return i.currency||(i.currency={code:"FUN",symbol:"FUN",subunits:100,exponent:2}),i.default_bet=e,i.available_bets.indexOf(e)<0&&(i.available_bets.push(e),i.available_bets.sort(((t,e)=>t-e))),!0}}))}}function l(t){if(t.features)return t.features.freespins_type}function h(t){if(t.gamble)return t.gamble.value[1]}var u=new o;u.initStyles();const c=u},6113:(t,e,i)=>{"use strict";i.d(e,{T:()=>a});var r=i(4381),n=window.Sentry,a=void 0;a&&(n.init({environment:window.__OPTIONS__.environment,dsn:void 0,release:"Plinko (game: v0.0.41_v14.13.3, utils: v14.13.3)",ignoreErrors:[],beforeBreadcrumb:t=>"ui.click"===t.category?null:t,tracesSampleRate:.1,attachStacktrace:!0,denyUrls:[/moz-extension:/,/chrome-extension:/,/edge-extension:/]}),window.user_id&&n.setUser({id:window.user_id}),r.A.addListener(((t,e,i)=>{n.addBreadcrumb({type:"info",category:"game.event",message:t,data:{eventName:t,targetName:e,source:JSON.stringify(i)},level:n.Severity.Info})})))},808:(t,e)=>{"use strict";function i(){return"undefined"==typeof Intl||!("getCanonicalLocales"in Intl)||"x-private"===Intl.getCanonicalLocales("und-x-private")[0]}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldPolyfill=void 0,e.shouldPolyfill=i},1707:(t,e)=>{"use strict";function i(){try{return"x-private"===new Intl.Locale("und-x-private").toString()}catch(t){return!0}}function r(){return!("Locale"in Intl)||i()}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldPolyfill=void 0,e.shouldPolyfill=r},1626:(t,e,i)=>{"use strict";function r(t,e){for(var i=e;;){if(t.has(i))return i;var r=i.lastIndexOf("-");if(!~r)return;r>=2&&"-"===i[r-2]&&(r-=2),i=i.slice(0,r)}}i.d(e,{q:()=>r})},234:(t,e,i)=>{"use strict";i.d(e,{s:()=>a});var r=i(9400),n=i(1626);function a(t,e){for(var i=[],a=0,s=e;a{"use strict";i.d(e,{B:()=>l});var r=i(9400),n=i(1626);function a(t,e,i){for(var a={locale:""},s=0,o=e;s2){var T=c.indexOf("-x-");if(-1===T)c+=d;else{var E=c.slice(0,T),S=c.slice(T,c.length);c=E+d+S}c=Intl.getCanonicalLocales(c)[0]}return p.locale=c,p}},9400:(t,e,i)=>{"use strict";i.d(e,{K:()=>r,V:()=>n});var r=/-u(?:-[0-9a-z]{2,8})+/gi;function n(t,e,i){if(void 0===i&&(i=Error),!t)throw new i(e)}},7343:(t,e,i)=>{"use strict";function r(t){return Intl.getCanonicalLocales(t)}i.r(e),i.d(e,{LookupSupportedLocales:()=>a.s,ResolveLocale:()=>n.B,match:()=>s});var n=i(722),a=i(234);function s(t,e,i,a){var s=e.reduce((function(t,e){return t.add(e),t}),new Set);return(0,n.B)(s,r(t),{localeMatcher:(null==a?void 0:a.algorithm)||"best fit"},[],{},(function(){return i})).locale}},1232:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shouldPolyfill=void 0;var r=i(7343),n=i(6673);function a(t){if(!t)return!0;var e=Array.isArray(t)?t:[t];return Intl.PluralRules.supportedLocalesOf(e).length===e.length}function s(t){if(void 0===t&&(t="en"),!("PluralRules"in Intl)||"one"===new Intl.PluralRules("en",{minimumFractionDigits:2}).select(1)||!a(t))return t?(0,r.match)([t],n.supportedLocales,"en"):void 0}e.shouldPolyfill=s},6673:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.supportedLocales=void 0,e.supportedLocales=["af","ak","am","an","ar","ars","as","asa","ast","az","bal","be","bem","bez","bg","bho","bm","bn","bo","br","brx","bs","ca","ce","ceb","cgg","chr","ckb","cs","cy","da","de","doi","dsb","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fil","fo","fr","fur","fy","ga","gd","gl","gsw","gu","guw","gv","ha","haw","he","hi","hnj","hr","hsb","hu","hy","ia","id","ig","ii","io","is","it","iu","ja","jbo","jgo","jmc","jv","jw","ka","kab","kaj","kcg","kde","kea","kk","kkj","kl","km","kn","ko","ks","ksb","ksh","ku","kw","ky","lag","lb","lg","lij","lkt","ln","lo","lt","lv","mas","mg","mgo","mk","ml","mn","mo","mr","ms","mt","my","nah","naq","nb","nd","ne","nl","nn","nnh","no","nqo","nr","nso","ny","nyn","om","or","os","osa","pa","pap","pcm","pl","prg","ps","pt-PT","pt","rm","ro","rof","ru","rwk","sah","saq","sat","sc","scn","sd","sdh","se","seh","ses","sg","sh","shi","si","sk","sl","sma","smi","smj","smn","sms","sn","so","sq","sr","ss","ssy","st","su","sv","sw","syr","ta","te","teo","th","ti","tig","tk","tl","tn","to","tpi","tr","ts","tzm","ug","uk","und","ur","uz","ve","vi","vo","vun","wa","wae","wo","xh","xog","yi","yo","yue","zh","zu"]},6317:(t,e,i)=>{"use strict";var r=i(6535),n=i(9829),a=n(r("String.prototype.indexOf"));t.exports=function(t,e){var i=r(t,!!e);return"function"==typeof i&&a(t,".prototype.")>-1?n(i):i}},9829:(t,e,i)=>{"use strict";var r=i(9477),n=i(6535),a=i(1451),s=i(9525),o=n("%Function.prototype.apply%"),l=n("%Function.prototype.call%"),h=n("%Reflect.apply%",!0)||r.call(l,o),u=i(4749),c=n("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=h(r,l,arguments);return a(e,1+c(0,t.length-(arguments.length-1)),!0)};var p=function(){return h(r,o,arguments)};u?u(t.exports,"apply",{value:p}):t.exports.apply=p},7675:(t,e,i)=>{"use strict";var r=i(4749),n=i(1902),a=i(9525),s=i(9857);t.exports=function(t,e,i){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],c=!!s&&s(t,e);if(r)r(t,e,{configurable:null===h&&c?c.configurable:!h,enumerable:null===o&&c?c.enumerable:!o,value:i,writable:null===l&&c?c.writable:!l});else{if(!u&&(o||l||h))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=i}}},2840:t=>{"use strict";function e(t,e,r){r=r||2;var a,s,o,l,u,c,p,d=e&&e.length,f=d?e[0]*r:t.length,g=i(t,0,f,r,!0),m=[];if(!g||g.next===g.prev)return m;if(d&&(g=h(t,e,g,r)),t.length>80*r){a=o=t[0],s=l=t[1];for(var A=r;Ao&&(o=u),c>l&&(l=c);p=0!==(p=Math.max(o-a,l-s))?32767/p:0}return n(g,m,r,a,s,p,0),m}function i(t,e,i,r,n){var a,s;if(n===M(t,e,i,r)>0)for(a=e;a=e;a-=r)s=R(a,t[a],t[a+1],s);return s&&b(s,s.next)&&(C(s),s=s.next),s}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!b(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function n(t,e,i,h,u,c,p){if(t){!p&&c&&f(t,h,u,c);for(var d,g,m=t;t.prev!==t.next;)if(d=t.prev,g=t.next,c?s(t,h,u,c):a(t))e.push(d.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),C(t),t=g.next,m=g.next;else if((t=g)===m){p?1===p?n(t=o(r(t),e,i),e,i,h,u,c,2):2===p&&l(t,e,i,h,u,c):n(r(t),e,i,h,u,c,1);break}}}function a(t){var e=t.prev,i=t,r=t.next;if(_(e,i,r)>=0)return!1;for(var n=e.x,a=i.x,s=r.x,o=e.y,l=i.y,h=r.y,u=na?n>s?n:s:a>s?a:s,d=o>l?o>h?o:h:l>h?l:h,f=r.next;f!==e;){if(f.x>=u&&f.x<=p&&f.y>=c&&f.y<=d&&v(n,o,a,l,s,h,f.x,f.y)&&_(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function s(t,e,i,r){var n=t.prev,a=t,s=t.next;if(_(n,a,s)>=0)return!1;for(var o=n.x,l=a.x,h=s.x,u=n.y,c=a.y,p=s.y,d=ol?o>h?o:h:l>h?l:h,A=u>c?u>p?u:p:c>p?c:p,y=m(d,f,e,i,r),b=m(g,A,e,i,r),x=t.prevZ,T=t.nextZ;x&&x.z>=y&&T&&T.z<=b;){if(x.x>=d&&x.x<=g&&x.y>=f&&x.y<=A&&x!==n&&x!==s&&v(o,u,l,c,h,p,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,T.x>=d&&T.x<=g&&T.y>=f&&T.y<=A&&T!==n&&T!==s&&v(o,u,l,c,h,p,T.x,T.y)&&_(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;x&&x.z>=y;){if(x.x>=d&&x.x<=g&&x.y>=f&&x.y<=A&&x!==n&&x!==s&&v(o,u,l,c,h,p,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;T&&T.z<=b;){if(T.x>=d&&T.x<=g&&T.y>=f&&T.y<=A&&T!==n&&T!==s&&v(o,u,l,c,h,p,T.x,T.y)&&_(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function o(t,e,i){var n=t;do{var a=n.prev,s=n.next.next;!b(a,s)&&x(a,n,n.next,s)&&w(a,s)&&w(s,a)&&(e.push(a.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),C(n),C(n.next),n=t=s),n=n.next}while(n!==t);return r(n)}function l(t,e,i,a,s,o){var l=t;do{for(var h=l.next.next;h!==l.prev;){if(l.i!==h.i&&y(l,h)){var u=I(l,h);return l=r(l,l.next),u=r(u,u.next),n(l,e,i,a,s,o,0),void n(u,e,i,a,s,o,0)}h=h.next}l=l.next}while(l!==t)}function h(t,e,r,n){var a,s,o,l=[];for(a=0,s=e.length;a=r.next.y&&r.next.y!==r.y){var o=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=n&&o>s&&(s=o,i=r.x=r.x&&r.x>=u&&n!==r.x&&v(ai.x||r.x===i.x&&d(i,r)))&&(i=r,p=l)),r=r.next}while(r!==h);return i}function d(t,e){return _(t.prev,t,e.prev)<0&&_(e.next,t,t.next)<0}function f(t,e,i,r){var n=t;do{0===n.z&&(n.z=m(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,g(n)}function g(t){var e,i,r,n,a,s,o,l,h=1;do{for(i=t,t=null,a=null,s=0;i;){for(s++,r=i,o=0,e=0;e0||l>0&&r;)0!==o&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,o--):(n=r,r=r.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=r}a.nextZ=null,h*=2}while(s>1);return t}function m(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function A(t){var e=t,i=t;do{(e.x=(t-s)*(a-o)&&(t-s)*(r-o)>=(i-s)*(e-o)&&(i-s)*(a-o)>=(n-s)*(r-o)}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!S(t,e)&&(w(t,e)&&w(e,t)&&P(t,e)&&(_(t.prev,t,e.prev)||_(t,e.prev,e))||b(t,e)&&_(t.prev,t,t.next)>0&&_(e.prev,e,e.next)>0)}function _(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,r){var n=E(_(t,e,i)),a=E(_(t,e,r)),s=E(_(i,r,t)),o=E(_(i,r,e));return n!==a&&s!==o||(!(0!==n||!T(t,i,e))||(!(0!==a||!T(t,r,e))||(!(0!==s||!T(i,t,r))||!(0!==o||!T(i,e,r)))))}function T(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function E(t){return t>0?1:t<0?-1:0}function S(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function w(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function P(t,e){var i=t,r=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}function I(t,e){var i=new O(t.i,t.x,t.y),r=new O(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function R(t,e,i,r){var n=new O(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(t,e,i,r){for(var n=0,a=e,s=i-r;a0&&(r+=t[n-1].length,i.holes.push(r))}return i}},4749:(t,e,i)=>{"use strict";var r=i(6535)("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(n){r=!1}t.exports=r},6235:t=>{"use strict";t.exports=EvalError},209:t=>{"use strict";t.exports=Error},2460:t=>{"use strict";t.exports=RangeError},7080:t=>{"use strict";t.exports=ReferenceError},1902:t=>{"use strict";t.exports=SyntaxError},9525:t=>{"use strict";t.exports=TypeError},3451:t=>{"use strict";t.exports=URIError},9846:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,r,a,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new n(r,a||t,s),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,s=new Array(a);n{function e(t,e){var i=e&&e.cache?e.cache:c,r=e&&e.serializer?e.serializer:h;return(e&&e.strategy?e.strategy:s)(t,{cache:i,serializer:r})}function i(t){return null==t||"number"==typeof t||"boolean"==typeof t}function r(t,e,r,n){var a=i(n)?n:r(n),s=e.get(a);return void 0===s&&(s=t.call(this,n),e.set(a,s)),s}function n(t,e,i){var r=Array.prototype.slice.call(arguments,3),n=i(r),a=e.get(n);return void 0===a&&(a=t.apply(this,r),e.set(n,a)),a}function a(t,e,i,r,n){return i.bind(e,t,r,n)}function s(t,e){return a(t,this,1===t.length?r:n,e.cache.create(),e.serializer)}function o(t,e){return a(t,this,n,e.cache.create(),e.serializer)}function l(t,e){return a(t,this,r,e.cache.create(),e.serializer)}function h(){return JSON.stringify(arguments)}function u(){this.cache=Object.create(null)}u.prototype.has=function(t){return t in this.cache},u.prototype.get=function(t){return this.cache[t]},u.prototype.set=function(t,e){this.cache[t]=e};var c={create:function(){return new u}};t.exports=e,t.exports.strategies={variadic:o,monadic:l}},7787:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,r=Math.max,n="[object Function]",a=function(t,e){for(var i=[],r=0;r{"use strict";var r=i(7787);t.exports=Function.prototype.bind||r},6535:(t,e,i)=>{"use strict";var r,n=i(209),a=i(6235),s=i(2460),o=i(7080),l=i(1902),h=i(9525),u=i(3451),c=Function,p=function(t){try{return c('"use strict"; return ('+t+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(k){d=null}var f=function(){throw new h},g=d?function(){try{return f}catch(t){try{return d(arguments,"callee").get}catch(e){return f}}}():f,m=i(6445)(),A=i(6274)(),v=Object.getPrototypeOf||(A?function(t){return t.__proto__}:null),y={},_="undefined"!=typeof Uint8Array&&v?v(Uint8Array):r,b={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":m&&v?v([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":a,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&v?v(v([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&m&&v?v((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":o,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&m&&v?v((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&v?v(""[Symbol.iterator]()):r,"%Symbol%":m?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":g,"%TypedArray%":_,"%TypeError%":h,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(v)try{null.error}catch(k){var x=v(v(k));b["%Error.prototype%"]=x}var T=function t(e){var i;if("%AsyncFunction%"===e)i=p("async function () {}");else if("%GeneratorFunction%"===e)i=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=p("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(i=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&v&&(i=v(n.prototype))}return b[e]=i,i},E={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},S=i(9477),w=i(2931),P=S.call(Function.call,Array.prototype.concat),I=S.call(Function.apply,Array.prototype.splice),R=S.call(Function.call,String.prototype.replace),C=S.call(Function.call,String.prototype.slice),O=S.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,B=/\\(\\)?/g,D=function(t){var e=C(t,0,1),i=C(t,-1);if("%"===e&&"%"!==i)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var r=[];return R(t,M,(function(t,e,i,n){r[r.length]=i?R(n,B,"$1"):e||t})),r},L=function(t,e){var i,r=t;if(w(E,r)&&(r="%"+(i=E[r])[0]+"%"),w(b,r)){var n=b[r];if(n===y&&(n=T(r)),void 0===n&&!e)throw new h("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:n}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new h('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=D(t),r=i.length>0?i[0]:"",n=L("%"+r+"%",e),a=n.name,s=n.value,o=!1,u=n.alias;u&&(r=u[0],I(i,P([0,1],u)));for(var c=1,p=!0;c=i.length){var A=d(s,f);s=(p=!!A)&&"get"in A&&!("originalValue"in A.get)?A.get:s[f]}else p=w(s,f),s=s[f];p&&!o&&(b[a]=s)}}return s}},9857:(t,e,i)=>{"use strict";var r=i(6535)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(n){r=null}t.exports=r},7214:(t,e,i)=>{"use strict";var r=i(4749),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},t.exports=n},6274:t=>{"use strict";var e={__proto__:null,foo:{}},i=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof i)}},6445:(t,e,i)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=i(9071);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},9071:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;var r=42;for(e in t[e]=r,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==r||!0!==a.enumerable)return!1}return!0}},2931:(t,e,i)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,a=i(9477);t.exports=a.call(r,n)},2449:(t,e,i)=>{var{webm:r,mp4:n}=i(3621),a=()=>"undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,s=()=>"wakeLock"in navigator;class o{constructor(){if(this.enabled=!1,s()){this._wakeLock=null;var t=()=>{null!==this._wakeLock&&"visible"===document.visibilityState&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",n),this.noSleepVideo.addEventListener("loadedmetadata",(()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",(()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}))})))}_addSourceToVideo(t,e,i){var r=document.createElement("source");r.src=i,r.type=`video/${e}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return s()?navigator.wakeLock.request("screen").then((t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",(()=>{console.log("Wake Lock released.")}))})).catch((t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t})):a()?(this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval((()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))}),15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then((t=>(this.enabled=!0,t))).catch((t=>{throw this.enabled=!1,t}))}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}t.exports=o},3621:t=>{t.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}},9726:t=>{"use strict";var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function a(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}t.exports=a()?Object.assign:function(t,a){for(var s,o,l=n(t),h=1;h{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=r&&n&&"function"==typeof n.get?n.get:null,s=r&&Map.prototype.forEach,o="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,h=o&&l&&"function"==typeof l.get?l.get:null,u=o&&Set.prototype.forEach,c="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,g=Object.prototype.toString,m=Function.prototype.toString,A=String.prototype.match,v=String.prototype.slice,y=String.prototype.replace,_=String.prototype.toUpperCase,b=String.prototype.toLowerCase,x=RegExp.prototype.test,T=Array.prototype.concat,E=Array.prototype.join,S=Array.prototype.slice,w=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,O="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===C||"symbol")?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,B=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-w(-t):w(t);if(r!==t){var n=String(r),a=v.call(e,n.length+1);return y.call(n,i,"$&_")+"."+y.call(y.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(e,i,"$&_")}var L=i(2290),k=L.custom,N=z(k)?k:null;function F(t,e,i){var r="double"===(i.quoteStyle||e)?'"':"'";return r+t+r}function G(t){return y.call(String(t),/"/g,""")}function U(t){return!("[object Array]"!==K(t)||O&&"object"==typeof t&&O in t)}function H(t){return!("[object Date]"!==K(t)||O&&"object"==typeof t&&O in t)}function X(t){return!("[object RegExp]"!==K(t)||O&&"object"==typeof t&&O in t)}function j(t){return!("[object Error]"!==K(t)||O&&"object"==typeof t&&O in t)}function W(t){return!("[object String]"!==K(t)||O&&"object"==typeof t&&O in t)}function V(t){return!("[object Number]"!==K(t)||O&&"object"==typeof t&&O in t)}function Y(t){return!("[object Boolean]"!==K(t)||O&&"object"==typeof t&&O in t)}function z(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(e){}return!1}function q(t){if(!t||"object"!=typeof t||!P)return!1;try{return P.call(t),!0}catch(e){}return!1}t.exports=function t(e,r,n,o){var l=r||{};if(Z(l,"quoteStyle")&&"single"!==l.quoteStyle&&"double"!==l.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Z(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!Z(l,"customInspect")||l.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Z(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Z(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=l.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return st(e,l);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var d=String(e);return p?D(e,d):d}if("bigint"==typeof e){var g=String(e)+"n";return p?D(e,g):g}var m=void 0===l.depth?5:l.depth;if(void 0===n&&(n=0),n>=m&&m>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var A=pt(l,n);if(void 0===o)o=[];else if($(o,e)>=0)return"[Circular]";function _(e,i,r){if(i&&(o=S.call(o)).push(i),r){var a={depth:l.depth};return Z(l,"quoteStyle")&&(a.quoteStyle=l.quoteStyle),t(e,a,n+1,o)}return t(e,l,n+1,o)}if("function"==typeof e&&!X(e)){var x=J(e),w=ft(e,_);return"[Function"+(x?": "+x:" (anonymous)")+"]"+(w.length>0?" { "+E.call(w,", ")+" }":"")}if(z(e)){var I=C?y.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?I:lt(I)}if(at(e)){for(var k="<"+b.call(String(e.nodeName)),Q=e.attributes||[],ot=0;ot"}if(U(e)){if(0===e.length)return"[]";var gt=ft(e,_);return A&&!ct(gt)?"["+dt(gt,A)+"]":"[ "+E.call(gt,", ")+" ]"}if(j(e)){var mt=ft(e,_);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===mt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+E.call(mt,", ")+" }":"{ ["+String(e)+"] "+E.call(T.call("[cause]: "+_(e.cause),mt),", ")+" }"}if("object"==typeof e&&c){if(N&&"function"==typeof e[N]&&L)return L(e,{depth:m-n});if("symbol"!==c&&"function"==typeof e.inspect)return e.inspect()}if(tt(e)){var At=[];return s&&s.call(e,(function(t,i){At.push(_(i,e,!0)+" => "+_(t,e))})),ut("Map",a.call(e),At,A)}if(rt(e)){var vt=[];return u&&u.call(e,(function(t){vt.push(_(t,e))})),ut("Set",h.call(e),vt,A)}if(et(e))return ht("WeakMap");if(nt(e))return ht("WeakSet");if(it(e))return ht("WeakRef");if(V(e))return lt(_(Number(e)));if(q(e))return lt(_(P.call(e)));if(Y(e))return lt(f.call(e));if(W(e))return lt(_(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===i.g)return"{ [object globalThis] }";if(!H(e)&&!X(e)){var yt=ft(e,_),_t=B?B(e)===Object.prototype:e instanceof Object||e.constructor===Object,bt=e instanceof Object?"":"null prototype",xt=!_t&&O&&Object(e)===e&&O in e?v.call(K(e),8,-1):bt?"Object":"",Tt=(_t||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(xt||bt?"["+E.call(T.call([],xt||[],bt||[]),": ")+"] ":"");return 0===yt.length?Tt+"{}":A?Tt+"{"+dt(yt,A)+"}":Tt+"{ "+E.call(yt,", ")+" }"}return String(e)};var Q=Object.prototype.hasOwnProperty||function(t){return t in this};function Z(t,e){return Q.call(t,e)}function K(t){return g.call(t)}function J(t){if(t.name)return t.name;var e=A.call(m.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function $(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,r=t.length;ie.maxStringLength){var i=t.length-e.maxStringLength,r="... "+i+" more character"+(i>1?"s":"");return st(v.call(t,0,e.maxStringLength),e)+r}return F(y.call(y.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ot),"single",e)}function ot(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+_.call(e.toString(16))}function lt(t){return"Object("+t+")"}function ht(t){return t+" { ? }"}function ut(t,e,i,r){return t+" ("+e+") {"+(r?dt(i,r):E.call(i,", "))+"}"}function ct(t){for(var e=0;e=0)return!1;return!0}function pt(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=E.call(Array(t.indent+1)," ")}return{base:i,prev:E.call(Array(e+1),i)}}function dt(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+E.call(t,","+i)+"\n"+e.prev}function ft(t,e){var i=U(t),r=[];if(i){r.length=t.length;for(var n=0;n{"use strict";var r=i(6535),n=i(7675),a=i(7214)(),s=i(9857),o=i(9525),l=r("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new o("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],r=!0,h=!0;if("length"in t&&s){var u=s(t,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(h=!1)}return(r||h||!i)&&(a?n(t,"length",e,!0,!0):n(t,"length",e)),t}},9078:(t,e,i)=>{"use strict";var r=i(6535),n=i(6317),a=i(4869),s=i(9525),o=r("%WeakMap%",!0),l=r("%Map%",!0),h=n("WeakMap.prototype.get",!0),u=n("WeakMap.prototype.set",!0),c=n("WeakMap.prototype.has",!0),p=n("Map.prototype.get",!0),d=n("Map.prototype.set",!0),f=n("Map.prototype.has",!0),g=function(t,e){for(var i,r=t;null!==(i=r.next);r=i)if(i.key===e)return r.next=i.next,i.next=t.next,t.next=i,i},m=function(t,e){var i=g(t,e);return i&&i.value},A=function(t,e,i){var r=g(t,e);r?r.value=i:t.next={key:e,next:t.next,value:i}},v=function(t,e){return!!g(t,e)};t.exports=function(){var t,e,i,r={assert:function(t){if(!r.has(t))throw new s("Side channel does not contain "+a(t))},get:function(r){if(o&&r&&("object"==typeof r||"function"==typeof r)){if(t)return h(t,r)}else if(l){if(e)return p(e,r)}else if(i)return m(i,r)},has:function(r){if(o&&r&&("object"==typeof r||"function"==typeof r)){if(t)return c(t,r)}else if(l){if(e)return f(e,r)}else if(i)return v(i,r);return!1},set:function(r,n){o&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new o),u(t,r,n)):l?(e||(e=new l),d(e,r,n)):(i||(i={key:{},next:null}),A(i,r,n))}};return r}},2008:function(t,e,i){var r;t=i.nmd(t),function(n){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof i.g&&i.g;a.global!==a&&a.window!==a&&a.self;var s,o=2147483647,l=36,h=1,u=26,c=38,p=700,d=72,f=128,g="-",m=/^xn--/,A=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=l-h,b=Math.floor,x=String.fromCharCode;function T(t){throw new RangeError(y[t])}function E(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function S(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+E((t=t.replace(v,".")).split("."),e).join(".")}function w(t){for(var e,i,r=[],n=0,a=t.length;n=55296&&e<=56319&&n65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=x(t)})).join("")}function I(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,i){var r=0;for(t=i?b(t/p):t>>1,t+=b(t/e);t>_*u>>1;r+=l)t=b(t/_);return b(r+(_+1)*t/(t+c))}function O(t){var e,i,r,n,a,s,c,p,m,A,v=[],y=t.length,_=0,x=f,E=d;for((i=t.lastIndexOf(g))<0&&(i=0),r=0;r=128&&T("not-basic"),v.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=y&&T("invalid-input"),((p=I(t.charCodeAt(n++)))>=l||p>b((o-_)/s))&&T("overflow"),_+=p*s,!(p<(m=c<=E?h:c>=E+u?u:c-E));c+=l)s>b(o/(A=l-m))&&T("overflow"),s*=A;E=C(_-a,e=v.length+1,0==a),b(_/e)>o-x&&T("overflow"),x+=b(_/e),_%=e,v.splice(_++,0,x)}return P(v)}function M(t){var e,i,r,n,a,s,c,p,m,A,v,y,_,E,S,P=[];for(y=(t=w(t)).length,e=f,i=0,a=d,s=0;s=e&&vb((o-i)/(_=r+1))&&T("overflow"),i+=(c-e)*_,e=c,s=0;so&&T("overflow"),v==e){for(p=i,m=l;!(p<(A=m<=a?h:m>=a+u?u:m-a));m+=l)S=p-A,E=l-A,P.push(x(R(A+S%E,0))),p=b(S/E);P.push(x(R(p,0))),a=C(i,_,r==n),i=0,++r}++i,++e}return P.join("")}function B(t){return S(t,(function(t){return m.test(t)?O(t.slice(4).toLowerCase()):t}))}function D(t){return S(t,(function(t){return A.test(t)?"xn--"+M(t):t}))}s={version:"1.4.1",ucs2:{decode:w,encode:P},decode:O,encode:M,toASCII:D,toUnicode:B},void 0===(r=function(){return s}.call(e,i,e,t))||(t.exports=r)}()},1856:t=>{"use strict";var e=String.prototype.replace,i=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};t.exports={default:r.RFC3986,formatters:{RFC1738:function(t){return e.call(t,i,"+")},RFC3986:function(t){return String(t)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986}},4096:(t,e,i)=>{"use strict";var r=i(9853),n=i(2947),a=i(1856);t.exports={formats:a,parse:n,stringify:r}},2947:(t,e,i)=>{"use strict";var r=i(5433),n=Object.prototype.hasOwnProperty,a=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},o=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},l=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},h="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",c=function(t,e){var i,c={__proto__:null},p=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,d=e.parameterLimit===1/0?void 0:e.parameterLimit,f=p.split(e.delimiter,d),g=-1,m=e.charset;if(e.charsetSentinel)for(i=0;i-1&&(v=a(v)?[v]:v),n.call(c,A)?c[A]=r.combine(c[A],v):c[A]=v}return c},p=function(t,e,i,r){for(var n=r?e:l(e,i),a=t.length-1;a>=0;--a){var s,o=t[a];if("[]"===o&&i.parseArrays)s=[].concat(n);else{s=i.plainObjects?Object.create(null):{};var h="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,u=parseInt(h,10);i.parseArrays||""!==h?!isNaN(u)&&o!==h&&String(u)===h&&u>=0&&i.parseArrays&&u<=i.arrayLimit?(s=[])[u]=n:"__proto__"!==h&&(s[h]=n):s={0:n}}n=s}return n},d=function(t,e,i,r){if(t){var a=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,l=i.depth>0&&s.exec(a),h=l?a.slice(0,l.index):a,u=[];if(h){if(!i.plainObjects&&n.call(Object.prototype,h)&&!i.allowPrototypes)return;u.push(h)}for(var c=0;i.depth>0&&null!==(l=o.exec(a))&&c{"use strict";var r=i(9078),n=i(5433),a=i(1856),s=Object.prototype.hasOwnProperty,o={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,h=Array.prototype.push,u=function(t,e){h.apply(t,l(e)?e:[e])},c=Date.prototype.toISOString,p=a.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:p,formatter:a.formatters[p],indices:!1,serializeDate:function(t){return c.call(t)},skipNulls:!1,strictNullHandling:!1},f=function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t},g={},m=function t(e,i,a,s,o,h,c,p,m,A,v,y,_,b,x,T){for(var E=e,S=T,w=0,P=!1;void 0!==(S=S.get(g))&&!P;){var I=S.get(e);if(w+=1,void 0!==I){if(I===w)throw new RangeError("Cyclic object value");P=!0}void 0===S.get(g)&&(w=0)}if("function"==typeof p?E=p(i,E):E instanceof Date?E=v(E):"comma"===a&&l(E)&&(E=n.maybeMap(E,(function(t){return t instanceof Date?v(t):t}))),null===E){if(o)return c&&!b?c(i,d.encoder,x,"key",y):i;E=""}if(f(E)||n.isBuffer(E))return c?[_(b?i:c(i,d.encoder,x,"key",y))+"="+_(c(E,d.encoder,x,"value",y))]:[_(i)+"="+_(String(E))];var R,C=[];if(void 0===E)return C;if("comma"===a&&l(E))b&&c&&(E=n.maybeMap(E,c)),R=[{value:E.length>0?E.join(",")||null:void 0}];else if(l(p))R=p;else{var O=Object.keys(E);R=m?O.sort(m):O}for(var M=s&&l(E)&&1===E.length?i+"[]":i,B=0;B0?y+v:""}},5433:(t,e,i)=>{"use strict";var r=i(1856),n=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),o=function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(a(i)){for(var r=[],n=0;n=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===r.RFC1738&&(40===u||41===u)?l+=o.charAt(h):u<128?l+=s[u]:u<2048?l+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?l+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(h+=1,u=65536+((1023&u)<<10|1023&o.charCodeAt(h)),l+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return l},d=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],r=0;r{"use strict";var r=i(2008);function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(l),u=["%","/","?",";","#"].concat(h),c=["/","?","#"],p=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},A={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=i(4096);function y(t,e,i){if(t&&"object"==typeof t&&t instanceof n)return t;var r=new n;return r.parse(t,e,i),r}function _(t){return"string"==typeof t&&(t=y(t)),t instanceof n?t.format():n.prototype.format.call(t)}function b(t,e){return y(t,!1,!0).resolve(e)}function x(t,e){return t?y(t,!1,!0).resolveObject(e):e}n.prototype.parse=function(t,e,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),s=-1!==n&&n127?D+="x":D+=B[L];if(!D.match(d)){var N=O.slice(0,I),F=O.slice(I+1),G=B.match(f);G&&(N.push(G[1]),F.unshift(G[2])),F.length&&(_="/"+F.join(".")+_),this.hostname=N.join(".");break}}}this.hostname.length>p?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+U,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!g[T])for(I=0,M=h.length;I0)&&i.host.split("@"))&&(i.auth=I.shift(),i.hostname=I.shift(),i.host=i.hostname);return i.search=t.search,i.query=t.query,null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!x.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var E=x.slice(-1)[0],S=(i.host||t.host||x.length>1)&&("."===E||".."===E)||""===E,w=0,P=x.length;P>=0;P--)"."===(E=x[P])?x.splice(P,1):".."===E?(x.splice(P,1),w++):w&&(x.splice(P,1),w--);if(!_&&!b)for(;w--;w)x.unshift("..");!_||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),S&&"/"!==x.join("/").substr(-1)&&x.push("");var I,R=""===x[0]||x[0]&&"/"===x[0].charAt(0);T&&(i.hostname=R?"":x.length?x.shift():"",i.host=i.hostname,(I=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=I.shift(),i.hostname=I.shift(),i.host=i.hostname));return(_=_||i.host&&x.length)&&!R&&x.unshift(""),x.length>0?i.pathname=x.join("/"):(i.pathname=null,i.path=null),null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},n.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.qg=y,e.hd=b,e.GP=_},1537:function(t,e){(function(){function e(t,e,i){return t.call.apply(t.bind,arguments)}function i(t,e,i){if(!t)throw Error();if(2=e.f?a():t.fonts.load(b(e.a),e.h).then((function(t){1<=t.length?r():setTimeout(s,25)}),(function(){a()}))}s()})),a=null,s=new Promise((function(t,i){a=setTimeout(i,e.f)}));Promise.race([s,r]).then((function(){a&&(clearTimeout(a),a=null),e.g(e.a)}),(function(){e.j(e.a)}))};var N={D:"serif",C:"sans-serif"},F=null;function G(){if(null===F){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);F=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return F}function U(t,e,i){for(var r in N)if(N.hasOwnProperty(r)&&e===t.f[N[r]]&&i===t.f[N[r]])return!0;return!1}function H(t){var e,i=t.g.a.offsetWidth,r=t.h.a.offsetWidth;(e=i===t.f.serif&&r===t.f["sans-serif"])||(e=G()&&U(t,i,r)),e?n()-t.A>=t.w?G()&&U(t,i,r)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?j(t,t.v):j(t,t.B):X(t):j(t,t.v)}function X(t){setTimeout(r((function(){H(this)}),t),50)}function j(t,e){setTimeout(r((function(){h(this.g.a),h(this.h.a),h(this.j.a),h(this.m.a),e(this.a)}),t),0)}function W(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}k.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=n(),H(this)};var V=null;function Y(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&u(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),R(t,"active")):I(t.a))}function z(t){this.j=t,this.a=new C,this.h=0,this.f=this.g=!0}function q(t,e,i,n,a){var s=0==--t.h;(t.f||t.g)&&setTimeout((function(){var t=a||null,o=n||{};if(0===i.length&&s)I(e.a);else{e.f+=i.length,s&&(e.j=s);var l,h=[];for(l=0;l{"use strict";var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i.g&&i.g||{},n={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function a(t){return t&&DataView.prototype.isPrototypeOf(t)}if(n.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function l(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function d(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function f(t){var e=new FileReader,i=d(e);return e.readAsArrayBuffer(t),i}function g(t){var e=new FileReader,i=d(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),n=r?r[1]:"utf-8";return e.readAsText(t,n),i}function m(t){for(var e=new Uint8Array(t),i=new Array(e.length),r=0;r-1?e:t}function b(t,e){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new c(e.headers)),this.method=_(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{var a=/\?/;this.url+=(a.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function x(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),r=i.shift().replace(/\+/g," "),n=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(n))}})),e}function T(t){var e=new c;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var i=t.split(":"),r=i.shift().trim();if(r){var n=i.join(":").trim();try{e.append(r,n)}catch(a){console.warn("Response "+a.message)}}})),e}function E(t,e){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},E.error=function(){var t=new E(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var S=[301,302,303,307,308];E.redirect=function(t,e){if(-1===S.indexOf(e))throw new RangeError("Invalid status code");return new E(null,{status:e,headers:{location:t}})};var w=r.DOMException;try{new w}catch(I){(w=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function P(t,e){return new Promise((function(i,a){var s=new b(t,e);if(s.signal&&s.signal.aborted)return a(new w("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}function p(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}if(o.onload=function(){var t={statusText:o.statusText,headers:T(o.getAllResponseHeaders()||"")};0===s.url.indexOf("file://")&&(o.status<200||o.status>599)?t.status=200:t.status=o.status,t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;setTimeout((function(){i(new E(e,t))}),0)},o.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request timed out"))}),0)},o.onabort=function(){setTimeout((function(){a(new w("Aborted","AbortError"))}),0)},o.open(s.method,p(s.url),!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&(n.blob?o.responseType="blob":n.arrayBuffer&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof c||r.Headers&&e.headers instanceof r.Headers)){var d=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){d.push(l(t)),o.setRequestHeader(t,h(e.headers[t]))})),s.headers.forEach((function(t,e){-1===d.indexOf(e)&&o.setRequestHeader(e,t)}))}else s.headers.forEach((function(t,e){o.setRequestHeader(e,t)}));s.signal&&(s.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",u)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}P.polyfill=!0,r.fetch||(r.fetch=P,r.Headers=c,r.Request=b,r.Response=E)},8145:(t,e,i)=>{var r;!function(){"use strict";var n=function(){this.init()};n.prototype={init:function(){var t=this||a;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var e=this||a;if(t=parseFloat(t),e.ctx||d(),void 0!==t&&t>=0&&t<=1){if(e._volume=t,e._muted)return e;e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t,a.ctx.currentTime);for(var i=0;i=0;e--)t._howls[e].unload();return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,d()),t},codecs:function(t){return(this||a)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||a;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(a){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||a,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(a){return t}if(!e||"function"!=typeof e.canPlayType)return t;var i=e.canPlayType("audio/mpeg;").replace(/^no$/,""),r=t._navigator?t._navigator.userAgent:"",n=r.match(/OPR\/(\d+)/g),s=n&&parseInt(n[0].split("/")[1],10)<33,o=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),l=r.match(/Version\/(.*?) /),h=o&&l&&parseInt(l[1],10)<15;return t._codecs={mp3:!(s||!i&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!i,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(e.canPlayType('audio/wav; codecs="1"')||e.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(e.canPlayType("audio/x-m4b;")||e.canPlayType("audio/m4b;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(h||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(h||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||a;if(!t._audioUnlocked&&t.ctx){t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var e=function(i){for(;t._html5AudioPool.length0?o._seek:i._sprite[t][0]/1e3),u=Math.max(0,(i._sprite[t][0]+i._sprite[t][1])/1e3-h),c=1e3*u/Math.abs(o._rate),p=i._sprite[t][0]/1e3,d=(i._sprite[t][0]+i._sprite[t][1])/1e3;o._sprite=t,o._ended=!1;var f=function(){o._paused=!1,o._seek=h,o._start=p,o._stop=d,o._loop=!(!o._loop&&!i._sprite[t][2])};if(!(h>=d)){var g=o._node;if(i._webAudio){var m=function(){i._playLock=!1,f(),i._refreshBuffer(o);var t=o._muted||i._muted?0:o._volume;g.gain.setValueAtTime(t,a.ctx.currentTime),o._playStart=a.ctx.currentTime,void 0===g.bufferSource.start?o._loop?g.bufferSource.noteGrainOn(0,h,86400):g.bufferSource.noteGrainOn(0,h,u):o._loop?g.bufferSource.start(0,h,86400):g.bufferSource.start(0,h,u),c!==1/0&&(i._endTimers[o._id]=setTimeout(i._ended.bind(i,o),c)),e||setTimeout((function(){i._emit("play",o._id),i._loadQueue()}),0)};"running"===a.state&&"interrupted"!==a.ctx.state?m():(i._playLock=!0,i.once("resume",m),i._clearTimer(o._id))}else{var A=function(){g.currentTime=h,g.muted=o._muted||i._muted||a._muted||g.muted,g.volume=o._volume*a.volume(),g.playbackRate=o._rate;try{var r=g.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(i._playLock=!0,f(),r.then((function(){i._playLock=!1,g._unlocked=!0,e?i._loadQueue():i._emit("play",o._id)})).catch((function(){i._playLock=!1,i._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):e||(i._playLock=!1,f(),i._emit("play",o._id)),g.playbackRate=o._rate,g.paused)return void i._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==t||o._loop?i._endTimers[o._id]=setTimeout(i._ended.bind(i,o),c):(i._endTimers[o._id]=function(){i._ended(o),g.removeEventListener("ended",i._endTimers[o._id],!1)},g.addEventListener("ended",i._endTimers[o._id],!1))}catch(t){i._emit("playerror",o._id,t)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===g.src&&(g.src=i._src,g.load());var v=window&&window.ejecta||!g.readyState&&a._navigator.isCocoonJS;if(g.readyState>=3||v)A();else{i._playLock=!0,i._state="loading";var y=function(){i._state="loaded",A(),g.removeEventListener(a._canPlayEvent,y,!1)};g.addEventListener(a._canPlayEvent,y,!1),i._clearTimer(o._id)}}return o._id}i._ended(o)},pause:function(t){var e=this;if("loaded"!==e._state||e._playLock)return e._queue.push({event:"pause",action:function(){e.pause(t)}}),e;for(var i=e._getSoundIds(t),r=0;r=0?e=parseInt(n[0],10):t=parseFloat(n[0]):n.length>=2&&(t=parseFloat(n[0]),e=parseInt(n[1],10)),!(void 0!==t&&t>=0&&t<=1))return(i=e?r._soundById(e):r._sounds[0])?i._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,n)}}),r;void 0===e&&(r._volume=t),e=r._getSoundIds(e);for(var s=0;s0?r/h:r),c=Date.now();t._fadeTo=i,t._interval=setInterval((function(){var n=(Date.now()-c)/r;c=Date.now(),o+=l*n,o=Math.round(100*o)/100,o=l<0?Math.max(i,o):Math.min(i,o),s._webAudio?t._volume=o:s.volume(o,t._id,!0),a&&(s._volume=o),(ie&&o>=i)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,s.volume(i,t._id),s._emit("fade",t._id))}),u)},_stopFade:function(t){var e=this,i=e._soundById(t);return i&&i._interval&&(e._webAudio&&i._node.gain.cancelScheduledValues(a.ctx.currentTime),clearInterval(i._interval),i._interval=null,e.volume(i._fadeTo,t),i._fadeTo=null,e._emit("fade",t)),e},loop:function(){var t,e,i,r=this,n=arguments;if(0===n.length)return r._loop;if(1===n.length){if("boolean"!=typeof n[0])return!!(i=r._soundById(parseInt(n[0],10)))&&i._loop;t=n[0],r._loop=t}else 2===n.length&&(t=n[0],e=parseInt(n[1],10));for(var a=r._getSoundIds(e),s=0;s=0?e=parseInt(n[0],10):t=parseFloat(n[0])}else 2===n.length&&(t=parseFloat(n[0]),e=parseInt(n[1],10));if("number"!=typeof t)return(i=r._soundById(e))?i._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,n)}}),r;void 0===e&&(r._rate=t),e=r._getSoundIds(e);for(var s=0;s=0?e=parseInt(r[0],10):i._sounds.length&&(e=i._sounds[0]._id,t=parseFloat(r[0]))}else 2===r.length&&(t=parseFloat(r[0]),e=parseInt(r[1],10));if(void 0===e)return 0;if("number"==typeof t&&("loaded"!==i._state||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,r)}}),i;var n=i._soundById(e);if(n){if(!("number"==typeof t&&t>=0)){if(i._webAudio){var s=i.playing(e)?a.ctx.currentTime-n._playStart:0,o=n._rateSeek?n._rateSeek-n._seek:0;return n._seek+(o+s*Math.abs(n._rate))}return n._node.currentTime}var l=i.playing(e);l&&i.pause(e,!0),n._seek=t,n._ended=!1,i._clearTimer(e),i._webAudio||!n._node||isNaN(n._node.duration)||(n._node.currentTime=t);var h=function(){l&&i.play(e,!0),i._emit("seek",e)};if(l&&!i._webAudio){var u=function(){i._playLock?setTimeout(u,0):h()};setTimeout(u,0)}else h()}return i},playing:function(t){var e=this;if("number"==typeof t){var i=e._soundById(t);return!!i&&!i._paused}for(var r=0;r=0&&a._howls.splice(r,1);var n=!0;for(i=0;i=0){n=!1;break}return l&&n&&delete l[t._src],a.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,e,i,r){var n=this,a=n["_on"+t];return"function"==typeof e&&a.push(r?{id:i,fn:e,once:r}:{id:i,fn:e}),n},off:function(t,e,i){var r=this,n=r["_on"+t],a=0;if("number"==typeof e&&(i=e,e=null),e||i)for(a=0;a=0;a--)n[a].id&&n[a].id!==e&&"load"!==t||(setTimeout(function(t){t.call(this,e,i)}.bind(r,n[a].fn),0),n[a].once&&r.off(t,n[a].fn,n[a].id));return r._loadQueue(t),r},_loadQueue:function(t){var e=this;if(e._queue.length>0){var i=e._queue[0];i.event===t&&(e._queue.shift(),e._loadQueue()),t||i.action()}return e},_ended:function(t){var e=this,i=t._sprite;if(!e._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime=0;r--){if(i<=e)return;t._sounds[r]._ended&&(t._webAudio&&t._sounds[r]._node&&t._sounds[r]._node.disconnect(0),t._sounds.splice(r,1),i--)}}},_getSoundIds:function(t){var e=this;if(void 0===t){for(var i=[],r=0;r=0;if(!t.bufferSource)return e;if(a._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),i))try{t.bufferSource.buffer=a._scratchBuffer}catch(t){}return t.bufferSource=null,e},_clearSound:function(t){/MSIE |Trident\//.test(a._navigator&&a._navigator.userAgent)||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var o=function(t){this._parent=t,this.init()};o.prototype={init:function(){var t=this,e=t._parent;return t._muted=e._muted,t._loop=e._loop,t._volume=e._volume,t._rate=e._rate,t._seek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++a._counter,e._sounds.push(t),t.create(),t},create:function(){var t=this,e=t._parent,i=a._muted||t._muted||t._parent._muted?0:t._volume;return e._webAudio?(t._node=void 0===a.ctx.createGain?a.ctx.createGainNode():a.ctx.createGain(),t._node.gain.setValueAtTime(i,a.ctx.currentTime),t._node.paused=!0,t._node.connect(a.masterGain)):a.noAudio||(t._node=a._obtainHtml5Audio(),t._errorFn=t._errorListener.bind(t),t._node.addEventListener("error",t._errorFn,!1),t._loadFn=t._loadListener.bind(t),t._node.addEventListener(a._canPlayEvent,t._loadFn,!1),t._endFn=t._endListener.bind(t),t._node.addEventListener("ended",t._endFn,!1),t._node.src=e._src,t._node.preload=!0===e._preload?"auto":e._preload,t._node.volume=i*a.volume(),t._node.load()),t},reset:function(){var t=this,e=t._parent;return t._muted=e._muted,t._loop=e._loop,t._volume=e._volume,t._rate=e._rate,t._seek=0,t._rateSeek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++a._counter,t},_errorListener:function(){var t=this;t._parent._emit("loaderror",t._id,t._node.error?t._node.error.code:0),t._node.removeEventListener("error",t._errorFn,!1)},_loadListener:function(){var t=this,e=t._parent;e._duration=Math.ceil(10*t._node.duration)/10,0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue()),t._node.removeEventListener(a._canPlayEvent,t._loadFn,!1)},_endListener:function(){var t=this,e=t._parent;e._duration===1/0&&(e._duration=Math.ceil(10*t._node.duration)/10,e._sprite.__default[1]===1/0&&(e._sprite.__default[1]=1e3*e._duration),e._ended(t)),t._node.removeEventListener("ended",t._endFn,!1)}};var l={},h=function(t){var e=t._src;if(l[e])return t._duration=l[e].duration,void p(t);if(/^data:[^;]+;base64,/.test(e)){for(var i=atob(e.split(",")[1]),r=new Uint8Array(i.length),n=0;n0?(l[e._src]=t,p(e,t)):i()};"undefined"!=typeof Promise&&1===a.ctx.decodeAudioData.length?a.ctx.decodeAudioData(t).then(r).catch(i):a.ctx.decodeAudioData(t,r,i)},p=function(t,e){e&&!t._duration&&(t._duration=e.duration),0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())},d=function(){if(a.usingWebAudio){try{"undefined"!=typeof AudioContext?a.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?a.ctx=new webkitAudioContext:a.usingWebAudio=!1}catch(t){a.usingWebAudio=!1}a.ctx||(a.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(a._navigator&&a._navigator.platform),e=a._navigator&&a._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),i=e?parseInt(e[1],10):null;if(t&&i&&i<9){var r=/safari/.test(a._navigator&&a._navigator.userAgent.toLowerCase());a._navigator&&!r&&(a.usingWebAudio=!1)}a.usingWebAudio&&(a.masterGain=void 0===a.ctx.createGain?a.ctx.createGainNode():a.ctx.createGain(),a.masterGain.gain.setValueAtTime(a._muted?0:a._volume,a.ctx.currentTime),a.masterGain.connect(a.ctx.destination)),a._setup()}};void 0!==(r=function(){return{Howler:a,Howl:s}}.apply(e,[]))&&(t.exports=r),a,s,void 0!==i.g?(i.g.HowlerGlobal=n,i.g.Howler=a,i.g.Howl=s,i.g.Sound=o):"undefined"!=typeof window&&(window.HowlerGlobal=n,window.Howler=a,window.Howl=s,window.Sound=o)}()},2290:()=>{},805:(t,e,i)=>{"use strict";var r,n,a,s,o,l,h,u,c,p,d,f,g,m,A,v,y,_,b,x;i.d(e,{B9:()=>s,E8:()=>f,Eq:()=>_,Gk:()=>g,Km:()=>r,M6:()=>p,OS:()=>A,Pk:()=>v,QE:()=>u,XZ:()=>c,_4:()=>o,dW:()=>h,fr:()=>m,h3:()=>n,hR:()=>l,he:()=>b,uR:()=>d,vg:()=>y,wn:()=>a,yw:()=>x}),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(r||(r={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(n||(n={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(a||(a={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(s||(s={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(o||(o={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(l||(l={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(h||(h={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(u||(u={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(c||(c={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(p||(p={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(d||(d={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(f||(f={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(g||(g={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(m||(m={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(A||(A={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(v||(v={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR"}(y||(y={})),function(t){t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA"}(_||(_={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(b||(b={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(x||(x={}))},1947:(t,e,i)=>{"use strict";i.d(e,{$P:()=>Pe,$Z:()=>It,$f:()=>w,A4:()=>Ve,A5:()=>P,A6:()=>rt,Ag:()=>s.A,BP:()=>Ht,Bu:()=>T,Bw:()=>de,CF:()=>Ee,CI:()=>_,D8:()=>Le,ES:()=>si,Eo:()=>qe,FW:()=>m,GW:()=>O,Gj:()=>S,He:()=>ye,JH:()=>ei,LE:()=>M,LQ:()=>ti,Ln:()=>u,MT:()=>ze,Mt:()=>Xt,NW:()=>ie,Nc:()=>c,O1:()=>F,OE:()=>B,OO:()=>J,Pt:()=>it,RO:()=>ve,Ru:()=>Fe,SD:()=>$e,Uw:()=>Qt,V2:()=>z,WD:()=>_t,WQ:()=>E,X1:()=>Q,XN:()=>ct,XO:()=>s.X,Y7:()=>N,_H:()=>be,_J:()=>Ae,aV:()=>b,ah:()=>re,bD:()=>at,cc:()=>Ke,ch:()=>ai,dJ:()=>Jt,dZ:()=>A,di:()=>I,gP:()=>k,hk:()=>ue,hp:()=>H,hq:()=>Ze,iH:()=>he,iQ:()=>Qe,iW:()=>ne,jH:()=>x,k2:()=>K,kO:()=>q,kb:()=>ut,kp:()=>Xe,lB:()=>ke,n1:()=>_e,nV:()=>hi,nW:()=>G,nj:()=>lt,oA:()=>ni,pq:()=>st,q5:()=>Ye,s9:()=>le,t5:()=>y,u3:()=>Je,u9:()=>et,uC:()=>Lt,vB:()=>Ge,xv:()=>ci});var r=i(9615),n=i(805),a=i(3785),s=i(6919),o=i(935),l=i(4775),h=i(7239);r.W0.PREFER_ENV=a.isMobile.any?n.Km.WEBGL:n.Km.WEBGL2,r.W0.STRICT_TEXTURE_CACHE=!1;var u=[];function c(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=u.length-1;n>=0;--n){var a=u[n];if(a.test&&a.test(t,i))return new a(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},p(t,e)};function d(t,e){function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var f=function(){return f=Object.assign||function(t){for(var e,i=arguments,r=1,n=arguments.length;r0&&d>0,s.textureCacheIds=[],s.destroyed=!1,s.resource=null,s._batchEnabled=0,s._batchLocation=0,s.parentTextureArray=null,s.setResource(e),s}return d(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=(0,a.isPow2)(this.realWidth)&&(0,a.isPow2)(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete a.BaseTextureCache[this.cacheId],delete a.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,i,n){void 0===n&&(n=r.W0.STRICT_TEXTURE_CACHE);var s="string"==typeof t,o=null;if(s)o=t;else{if(!t._pixiId){var l=i&&i.pixiIdPrefix||"pixiid";t._pixiId=l+"_"+(0,a.uid)()}o=t._pixiId}var h=a.BaseTextureCache[o];if(s&&n&&!h)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return h||((h=new e(t,i)).cacheId=o,e.addToCache(h,o)),h},e.fromBuffer=function(t,i,r,a){t=t||new Float32Array(i*r*4);var s=new A(t,{width:i,height:r}),o=t instanceof Float32Array?n.QE.FLOAT:n.QE.UNSIGNED_BYTE;return new e(s,Object.assign({},v,a||{width:i,height:r,type:o}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),a.BaseTextureCache[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),a.BaseTextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=a.BaseTextureCache[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete a.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=n.dW.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,i,r){for(var n=this.itemDirtyIds,a=0;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(x),P=function(t){function e(i,r){var n=this;if(r=r||{},!(i instanceof HTMLVideoElement)){var a=document.createElement("video");a.setAttribute("preload","auto"),a.setAttribute("webkit-playsinline",""),a.setAttribute("playsinline",""),"string"==typeof i&&(i=[i]);var s=i[0].src||i[0];x.crossOrigin(a,s,r.crossorigin);for(var o=0;o2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(l.Rv.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(l.Rv.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(l.Rv.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(l.Rv.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(l.Rv.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,i){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(x),I=function(t){function e(e){return t.call(this,e)||this}return d(e,t),e.test=function(t){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap},e}(x);u.push(S,I,T,P,w,A,E,b);var R={__proto__:null,Resource:m,BaseImageResource:x,INSTALLED:u,autoDetectResource:c,AbstractMultiResource:_,ArrayResource:b,BufferResource:A,CanvasResource:T,CubeResource:E,ImageResource:S,SVGResource:w,VideoResource:P,ImageBitmapResource:I},C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.upload=function(t,e,i){var r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===n.Gk.UNPACK);var a=e.realWidth,s=e.realHeight;return i.width===a&&i.height===s?r.texSubImage2D(e.target,0,0,0,a,s,e.format,i.type,this.data):(i.width=a,i.height=s,r.texImage2D(e.target,0,i.internalFormat,a,s,0,e.format,i.type,this.data)),!0},e}(A),O=function(){function t(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new o.b("disposeFramebuffer"),this.multisample=n.he.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new y(null,{scaleMode:n.M6.NEAREST,resolution:1,mipmap:n.E8.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new y(new C(null,{width:this.width,height:this.height}),{scaleMode:n.M6.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:n.E8.OFF,format:n.hR.DEPTH_COMPONENT,type:n.QE.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete a.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(a||s){var o=a&&s?"and":"or",l="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,h="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+l+" "+o+" "+h)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new y),L(e._EMPTY),L(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=r.W0.ADAPTER.createCanvas(16,16),i=t.getContext("2d");t.width=16,t.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),e._WHITE=new e(y.from(t)),L(e._WHITE),L(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(a.EventEmitter),N=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return d(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,i){void 0===i&&(i=!0);var r=this.baseTexture.resolution,n=Math.round(t*r)/r,a=Math.round(e*r)/r;this.valid=n>0&&a>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(n,a),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var i=arguments,r=[],n=1;n1?-r:-1:(s=((65535&(t=(0,a.nextPow2)(t)))<<16|65535&(e=(0,a.nextPow2)(e)))>>>0,r>1&&(s+=4294967296*r)),this.texturePool[s]||(this.texturePool[s]=[]);var o=this.texturePool[s].pop();return o||(o=this.createTexture(t,e,r)),o.filterPoolKey=s,o.setResolution(i),o},t.prototype.getFilterTexture=function(t,e,i){var r=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||n.he.NONE);return r.filterFrame=t.filterFrame,r},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var r=0;r0&&t.height>0,this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var r=0;r1){for(var h=0;h1&&((c=this.getOptimalFilterTexture(u.width,u.height,e.resolution)).filterFrame=u.filterFrame),i[p].apply(this,u,c,n.fr.CLEAR,e);var d=u;u=c,c=d}i[p].apply(this,u,h.renderTexture,n.fr.BLEND,e),p>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(u),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(t,e){void 0===e&&(e=n.fr.CLEAR);var i=this.renderer,r=i.renderTexture,a=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=t.filterFrame.width,s.height=t.filterFrame.height,r.bind(t,t.filterFrame,s)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=1&a.stateId||this.forceClear;(e===n.fr.CLEAR||e===n.fr.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(t,e,i,r){var a=this.renderer;a.state.set(t.state),this.bindAndClear(i,r),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,a.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),a.geometry.bind(this.quadUv),a.geometry.draw(n._4.TRIANGLES)):(a.geometry.bind(this.quad),a.geometry.draw(n._4.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,r=i.sourceFrame,n=i.destinationFrame,a=e._texture.orig,s=t.set(n.width,0,0,n.height,r.x,r.y),o=e.worldTransform.copyTo(h.uq.TEMP_MATRIX);return o.invert(),s.prepend(o),s.scale(1/a.width,1/a.height),s.translate(e.anchor.x,e.anchor.y),s},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(t,e,i,r){return void 0===i&&(i=1),void 0===r&&(r=n.he.NONE),this.texturePool.getOptimalTexture(t,e,i,r)},t.prototype.getFilterTexture=function(t,e,i){if("number"==typeof t){var r=t;t=e,e=r}t=t||this.activeState.renderTexture;var a=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||n.he.NONE);return a.filterFrame=t.filterFrame,a},t.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(t,e){var i=$[0],r=$[1],n=$[2],a=$[3];i.set(e.left,e.top),r.set(e.left,e.bottom),n.set(e.right,e.top),a.set(e.right,e.bottom),t.apply(i,i),t.apply(r,r),t.apply(n,n),t.apply(a,a);var s=Math.min(i.x,r.x,n.x,a.x),o=Math.min(i.y,r.y,n.y,a.y),l=Math.max(i.x,r.x,n.x,a.x),h=Math.max(i.y,r.y,n.y,a.y);e.x=s,e.y=o,e.width=l-s,e.height=h-o},t.prototype.roundFrame=function(t,e,i,r,n){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(n){var a=n.a,s=n.b,o=n.c,l=n.d;if((Math.abs(s)>1e-4||Math.abs(o)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(l)>1e-4))return}(n=n?tt.copyFrom(n):tt.identity()).translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}},t}(),it=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),rt=function(){function t(t){this.renderer=t,this.emptyRenderer=new it(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,r=e-1;r>=0;--r)t[r]=i[r]||null,t[r]&&(t[r]._batchLocation=r)},t.prototype.boundArray=function(t,e,i,r){for(var n=t.elements,a=t.ids,s=t.count,o=0,l=0;l=0&&u=n.Km.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout((function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()}),0)},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},t}(),st=function(){function t(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=n.he.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return t}(),ot=new h.M_,lt=function(){function t(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new O(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new h.M_,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;r.W0.PREFER_ENV===n.Km.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},t.prototype.bind=function(t,e,i){void 0===i&&(i=0);var r=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=i),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var a=0;a>i,l=e.height>>i,h=o/e.width;this.setViewport(e.x*h,e.y*h,o,l)}else{o=t.width>>i,l=t.height>>i;this.setViewport(0,0,o,l)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(t,e,i,r){var n=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),n.width===i&&n.height===r&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,r))},Object.defineProperty(t.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),t.prototype.clear=function(t,e,i,r,a){void 0===a&&(a=n.wn.COLOR|n.wn.DEPTH);var s=this.gl;s.clearColor(t,e,i,r),s.clear(a)},t.prototype.initFramebuffer=function(t){var e=this.gl,i=new st(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},t.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var r=t.colorTextures,n=r.length;e.drawBuffers||(n=Math.min(n,1));for(var a=0;a1&&this.canMultisampleFramebuffer(t)?(r.msaaBuffer=r.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,r.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,i.RGBA8,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(i.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var s=[],o=0;o1&&i.drawBuffers(s),t.depthTexture)&&this.writeDepthTexture){var u=t.depthTexture;this.renderer.texture.bind(u,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,u._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?r.stencil&&(i.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,r.stencil),r.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,r.stencil))},t.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},t.prototype.detectSamples=function(t){var e=this.msaaSamples,i=n.he.NONE;if(t<=1||null===e)return i;for(var r=0;r=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&r.deleteRenderbuffer(i.msaaBuffer),i.stencil&&r.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=n.Km.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),yt=e}return yt}function bt(){if(!At){At=n.Pk.MEDIUM;var t=_t();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);At=e.precision?n.Pk.HIGH:n.Pk.MEDIUM}}return At}function xt(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===n.Pk.HIGH&&i!==n.Pk.HIGH&&(r=n.Pk.MEDIUM),"precision "+r+" float;\n"+t}return i!==n.Pk.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Tt={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Et(t){return Tt[t]}var St=null,wt={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Pt(t,e){if(!St){var i=Object.keys(wt);St={};for(var r=0;r0&&(e+="\nelse "),i0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask(0!=(1&i),0!=(2&i),0!=(4&i),0!=(8&i))},t.prototype.destroy=function(){this.renderer=null},t}(),ae=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var r=this.getStackLength();r!==i&&(0===r?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),se=new h.uq,oe=[],le=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=r.W0.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return d(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var e;if(!t._scissorRectLocal){var i=t._scissorRect,r=t.maskObject,n=this.renderer,a=n.renderTexture,s=r.getBounds(!0,null!==(e=oe.pop())&&void 0!==e?e:new h.M_);this.roundFrameToPixels(s,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),i&&s.fit(i),t._scissorRectLocal=s}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,i=t.b,r=t.c,n=t.d;return(Math.abs(i)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)},e.prototype.testScissor=function(t){var i=t.maskObject;if(!i.isFastRect||!i.isFastRect())return!1;if(e.isMatrixRotated(i.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var r=t._scissorRectLocal;return r.width>0&&r.height>0},e.prototype.roundFrameToPixels=function(t,i,r,n,a){e.isMatrixRotated(a)||((a=a?se.copyFrom(a):se.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(a,t),t.fit(n),t.x=Math.round(t.x*i),t.y=Math.round(t.y*i),t.width=Math.round(t.width*i),t.height=Math.round(t.height*i))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;t&&oe.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(ae),he=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=r.W0.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return d(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,i=this.renderer.gl,r=t._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;var n=t._colorMask;0!==n&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,r,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==n&&(t._colorMask=n,i.colorMask(0!=(1&n),0!=(2&n),0!=(4&n),0!=(8&n))),this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{var i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,r=i?i._colorMask:15;0!==r&&(i._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==r&&(i._colorMask=r,e.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(ae),ue=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new h.uq,this.transform=null}return t.prototype.update=function(t,e,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,r),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,i,r){var n=this.projectionMatrix,a=r?-1:1;n.identity(),n.a=1/e.width*2,n.d=a*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-a-e.y*n.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),ce=new h.M_,pe=new h.M_,de=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new h.M_,this.destinationFrame=new h.M_,this.viewportFrame=new h.M_}return t.prototype.bind=function(t,e,i){void 0===t&&(t=null);var r,n,a,s=this.renderer;this.current=t,t?(a=(r=t.baseTexture).resolution,e||(ce.width=t.frame.width,ce.height=t.frame.height,e=ce),i||(pe.x=t.frame.x,pe.y=t.frame.y,pe.width=e.width,pe.height=e.height,i=pe),n=r.framebuffer):(a=s.resolution,e||(ce.width=s.screen.width,ce.height=s.screen.height,e=ce),i||((i=ce).width=e.width,i.height=e.height));var o=this.viewportFrame;o.x=i.x*a,o.y=i.y*a,o.width=i.width*a,o.height=i.height*a,t||(o.y=s.view.height-(o.y+o.height)),o.ceil(),this.renderer.framebuffer.bind(n,o),this.renderer.projection.update(i,e,a,!n),t?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var i=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,n=i.width!==r.width||i.height!==r.height;if(n){var a=this.viewportFrame,s=a.x,o=a.y,l=a.width,h=a.height;s=Math.round(s),o=Math.round(o),l=Math.round(l),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,o,l,h)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),n&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function fe(t,e,i,r,n){i.buffer.update(n)}var ge={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},me={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function Ae(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),i=0,r=0,n=0,a=0;a1&&(i=Math.max(i,16)*s.data.size),s.dataLen=i,r%i!=0&&r<16){var o=r%i%16;r+=o,n+=o}r+i>16?(n=16*Math.ceil(n/16),s.offset=n,n+=i,r=i):(s.offset=n,r+=i,n+=i)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}function ve(t,e){var i=[];for(var r in t)e[r]&&i.push(e[r]);return i.sort((function(t,e){return t.index-e.index})),i}function ye(t,e){if(!t.autoManage)return{size:0,syncFunc:fe};for(var i=Ae(ve(t.uniforms,e)),r=i.uboElements,n=i.size,a=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],s=0;s1){var d=Et(o.data.type),f=Math.max(me[o.data.type]/16,1),g=d/f,m=(4-g%4)%4;a.push("\n cv = ud."+h+".value;\n v = uv."+h+";\n offset = "+o.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+o.data.size*f+"; i++)\n {\n for(var j = 0; j < "+g+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var A=ge[o.data.type];a.push("\n cv = ud."+h+".value;\n v = uv."+h+";\n offset = "+o.offset/4+";\n "+A+";\n ")}}return a.push("\n renderer.buffer.update(buffer);\n "),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",a.join("\n"))}}var _e=function(){function t(){}return t}(),be=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function xe(t,e){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;ne?1:-1}));for(var s=0;s>=1,i++;this.stateId=t.data}for(i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){var a=0;for(r=0;r=0;r--)this.unload(t.children[r])},t.prototype.destroy=function(){this.renderer=null},t}();function Ne(t){var e,i,r,a,s,o,l,h,u,c,p,d,f,g,m,A,v,y,_,b,x,T,E;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?((e={})[n.QE.UNSIGNED_BYTE]=((i={})[n.hR.RGBA]=t.RGBA8,i[n.hR.RGB]=t.RGB8,i[n.hR.RG]=t.RG8,i[n.hR.RED]=t.R8,i[n.hR.RGBA_INTEGER]=t.RGBA8UI,i[n.hR.RGB_INTEGER]=t.RGB8UI,i[n.hR.RG_INTEGER]=t.RG8UI,i[n.hR.RED_INTEGER]=t.R8UI,i[n.hR.ALPHA]=t.ALPHA,i[n.hR.LUMINANCE]=t.LUMINANCE,i[n.hR.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,i),e[n.QE.BYTE]=((r={})[n.hR.RGBA]=t.RGBA8_SNORM,r[n.hR.RGB]=t.RGB8_SNORM,r[n.hR.RG]=t.RG8_SNORM,r[n.hR.RED]=t.R8_SNORM,r[n.hR.RGBA_INTEGER]=t.RGBA8I,r[n.hR.RGB_INTEGER]=t.RGB8I,r[n.hR.RG_INTEGER]=t.RG8I,r[n.hR.RED_INTEGER]=t.R8I,r),e[n.QE.UNSIGNED_SHORT]=((a={})[n.hR.RGBA_INTEGER]=t.RGBA16UI,a[n.hR.RGB_INTEGER]=t.RGB16UI,a[n.hR.RG_INTEGER]=t.RG16UI,a[n.hR.RED_INTEGER]=t.R16UI,a[n.hR.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,a),e[n.QE.SHORT]=((s={})[n.hR.RGBA_INTEGER]=t.RGBA16I,s[n.hR.RGB_INTEGER]=t.RGB16I,s[n.hR.RG_INTEGER]=t.RG16I,s[n.hR.RED_INTEGER]=t.R16I,s),e[n.QE.UNSIGNED_INT]=((o={})[n.hR.RGBA_INTEGER]=t.RGBA32UI,o[n.hR.RGB_INTEGER]=t.RGB32UI,o[n.hR.RG_INTEGER]=t.RG32UI,o[n.hR.RED_INTEGER]=t.R32UI,o[n.hR.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,o),e[n.QE.INT]=((l={})[n.hR.RGBA_INTEGER]=t.RGBA32I,l[n.hR.RGB_INTEGER]=t.RGB32I,l[n.hR.RG_INTEGER]=t.RG32I,l[n.hR.RED_INTEGER]=t.R32I,l),e[n.QE.FLOAT]=((h={})[n.hR.RGBA]=t.RGBA32F,h[n.hR.RGB]=t.RGB32F,h[n.hR.RG]=t.RG32F,h[n.hR.RED]=t.R32F,h[n.hR.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,h),e[n.QE.HALF_FLOAT]=((u={})[n.hR.RGBA]=t.RGBA16F,u[n.hR.RGB]=t.RGB16F,u[n.hR.RG]=t.RG16F,u[n.hR.RED]=t.R16F,u),e[n.QE.UNSIGNED_SHORT_5_6_5]=((c={})[n.hR.RGB]=t.RGB565,c),e[n.QE.UNSIGNED_SHORT_4_4_4_4]=((p={})[n.hR.RGBA]=t.RGBA4,p),e[n.QE.UNSIGNED_SHORT_5_5_5_1]=((d={})[n.hR.RGBA]=t.RGB5_A1,d),e[n.QE.UNSIGNED_INT_2_10_10_10_REV]=((f={})[n.hR.RGBA]=t.RGB10_A2,f[n.hR.RGBA_INTEGER]=t.RGB10_A2UI,f),e[n.QE.UNSIGNED_INT_10F_11F_11F_REV]=((g={})[n.hR.RGB]=t.R11F_G11F_B10F,g),e[n.QE.UNSIGNED_INT_5_9_9_9_REV]=((m={})[n.hR.RGB]=t.RGB9_E5,m),e[n.QE.UNSIGNED_INT_24_8]=((A={})[n.hR.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,A),e[n.QE.FLOAT_32_UNSIGNED_INT_24_8_REV]=((v={})[n.hR.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,v),E=e):((y={})[n.QE.UNSIGNED_BYTE]=((_={})[n.hR.RGBA]=t.RGBA,_[n.hR.RGB]=t.RGB,_[n.hR.ALPHA]=t.ALPHA,_[n.hR.LUMINANCE]=t.LUMINANCE,_[n.hR.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,_),y[n.QE.UNSIGNED_SHORT_5_6_5]=((b={})[n.hR.RGB]=t.RGB,b),y[n.QE.UNSIGNED_SHORT_4_4_4_4]=((x={})[n.hR.RGBA]=t.RGBA,x),y[n.QE.UNSIGNED_SHORT_5_5_5_1]=((T={})[n.hR.RGBA]=t.RGBA,T),E=y),E}var Fe=function(){function t(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=n.QE.UNSIGNED_BYTE,this.internalFormat=n.hR.RGBA,this.samplerType=0}return t}(),Ge=function(){function t(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new y,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Ne(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=0;--s){var o=i[s];if(o)o._glTextures[a].samplerType!==n.XZ.FLOAT&&this.renderer.texture.unbind(o)}},t.prototype.initTexture=function(t){var e=new Fe(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(t,e){var i,r;e.internalFormat=null!==(r=null===(i=this.internalFormats[t.type])||void 0===i?void 0:i[t.format])&&void 0!==r?r:t.format,2===this.webGLVersion&&t.type===n.QE.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},t.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==n.XZ.FLOAT&&(this.hasIntegerTextures=!0);else{var r=t.realWidth,a=t.realHeight,s=i.gl;(e.width!==r||e.height!==a||e.dirtyId<0)&&(e.width=r,e.height=a,s.texImage2D(t.target,0,e.internalFormat,r,a,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},t.prototype.destroyTexture=function(t,e){var i=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var r=this.managedTextures.indexOf(t);-1!==r&&(0,a.removeItems)(this.managedTextures,r,1)}},t.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==n.E8.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=n.uR.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},t.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==n.E8.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===n.M6.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===n.M6.LINEAR){var a=Math.min(t.anisotropicLevel,i.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,a)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===n.M6.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===n.M6.LINEAR?i.LINEAR:i.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),Ue={__proto__:null,FilterSystem:et,BatchSystem:rt,ContextSystem:at,FramebufferSystem:lt,GeometrySystem:ut,MaskSystem:ne,ScissorSystem:le,StencilSystem:he,ProjectionSystem:ue,RenderTextureSystem:de,ShaderSystem:Pe,StateSystem:Le,TextureGCSystem:ke,TextureSystem:Ge},He=new h.uq,Xe=function(t){function e(e,i){void 0===e&&(e=n.h3.UNKNOWN);var s=t.call(this)||this;return i=Object.assign({},r.W0.RENDER_OPTIONS,i),s.options=i,s.type=e,s.screen=new h.M_(0,0,i.width,i.height),s.view=i.view||r.W0.ADAPTER.createCanvas(),s.resolution=i.resolution||r.W0.RESOLUTION,s.useContextAlpha=i.useContextAlpha,s.autoDensity=!!i.autoDensity,s.preserveDrawingBuffer=i.preserveDrawingBuffer,s.clearBeforeRender=i.clearBeforeRender,s._backgroundColor=0,s._backgroundColorRgba=[0,0,0,1],s._backgroundColorString="#000000",s.backgroundColor=i.backgroundColor||s._backgroundColor,s.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&((0,a.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),s.useContextAlpha=i.transparent,s.backgroundAlpha=i.transparent?0:1),s._lastObjectRendered=null,s.plugins={},s}return d(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var i=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=i,this.screen.height=r,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=r+"px"),this.emit("resize",i,r)},e.prototype.generateTexture=function(t,e,i,r){void 0===e&&(e={}),"number"==typeof e&&((0,a.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:i,region:r});var n=e.region,s=g(e,["region"]);0===(r=n||t.getLocalBounds(null,!0)).width&&(r.width=1),0===r.height&&(r.height=1);var o=N.create(f({width:r.width,height:r.height},s));return He.tx=-r.x,He.ty=-r.y,this.render(t,{renderTexture:o,clear:!1,transform:He,skipUpdateTransform:!!t.parent}),o},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=n.h3.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=(0,a.hex2string)(t),(0,a.hex2rgb)(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(a.EventEmitter),je=function(){function t(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return t}(),We=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this,i=e.gl,r=e.CONTEXT_UID,n=t._glBuffers[r]||this.createGLBuffer(t);i.bindBuffer(t.type,n.buffer)},t.prototype.bindBufferBase=function(t,e){var i=this,r=i.gl,n=i.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var a=t._glBuffers[n]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,a.buffer)}},t.prototype.bindBufferRange=function(t,e,i){var r=this,n=r.gl,a=r.CONTEXT_UID;i=i||0;var s=t._glBuffers[a]||this.createGLBuffer(t);n.bindBufferRange(n.UNIFORM_BUFFER,e||0,s.buffer,256*i,256)},t.prototype.update=function(t){var e=this,i=e.gl,r=e.CONTEXT_UID,n=t._glBuffers[r];if(t._updateID!==n.updateID)if(n.updateID=t._updateID,i.bindBuffer(t.type,n.buffer),n.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{var a=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;n.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,a)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i=n.he.HIGH?this.multisample=n.he.HIGH:t>=n.he.MEDIUM?this.multisample=n.he.MEDIUM:t>=n.he.LOW?this.multisample=n.he.LOW:this.multisample=n.he.NONE},e.prototype.addSystem=function(t,e){var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e){var i,r,n,s;if(e&&(e instanceof N?((0,a.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),i=e,r=arguments[2],n=arguments[3],s=arguments[4]):(i=e.renderTexture,r=e.clear,n=e.transform,s=e.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(i||(this._lastObjectRendered=t),!s){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(e,i,r,n){void 0===i&&(i={});var a=t.prototype.generateTexture.call(this,e,i,r,n);return this.framebuffer.blit(),a},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var i in this.runners.destroy.emit(),this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return(0,a.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,e){(0,a.deprecation)("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),s.X.add({name:t,type:s.A.RendererPlugin,ref:e})},e.__plugins={},e}(Xe);function Ye(t){return Ve.create(t)}s.X.handleByMap(s.A.RendererPlugin,Ve.__plugins);var ze="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qe="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Qe=function(){function t(t){(0,a.deprecation)("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),Ze=function(){function t(){this.texArray=null,this.blend=0,this.type=n._4.TRIANGLES,this.start=0,this.size=0,this.data=null}return t}(),Ke=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this,i=t._bufferedTextures,r=t.MAX_TEXTURES,n=e._textureArrayPool,a=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count,l=++y._globalBatch,h=0,u=n[0],c=0;a.copyBoundTextures(s,r);for(var p=0;p=r&&(a.boundArray(u,s,l,r),this.buildDrawCalls(u,c,p),c=p,u=n[++h],++l),d._batchEnabled=l,d.touched=o,u.elements[u.count++]=d)}u.count>0&&(a.boundArray(u,s,l,r),this.buildDrawCalls(u,c,this._bufferSize),++h,++l);for(p=0;p0&&(e+="\nelse "),i{"use strict";i.d(e,{cz:()=>o,dC:()=>c,mc:()=>d,q9:()=>u});var r=i(9615),n=i(7239),a=i(3785),s=i(805);r.W0.SORTABLE_CHILDREN=!1;var o=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?n.M_.EMPTY:((t=t||new n.M_(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var i=t.a,r=t.b,n=t.c,a=t.d,s=t.tx,o=t.ty,l=i*e.x+n*e.y+s,h=r*e.x+a*e.y+o;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)},t.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,a=t[0],s=t[1];e=ar?a:r,n=s>n?s:n,e=(a=t[2])r?a:r,n=s>n?s:n,e=(a=t[4])r?a:r,n=s>n?s:n,e=(a=t[6])r?a:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},t.prototype.addFrame=function(t,e,i,r,n){this.addFrameMatrix(t.worldTransform,e,i,r,n)},t.prototype.addFrameMatrix=function(t,e,i,r,n){var a=t.a,s=t.b,o=t.c,l=t.d,h=t.tx,u=t.ty,c=this.minX,p=this.minY,d=this.maxX,f=this.maxY,g=a*e+o*i+h,m=s*e+l*i+u;c=gd?g:d,f=m>f?m:f,c=(g=a*r+o*i+h)d?g:d,f=m>f?m:f,c=(g=a*e+o*n+h)d?g:d,f=m>f?m:f,c=(g=a*r+o*n+h)d?g:d,f=m>f?m:f,this.minX=c,this.minY=p,this.maxX=d,this.maxY=f},t.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,a=this.maxX,s=this.maxY,o=e;oa?l:a,s=h>s?h:s}this.minX=r,this.minY=n,this.maxX=a,this.maxY=s},t.prototype.addVertices=function(t,e,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)},t.prototype.addVerticesMatrix=function(t,e,i,r,n,a){void 0===n&&(n=0),void 0===a&&(a=n);for(var s=t.a,o=t.b,l=t.c,h=t.d,u=t.tx,c=t.ty,p=this.minX,d=this.minY,f=this.maxX,g=this.maxY,m=i;mr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXl?n:l,this.maxY=a>h?a:h}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXl?n:l,this.maxY=a>h?a:h}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,i,r,n,a){t-=n,e-=a,i+=n,r+=a,this.minX=this.minXi?this.maxX:i,this.minY=this.minYr?this.maxY:r},t}(),l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},l(t,e)};function h(t,e){function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var u=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new n.dL,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new o,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return h(e,t),e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);(0,a.removeItems)(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],i=0;i1)for(var r=0;r0&&n<=e){i=this.children.splice(r,n);for(var a=0;a1&&this.children.sort(p),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t0&&i.height>0){var r,n;if(this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==e.prototype._render&&(r=this.getBounds(!0)),r&&i.intersects(r,n))this._render(t);else if(this.cullArea)return;for(var a=0,s=this.children.length;a{"use strict";i.d(e,{A:()=>r,X:()=>s});var r,n=function(){return n=Object.assign||function(t){for(var e,i=arguments,r=1,n=arguments.length;r{"use strict";i.d(e,{A1:()=>U,Mp:()=>n,Sc:()=>N,Zw:()=>c,ie:()=>D,lU:()=>u,lo:()=>H,mk:()=>k,u2:()=>r});var r,n,a=i(1947),s=i(7239),o=i(3785),l=i(805),h=i(903);(function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"})(r||(r={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(n||(n={}));var u={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return ithis.maxSegments&&(i=this.maxSegments),i}},c=function(){function t(){this.color=16777215,this.alpha=1,this.texture=a.gP.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=a.gP.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},p(t,e)};function d(t,e){function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function f(t,e){var i,r;void 0===e&&(e=!1);var n=t.length;if(!(n<6)){for(var a=0,s=0,o=t[n-2],l=t[n-1];s0||e&&a<=0){var c=n/2;for(s=c+c%2;s=6){f(i,!1);for(var s=[],l=0;l=0&&o>=0&&r>=0&&n>=0){var f=Math.ceil(2.3*Math.sqrt(a+o)),g=8*f+(r?4:0)+(n?4:0);if(l.length=g,0!==g){if(0===f)return l.length=8,l[0]=l[6]=e+r,l[1]=l[3]=i+n,l[2]=l[4]=e-r,void(l[5]=l[7]=i-n);var m=0,A=4*f+(r?2:0)+2,v=A,y=g,_=e+(w=r+a),b=e-w,x=i+(P=n);if(l[m++]=_,l[m++]=x,l[--A]=x,l[--A]=b,n){var T=i-P;l[v++]=b,l[v++]=T,l[--y]=T,l[--y]=_}for(var E=1;Ec&&(c+=2*Math.PI);var p=u,d=c-u,f=Math.abs(d),g=Math.sqrt(l*l+h*h),m=1+(15*f*Math.sqrt(g)/Math.PI>>0),A=d/m;if(p+=A,o){s.push(t,e),s.push(i,r);for(var v=1,y=p;v=0&&(l.join===r.ROUND?v+=x(P,I,P-O*N,I-M*N,P-B*N,I-D*N,m,!1)+4:v+=2,m.push(P-B*F,I-D*F),m.push(P+B*N,I+D*N));else{var z=(-O+S)*(-M+I)-(-O+P)*(-M+w),q=(-B+R)*(-D+I)-(-B+P)*(-D+C),Q=(U*q-X*z)/V,Z=(j*z-H*q)/V,K=(Q-P)*(Q-P)+(Z-I)*(Z-I),J=P+(Q-P)*N,$=I+(Z-I)*N,tt=P-(Q-P)*F,et=I-(Z-I)*F,it=Y?N:F;K<=Math.min(U*U+H*H,X*X+j*j)+it*it*T?l.join===r.BEVEL||K/T>E?(Y?(m.push(J,$),m.push(P+O*F,I+M*F),m.push(J,$),m.push(P+B*F,I+D*F)):(m.push(P-O*N,I-M*N),m.push(tt,et),m.push(P-B*N,I-D*N),m.push(tt,et)),v+=2):l.join===r.ROUND?Y?(m.push(J,$),m.push(P+O*F,I+M*F),v+=x(P,I,P+O*F,I+M*F,P+B*F,I+D*F,m,!0)+4,m.push(J,$),m.push(P+B*F,I+D*F)):(m.push(P-O*N,I-M*N),m.push(tt,et),v+=x(P,I,P-O*N,I-M*N,P-B*N,I-D*N,m,!1)+4,m.push(P-B*N,I-D*N),m.push(tt,et)):(m.push(J,$),m.push(tt,et)):(m.push(P-O*N,I-M*N),m.push(P+O*F,I+M*F),l.join===r.ROUND?v+=Y?x(P,I,P+O*F,I+M*F,P+B*F,I+D*F,m,!0)+2:x(P,I,P-O*N,I-M*N,P-B*N,I-D*N,m,!1)+2:l.join===r.MITER&&K/T<=E&&(Y?(m.push(tt,et),m.push(tt,et)):(m.push(J,$),m.push(J,$)),v+=2),m.push(P-B*N,I-D*N),m.push(P+B*F,I+D*F),v+=2)}}S=a[2*(A-2)],w=a[2*(A-2)+1],P=a[2*(A-1)],O=-(w-(I=a[2*(A-1)+1])),M=S-P,O/=L=Math.sqrt(O*O+M*M),M/=L,O*=_,M*=_,m.push(P-O*N,I-M*N),m.push(P+O*F,I+M*F),p||(l.cap===n.ROUND?v+=x(P-O*(N-F)*.5,I-M*(N-F)*.5,P-O*N,I-M*N,P+O*F,I+M*F,m,!1)+2:l.cap===n.SQUARE&&(v+=b(P,I,O,M,N,F,!1,m)));var rt=e.indices,nt=u.epsilon*u.epsilon;for(G=y;Gu*o}},t.arc=function(t,e,i,r,n,a,o,l,h){for(var c=o-a,p=u._segmentsCount(Math.abs(c)*n,40*Math.ceil(Math.abs(c)/s.TO)),d=c/(2*p),f=2*d,g=Math.cos(d),m=Math.sin(d),A=p-1,v=A%1/A,y=0;y<=A;++y){var _=d+a+f*(y+v*y),b=Math.cos(_),x=-Math.sin(_);h.push((g*b+m*x)*n+i,(g*-x+m*b)*n+r)}},t}(),I=function(){function t(){}return t.curveLength=function(t,e,i,r,n,a,s,o){for(var l=10,h=0,u=0,c=0,p=0,d=0,f=0,g=0,m=0,A=0,v=0,y=0,_=t,b=e,x=1;x<=l;++x)v=_-(m=(g=(f=(d=1-(u=x/l))*d)*d)*t+3*f*u*i+3*d*(c=u*u)*n+(p=c*u)*s),y=b-(A=g*e+3*f*u*r+3*d*c*a+p*o),_=m,b=A,h+=Math.sqrt(v*v+y*y);return h},t.curveTo=function(e,i,r,n,a,s,o){var l=o[o.length-2],h=o[o.length-1];o.length-=2;var c=u._segmentsCount(t.curveLength(l,h,e,i,r,n,a,s)),p=0,d=0,f=0,g=0,m=0;o.push(l,h);for(var A=1,v=0;A<=c;++A)f=(d=(p=1-(v=A/c))*p)*p,m=(g=v*v)*v,o.push(f*l+3*d*v*e+3*p*g*r+m*a,f*h+3*d*v*i+3*p*g*n+m*s)},t}(),R=function(){function t(){}return t.curveLength=function(t,e,i,r,n,a){var s=t-2*i+n,o=e-2*r+a,l=2*i-2*t,h=2*r-2*e,u=4*(s*s+o*o),c=4*(s*l+o*h),p=l*l+h*h,d=2*Math.sqrt(u+c+p),f=Math.sqrt(u),g=2*u*f,m=2*Math.sqrt(p),A=c/f;return(g*d+f*c*(d-m)+(4*p*u-c*c)*Math.log((2*f+A+d)/(A+m)))/(4*g)},t.curveTo=function(e,i,r,n,a){for(var s=a[a.length-2],o=a[a.length-1],l=u._segmentsCount(t.curveLength(s,o,e,i,r,n)),h=0,c=0,p=1;p<=l;++p){var d=p/l;h=s+(e-s)*d,c=o+(i-o)*d,a.push(h+(e+(r-e)*d-h)*d,c+(i+(n-i)*d-c)*d)}},t}(),C=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),O=((w={})[s.HY.POLY]=g,w[s.HY.CIRC]=m,w[s.HY.ELIP]=m,w[s.HY.RECT]=A,w[s.HY.RREC]=_,w),M=[],B=[],D=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),L=new s.bR,k=function(t){function e(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new h.cz,e.boundsDirty=-1,e}return d(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null);var n=new D(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new D(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e0&&(r=(i=this.batches[this.batches.length-1]).style);for(var n=this.shapeIndex;n65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&A===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=A?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,i=0;i0&&((n=B.pop())||((n=new a.hq).texArray=new a.cc),this.drawCalls.push(n)),n.start=p,n.size=0,n.texArray.count=0,n.type=c),m.touched=1,m._batchEnabled=t,m._batchLocation=s,m.wrapMode=l.uR.REPEAT,n.texArray.elements[n.texArray.count++]=m,s++)),n.size+=d.size,p+=d.size,h=m._batchLocation,this.addColors(i,g.color,g.alpha,d.attribSize,d.attribStart),this.addTextureIds(r,h,d.attribSize,d.attribStart)}a.t5._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,n=new ArrayBuffer(3*t.length*4),a=new Float32Array(n),s=new Uint32Array(n),o=0,l=0;l>16)+(65280&e)+((255&e)<<16),s=(0,o.premultiplyTint)(a,i);t.length=Math.max(t.length,n+r);for(var l=0;l0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new s.tS,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new s.tS,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),R.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,a){return this._initCurve(),I.curveTo(t,e,i,r,n,a,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var a=this.currentPath.points,s=P.curveTo(t,e,i,r,n,a);if(s){var o=s.cx,l=s.cy,h=s.radius,u=s.startAngle,c=s.endAngle,p=s.anticlockwise;this.arc(o,l,h,u,c,p)}return this},e.prototype.arc=function(t,e,i,r,n,a){if(void 0===a&&(a=!1),r===n)return this;if(!a&&n<=r?n+=s.TO:a&&r<=n&&(r+=s.TO),0===n-r)return this;var o=t+Math.cos(r)*i,l=e+Math.sin(r)*i,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var c=Math.abs(u[u.length-2]-o),p=Math.abs(u[u.length-1]-l);c0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new s.M_(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new s.TE(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new s.jl(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new s.Pp(t,e,i,r))},e.prototype.drawPolygon=function(){for(var t,e=arguments,i=[],r=0;r>16&255)/255*n,a.tint[1]=(r>>8&255)/255*n,a.tint[2]=(255&r)/255*n,a.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var o=0,l=s.length;o>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,a=e.d,s=e.tx,o=e.ty,l=this._geometry.points,h=this.vertexData,u=0,c=0;c{"use strict";i.d(e,{ER:()=>E,HY:()=>r,M_:()=>h,Pp:()=>c,TE:()=>d,TO:()=>n,Td:()=>s,bO:()=>a,bR:()=>o,dL:()=>S,jl:()=>u,oA:()=>f,tS:()=>p,uq:()=>g});var r,n=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"})(r||(r={}));var o=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),l=[new o,new o,new o,new o],h=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(n),this.type=r.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&et.right?t.right:this.right)<=i)return!1;var r=this.yt.bottom?t.bottom:this.bottom)>r}var n=this.left,a=this.right,s=this.top,o=this.bottom;if(a<=n||o<=s)return!1;var h=l[0].set(t.left,t.top),u=l[1].set(t.left,t.bottom),c=l[2].set(t.right,t.top),p=l[3].set(t.right,t.bottom);if(c.x<=h.x||u.y<=h.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d)return!1;if(e.apply(h,h),e.apply(u,u),e.apply(c,c),e.apply(p,p),Math.max(h.x,u.x,c.x,p.x)<=n||Math.min(h.x,u.x,c.x,p.x)>=a||Math.max(h.y,u.y,c.y,p.y)<=s||Math.min(h.y,u.y,c.y,p.y)>=o)return!1;var f=d*(u.y-h.y),g=d*(h.x-u.x),m=f*n+g*s,A=f*a+g*s,v=f*n+g*o,y=f*a+g*o;if(Math.max(m,A,v,y)<=f*h.x+g*h.y||Math.min(m,A,v,y)>=f*p.x+g*p.y)return!1;var _=d*(h.y-c.y),b=d*(c.x-h.x),x=_*n+b*s,T=_*a+b*s,E=_*n+b*o,S=_*a+b*o;return!(Math.max(x,T,E,S)<=_*h.x+b*h.y||Math.min(x,T,E,S)>=_*p.x+b*p.y)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),u=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.radius=i,this.type=r.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,r=this.x-t,n=this.y-e;return(r*=r)+(n*=n)<=i},t.prototype.getBounds=function(){return new h(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},t}(),c=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n,this.type=r.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,r=(e-this.y)/this.height;return(i*=i)+(r*=r)<=1},t.prototype.getBounds=function(){return new h(this.x-this.width,this.y-this.height,this.width,this.height)},t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),p=function(){function t(){for(var t=arguments,e=[],i=0;ie!=h>e&&t<(e-o)/(h-o)*(l-s)+s&&(i=!i)}return i},t.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(t,e){return t+", "+e}),"")+"]"},t}(),d=function(){function t(t,e,i,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=20),this.x=t,this.y=e,this.width=i,this.height=n,this.radius=a,this.type=r.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;var r=t-(this.x+i),n=e-(this.y+i),a=i*i;if(r*r+n*n<=a)return!0;if((r=t-(this.x+this.width-i))*r+n*n<=a)return!0;if(r*r+(n=e-(this.y+this.height-i))*n<=a)return!0;if((r=t-(this.x+i))*r+n*n<=a)return!0}return!1},t.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},t}(),f=function(){function t(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this._x=i,this._y=r,this.cb=t,this.scope=e}return t.prototype.clone=function(e,i){return void 0===e&&(e=this.cb),void 0===i&&(i=this.scope),new t(e,i,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),g=function(){function t(t,e,i,r,n,a){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===a&&(a=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=a}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,i,r,n,a){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=a,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},t.prototype.apply=function(t,e){e=e||new o;var i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new o;var i=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*i*r+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.a,n=this.c,a=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=a*e-this.ty*i,this.ty=a*i+this.ty*e,this},t.prototype.append=function(t){var e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,i,r,n,a,s,o,l){return this.a=Math.cos(s+l)*n,this.b=Math.sin(s+l)*n,this.c=-Math.sin(s-o)*a,this.d=Math.cos(s-o)*a,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,i=this.b,r=this.c,a=this.d,s=t.pivot,o=-Math.atan2(-r,a),l=Math.atan2(i,e),h=Math.abs(o+l);return h<1e-5||Math.abs(n-h)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=l),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(r*r+a*a),t.position.x=this.tx+(s.x*e+s.y*r),t.position.y=this.ty+(s.x*i+s.y*a),t},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,a=t*r-e*i;return this.a=r/a,this.b=-e/a,this.c=-i/a,this.d=t/a,this.tx=(i*this.ty-r*n)/a,this.ty=-(t*this.ty-e*n)/a,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],A=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],v=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],y=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],_=[],b=[],x=Math.sign;function T(){for(var t=0;t<16;t++){var e=[];_.push(e);for(var i=0;i<16;i++)for(var r=x(m[t]*m[i]+v[t]*A[i]),n=x(A[t]*m[i]+y[t]*A[i]),a=x(m[t]*v[i]+v[t]*y[i]),s=x(A[t]*v[i]+y[t]*y[i]),o=0;o<16;o++)if(m[o]===r&&A[o]===n&&v[o]===a&&y[o]===s){e.push(o);break}}for(t=0;t<16;t++){var l=new g;l.set(m[t],A[t],v[t],y[t],0,0),b.push(l)}}T();var E={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return m[t]},uY:function(t){return A[t]},vX:function(t){return v[t]},vY:function(t){return y[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return _[t][e]},sub:function(t,e){return _[t][E.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?E.S:E.N:2*Math.abs(e)<=Math.abs(t)?t>0?E.E:E.W:e>0?t>0?E.SE:E.SW:t>0?E.NE:E.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=b[E.inv(e)];n.tx=i,n.ty=r,t.append(n)}},S=function(){function t(){this.worldTransform=new g,this.localTransform=new g,this.position=new f(this.onChange,this,0,0),this.scale=new f(this.onChange,this,1,1),this.pivot=new f(this.onChange,this,0,0),this.skew=new f(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}()},2365:(t,e,i)=>{"use strict";i.d(e,{Bq:()=>h,D8:()=>u,F_:()=>f,bd:()=>l,g:()=>p,js:()=>c});var r=i(2551),n=i(805),a=i(1947),s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},s(t,e)};function o(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var l=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10);var a=t.call(this)||this;return a.segWidth=r,a.segHeight=n,a.width=e,a.height=i,a.build(),a}return o(e,t),e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,a=this.segHeight-1,s=this.width/n,o=this.height/a,l=0;l0){var p=o.x-t[u].x,d=o.y-t[u].y,f=Math.sqrt(p*p+d*d);o=t[u],s+=f/l}else s=u/(h-1);n[c]=s,n[c+1]=0,n[c+2]=s,n[c+3]=1}var g=0;for(u=0;u0?this.textureScale*this._width/2:this._width/2;r/=u,n/=u,r*=c,n*=c,a[h]=l.x+r,a[h+1]=l.y+n,a[h+2]=l.x-r,a[h+3]=l.y-n,i=l}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(r.u),u=function(t){function e(e,i,a){void 0===a&&(a=0);var s=this,o=new h(e.height,i,a),l=new r.PX(e);return a>0&&(e.baseTexture.wrapMode=n.uR.REPEAT),(s=t.call(this,o,l)||this).autoUpdate=!0,s}return o(e,t),e.prototype._render=function(e){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),t.prototype._render.call(this,e)},e}(r.e),c=function(t){function e(e,i,n){var s=this,o=new l(e.width,e.height,i,n),h=new r.PX(a.gP.WHITE);return(s=t.call(this,o,h)||this).texture=e,s.autoResize=!0,s}return o(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,i=e.width,r=e.height;!this.autoResize||t.width===i&&t.height===r||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(r.e),p=function(t){function e(e,i,n,s,o){void 0===e&&(e=a.gP.EMPTY);var l=this,h=new r.u(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new r.PX(e);return(l=t.call(this,h,u,null,o)||this).autoUpdate=!0,l}return o(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(r.e),d=10,f=function(t){function e(e,i,r,n,s){void 0===i&&(i=d),void 0===r&&(r=d),void 0===n&&(n=d),void 0===s&&(s=d);var o=t.call(this,a.gP.WHITE,4,4)||this;return o._origWidth=e.orig.width,o._origHeight=e.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=i,o._rightWidth=n,o._topHeight=r,o._bottomHeight=s,o.texture=e,o}return o(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,r=this._height>i?1:this._height/i;return Math.min(e,r)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(c)},2551:(t,e,i)=>{"use strict";i.d(e,{PX:()=>A,e:()=>f,iM:()=>c,u:()=>v});var r=i(1947),n=i(7239),a=i(805),s=i(903),o=i(9615),l=i(3785),h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},h(t,e)};function u(t,e){function i(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var c=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),p=new n.bR,d=new n.tS,f=function(t){function e(e,i,n,s){void 0===s&&(s=a._4.TRIANGLES);var l=t.call(this)||this;return l.geometry=e,l.shader=i,l.state=n||r.Uw.for2d(),l.drawMode=s,l.start=0,l.size=0,l.uvs=null,l.indices=null,l.vertexData=new Float32Array(1),l.vertexDirty=-1,l._transformID=-1,l._roundPixels=o.W0.ROUND_PIXELS,l.batchUvs=null,l}return u(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===a._4.TRIANGLES&&i.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;var r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry.buffers[0],e=t.data,i=t._updateID;if(i!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var r=this.transform.worldTransform,n=r.a,a=r.b,s=r.c,l=r.d,h=r.tx,u=r.ty,c=this.vertexData,p=0;p>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;(0,l.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(r.Mt),v=function(t){function e(e,i,n){var s=t.call(this)||this,o=new r.hp(e),l=new r.hp(i,!0),h=new r.hp(n,!0,!0);return s.addAttribute("aVertexPosition",o,2,!1,a.QE.FLOAT).addAttribute("aTextureCoord",l,2,!1,a.QE.FLOAT).addIndex(h),s._updateId=-1,s}return u(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(r.V2)},1571:(t,e,i)=>{"use strict";i.d(e,{e:()=>f,w:()=>u});var r=i(805),n=i(903),a=i(3785),s=i(1947),o=i(7239),l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},l(t,e)};function h(t,e){function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var u=function(t){function e(e,i,n,a){void 0===e&&(e=1500),void 0===n&&(n=16384),void 0===a&&(a=!1);var s=t.call(this)||this,o=16384;return n>o&&(n=o),s._properties=[!1,!0,!1,!1,!1],s._maxSize=e,s._batchSize=n,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=r.B9.NORMAL,s.autoResize=a,s.roundPixels=!0,s.baseTexture=null,s.setProperties(i),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return h(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,(0,a.hex2rgb)(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(s=i);var o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));var l=e[0]._texture.baseTexture,h=l.alphaMode>0;this.state.blendMode=(0,a.correctBlendMode)(t.blendMode,h),n.state.set(this.state);var u=n.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=(0,a.premultiplyRgba)(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h),this.shader.uniforms.uSampler=l,this.renderer.shader.bind(this.shader);for(var p=!1,d=0,f=0;dr&&(g=r),f>=o.length&&o.push(this._generateOneMoreBuffer(t));var m=o[f];m.uploadDynamic(e,d,g);var A=t._bufferUpdateIDs[f]||0;(p=p||m._updateID0,u=l.alpha,c=u<1&&h?(0,a.premultiplyTint)(l._tintRGB,u):l._tintRGB+(255*u<<24);r[s]=c,r[s+n]=c,r[s+2*n]=c,r[s+3*n]=c,s+=4*n}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e.extension={name:"particle",type:s.Ag.RendererPlugin},e}(s.Pt)},1605:(t,e,i)=>{"use strict";i.d(e,{It:()=>p,Ls:()=>_,oP:()=>S,p8:()=>E});var r=i(9615),n=i(1947),a=i(5871),s=i(4775),o=i(903),l=i(8723),h=i(3785);r.W0.UPLOADS_PER_FRAME=4;var u=function(t,e){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},u(t,e)};function c(t,e){function i(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var p=function(){function t(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function d(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&s.Rv.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function b(t,e){return e instanceof n.t5&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function x(t,e){if(!(e instanceof a.A1))return!1;var i=e.geometry;e.finishPoly(),i.updateBatches();for(var r=i.batches,n=0;n{"use strict";i.d(e,{b:()=>r});var r=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,i,r,n,a,s,o){if(arguments.length>8)throw new Error("max arguments reached");var l=this,h=l.name,u=l.items;this._aliasCount++;for(var c=0,p=u.length;c0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(r.prototype,{dispatch:{value:r.prototype.emit},run:{value:r.prototype.emit}})},9615:(t,e,i)=>{"use strict";i.d(e,{Fr:()=>T,OF:()=>n,W0:()=>w});var r=i(805),n={createCanvas:function(t,e){var i=document.createElement("canvas");return i.width=t,i.height=e,i},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var t;return null!==(t=document.baseURI)&&void 0!==t?t:window.location.href},fetch:function(t,e){return fetch(t,e)}},a=/iPhone/i,s=/iPod/i,o=/iPad/i,l=/\biOS-universal(?:.+)Mac\b/i,h=/\bAndroid(?:.+)Mobile\b/i,u=/Android/i,c=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,p=/Silk/i,d=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,g=/BlackBerry/i,m=/BB10/i,A=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,y=/Mobile(?:.+)Firefox\b/i,_=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function b(t){return function(e){return e.test(t)}}function x(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var i=e.userAgent,r=i.split("[FBAN");void 0!==r[1]&&(i=r[0]),void 0!==(r=i.split("Twitter"))[1]&&(i=r[0]);var n=b(i),x={apple:{phone:n(a)&&!n(d),ipod:n(s),tablet:!n(a)&&(n(o)||_(e))&&!n(d),universal:n(l),device:(n(a)||n(s)||n(o)||n(l)||_(e))&&!n(d)},amazon:{phone:n(c),tablet:!n(c)&&n(p),device:n(c)||n(p)},android:{phone:!n(d)&&n(c)||!n(d)&&n(h),tablet:!n(d)&&!n(c)&&!n(h)&&(n(p)||n(u)),device:!n(d)&&(n(c)||n(p)||n(h)||n(u))||n(/\bokhttp\b/i)},windows:{phone:n(d),tablet:n(f),device:n(d)||n(f)},other:{blackberry:n(g),blackberry10:n(m),opera:n(A),firefox:n(y),chrome:n(v),device:n(g)||n(m)||n(A)||n(y)||n(v)},any:!1,phone:!1,tablet:!1};return x.any=x.apple.device||x.android.device||x.windows.device||x.other.device,x.phone=x.apple.phone||x.android.phone||x.windows.phone,x.tablet=x.apple.tablet||x.android.tablet||x.windows.tablet,x}var T=x(globalThis.navigator);function E(){return!T.apple.device}function S(t){var e=!0;if(T.tablet||T.phone){var i;if(T.apple.device)if(i=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(i[1],10)<11&&(e=!1);if(T.android.device)if(i=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(i[1],10)<7&&(e=!1)}return e?t:4}var w={ADAPTER:n,MIPMAP_TEXTURES:r.E8.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:r.he.NONE,SPRITE_MAX_TEXTURES:S(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:r.OS.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:r.uR.CLAMP,SCALE_MODE:r.M6.LINEAR,PRECISION_VERTEX:r.Pk.HIGH,PRECISION_FRAGMENT:T.apple.device?r.Pk.HIGH:r.Pk.MEDIUM,CAN_UPLOAD_SAME_BUFFER:E(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},3481:(t,e,i)=>{"use strict";i.d(e,{_:()=>v,t:()=>c});var r=i(1947),n=i(7239),a=i(511),s=i(805),o=i(3785),l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},l(t,e)};function h(t,e){function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var u=new n.bR,c=function(t){function e(e,i,a){void 0===i&&(i=100),void 0===a&&(a=100);var s=t.call(this,e)||this;return s.tileTransform=new n.dL,s._width=i,s._height=a,s.uvMatrix=s.texture.uvMatrix||new r.NW(e),s.pluginName="tilingSprite",s.uvRespectAnchor=!1,s}return h(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,i,r)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new n.M_),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e=this._width,i=this._height,r=-e*this.anchor._x;if(u.x>=r&&u.x=n&&u.y1?r.Mt.from(g,m,e):r.Mt.from(d,f,e)},e.prototype.render=function(t){var e=this.renderer,i=this.quad,r=i.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y);var n=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;(r=i.uvs)[0]=r[6]=-n,r[1]=r[3]=-a,r[2]=r[4]=1-n,r[5]=r[7]=1-a,i.invalidate();var l=t._texture,h=l.baseTexture,u=h.alphaMode>0,c=t.tileTransform.localTransform,p=t.uvMatrix,d=h.isPowerOfTwo&&l.frame.width===h.width&&l.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==s.uR.CLAMP:h.wrapMode===s.uR.CLAMP&&(h.wrapMode=s.uR.REPEAT));var f=d?this.simpleShader:this.shader,g=l.width,m=l.height,v=t._width,y=t._height;A.set(c.a*g/v,c.b*g/y,c.c*m/v,c.d*m/y,c.tx/v,c.ty/y),A.invert(),d?A.prepend(p.mapCoord):(f.uniforms.uMapCoord=p.mapCoord.toArray(!0),f.uniforms.uClampFrame=p.uClampFrame,f.uniforms.uClampOffset=p.uClampOffset),f.uniforms.uTransform=A.toArray(!0),f.uniforms.uColor=(0,o.premultiplyTintToRgba)(t.tint,t.worldAlpha,f.uniforms.uColor,u),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=l,e.shader.bind(f),e.geometry.bind(i),this.state.blendMode=(0,o.correctBlendMode)(t.blendMode,u),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:r.Ag.RendererPlugin},e}(r.Pt)},511:(t,e,i)=>{"use strict";i.d(e,{k:()=>d});var r=i(805),n=i(1947),a=i(903),s=i(7239),o=i(9615),l=i(3785),h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},h(t,e)};function u(t,e){function i(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var c=new s.bR,p=new Uint16Array([0,1,2,0,2,3]),d=function(t){function e(e){var i=t.call(this)||this;return i._anchor=new s.oA(i._onAnchorUpdate,i,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=r.B9.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=e||n.gP.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=p,i.pluginName="batch",i.isSprite=!0,i._roundPixels=o.W0.ROUND_PIXELS,i}return u(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=(0,l.sign)(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=(0,l.sign)(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,a=e.d,s=e.tx,l=e.ty,h=this.vertexData,u=t.trim,c=t.orig,p=this._anchor,d=0,f=0,g=0,m=0;if(u?(d=(f=u.x-p._x*c.width)+u.width,g=(m=u.y-p._y*c.height)+u.height):(d=(f=-p._x*c.width)+c.width,g=(m=-p._y*c.height)+c.height),h[0]=i*f+n*m+s,h[1]=a*m+r*f+l,h[2]=i*d+n*m+s,h[3]=a*m+r*d+l,h[4]=i*d+n*g+s,h[5]=a*g+r*d+l,h[6]=i*f+n*g+s,h[7]=a*g+r*f+l,this._roundPixels)for(var A=o.W0.RESOLUTION,v=0;v=r&&c.x=n&&c.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||n.gP.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(a.mc)},8723:(t,e,i)=>{"use strict";i.d(e,{EY:()=>b,T:()=>r,Z1:()=>y,xJ:()=>d});var r,n=i(511),a=i(1947),s=i(9615),o=i(7239),l=i(3785),h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},h(t,e)};function u(t,e){function i(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(r||(r={}));var c={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:r.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},p=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],d=function(){function t(t){this.styleID=0,this.reset(),A(this,t,t)}return t.prototype.clone=function(){var e={};return A(e,this,c),new t(e)},t.prototype.reset=function(){A(this,c,c)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=g(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=g(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){m(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=g(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var i=e.length-1;i>=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&p.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function f(t){return"number"==typeof t?(0,l.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function g(t){if(Array.isArray(t)){for(var e=0;ef)if(""!==s&&(o+=t.addLine(s),s="",a=0),t.canBreakWords(A,i.breakWords))for(var x=t.wordWrapSplit(A),T=0;Tf&&(o+=t.addLine(s),d=!1,s="",a=0),s+=E,a+=I}else{s.length>0&&(o+=t.addLine(s),s="",a=0);var R=m===g.length-1;o+=t.addLine(A,!R),d=!1,s="",a=0}else b+a>f&&(d=!1,o+=t.addLine(s),s="",a=0),(s.length>0||!t.isBreakingSpace(A)||d)&&(s+=A,a+=b)}return o+=t.addLine(s,!1)},t.addLine=function(e,i){return void 0===i&&(i=!0),e=t.trimRight(e),e=i?e+"\n":e},t.getFromCache=function(t,e,i,r){var n=i[t];if("number"!=typeof n){var a=t.length*e;n=r.measureText(t).width+a,i[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var i=e.length-1;i>=0;i--){var r=e[i];if(!t.isBreakingSpace(r))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,i){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var i=[],r="";if("string"!=typeof e)return i;for(var n=0;no;--p){for(g=0;g0&&g>m&&(A=(m+g)/2);var v=m+f,y=i.lineHeight*(d+1),_=v;d+1{"use strict";i.d(e,{Rv:()=>o,dQ:()=>r,y:()=>l});var r,n=i(9615),a=i(6919);n.W0.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(r||(r={}));var s=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=0),void 0===r&&(r=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=r}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),o=function(){function t(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new s(null,null,1/0),this.deltaMS=1/n.W0.TARGET_FPMS,this.elapsedMS=1/n.W0.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,i){return void 0===i&&(i=r.NORMAL),this._addListener(new s(t,e,i))},t.prototype.addOnce=function(t,e,i){return void 0===i&&(i=r.NORMAL),this._addListener(new s(t,e,i,!0))},t.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i{"use strict";i.r(e),i.d(e,{BaseTextureCache:()=>z,CanvasRenderTarget:()=>Z,DATA_URI:()=>$,EventEmitter:()=>n,ProgramCache:()=>V,TextureCache:()=>Y,clearTextureCache:()=>Q,correctBlendMode:()=>I,createIndicesForQuads:()=>M,decomposeDataUri:()=>tt,deprecation:()=>W,destroyTextureCache:()=>q,determineCrossOrigin:()=>et,earcut:()=>a,getBufferType:()=>B,getResolutionOfUrl:()=>it,hex2rgb:()=>x,hex2string:()=>T,interleaveTypedArrays:()=>L,isMobile:()=>r.Fr,isPow2:()=>N,isWebGLSupported:()=>_,log2:()=>F,nextPow2:()=>k,path:()=>f,premultiplyBlendMode:()=>P,premultiplyRgba:()=>R,premultiplyTint:()=>C,premultiplyTintToRgba:()=>O,removeItems:()=>G,rgb2hex:()=>S,sayHello:()=>y,sign:()=>U,skipHello:()=>v,string2hex:()=>E,trimCanvas:()=>K,uid:()=>X,url:()=>l});var r=i(9615),n=i(9846),a=i(2840),s=i(3241),o=i(805),l={parse:s.qg,format:s.GP,resolve:s.hd};function h(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function u(t){return t.split("?")[0].split("#")[0]}function c(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(t,e,i){return t.replace(new RegExp(c(e),"g"),i)}function d(t,e){for(var i,r="",n=0,a=-1,s=0,o=0;o<=t.length;++o){if(o2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",n=0):n=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=o,s=0;continue}}else if(2===r.length||1===r.length){r="",n=0,a=o,s=0;continue}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+t.slice(a+1,o):r=t.slice(a+1,o),n=o-a-1;a=o,s=0}else 46===i&&-1!==s?++s:s=-1}return r}var f={toPosix:function(t){return p(t,"\\","/")},isUrl:function(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:function(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},hasProtocol:function(t){return/^[^/:]+:\//.test(this.toPosix(t))},getProtocol:function(t){h(t),t=this.toPosix(t);var e="",i=/^file:\/\/\//.exec(t),r=/^[^/:]+:\/\//.exec(t),n=/^[^/:]+:\//.exec(t);if(i||r||n){var a=(null==i?void 0:i[0])||(null==r?void 0:r[0])||(null==n?void 0:n[0]);e=a,t=t.slice(a.length)}return e},toAbsolute:function(t,e,i){if(this.isDataUrl(t))return t;var n=u(this.toPosix(null!=e?e:r.W0.ADAPTER.getBaseUrl())),a=u(this.toPosix(null!=i?i:this.rootname(n)));return h(t),(t=this.toPosix(t)).startsWith("/")?f.join(a,t.slice(1)):this.isAbsolute(t)?t:this.join(n,t)},normalize:function(t){if(h(t=this.toPosix(t)),0===t.length)return".";var e="",i=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));var r=t.endsWith("/");return(t=d(t,!1)).length>0&&r&&(t+="/"),i?"/"+t:e+t},isAbsolute:function(t){return h(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join:function(){for(var t,e,i=arguments,r=[],n=0;n0)if(void 0===e)e=s;else{var o=null!==(t=r[a-1])&&void 0!==t?t:"";this.extname(o)?e+="/../"+s:e+="/"+s}}return void 0===e?".":this.normalize(e)},dirname:function(t){if(h(t),0===t.length)return".";for(var e=(t=this.toPosix(t)).charCodeAt(0),i=47===e,r=-1,n=!0,a=this.getProtocol(t),s=t,o=(t=t.slice(a.length)).length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!n){r=o;break}}else n=!1;return-1===r?i?"/":this.isUrl(s)?a+t:a:i&&1===r?"//":a+t.slice(0,r)},rootname:function(t){h(t);var e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){var i=t.indexOf("/",e.length);(e=-1!==i?t.slice(0,i):t).endsWith("/")||(e+="/")}return e},basename:function(t,e){h(t),e&&h(e),t=this.toPosix(t);var i,r=0,n=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,o=-1;for(i=t.length-1;i>=0;--i){var l=t.charCodeAt(i);if(47===l){if(!a){r=i+1;break}}else-1===o&&(a=!1,o=i+1),s>=0&&(l===e.charCodeAt(s)?-1==--s&&(n=i):(s=-1,n=o))}return r===n?n=o:-1===n&&(n=t.length),t.slice(r,n)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!a){r=i+1;break}}else-1===n&&(a=!1,n=i+1);return-1===n?"":t.slice(r,n)},extname:function(t){h(t);for(var e=-1,i=0,r=-1,n=!0,a=0,s=(t=this.toPosix(t)).length-1;s>=0;--s){var o=t.charCodeAt(s);if(47!==o)-1===r&&(n=!1,r=s+1),46===o?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!n){i=s+1;break}}return-1===e||-1===r||0===a||1===a&&e===r-1&&e===i+1?"":t.slice(e,r)},parse:function(t){h(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var i,r=(t=this.toPosix(t)).charCodeAt(0),n=this.isAbsolute(t);e.root=this.rootname(t),i=n||this.hasProtocol(t)?1:0;for(var a=-1,s=0,o=-1,l=!0,u=t.length-1,c=0;u>=i;--u)if(47!==(r=t.charCodeAt(u)))-1===o&&(l=!1,o=u+1),46===r?-1===a?a=u:1!==c&&(c=1):-1!==a&&(c=-1);else if(!l){s=u+1;break}return-1===a||-1===o||0===c||1===c&&a===o-1&&a===s+1?-1!==o&&(e.base=e.name=0===s&&n?t.slice(1,o):t.slice(s,o)):(0===s&&n?(e.name=t.slice(1,a),e.base=t.slice(1,o)):(e.name=t.slice(s,a),e.base=t.slice(s,o)),e.ext=t.slice(a,o)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"};r.W0.RETINA_PREFIX=/@([0-9\.]+)x/,r.W0.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var g,m=!1,A="6.5.10";function v(){m=!0}function y(t){var e;if(!m){if(r.W0.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var i=["\n %c %c %c PixiJS "+A+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,i)}else globalThis.console&&globalThis.console.log("PixiJS "+A+" - "+t+" - http://www.pixijs.com/");m=!0}}function _(){return void 0===g&&(g=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:r.W0.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!r.W0.ADAPTER.getWebGLRenderingContext())return!1;var e=r.W0.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!(!i||!i.getContextAttributes().stencil);if(i){var a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,n}catch(s){return!1}}()),g}var b={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function x(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function T(t){var e=t.toString(16);return"#"+(e="000000".substring(0,6-e.length)+e)}function E(t){return"string"==typeof t&&"#"===(t=b[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}function S(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}function w(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[o.B9.NORMAL_NPM]=o.B9.NORMAL,t[o.B9.ADD_NPM]=o.B9.ADD,t[o.B9.SCREEN_NPM]=o.B9.SCREEN,e[o.B9.NORMAL]=o.B9.NORMAL_NPM,e[o.B9.ADD]=o.B9.ADD_NPM,e[o.B9.SCREEN]=o.B9.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}var P=w();function I(t,e){return P[e?1:0][t]}function R(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function C(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function O(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function M(t,e){void 0===e&&(e=null);var i=6*t;if((e=e||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+i);for(var r=0,n=0;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function N(t){return!(t&t-1||!t)}function F(t){var e=(t>65535?1:0)<<4,i=((t>>>=e)>255?1:0)<<3;return e|=i,e|=i=((t>>>=i)>15?1:0)<<2,(e|=i=((t>>>=i)>3?1:0)<<1)|(t>>>=i)>>1}function G(t,e,i){var r,n=t.length;if(!(e>=n||0===i)){var a=n-(i=e+i>n?n-e:i);for(r=e;r{"use strict";function r(t){var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){return e.reject(i)}))}))}i.r(e),i.d(e,{ALPHA_MODES:()=>et.Gk,AbstractBatchRenderer:()=>O.SD,AbstractMultiResource:()=>O.CI,AbstractRenderer:()=>O.kp,AccessibilityManager:()=>X,AnimatedSprite:()=>zi,AppLoaderPlugin:()=>Pt,Application:()=>Hi,ArrayResource:()=>O.aV,Attribute:()=>O.nW,BLEND_MODES:()=>et.B9,BUFFER_BITS:()=>et.wn,BUFFER_TYPE:()=>et.yw,BaseImageResource:()=>O.jH,BasePrepare:()=>Be.Ls,BaseRenderTexture:()=>O.LE,BaseTexture:()=>O.t5,BatchDrawCall:()=>O.hq,BatchGeometry:()=>O.JH,BatchPluginFactory:()=>O.oA,BatchRenderer:()=>O.ch,BatchShaderGenerator:()=>O.LQ,BatchSystem:()=>O.A6,BatchTextureArray:()=>O.cc,BitmapFont:()=>Je,BitmapFontData:()=>He,BitmapFontLoader:()=>ai,BitmapText:()=>ni,BlobResource:()=>jt,Bounds:()=>C.cz,BrowserAdapter:()=>Lt.OF,Buffer:()=>O.hp,BufferResource:()=>O.dZ,CLEAR_MODES:()=>et.fr,COLOR_MASK_BITS:()=>et.Eq,CanvasResource:()=>O.Bu,Circle:()=>j.jl,CompressedTextureLoader:()=>Vt,CompressedTextureResource:()=>Wt,Container:()=>C.mc,ContextSystem:()=>O.bD,CountLimiter:()=>Be.It,CubeResource:()=>O.WQ,DDSLoader:()=>Ce,DEG_TO_RAD:()=>j.Td,DRAW_MODES:()=>et._4,DisplayObject:()=>C.q9,ENV:()=>et.Km,Ellipse:()=>j.Pp,ExtensionType:()=>O.Ag,Extract:()=>nt,FORMATS:()=>et.hR,FORMATS_TO_COMPONENTS:()=>Ee,FillStyle:()=>Xi.Zw,Filter:()=>O.dJ,FilterState:()=>O.OO,FilterSystem:()=>O.u9,Framebuffer:()=>O.GW,FramebufferSystem:()=>O.nj,GC_MODES:()=>et.OS,GLFramebuffer:()=>O.pq,GLProgram:()=>O._H,GLTexture:()=>O.Ru,GRAPHICS_CURVES:()=>Xi.lU,Geometry:()=>O.V2,GeometrySystem:()=>O.kb,Graphics:()=>Xi.A1,GraphicsData:()=>Xi.ie,GraphicsGeometry:()=>Xi.mk,IGLUniformData:()=>O.n1,INSTALLED:()=>O.Ln,INTERNAL_FORMATS:()=>Dt,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:()=>kt,ImageBitmapResource:()=>O.di,ImageResource:()=>O.Gj,InteractionData:()=>V,InteractionEvent:()=>q,InteractionManager:()=>tt,InteractionTrackingData:()=>Q,KTXLoader:()=>Oe,LINE_CAP:()=>Xi.Mp,LINE_JOIN:()=>Xi.u2,LineStyle:()=>Xi.Sc,Loader:()=>wt,LoaderResource:()=>yt,MASK_TYPES:()=>et.vg,MIPMAP_MODES:()=>et.E8,MSAA_QUALITY:()=>et.he,MaskData:()=>O.XN,MaskSystem:()=>O.iW,Matrix:()=>j.uq,Mesh:()=>Ne.e,MeshBatchUvs:()=>Ne.iM,MeshGeometry:()=>Ne.u,MeshMaterial:()=>Ne.PX,NineSlicePlane:()=>ji.F_,ObjectRenderer:()=>O.Pt,ObservablePoint:()=>j.oA,PI_2:()=>j.TO,PRECISION:()=>et.Pk,ParticleContainer:()=>Me.w,ParticleRenderer:()=>Me.e,PlaneGeometry:()=>ji.bd,Point:()=>j.bR,Polygon:()=>j.tS,Prepare:()=>Be.p8,Program:()=>O.BP,ProjectionSystem:()=>O.hk,Quad:()=>O.kO,QuadUv:()=>O.X1,RAD_TO_DEG:()=>j.bO,RENDERER_TYPE:()=>et.h3,Rectangle:()=>j.M_,RenderTexture:()=>O.Y7,RenderTexturePool:()=>O.O1,RenderTextureSystem:()=>O.Bw,Renderer:()=>O.A4,ResizePlugin:()=>Ui,Resource:()=>O.FW,RopeGeometry:()=>ji.Bq,RoundedRectangle:()=>j.TE,Runner:()=>Wi.b,SAMPLER_TYPES:()=>et.XZ,SCALE_MODES:()=>et.M6,SHAPES:()=>j.HY,SVGResource:()=>O.$f,ScissorSystem:()=>O.s9,Shader:()=>O.Mt,ShaderSystem:()=>O.$P,SimpleMesh:()=>ji.g,SimplePlane:()=>ji.js,SimpleRope:()=>ji.D8,Sprite:()=>Ni.k,SpriteMaskFilter:()=>O.ah,Spritesheet:()=>De,SpritesheetLoader:()=>Le,State:()=>O.Uw,StateSystem:()=>O.D8,StencilSystem:()=>O.iH,System:()=>O.iQ,TARGETS:()=>et.dW,TEXT_GRADIENT:()=>Fe.T,TYPES:()=>et.QE,TYPES_TO_BYTES_PER_COMPONENT:()=>Te,TYPES_TO_BYTES_PER_PIXEL:()=>Se,TemporaryDisplayObject:()=>C.dC,Text:()=>Fe.EY,TextFormat:()=>Xe,TextMetrics:()=>Fe.Z1,TextStyle:()=>Fe.xJ,Texture:()=>O.gP,TextureGCSystem:()=>O.lB,TextureLoader:()=>It,TextureMatrix:()=>O.NW,TextureSystem:()=>O.vB,TextureUvs:()=>O.OE,Ticker:()=>W.Rv,TickerPlugin:()=>W.y,TilingSprite:()=>ke.t,TilingSpriteRenderer:()=>ke._,TimeLimiter:()=>Be.oP,Transform:()=>j.dL,UPDATE_PRIORITY:()=>W.dQ,UniformGroup:()=>O.k2,VERSION:()=>O.xv,VideoResource:()=>O.A5,ViewableBuffer:()=>O.u3,WRAP_MODES:()=>et.uR,XMLFormat:()=>je,XMLStringFormat:()=>We,accessibleTarget:()=>M,autoDetectFormat:()=>Ye,autoDetectRenderer:()=>O.q5,autoDetectResource:()=>O.Nc,checkMaxIfStatementsInShader:()=>O.uC,createUBOElements:()=>O._J,defaultFilterVertex:()=>O.Eo,defaultVertex:()=>O.MT,extensions:()=>O.XO,filters:()=>qi,generateProgram:()=>O.CF,generateUniformBufferSync:()=>O.He,getTestContext:()=>O.WD,getUBOData:()=>O.RO,graphicsUtils:()=>Xi.lo,groupD8:()=>j.ER,interactiveTarget:()=>K,isMobile:()=>Lt.Fr,parseDDS:()=>ve,parseKTX:()=>we,resources:()=>O.ES,settings:()=>Lt.W0,systems:()=>O.nV,uniformParsers:()=>O.$Z,utils:()=>R});const n=r;function a(t){return new this((function(e,i){if(!t||void 0===t.length)return i(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var n=r.length;function a(t,i){if(i&&("object"==typeof i||"function"==typeof i)){var s=i.then;if("function"==typeof s)return void s.call(i,(function(e){a(t,e)}),(function(i){r[t]={status:"rejected",reason:i},0==--n&&e(r)}))}r[t]={status:"fulfilled",value:i},0==--n&&e(r)}for(var s=0;s0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);var R=i(3785),C=i(903),O=i(1947),M={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};C.q9.mixin(M);var B=9,D=100,L=0,k=0,N=2,F=1,G=-1e3,U=-1e3,H=2,X=function(){function t(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(R.isMobile.tablet||R.isMobile.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width=D+"px",e.style.height=D+"px",e.style.position="absolute",e.style.top=L+"px",e.style.left=k+"px",e.style.zIndex=N.toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width=F+"px",e.style.height=F+"px",e.style.position="absolute",e.style.top=G+"px",e.style.left=U+"px",e.style.zIndex=H.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.prototype.activate=function(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(t=this.renderer.view.parentNode)||void 0===t||t.appendChild(this.div))},t.prototype.deactivate=function(){var t;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(t=this.div.parentNode)||void 0===t||t.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var i=0;i title : "+t.title+"
tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,i=e.width,r=e.height;t.x+t.width>i&&(t.width=i-t.x),t.y+t.height>r&&(t.height=r-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width=D+"px",e.style.height=D+"px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=N.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,i=t.target.displayObject,r=e.eventData;e.dispatchEvent(i,"click",r),e.dispatchEvent(i,"pointertap",r),e.dispatchEvent(i,"tap",r)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,i=t.target.displayObject,r=e.eventData;e.dispatchEvent(i,"mouseover",r)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,i=t.target.displayObject,r=e.eventData;e.dispatchEvent(i,"mouseout",r)},t.prototype._onKeyDown=function(t){t.keyCode===B&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t.extension={name:"accessibility",type:[O.Ag.RendererPlugin,O.Ag.CanvasRendererPlugin]},t}(),j=i(7239),W=i(4775),V=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new j.bR,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),Y=function(t,e){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Y(t,e)};function z(t,e){function i(){this.constructor=t}Y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var q=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),Q=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),Z=function(){function t(){this._tempPoint=new j.bR}return t.prototype.recursiveFindHit=function(t,e,i,r,n){var a;if(!e||!e.visible)return!1;var s=t.data.global,o=!1,l=n=e.interactive||n,h=!0;if(e.hitArea)r&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?o=!0:(r=!1,h=!1)),l=!1;else if(e._mask&&r){var u=e._mask.isMaskData?e._mask.maskObject:e._mask;u&&!(null===(a=u.containsPoint)||void 0===a?void 0:a.call(u,s))&&(r=!1)}if(h&&e.interactiveChildren&&e.children)for(var c=e.children,p=c.length-1;p>=0;p--){var d=c[p],f=this.recursiveFindHit(t,d,i,r,l);if(f){if(!d.parent)continue;l=!1,f&&(t.target&&(r=!1),o=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(o=!0),e.interactive&&(o&&!t.target&&(t.target=e),i&&i(t,e,!!o))),o},t.prototype.findHit=function(t,e,i,r){this.recursiveFindHit(t,e,i,r,!1)},t}(),K={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};C.q9.mixin(K);var J=1,$={target:null,data:{global:null}},tt=function(t){function e(e,i){var r=t.call(this)||this;return i=i||{},r.renderer=e,r.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,r.interactionFrequency=i.interactionFrequency||10,r.mouse=new V,r.mouse.identifier=J,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[J]=r.mouse,r.interactionDataPool=[],r.eventData=new q,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!("PointerEvent"in globalThis),r.supportsTouchEvents="ontouchstart"in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new Z,r._tempDisplayObject=new C.dC,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return z(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return $.target=null,$.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive($,e,null,!0),$.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(W.Rv.system.add(this.tickerUpdate,this,W.dQ.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(W.Rv.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime0&&(a=t.composedPath()[0]);for(var s=a!==this.interactionDOMElement?"outside":"",o=0;o=2?n.multisample:et.he.NONE;if(r=this.renderer.generateTexture(t,{multisample:o}),o!==et.he.NONE){var l=O.Y7.create({width:r.width,height:r.height});n.framebuffer.bind(r.framebuffer),n.framebuffer.blit(l.framebuffer),n.framebuffer.bind(null),r.destroy(!0),r=l}s=!0}r?(i=r.baseTexture.resolution,e=null!=e?e:r.frame,a=!1,n.renderTexture.bind(r)):(i=n.resolution,e||((e=it).width=n.width,e.height=n.height),a=!0,n.renderTexture.bind(null));var h=Math.round(e.width*i),u=Math.round(e.height*i),c=new Uint8Array(rt*h*u),p=n.gl;return p.readPixels(Math.round(e.x*i),Math.round(e.y*i),h,u,p.RGBA,p.UNSIGNED_BYTE,c),s&&r.destroy(!0),{pixels:c,width:h,height:u,flipY:a}},t.prototype.destroy=function(){this.renderer=null},t.arrayPostDivide=function(t,e){for(var i=0;i0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=pt:r===ft&&(r=dt),(r/100|0)===gt){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(s){return void this.abort("Error trying to parse loaded json: "+s)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var a=document.createElement("div");a.innerHTML=i,this.data=a}this.type=t.TYPE.XML}catch(o){return void this.abort("Error trying to parse loaded xml: "+o)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,ut||(ut=document.createElement("a")),ut.href=t;var i=ht(ut.href,{strictMode:!0}),r=!i.port&&""===e.port||i.port===e.port,n=i.protocol?i.protocol+":":"";return i.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),a=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,a)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}();function _t(){}function bt(t){return function(){for(var e=arguments,i=[],r=0;r>2,n[1]=(3&r[0])<<4|r[1]>>4,n[2]=(15&r[1])<<2|r[2]>>6,n[3]=63&r[2],i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(a=0;a0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,e,i,r,n,a,s){for(var o=new Array(i),l=t.byteOffset,h=a,u=s,c=h+r-1&~(r-1),p=u+n-1&~(n-1),d=c*p*kt[e],f=0;f1?h:c,levelHeight:i>1?u:p,levelBuffer:new Uint8Array(t.buffer,l,d)},l+=d,d=(c=(h=h>>1||1)+r-1&~(r-1))*(p=(u=u>>1||1)+n-1&~(n-1))*kt[e];return o},e}(jt),Vt=function(){function t(){}return t.use=function(e,i){var r=e.data,n=this;if(e.type===yt.TYPE.JSON&&r&&r.cacheID&&r.textures){for(var a=r.textures,s=void 0,o=void 0,l=0,h=a.length;l>>=1,T>>>=1}var S=y;for(E=0;E1||0!==a?E:w,levelHeight:d>1||0!==a?S:P,levelBuffer:new Uint8Array(e,M,T)},M+=T}I=(I+=C+4)%4!=0?I+4-I%4:I,T=(w=(E=E>>1||1)+m-1&~(m-1))*(P=(S=S>>1||1)+A-1&~(A-1))*g}return 0!==a?{uncompressed:_.map((function(t){var e=t[0].levelBuffer,i=!1;return a===et.QE.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):a===et.QE.UNSIGNED_INT?(i=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):a===et.QE.INT&&(i=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new O.dZ(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:a,format:i?Ie(s):s}})),kvData:x}:{compressed:_.map((function(t){return new Wt(null,{format:o,width:l,height:h,levels:d,levelBuffers:t})})),kvData:x}}function Pe(t,e){for(var i=0;ie-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var l=0;l")>-1){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return je.test(e)}return!1},t.parse=function(t){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return je.parse(e)},t}(),Ve=[Xe,je,We];function Ye(t){for(var e=0;e=h-S*o){if(0===v)throw new Error("[BitmapFont] textureHeight "+h+"px is too small (fontFamily: '"+c.fontFamily+"', fontSize: "+c.fontSize+"px, char: '"+x+"')");--b,f=null,g=null,m=null,v=0,A=0,y=0}else if(y=Math.max(S+T.fontProperties.descent,y),w*o+A>=p){if(0===A)throw new Error("[BitmapFont] textureWidth "+l+"px is too small (fontFamily: '"+c.fontFamily+"', fontSize: "+c.fontSize+"px, char: '"+x+"')");--b,v+=y*o,v=Math.ceil(v),A=0,y=0}else{qe(f,g,T,A,v,o,c);var P=Ke(T.text);d.char.push({id:P,page:_.length-1,x:A/o,y:v/o,width:w,height:S,xoffset:0,yoffset:0,xadvance:Math.ceil(E-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))}),A+=(w+2*s)*o,A=Math.ceil(A)}}if(!(null==r?void 0:r.skipKerning)){b=0;for(var I=u.length;b 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n",ti="// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n",ei=[],ii=[],ri=[],ni=function(t){function e(i,r){void 0===r&&(r={});var n=t.call(this)||this;n._tint=16777215;var a=Object.assign({},e.styleDefaults,r),s=a.align,o=a.tint,l=a.maxWidth,h=a.letterSpacing,u=a.fontName,c=a.fontSize;if(!Je.available[u])throw new Error('Missing BitmapFont "'+u+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=s,n._tint=o,n._font=void 0,n._fontName=u,n._fontSize=c,n.text=i,n._maxWidth=l,n._maxLineHeight=0,n._letterSpacing=h,n._anchor=new j.oA((function(){n.dirty=!0}),n,0,0),n._roundPixels=Lt.W0.ROUND_PIXELS,n.dirty=!0,n._resolution=Lt.W0.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return Ue(e,t),e.prototype.updateText=function(){for(var t,e=Je.available[this._fontName],i=this.fontSize,r=i/e.size,n=new j.bR,a=[],s=[],o=[],l=Qe(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),h=this._maxWidth*e.size/i,u="none"===e.distanceFieldType?ei:ii,c=null,p=0,d=0,f=0,g=-1,m=0,A=0,v=0,y=0,_=0;_0&&n.x>h&&(++A,(0,R.removeItems)(a,1+g-A,1+_-g),_=g,g=-1,s.push(m),o.push(a.length>0?a[a.length-1].prevSpaces:0),d=Math.max(d,m),f++,n.x=0,n.y+=e.lineHeight,c=null,y=0)}}else s.push(p),o.push(-1),d=Math.max(d,p),++f,++A,n.x=0,n.y+=e.lineHeight,c=null,y=0}var E=l[l.length-1];"\r"!==E&&"\n"!==E&&(/(?:\s)/.test(E)&&(p=m),s.push(p),d=Math.max(d,p),o.push(-1));var S=[];for(_=0;_<=f;_++){var w=0;"right"===this._align?w=d-s[_]:"center"===this._align?w=(d-s[_])/2:"justify"===this._align&&(w=o[_]<0?0:(d-s[_])/o[_]),S.push(w)}var P=a.length,I={},C=[],M=this._activePagesMeshData;u.push.apply(u,M);for(_=0;_6*G)||$.vertices.length<2*Ne.e.BATCHABLE_SIZE)$.vertices=new Float32Array(8*G),$.uvs=new Float32Array(8*G),$.indices=new Uint16Array(6*G);else for(var U=$.total,H=$.vertices,X=4*U*2;X=r&&(e=t-o-1),a+=l=l.replace("%value%",i[e].toString()),a+="\n"}return n=(n=n.replace("%blur%",a)).replace("%size%",t.toString())}var Ai=function(t){function e(e,i,r,n,a){void 0===i&&(i=8),void 0===r&&(r=4),void 0===n&&(n=Lt.W0.FILTER_RESOLUTION),void 0===a&&(a=5);var s=this,o=di(a,e),l=mi(a);return(s=t.call(this,o,l)||this).horizontal=e,s.resolution=n,s._quality=0,s.quality=r,s.blur=i,s}return ci(e,t),e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),a=t.renderer,s=e,o=n;this.state.blend=!1,t.applyFilter(this,s,o,et.fr.CLEAR);for(var l=1;l>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){var e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,a=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-a*r,n*(1-i)+a*r,0,0,n*(1-i)+a*r,i+n*(1-i),n*(1-i)-a*r,0,0,n*(1-i)-a*r,n*(1-i)+a*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){var e=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.sepia=function(t){var e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.technicolor=function(t){var e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.polaroid=function(t){var e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.toBGR=function(t){var e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.kodachrome=function(t){var e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.browni=function(t){var e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.vintage=function(t){var e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.colorTone=function(t,e,i,r,n){var a=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,o=(255&i)/255,l=((r=r||3375104)>>16&255)/255,h=(r>>8&255)/255,u=(255&r)/255,c=[.3,.59,.11,0,0,a,s,o,t=t||.2,0,l,h,u,e=e||.15,0,a-l,s-h,o-u,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(O.dJ);xi.prototype.grayscale=xi.prototype.greyscale;var Ti=function(t,e){return Ti=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Ti(t,e)};function Ei(t,e){function i(){this.constructor=t}Ti(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Si="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",wi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",Pi=function(t){function e(e,i){var r=this,n=new j.uq;return e.renderable=!1,(r=t.call(this,wi,Si,{mapSampler:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,r.maskMatrix=n,null==i&&(i=20),r.scale=new j.bR(i,i),r}return Ei(e,t),e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,a=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==a&&0!==s&&(this.uniforms.rotation[0]=n.a/a,this.uniforms.rotation[1]=n.b/a,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(O.dJ),Ii=function(t,e){return Ii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Ii(t,e)};function Ri(t,e){function i(){this.constructor=t}Ii(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Ci="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",Oi='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Mi=function(t){function e(){return t.call(this,Ci,Oi)||this}return Ri(e,t),e}(O.dJ),Bi=function(t,e){return Bi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Bi(t,e)};function Di(t,e){function i(){this.constructor=t}Bi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Li="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ki=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random());var r=t.call(this,O.Eo,Li,{uNoise:0,uSeed:0})||this;return r.noise=e,r.seed=i,r}return Di(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(O.dJ),Ni=i(511),Fi=new j.uq;C.q9.prototype._cacheAsBitmap=!1,C.q9.prototype._cacheData=null,C.q9.prototype._cacheAsBitmapResolution=null,C.q9.prototype._cacheAsBitmapMultisample=et.he.NONE;var Gi=function(){function t(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return t}();Object.defineProperties(C.q9.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Gi),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),C.q9.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},C.q9.prototype._initCachedDisplayObject=function(t){var e;if(!this._cacheData||!this._cacheData.sprite){var i=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var n=this.filters[0].padding;r.pad(n)}r.ceil(Lt.W0.RESOLUTION);var a=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),o=t.renderTexture.destinationFrame.clone(),l=t.projection.transform,h=O.Y7.create({width:r.width,height:r.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),u="cacheAsBitmap_"+(0,R.uid)();this._cacheData.textureCacheId=u,O.t5.addToCache(h.baseTexture,u),O.gP.addToCache(h,u);var c=this.transform.localTransform.copyTo(Fi).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:h,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=l,t.renderTexture.bind(a,s,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var p=new Ni.k(h);p.transform.worldTransform=this.transform.worldTransform,p.anchor.x=-r.x/r.width,p.anchor.y=-r.y/r.height,p.alpha=i,p._bounds=this._bounds,this._cacheData.sprite=p,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=p.containsPoint.bind(p)}},C.q9.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},C.q9.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;var r=t.context,n=t._projTransform;e.ceil(Lt.W0.RESOLUTION);var a=O.Y7.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+(0,R.uid)();this._cacheData.textureCacheId=s,O.t5.addToCache(a.baseTexture,s),O.gP.addToCache(a,s);var o=Fi;this.transform.localTransform.copyTo(o),o.invert(),o.tx-=e.x,o.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:a,clear:!0,transform:o,skipUpdateTransform:!1}),t.context=r,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var l=new Ni.k(a);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-e.x/e.width,l.anchor.y=-e.y/e.height,l.alpha=i,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)}},C.q9.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},C.q9.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},C.q9.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,O.t5.removeFromCache(this._cacheData.textureCacheId),O.gP.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},C.q9.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},C.q9.prototype.name=null,C.mc.prototype.getChildByName=function(t,e){for(var i=0,r=this.children.length;i=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei)&&this.onLoop(),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r{"use strict";i.r(e),i.d(e,{__addDisposableResource:()=>D,__assign:()=>a,__asyncDelegator:()=>S,__asyncGenerator:()=>E,__asyncValues:()=>w,__await:()=>T,__awaiter:()=>f,__classPrivateFieldGet:()=>O,__classPrivateFieldIn:()=>B,__classPrivateFieldSet:()=>M,__createBinding:()=>m,__decorate:()=>o,__disposeResources:()=>k,__esDecorate:()=>h,__exportStar:()=>A,__extends:()=>n,__generator:()=>g,__importDefault:()=>C,__importStar:()=>R,__makeTemplateObject:()=>P,__metadata:()=>d,__param:()=>l,__propKey:()=>c,__read:()=>y,__rest:()=>s,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>_,__spreadArray:()=>x,__spreadArrays:()=>b,__values:()=>v,default:()=>N});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},r(t,e)};function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var a=function(){return a=Object.assign||function(t){for(var e,i=1,r=arguments.length;i=0;o--)(n=t[o])&&(s=(a<3?n(s):a>3?n(e,i,s):n(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s}function l(t,e){return function(i,r){e(i,r,t)}}function h(t,e,i,r,n,a){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?r.static?t:t.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,d=i.length-1;d>=0;d--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(t||null))};var m=(0,i[d])("accessor"===l?{get:c.get,set:c.set}:c[h],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(c.get=o),(o=s(m.set))&&(c.set=o),(o=s(m.init))&&n.unshift(o)}else(o=s(m))&&("field"===l?n.unshift(o):c[h]=o)}u&&Object.defineProperty(u,r.name,c),p=!0}function u(t,e,i){for(var r=arguments.length>2,n=0;n0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,a=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(o){n={error:o}}finally{try{r&&!r.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return s}function _(){for(var t=[],e=0;e1||o(t,e)}))})}function o(t,e){try{l(n[t](e))}catch(i){c(a[0][3],i)}}function l(t){t.value instanceof T?Promise.resolve(t.value.v).then(h,u):c(a[0][2],t)}function h(t){o("next",t)}function u(t){o("throw",t)}function c(t,e){t(e),a.shift(),a.length&&o(a[0][0],a[0][1])}}function S(t){var e,i;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,n){e[r]=t[r]?function(e){return(i=!i)?{value:T(t[r](e)),done:!1}:n?n(e):e}:n}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t="function"==typeof v?v(t):t[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(i){e[i]=t[i]&&function(e){return new Promise((function(r,a){n(r,a,(e=t[i](e)).done,e.value)}))}}function n(t,e,i,r){Promise.resolve(r).then((function(e){t({value:e,done:i})}),e)}}function P(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var I=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function R(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&m(e,t,i);return I(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function O(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)}function M(t,e,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(t,i):n?n.value=i:e.set(t,i),i}function B(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function D(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:r,async:i})}else i&&t.stack.push({async:!0});return e}var L="function"==typeof SuppressedError?SuppressedError:function(t,e,i){var r=new Error(i);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function k(t){function e(e){t.error=t.hasError?new L(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}function i(){for(;t.stack.length;){var r=t.stack.pop();try{var n=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(n).then(i,(function(t){return e(t),i()}))}catch(a){e(a)}}if(t.hasError)throw t.error}return i()}const N={__extends:n,__assign:a,__rest:s,__decorate:o,__param:l,__metadata:d,__awaiter:f,__generator:g,__createBinding:m,__exportStar:A,__values:v,__read:y,__spread:_,__spreadArrays:b,__spreadArray:x,__await:T,__asyncGenerator:E,__asyncDelegator:S,__asyncValues:w,__makeTemplateObject:P,__importStar:R,__importDefault:C,__classPrivateFieldGet:O,__classPrivateFieldSet:M,__classPrivateFieldIn:B,__addDisposableResource:D,__disposeResources:k}}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={id:t,loaded:!1,exports:{}};return r[t].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=r,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(i,r){if(1&r&&(i=this(i)),8&r)return i;if("object"==typeof i&&i){if(4&r&&i.__esModule)return i;if(16&r&&"function"==typeof i.then)return i}var n=Object.create(null);a.r(n);var s={};t=t||[null,e({}),e([]),e(e)];for(var o=2&r&&i;"object"==typeof o&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach((t=>s[t]=()=>i[t]));return s.default=()=>i,a.d(n,s),n},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,i)=>(a.f[i](t,e),e)),[])),a.u=t=>"chunks/"+t+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i={},a.l=(t,e,r,n)=>{if(i[t])i[t].push(e);else{var s,o;if(void 0!==r)for(var l=document.getElementsByTagName("script"),h=0;h{s.onerror=s.onload=null,clearTimeout(p);var n=i[t];if(delete i[t],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((t=>t(r))),e)return e(r)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=c.bind(null,s.onerror),s.onload=c.bind(null,s.onload),o&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");if(i.length)for(var r=i.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=i[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={23:0};a.f.j=(e,i)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)i.push(r[2]);else{var n=new Promise(((i,n)=>r=t[e]=[i,n]));i.push(r[2]=n);var s=a.p+a.u(e),o=new Error,l=i=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var n=i&&("load"===i.type?"missing":i.type),s=i&&i.target&&i.target.src;o.message="Loading chunk "+e+" failed.\n("+n+": "+s+")",o.name="ChunkLoadError",o.type=n,o.request=s,r[1](o)}};a.l(s,l,"chunk-"+e,e)}};var e=(e,i)=>{var r,n,[s,o,l]=i,h=0;if(s.some((e=>0!==t[e]))){for(r in o)a.o(o,r)&&(a.m[r]=o[r]);if(l)l(a)}for(e&&e(i);h { + var e = {2236: () => { + var e; + try { + e = window.localStorage; + } catch (a) { + console.log("LocalStorage is unavailable!"); + } + window.GAME_GROUP = "casual"; + var r = window.SKIN_DIRS || {}, o = window.__OPTIONS__.rules_url, i = o.slice(o.indexOf(`/${window.__OPTIONS__.locale}/`) + 1); + function t(r) { + var o = (r.ui.skin || "basic").toLocaleLowerCase(), i = window.location.search.match(new RegExp("[?&]skin=([^&]*)(&?)", "i")), t = i ? i[1] : null; + if (!e) return t || o; + var a = `lastApiSkin_${r.cache_id}`, n = `userSkin_${r.cache_id}`; + return t ? e.setItem(n, t) : t = e.getItem(n), e.getItem(a) === o && t ? t : (e.removeItem(n), e.setItem(a, o), o); + } + window.__OPTIONS__.rules_url = "https://rules.bgaming-network.com/" + i, window.initializeCasinoOptions = e => { + var o = t(e), {root: i, res: a = "v0.0.41_v14.13.3"} = r[o] || r.basic || {}; + e.ui.applied_skin = i, e.resources_root_path = e.resources_path + (i ? `/${i}` : ""), e.resources_path += `/${a}`, e.game_bundle_source = e.resources_path + "/bundle.js", window.__OPTIONS__ = e; + }; + }}, r = {}; + function o(i) { + var t = r[i]; + if (undefined !== t) return t.exports; + var a = r[i] = {exports: {}}; + return e[i](a, a.exports, o), a.exports; + } + o.n = e => { + var r = e && e.__esModule ? () => e.default : () => e; + return o.d(r, {a: r}), r; + }, o.d = (e, r) => { + for (var i in r) o.o(r, i) && !o.o(e, i) && Object.defineProperty(e, i, {enumerable: true, get: r[i]}); + }, o.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r); + (() => { + "use strict"; + o(2236); + var e = window.__OPTIONS__; + e.identifier, window.initializeCasinoOptions(e); + })(); +})(); diff --git a/plinko/Plinko_files/replays.js b/plinko/Plinko_files/replays.js new file mode 100644 index 0000000..104fc22 --- /dev/null +++ b/plinko/Plinko_files/replays.js @@ -0,0 +1,82 @@ +var D=Object.defineProperty;var w=(c,o,u)=>o in c?D(c,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[o]=u;var d=(c,o,u)=>(w(c,typeof o!="symbol"?o+"":o,u),u);(function(){"use strict";const c=` +canvas { + pointer-events: none; + border: #ffcc29 3px solid; + box-sizing: border-box; + border-top-width: 45px; +} + +#replay-panel { + height: 45px; + z-index: 100; + position: absolute; + top: 0; + font-family: 'Arial'; + color: #000000; + display: flex; + width: 100%; + align-items: baseline; + justify-content: center; + font-size: 20px; + font-weight: 700; +} + +#replay-panel button { + height: 35px; + line-height: 1; + cursor: pointer; + padding: 6px 23px; + background: #ff8f00; + margin: 5px; + border-radius: 18px; + font-size: 17px; + font-weight: 700; +} + +#replay-panel button:hover { + outline: 1px solid #774400; + outline-offset: 2px; +} + +#replay-panel button:disabled { + pointer-events: none; + cursor: unset; + opacity: 0.5; +} + +.highlight { + animation: highlight 1s ease 0s infinite normal forwards; + outline-offset: 2px; + outline: 3px solid #ff0000; +} + +#pause-message { + animation: flash 1s ease 0s infinite normal forwards; + position: absolute; + font-family: 'Arial'; + color: #ffffff; + top: 43vh; + font-size: 400%; + text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; +} + +@keyframes highlight { + 0%, + 100% { + outline-color: #ff0000; + } + 50% { + outline-color: #ffcc29; + } +} + +@keyframes flash { + 0%, + 100% { + opacity: 1; + } + 50% { + opacity: 0; + } +} +`,o={START_LOADING:"start_loading",GAME_RESOURCES_LOADED:"game_resources_loaded",GAME_LOADED:"game_loaded",GAME_INITIALIZED:"game_initialized",ACTION_EXEC:"action_exec",BET_CHANGED:"bet_changed",FINISH_SPIN_ANIMATIONS:"finish_spin_animations",FINISH_ROUND_ANIMATIONS:"finish_round_animations",API_RESPONSE:"api_response",BALANCE_UPDATE:"balance_update",BUTTON_CLICK:"button-click",PRE_PLAY:"pre_play",PLAY:"play",AUTOSPINS_STOPPED:"autospins_stopped",GO_HOME:"go_home",SET_SKIN:"set_skin",ERROR:"game_error",SET_LINES_COUNT:"set_lines_count",CUSTOM_EVENT:"custom_event",GAME_UI_BET_PANEL_OPENED:"game_ui_bet_panel_opened",GAME_UI_BET_PANEL_CLOSED:"game_ui_bet_panel_closed",GAME_UI_SETTINGS_OPENED:"game_ui_settings_opened",GAME_UI_SETTINGS_CLOSED:"game_ui_settings_closed",GAME_UI_RULES_OPENED:"game_ui_rules_opened",GAME_UI_RULES_CLOSED:"game_ui_rules_closed",GAME_UI_PAYTABLE_OPENED:"game_ui_paytable_opened",GAME_UI_PAYTABLE_CLOSED:"game_ui_paytable_closed",GAME_UI_AUTOSPINS_PANEL_OPENED:"game_ui_autospins_panel_opened",GAME_UI_AUTOSPINS_PANEL_CLOSED:"game_ui_autospins_panel_closed",GAME_UI_QUICK_SPIN_OFFER_OPENED:"game_ui_quick_spin_offer_opened",GAME_UI_QUICK_SPIN_OFFER_CLOSED:"game_ui_quick_spin_offer_closed"};let u=!1;class f{constructor(){d(this,"gameController",null);d(this,"globalEventDispatcher",null);d(this,"game",null);d(this,"isEditor",!1);d(this,"isDebug",!1);this.initialHandler=this.initialHandler.bind(this),window.trackGameEventListeners||(window.trackGameEventListeners=[]),window.trackGameEventListeners.push(this.initialHandler),window.addEventListener("keydown",t=>{var e,i,a,l;if(this.game&&t.altKey&&t.ctrlKey&&t.code==="KeyR"&&(i=(e=this.game.data.latestData)==null?void 0:e.flow)!=null&&i.round_id){const r=new URLSearchParams(window.location.search).get("server_url");window.open("/api/replays/"+((l=(a=this.game.data.latestData)==null?void 0:a.flow)==null?void 0:l.round_id)+(r?"?server_url="+r:""),"__blank")}})}initialHandler(t,e,i){var a;switch(t){case o.START_LOADING:this.gameController=i,this.game=i==null?void 0:i.game,this.globalEventDispatcher=(a=this.game)==null?void 0:a.globalEventDispatcher,this.game&&this.initStyles();break}}gameInitHanddler(){this.game={}}initGame(){this.initReplayData(),this.isReplayMode()&&(this.game.all.hasOwnProperty("spin-button")&&(this.game.all["spin-button"].hotkey=0),this.speed||(this.speed=1),this.started=!1,this.firstSpinClicked=!1,this.replayData&&(this.initView(),this.game.settings.clear()),this.clickToContinueDelay=0,this.refreshView()),this.initStyles()}isReplayMode(){return!!this.replayData}isReplayFinished(){return this.replayData.length===0}getNextResponse(){return _(this.replayData&&this.replayData.length,"Replays data is empty."),this.replayData.shift()}beforeGameInit(){this.isReplayMode()&&(window._thingEngineAssets.projectDesc.id="replay-mode")}initView(){if(!this.viewInitialized){let t=0;this.game.pixiApp.ticker.add(()=>{for(t>this.game.time&&(t=this.game.time);this.game.time>=t+10;)t+=10,this.update()}),this.viewInitialized=!0;const e=document.createElement("div");e.id="replay-panel",this.game.pixiApp.view.parentElement.appendChild(e);const i=document.createElement("button");i.addEventListener("pointerdown",()=>{this.setSpeed(1)}),i.innerText="×1",e.appendChild(i),this.x1btn=i;const a=document.createElement("button");a.addEventListener("pointerdown",()=>{this.setSpeed(2)}),a.innerText="×2",a.innerText="×2",e.appendChild(a),this.x2btn=a;const l=document.createElement("button");l.addEventListener("pointerdown",()=>{this.setSpeed(4)}),l.innerText="×4",e.appendChild(l),this.x4btn=l,e.appendChild(document.createTextNode("replay"));const n=document.createElement("button");n.addEventListener("pointerdown",()=>{this.paused=!1,this.started=!1,this.firstSpinClicked=!1,this.game.pixiApp.ticker.speed=1,this.game.SharedAPI.restartGame()}),n.innerText="⏮",e.appendChild(n),this.restartButton=n;const r=document.createElement("button");r.addEventListener("pointerdown",()=>{this.started?(this.paused=!this.paused,this.game.pixiApp.ticker.speed=this.paused?0:this.speed,this.refreshView()):this.startReplay()}),e.appendChild(r),this.playBtn=r;const h=document.createElement("div");h.id="pause-message",e.appendChild(h),h.innerText="P A U S E",this.pauseMessage=h;const p=document.createElement("button");p.style.position="absolute",p.style.right="10px",p.addEventListener("pointerdown",()=>{this.spinReelsOrSkip()}),p.innerText="Help",e.appendChild(p),this.helpMessage=p,this.refreshView()}}startReplay(){this.started=!0,this.refreshView()}clickSpin(){if(!this.firstSpinClicked){const t=this.game.all["spin-button"];if(t&&t.isCanBePressed)return this.firstSpinClicked=!0,t.callClick(),!0}}skipClickToContinuePopups(){let t=!1;if(this.clickToContinueDelay<0){this.clickToContinueDelay++;return}return this.game.currentContainer&&this.game.currentContainer.forAllChildren(e=>{if((e.worldVisible&&e.worldAlpha&&this.clickToContinueDelay>=0||this.clickToContinueDelay>0)&&(e instanceof this.game.classes.Text&&e.translatableText&&(e.translatableText.includes("tap_to_continue")||e.translatableText.includes("click_to_continue")||e.translatableText.includes("push_to_continue")||e.translatableText.includes("tap_to_start")||e.translatableText.includes("push_to_start")||e.translatableText.includes("click_to_start")||e.translatableText.includes("tap_to_spin")||e.translatableText.includes("push_to_spin")||e.translatableText.includes("click_to_spin")||e.translatableText.includes("tap_to_play")||e.translatableText.includes("push_to_play")||e.translatableText.includes("click_to_play"))||e.name&&e.name.startsWith&&e.name.startsWith("slot-animations/popup/free-spins"))){let i=e.findParentByType(this.game.classes.Button);i&&i.isCanBePressed?this.clickButton(i):(this.clickToContinueDelay++,this.clickToContinueDelay===12&&(this.spinReelsOrSkip(),this.clickToContinueDelay=-12),t=!0)}}),t||(this.clickToContinueDelay=0),t}buyFeature(){const t=g(this.replayData[0]);if(t&&!t.includes("chance")){let e=".buyBonusClick`"+t;const i=b(this.replayData[0]);i&&(e+=","+i);let a=this.game.currentScene.getBuyBonusButtonForReplays&&this.game.currentScene.getBuyBonusButtonForReplays(t)||this.game.currentContainer.findChildrenByType(this.game.classes.Button).filter(n=>n.isCanBePressed&&n.onClick&&n.onClick.endsWith(e))[0];if(a)return this.clickButton(a),!0;const l=this.game.currentContainer.findChildrenByType(this.game.classes.Button).filter(n=>n.isCanBePressed&&["currentScene.showBuyBonusPopup","showModal`buy-bonus-popup","showModal`buy-bonus","currentScene.launchAnimations`buy-bonus","slot-animations/buy-bonus-portrait"].includes(n.onClick))[0];if(l)return this.clickButton(l),!0}}chooseFeature(){const t=C(this.replayData[0]);if(t){let e=this.game.currentContainer.findChildByName("choose-btn-"+t);e&&this.clickButton(e)}}gamblePlay(){const t=k(this.replayData[0]);if(t){let e=this.game.currentContainer.findChildByName("gamble-btn");if(e&&e.isCanBePressed)return this.clickButton(e),!0;e=null;const i="currentScene.playGamble`"+t;this.game.currentContainer.forAllChildren(a=>{a instanceof this.game.classes.Button&&a.onClick===i&&(e=a)}),e&&this.clickButton(e)}}markedButtonClick(){let t=this.game.currentContainer.findChildrenByName("replay-auto-click-parent");t=t.map(i=>i.parent).filter(i=>i instanceof this.game.classes.Button&&i.isCanBePressed);const e=t[Math.floor(Math.random()*t.length)];if(e)return this.clickButton(e),!0}update(){this.paused||!this.started||!this.game.currentScene||(this.buttonClickWaits?this.processClickWaitingButton():this.replayData.length&&this.game.currentContainer?this.buyFeature()||this.collectRound()||this.chooseFeature()||this.gamblePlay()||this.markedButtonClick()||this.skipClickToContinuePopups()||this.clickSpin():this.skipClickToContinuePopups()||this.markedButtonClick())}collectRound(){if(this.replayData[0].flow.command==="close")return this.clickButton(this.game.all["collect-btn"]),!0}spinReelsOrSkip(){if(this.game.classes.BaseSlotScene&&this.game.currentContainer instanceof this.game.classes.BaseSlotScene){const t=this.game.all["spin-button"];t&&t.isCanBePressed?(t.callClick(),this.started=!0,this.refreshView()):(this.game.currentContainer.skipSpin&&this.game.currentContainer.skipSpin(),this.game.all.hasOwnProperty("root-skip-trigger")&&this.game.all["root-skip-trigger"].skipNext())}}clickButton(t){_(!this.buttonClickWaits,"previous button click is not finished."),this.buttonClickWaits=t;const e=this.game.Lib.loadPrefab("replays-click-animation");e.targetButton=t,t.getRootContainer().addChild(e),this.clickButtonDelay=0}processClickWaitingButton(){if(this.buttonClickWaits)return this.buttonClickWaits.isCanBePressed&&this.buttonClickWaits.worldVisible&&this.buttonClickWaits.worldAlpha>.1&&(this.clickButtonDelay++,this.clickButtonDelay===6&&this.buttonClickWaits.onOver(),this.clickButtonDelay===12&&(this.buttonClickWaits.callClick(),this.buttonClickWaits=null)),!0}setSpeed(t){this.speed=t,this.game.pixiApp.ticker.speed=t,this.refreshView()}refreshView(){this.playBtn.innerText=!this.started||this.paused?"⏵":"⏸",this.pauseMessage.style.display=!this.started||this.paused?"block":"none",this.started?this.playBtn.classList.remove("highlight"):this.playBtn.classList.add("highlight"),this.restartButton.disabled=!this.started,this.x1btn.disabled=this.speed===1,this.x2btn.disabled=this.speed===2,this.x4btn.disabled=this.speed===4}initStyles(){u||(this.initReplayData(),this.replayData&&(u=!0,this.game.applyCSS(c)))}initReplayData(){var t;if(this.replayData=m(((t=window.__OPTIONS__)==null?void 0:t.replay)||null),this.replayData){const e=this.replayData[0].options;if(this.replayData.some(i=>{if(i&&i.outcome&&i.outcome.bet){let a=i.outcome.bet;return this.betRestoringProcess&&(a=this.betRestoringProcess(i)),e.currency||(e.currency={code:"FUN",symbol:"FUN",subunits:100,exponent:2}),e.default_bet=a,e.available_bets.indexOf(a)<0&&(e.available_bets.push(a),e.available_bets.sort((l,n)=>l-n)),!0}}),this.replayData[0].api_version==="2"?this.replayData[0].balance.wallet=this.replayData[1].balance.wallet+this.replayData[1].outcome.bet:this.replayData[0].balance=this.replayData[1].balance+this.replayData[1].outcome.bet,e.feature_options&&e.feature_options.feature_multipliers){let i=this.replayData[0].balance;this.replayData[0].api_version==="2"&&(i=i.wallet);let a=0;for(const n in e.feature_options.feature_multipliers)if(n!=="base_bet"){const r=e.feature_options.feature_multipliers[n];if(typeof r=="number")a=Math.max(r,a);else for(let h in r)a=Math.max(r[h],a)}a=Math.max(i,a/(e.feature_options.feature_multipliers.base_bet||100)*this.replayData[1].outcome.bet);const l=a-i;l>0&&this.replayData.some(n=>{this.replayData[0].api_version==="2"?n.balance.wallet+=l:n.balance+=l})}if(this.replayData[1].flow.purchased_feature&&this.replayData[1].flow.purchased_feature.name){const i=this.replayData[1].flow.purchased_feature.name;y(i)&&(this.replayData[0].flow.purchased_feature=JSON.parse(JSON.stringify(this.replayData[1].flow.purchased_feature)))}}}replayLastRound(){var e,i;let t=((i=(e=this.game.data.latestData)==null?void 0:e.flow)==null?void 0:i.round_id)||editor.settings.getItem(this.game.projectDesc.id+"last-replay-round-id");t?(editor.settings.setItem(this.game.projectDesc.id+"last-replay-round-id",t),this.__replayRound(t)):alert("Play a round first.")}async __replayRound(t){const e=window.SERVER_URL+"/api/replays/"+t,i=await fetch(e).then(l=>l.text()),a=i.indexOf("window.__OPTIONS__ = ")+21;window.__OPTIONS__.replay=JSON.parse(i.substring(a,i.indexOf("<\/script>"))).replay,this.initGame(),this.game.SharedAPI.restartGame()}}function _(s,t){s||alert(t)}function m(s){return s?JSON.parse(JSON.stringify(s)):null}function y(s){return s&&s.endsWith("_chance")}function g(s){if(s.flow&&s.flow.purchased_feature)return s.flow.purchased_feature.name}function b(s){if(s.flow&&s.flow.purchased_feature)return s.flow.purchased_feature.level}function C(s){if(s.features)return s.features.freespins_type}function k(s){if(s.gamble)return s.gamble.value[1]}const E=new f;window.__REPLAYS__=E})(); diff --git a/plinko/Plinko_files/sentry.js b/plinko/Plinko_files/sentry.js new file mode 100644 index 0000000..6fb0427 --- /dev/null +++ b/plinko/Plinko_files/sentry.js @@ -0,0 +1,36512 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js": +/*!**********************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEBUG_BUILD: () => (/* binding */ DEBUG_BUILD) +/* harmony export */ }); +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + + +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js": +/*!**********************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ clearCachedImplementation: () => (/* binding */ clearCachedImplementation), +/* harmony export */ fetch: () => (/* binding */ fetch), +/* harmony export */ getNativeImplementation: () => (/* binding */ getNativeImplementation), +/* harmony export */ setTimeout: () => (/* binding */ setTimeout) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + + + +/** + * We generally want to use window.fetch / window.setTimeout. + * However, in some cases this may be wrapped (e.g. by Zone.js for Angular), + * so we try to get an unpatched version of this from a sandboxed iframe. + */ + +const cachedImplementations = {}; + +/** + * Get the native implementation of a browser function. + * + * This can be used to ensure we get an unwrapped version of a function, in cases where a wrapped function can lead to problems. + * + * The following methods can be retrieved: + * - `setTimeout`: This can be wrapped by e.g. Angular, causing change detection to be triggered. + * - `fetch`: This can be wrapped by e.g. ad-blockers, causing an infinite loop when a request is blocked. + */ +function getNativeImplementation( + name, +) { + const cached = cachedImplementations[name]; + if (cached) { + return cached; + } + + let impl = _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW[name] ; + + // Fast path to avoid DOM I/O + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.isNativeFunction)(impl)) { + return (cachedImplementations[name] = impl.bind(_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW) ); + } + + const document = _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document; + // eslint-disable-next-line deprecation/deprecation + if (document && typeof document.createElement === 'function') { + try { + const sandbox = document.createElement('iframe'); + sandbox.hidden = true; + document.head.appendChild(sandbox); + const contentWindow = sandbox.contentWindow; + if (contentWindow && contentWindow[name]) { + impl = contentWindow[name] ; + } + document.head.removeChild(sandbox); + } catch (e) { + // Could not create sandbox iframe, just use window.xxx + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.warn(`Could not create sandbox iframe for ${name} check, bailing to window.${name}: `, e); + } + } + + // Sanity check: This _should_ not happen, but if it does, we just skip caching... + // This can happen e.g. in tests where fetch may not be available in the env, or similar. + if (!impl) { + return impl; + } + + return (cachedImplementations[name] = impl.bind(_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW) ); +} + +/** Clear a cached implementation. */ +function clearCachedImplementation(name) { + cachedImplementations[name] = undefined; +} + +/** + * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers. + * Whenever someone wraps the Fetch API and returns the wrong promise chain, + * this chain becomes orphaned and there is no possible way to capture it's rejections + * other than allowing it bubble up to this very handler. eg. + * + * const f = window.fetch; + * window.fetch = function () { + * const p = f.apply(this, arguments); + * + * p.then(function() { + * console.log('hi.'); + * }); + * + * return p; + * } + * + * `p.then(function () { ... })` is producing a completely separate promise chain, + * however, what's returned is `p` - the result of original `fetch` call. + * + * This mean, that whenever we use the Fetch API to send our own requests, _and_ + * some ad-blocker blocks it, this orphaned chain will _always_ reject, + * effectively causing another event to be captured. + * This makes a whole process become an infinite loop, which we need to somehow + * deal with, and break it in one way or another. + * + * To deal with this issue, we are making sure that we _always_ use the real + * browser Fetch API, instead of relying on what `window.fetch` exposes. + * The only downside to this would be missing our own requests as breadcrumbs, + * but because we are already not doing this, it should be just fine. + * + * Possible failed fetch error messages per-browser: + * + * Chrome: Failed to fetch + * Edge: Failed to Fetch + * Firefox: NetworkError when attempting to fetch resource + * Safari: resource blocked by content blocker + */ +function fetch(...rest) { + return getNativeImplementation('fetch')(...rest); +} + +/** + * Get an unwrapped `setTimeout` method. + * This ensures that even if e.g. Angular wraps `setTimeout`, we get the native implementation, + * avoiding triggering change detection. + */ +function setTimeout(...rest) { + return getNativeImplementation('setTimeout')(...rest); +} + + +//# sourceMappingURL=getNativeImplementation.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js": +/*!*************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addClickKeypressInstrumentationHandler: () => (/* binding */ addClickKeypressInstrumentationHandler), +/* harmony export */ instrumentDOM: () => (/* binding */ instrumentDOM) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + + +const DEBOUNCE_DURATION = 1000; + +let debounceTimerID; +let lastCapturedEventType; +let lastCapturedEventTargetId; + +/** + * Add an instrumentation handler for when a click or a keypress happens. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addClickKeypressInstrumentationHandler(handler) { + const type = 'dom'; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, instrumentDOM); +} + +/** Exported for tests only. */ +function instrumentDOM() { + if (!_types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document) { + return; + } + + // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom + // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before + // we instrument `addEventListener` so that we don't end up attaching this handler twice. + const triggerDOMHandler = _sentry_core__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers.bind(null, 'dom'); + const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); + _types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.addEventListener('click', globalDOMEventHandler, false); + _types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false); + + // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled + // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That + // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler + // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still + // guaranteed to fire at least once.) + ['EventTarget', 'Node'].forEach((target) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any + const proto = (_types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW )[target] && (_types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW )[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.fill)(proto, 'addEventListener', function (originalAddEventListener) { + return function ( + + type, + listener, + options, + ) { + if (type === 'click' || type == 'keypress') { + try { + const el = this ; + const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {}); + const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 }); + + if (!handlerForType.handler) { + const handler = makeDOMEventHandler(triggerDOMHandler); + handlerForType.handler = handler; + originalAddEventListener.call(this, type, handler, options); + } + + handlerForType.refCount++; + } catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListeners` calls with no proper `this` context. + } + } + + return originalAddEventListener.call(this, type, listener, options); + }; + }); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.fill)( + proto, + 'removeEventListener', + function (originalRemoveEventListener) { + return function ( + + type, + listener, + options, + ) { + if (type === 'click' || type == 'keypress') { + try { + const el = this ; + const handlers = el.__sentry_instrumentation_handlers__ || {}; + const handlerForType = handlers[type]; + + if (handlerForType) { + handlerForType.refCount--; + // If there are no longer any custom handlers of the current type on this element, we can remove ours, too. + if (handlerForType.refCount <= 0) { + originalRemoveEventListener.call(this, type, handlerForType.handler, options); + handlerForType.handler = undefined; + delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete + } + + // If there are no longer any custom handlers of any type on this element, cleanup everything. + if (Object.keys(handlers).length === 0) { + delete el.__sentry_instrumentation_handlers__; + } + } + } catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListeners` calls with no proper `this` context. + } + } + + return originalRemoveEventListener.call(this, type, listener, options); + }; + }, + ); + }); +} + +/** + * Check whether the event is similar to the last captured one. For example, two click events on the same button. + */ +function isSimilarToLastCapturedEvent(event) { + // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress. + if (event.type !== lastCapturedEventType) { + return false; + } + + try { + // If both events have the same type, it's still possible that actions were performed on different targets. + // e.g. 2 clicks on different buttons. + if (!event.target || (event.target )._sentryId !== lastCapturedEventTargetId) { + return false; + } + } catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + + // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_ + // to which an event listener was attached), we treat them as the same action, as we want to capture + // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box. + return true; +} + +/** + * Decide whether an event should be captured. + * @param event event to be captured + */ +function shouldSkipDOMEvent(eventType, target) { + // We are only interested in filtering `keypress` events for now. + if (eventType !== 'keypress') { + return false; + } + + if (!target || !target.tagName) { + return true; + } + + // Only consider keypress events on actual input elements. This will disregard keypresses targeting body + // e.g.tabbing through elements, hotkeys, etc. + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { + return false; + } + + return true; +} + +/** + * Wraps addEventListener to capture UI breadcrumbs + */ +function makeDOMEventHandler( + handler, + globalListener = false, +) { + return (event) => { + // It's possible this handler might trigger multiple times for the same + // event (e.g. event propagation through node ancestors). + // Ignore if we've already captured that event. + if (!event || event['_sentryCaptured']) { + return; + } + + const target = getEventTarget(event); + + // We always want to skip _some_ events. + if (shouldSkipDOMEvent(event.type, target)) { + return; + } + + // Mark event as "seen" + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.addNonEnumerableProperty)(event, '_sentryCaptured', true); + + if (target && !target._sentryId) { + // Add UUID to event target so we can identify if + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.addNonEnumerableProperty)(target, '_sentryId', (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.uuid4)()); + } + + const name = event.type === 'keypress' ? 'input' : event.type; + + // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons. + // If there is a last captured event, see if the new event is different enough to treat it as a unique one. + // If that's the case, emit the previous event and store locally the newly-captured DOM event. + if (!isSimilarToLastCapturedEvent(event)) { + const handlerData = { event, name, global: globalListener }; + handler(handlerData); + lastCapturedEventType = event.type; + lastCapturedEventTargetId = target ? target._sentryId : undefined; + } + + // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together. + clearTimeout(debounceTimerID); + debounceTimerID = _types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.setTimeout(() => { + lastCapturedEventTargetId = undefined; + lastCapturedEventType = undefined; + }, DEBOUNCE_DURATION); + }; +} + +function getEventTarget(event) { + try { + return event.target ; + } catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + return null; + } +} + + +//# sourceMappingURL=dom.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js": +/*!*****************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addHistoryInstrumentationHandler: () => (/* binding */ addHistoryInstrumentationHandler) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/vendor/supportsHistory.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + + +let lastHref; + +/** + * Add an instrumentation handler for when a fetch request happens. + * The handler function is called once when the request starts and once when it ends, + * which can be identified by checking if it has an `endTimestamp`. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addHistoryInstrumentationHandler(handler) { + const type = 'history'; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, instrumentHistory); +} + +function instrumentHistory() { + if (!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.supportsHistory)()) { + return; + } + + const oldOnPopState = _types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.onpopstate; + _types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.onpopstate = function ( ...args) { + const to = _types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.location.href; + // keep track of the current URL state, as we always receive only the updated state + const from = lastHref; + lastHref = to; + const handlerData = { from, to }; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('history', handlerData); + if (oldOnPopState) { + // Apparently this can throw in Firefox when incorrectly implemented plugin is installed. + // https://github.com/getsentry/sentry-javascript/issues/3344 + // https://github.com/bugsnag/bugsnag-js/issues/469 + try { + return oldOnPopState.apply(this, args); + } catch (_oO) { + // no-empty + } + } + }; + + function historyReplacementFunction(originalHistoryFunction) { + return function ( ...args) { + const url = args.length > 2 ? args[2] : undefined; + if (url) { + // coerce to string (this is what pushState does) + const from = lastHref; + const to = String(url); + // keep track of the current URL state, as we always receive only the updated state + lastHref = to; + const handlerData = { from, to }; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('history', handlerData); + } + return originalHistoryFunction.apply(this, args); + }; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.fill)(_types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.history, 'pushState', historyReplacementFunction); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.fill)(_types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.history, 'replaceState', historyReplacementFunction); +} + + +//# sourceMappingURL=history.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js": +/*!*************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SENTRY_XHR_DATA_KEY: () => (/* binding */ SENTRY_XHR_DATA_KEY), +/* harmony export */ addXhrInstrumentationHandler: () => (/* binding */ addXhrInstrumentationHandler), +/* harmony export */ instrumentXHR: () => (/* binding */ instrumentXHR) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + + +const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__'; + +/** + * Add an instrumentation handler for when an XHR request happens. + * The handler function is called once when the request starts and once when it ends, + * which can be identified by checking if it has an `endTimestamp`. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addXhrInstrumentationHandler(handler) { + const type = 'xhr'; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, instrumentXHR); +} + +/** Exported only for tests. */ +function instrumentXHR() { + if (!(_types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW ).XMLHttpRequest) { + return; + } + + const xhrproto = XMLHttpRequest.prototype; + + // eslint-disable-next-line @typescript-eslint/unbound-method + xhrproto.open = new Proxy(xhrproto.open, { + apply(originalOpen, xhrOpenThisArg, xhrOpenArgArray) { + const startTimestamp = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.timestampInSeconds)() * 1000; + + // open() should always be called with two or more arguments + // But to be on the safe side, we actually validate this and bail out if we don't have a method & url + const method = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.isString)(xhrOpenArgArray[0]) ? xhrOpenArgArray[0].toUpperCase() : undefined; + const url = parseUrl(xhrOpenArgArray[1]); + + if (!method || !url) { + return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); + } + + xhrOpenThisArg[SENTRY_XHR_DATA_KEY] = { + method, + url, + request_headers: {}, + }; + + // if Sentry key appears in URL, don't capture it as a request + if (method === 'POST' && url.match(/sentry_key/)) { + xhrOpenThisArg.__sentry_own_request__ = true; + } + + const onreadystatechangeHandler = () => { + // For whatever reason, this is not the same instance here as from the outer method + const xhrInfo = xhrOpenThisArg[SENTRY_XHR_DATA_KEY]; + + if (!xhrInfo) { + return; + } + + if (xhrOpenThisArg.readyState === 4) { + try { + // touching statusCode in some platforms throws + // an exception + xhrInfo.status_code = xhrOpenThisArg.status; + } catch (e) { + /* do nothing */ + } + + const handlerData = { + endTimestamp: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.timestampInSeconds)() * 1000, + startTimestamp, + xhr: xhrOpenThisArg, + }; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('xhr', handlerData); + } + }; + + if ('onreadystatechange' in xhrOpenThisArg && typeof xhrOpenThisArg.onreadystatechange === 'function') { + xhrOpenThisArg.onreadystatechange = new Proxy(xhrOpenThisArg.onreadystatechange, { + apply(originalOnreadystatechange, onreadystatechangeThisArg, onreadystatechangeArgArray) { + onreadystatechangeHandler(); + return originalOnreadystatechange.apply(onreadystatechangeThisArg, onreadystatechangeArgArray); + }, + }); + } else { + xhrOpenThisArg.addEventListener('readystatechange', onreadystatechangeHandler); + } + + // Intercepting `setRequestHeader` to access the request headers of XHR instance. + // This will only work for user/library defined headers, not for the default/browser-assigned headers. + // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`. + xhrOpenThisArg.setRequestHeader = new Proxy(xhrOpenThisArg.setRequestHeader, { + apply( + originalSetRequestHeader, + setRequestHeaderThisArg, + setRequestHeaderArgArray, + ) { + const [header, value] = setRequestHeaderArgArray; + + const xhrInfo = setRequestHeaderThisArg[SENTRY_XHR_DATA_KEY]; + + if (xhrInfo && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.isString)(header) && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.isString)(value)) { + xhrInfo.request_headers[header.toLowerCase()] = value; + } + + return originalSetRequestHeader.apply(setRequestHeaderThisArg, setRequestHeaderArgArray); + }, + }); + + return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); + }, + }); + + // eslint-disable-next-line @typescript-eslint/unbound-method + xhrproto.send = new Proxy(xhrproto.send, { + apply(originalSend, sendThisArg, sendArgArray) { + const sentryXhrData = sendThisArg[SENTRY_XHR_DATA_KEY]; + + if (!sentryXhrData) { + return originalSend.apply(sendThisArg, sendArgArray); + } + + if (sendArgArray[0] !== undefined) { + sentryXhrData.body = sendArgArray[0]; + } + + const handlerData = { + startTimestamp: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.timestampInSeconds)() * 1000, + xhr: sendThisArg, + }; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('xhr', handlerData); + + return originalSend.apply(sendThisArg, sendArgArray); + }, + }); +} + +function parseUrl(url) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.isString)(url)) { + return url; + } + + try { + // url can be a string or URL + // but since URL is not available in IE11, we do not check for it, + // but simply assume it is an URL and return `toString()` from it (which returns the full URL) + // If that fails, we just return undefined + return (url ).toString(); + } catch (e2) {} // eslint-disable-line no-empty + + return undefined; +} + + +//# sourceMappingURL=xhr.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js": +/*!*********************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _addMeasureSpans: () => (/* binding */ _addMeasureSpans), +/* harmony export */ _addResourceSpans: () => (/* binding */ _addResourceSpans), +/* harmony export */ addPerformanceEntries: () => (/* binding */ addPerformanceEntries), +/* harmony export */ startTrackingInteractions: () => (/* binding */ startTrackingInteractions), +/* harmony export */ startTrackingLongAnimationFrames: () => (/* binding */ startTrackingLongAnimationFrames), +/* harmony export */ startTrackingLongTasks: () => (/* binding */ startTrackingLongTasks), +/* harmony export */ startTrackingWebVitals: () => (/* binding */ startTrackingWebVitals) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/measurement.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/url.js"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); +/* harmony import */ var _cls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cls.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/cls.js"); +/* harmony import */ var _instrument_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instrument.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js"); +/* harmony import */ var _web_vitals_lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./web-vitals/lib/getActivationStart.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js"); +/* harmony import */ var _web_vitals_lib_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./web-vitals/lib/getNavigationEntry.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js"); +/* harmony import */ var _web_vitals_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./web-vitals/lib/getVisibilityWatcher.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js"); + + + + + + + + + +/* eslint-disable max-lines */ + +const MAX_INT_AS_BYTES = 2147483647; + +let _performanceCursor = 0; + +let _measurements = {}; +let _lcpEntry; +let _clsEntry; + +/** + * Start tracking web vitals. + * The callback returned by this function can be used to stop tracking & ensure all measurements are final & captured. + * + * @returns A function that forces web vitals collection + */ +function startTrackingWebVitals({ recordClsStandaloneSpans }) { + const performance = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getBrowserPerformanceAPI)(); + if (performance && _sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin) { + // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are + if (performance.mark) { + _types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.performance.mark('sentry-tracing-init'); + } + const fidCleanupCallback = _trackFID(); + const lcpCleanupCallback = _trackLCP(); + const ttfbCleanupCallback = _trackTtfb(); + const clsCleanupCallback = recordClsStandaloneSpans ? (0,_cls_js__WEBPACK_IMPORTED_MODULE_3__.trackClsAsStandaloneSpan)() : _trackCLS(); + + return () => { + fidCleanupCallback(); + lcpCleanupCallback(); + ttfbCleanupCallback(); + clsCleanupCallback && clsCleanupCallback(); + }; + } + + return () => undefined; +} + +/** + * Start tracking long tasks. + */ +function startTrackingLongTasks() { + (0,_instrument_js__WEBPACK_IMPORTED_MODULE_4__.addPerformanceInstrumentationHandler)('longtask', ({ entries }) => { + const parent = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getActiveSpan)(); + if (!parent) { + return; + } + + const { op: parentOp, start_timestamp: parentStartTimestamp } = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.spanToJSON)(parent); + + for (const entry of entries) { + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)((_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin ) + entry.startTime); + const duration = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.duration); + + if (parentOp === 'navigation' && parentStartTimestamp && startTime < parentStartTimestamp) { + // Skip adding a span if the long task started before the navigation started. + // `startAndEndSpan` will otherwise adjust the parent's start time to the span's start + // time, potentially skewing the duration of the actual navigation as reported via our + // routing instrumentations + continue; + } + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(parent, startTime, startTime + duration, { + name: 'Main UI thread blocked', + op: 'ui.long-task', + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }, + }); + } + }); +} + +/** + * Start tracking long animation frames. + */ +function startTrackingLongAnimationFrames() { + // NOTE: the current web-vitals version (3.5.2) does not support long-animation-frame, so + // we directly observe `long-animation-frame` events instead of through the web-vitals + // `observe` helper function. + const observer = new PerformanceObserver(list => { + const parent = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getActiveSpan)(); + if (!parent) { + return; + } + for (const entry of list.getEntries() ) { + if (!entry.scripts[0]) { + continue; + } + + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)((_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin ) + entry.startTime); + + const { start_timestamp: parentStartTimestamp, op: parentOp } = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.spanToJSON)(parent); + + if (parentOp === 'navigation' && parentStartTimestamp && startTime < parentStartTimestamp) { + // Skip adding the span if the long animation frame started before the navigation started. + // `startAndEndSpan` will otherwise adjust the parent's start time to the span's start + // time, potentially skewing the duration of the actual navigation as reported via our + // routing instrumentations + continue; + } + + const duration = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.duration); + + const attributes = { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }; + + const initialScript = entry.scripts[0]; + const { invoker, invokerType, sourceURL, sourceFunctionName, sourceCharPosition } = initialScript; + attributes['browser.script.invoker'] = invoker; + attributes['browser.script.invoker_type'] = invokerType; + if (sourceURL) { + attributes['code.filepath'] = sourceURL; + } + if (sourceFunctionName) { + attributes['code.function'] = sourceFunctionName; + } + if (sourceCharPosition !== -1) { + attributes['browser.script.source_char_position'] = sourceCharPosition; + } + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(parent, startTime, startTime + duration, { + name: 'Main UI thread blocked', + op: 'ui.long-animation-frame', + attributes, + }); + } + }); + + observer.observe({ type: 'long-animation-frame', buffered: true }); +} + +/** + * Start tracking interaction events. + */ +function startTrackingInteractions() { + (0,_instrument_js__WEBPACK_IMPORTED_MODULE_4__.addPerformanceInstrumentationHandler)('event', ({ entries }) => { + const parent = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getActiveSpan)(); + if (!parent) { + return; + } + for (const entry of entries) { + if (entry.name === 'click') { + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)((_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin ) + entry.startTime); + const duration = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.duration); + + const spanOptions = { + name: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.htmlTreeAsString)(entry.target), + op: `ui.interaction.${entry.name}`, + startTime: startTime, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }, + }; + + const componentName = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.getComponentName)(entry.target); + if (componentName) { + spanOptions.attributes['ui.component_name'] = componentName; + } + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(parent, startTime, startTime + duration, spanOptions); + } + } + }); +} + +/** + * Starts tracking the Cumulative Layout Shift on the current page and collects the value and last entry + * to the `_measurements` object which ultimately is applied to the pageload span's measurements. + */ +function _trackCLS() { + return (0,_instrument_js__WEBPACK_IMPORTED_MODULE_4__.addClsInstrumentationHandler)(({ metric }) => { + const entry = metric.entries[metric.entries.length - 1] ; + if (!entry) { + return; + } + _measurements['cls'] = { value: metric.value, unit: '' }; + _clsEntry = entry; + }, true); +} + +/** Starts tracking the Largest Contentful Paint on the current page. */ +function _trackLCP() { + return (0,_instrument_js__WEBPACK_IMPORTED_MODULE_4__.addLcpInstrumentationHandler)(({ metric }) => { + const entry = metric.entries[metric.entries.length - 1]; + if (!entry) { + return; + } + + _measurements['lcp'] = { value: metric.value, unit: 'millisecond' }; + _lcpEntry = entry ; + }, true); +} + +/** Starts tracking the First Input Delay on the current page. */ +function _trackFID() { + return (0,_instrument_js__WEBPACK_IMPORTED_MODULE_4__.addFidInstrumentationHandler)(({ metric }) => { + const entry = metric.entries[metric.entries.length - 1]; + if (!entry) { + return; + } + + const timeOrigin = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin ); + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.startTime); + _measurements['fid'] = { value: metric.value, unit: 'millisecond' }; + _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' }; + }); +} + +function _trackTtfb() { + return (0,_instrument_js__WEBPACK_IMPORTED_MODULE_4__.addTtfbInstrumentationHandler)(({ metric }) => { + const entry = metric.entries[metric.entries.length - 1]; + if (!entry) { + return; + } + + _measurements['ttfb'] = { value: metric.value, unit: 'millisecond' }; + }); +} + +/** Add performance related spans to a transaction */ +function addPerformanceEntries(span, options) { + const performance = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getBrowserPerformanceAPI)(); + if (!performance || !_types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.performance.getEntries || !_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin) { + // Gatekeeper if performance API not available + return; + } + + const timeOrigin = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin); + + const performanceEntries = performance.getEntries(); + + const { op, start_timestamp: transactionStartTime } = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.spanToJSON)(span); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + performanceEntries.slice(_performanceCursor).forEach((entry) => { + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.startTime); + const duration = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)( + // Inexplicably, Chrome sometimes emits a negative duration. We need to work around this. + // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display + // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker. + // TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans. + Math.max(0, entry.duration), + ); + + if (op === 'navigation' && transactionStartTime && timeOrigin + startTime < transactionStartTime) { + return; + } + + switch (entry.entryType) { + case 'navigation': { + _addNavigationSpans(span, entry, timeOrigin); + break; + } + case 'mark': + case 'paint': + case 'measure': { + _addMeasureSpans(span, entry, startTime, duration, timeOrigin); + + // capture web vitals + const firstHidden = (0,_web_vitals_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_8__.getVisibilityWatcher)(); + // Only report if the page wasn't hidden prior to the web vital. + const shouldRecord = entry.startTime < firstHidden.firstHiddenTime; + + if (entry.name === 'first-paint' && shouldRecord) { + _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' }; + } + if (entry.name === 'first-contentful-paint' && shouldRecord) { + _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' }; + } + break; + } + case 'resource': { + _addResourceSpans(span, entry, entry.name , startTime, duration, timeOrigin); + break; + } + // Ignore other entry types. + } + }); + + _performanceCursor = Math.max(performanceEntries.length - 1, 0); + + _trackNavigator(span); + + // Measurements are only available for pageload transactions + if (op === 'pageload') { + _addTtfbRequestTimeToMeasurements(_measurements); + + const fidMark = _measurements['mark.fid']; + if (fidMark && _measurements['fid']) { + // create span for FID + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(span, fidMark.value, fidMark.value + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(_measurements['fid'].value), { + name: 'first input delay', + op: 'ui.action', + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }, + }); + + // Delete mark.fid as we don't want it to be part of final payload + delete _measurements['mark.fid']; + } + + // If FCP is not recorded we should not record the cls value + // according to the new definition of CLS. + // TODO: Check if the first condition is still necessary: `onCLS` already only fires once `onFCP` was called. + if (!('fcp' in _measurements) || !options.recordClsOnPageloadSpan) { + delete _measurements.cls; + } + + Object.entries(_measurements).forEach(([measurementName, measurement]) => { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.setMeasurement)(measurementName, measurement.value, measurement.unit); + }); + + // Set timeOrigin which denotes the timestamp which to base the LCP/FCP/FP/TTFB measurements on + span.setAttribute('performance.timeOrigin', timeOrigin); + + // In prerendering scenarios, where a page might be prefetched and pre-rendered before the user clicks the link, + // the navigation starts earlier than when the user clicks it. Web Vitals should always be based on the + // user-perceived time, so they are not reported from the actual start of the navigation, but rather from the + // time where the user actively started the navigation, for example by clicking a link. + // This is user action is called "activation" and the time between navigation and activation is stored in + // the `activationStart` attribute of the "navigation" PerformanceEntry. + span.setAttribute('performance.activationStart', (0,_web_vitals_lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_10__.getActivationStart)()); + + _setWebVitalAttributes(span); + } + + _lcpEntry = undefined; + _clsEntry = undefined; + _measurements = {}; +} + +/** Create measure related spans */ +function _addMeasureSpans( + span, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + entry, + startTime, + duration, + timeOrigin, +) { + const navEntry = (0,_web_vitals_lib_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_11__.getNavigationEntry)(); + const requestTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(navEntry ? navEntry.requestStart : 0); + // Because performance.measure accepts arbitrary timestamps it can produce + // spans that happen before the browser even makes a request for the page. + // + // An example of this is the automatically generated Next.js-before-hydration + // spans created by the Next.js framework. + // + // To prevent this we will pin the start timestamp to the request start time + // This does make duration inaccurate, so if this does happen, we will add + // an attribute to the span + const measureStartTimestamp = timeOrigin + Math.max(startTime, requestTime); + const startTimeStamp = timeOrigin + startTime; + const measureEndTimestamp = startTimeStamp + duration; + + const attributes = { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', + }; + + if (measureStartTimestamp !== startTimeStamp) { + attributes['sentry.browser.measure_happened_before_request'] = true; + attributes['sentry.browser.measure_start_time'] = measureStartTimestamp; + } + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(span, measureStartTimestamp, measureEndTimestamp, { + name: entry.name , + op: entry.entryType , + attributes, + }); + + return measureStartTimestamp; +} + +/** Instrument navigation entries */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _addNavigationSpans(span, entry, timeOrigin) { + ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => { + _addPerformanceNavigationTiming(span, entry, event, timeOrigin); + }); + _addPerformanceNavigationTiming(span, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd'); + _addPerformanceNavigationTiming(span, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart'); + _addPerformanceNavigationTiming(span, entry, 'domainLookup', timeOrigin, 'DNS'); + _addRequest(span, entry, timeOrigin); +} + +/** Create performance navigation related spans */ +function _addPerformanceNavigationTiming( + span, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + entry, + event, + timeOrigin, + name, + eventEnd, +) { + const end = eventEnd ? (entry[eventEnd] ) : (entry[`${event}End`] ); + const start = entry[`${event}Start`] ; + if (!start || !end) { + return; + } + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(span, timeOrigin + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(start), timeOrigin + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(end), { + op: `browser.${name || event}`, + name: entry.name, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }, + }); +} + +/** Create request and response related spans */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _addRequest(span, entry, timeOrigin) { + const requestStartTimestamp = timeOrigin + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.requestStart ); + const responseEndTimestamp = timeOrigin + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.responseEnd ); + const responseStartTimestamp = timeOrigin + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(entry.responseStart ); + if (entry.responseEnd) { + // It is possible that we are collecting these metrics when the page hasn't finished loading yet, for example when the HTML slowly streams in. + // In this case, ie. when the document request hasn't finished yet, `entry.responseEnd` will be 0. + // In order not to produce faulty spans, where the end timestamp is before the start timestamp, we will only collect + // these spans when the responseEnd value is available. The backend (Relay) would drop the entire span if it contained faulty spans. + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(span, requestStartTimestamp, responseEndTimestamp, { + op: 'browser.request', + name: entry.name, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }, + }); + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(span, responseStartTimestamp, responseEndTimestamp, { + op: 'browser.response', + name: entry.name, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + }, + }); + } +} + +/** Create resource-related spans */ +function _addResourceSpans( + span, + entry, + resourceUrl, + startTime, + duration, + timeOrigin, +) { + // we already instrument based on fetch and xhr, so we don't need to + // duplicate spans here. + if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') { + return; + } + + const parsedUrl = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_12__.parseUrl)(resourceUrl); + + const attributes = { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', + }; + setResourceEntrySizeData(attributes, entry, 'transferSize', 'http.response_transfer_size'); + setResourceEntrySizeData(attributes, entry, 'encodedBodySize', 'http.response_content_length'); + setResourceEntrySizeData(attributes, entry, 'decodedBodySize', 'http.decoded_response_content_length'); + + if (entry.deliveryType != null) { + attributes['http.response_delivery_type'] = entry.deliveryType; + } + + if ('renderBlockingStatus' in entry) { + attributes['resource.render_blocking_status'] = entry.renderBlockingStatus; + } + if (parsedUrl.protocol) { + attributes['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it. + } + + if (parsedUrl.host) { + attributes['server.address'] = parsedUrl.host; + } + + attributes['url.same_origin'] = resourceUrl.includes(_types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.location.origin); + + const startTimestamp = timeOrigin + startTime; + const endTimestamp = startTimestamp + duration; + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startAndEndSpan)(span, startTimestamp, endTimestamp, { + name: resourceUrl.replace(_types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.location.origin, ''), + op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other', + attributes, + }); +} + +/** + * Capture the information of the user agent. + */ +function _trackNavigator(span) { + const navigator = _types_js__WEBPACK_IMPORTED_MODULE_2__.WINDOW.navigator ; + if (!navigator) { + return; + } + + // track network connectivity + const connection = navigator.connection; + if (connection) { + if (connection.effectiveType) { + span.setAttribute('effectiveConnectionType', connection.effectiveType); + } + + if (connection.type) { + span.setAttribute('connectionType', connection.type); + } + + if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMeasurementValue)(connection.rtt)) { + _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' }; + } + } + + if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMeasurementValue)(navigator.deviceMemory)) { + span.setAttribute('deviceMemory', `${navigator.deviceMemory} GB`); + } + + if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMeasurementValue)(navigator.hardwareConcurrency)) { + span.setAttribute('hardwareConcurrency', String(navigator.hardwareConcurrency)); + } +} + +/** Add LCP / CLS data to span to allow debugging */ +function _setWebVitalAttributes(span) { + if (_lcpEntry) { + // Capture Properties of the LCP element that contributes to the LCP. + + if (_lcpEntry.element) { + span.setAttribute('lcp.element', (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.htmlTreeAsString)(_lcpEntry.element)); + } + + if (_lcpEntry.id) { + span.setAttribute('lcp.id', _lcpEntry.id); + } + + if (_lcpEntry.url) { + // Trim URL to the first 200 characters. + span.setAttribute('lcp.url', _lcpEntry.url.trim().slice(0, 200)); + } + + if (_lcpEntry.loadTime != null) { + // loadTime is the time of LCP that's related to receiving the LCP element response.. + span.setAttribute('lcp.loadTime', _lcpEntry.loadTime); + } + + if (_lcpEntry.renderTime != null) { + // renderTime is loadTime + rendering time + // it's 0 if the LCP element is loaded from a 3rd party origin that doesn't send the + // `Timing-Allow-Origin` header. + span.setAttribute('lcp.renderTime', _lcpEntry.renderTime); + } + + span.setAttribute('lcp.size', _lcpEntry.size); + } + + // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift + if (_clsEntry && _clsEntry.sources) { + _clsEntry.sources.forEach((source, index) => + span.setAttribute(`cls.source.${index + 1}`, (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.htmlTreeAsString)(source.node)), + ); + } +} + +function setResourceEntrySizeData( + attributes, + entry, + key, + dataKey, +) { + const entryVal = entry[key]; + if (entryVal != null && entryVal < MAX_INT_AS_BYTES) { + attributes[dataKey] = entryVal; + } +} + +/** + * Add ttfb request time information to measurements. + * + * ttfb information is added via vendored web vitals library. + */ +function _addTtfbRequestTimeToMeasurements(_measurements) { + const navEntry = (0,_web_vitals_lib_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_11__.getNavigationEntry)(); + if (!navEntry) { + return; + } + + const { responseStart, requestStart } = navEntry; + + if (requestStart <= responseStart) { + _measurements['ttfb.requestTime'] = { + value: responseStart - requestStart, + unit: 'millisecond', + }; + } +} + + +//# sourceMappingURL=browserMetrics.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/cls.js": +/*!**********************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/cls.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ trackClsAsStandaloneSpan: () => (/* binding */ trackClsAsStandaloneSpan) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js"); +/* harmony import */ var _instrument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instrument.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js"); +/* harmony import */ var _web_vitals_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./web-vitals/lib/onHidden.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js"); + + + + + + +/** + * Starts tracking the Cumulative Layout Shift on the current page and collects the value once + * + * - the page visibility is hidden + * - a navigation span is started (to stop CLS measurement for SPA soft navigations) + * + * Once either of these events triggers, the CLS value is sent as a standalone span and we stop + * measuring CLS. + */ +function trackClsAsStandaloneSpan() { + let standaloneCLsValue = 0; + let standaloneClsEntry; + let pageloadSpanId; + + if (!supportsLayoutShift()) { + return; + } + + let sentSpan = false; + function _collectClsOnce() { + if (sentSpan) { + return; + } + sentSpan = true; + if (pageloadSpanId) { + sendStandaloneClsSpan(standaloneCLsValue, standaloneClsEntry, pageloadSpanId); + } + cleanupClsHandler(); + } + + const cleanupClsHandler = (0,_instrument_js__WEBPACK_IMPORTED_MODULE_0__.addClsInstrumentationHandler)(({ metric }) => { + const entry = metric.entries[metric.entries.length - 1] ; + if (!entry) { + return; + } + standaloneCLsValue = metric.value; + standaloneClsEntry = entry; + }, true); + + // use pagehide event from web-vitals + (0,_web_vitals_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_1__.onHidden)(() => { + _collectClsOnce(); + }); + + // Since the call chain of this function is synchronous and evaluates before the SDK client is created, + // we need to wait with subscribing to a client hook until the client is created. Therefore, we defer + // to the next tick after the SDK setup. + setTimeout(() => { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getClient)(); + + if (!client) { + return; + } + + const unsubscribeStartNavigation = client.on('startNavigationSpan', () => { + _collectClsOnce(); + unsubscribeStartNavigation && unsubscribeStartNavigation(); + }); + + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getActiveSpan)(); + const rootSpan = activeSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(activeSpan); + const spanJSON = rootSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(rootSpan); + if (spanJSON && spanJSON.op === 'pageload') { + pageloadSpanId = rootSpan.spanContext().spanId; + } + }, 0); +} + +function sendStandaloneClsSpan(clsValue, entry, pageloadSpanId) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_4__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_5__.logger.log(`Sending CLS span (${clsValue})`); + + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.msToSec)((_sentry_core__WEBPACK_IMPORTED_MODULE_7__.browserPerformanceTimeOrigin || 0) + ((entry && entry.startTime) || 0)); + const routeName = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getCurrentScope)().getScopeData().transactionName; + + const name = entry ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.htmlTreeAsString)(entry.sources[0] && entry.sources[0].node) : 'Layout shift'; + + const attributes = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.dropUndefinedKeys)({ + [_sentry_core__WEBPACK_IMPORTED_MODULE_10__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.cls', + [_sentry_core__WEBPACK_IMPORTED_MODULE_10__.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.webvital.cls', + [_sentry_core__WEBPACK_IMPORTED_MODULE_10__.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: (entry && entry.duration) || 0, + // attach the pageload span id to the CLS span so that we can link them in the UI + 'sentry.pageload.span_id': pageloadSpanId, + }); + + const span = (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.startStandaloneWebVitalSpan)({ + name, + transaction: routeName, + attributes, + startTime, + }); + + if (span) { + span.addEvent('cls', { + [_sentry_core__WEBPACK_IMPORTED_MODULE_10__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: '', + [_sentry_core__WEBPACK_IMPORTED_MODULE_10__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue, + }); + + // LayoutShift performance entries always have a duration of 0, so we don't need to add `entry.duration` here + // see: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/duration + span.end(startTime); + } +} + +function supportsLayoutShift() { + try { + return PerformanceObserver.supportedEntryTypes.includes('layout-shift'); + } catch (e) { + return false; + } +} + + +//# sourceMappingURL=cls.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/inp.js": +/*!**********************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/inp.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ registerInpInteractionListener: () => (/* binding */ registerInpInteractionListener), +/* harmony export */ startTrackingINP: () => (/* binding */ startTrackingINP) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _instrument_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./instrument.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js"); + + + + +const LAST_INTERACTIONS = []; +const INTERACTIONS_SPAN_MAP = new Map(); + +/** + * Start tracking INP webvital events. + */ +function startTrackingINP() { + const performance = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getBrowserPerformanceAPI)(); + if (performance && _sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin) { + const inpCallback = _trackINP(); + + return () => { + inpCallback(); + }; + } + + return () => undefined; +} + +const INP_ENTRY_MAP = { + click: 'click', + pointerdown: 'click', + pointerup: 'click', + mousedown: 'click', + mouseup: 'click', + touchstart: 'click', + touchend: 'click', + mouseover: 'hover', + mouseout: 'hover', + mouseenter: 'hover', + mouseleave: 'hover', + pointerover: 'hover', + pointerout: 'hover', + pointerenter: 'hover', + pointerleave: 'hover', + dragstart: 'drag', + dragend: 'drag', + drag: 'drag', + dragenter: 'drag', + dragleave: 'drag', + dragover: 'drag', + drop: 'drag', + keydown: 'press', + keyup: 'press', + keypress: 'press', + input: 'press', +}; + +/** Starts tracking the Interaction to Next Paint on the current page. */ +function _trackINP() { + return (0,_instrument_js__WEBPACK_IMPORTED_MODULE_2__.addInpInstrumentationHandler)(({ metric }) => { + if (metric.value == undefined) { + return; + } + + const entry = metric.entries.find(entry => entry.duration === metric.value && INP_ENTRY_MAP[entry.name]); + + if (!entry) { + return; + } + + const { interactionId } = entry; + const interactionType = INP_ENTRY_MAP[entry.name]; + + /** Build the INP span, create an envelope from the span, and then send the envelope */ + const startTime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)((_sentry_core__WEBPACK_IMPORTED_MODULE_1__.browserPerformanceTimeOrigin ) + entry.startTime); + const duration = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.msToSec)(metric.value); + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getActiveSpan)(); + const rootSpan = activeSpan ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(activeSpan) : undefined; + + // We first try to lookup the span from our INTERACTIONS_SPAN_MAP, + // where we cache the route per interactionId + const cachedSpan = interactionId != null ? INTERACTIONS_SPAN_MAP.get(interactionId) : undefined; + + const spanToUse = cachedSpan || rootSpan; + + // Else, we try to use the active span. + // Finally, we fall back to look at the transactionName on the scope + const routeName = spanToUse ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(spanToUse).description : (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.getCurrentScope)().getScopeData().transactionName; + + const name = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.htmlTreeAsString)(entry.target); + const attributes = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.dropUndefinedKeys)({ + [_sentry_core__WEBPACK_IMPORTED_MODULE_7__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.inp', + [_sentry_core__WEBPACK_IMPORTED_MODULE_7__.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `ui.interaction.${interactionType}`, + [_sentry_core__WEBPACK_IMPORTED_MODULE_7__.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry.duration, + }); + + const span = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startStandaloneWebVitalSpan)({ + name, + transaction: routeName, + attributes, + startTime, + }); + + if (span) { + span.addEvent('inp', { + [_sentry_core__WEBPACK_IMPORTED_MODULE_7__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: 'millisecond', + [_sentry_core__WEBPACK_IMPORTED_MODULE_7__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: metric.value, + }); + + span.end(startTime + duration); + } + }); +} + +/** + * Register a listener to cache route information for INP interactions. + * TODO(v9): `latestRoute` no longer needs to be passed in and will be removed in v9. + */ +function registerInpInteractionListener(_latestRoute) { + const handleEntries = ({ entries }) => { + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getActiveSpan)(); + const activeRootSpan = activeSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(activeSpan); + + entries.forEach(entry => { + if (!(0,_instrument_js__WEBPACK_IMPORTED_MODULE_2__.isPerformanceEventTiming)(entry) || !activeRootSpan) { + return; + } + + const interactionId = entry.interactionId; + if (interactionId == null) { + return; + } + + // If the interaction was already recorded before, nothing more to do + if (INTERACTIONS_SPAN_MAP.has(interactionId)) { + return; + } + + // We keep max. 10 interactions in the list, then remove the oldest one & clean up + if (LAST_INTERACTIONS.length > 10) { + const last = LAST_INTERACTIONS.shift() ; + INTERACTIONS_SPAN_MAP.delete(last); + } + + // We add the interaction to the list of recorded interactions + // and store the span for this interaction + LAST_INTERACTIONS.push(interactionId); + INTERACTIONS_SPAN_MAP.set(interactionId, activeRootSpan); + }); + }; + + (0,_instrument_js__WEBPACK_IMPORTED_MODULE_2__.addPerformanceInstrumentationHandler)('event', handleEntries); + (0,_instrument_js__WEBPACK_IMPORTED_MODULE_2__.addPerformanceInstrumentationHandler)('first-input', handleEntries); +} + + +//# sourceMappingURL=inp.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js": +/*!*****************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addClsInstrumentationHandler: () => (/* binding */ addClsInstrumentationHandler), +/* harmony export */ addFidInstrumentationHandler: () => (/* binding */ addFidInstrumentationHandler), +/* harmony export */ addInpInstrumentationHandler: () => (/* binding */ addInpInstrumentationHandler), +/* harmony export */ addLcpInstrumentationHandler: () => (/* binding */ addLcpInstrumentationHandler), +/* harmony export */ addPerformanceInstrumentationHandler: () => (/* binding */ addPerformanceInstrumentationHandler), +/* harmony export */ addTtfbInstrumentationHandler: () => (/* binding */ addTtfbInstrumentationHandler), +/* harmony export */ isPerformanceEventTiming: () => (/* binding */ isPerformanceEventTiming) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js"); +/* harmony import */ var _web_vitals_getCLS_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./web-vitals/getCLS.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getCLS.js"); +/* harmony import */ var _web_vitals_getFID_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./web-vitals/getFID.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getFID.js"); +/* harmony import */ var _web_vitals_getINP_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./web-vitals/getINP.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getINP.js"); +/* harmony import */ var _web_vitals_getLCP_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./web-vitals/getLCP.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getLCP.js"); +/* harmony import */ var _web_vitals_lib_observe_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./web-vitals/lib/observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); +/* harmony import */ var _web_vitals_onTTFB_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./web-vitals/onTTFB.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onTTFB.js"); + + + + + + + + + +const handlers = {}; +const instrumented = {}; + +let _previousCls; +let _previousFid; +let _previousLcp; +let _previousTtfb; +let _previousInp; + +/** + * Add a callback that will be triggered when a CLS metric is available. + * Returns a cleanup callback which can be called to remove the instrumentation handler. + * + * Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called. + * This will lead to the CLS being finalized and frozen. + */ +function addClsInstrumentationHandler( + callback, + stopOnCallback = false, +) { + return addMetricObserver('cls', callback, instrumentCls, _previousCls, stopOnCallback); +} + +/** + * Add a callback that will be triggered when a LCP metric is available. + * Returns a cleanup callback which can be called to remove the instrumentation handler. + * + * Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called. + * This will lead to the LCP being finalized and frozen. + */ +function addLcpInstrumentationHandler( + callback, + stopOnCallback = false, +) { + return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp, stopOnCallback); +} + +/** + * Add a callback that will be triggered when a FID metric is available. + * Returns a cleanup callback which can be called to remove the instrumentation handler. + */ +function addFidInstrumentationHandler(callback) { + return addMetricObserver('fid', callback, instrumentFid, _previousFid); +} + +/** + * Add a callback that will be triggered when a FID metric is available. + */ +function addTtfbInstrumentationHandler(callback) { + return addMetricObserver('ttfb', callback, instrumentTtfb, _previousTtfb); +} + +/** + * Add a callback that will be triggered when a INP metric is available. + * Returns a cleanup callback which can be called to remove the instrumentation handler. + */ +function addInpInstrumentationHandler( + callback, +) { + return addMetricObserver('inp', callback, instrumentInp, _previousInp); +} + +/** + * Add a callback that will be triggered when a performance observer is triggered, + * and receives the entries of the observer. + * Returns a cleanup callback which can be called to remove the instrumentation handler. + */ +function addPerformanceInstrumentationHandler( + type, + callback, +) { + addHandler(type, callback); + + if (!instrumented[type]) { + instrumentPerformanceObserver(type); + instrumented[type] = true; + } + + return getCleanupCallback(type, callback); +} + +/** Trigger all handlers of a given type. */ +function triggerHandlers(type, data) { + const typeHandlers = handlers[type]; + + if (!typeHandlers || !typeHandlers.length) { + return; + } + + for (const handler of typeHandlers) { + try { + handler(data); + } catch (e) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && + _sentry_core__WEBPACK_IMPORTED_MODULE_1__.logger.error( + `Error while triggering instrumentation handler.\nType: ${type}\nName: ${(0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(handler)}\nError:`, + e, + ); + } + } +} + +function instrumentCls() { + return (0,_web_vitals_getCLS_js__WEBPACK_IMPORTED_MODULE_3__.onCLS)( + metric => { + triggerHandlers('cls', { + metric, + }); + _previousCls = metric; + }, + // We want the callback to be called whenever the CLS value updates. + // By default, the callback is only called when the tab goes to the background. + { reportAllChanges: true }, + ); +} + +function instrumentFid() { + return (0,_web_vitals_getFID_js__WEBPACK_IMPORTED_MODULE_4__.onFID)(metric => { + triggerHandlers('fid', { + metric, + }); + _previousFid = metric; + }); +} + +function instrumentLcp() { + return (0,_web_vitals_getLCP_js__WEBPACK_IMPORTED_MODULE_5__.onLCP)( + metric => { + triggerHandlers('lcp', { + metric, + }); + _previousLcp = metric; + }, + // We want the callback to be called whenever the LCP value updates. + // By default, the callback is only called when the tab goes to the background. + { reportAllChanges: true }, + ); +} + +function instrumentTtfb() { + return (0,_web_vitals_onTTFB_js__WEBPACK_IMPORTED_MODULE_6__.onTTFB)(metric => { + triggerHandlers('ttfb', { + metric, + }); + _previousTtfb = metric; + }); +} + +function instrumentInp() { + return (0,_web_vitals_getINP_js__WEBPACK_IMPORTED_MODULE_7__.onINP)(metric => { + triggerHandlers('inp', { + metric, + }); + _previousInp = metric; + }); +} + +function addMetricObserver( + type, + callback, + instrumentFn, + previousValue, + stopOnCallback = false, +) { + addHandler(type, callback); + + let stopListening; + + if (!instrumented[type]) { + stopListening = instrumentFn(); + instrumented[type] = true; + } + + if (previousValue) { + callback({ metric: previousValue }); + } + + return getCleanupCallback(type, callback, stopOnCallback ? stopListening : undefined); +} + +function instrumentPerformanceObserver(type) { + const options = {}; + + // Special per-type options we want to use + if (type === 'event') { + options.durationThreshold = 0; + } + + (0,_web_vitals_lib_observe_js__WEBPACK_IMPORTED_MODULE_8__.observe)( + type, + entries => { + triggerHandlers(type, { entries }); + }, + options, + ); +} + +function addHandler(type, handler) { + handlers[type] = handlers[type] || []; + (handlers[type] ).push(handler); +} + +// Get a callback which can be called to remove the instrumentation handler +function getCleanupCallback( + type, + callback, + stopListening, +) { + return () => { + if (stopListening) { + stopListening(); + } + + const typeHandlers = handlers[type]; + + if (!typeHandlers) { + return; + } + + const index = typeHandlers.indexOf(callback); + if (index !== -1) { + typeHandlers.splice(index, 1); + } + }; +} + +/** + * Check if a PerformanceEntry is a PerformanceEventTiming by checking for the `duration` property. + */ +function isPerformanceEventTiming(entry) { + return 'duration' in entry; +} + + +//# sourceMappingURL=instrument.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js": +/*!************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getBrowserPerformanceAPI: () => (/* binding */ getBrowserPerformanceAPI), +/* harmony export */ isMeasurementValue: () => (/* binding */ isMeasurementValue), +/* harmony export */ msToSec: () => (/* binding */ msToSec), +/* harmony export */ startAndEndSpan: () => (/* binding */ startAndEndSpan), +/* harmony export */ startStandaloneWebVitalSpan: () => (/* binding */ startStandaloneWebVitalSpan) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/trace.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + + +/** + * Checks if a given value is a valid measurement value. + */ +function isMeasurementValue(value) { + return typeof value === 'number' && isFinite(value); +} + +/** + * Helper function to start child on transactions. This function will make sure that the transaction will + * use the start timestamp of the created child span if it is earlier than the transactions actual + * start timestamp. + */ +function startAndEndSpan( + parentSpan, + startTimeInSeconds, + endTime, + { ...ctx }, +) { + const parentStartTime = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.spanToJSON)(parentSpan).start_timestamp; + if (parentStartTime && parentStartTime > startTimeInSeconds) { + // We can only do this for SentrySpans... + if (typeof (parentSpan ).updateStartTime === 'function') { + (parentSpan ).updateStartTime(startTimeInSeconds); + } + } + + // The return value only exists for tests + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.withActiveSpan)(parentSpan, () => { + const span = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.startInactiveSpan)({ + startTime: startTimeInSeconds, + ...ctx, + }); + + if (span) { + span.end(endTime); + } + + return span; + }); +} + +/** + * Starts an inactive, standalone span used to send web vital values to Sentry. + * DO NOT use this for arbitrary spans, as these spans require special handling + * during ingestion to extract metrics. + * + * This function adds a bunch of attributes and data to the span that's shared + * by all web vital standalone spans. However, you need to take care of adding + * the actual web vital value as an event to the span. Also, you need to assign + * a transaction name and some other values that are specific to the web vital. + * + * Ultimately, you also need to take care of ending the span to send it off. + * + * @param options + * + * @returns an inactive, standalone and NOT YET ended span + */ +function startStandaloneWebVitalSpan(options) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getClient)(); + if (!client) { + return; + } + + const { name, transaction, attributes: passedAttributes, startTime } = options; + + const { release, environment } = client.getOptions(); + // We need to get the replay, user, and activeTransaction from the current scope + // so that we can associate replay id, profile id, and a user display to the span + const replay = client.getIntegrationByName('Replay'); + const replayId = replay && replay.getReplayId(); + + const scope = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getCurrentScope)(); + + const user = scope.getUser(); + const userDisplay = user !== undefined ? user.email || user.id || user.ip_address : undefined; + + let profileId; + try { + // @ts-expect-error skip optional chaining to save bundle size with try catch + profileId = scope.getScopeData().contexts.profile.profile_id; + } catch (e) { + // do nothing + } + + const attributes = { + release, + environment, + + user: userDisplay || undefined, + profile_id: profileId || undefined, + replay_id: replayId || undefined, + + transaction, + + // Web vital score calculation relies on the user agent to account for different + // browsers setting different thresholds for what is considered a good/meh/bad value. + // For example: Chrome vs. Chrome Mobile + 'user_agent.original': _types_js__WEBPACK_IMPORTED_MODULE_3__.WINDOW.navigator && _types_js__WEBPACK_IMPORTED_MODULE_3__.WINDOW.navigator.userAgent, + + ...passedAttributes, + }; + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.startInactiveSpan)({ + name, + attributes, + startTime, + experimental: { + standalone: true, + }, + }); +} + +/** Get the browser performance API. */ +function getBrowserPerformanceAPI() { + // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are + return _types_js__WEBPACK_IMPORTED_MODULE_3__.WINDOW && _types_js__WEBPACK_IMPORTED_MODULE_3__.WINDOW.addEventListener && _types_js__WEBPACK_IMPORTED_MODULE_3__.WINDOW.performance; +} + +/** + * Converts from milliseconds to seconds + * @param time time in ms + */ +function msToSec(time) { + return time / 1000; +} + + +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getCLS.js": +/*!************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getCLS.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CLSThresholds: () => (/* binding */ CLSThresholds), +/* harmony export */ onCLS: () => (/* binding */ onCLS) +/* harmony export */ }); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/bindReporter.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/initMetric.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/onHidden.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js"); +/* harmony import */ var _lib_runOnce_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/runOnce.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js"); +/* harmony import */ var _onFCP_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./onFCP.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onFCP.js"); + + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** Thresholds for CLS. See https://web.dev/articles/cls#what_is_a_good_cls_score */ +const CLSThresholds = [0.1, 0.25]; + +/** + * Calculates the [CLS](https://web.dev/articles/cls) value for the current page and + * calls the `callback` function once the value is ready to be reported, along + * with all `layout-shift` performance entries that were used in the metric + * value calculation. The reported value is a `double` (corresponding to a + * [layout shift score](https://web.dev/articles/cls#layout_shift_score)). + * + * If the `reportAllChanges` configuration option is set to `true`, the + * `callback` function will be called as soon as the value is initially + * determined as well as any time the value changes throughout the page + * lifespan. + * + * _**Important:** CLS should be continually monitored for changes throughout + * the entire lifespan of a page—including if the user returns to the page after + * it's been hidden/backgrounded. However, since browsers often [will not fire + * additional callbacks once the user has backgrounded a + * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden), + * `callback` is always called when the page's visibility state changes to + * hidden. As a result, the `callback` function might be called multiple times + * during the same page load._ + */ +const onCLS = (onReport, opts = {}) => { + // Start monitoring FCP so we can only report CLS if FCP is also reported. + // Note: this is done to match the current behavior of CrUX. + (0,_onFCP_js__WEBPACK_IMPORTED_MODULE_0__.onFCP)( + (0,_lib_runOnce_js__WEBPACK_IMPORTED_MODULE_1__.runOnce)(() => { + const metric = (0,_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__.initMetric)('CLS', 0); + let report; + + let sessionValue = 0; + let sessionEntries = []; + + const handleEntries = (entries) => { + entries.forEach(entry => { + // Only count layout shifts without recent user input. + if (!entry.hadRecentInput) { + const firstSessionEntry = sessionEntries[0]; + const lastSessionEntry = sessionEntries[sessionEntries.length - 1]; + + // If the entry occurred less than 1 second after the previous entry + // and less than 5 seconds after the first entry in the session, + // include the entry in the current session. Otherwise, start a new + // session. + if ( + sessionValue && + firstSessionEntry && + lastSessionEntry && + entry.startTime - lastSessionEntry.startTime < 1000 && + entry.startTime - firstSessionEntry.startTime < 5000 + ) { + sessionValue += entry.value; + sessionEntries.push(entry); + } else { + sessionValue = entry.value; + sessionEntries = [entry]; + } + } + }); + + // If the current session value is larger than the current CLS value, + // update CLS and the entries contributing to it. + if (sessionValue > metric.value) { + metric.value = sessionValue; + metric.entries = sessionEntries; + report(); + } + }; + + const po = (0,_lib_observe_js__WEBPACK_IMPORTED_MODULE_3__.observe)('layout-shift', handleEntries); + if (po) { + report = (0,_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_4__.bindReporter)(onReport, metric, CLSThresholds, opts.reportAllChanges); + + (0,_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_5__.onHidden)(() => { + handleEntries(po.takeRecords() ); + report(true); + }); + + // Queue a task to report (if nothing else triggers a report first). + // This allows CLS to be reported as soon as FCP fires when + // `reportAllChanges` is true. + setTimeout(report, 0); + } + }), + ); +}; + + +//# sourceMappingURL=getCLS.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getFID.js": +/*!************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getFID.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ FIDThresholds: () => (/* binding */ FIDThresholds), +/* harmony export */ onFID: () => (/* binding */ onFID) +/* harmony export */ }); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/bindReporter.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js"); +/* harmony import */ var _lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/getVisibilityWatcher.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/initMetric.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/onHidden.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js"); +/* harmony import */ var _lib_runOnce_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/runOnce.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js"); +/* harmony import */ var _lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/whenActivated.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js"); + + + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** Thresholds for FID. See https://web.dev/articles/fid#what_is_a_good_fid_score */ +const FIDThresholds = [100, 300]; + +/** + * Calculates the [FID](https://web.dev/articles/fid) value for the current page and + * calls the `callback` function once the value is ready, along with the + * relevant `first-input` performance entry used to determine the value. The + * reported value is a `DOMHighResTimeStamp`. + * + * _**Important:** since FID is only reported after the user interacts with the + * page, it's possible that it will not be reported for some page loads._ + */ +const onFID = (onReport, opts = {}) => { + (0,_lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_0__.whenActivated)(() => { + const visibilityWatcher = (0,_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__.getVisibilityWatcher)(); + const metric = (0,_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__.initMetric)('FID'); + // eslint-disable-next-line prefer-const + let report; + + const handleEntry = (entry) => { + // Only report if the page wasn't hidden prior to the first input. + if (entry.startTime < visibilityWatcher.firstHiddenTime) { + metric.value = entry.processingStart - entry.startTime; + metric.entries.push(entry); + report(true); + } + }; + + const handleEntries = (entries) => { + (entries ).forEach(handleEntry); + }; + + const po = (0,_lib_observe_js__WEBPACK_IMPORTED_MODULE_3__.observe)('first-input', handleEntries); + report = (0,_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_4__.bindReporter)(onReport, metric, FIDThresholds, opts.reportAllChanges); + + if (po) { + (0,_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_5__.onHidden)( + (0,_lib_runOnce_js__WEBPACK_IMPORTED_MODULE_6__.runOnce)(() => { + handleEntries(po.takeRecords() ); + po.disconnect(); + }), + ); + } + }); +}; + + +//# sourceMappingURL=getFID.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getINP.js": +/*!************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getINP.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ INPThresholds: () => (/* binding */ INPThresholds), +/* harmony export */ onINP: () => (/* binding */ onINP) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/bindReporter.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/initMetric.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/onHidden.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js"); +/* harmony import */ var _lib_polyfills_interactionCountPolyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/polyfills/interactionCountPolyfill.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js"); +/* harmony import */ var _lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/whenActivated.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js"); + + + + + + + + +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** Thresholds for INP. See https://web.dev/articles/inp#what_is_a_good_inp_score */ +const INPThresholds = [200, 500]; + +// Used to store the interaction count after a bfcache restore, since p98 +// interaction latencies should only consider the current navigation. +const prevInteractionCount = 0; + +/** + * Returns the interaction count since the last bfcache restore (or for the + * full page lifecycle if there were no bfcache restores). + */ +const getInteractionCountForNavigation = () => { + return (0,_lib_polyfills_interactionCountPolyfill_js__WEBPACK_IMPORTED_MODULE_0__.getInteractionCount)() - prevInteractionCount; +}; + +// To prevent unnecessary memory usage on pages with lots of interactions, +// store at most 10 of the longest interactions to consider as INP candidates. +const MAX_INTERACTIONS_TO_CONSIDER = 10; + +// A list of longest interactions on the page (by latency) sorted so the +// longest one is first. The list is as most MAX_INTERACTIONS_TO_CONSIDER long. +const longestInteractionList = []; + +// A mapping of longest interactions by their interaction ID. +// This is used for faster lookup. +const longestInteractionMap = {}; + +/** + * Takes a performance entry and adds it to the list of worst interactions + * if its duration is long enough to make it among the worst. If the + * entry is part of an existing interaction, it is merged and the latency + * and entries list is updated as needed. + */ +const processEntry = (entry) => { + // The least-long of the 10 longest interactions. + const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1]; + + const existingInteraction = longestInteractionMap[entry.interactionId]; + + // Only process the entry if it's possibly one of the ten longest, + // or if it's part of an existing interaction. + if ( + existingInteraction || + longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER || + (minLongestInteraction && entry.duration > minLongestInteraction.latency) + ) { + // If the interaction already exists, update it. Otherwise create one. + if (existingInteraction) { + existingInteraction.entries.push(entry); + existingInteraction.latency = Math.max(existingInteraction.latency, entry.duration); + } else { + const interaction = { + id: entry.interactionId, + latency: entry.duration, + entries: [entry], + }; + longestInteractionMap[interaction.id] = interaction; + longestInteractionList.push(interaction); + } + + // Sort the entries by latency (descending) and keep only the top ten. + longestInteractionList.sort((a, b) => b.latency - a.latency); + longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach(i => { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete longestInteractionMap[i.id]; + }); + } +}; + +/** + * Returns the estimated p98 longest interaction based on the stored + * interaction candidates and the interaction count for the current page. + */ +const estimateP98LongestInteraction = () => { + const candidateInteractionIndex = Math.min( + longestInteractionList.length - 1, + Math.floor(getInteractionCountForNavigation() / 50), + ); + + return longestInteractionList[candidateInteractionIndex]; +}; + +/** + * Calculates the [INP](https://web.dev/articles/inp) value for the current + * page and calls the `callback` function once the value is ready, along with + * the `event` performance entries reported for that interaction. The reported + * value is a `DOMHighResTimeStamp`. + * + * A custom `durationThreshold` configuration option can optionally be passed to + * control what `event-timing` entries are considered for INP reporting. The + * default threshold is `40`, which means INP scores of less than 40 are + * reported as 0. Note that this will not affect your 75th percentile INP value + * unless that value is also less than 40 (well below the recommended + * [good](https://web.dev/articles/inp#what_is_a_good_inp_score) threshold). + * + * If the `reportAllChanges` configuration option is set to `true`, the + * `callback` function will be called as soon as the value is initially + * determined as well as any time the value changes throughout the page + * lifespan. + * + * _**Important:** INP should be continually monitored for changes throughout + * the entire lifespan of a page—including if the user returns to the page after + * it's been hidden/backgrounded. However, since browsers often [will not fire + * additional callbacks once the user has backgrounded a + * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden), + * `callback` is always called when the page's visibility state changes to + * hidden. As a result, the `callback` function might be called multiple times + * during the same page load._ + */ +const onINP = (onReport, opts = {}) => { + (0,_lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_1__.whenActivated)(() => { + // TODO(philipwalton): remove once the polyfill is no longer needed. + (0,_lib_polyfills_interactionCountPolyfill_js__WEBPACK_IMPORTED_MODULE_0__.initInteractionCountPolyfill)(); + + const metric = (0,_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__.initMetric)('INP'); + // eslint-disable-next-line prefer-const + let report; + + const handleEntries = (entries) => { + entries.forEach(entry => { + if (entry.interactionId) { + processEntry(entry); + } + + // Entries of type `first-input` don't currently have an `interactionId`, + // so to consider them in INP we have to first check that an existing + // entry doesn't match the `duration` and `startTime`. + // Note that this logic assumes that `event` entries are dispatched + // before `first-input` entries. This is true in Chrome (the only browser + // that currently supports INP). + // TODO(philipwalton): remove once crbug.com/1325826 is fixed. + if (entry.entryType === 'first-input') { + const noMatchingEntry = !longestInteractionList.some(interaction => { + return interaction.entries.some(prevEntry => { + return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime; + }); + }); + if (noMatchingEntry) { + processEntry(entry); + } + } + }); + + const inp = estimateP98LongestInteraction(); + + if (inp && inp.latency !== metric.value) { + metric.value = inp.latency; + metric.entries = inp.entries; + report(); + } + }; + + const po = (0,_lib_observe_js__WEBPACK_IMPORTED_MODULE_3__.observe)('event', handleEntries, { + // Event Timing entries have their durations rounded to the nearest 8ms, + // so a duration of 40ms would be any event that spans 2.5 or more frames + // at 60Hz. This threshold is chosen to strike a balance between usefulness + // and performance. Running this callback for any interaction that spans + // just one or two frames is likely not worth the insight that could be + // gained. + durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : 40, + } ); + + report = (0,_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_4__.bindReporter)(onReport, metric, INPThresholds, opts.reportAllChanges); + + if (po) { + // If browser supports interactionId (and so supports INP), also + // observe entries of type `first-input`. This is useful in cases + // where the first interaction is less than the `durationThreshold`. + if ("PerformanceEventTiming" in _types_js__WEBPACK_IMPORTED_MODULE_5__.WINDOW && 'interactionId' in PerformanceEventTiming.prototype) { + po.observe({ type: 'first-input', buffered: true }); + } + + (0,_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_6__.onHidden)(() => { + handleEntries(po.takeRecords() ); + + // If the interaction count shows that there were interactions but + // none were captured by the PerformanceObserver, report a latency of 0. + if (metric.value < 0 && getInteractionCountForNavigation() > 0) { + metric.value = 0; + metric.entries = []; + } + + report(true); + }); + } + }); +}; + + +//# sourceMappingURL=getINP.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getLCP.js": +/*!************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getLCP.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ LCPThresholds: () => (/* binding */ LCPThresholds), +/* harmony export */ onLCP: () => (/* binding */ onLCP) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/bindReporter.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js"); +/* harmony import */ var _lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/getActivationStart.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js"); +/* harmony import */ var _lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/getVisibilityWatcher.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/initMetric.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/onHidden.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js"); +/* harmony import */ var _lib_runOnce_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/runOnce.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js"); +/* harmony import */ var _lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/whenActivated.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js"); + + + + + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** Thresholds for LCP. See https://web.dev/articles/lcp#what_is_a_good_lcp_score */ +const LCPThresholds = [2500, 4000]; + +const reportedMetricIDs = {}; + +/** + * Calculates the [LCP](https://web.dev/articles/lcp) value for the current page and + * calls the `callback` function once the value is ready (along with the + * relevant `largest-contentful-paint` performance entry used to determine the + * value). The reported value is a `DOMHighResTimeStamp`. + * + * If the `reportAllChanges` configuration option is set to `true`, the + * `callback` function will be called any time a new `largest-contentful-paint` + * performance entry is dispatched, or once the final value of the metric has + * been determined. + */ +const onLCP = (onReport, opts = {}) => { + (0,_lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_0__.whenActivated)(() => { + const visibilityWatcher = (0,_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__.getVisibilityWatcher)(); + const metric = (0,_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__.initMetric)('LCP'); + let report; + + const handleEntries = (entries) => { + const lastEntry = entries[entries.length - 1] ; + if (lastEntry) { + // Only report if the page wasn't hidden prior to LCP. + if (lastEntry.startTime < visibilityWatcher.firstHiddenTime) { + // The startTime attribute returns the value of the renderTime if it is + // not 0, and the value of the loadTime otherwise. The activationStart + // reference is used because LCP should be relative to page activation + // rather than navigation start if the page was prerendered. But in cases + // where `activationStart` occurs after the LCP, this time should be + // clamped at 0. + metric.value = Math.max(lastEntry.startTime - (0,_lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_3__.getActivationStart)(), 0); + metric.entries = [lastEntry]; + report(); + } + } + }; + + const po = (0,_lib_observe_js__WEBPACK_IMPORTED_MODULE_4__.observe)('largest-contentful-paint', handleEntries); + + if (po) { + report = (0,_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_5__.bindReporter)(onReport, metric, LCPThresholds, opts.reportAllChanges); + + const stopListening = (0,_lib_runOnce_js__WEBPACK_IMPORTED_MODULE_6__.runOnce)(() => { + if (!reportedMetricIDs[metric.id]) { + handleEntries(po.takeRecords() ); + po.disconnect(); + reportedMetricIDs[metric.id] = true; + report(true); + } + }); + + // Stop listening after input. Note: while scrolling is an input that + // stops LCP observation, it's unreliable since it can be programmatically + // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75 + ['keydown', 'click'].forEach(type => { + if (_types_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.document) { + // Wrap in a setTimeout so the callback is run in a separate task + // to avoid extending the keyboard/click handler to reduce INP impact + // https://github.com/GoogleChrome/web-vitals/issues/383 + addEventListener(type, () => setTimeout(stopListening, 0), true); + } + }); + + (0,_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_8__.onHidden)(stopListening); + } + }); +}; + + +//# sourceMappingURL=getLCP.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js": +/*!**********************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js ***! + \**********************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ bindReporter: () => (/* binding */ bindReporter) +/* harmony export */ }); +const getRating = (value, thresholds) => { + if (value > thresholds[1]) { + return 'poor'; + } + if (value > thresholds[0]) { + return 'needs-improvement'; + } + return 'good'; +}; + +const bindReporter = ( + callback, + metric, + thresholds, + reportAllChanges, +) => { + let prevValue; + let delta; + return (forceReport) => { + if (metric.value >= 0) { + if (forceReport || reportAllChanges) { + delta = metric.value - (prevValue || 0); + + // Report the metric if there's a non-zero delta or if no previous + // value exists (which can happen in the case of the document becoming + // hidden when the metric value is 0). + // See: https://github.com/GoogleChrome/web-vitals/issues/14 + if (delta || prevValue === undefined) { + prevValue = metric.value; + metric.delta = delta; + metric.rating = getRating(metric.value, thresholds); + callback(metric); + } + } + } + }; +}; + + +//# sourceMappingURL=bindReporter.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/generateUniqueID.js": +/*!**************************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/generateUniqueID.js ***! + \**************************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ generateUniqueID: () => (/* binding */ generateUniqueID) +/* harmony export */ }); +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Performantly generate a unique, 30-char string by combining a version + * number, the current timestamp with a 13-digit number integer. + * @return {string} + */ +const generateUniqueID = () => { + return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`; +}; + + +//# sourceMappingURL=generateUniqueID.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js": +/*!****************************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js ***! + \****************************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getActivationStart: () => (/* binding */ getActivationStart) +/* harmony export */ }); +/* harmony import */ var _getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNavigationEntry.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js"); + + +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const getActivationStart = () => { + const navEntry = (0,_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_0__.getNavigationEntry)(); + return (navEntry && navEntry.activationStart) || 0; +}; + + +//# sourceMappingURL=getActivationStart.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js": +/*!****************************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js ***! + \****************************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getNavigationEntry: () => (/* binding */ getNavigationEntry) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const getNavigationEntry = () => { + return _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0]; +}; + + +//# sourceMappingURL=getNavigationEntry.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js": +/*!******************************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js ***! + \******************************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getVisibilityWatcher: () => (/* binding */ getVisibilityWatcher) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +let firstHiddenTime = -1; + +const initHiddenTime = () => { + // If the document is hidden when this code runs, assume it was always + // hidden and the page was loaded in the background, with the one exception + // that visibility state is always 'hidden' during prerendering, so we have + // to ignore that case until prerendering finishes (see: `prerenderingchange` + // event logic below). + firstHiddenTime = _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.visibilityState === 'hidden' && !_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.prerendering ? 0 : Infinity; +}; + +const onVisibilityUpdate = (event) => { + // If the document is 'hidden' and no previous hidden timestamp has been + // set, update it based on the current event data. + if (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.visibilityState === 'hidden' && firstHiddenTime > -1) { + // If the event is a 'visibilitychange' event, it means the page was + // visible prior to this change, so the event timestamp is the first + // hidden time. + // However, if the event is not a 'visibilitychange' event, then it must + // be a 'prerenderingchange' event, and the fact that the document is + // still 'hidden' from the above check means the tab was activated + // in a background state and so has always been hidden. + firstHiddenTime = event.type === 'visibilitychange' ? event.timeStamp : 0; + + // Remove all listeners now that a `firstHiddenTime` value has been set. + removeEventListener('visibilitychange', onVisibilityUpdate, true); + removeEventListener('prerenderingchange', onVisibilityUpdate, true); + } +}; + +const addChangeListeners = () => { + addEventListener('visibilitychange', onVisibilityUpdate, true); + // IMPORTANT: when a page is prerendering, its `visibilityState` is + // 'hidden', so in order to account for cases where this module checks for + // visibility during prerendering, an additional check after prerendering + // completes is also required. + addEventListener('prerenderingchange', onVisibilityUpdate, true); +}; + +const getVisibilityWatcher = () => { + if (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document && firstHiddenTime < 0) { + // If the document is hidden when this code runs, assume it was hidden + // since navigation start. This isn't a perfect heuristic, but it's the + // best we can do until an API is available to support querying past + // visibilityState. + initHiddenTime(); + addChangeListeners(); + } + return { + get firstHiddenTime() { + return firstHiddenTime; + }, + }; +}; + + +//# sourceMappingURL=getVisibilityWatcher.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js": +/*!********************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js ***! + \********************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ initMetric: () => (/* binding */ initMetric) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); +/* harmony import */ var _generateUniqueID_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generateUniqueID.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/generateUniqueID.js"); +/* harmony import */ var _getActivationStart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getActivationStart.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js"); +/* harmony import */ var _getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNavigationEntry.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js"); + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const initMetric = (name, value) => { + const navEntry = (0,_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_0__.getNavigationEntry)(); + let navigationType = 'navigate'; + + if (navEntry) { + if ((_types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document && _types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.prerendering) || (0,_getActivationStart_js__WEBPACK_IMPORTED_MODULE_2__.getActivationStart)() > 0) { + navigationType = 'prerender'; + } else if (_types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document && _types_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.wasDiscarded) { + navigationType = 'restore'; + } else if (navEntry.type) { + navigationType = navEntry.type.replace(/_/g, '-') ; + } + } + + // Use `entries` type specific for the metric. + const entries = []; + + return { + name, + value: typeof value === 'undefined' ? -1 : value, + rating: 'good' , // If needed, will be updated when reported. `const` to keep the type from widening to `string`. + delta: 0, + entries, + id: (0,_generateUniqueID_js__WEBPACK_IMPORTED_MODULE_3__.generateUniqueID)(), + navigationType, + }; +}; + + +//# sourceMappingURL=initMetric.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js": +/*!*****************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js ***! + \*****************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ observe: () => (/* binding */ observe) +/* harmony export */ }); +/** + * Takes a performance entry type and a callback function, and creates a + * `PerformanceObserver` instance that will observe the specified entry type + * with buffering enabled and call the callback _for each entry_. + * + * This function also feature-detects entry support and wraps the logic in a + * try/catch to avoid errors in unsupporting browsers. + */ +const observe = ( + type, + callback, + opts, +) => { + try { + if (PerformanceObserver.supportedEntryTypes.includes(type)) { + const po = new PerformanceObserver(list => { + // Delay by a microtask to workaround a bug in Safari where the + // callback is invoked immediately, rather than in a separate task. + // See: https://github.com/GoogleChrome/web-vitals/issues/277 + // eslint-disable-next-line @typescript-eslint/no-floating-promises + Promise.resolve().then(() => { + callback(list.getEntries() ); + }); + }); + po.observe( + Object.assign( + { + type, + buffered: true, + }, + opts || {}, + ) , + ); + return po; + } + } catch (e) { + // Do nothing. + } + return; +}; + + +//# sourceMappingURL=observe.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js": +/*!******************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js ***! + \******************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ onHidden: () => (/* binding */ onHidden) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const onHidden = (cb) => { + const onHiddenOrPageHide = (event) => { + if (event.type === 'pagehide' || (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document && _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.visibilityState === 'hidden')) { + cb(event); + } + }; + + if (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document) { + addEventListener('visibilitychange', onHiddenOrPageHide, true); + // Some browsers have buggy implementations of visibilitychange, + // so we use pagehide in addition, just to be safe. + addEventListener('pagehide', onHiddenOrPageHide, true); + } +}; + + +//# sourceMappingURL=onHidden.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js": +/*!********************************************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js ***! + \********************************************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getInteractionCount: () => (/* binding */ getInteractionCount), +/* harmony export */ initInteractionCountPolyfill: () => (/* binding */ initInteractionCountPolyfill) +/* harmony export */ }); +/* harmony import */ var _observe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); + + +let interactionCountEstimate = 0; +let minKnownInteractionId = Infinity; +let maxKnownInteractionId = 0; + +const updateEstimate = (entries) => { + (entries ).forEach(e => { + if (e.interactionId) { + minKnownInteractionId = Math.min(minKnownInteractionId, e.interactionId); + maxKnownInteractionId = Math.max(maxKnownInteractionId, e.interactionId); + + interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0; + } + }); +}; + +let po; + +/** + * Returns the `interactionCount` value using the native API (if available) + * or the polyfill estimate in this module. + */ +const getInteractionCount = () => { + return po ? interactionCountEstimate : performance.interactionCount || 0; +}; + +/** + * Feature detects native support or initializes the polyfill if needed. + */ +const initInteractionCountPolyfill = () => { + if ('interactionCount' in performance || po) return; + + po = (0,_observe_js__WEBPACK_IMPORTED_MODULE_0__.observe)('event', updateEstimate, { + type: 'event', + buffered: true, + durationThreshold: 0, + } ); +}; + + +//# sourceMappingURL=interactionCountPolyfill.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js": +/*!*****************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js ***! + \*****************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ runOnce: () => (/* binding */ runOnce) +/* harmony export */ }); +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const runOnce = (cb) => { + let called = false; + return (arg) => { + if (!called) { + cb(arg); + called = true; + } + }; +}; + + +//# sourceMappingURL=runOnce.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js": +/*!***********************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js ***! + \***********************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ whenActivated: () => (/* binding */ whenActivated) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); + + +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const whenActivated = (callback) => { + if (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document && _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.prerendering) { + addEventListener('prerenderingchange', () => callback(), true); + } else { + callback(); + } +}; + + +//# sourceMappingURL=whenActivated.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onFCP.js": +/*!***********************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onFCP.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ FCPThresholds: () => (/* binding */ FCPThresholds), +/* harmony export */ onFCP: () => (/* binding */ onFCP) +/* harmony export */ }); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/bindReporter.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js"); +/* harmony import */ var _lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/getActivationStart.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js"); +/* harmony import */ var _lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/getVisibilityWatcher.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/initMetric.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/observe.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js"); +/* harmony import */ var _lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/whenActivated.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js"); + + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** Thresholds for FCP. See https://web.dev/articles/fcp#what_is_a_good_fcp_score */ +const FCPThresholds = [1800, 3000]; + +/** + * Calculates the [FCP](https://web.dev/articles/fcp) value for the current page and + * calls the `callback` function once the value is ready, along with the + * relevant `paint` performance entry used to determine the value. The reported + * value is a `DOMHighResTimeStamp`. + */ +const onFCP = (onReport, opts = {}) => { + (0,_lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_0__.whenActivated)(() => { + const visibilityWatcher = (0,_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__.getVisibilityWatcher)(); + const metric = (0,_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__.initMetric)('FCP'); + let report; + + const handleEntries = (entries) => { + (entries ).forEach(entry => { + if (entry.name === 'first-contentful-paint') { + po.disconnect(); + + // Only report if the page wasn't hidden prior to the first paint. + if (entry.startTime < visibilityWatcher.firstHiddenTime) { + // The activationStart reference is used because FCP should be + // relative to page activation rather than navigation start if the + // page was prerendered. But in cases where `activationStart` occurs + // after the FCP, this time should be clamped at 0. + metric.value = Math.max(entry.startTime - (0,_lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_3__.getActivationStart)(), 0); + metric.entries.push(entry); + report(true); + } + } + }); + }; + + const po = (0,_lib_observe_js__WEBPACK_IMPORTED_MODULE_4__.observe)('paint', handleEntries); + + if (po) { + report = (0,_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_5__.bindReporter)(onReport, metric, FCPThresholds, opts.reportAllChanges); + } + }); +}; + + +//# sourceMappingURL=onFCP.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onTTFB.js": +/*!************************************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onTTFB.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TTFBThresholds: () => (/* binding */ TTFBThresholds), +/* harmony export */ onTTFB: () => (/* binding */ onTTFB) +/* harmony export */ }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../types.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js"); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/bindReporter.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js"); +/* harmony import */ var _lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/getActivationStart.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js"); +/* harmony import */ var _lib_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/getNavigationEntry.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/initMetric.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js"); +/* harmony import */ var _lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/whenActivated.js */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js"); + + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** Thresholds for TTFB. See https://web.dev/articles/ttfb#what_is_a_good_ttfb_score */ +const TTFBThresholds = [800, 1800]; + +/** + * Runs in the next task after the page is done loading and/or prerendering. + * @param callback + */ +const whenReady = (callback) => { + if (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document && _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.prerendering) { + (0,_lib_whenActivated_js__WEBPACK_IMPORTED_MODULE_1__.whenActivated)(() => whenReady(callback)); + } else if (_types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document && _types_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.readyState !== 'complete') { + addEventListener('load', () => whenReady(callback), true); + } else { + // Queue a task so the callback runs after `loadEventEnd`. + setTimeout(callback, 0); + } +}; + +/** + * Calculates the [TTFB](https://web.dev/articles/ttfb) value for the + * current page and calls the `callback` function once the page has loaded, + * along with the relevant `navigation` performance entry used to determine the + * value. The reported value is a `DOMHighResTimeStamp`. + * + * Note, this function waits until after the page is loaded to call `callback` + * in order to ensure all properties of the `navigation` entry are populated. + * This is useful if you want to report on other metrics exposed by the + * [Navigation Timing API](https://w3c.github.io/navigation-timing/). For + * example, the TTFB metric starts from the page's [time + * origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it + * includes time spent on DNS lookup, connection negotiation, network latency, + * and server processing time. + */ +const onTTFB = (onReport, opts = {}) => { + const metric = (0,_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__.initMetric)('TTFB'); + const report = (0,_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_3__.bindReporter)(onReport, metric, TTFBThresholds, opts.reportAllChanges); + + whenReady(() => { + const navEntry = (0,_lib_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_4__.getNavigationEntry)(); + + if (navEntry) { + const responseStart = navEntry.responseStart; + + // In some cases no value is reported by the browser (for + // privacy/security reasons), and in other cases (bugs) the value is + // negative or is larger than the current page time. Ignore these cases: + // https://github.com/GoogleChrome/web-vitals/issues/137 + // https://github.com/GoogleChrome/web-vitals/issues/162 + // https://github.com/GoogleChrome/web-vitals/issues/275 + if (responseStart <= 0 || responseStart > performance.now()) return; + + // The activationStart reference is used because TTFB should be + // relative to page activation rather than navigation start if the + // page was prerendered. But in cases where `activationStart` occurs + // after the first byte is received, this time should be clamped at 0. + metric.value = Math.max(responseStart - (0,_lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_5__.getActivationStart)(), 0); + + metric.entries = [navEntry]; + report(true); + } + }); +}; + + +//# sourceMappingURL=onTTFB.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/browser-utils/build/esm/types.js": +/*!****************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/browser-utils/build/esm/types.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ WINDOW: () => (/* binding */ WINDOW) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + +const WINDOW = _sentry_core__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ + +; + + +//# sourceMappingURL=types.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry-internal/feedback/build/npm/esm/index.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry-internal/feedback/build/npm/esm/index.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ buildFeedbackIntegration: () => (/* binding */ buildFeedbackIntegration), +/* harmony export */ feedbackModalIntegration: () => (/* binding */ feedbackModalIntegration), +/* harmony export */ feedbackScreenshotIntegration: () => (/* binding */ feedbackScreenshotIntegration), +/* harmony export */ getFeedback: () => (/* binding */ getFeedback), +/* harmony export */ sendFeedback: () => (/* binding */ sendFeedback) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/feedback.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/isBrowser.js"); + + +// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser` +// prevents the browser package from being bundled in the CDN bundle, and avoids a +// circular dependency between the browser and feedback packages +const WINDOW = _sentry_core__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; +const DOCUMENT = WINDOW.document; +const NAVIGATOR = WINDOW.navigator; + +const TRIGGER_LABEL = 'Report a Bug'; +const CANCEL_BUTTON_LABEL = 'Cancel'; +const SUBMIT_BUTTON_LABEL = 'Send Bug Report'; +const CONFIRM_BUTTON_LABEL = 'Confirm'; +const FORM_TITLE = 'Report a Bug'; +const EMAIL_PLACEHOLDER = 'your.email@example.org'; +const EMAIL_LABEL = 'Email'; +const MESSAGE_PLACEHOLDER = "What's the bug? What did you expect?"; +const MESSAGE_LABEL = 'Description'; +const NAME_PLACEHOLDER = 'Your Name'; +const NAME_LABEL = 'Name'; +const SUCCESS_MESSAGE_TEXT = 'Thank you for your report!'; +const IS_REQUIRED_LABEL = '(required)'; +const ADD_SCREENSHOT_LABEL = 'Add a screenshot'; +const REMOVE_SCREENSHOT_LABEL = 'Remove screenshot'; + +const FEEDBACK_WIDGET_SOURCE = 'widget'; +const FEEDBACK_API_SOURCE = 'api'; + +const SUCCESS_MESSAGE_TIMEOUT = 5000; + +/** + * Public API to send a Feedback item to Sentry + */ +const sendFeedback = ( + params, + hint = { includeReplay: true }, +) => { + if (!params.message) { + throw new Error('Unable to submit feedback with empty message'); + } + + // We want to wait for the feedback to be sent (or not) + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getClient)(); + + if (!client) { + throw new Error('No client setup, cannot send feedback.'); + } + + if (params.tags && Object.keys(params.tags).length) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentScope)().setTags(params.tags); + } + const eventId = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.captureFeedback)( + { + source: FEEDBACK_API_SOURCE, + url: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getLocationHref)(), + ...params, + }, + hint, + ); + + // We want to wait for the feedback to be sent (or not) + return new Promise((resolve, reject) => { + // After 5s, we want to clear anyhow + const timeout = setTimeout(() => reject('Unable to determine if Feedback was correctly sent.'), 5000); + + const cleanup = client.on('afterSendEvent', (event, response) => { + if (event.event_id !== eventId) { + return; + } + + clearTimeout(timeout); + cleanup(); + + // Require valid status codes, otherwise can assume feedback was not sent successfully + if ( + response && + typeof response.statusCode === 'number' && + response.statusCode >= 200 && + response.statusCode < 300 + ) { + resolve(eventId); + } + + if (response && typeof response.statusCode === 'number' && response.statusCode === 0) { + return reject( + 'Unable to send Feedback. This is because of network issues, or because you are using an ad-blocker.', + ); + } + + if (response && typeof response.statusCode === 'number' && response.statusCode === 403) { + return reject( + 'Unable to send Feedback. This could be because this domain is not in your list of allowed domains.', + ); + } + + return reject( + 'Unable to send Feedback. This could be because of network issues, or because you are using an ad-blocker', + ); + }); + }); +}; + +/* + * For reference, the fully built event looks something like this: + * { + * "type": "feedback", + * "event_id": "d2132d31b39445f1938d7e21b6bf0ec4", + * "timestamp": 1597977777.6189718, + * "dist": "1.12", + * "platform": "javascript", + * "environment": "production", + * "release": 42, + * "tags": {"transaction": "/organizations/:orgId/performance/:eventSlug/"}, + * "sdk": {"name": "name", "version": "version"}, + * "user": { + * "id": "123", + * "username": "user", + * "email": "user@site.com", + * "ip_address": "192.168.11.12", + * }, + * "request": { + * "url": None, + * "headers": { + * "user-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15" + * }, + * }, + * "contexts": { + * "feedback": { + * "message": "test message", + * "contact_email": "test@example.com", + * "type": "feedback", + * }, + * "trace": { + * "trace_id": "4C79F60C11214EB38604F4AE0781BFB2", + * "span_id": "FA90FDEAD5F74052", + * "type": "trace", + * }, + * "replay": { + * "replay_id": "e2d42047b1c5431c8cba85ee2a8ab25d", + * }, + * }, + * } + */ + +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +/** + * Mobile browsers do not support `mediaDevices.getDisplayMedia` even though they have the api implemented + * Instead they return things like `NotAllowedError` when called. + * + * It's simpler for us to browser sniff first, and avoid loading the integration if we can. + * + * https://stackoverflow.com/a/58879212 + * https://stackoverflow.com/a/3540295 + * + * `mediaDevices.getDisplayMedia` is also only supported in secure contexts, and return a `mediaDevices is not supported` error, so we should also avoid loading the integration if we can. + * + * https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia + */ +function isScreenshotSupported() { + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(NAVIGATOR.userAgent)) { + return false; + } + /** + * User agent on iPads show as Macintosh, so we need extra checks + * + * https://forums.developer.apple.com/forums/thread/119186 + * https://stackoverflow.com/questions/60482650/how-to-detect-ipad-useragent-on-safari-browser + */ + if (/Macintosh/i.test(NAVIGATOR.userAgent) && NAVIGATOR.maxTouchPoints && NAVIGATOR.maxTouchPoints > 1) { + return false; + } + if (!isSecureContext) { + return false; + } + return true; +} + +/** + * Quick and dirty deep merge for the Feedback integration options + */ +function mergeOptions( + defaultOptions, + optionOverrides, +) { + return { + ...defaultOptions, + ...optionOverrides, + tags: { + ...defaultOptions.tags, + ...optionOverrides.tags, + }, + onFormOpen: () => { + optionOverrides.onFormOpen && optionOverrides.onFormOpen(); + defaultOptions.onFormOpen && defaultOptions.onFormOpen(); + }, + onFormClose: () => { + optionOverrides.onFormClose && optionOverrides.onFormClose(); + defaultOptions.onFormClose && defaultOptions.onFormClose(); + }, + onSubmitSuccess: (data) => { + optionOverrides.onSubmitSuccess && optionOverrides.onSubmitSuccess(data); + defaultOptions.onSubmitSuccess && defaultOptions.onSubmitSuccess(data); + }, + onSubmitError: (error) => { + optionOverrides.onSubmitError && optionOverrides.onSubmitError(error); + defaultOptions.onSubmitError && defaultOptions.onSubmitError(error); + }, + onFormSubmitted: () => { + optionOverrides.onFormSubmitted && optionOverrides.onFormSubmitted(); + defaultOptions.onFormSubmitted && defaultOptions.onFormSubmitted(); + }, + themeDark: { + ...defaultOptions.themeDark, + ...optionOverrides.themeDark, + }, + themeLight: { + ...defaultOptions.themeLight, + ...optionOverrides.themeLight, + }, + }; +} + +/** + * Creates
, + * The target will be the image, not the button, which we don't want here + */ +function getClickTargetNode(event) { + const target = getTargetNode(event); + + if (!target || !(target instanceof Element)) { + return target; + } + + return getClosestInteractive(target); +} + +/** Get the event target node. */ +function getTargetNode(event) { + if (isEventWithTarget(event)) { + return event.target ; + } + + return event; +} + +function isEventWithTarget(event) { + return typeof event === 'object' && !!event && 'target' in event; +} + +let handlers; + +/** + * Register a handler to be called when `window.open()` is called. + * Returns a cleanup function. + */ +function onWindowOpen(cb) { + // Ensure to only register this once + if (!handlers) { + handlers = []; + monkeyPatchWindowOpen(); + } + + handlers.push(cb); + + return () => { + const pos = handlers ? handlers.indexOf(cb) : -1; + if (pos > -1) { + (handlers ).splice(pos, 1); + } + }; +} + +function monkeyPatchWindowOpen() { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.fill)(WINDOW, 'open', function (originalWindowOpen) { + return function (...args) { + if (handlers) { + try { + handlers.forEach(handler => handler()); + } catch (e) { + // ignore errors in here + } + } + + return originalWindowOpen.apply(WINDOW, args); + }; + }); +} + +/** Any IncrementalSource for rrweb that we interpret as a kind of mutation. */ +const IncrementalMutationSources = new Set([ + IncrementalSource.Mutation, + IncrementalSource.StyleSheetRule, + IncrementalSource.StyleDeclaration, + IncrementalSource.AdoptedStyleSheet, + IncrementalSource.CanvasMutation, + IncrementalSource.Selection, + IncrementalSource.MediaInteraction, +]); + +/** Handle a click. */ +function handleClick(clickDetector, clickBreadcrumb, node) { + clickDetector.handleClick(clickBreadcrumb, node); +} + +/** A click detector class that can be used to detect slow or rage clicks on elements. */ +class ClickDetector { + // protected for testing + + constructor( + replay, + slowClickConfig, + // Just for easier testing + _addBreadcrumbEvent = addBreadcrumbEvent, + ) { + this._lastMutation = 0; + this._lastScroll = 0; + this._clicks = []; + + // We want everything in s, but options are in ms + this._timeout = slowClickConfig.timeout / 1000; + this._threshold = slowClickConfig.threshold / 1000; + this._scrollTimeout = slowClickConfig.scrollTimeout / 1000; + this._replay = replay; + this._ignoreSelector = slowClickConfig.ignoreSelector; + this._addBreadcrumbEvent = _addBreadcrumbEvent; + } + + /** Register click detection handlers on mutation or scroll. */ + addListeners() { + const cleanupWindowOpen = onWindowOpen(() => { + // Treat window.open as mutation + this._lastMutation = nowInSeconds(); + }); + + this._teardown = () => { + cleanupWindowOpen(); + + this._clicks = []; + this._lastMutation = 0; + this._lastScroll = 0; + }; + } + + /** Clean up listeners. */ + removeListeners() { + if (this._teardown) { + this._teardown(); + } + + if (this._checkClickTimeout) { + clearTimeout(this._checkClickTimeout); + } + } + + /** @inheritDoc */ + handleClick(breadcrumb, node) { + if (ignoreElement(node, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) { + return; + } + + const newClick = { + timestamp: timestampToS(breadcrumb.timestamp), + clickBreadcrumb: breadcrumb, + // Set this to 0 so we know it originates from the click breadcrumb + clickCount: 0, + node, + }; + + // If there was a click in the last 1s on the same element, ignore it - only keep a single reference per second + if ( + this._clicks.some(click => click.node === newClick.node && Math.abs(click.timestamp - newClick.timestamp) < 1) + ) { + return; + } + + this._clicks.push(newClick); + + // If this is the first new click, set a timeout to check for multi clicks + if (this._clicks.length === 1) { + this._scheduleCheckClicks(); + } + } + + /** @inheritDoc */ + registerMutation(timestamp = Date.now()) { + this._lastMutation = timestampToS(timestamp); + } + + /** @inheritDoc */ + registerScroll(timestamp = Date.now()) { + this._lastScroll = timestampToS(timestamp); + } + + /** @inheritDoc */ + registerClick(element) { + const node = getClosestInteractive(element); + this._handleMultiClick(node ); + } + + /** Count multiple clicks on elements. */ + _handleMultiClick(node) { + this._getClicks(node).forEach(click => { + click.clickCount++; + }); + } + + /** Get all pending clicks for a given node. */ + _getClicks(node) { + return this._clicks.filter(click => click.node === node); + } + + /** Check the clicks that happened. */ + _checkClicks() { + const timedOutClicks = []; + + const now = nowInSeconds(); + + this._clicks.forEach(click => { + if (!click.mutationAfter && this._lastMutation) { + click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined; + } + if (!click.scrollAfter && this._lastScroll) { + click.scrollAfter = click.timestamp <= this._lastScroll ? this._lastScroll - click.timestamp : undefined; + } + + // All of these are in seconds! + if (click.timestamp + this._timeout <= now) { + timedOutClicks.push(click); + } + }); + + // Remove "old" clicks + for (const click of timedOutClicks) { + const pos = this._clicks.indexOf(click); + + if (pos > -1) { + this._generateBreadcrumbs(click); + this._clicks.splice(pos, 1); + } + } + + // Trigger new check, unless no clicks left + if (this._clicks.length) { + this._scheduleCheckClicks(); + } + } + + /** Generate matching breadcrumb(s) for the click. */ + _generateBreadcrumbs(click) { + const replay = this._replay; + const hadScroll = click.scrollAfter && click.scrollAfter <= this._scrollTimeout; + const hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold; + + const isSlowClick = !hadScroll && !hadMutation; + const { clickCount, clickBreadcrumb } = click; + + // Slow click + if (isSlowClick) { + // If `mutationAfter` is set, it means a mutation happened after the threshold, but before the timeout + // If not, it means we just timed out without scroll & mutation + const timeAfterClickMs = Math.min(click.mutationAfter || this._timeout, this._timeout) * 1000; + const endReason = timeAfterClickMs < this._timeout * 1000 ? 'mutation' : 'timeout'; + + const breadcrumb = { + type: 'default', + message: clickBreadcrumb.message, + timestamp: clickBreadcrumb.timestamp, + category: 'ui.slowClickDetected', + data: { + ...clickBreadcrumb.data, + url: WINDOW.location.href, + route: replay.getCurrentRoute(), + timeAfterClickMs, + endReason, + // If clickCount === 0, it means multiClick was not correctly captured here + // - we still want to send 1 in this case + clickCount: clickCount || 1, + }, + }; + + this._addBreadcrumbEvent(replay, breadcrumb); + return; + } + + // Multi click + if (clickCount > 1) { + const breadcrumb = { + type: 'default', + message: clickBreadcrumb.message, + timestamp: clickBreadcrumb.timestamp, + category: 'ui.multiClick', + data: { + ...clickBreadcrumb.data, + url: WINDOW.location.href, + route: replay.getCurrentRoute(), + clickCount, + metric: true, + }, + }; + + this._addBreadcrumbEvent(replay, breadcrumb); + } + } + + /** Schedule to check current clicks. */ + _scheduleCheckClicks() { + if (this._checkClickTimeout) { + clearTimeout(this._checkClickTimeout); + } + + this._checkClickTimeout = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_9__.setTimeout)(() => this._checkClicks(), 1000); + } +} + +const SLOW_CLICK_TAGS = ['A', 'BUTTON', 'INPUT']; + +/** exported for tests only */ +function ignoreElement(node, ignoreSelector) { + if (!SLOW_CLICK_TAGS.includes(node.tagName)) { + return true; + } + + // If tag, we only want to consider input[type='submit'] & input[type='button'] + if (node.tagName === 'INPUT' && !['submit', 'button'].includes(node.getAttribute('type') || '')) { + return true; + } + + // If tag, detect special variants that may not lead to an action + // If target !== _self, we may open the link somewhere else, which would lead to no action + // Also, when downloading a file, we may not leave the page, but still not trigger an action + if ( + node.tagName === 'A' && + (node.hasAttribute('download') || (node.hasAttribute('target') && node.getAttribute('target') !== '_self')) + ) { + return true; + } + + if (ignoreSelector && node.matches(ignoreSelector)) { + return true; + } + + return false; +} + +function isClickBreadcrumb(breadcrumb) { + return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === 'number' && breadcrumb.timestamp); +} + +// This is good enough for us, and is easier to test/mock than `timestampInSeconds` +function nowInSeconds() { + return Date.now() / 1000; +} + +/** Update the click detector based on a recording event of rrweb. */ +function updateClickDetectorForRecordingEvent(clickDetector, event) { + try { + // note: We only consider incremental snapshots here + // This means that any full snapshot is ignored for mutation detection - the reason is that we simply cannot know if a mutation happened here. + // E.g. think that we are buffering, an error happens and we take a full snapshot because we switched to session mode - + // in this scenario, we would not know if a dead click happened because of the error, which is a key dead click scenario. + // Instead, by ignoring full snapshots, we have the risk that we generate a false positive + // (if a mutation _did_ happen but was "swallowed" by the full snapshot) + // But this should be more unlikely as we'd generally capture the incremental snapshot right away + + if (!isIncrementalEvent(event)) { + return; + } + + const { source } = event.data; + if (IncrementalMutationSources.has(source)) { + clickDetector.registerMutation(event.timestamp); + } + + if (source === IncrementalSource.Scroll) { + clickDetector.registerScroll(event.timestamp); + } + + if (isIncrementalMouseInteraction(event)) { + const { type, id } = event.data; + const node = record.mirror.getNode(id); + + if (node instanceof HTMLElement && type === MouseInteractions.Click) { + clickDetector.registerClick(node); + } + } + } catch (e) { + // ignore errors here, e.g. if accessing something that does not exist + } +} + +function isIncrementalEvent(event) { + return event.type === ReplayEventTypeIncrementalSnapshot; +} + +function isIncrementalMouseInteraction( + event, +) { + return event.data.source === IncrementalSource.MouseInteraction; +} + +/** + * Create a breadcrumb for a replay. + */ +function createBreadcrumb( + breadcrumb, +) { + return { + timestamp: Date.now() / 1000, + type: 'default', + ...breadcrumb, + }; +} + +var NodeType; +(function (NodeType) { + NodeType[NodeType["Document"] = 0] = "Document"; + NodeType[NodeType["DocumentType"] = 1] = "DocumentType"; + NodeType[NodeType["Element"] = 2] = "Element"; + NodeType[NodeType["Text"] = 3] = "Text"; + NodeType[NodeType["CDATA"] = 4] = "CDATA"; + NodeType[NodeType["Comment"] = 5] = "Comment"; +})(NodeType || (NodeType = {})); + +// Note that these are the serialized attributes and not attributes directly on +// the DOM Node. Attributes we are interested in: +const ATTRIBUTES_TO_RECORD = new Set([ + 'id', + 'class', + 'aria-label', + 'role', + 'name', + 'alt', + 'title', + 'data-test-id', + 'data-testid', + 'disabled', + 'aria-disabled', + 'data-sentry-component', +]); + +/** + * Inclusion list of attributes that we want to record from the DOM element + */ +function getAttributesToRecord(attributes) { + const obj = {}; + if (!attributes['data-sentry-component'] && attributes['data-sentry-element']) { + attributes['data-sentry-component'] = attributes['data-sentry-element']; + } + for (const key in attributes) { + if (ATTRIBUTES_TO_RECORD.has(key)) { + let normalizedKey = key; + + if (key === 'data-testid' || key === 'data-test-id') { + normalizedKey = 'testId'; + } + + obj[normalizedKey] = attributes[key]; + } + } + + return obj; +} + +const handleDomListener = ( + replay, +) => { + return (handlerData) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleDom(handlerData); + + if (!result) { + return; + } + + const isClick = handlerData.name === 'click'; + const event = isClick ? (handlerData.event ) : undefined; + // Ignore clicks if ctrl/alt/meta/shift keys are held down as they alter behavior of clicks (e.g. open in new tab) + if ( + isClick && + replay.clickDetector && + event && + event.target && + !event.altKey && + !event.metaKey && + !event.ctrlKey && + !event.shiftKey + ) { + handleClick( + replay.clickDetector, + result , + getClickTargetNode(handlerData.event ) , + ); + } + + addBreadcrumbEvent(replay, result); + }; +}; + +/** Get the base DOM breadcrumb. */ +function getBaseDomBreadcrumb(target, message) { + const nodeId = record.mirror.getId(target); + const node = nodeId && record.mirror.getNode(nodeId); + const meta = node && record.mirror.getMeta(node); + const element = meta && isElement(meta) ? meta : null; + + return { + message, + data: element + ? { + nodeId, + node: { + id: nodeId, + tagName: element.tagName, + textContent: Array.from(element.childNodes) + .map((node) => node.type === NodeType.Text && node.textContent) + .filter(Boolean) // filter out empty values + .map(text => (text ).trim()) + .join(''), + attributes: getAttributesToRecord(element.attributes), + }, + } + : {}, + }; +} + +/** + * An event handler to react to DOM events. + * Exported for tests. + */ +function handleDom(handlerData) { + const { target, message } = getDomTarget(handlerData); + + return createBreadcrumb({ + category: `ui.${handlerData.name}`, + ...getBaseDomBreadcrumb(target, message), + }); +} + +function getDomTarget(handlerData) { + const isClick = handlerData.name === 'click'; + + let message; + let target = null; + + // Accessing event.target can throw (see getsentry/raven-js#838, #768) + try { + target = isClick ? getClickTargetNode(handlerData.event ) : getTargetNode(handlerData.event ); + message = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__.htmlTreeAsString)(target, { maxStringLength: 200 }) || ''; + } catch (e) { + message = ''; + } + + return { target, message }; +} + +function isElement(node) { + return node.type === NodeType.Element; +} + +/** Handle keyboard events & create breadcrumbs. */ +function handleKeyboardEvent(replay, event) { + if (!replay.isEnabled()) { + return; + } + + // Update user activity, but do not restart recording as it can create + // noisy/low-value replays (e.g. user comes back from idle, hits alt-tab, new + // session with a single "keydown" breadcrumb is created) + replay.updateUserActivity(); + + const breadcrumb = getKeyboardBreadcrumb(event); + + if (!breadcrumb) { + return; + } + + addBreadcrumbEvent(replay, breadcrumb); +} + +/** exported only for tests */ +function getKeyboardBreadcrumb(event) { + const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event; + + // never capture for input fields + if (!target || isInputElement(target ) || !key) { + return null; + } + + // Note: We do not consider shift here, as that means "uppercase" + const hasModifierKey = metaKey || ctrlKey || altKey; + const isCharacterKey = key.length === 1; // other keys like Escape, Tab, etc have a longer length + + // Do not capture breadcrumb if only a word key is pressed + // This could leak e.g. user input + if (!hasModifierKey && isCharacterKey) { + return null; + } + + const message = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__.htmlTreeAsString)(target, { maxStringLength: 200 }) || ''; + const baseBreadcrumb = getBaseDomBreadcrumb(target , message); + + return createBreadcrumb({ + category: 'ui.keyDown', + message, + data: { + ...baseBreadcrumb.data, + metaKey, + shiftKey, + ctrlKey, + altKey, + key, + }, + }); +} + +function isInputElement(target) { + return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable; +} + +// Map entryType -> function to normalize data for event +const ENTRY_TYPES + + = { + // @ts-expect-error TODO: entry type does not fit the create* functions entry type + resource: createResourceEntry, + paint: createPaintEntry, + // @ts-expect-error TODO: entry type does not fit the create* functions entry type + navigation: createNavigationEntry, +}; + +/** + * Handler creater for web vitals + */ +function webVitalHandler( + getter, + replay, +) { + return ({ metric }) => void replay.replayPerformanceEntries.push(getter(metric)); +} + +/** + * Create replay performance entries from the browser performance entries. + */ +function createPerformanceEntries( + entries, +) { + return entries.map(createPerformanceEntry).filter(Boolean) ; +} + +function createPerformanceEntry(entry) { + const entryType = ENTRY_TYPES[entry.entryType]; + if (!entryType) { + return null; + } + + return entryType(entry); +} + +function getAbsoluteTime(time) { + // browserPerformanceTimeOrigin can be undefined if `performance` or + // `performance.now` doesn't exist, but this is already checked by this integration + return ((_sentry_core__WEBPACK_IMPORTED_MODULE_11__.browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000; +} + +function createPaintEntry(entry) { + const { duration, entryType, name, startTime } = entry; + + const start = getAbsoluteTime(startTime); + return { + type: entryType, + name, + start, + end: start + duration, + data: undefined, + }; +} + +function createNavigationEntry(entry) { + const { + entryType, + name, + decodedBodySize, + duration, + domComplete, + encodedBodySize, + domContentLoadedEventStart, + domContentLoadedEventEnd, + domInteractive, + loadEventStart, + loadEventEnd, + redirectCount, + startTime, + transferSize, + type, + } = entry; + + // Ignore entries with no duration, they do not seem to be useful and cause dupes + if (duration === 0) { + return null; + } + + return { + type: `${entryType}.${type}`, + start: getAbsoluteTime(startTime), + end: getAbsoluteTime(domComplete), + name, + data: { + size: transferSize, + decodedBodySize, + encodedBodySize, + duration, + domInteractive, + domContentLoadedEventStart, + domContentLoadedEventEnd, + loadEventStart, + loadEventEnd, + domComplete, + redirectCount, + }, + }; +} + +function createResourceEntry( + entry, +) { + const { + entryType, + initiatorType, + name, + responseEnd, + startTime, + decodedBodySize, + encodedBodySize, + responseStatus, + transferSize, + } = entry; + + // Core SDK handles these + if (['fetch', 'xmlhttprequest'].includes(initiatorType)) { + return null; + } + + return { + type: `${entryType}.${initiatorType}`, + start: getAbsoluteTime(startTime), + end: getAbsoluteTime(responseEnd), + name, + data: { + size: transferSize, + statusCode: responseStatus, + decodedBodySize, + encodedBodySize, + }, + }; +} + +/** + * Add a LCP event to the replay based on a LCP metric. + */ +function getLargestContentfulPaint(metric) { + const lastEntry = metric.entries[metric.entries.length - 1] ; + const node = lastEntry && lastEntry.element ? [lastEntry.element] : undefined; + return getWebVital(metric, 'largest-contentful-paint', node); +} + +function isLayoutShift(entry) { + return (entry ).sources !== undefined; +} + +/** + * Add a CLS event to the replay based on a CLS metric. + */ +function getCumulativeLayoutShift(metric) { + const layoutShifts = []; + const nodes = []; + for (const entry of metric.entries) { + if (isLayoutShift(entry)) { + const nodeIds = []; + for (const source of entry.sources) { + if (source.node) { + nodes.push(source.node); + const nodeId = record.mirror.getId(source.node); + if (nodeId) { + nodeIds.push(nodeId); + } + } + } + layoutShifts.push({ value: entry.value, nodeIds: nodeIds.length ? nodeIds : undefined }); + } + } + + return getWebVital(metric, 'cumulative-layout-shift', nodes, layoutShifts); +} + +/** + * Add a FID event to the replay based on a FID metric. + */ +function getFirstInputDelay(metric) { + const lastEntry = metric.entries[metric.entries.length - 1] ; + const node = lastEntry && lastEntry.target ? [lastEntry.target] : undefined; + return getWebVital(metric, 'first-input-delay', node); +} + +/** + * Add an INP event to the replay based on an INP metric. + */ +function getInteractionToNextPaint(metric) { + const lastEntry = metric.entries[metric.entries.length - 1] ; + const node = lastEntry && lastEntry.target ? [lastEntry.target] : undefined; + return getWebVital(metric, 'interaction-to-next-paint', node); +} + +/** + * Add an web vital event to the replay based on the web vital metric. + */ +function getWebVital( + metric, + name, + nodes, + attributions, +) { + const value = metric.value; + const rating = metric.rating; + + const end = getAbsoluteTime(value); + + return { + type: 'web-vital', + name, + start: end, + end, + data: { + value, + size: value, + rating, + nodeIds: nodes ? nodes.map(node => record.mirror.getId(node)) : undefined, + attributions, + }, + }; +} + +/** + * Sets up a PerformanceObserver to listen to all performance entry types. + * Returns a callback to stop observing. + */ +function setupPerformanceObserver(replay) { + function addPerformanceEntry(entry) { + // It is possible for entries to come up multiple times + if (!replay.performanceEntries.includes(entry)) { + replay.performanceEntries.push(entry); + } + } + + function onEntries({ entries }) { + entries.forEach(addPerformanceEntry); + } + + const clearCallbacks = []; + + (['navigation', 'paint', 'resource'] ).forEach(type => { + clearCallbacks.push((0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_12__.addPerformanceInstrumentationHandler)(type, onEntries)); + }); + + clearCallbacks.push( + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_12__.addLcpInstrumentationHandler)(webVitalHandler(getLargestContentfulPaint, replay)), + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_12__.addClsInstrumentationHandler)(webVitalHandler(getCumulativeLayoutShift, replay)), + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_12__.addFidInstrumentationHandler)(webVitalHandler(getFirstInputDelay, replay)), + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_12__.addInpInstrumentationHandler)(webVitalHandler(getInteractionToNextPaint, replay)), + ); + + // A callback to cleanup all handlers + return () => { + clearCallbacks.forEach(clearCallback => clearCallback()); + }; +} + +const r = `var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a>h]=l}else for(o=new n(i),a=0;a>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],a=0;ad&&(d=o[a].s);var g=new n(d+1),w=A(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<e))break;p+=m-(1<>=y;p>0;){var M=o[a].s;g[M]=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=C[s-1],M=y>>13,E=8191&y,z=(1<7e3||q>24576)&&(N>423||!w)){p=U(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(J)return J.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),a=0,s=function(t){i[a++]=t},o=0;oi.length){var f=new t(a+8+(e-o<<1));f.set(i),i=f}var h=n.charCodeAt(o);h<128||r?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++o))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return b(i,0,a)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`; + +function e(){const e=new Blob([r]);return URL.createObjectURL(e)} + +/** This error indicates that the event buffer size exceeded the limit.. */ +class EventBufferSizeExceededError extends Error { + constructor() { + super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`); + } +} + +/** + * A basic event buffer that does not do any compression. + * Used as fallback if the compression worker cannot be loaded or is disabled. + */ +class EventBufferArray { + /** All the events that are buffered to be sent. */ + + /** @inheritdoc */ + + /** @inheritdoc */ + + constructor() { + this.events = []; + this._totalSize = 0; + this.hasCheckout = false; + this.waitForCheckout = false; + } + + /** @inheritdoc */ + get hasEvents() { + return this.events.length > 0; + } + + /** @inheritdoc */ + get type() { + return 'sync'; + } + + /** @inheritdoc */ + destroy() { + this.events = []; + } + + /** @inheritdoc */ + async addEvent(event) { + const eventSize = JSON.stringify(event).length; + this._totalSize += eventSize; + if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) { + throw new EventBufferSizeExceededError(); + } + + this.events.push(event); + } + + /** @inheritdoc */ + finish() { + return new Promise(resolve => { + // Make a copy of the events array reference and immediately clear the + // events member so that we do not lose new events while uploading + // attachment. + const eventsRet = this.events; + this.clear(); + resolve(JSON.stringify(eventsRet)); + }); + } + + /** @inheritdoc */ + clear() { + this.events = []; + this._totalSize = 0; + this.hasCheckout = false; + } + + /** @inheritdoc */ + getEarliestTimestamp() { + const timestamp = this.events.map(event => event.timestamp).sort()[0]; + + if (!timestamp) { + return null; + } + + return timestampToMs(timestamp); + } +} + +/** + * Event buffer that uses a web worker to compress events. + * Exported only for testing. + */ +class WorkerHandler { + + constructor(worker) { + this._worker = worker; + this._id = 0; + } + + /** + * Ensure the worker is ready (or not). + * This will either resolve when the worker is ready, or reject if an error occurred. + */ + ensureReady() { + // Ensure we only check once + if (this._ensureReadyPromise) { + return this._ensureReadyPromise; + } + + this._ensureReadyPromise = new Promise((resolve, reject) => { + this._worker.addEventListener( + 'message', + ({ data }) => { + if ((data ).success) { + resolve(); + } else { + reject(); + } + }, + { once: true }, + ); + + this._worker.addEventListener( + 'error', + error => { + reject(error); + }, + { once: true }, + ); + }); + + return this._ensureReadyPromise; + } + + /** + * Destroy the worker. + */ + destroy() { + DEBUG_BUILD && logger.info('Destroying compression worker'); + this._worker.terminate(); + } + + /** + * Post message to worker and wait for response before resolving promise. + */ + postMessage(method, arg) { + const id = this._getAndIncrementId(); + + return new Promise((resolve, reject) => { + const listener = ({ data }) => { + const response = data ; + if (response.method !== method) { + return; + } + + // There can be multiple listeners for a single method, the id ensures + // that the response matches the caller. + if (response.id !== id) { + return; + } + + // At this point, we'll always want to remove listener regardless of result status + this._worker.removeEventListener('message', listener); + + if (!response.success) { + // TODO: Do some error handling, not sure what + DEBUG_BUILD && logger.error('Error in compression worker: ', response.response); + + reject(new Error('Error in compression worker')); + return; + } + + resolve(response.response ); + }; + + // Note: we can't use `once` option because it's possible it needs to + // listen to multiple messages + this._worker.addEventListener('message', listener); + this._worker.postMessage({ id, method, arg }); + }); + } + + /** Get the current ID and increment it for the next call. */ + _getAndIncrementId() { + return this._id++; + } +} + +/** + * Event buffer that uses a web worker to compress events. + * Exported only for testing. + */ +class EventBufferCompressionWorker { + /** @inheritdoc */ + + /** @inheritdoc */ + + constructor(worker) { + this._worker = new WorkerHandler(worker); + this._earliestTimestamp = null; + this._totalSize = 0; + this.hasCheckout = false; + this.waitForCheckout = false; + } + + /** @inheritdoc */ + get hasEvents() { + return !!this._earliestTimestamp; + } + + /** @inheritdoc */ + get type() { + return 'worker'; + } + + /** + * Ensure the worker is ready (or not). + * This will either resolve when the worker is ready, or reject if an error occurred. + */ + ensureReady() { + return this._worker.ensureReady(); + } + + /** + * Destroy the event buffer. + */ + destroy() { + this._worker.destroy(); + } + + /** + * Add an event to the event buffer. + * + * Returns true if event was successfully received and processed by worker. + */ + addEvent(event) { + const timestamp = timestampToMs(event.timestamp); + if (!this._earliestTimestamp || timestamp < this._earliestTimestamp) { + this._earliestTimestamp = timestamp; + } + + const data = JSON.stringify(event); + this._totalSize += data.length; + + if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) { + return Promise.reject(new EventBufferSizeExceededError()); + } + + return this._sendEventToWorker(data); + } + + /** + * Finish the event buffer and return the compressed data. + */ + finish() { + return this._finishRequest(); + } + + /** @inheritdoc */ + clear() { + this._earliestTimestamp = null; + this._totalSize = 0; + this.hasCheckout = false; + + // We do not wait on this, as we assume the order of messages is consistent for the worker + this._worker.postMessage('clear').then(null, e => { + DEBUG_BUILD && logger.exception(e, 'Sending "clear" message to worker failed', e); + }); + } + + /** @inheritdoc */ + getEarliestTimestamp() { + return this._earliestTimestamp; + } + + /** + * Send the event to the worker. + */ + _sendEventToWorker(data) { + return this._worker.postMessage('addEvent', data); + } + + /** + * Finish the request and return the compressed data from the worker. + */ + async _finishRequest() { + const response = await this._worker.postMessage('finish'); + + this._earliestTimestamp = null; + this._totalSize = 0; + + return response; + } +} + +/** + * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there. + * This can happen e.g. if the worker cannot be loaded. + * Exported only for testing. + */ +class EventBufferProxy { + + constructor(worker) { + this._fallback = new EventBufferArray(); + this._compression = new EventBufferCompressionWorker(worker); + this._used = this._fallback; + + this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded(); + } + + /** @inheritdoc */ + get waitForCheckout() { + return this._used.waitForCheckout; + } + + /** @inheritdoc */ + get type() { + return this._used.type; + } + + /** @inheritDoc */ + get hasEvents() { + return this._used.hasEvents; + } + + /** @inheritdoc */ + get hasCheckout() { + return this._used.hasCheckout; + } + /** @inheritdoc */ + set hasCheckout(value) { + this._used.hasCheckout = value; + } + + /** @inheritdoc */ + // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures + set waitForCheckout(value) { + this._used.waitForCheckout = value; + } + + /** @inheritDoc */ + destroy() { + this._fallback.destroy(); + this._compression.destroy(); + } + + /** @inheritdoc */ + clear() { + return this._used.clear(); + } + + /** @inheritdoc */ + getEarliestTimestamp() { + return this._used.getEarliestTimestamp(); + } + + /** + * Add an event to the event buffer. + * + * Returns true if event was successfully added. + */ + addEvent(event) { + return this._used.addEvent(event); + } + + /** @inheritDoc */ + async finish() { + // Ensure the worker is loaded, so the sent event is compressed + await this.ensureWorkerIsLoaded(); + + return this._used.finish(); + } + + /** Ensure the worker has loaded. */ + ensureWorkerIsLoaded() { + return this._ensureWorkerIsLoadedPromise; + } + + /** Actually check if the worker has been loaded. */ + async _ensureWorkerIsLoaded() { + try { + await this._compression.ensureReady(); + } catch (error) { + // If the worker fails to load, we fall back to the simple buffer. + // Nothing more to do from our side here + DEBUG_BUILD && logger.exception(error, 'Failed to load the compression worker, falling back to simple buffer'); + return; + } + + // Now we need to switch over the array buffer to the compression worker + await this._switchToCompressionWorker(); + } + + /** Switch the used buffer to the compression worker. */ + async _switchToCompressionWorker() { + const { events, hasCheckout, waitForCheckout } = this._fallback; + + const addEventPromises = []; + for (const event of events) { + addEventPromises.push(this._compression.addEvent(event)); + } + + this._compression.hasCheckout = hasCheckout; + this._compression.waitForCheckout = waitForCheckout; + + // We switch over to the new buffer immediately - any further events will be added + // after the previously buffered ones + this._used = this._compression; + + // Wait for original events to be re-added before resolving + try { + await Promise.all(addEventPromises); + + // Can now clear fallback buffer as it's no longer necessary + this._fallback.clear(); + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to add events when switching buffers.'); + } + } +} + +/** + * Create an event buffer for replays. + */ +function createEventBuffer({ + useCompression, + workerUrl: customWorkerUrl, +}) { + if ( + useCompression && + // eslint-disable-next-line no-restricted-globals + window.Worker + ) { + const worker = _loadWorker(customWorkerUrl); + + if (worker) { + return worker; + } + } + + DEBUG_BUILD && logger.info('Using simple buffer'); + return new EventBufferArray(); +} + +function _loadWorker(customWorkerUrl) { + try { + const workerUrl = customWorkerUrl || _getWorkerUrl(); + + if (!workerUrl) { + return; + } + + DEBUG_BUILD && logger.info(`Using compression worker${customWorkerUrl ? ` from ${customWorkerUrl}` : ''}`); + const worker = new Worker(workerUrl); + return new EventBufferProxy(worker); + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to create compression worker'); + // Fall back to use simple event buffer array + } +} + +function _getWorkerUrl() { + if (typeof __SENTRY_EXCLUDE_REPLAY_WORKER__ === 'undefined' || !__SENTRY_EXCLUDE_REPLAY_WORKER__) { + return e(); + } + + return ''; +} + +/** If sessionStorage is available. */ +function hasSessionStorage() { + try { + // This can throw, e.g. when being accessed in a sandboxed iframe + return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage; + } catch (e) { + return false; + } +} + +/** + * Removes the session from Session Storage and unsets session in replay instance + */ +function clearSession(replay) { + deleteSession(); + replay.session = undefined; +} + +/** + * Deletes a session from storage + */ +function deleteSession() { + if (!hasSessionStorage()) { + return; + } + + try { + WINDOW.sessionStorage.removeItem(REPLAY_SESSION_KEY); + } catch (e) { + // Ignore potential SecurityError exceptions + } +} + +/** + * Given a sample rate, returns true if replay should be sampled. + * + * 1.0 = 100% sampling + * 0.0 = 0% sampling + */ +function isSampled(sampleRate) { + if (sampleRate === undefined) { + return false; + } + + // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1) + return Math.random() < sampleRate; +} + +/** + * Get a session with defaults & applied sampling. + */ +function makeSession(session) { + const now = Date.now(); + const id = session.id || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_13__.uuid4)(); + // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests. + const started = session.started || now; + const lastActivity = session.lastActivity || now; + const segmentId = session.segmentId || 0; + const sampled = session.sampled; + const previousSessionId = session.previousSessionId; + + return { + id, + started, + lastActivity, + segmentId, + sampled, + previousSessionId, + }; +} + +/** + * Save a session to session storage. + */ +function saveSession(session) { + if (!hasSessionStorage()) { + return; + } + + try { + WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session)); + } catch (e) { + // Ignore potential SecurityError exceptions + } +} + +/** + * Get the sampled status for a session based on sample rates & current sampled status. + */ +function getSessionSampleType(sessionSampleRate, allowBuffering) { + return isSampled(sessionSampleRate) ? 'session' : allowBuffering ? 'buffer' : false; +} + +/** + * Create a new session, which in its current implementation is a Sentry event + * that all replays will be saved to as attachments. Currently, we only expect + * one of these Sentry events per "replay session". + */ +function createSession( + { sessionSampleRate, allowBuffering, stickySession = false }, + { previousSessionId } = {}, +) { + const sampled = getSessionSampleType(sessionSampleRate, allowBuffering); + const session = makeSession({ + sampled, + previousSessionId, + }); + + if (stickySession) { + saveSession(session); + } + + return session; +} + +/** + * Fetches a session from storage + */ +function fetchSession() { + if (!hasSessionStorage()) { + return null; + } + + try { + // This can throw if cookies are disabled + const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY); + + if (!sessionStringFromStorage) { + return null; + } + + const sessionObj = JSON.parse(sessionStringFromStorage) ; + + DEBUG_BUILD && logger.infoTick('Loading existing session'); + + return makeSession(sessionObj); + } catch (e) { + return null; + } +} + +/** + * Given an initial timestamp and an expiry duration, checks to see if current + * time should be considered as expired. + */ +function isExpired( + initialTime, + expiry, + targetTime = +new Date(), +) { + // Always expired if < 0 + if (initialTime === null || expiry === undefined || expiry < 0) { + return true; + } + + // Never expires if == 0 + if (expiry === 0) { + return false; + } + + return initialTime + expiry <= targetTime; +} + +/** + * Checks to see if session is expired + */ +function isSessionExpired( + session, + { + maxReplayDuration, + sessionIdleExpire, + targetTime = Date.now(), + }, +) { + return ( + // First, check that maximum session length has not been exceeded + isExpired(session.started, maxReplayDuration, targetTime) || + // check that the idle timeout has not been exceeded (i.e. user has + // performed an action within the last `sessionIdleExpire` ms) + isExpired(session.lastActivity, sessionIdleExpire, targetTime) + ); +} + +/** If the session should be refreshed or not. */ +function shouldRefreshSession( + session, + { sessionIdleExpire, maxReplayDuration }, +) { + // If not expired, all good, just keep the session + if (!isSessionExpired(session, { sessionIdleExpire, maxReplayDuration })) { + return false; + } + + // If we are buffering & haven't ever flushed yet, always continue + if (session.sampled === 'buffer' && session.segmentId === 0) { + return false; + } + + return true; +} + +/** + * Get or create a session, when initializing the replay. + * Returns a session that may be unsampled. + */ +function loadOrCreateSession( + { + sessionIdleExpire, + maxReplayDuration, + previousSessionId, + } + +, + sessionOptions, +) { + const existingSession = sessionOptions.stickySession && fetchSession(); + + // No session exists yet, just create a new one + if (!existingSession) { + DEBUG_BUILD && logger.infoTick('Creating new session'); + return createSession(sessionOptions, { previousSessionId }); + } + + if (!shouldRefreshSession(existingSession, { sessionIdleExpire, maxReplayDuration })) { + return existingSession; + } + + DEBUG_BUILD && logger.infoTick('Session in sessionStorage is expired, creating new one...'); + return createSession(sessionOptions, { previousSessionId: existingSession.id }); +} + +function isCustomEvent(event) { + return event.type === EventType.Custom; +} + +/** + * Add an event to the event buffer. + * In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail. + * Instead this returns `true` if we tried to add the event, else false. + * It returns `false` e.g. if we are paused, disabled, or out of the max replay duration. + * + * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`. + */ +function addEventSync(replay, event, isCheckout) { + if (!shouldAddEvent(replay, event)) { + return false; + } + + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + _addEvent(replay, event, isCheckout); + + return true; +} + +/** + * Add an event to the event buffer. + * Resolves to `null` if no event was added, else to `void`. + * + * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`. + */ +function addEvent( + replay, + event, + isCheckout, +) { + if (!shouldAddEvent(replay, event)) { + return Promise.resolve(null); + } + + return _addEvent(replay, event, isCheckout); +} + +async function _addEvent( + replay, + event, + isCheckout, +) { + const { eventBuffer } = replay; + + if (!eventBuffer || (eventBuffer.waitForCheckout && !isCheckout)) { + return null; + } + + const isBufferMode = replay.recordingMode === 'buffer'; + + try { + if (isCheckout && isBufferMode) { + eventBuffer.clear(); + } + + if (isCheckout) { + eventBuffer.hasCheckout = true; + eventBuffer.waitForCheckout = false; + } + + const replayOptions = replay.getOptions(); + + const eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent); + + if (!eventAfterPossibleCallback) { + return; + } + + return await eventBuffer.addEvent(eventAfterPossibleCallback); + } catch (error) { + const isExceeded = error && error instanceof EventBufferSizeExceededError; + const reason = isExceeded ? 'addEventSizeExceeded' : 'addEvent'; + + if (isExceeded && isBufferMode) { + // Clear buffer and wait for next checkout + eventBuffer.clear(); + eventBuffer.waitForCheckout = true; + + return null; + } + + replay.handleException(error); + + await replay.stop({ reason }); + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + + if (client) { + client.recordDroppedEvent('internal_sdk_error', 'replay'); + } + } +} + +/** Exported only for tests. */ +function shouldAddEvent(replay, event) { + if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) { + return false; + } + + const timestampInMs = timestampToMs(event.timestamp); + + // Throw out events that happen more than 5 minutes ago. This can happen if + // page has been left open and idle for a long period of time and user + // comes back to trigger a new session. The performance entries rely on + // `performance.timeOrigin`, which is when the page first opened. + if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) { + return false; + } + + // Throw out events that are +60min from the initial timestamp + if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) { + DEBUG_BUILD && + logger.infoTick(`Skipping event with timestamp ${timestampInMs} because it is after maxReplayDuration`); + return false; + } + + return true; +} + +function maybeApplyCallback( + event, + callback, +) { + try { + if (typeof callback === 'function' && isCustomEvent(event)) { + return callback(event); + } + } catch (error) { + DEBUG_BUILD && + logger.exception(error, 'An error occurred in the `beforeAddRecordingEvent` callback, skipping the event...'); + return null; + } + + return event; +} + +/** If the event is an error event */ +function isErrorEvent(event) { + return !event.type; +} + +/** If the event is a transaction event */ +function isTransactionEvent(event) { + return event.type === 'transaction'; +} + +/** If the event is an replay event */ +function isReplayEvent(event) { + return event.type === 'replay_event'; +} + +/** If the event is a feedback event */ +function isFeedbackEvent(event) { + return event.type === 'feedback'; +} + +/** + * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`. + */ +function handleAfterSendEvent(replay) { + return (event, sendResponse) => { + if (!replay.isEnabled() || (!isErrorEvent(event) && !isTransactionEvent(event))) { + return; + } + + const statusCode = sendResponse && sendResponse.statusCode; + + // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached + // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet) + // If we do use the base transport, we skip if we encountered an non-OK status code + if (!statusCode || statusCode < 200 || statusCode >= 300) { + return; + } + + if (isTransactionEvent(event)) { + handleTransactionEvent(replay, event); + return; + } + + handleErrorEvent(replay, event); + }; +} + +function handleTransactionEvent(replay, event) { + const replayContext = replay.getContext(); + + // Collect traceIds in _context regardless of `recordingMode` + // In error mode, _context gets cleared on every checkout + // We limit to max. 100 transactions linked + if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) { + replayContext.traceIds.add(event.contexts.trace.trace_id ); + } +} + +function handleErrorEvent(replay, event) { + const replayContext = replay.getContext(); + + // Add error to list of errorIds of replay. This is ok to do even if not + // sampled because context will get reset at next checkout. + // XXX: There is also a race condition where it's possible to capture an + // error to Sentry before Replay SDK has loaded, but response returns after + // it was loaded, and this gets called. + // We limit to max. 100 errors linked + if (event.event_id && replayContext.errorIds.size < 100) { + replayContext.errorIds.add(event.event_id); + } + + // If error event is tagged with replay id it means it was sampled (when in buffer mode) + // Need to be very careful that this does not cause an infinite loop + if (replay.recordingMode !== 'buffer' || !event.tags || !event.tags.replayId) { + return; + } + + const { beforeErrorSampling } = replay.getOptions(); + if (typeof beforeErrorSampling === 'function' && !beforeErrorSampling(event)) { + return; + } + + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_9__.setTimeout)(async () => { + try { + // Capture current event buffer as new replay + await replay.sendBufferedReplayOrFlush(); + } catch (err) { + replay.handleException(err); + } + }); +} + +/** + * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`. + */ +function handleBeforeSendEvent(replay) { + return (event) => { + if (!replay.isEnabled() || !isErrorEvent(event)) { + return; + } + + handleHydrationError(replay, event); + }; +} + +function handleHydrationError(replay, event) { + const exceptionValue = + event.exception && event.exception.values && event.exception.values[0] && event.exception.values[0].value; + if (typeof exceptionValue !== 'string') { + return; + } + + if ( + // Only matches errors in production builds of react-dom + // Example https://reactjs.org/docs/error-decoder.html?invariant=423 + // With newer React versions, the messages changed to a different website https://react.dev/errors/418 + exceptionValue.match( + /(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/, + ) || + // Development builds of react-dom + // Error 1: Hydration failed because the initial UI does not match what was rendered on the server. + // Error 2: Text content does not match server-rendered HTML. Warning: Text content did not match. + exceptionValue.match(/(does not match server-rendered HTML|Hydration failed because)/i) + ) { + const breadcrumb = createBreadcrumb({ + category: 'replay.hydrate-error', + data: { + url: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__.getLocationHref)(), + }, + }); + addBreadcrumbEvent(replay, breadcrumb); + } +} + +/** + * Handle breadcrumbs that Sentry captures, and make sure to capture relevant breadcrumbs to Replay as well. + */ +function handleBreadcrumbs(replay) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + + if (!client) { + return; + } + + client.on('beforeAddBreadcrumb', breadcrumb => beforeAddBreadcrumb(replay, breadcrumb)); +} + +function beforeAddBreadcrumb(replay, breadcrumb) { + if (!replay.isEnabled() || !isBreadcrumbWithCategory(breadcrumb)) { + return; + } + + const result = normalizeBreadcrumb(breadcrumb); + if (result) { + addBreadcrumbEvent(replay, result); + } +} + +/** Exported only for tests. */ +function normalizeBreadcrumb(breadcrumb) { + if ( + !isBreadcrumbWithCategory(breadcrumb) || + [ + // fetch & xhr are handled separately,in handleNetworkBreadcrumbs + 'fetch', + 'xhr', + // These two are breadcrumbs for emitted sentry events, we don't care about them + 'sentry.event', + 'sentry.transaction', + ].includes(breadcrumb.category) || + // We capture UI breadcrumbs separately + breadcrumb.category.startsWith('ui.') + ) { + return null; + } + + if (breadcrumb.category === 'console') { + return normalizeConsoleBreadcrumb(breadcrumb); + } + + return createBreadcrumb(breadcrumb); +} + +/** exported for tests only */ +function normalizeConsoleBreadcrumb( + breadcrumb, +) { + const args = breadcrumb.data && breadcrumb.data.arguments; + + if (!Array.isArray(args) || args.length === 0) { + return createBreadcrumb(breadcrumb); + } + + let isTruncated = false; + + // Avoid giant args captures + const normalizedArgs = args.map(arg => { + if (!arg) { + return arg; + } + if (typeof arg === 'string') { + if (arg.length > CONSOLE_ARG_MAX_SIZE) { + isTruncated = true; + return `${arg.slice(0, CONSOLE_ARG_MAX_SIZE)}…`; + } + + return arg; + } + if (typeof arg === 'object') { + try { + const normalizedArg = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.normalize)(arg, 7); + const stringified = JSON.stringify(normalizedArg); + if (stringified.length > CONSOLE_ARG_MAX_SIZE) { + isTruncated = true; + // We use the pretty printed JSON string here as a base + return `${JSON.stringify(normalizedArg, null, 2).slice(0, CONSOLE_ARG_MAX_SIZE)}…`; + } + return normalizedArg; + } catch (e) { + // fall back to default + } + } + + return arg; + }); + + return createBreadcrumb({ + ...breadcrumb, + data: { + ...breadcrumb.data, + arguments: normalizedArgs, + ...(isTruncated ? { _meta: { warnings: ['CONSOLE_ARG_TRUNCATED'] } } : {}), + }, + }); +} + +function isBreadcrumbWithCategory(breadcrumb) { + return !!breadcrumb.category; +} + +/** + * Returns true if we think the given event is an error originating inside of rrweb. + */ +function isRrwebError(event, hint) { + if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) { + return false; + } + + // @ts-expect-error this may be set by rrweb when it finds errors + if (hint.originalException && hint.originalException.__rrweb__) { + return true; + } + + return false; +} + +/** + * Reset the `replay_id` field on the DSC. + */ +function resetReplayIdOnDynamicSamplingContext() { + // Reset DSC on the current scope, if there is one + const dsc = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getCurrentScope)().getPropagationContext().dsc; + if (dsc) { + delete dsc.replay_id; + } + + // Clear it from frozen DSC on the active span + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.getActiveSpan)(); + if (activeSpan) { + const dsc = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_16__.getDynamicSamplingContextFromSpan)(activeSpan); + delete (dsc ).replay_id; + } +} + +/** + * Add a feedback breadcrumb event to replay. + */ +function addFeedbackBreadcrumb(replay, event) { + replay.triggerUserActivity(); + replay.addUpdate(() => { + if (!event.timestamp) { + // Ignore events that don't have timestamps (this shouldn't happen, more of a typing issue) + // Return true here so that we don't flush + return true; + } + + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + replay.throttledAddEvent({ + type: EventType.Custom, + timestamp: event.timestamp * 1000, + data: { + tag: 'breadcrumb', + payload: { + timestamp: event.timestamp, + type: 'default', + category: 'sentry.feedback', + data: { + feedbackId: event.event_id, + }, + }, + }, + } ); + + return false; + }); +} + +/** + * Determine if event should be sampled (only applies in buffer mode). + * When an event is captured by `handleGlobalEvent`, when in buffer mode + * we determine if we want to sample the error or not. + */ +function shouldSampleForBufferEvent(replay, event) { + if (replay.recordingMode !== 'buffer') { + return false; + } + + // ignore this error because otherwise we could loop indefinitely with + // trying to capture replay and failing + if (event.message === UNABLE_TO_SEND_REPLAY) { + return false; + } + + // Require the event to be an error event & to have an exception + if (!event.exception || event.type) { + return false; + } + + return isSampled(replay.getOptions().errorSampleRate); +} + +/** + * Returns a listener to be added to `addEventProcessor(listener)`. + */ +function handleGlobalEventListener(replay) { + return Object.assign( + (event, hint) => { + // Do nothing if replay has been disabled or paused + if (!replay.isEnabled() || replay.isPaused()) { + return event; + } + + if (isReplayEvent(event)) { + // Replays have separate set of breadcrumbs, do not include breadcrumbs + // from core SDK + delete event.breadcrumbs; + return event; + } + + // We only want to handle errors, transactions, and feedbacks, nothing else + if (!isErrorEvent(event) && !isTransactionEvent(event) && !isFeedbackEvent(event)) { + return event; + } + + // Ensure we do not add replay_id if the session is expired + const isSessionActive = replay.checkAndHandleExpiredSession(); + if (!isSessionActive) { + // prevent exceeding replay durations by removing the expired replayId from the DSC + resetReplayIdOnDynamicSamplingContext(); + return event; + } + + if (isFeedbackEvent(event)) { + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + replay.flush(); + event.contexts.feedback.replay_id = replay.getSessionId(); + // Add a replay breadcrumb for this piece of feedback + addFeedbackBreadcrumb(replay, event); + return event; + } + + // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb + // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users + if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) { + DEBUG_BUILD && logger.log('Ignoring error from rrweb internals', event); + return null; + } + + // When in buffer mode, we decide to sample here. + // Later, in `handleAfterSendEvent`, if the replayId is set, we know that we sampled + // And convert the buffer session to a full session + const isErrorEventSampled = shouldSampleForBufferEvent(replay, event); + + // Tag errors if it has been sampled in buffer mode, or if it is session mode + // Only tag transactions if in session mode + const shouldTagReplayId = isErrorEventSampled || replay.recordingMode === 'session'; + + if (shouldTagReplayId) { + event.tags = { ...event.tags, replayId: replay.getSessionId() }; + } + + return event; + }, + { id: 'Replay' }, + ); +} + +/** + * Create a "span" for each performance entry. + */ +function createPerformanceSpans( + replay, + entries, +) { + return entries.map(({ type, start, end, name, data }) => { + const response = replay.throttledAddEvent({ + type: EventType.Custom, + timestamp: start, + data: { + tag: 'performanceSpan', + payload: { + op: type, + description: name, + startTimestamp: start, + endTimestamp: end, + data, + }, + }, + }); + + // If response is a string, it means its either THROTTLED or SKIPPED + return typeof response === 'string' ? Promise.resolve(null) : response; + }); +} + +function handleHistory(handlerData) { + const { from, to } = handlerData; + + const now = Date.now() / 1000; + + return { + type: 'navigation.push', + start: now, + end: now, + name: to, + data: { + previous: from, + }, + }; +} + +/** + * Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`. + */ +function handleHistorySpanListener(replay) { + return (handlerData) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleHistory(handlerData); + + if (result === null) { + return; + } + + // Need to collect visited URLs + replay.getContext().urls.push(result.name); + replay.triggerUserActivity(); + + replay.addUpdate(() => { + createPerformanceSpans(replay, [result]); + // Returning false to flush + return false; + }); + }; +} + +/** + * Check whether a given request URL should be filtered out. This is so we + * don't log Sentry ingest requests. + */ +function shouldFilterRequest(replay, url) { + // If we enabled the `traceInternals` experiment, we want to trace everything + if (DEBUG_BUILD && replay.getOptions()._experiments.traceInternals) { + return false; + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.isSentryRequestUrl)(url, (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)()); +} + +/** Add a performance entry breadcrumb */ +function addNetworkBreadcrumb( + replay, + result, +) { + if (!replay.isEnabled()) { + return; + } + + if (result === null) { + return; + } + + if (shouldFilterRequest(replay, result.name)) { + return; + } + + replay.addUpdate(() => { + createPerformanceSpans(replay, [result]); + // Returning true will cause `addUpdate` to not flush + // We do not want network requests to cause a flush. This will prevent + // recurring/polling requests from keeping the replay session alive. + return true; + }); +} + +/** Get the size of a body. */ +function getBodySize(body) { + if (!body) { + return undefined; + } + + const textEncoder = new TextEncoder(); + + try { + if (typeof body === 'string') { + return textEncoder.encode(body).length; + } + + if (body instanceof URLSearchParams) { + return textEncoder.encode(body.toString()).length; + } + + if (body instanceof FormData) { + const formDataStr = _serializeFormData(body); + return textEncoder.encode(formDataStr).length; + } + + if (body instanceof Blob) { + return body.size; + } + + if (body instanceof ArrayBuffer) { + return body.byteLength; + } + + // Currently unhandled types: ArrayBufferView, ReadableStream + } catch (e) { + // just return undefined + } + + return undefined; +} + +/** Convert a Content-Length header to number/undefined. */ +function parseContentLengthHeader(header) { + if (!header) { + return undefined; + } + + const size = parseInt(header, 10); + return isNaN(size) ? undefined : size; +} + +/** Get the string representation of a body. */ +function getBodyString(body) { + try { + if (typeof body === 'string') { + return [body]; + } + + if (body instanceof URLSearchParams) { + return [body.toString()]; + } + + if (body instanceof FormData) { + return [_serializeFormData(body)]; + } + + if (!body) { + return [undefined]; + } + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to serialize body', body); + return [undefined, 'BODY_PARSE_ERROR']; + } + + DEBUG_BUILD && logger.info('Skipping network body because of body type', body); + + return [undefined, 'UNPARSEABLE_BODY_TYPE']; +} + +/** Merge a warning into an existing network request/response. */ +function mergeWarning( + info, + warning, +) { + if (!info) { + return { + headers: {}, + size: undefined, + _meta: { + warnings: [warning], + }, + }; + } + + const newMeta = { ...info._meta }; + const existingWarnings = newMeta.warnings || []; + newMeta.warnings = [...existingWarnings, warning]; + + info._meta = newMeta; + return info; +} + +/** Convert ReplayNetworkRequestData to a PerformanceEntry. */ +function makeNetworkReplayBreadcrumb( + type, + data, +) { + if (!data) { + return null; + } + + const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data; + + const result = { + type, + start: startTimestamp / 1000, + end: endTimestamp / 1000, + name: url, + data: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.dropUndefinedKeys)({ + method, + statusCode, + request, + response, + }), + }; + + return result; +} + +/** Build the request or response part of a replay network breadcrumb that was skipped. */ +function buildSkippedNetworkRequestOrResponse(bodySize) { + return { + headers: {}, + size: bodySize, + _meta: { + warnings: ['URL_SKIPPED'], + }, + }; +} + +/** Build the request or response part of a replay network breadcrumb. */ +function buildNetworkRequestOrResponse( + headers, + bodySize, + body, +) { + if (!bodySize && Object.keys(headers).length === 0) { + return undefined; + } + + if (!bodySize) { + return { + headers, + }; + } + + if (!body) { + return { + headers, + size: bodySize, + }; + } + + const info = { + headers, + size: bodySize, + }; + + const { body: normalizedBody, warnings } = normalizeNetworkBody(body); + info.body = normalizedBody; + if (warnings && warnings.length > 0) { + info._meta = { + warnings, + }; + } + + return info; +} + +/** Filter a set of headers */ +function getAllowedHeaders(headers, allowedHeaders) { + return Object.entries(headers).reduce((filteredHeaders, [key, value]) => { + const normalizedKey = key.toLowerCase(); + // Avoid putting empty strings into the headers + if (allowedHeaders.includes(normalizedKey) && headers[key]) { + filteredHeaders[normalizedKey] = value; + } + return filteredHeaders; + }, {}); +} + +function _serializeFormData(formData) { + // This is a bit simplified, but gives us a decent estimate + // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13' + // @ts-expect-error passing FormData to URLSearchParams actually works + return new URLSearchParams(formData).toString(); +} + +function normalizeNetworkBody(body) + + { + if (!body || typeof body !== 'string') { + return { + body, + }; + } + + const exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE; + const isProbablyJson = _strIsProbablyJson(body); + + if (exceedsSizeLimit) { + const truncatedBody = body.slice(0, NETWORK_BODY_MAX_SIZE); + + if (isProbablyJson) { + return { + body: truncatedBody, + warnings: ['MAYBE_JSON_TRUNCATED'], + }; + } + + return { + body: `${truncatedBody}…`, + warnings: ['TEXT_TRUNCATED'], + }; + } + + if (isProbablyJson) { + try { + const jsonBody = JSON.parse(body); + return { + body: jsonBody, + }; + } catch (e2) { + // fall back to just send the body as string + } + } + + return { + body, + }; +} + +function _strIsProbablyJson(str) { + const first = str[0]; + const last = str[str.length - 1]; + + // Simple check: If this does not start & end with {} or [], it's not JSON + return (first === '[' && last === ']') || (first === '{' && last === '}'); +} + +/** Match an URL against a list of strings/Regex. */ +function urlMatches(url, urls) { + const fullUrl = getFullUrl(url); + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_18__.stringMatchesSomePattern)(fullUrl, urls); +} + +/** exported for tests */ +function getFullUrl(url, baseURI = WINDOW.document.baseURI) { + // Short circuit for common cases: + if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith(WINDOW.location.origin)) { + return url; + } + const fixedUrl = new URL(url, baseURI); + + // If these do not match, we are not dealing with a relative URL, so just return it + if (fixedUrl.origin !== new URL(baseURI).origin) { + return url; + } + + const fullUrl = fixedUrl.href; + + // Remove trailing slashes, if they don't match the original URL + if (!url.endsWith('/') && fullUrl.endsWith('/')) { + return fullUrl.slice(0, -1); + } + + return fullUrl; +} + +/** + * Capture a fetch breadcrumb to a replay. + * This adds additional data (where appropriate). + */ +async function captureFetchBreadcrumbToReplay( + breadcrumb, + hint, + options + +, +) { + try { + const data = await _prepareFetchData(breadcrumb, hint, options); + + // Create a replay performance entry from this breadcrumb + const result = makeNetworkReplayBreadcrumb('resource.fetch', data); + addNetworkBreadcrumb(options.replay, result); + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to capture fetch breadcrumb'); + } +} + +/** + * Enrich a breadcrumb with additional data. + * This has to be sync & mutate the given breadcrumb, + * as the breadcrumb is afterwards consumed by other handlers. + */ +function enrichFetchBreadcrumb( + breadcrumb, + hint, +) { + const { input, response } = hint; + + const body = input ? _getFetchRequestArgBody(input) : undefined; + const reqSize = getBodySize(body); + + const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined; + + if (reqSize !== undefined) { + breadcrumb.data.request_body_size = reqSize; + } + if (resSize !== undefined) { + breadcrumb.data.response_body_size = resSize; + } +} + +async function _prepareFetchData( + breadcrumb, + hint, + options, +) { + const now = Date.now(); + const { startTimestamp = now, endTimestamp = now } = hint; + + const { + url, + method, + status_code: statusCode = 0, + request_body_size: requestBodySize, + response_body_size: responseBodySize, + } = breadcrumb.data; + + const captureDetails = + urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls); + + const request = captureDetails + ? _getRequestInfo(options, hint.input, requestBodySize) + : buildSkippedNetworkRequestOrResponse(requestBodySize); + const response = await _getResponseInfo(captureDetails, options, hint.response, responseBodySize); + + return { + startTimestamp, + endTimestamp, + url, + method, + statusCode, + request, + response, + }; +} + +function _getRequestInfo( + { networkCaptureBodies, networkRequestHeaders }, + input, + requestBodySize, +) { + const headers = input ? getRequestHeaders(input, networkRequestHeaders) : {}; + + if (!networkCaptureBodies) { + return buildNetworkRequestOrResponse(headers, requestBodySize, undefined); + } + + // We only want to transmit string or string-like bodies + const requestBody = _getFetchRequestArgBody(input); + const [bodyStr, warning] = getBodyString(requestBody); + const data = buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr); + + if (warning) { + return mergeWarning(data, warning); + } + + return data; +} + +/** Exported only for tests. */ +async function _getResponseInfo( + captureDetails, + { + networkCaptureBodies, + networkResponseHeaders, + }, + response, + responseBodySize, +) { + if (!captureDetails && responseBodySize !== undefined) { + return buildSkippedNetworkRequestOrResponse(responseBodySize); + } + + const headers = response ? getAllHeaders(response.headers, networkResponseHeaders) : {}; + + if (!response || (!networkCaptureBodies && responseBodySize !== undefined)) { + return buildNetworkRequestOrResponse(headers, responseBodySize, undefined); + } + + const [bodyText, warning] = await _parseFetchResponseBody(response); + const result = getResponseData(bodyText, { + networkCaptureBodies, + + responseBodySize, + captureDetails, + headers, + }); + + if (warning) { + return mergeWarning(result, warning); + } + + return result; +} + +function getResponseData( + bodyText, + { + networkCaptureBodies, + responseBodySize, + captureDetails, + headers, + } + +, +) { + try { + const size = + bodyText && bodyText.length && responseBodySize === undefined ? getBodySize(bodyText) : responseBodySize; + + if (!captureDetails) { + return buildSkippedNetworkRequestOrResponse(size); + } + + if (networkCaptureBodies) { + return buildNetworkRequestOrResponse(headers, size, bodyText); + } + + return buildNetworkRequestOrResponse(headers, size, undefined); + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to serialize response body'); + // fallback + return buildNetworkRequestOrResponse(headers, responseBodySize, undefined); + } +} + +async function _parseFetchResponseBody(response) { + const res = _tryCloneResponse(response); + + if (!res) { + return [undefined, 'BODY_PARSE_ERROR']; + } + + try { + const text = await _tryGetResponseText(res); + return [text]; + } catch (error) { + if (error instanceof Error && error.message.indexOf('Timeout') > -1) { + DEBUG_BUILD && logger.warn('Parsing text body from response timed out'); + return [undefined, 'BODY_PARSE_TIMEOUT']; + } + + DEBUG_BUILD && logger.exception(error, 'Failed to get text body from response'); + return [undefined, 'BODY_PARSE_ERROR']; + } +} + +function _getFetchRequestArgBody(fetchArgs = []) { + // We only support getting the body from the fetch options + if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') { + return undefined; + } + + return (fetchArgs[1] ).body; +} + +function getAllHeaders(headers, allowedHeaders) { + const allHeaders = {}; + + allowedHeaders.forEach(header => { + if (headers.get(header)) { + allHeaders[header] = headers.get(header) ; + } + }); + + return allHeaders; +} + +function getRequestHeaders(fetchArgs, allowedHeaders) { + if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') { + return getHeadersFromOptions(fetchArgs[0] , allowedHeaders); + } + + if (fetchArgs.length === 2) { + return getHeadersFromOptions(fetchArgs[1] , allowedHeaders); + } + + return {}; +} + +function getHeadersFromOptions( + input, + allowedHeaders, +) { + if (!input) { + return {}; + } + + const headers = input.headers; + + if (!headers) { + return {}; + } + + if (headers instanceof Headers) { + return getAllHeaders(headers, allowedHeaders); + } + + // We do not support this, as it is not really documented (anymore?) + if (Array.isArray(headers)) { + return {}; + } + + return getAllowedHeaders(headers, allowedHeaders); +} + +function _tryCloneResponse(response) { + try { + // We have to clone this, as the body can only be read once + return response.clone(); + } catch (error) { + // this can throw if the response was already consumed before + DEBUG_BUILD && logger.exception(error, 'Failed to clone response body'); + } +} + +/** + * Get the response body of a fetch request, or timeout after 500ms. + * Fetch can return a streaming body, that may not resolve (or not for a long time). + * If that happens, we rather abort after a short time than keep waiting for this. + */ +function _tryGetResponseText(response) { + return new Promise((resolve, reject) => { + const timeout = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_9__.setTimeout)(() => reject(new Error('Timeout while trying to read response body')), 500); + + _getResponseText(response) + .then( + txt => resolve(txt), + reason => reject(reason), + ) + .finally(() => clearTimeout(timeout)); + }); +} + +async function _getResponseText(response) { + // Force this to be a promise, just to be safe + // eslint-disable-next-line no-return-await + return await response.text(); +} + +/** + * Capture an XHR breadcrumb to a replay. + * This adds additional data (where appropriate). + */ +async function captureXhrBreadcrumbToReplay( + breadcrumb, + hint, + options, +) { + try { + const data = _prepareXhrData(breadcrumb, hint, options); + + // Create a replay performance entry from this breadcrumb + const result = makeNetworkReplayBreadcrumb('resource.xhr', data); + addNetworkBreadcrumb(options.replay, result); + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to capture xhr breadcrumb'); + } +} + +/** + * Enrich a breadcrumb with additional data. + * This has to be sync & mutate the given breadcrumb, + * as the breadcrumb is afterwards consumed by other handlers. + */ +function enrichXhrBreadcrumb( + breadcrumb, + hint, +) { + const { xhr, input } = hint; + + if (!xhr) { + return; + } + + const reqSize = getBodySize(input); + const resSize = xhr.getResponseHeader('content-length') + ? parseContentLengthHeader(xhr.getResponseHeader('content-length')) + : _getBodySize(xhr.response, xhr.responseType); + + if (reqSize !== undefined) { + breadcrumb.data.request_body_size = reqSize; + } + if (resSize !== undefined) { + breadcrumb.data.response_body_size = resSize; + } +} + +function _prepareXhrData( + breadcrumb, + hint, + options, +) { + const now = Date.now(); + const { startTimestamp = now, endTimestamp = now, input, xhr } = hint; + + const { + url, + method, + status_code: statusCode = 0, + request_body_size: requestBodySize, + response_body_size: responseBodySize, + } = breadcrumb.data; + + if (!url) { + return null; + } + + if (!xhr || !urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) { + const request = buildSkippedNetworkRequestOrResponse(requestBodySize); + const response = buildSkippedNetworkRequestOrResponse(responseBodySize); + return { + startTimestamp, + endTimestamp, + url, + method, + statusCode, + request, + response, + }; + } + + const xhrInfo = xhr[_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_19__.SENTRY_XHR_DATA_KEY]; + const networkRequestHeaders = xhrInfo + ? getAllowedHeaders(xhrInfo.request_headers, options.networkRequestHeaders) + : {}; + const networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.networkResponseHeaders); + + const [requestBody, requestWarning] = options.networkCaptureBodies ? getBodyString(input) : [undefined]; + const [responseBody, responseWarning] = options.networkCaptureBodies ? _getXhrResponseBody(xhr) : [undefined]; + + const request = buildNetworkRequestOrResponse(networkRequestHeaders, requestBodySize, requestBody); + const response = buildNetworkRequestOrResponse(networkResponseHeaders, responseBodySize, responseBody); + + return { + startTimestamp, + endTimestamp, + url, + method, + statusCode, + request: requestWarning ? mergeWarning(request, requestWarning) : request, + response: responseWarning ? mergeWarning(response, responseWarning) : response, + }; +} + +function getResponseHeaders(xhr) { + const headers = xhr.getAllResponseHeaders(); + + if (!headers) { + return {}; + } + + return headers.split('\r\n').reduce((acc, line) => { + const [key, value] = line.split(': ') ; + if (value) { + acc[key.toLowerCase()] = value; + } + return acc; + }, {}); +} + +function _getXhrResponseBody(xhr) { + // We collect errors that happen, but only log them if we can't get any response body + const errors = []; + + try { + return [xhr.responseText]; + } catch (e) { + errors.push(e); + } + + // Try to manually parse the response body, if responseText fails + try { + return _parseXhrResponse(xhr.response, xhr.responseType); + } catch (e) { + errors.push(e); + } + + DEBUG_BUILD && logger.warn('Failed to get xhr response body', ...errors); + + return [undefined]; +} + +/** + * Get the string representation of the XHR response. + * Based on MDN, these are the possible types of the response: + * string + * ArrayBuffer + * Blob + * Document + * POJO + * + * Exported only for tests. + */ +function _parseXhrResponse( + body, + responseType, +) { + try { + if (typeof body === 'string') { + return [body]; + } + + if (body instanceof Document) { + return [body.body.outerHTML]; + } + + if (responseType === 'json' && body && typeof body === 'object') { + return [JSON.stringify(body)]; + } + + if (!body) { + return [undefined]; + } + } catch (error) { + DEBUG_BUILD && logger.exception(error, 'Failed to serialize body', body); + return [undefined, 'BODY_PARSE_ERROR']; + } + + DEBUG_BUILD && logger.info('Skipping network body because of body type', body); + + return [undefined, 'UNPARSEABLE_BODY_TYPE']; +} + +function _getBodySize( + body, + responseType, +) { + try { + const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body; + return getBodySize(bodyStr); + } catch (e2) { + return undefined; + } +} + +/** + * This method does two things: + * - It enriches the regular XHR/fetch breadcrumbs with request/response size data + * - It captures the XHR/fetch breadcrumbs to the replay + * (enriching it with further data that is _not_ added to the regular breadcrumbs) + */ +function handleNetworkBreadcrumbs(replay) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + + try { + const { + networkDetailAllowUrls, + networkDetailDenyUrls, + networkCaptureBodies, + networkRequestHeaders, + networkResponseHeaders, + } = replay.getOptions(); + + const options = { + replay, + networkDetailAllowUrls, + networkDetailDenyUrls, + networkCaptureBodies, + networkRequestHeaders, + networkResponseHeaders, + }; + + if (client) { + client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint)); + } + } catch (e2) { + // Do nothing + } +} + +/** just exported for tests */ +function beforeAddNetworkBreadcrumb( + options, + breadcrumb, + hint, +) { + if (!breadcrumb.data) { + return; + } + + try { + if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) { + // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick + // Because the hook runs synchronously, and the breadcrumb is afterwards passed on + // So any async mutations to it will not be reflected in the final breadcrumb + enrichXhrBreadcrumb(breadcrumb, hint); + + // This call should not reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + captureXhrBreadcrumbToReplay(breadcrumb, hint, options); + } + + if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) { + // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick + // Because the hook runs synchronously, and the breadcrumb is afterwards passed on + // So any async mutations to it will not be reflected in the final breadcrumb + enrichFetchBreadcrumb(breadcrumb, hint); + + // This call should not reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + captureFetchBreadcrumbToReplay(breadcrumb, hint, options); + } + } catch (e) { + DEBUG_BUILD && logger.exception(e, 'Error when enriching network breadcrumb'); + } +} + +function _isXhrBreadcrumb(breadcrumb) { + return breadcrumb.category === 'xhr'; +} + +function _isFetchBreadcrumb(breadcrumb) { + return breadcrumb.category === 'fetch'; +} + +function _isXhrHint(hint) { + return hint && hint.xhr; +} + +function _isFetchHint(hint) { + return hint && hint.response; +} + +/** + * Add global listeners that cannot be removed. + */ +function addGlobalListeners(replay) { + // Listeners from core SDK // + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_20__.addClickKeypressInstrumentationHandler)(handleDomListener(replay)); + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_21__.addHistoryInstrumentationHandler)(handleHistorySpanListener(replay)); + handleBreadcrumbs(replay); + handleNetworkBreadcrumbs(replay); + + // Tag all (non replay) events that get sent to Sentry with the current + // replay ID so that we can reference them later in the UI + const eventProcessor = handleGlobalEventListener(replay); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.addEventProcessor)(eventProcessor); + + // If a custom client has no hooks yet, we continue to use the "old" implementation + if (client) { + client.on('beforeSendEvent', handleBeforeSendEvent(replay)); + client.on('afterSendEvent', handleAfterSendEvent(replay)); + client.on('createDsc', (dsc) => { + const replayId = replay.getSessionId(); + // We do not want to set the DSC when in buffer mode, as that means the replay has not been sent (yet) + if (replayId && replay.isEnabled() && replay.recordingMode === 'session') { + // Ensure to check that the session is still active - it could have expired in the meanwhile + const isSessionActive = replay.checkAndHandleExpiredSession(); + if (isSessionActive) { + dsc.replay_id = replayId; + } + } + }); + + client.on('spanStart', span => { + replay.lastActiveSpan = span; + }); + + // We may be missing the initial spanStart due to timing issues, + // so we capture it on finish again. + client.on('spanEnd', span => { + replay.lastActiveSpan = span; + }); + + // We want to flush replay + client.on('beforeSendFeedback', (feedbackEvent, options) => { + const replayId = replay.getSessionId(); + if (options && options.includeReplay && replay.isEnabled() && replayId) { + // This should never reject + if (feedbackEvent.contexts && feedbackEvent.contexts.feedback) { + feedbackEvent.contexts.feedback.replay_id = replayId; + } + } + }); + } +} + +/** + * Create a "span" for the total amount of memory being used by JS objects + * (including v8 internal objects). + */ +async function addMemoryEntry(replay) { + // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this + try { + return Promise.all( + createPerformanceSpans(replay, [ + // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above) + createMemoryEntry(WINDOW.performance.memory), + ]), + ); + } catch (error) { + // Do nothing + return []; + } +} + +function createMemoryEntry(memoryEntry) { + const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry; + // we don't want to use `getAbsoluteTime` because it adds the event time to the + // time origin, so we get the current timestamp instead + const time = Date.now() / 1000; + return { + type: 'memory', + name: 'memory', + start: time, + end: time, + data: { + memory: { + jsHeapSizeLimit, + totalJSHeapSize, + usedJSHeapSize, + }, + }, + }; +} + +/** + * Heavily simplified debounce function based on lodash.debounce. + * + * This function takes a callback function (@param fun) and delays its invocation + * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options, + * which ensures that the callback is invoked at least once after the specified max. wait time. + * + * @param func the function whose invocation is to be debounced + * @param wait the minimum time until the function is invoked after it was called once + * @param options the options object, which can contain the `maxWait` property + * + * @returns the debounced version of the function, which needs to be called at least once to start the + * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc + * was already invoked in the meantime, return @param func's return value. + * The debounced function has two additional properties: + * - `flush`: Invokes the debounced function immediately and returns its return value + * - `cancel`: Cancels the debouncing process and resets the debouncing timer + */ +function debounce(func, wait, options) { + let callbackReturnValue; + + let timerId; + let maxTimerId; + + const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0; + + function invokeFunc() { + cancelTimers(); + callbackReturnValue = func(); + return callbackReturnValue; + } + + function cancelTimers() { + timerId !== undefined && clearTimeout(timerId); + maxTimerId !== undefined && clearTimeout(maxTimerId); + timerId = maxTimerId = undefined; + } + + function flush() { + if (timerId !== undefined || maxTimerId !== undefined) { + return invokeFunc(); + } + return callbackReturnValue; + } + + function debounced() { + if (timerId) { + clearTimeout(timerId); + } + timerId = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_9__.setTimeout)(invokeFunc, wait); + + if (maxWait && maxTimerId === undefined) { + maxTimerId = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_9__.setTimeout)(invokeFunc, maxWait); + } + + return callbackReturnValue; + } + + debounced.cancel = cancelTimers; + debounced.flush = flush; + return debounced; +} + +/** + * Handler for recording events. + * + * Adds to event buffer, and has varying flushing behaviors if the event was a checkout. + */ +function getHandleRecordingEmit(replay) { + let hadFirstEvent = false; + + return (event, _isCheckout) => { + // If this is false, it means session is expired, create and a new session and wait for checkout + if (!replay.checkAndHandleExpiredSession()) { + DEBUG_BUILD && logger.warn('Received replay event after session expired.'); + + return; + } + + // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms` + // We also want to treat the first event as a checkout, so we handle this specifically here + const isCheckout = _isCheckout || !hadFirstEvent; + hadFirstEvent = true; + + if (replay.clickDetector) { + updateClickDetectorForRecordingEvent(replay.clickDetector, event); + } + + // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush. + replay.addUpdate(() => { + // The session is always started immediately on pageload/init, but for + // error-only replays, it should reflect the most recent checkout + // when an error occurs. Clear any state that happens before this current + // checkout. This needs to happen before `addEvent()` which updates state + // dependent on this reset. + if (replay.recordingMode === 'buffer' && isCheckout) { + replay.setInitialState(); + } + + // If the event is not added (e.g. due to being paused, disabled, or out of the max replay duration), + // Skip all further steps + if (!addEventSync(replay, event, isCheckout)) { + // Return true to skip scheduling a debounced flush + return true; + } + + // Different behavior for full snapshots (type=2), ignore other event types + // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16 + if (!isCheckout) { + return false; + } + + const session = replay.session; + + // Additionally, create a meta event that will capture certain SDK settings. + // In order to handle buffer mode, this needs to either be done when we + // receive checkout events or at flush time. We have an experimental mode + // to perform multiple checkouts a session (the idea is to improve + // seeking during playback), so also only include if segmentId is 0 + // (handled in `addSettingsEvent`). + // + // `isCheckout` is always true, but want to be explicit that it should + // only be added for checkouts + addSettingsEvent(replay, isCheckout); + + // When in buffer mode, make sure we adjust the session started date to the current earliest event of the buffer + // this should usually be the timestamp of the checkout event, but to be safe... + if (replay.recordingMode === 'buffer' && session && replay.eventBuffer) { + const earliestEvent = replay.eventBuffer.getEarliestTimestamp(); + if (earliestEvent) { + DEBUG_BUILD && + logger.info(`Updating session start time to earliest event in buffer to ${new Date(earliestEvent)}`); + + session.started = earliestEvent; + + if (replay.getOptions().stickySession) { + saveSession(session); + } + } + } + + // If there is a previousSessionId after a full snapshot occurs, then + // the replay session was started due to session expiration. The new session + // is started before triggering a new checkout and contains the id + // of the previous session. Do not immediately flush in this case + // to avoid capturing only the checkout and instead the replay will + // be captured if they perform any follow-up actions. + if (session && session.previousSessionId) { + return true; + } + + if (replay.recordingMode === 'session') { + // If the full snapshot is due to an initial load, we will not have + // a previous session ID. In this case, we want to buffer events + // for a set amount of time before flushing. This can help avoid + // capturing replays of users that immediately close the window. + + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + void replay.flush(); + } + + return true; + }); + }; +} + +/** + * Exported for tests + */ +function createOptionsEvent(replay) { + const options = replay.getOptions(); + return { + type: EventType.Custom, + timestamp: Date.now(), + data: { + tag: 'options', + payload: { + shouldRecordCanvas: replay.isRecordingCanvas(), + sessionSampleRate: options.sessionSampleRate, + errorSampleRate: options.errorSampleRate, + useCompressionOption: options.useCompression, + blockAllMedia: options.blockAllMedia, + maskAllText: options.maskAllText, + maskAllInputs: options.maskAllInputs, + useCompression: replay.eventBuffer ? replay.eventBuffer.type === 'worker' : false, + networkDetailHasUrls: options.networkDetailAllowUrls.length > 0, + networkCaptureBodies: options.networkCaptureBodies, + networkRequestHasHeaders: options.networkRequestHeaders.length > 0, + networkResponseHasHeaders: options.networkResponseHeaders.length > 0, + }, + }, + }; +} + +/** + * Add a "meta" event that contains a simplified view on current configuration + * options. This should only be included on the first segment of a recording. + */ +function addSettingsEvent(replay, isCheckout) { + // Only need to add this event when sending the first segment + if (!isCheckout || !replay.session || replay.session.segmentId !== 0) { + return; + } + + addEventSync(replay, createOptionsEvent(replay), false); +} + +/** + * Create a replay envelope ready to be sent. + * This includes both the replay event, as well as the recording data. + */ +function createReplayEnvelope( + replayEvent, + recordingData, + dsn, + tunnel, +) { + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_22__.createEnvelope)( + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_22__.createEventEnvelopeHeaders)(replayEvent, (0,_sentry_core__WEBPACK_IMPORTED_MODULE_22__.getSdkMetadataForEnvelopeHeader)(replayEvent), tunnel, dsn), + [ + [{ type: 'replay_event' }, replayEvent], + [ + { + type: 'replay_recording', + // If string then we need to encode to UTF8, otherwise will have + // wrong size. TextEncoder has similar browser support to + // MutationObserver, although it does not accept IE11. + length: + typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length, + }, + recordingData, + ], + ], + ); +} + +/** + * Prepare the recording data ready to be sent. + */ +function prepareRecordingData({ + recordingData, + headers, +} + +) { + let payloadWithSequence; + + // XXX: newline is needed to separate sequence id from events + const replayHeaders = `${JSON.stringify(headers)} +`; + + if (typeof recordingData === 'string') { + payloadWithSequence = `${replayHeaders}${recordingData}`; + } else { + const enc = new TextEncoder(); + // XXX: newline is needed to separate sequence id from events + const sequence = enc.encode(replayHeaders); + // Merge the two Uint8Arrays + payloadWithSequence = new Uint8Array(sequence.length + recordingData.length); + payloadWithSequence.set(sequence); + payloadWithSequence.set(recordingData, sequence.length); + } + + return payloadWithSequence; +} + +/** + * Prepare a replay event & enrich it with the SDK metadata. + */ +async function prepareReplayEvent({ + client, + scope, + replayId: event_id, + event, +} + +) { + const integrations = + typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations) + ? Object.keys(client._integrations) + : undefined; + + const eventHint = { event_id, integrations }; + + client.emit('preprocessEvent', event, eventHint); + + const preparedEvent = (await (0,_sentry_core__WEBPACK_IMPORTED_MODULE_23__.prepareEvent)( + client.getOptions(), + event, + eventHint, + scope, + client, + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getIsolationScope)(), + )) ; + + // If e.g. a global event processor returned null + if (!preparedEvent) { + return null; + } + + // This normally happens in browser client "_prepareEvent" + // but since we do not use this private method from the client, but rather the plain import + // we need to do this manually. + preparedEvent.platform = preparedEvent.platform || 'javascript'; + + // extract the SDK name because `client._prepareEvent` doesn't add it to the event + const metadata = client.getSdkMetadata(); + const { name, version } = (metadata && metadata.sdk) || {}; + + preparedEvent.sdk = { + ...preparedEvent.sdk, + name: name || 'sentry.javascript.unknown', + version: version || '0.0.0', + }; + + return preparedEvent; +} + +/** + * Send replay attachment using `fetch()` + */ +async function sendReplayRequest({ + recordingData, + replayId, + segmentId: segment_id, + eventContext, + timestamp, + session, +}) { + const preparedRecordingData = prepareRecordingData({ + recordingData, + headers: { + segment_id, + }, + }); + + const { urls, errorIds, traceIds, initialTimestamp } = eventContext; + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + const scope = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getCurrentScope)(); + const transport = client && client.getTransport(); + const dsn = client && client.getDsn(); + + if (!client || !transport || !dsn || !session.sampled) { + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_24__.resolvedSyncPromise)({}); + } + + const baseEvent = { + type: REPLAY_EVENT_NAME, + replay_start_timestamp: initialTimestamp / 1000, + timestamp: timestamp / 1000, + error_ids: errorIds, + trace_ids: traceIds, + urls, + replay_id: replayId, + segment_id, + replay_type: session.sampled, + }; + + const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent }); + + if (!replayEvent) { + // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions + client.recordDroppedEvent('event_processor', 'replay', baseEvent); + DEBUG_BUILD && logger.info('An event processor returned `null`, will not send event.'); + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_24__.resolvedSyncPromise)({}); + } + + /* + For reference, the fully built event looks something like this: + { + "type": "replay_event", + "timestamp": 1670837008.634, + "error_ids": [ + "errorId" + ], + "trace_ids": [ + "traceId" + ], + "urls": [ + "https://example.com" + ], + "replay_id": "eventId", + "segment_id": 3, + "replay_type": "error", + "platform": "javascript", + "event_id": "eventId", + "environment": "production", + "sdk": { + "integrations": [ + "BrowserTracing", + "Replay" + ], + "name": "sentry.javascript.browser", + "version": "7.25.0" + }, + "sdkProcessingMetadata": {}, + "contexts": { + }, + } + */ + + // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to + // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may + // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid + // of this `delete`, lest we miss putting it back in the next time the property is in use.) + delete replayEvent.sdkProcessingMetadata; + + const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel); + + let response; + + try { + response = await transport.send(envelope); + } catch (err) { + const error = new Error(UNABLE_TO_SEND_REPLAY); + + try { + // In case browsers don't allow this property to be writable + // @ts-expect-error This needs lib es2022 and newer + error.cause = err; + } catch (e) { + // nothing to do + } + throw error; + } + + // If the status code is invalid, we want to immediately stop & not retry + if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) { + throw new TransportStatusCodeError(response.statusCode); + } + + const rateLimits = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_25__.updateRateLimits)({}, response); + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_25__.isRateLimited)(rateLimits, 'replay')) { + throw new RateLimitError(rateLimits); + } + + return response; +} + +/** + * This error indicates that the transport returned an invalid status code. + */ +class TransportStatusCodeError extends Error { + constructor(statusCode) { + super(`Transport returned status code ${statusCode}`); + } +} + +/** + * This error indicates that we hit a rate limit API error. + */ +class RateLimitError extends Error { + + constructor(rateLimits) { + super('Rate limit hit'); + this.rateLimits = rateLimits; + } +} + +/** + * Finalize and send the current replay event to Sentry + */ +async function sendReplay( + replayData, + retryConfig = { + count: 0, + interval: RETRY_BASE_INTERVAL, + }, +) { + const { recordingData, onError } = replayData; + + // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check) + if (!recordingData.length) { + return; + } + + try { + await sendReplayRequest(replayData); + return true; + } catch (err) { + if (err instanceof TransportStatusCodeError || err instanceof RateLimitError) { + throw err; + } + + // Capture error for every failed replay + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.setContext)('Replays', { + _retryCount: retryConfig.count, + }); + + if (onError) { + onError(err); + } + + // If an error happened here, it's likely that uploading the attachment + // failed, we'll can retry with the same events payload + if (retryConfig.count >= RETRY_MAX_COUNT) { + const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`); + + try { + // In case browsers don't allow this property to be writable + // @ts-expect-error This needs lib es2022 and newer + error.cause = err; + } catch (e) { + // nothing to do + } + + throw error; + } + + // will retry in intervals of 5, 10, 30 + retryConfig.interval *= ++retryConfig.count; + + return new Promise((resolve, reject) => { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_9__.setTimeout)(async () => { + try { + await sendReplay(replayData, retryConfig); + resolve(true); + } catch (err) { + reject(err); + } + }, retryConfig.interval); + }); + } +} + +const THROTTLED = '__THROTTLED'; +const SKIPPED = '__SKIPPED'; + +/** + * Create a throttled function off a given function. + * When calling the throttled function, it will call the original function only + * if it hasn't been called more than `maxCount` times in the last `durationSeconds`. + * + * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`, + * or else the return value of the original function. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function throttle( + fn, + maxCount, + durationSeconds, +) { + const counter = new Map(); + + const _cleanup = (now) => { + const threshold = now - durationSeconds; + counter.forEach((_value, key) => { + if (key < threshold) { + counter.delete(key); + } + }); + }; + + const _getTotalCount = () => { + return [...counter.values()].reduce((a, b) => a + b, 0); + }; + + let isThrottled = false; + + return (...rest) => { + // Date in second-precision, which we use as basis for the throttling + const now = Math.floor(Date.now() / 1000); + + // First, make sure to delete any old entries + _cleanup(now); + + // If already over limit, do nothing + if (_getTotalCount() >= maxCount) { + const wasThrottled = isThrottled; + isThrottled = true; + return wasThrottled ? SKIPPED : THROTTLED; + } + + isThrottled = false; + const count = counter.get(now) || 0; + counter.set(now, count + 1); + + return fn(...rest); + }; +} + +/* eslint-disable max-lines */ // TODO: We might want to split this file up + +/** + * The main replay container class, which holds all the state and methods for recording and sending replays. + */ +class ReplayContainer { + + /** + * Recording can happen in one of two modes: + * - session: Record the whole session, sending it continuously + * - buffer: Always keep the last 60s of recording, requires: + * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs + * - or calling `flush()` to send the replay + */ + + /** + * The current or last active span. + * This is only available when performance is enabled. + */ + + /** + * These are here so we can overwrite them in tests etc. + * @hidden + */ + + /** The replay has to be manually started, because no sample rate (neither session or error) was provided. */ + + /** + * Options to pass to `rrweb.record()` + */ + + /** + * Timestamp of the last user activity. This lives across sessions. + */ + + /** + * Is the integration currently active? + */ + + /** + * Paused is a state where: + * - DOM Recording is not listening at all + * - Nothing will be added to event buffer (e.g. core SDK events) + */ + + /** + * Have we attached listeners to the core SDK? + * Note we have to track this as there is no way to remove instrumentation handlers. + */ + + /** + * Function to stop recording + */ + + /** + * Internal use for canvas recording options + */ + + constructor({ + options, + recordingOptions, + } + +) {ReplayContainer.prototype.__init.call(this);ReplayContainer.prototype.__init2.call(this);ReplayContainer.prototype.__init3.call(this);ReplayContainer.prototype.__init4.call(this);ReplayContainer.prototype.__init5.call(this);ReplayContainer.prototype.__init6.call(this); + this.eventBuffer = null; + this.performanceEntries = []; + this.replayPerformanceEntries = []; + this.recordingMode = 'session'; + this.timeouts = { + sessionIdlePause: SESSION_IDLE_PAUSE_DURATION, + sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION, + } ; + this._lastActivity = Date.now(); + this._isEnabled = false; + this._isPaused = false; + this._requiresManualStart = false; + this._hasInitializedCoreListeners = false; + this._context = { + errorIds: new Set(), + traceIds: new Set(), + urls: [], + initialTimestamp: Date.now(), + initialUrl: '', + }; + + this._recordingOptions = recordingOptions; + this._options = options; + + this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, { + maxWait: this._options.flushMaxDelay, + }); + + this._throttledAddEvent = throttle( + (event, isCheckout) => addEvent(this, event, isCheckout), + // Max 300 events... + 300, + // ... per 5s + 5, + ); + + const { slowClickTimeout, slowClickIgnoreSelectors } = this.getOptions(); + + const slowClickConfig = slowClickTimeout + ? { + threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout), + timeout: slowClickTimeout, + scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT, + ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(',') : '', + } + : undefined; + + if (slowClickConfig) { + this.clickDetector = new ClickDetector(this, slowClickConfig); + } + + // Configure replay logger w/ experimental options + if (DEBUG_BUILD) { + const experiments = options._experiments; + logger.setConfig({ + captureExceptions: !!experiments.captureExceptions, + traceInternals: !!experiments.traceInternals, + }); + } + } + + /** Get the event context. */ + getContext() { + return this._context; + } + + /** If recording is currently enabled. */ + isEnabled() { + return this._isEnabled; + } + + /** If recording is currently paused. */ + isPaused() { + return this._isPaused; + } + + /** + * Determine if canvas recording is enabled + */ + isRecordingCanvas() { + return Boolean(this._canvas); + } + + /** Get the replay integration options. */ + getOptions() { + return this._options; + } + + /** A wrapper to conditionally capture exceptions. */ + handleException(error) { + DEBUG_BUILD && logger.exception(error); + if (this._options.onError) { + this._options.onError(error); + } + } + + /** + * Initializes the plugin based on sampling configuration. Should not be + * called outside of constructor. + */ + initializeSampling(previousSessionId) { + const { errorSampleRate, sessionSampleRate } = this._options; + + // If neither sample rate is > 0, then do nothing - user will need to call one of + // `start()` or `startBuffering` themselves. + const requiresManualStart = errorSampleRate <= 0 && sessionSampleRate <= 0; + + this._requiresManualStart = requiresManualStart; + + if (requiresManualStart) { + return; + } + + // Otherwise if there is _any_ sample rate set, try to load an existing + // session, or create a new one. + this._initializeSessionForSampling(previousSessionId); + + if (!this.session) { + // This should not happen, something wrong has occurred + DEBUG_BUILD && logger.exception(new Error('Unable to initialize and create session')); + return; + } + + if (this.session.sampled === false) { + // This should only occur if `errorSampleRate` is 0 and was unsampled for + // session-based replay. In this case there is nothing to do. + return; + } + + // If segmentId > 0, it means we've previously already captured this session + // In this case, we still want to continue in `session` recording mode + this.recordingMode = this.session.sampled === 'buffer' && this.session.segmentId === 0 ? 'buffer' : 'session'; + + DEBUG_BUILD && logger.infoTick(`Starting replay in ${this.recordingMode} mode`); + + this._initializeRecording(); + } + + /** + * Start a replay regardless of sampling rate. Calling this will always + * create a new session. Will log a message if replay is already in progress. + * + * Creates or loads a session, attaches listeners to varying events (DOM, + * _performanceObserver, Recording, Sentry SDK, etc) + */ + start() { + if (this._isEnabled && this.recordingMode === 'session') { + DEBUG_BUILD && logger.info('Recording is already in progress'); + return; + } + + if (this._isEnabled && this.recordingMode === 'buffer') { + DEBUG_BUILD && logger.info('Buffering is in progress, call `flush()` to save the replay'); + return; + } + + DEBUG_BUILD && logger.infoTick('Starting replay in session mode'); + + // Required as user activity is initially set in + // constructor, so if `start()` is called after + // session idle expiration, a replay will not be + // created due to an idle timeout. + this._updateUserActivity(); + + const session = loadOrCreateSession( + { + maxReplayDuration: this._options.maxReplayDuration, + sessionIdleExpire: this.timeouts.sessionIdleExpire, + }, + { + stickySession: this._options.stickySession, + // This is intentional: create a new session-based replay when calling `start()` + sessionSampleRate: 1, + allowBuffering: false, + }, + ); + + this.session = session; + + this._initializeRecording(); + } + + /** + * Start replay buffering. Buffers until `flush()` is called or, if + * `replaysOnErrorSampleRate` > 0, an error occurs. + */ + startBuffering() { + if (this._isEnabled) { + DEBUG_BUILD && logger.info('Buffering is in progress, call `flush()` to save the replay'); + return; + } + + DEBUG_BUILD && logger.infoTick('Starting replay in buffer mode'); + + const session = loadOrCreateSession( + { + sessionIdleExpire: this.timeouts.sessionIdleExpire, + maxReplayDuration: this._options.maxReplayDuration, + }, + { + stickySession: this._options.stickySession, + sessionSampleRate: 0, + allowBuffering: true, + }, + ); + + this.session = session; + + this.recordingMode = 'buffer'; + this._initializeRecording(); + } + + /** + * Start recording. + * + * Note that this will cause a new DOM checkout + */ + startRecording() { + try { + const canvasOptions = this._canvas; + + this._stopRecording = record({ + ...this._recordingOptions, + // When running in error sampling mode, we need to overwrite `checkoutEveryNms` + // Without this, it would record forever, until an error happens, which we don't want + // instead, we'll always keep the last 60 seconds of replay before an error happened + ...(this.recordingMode === 'buffer' + ? { checkoutEveryNms: BUFFER_CHECKOUT_TIME } + : // Otherwise, use experimental option w/ min checkout time of 6 minutes + // This is to improve playback seeking as there could potentially be + // less mutations to process in the worse cases. + // + // checkout by "N" events is probably ideal, but means we have less + // control about the number of checkouts we make (which generally + // increases replay size) + this._options._experiments.continuousCheckout && { + // Minimum checkout time is 6 minutes + checkoutEveryNms: Math.max(360000, this._options._experiments.continuousCheckout), + }), + emit: getHandleRecordingEmit(this), + onMutation: this._onMutationHandler, + ...(canvasOptions + ? { + recordCanvas: canvasOptions.recordCanvas, + getCanvasManager: canvasOptions.getCanvasManager, + sampling: canvasOptions.sampling, + dataURLOptions: canvasOptions.dataURLOptions, + } + : {}), + }); + } catch (err) { + this.handleException(err); + } + } + + /** + * Stops the recording, if it was running. + * + * Returns true if it was previously stopped, or is now stopped, + * otherwise false. + */ + stopRecording() { + try { + if (this._stopRecording) { + this._stopRecording(); + this._stopRecording = undefined; + } + + return true; + } catch (err) { + this.handleException(err); + return false; + } + } + + /** + * Currently, this needs to be manually called (e.g. for tests). Sentry SDK + * does not support a teardown + */ + async stop({ forceFlush = false, reason } = {}) { + if (!this._isEnabled) { + return; + } + + // We can't move `_isEnabled` after awaiting a flush, otherwise we can + // enter into an infinite loop when `stop()` is called while flushing. + this._isEnabled = false; + + try { + DEBUG_BUILD && logger.info(`Stopping Replay${reason ? ` triggered by ${reason}` : ''}`); + + resetReplayIdOnDynamicSamplingContext(); + + this._removeListeners(); + this.stopRecording(); + + this._debouncedFlush.cancel(); + // See comment above re: `_isEnabled`, we "force" a flush, ignoring the + // `_isEnabled` state of the plugin since it was disabled above. + if (forceFlush) { + await this._flush({ force: true }); + } + + // After flush, destroy event buffer + this.eventBuffer && this.eventBuffer.destroy(); + this.eventBuffer = null; + + // Clear session from session storage, note this means if a new session + // is started after, it will not have `previousSessionId` + clearSession(this); + } catch (err) { + this.handleException(err); + } + } + + /** + * Pause some replay functionality. See comments for `_isPaused`. + * This differs from stop as this only stops DOM recording, it is + * not as thorough of a shutdown as `stop()`. + */ + pause() { + if (this._isPaused) { + return; + } + + this._isPaused = true; + this.stopRecording(); + + DEBUG_BUILD && logger.info('Pausing replay'); + } + + /** + * Resumes recording, see notes for `pause(). + * + * Note that calling `startRecording()` here will cause a + * new DOM checkout.` + */ + resume() { + if (!this._isPaused || !this._checkSession()) { + return; + } + + this._isPaused = false; + this.startRecording(); + + DEBUG_BUILD && logger.info('Resuming replay'); + } + + /** + * If not in "session" recording mode, flush event buffer which will create a new replay. + * Unless `continueRecording` is false, the replay will continue to record and + * behave as a "session"-based replay. + * + * Otherwise, queue up a flush. + */ + async sendBufferedReplayOrFlush({ continueRecording = true } = {}) { + if (this.recordingMode === 'session') { + return this.flushImmediate(); + } + + const activityTime = Date.now(); + + DEBUG_BUILD && logger.info('Converting buffer to session'); + + // Allow flush to complete before resuming as a session recording, otherwise + // the checkout from `startRecording` may be included in the payload. + // Prefer to keep the error replay as a separate (and smaller) segment + // than the session replay. + await this.flushImmediate(); + + const hasStoppedRecording = this.stopRecording(); + + if (!continueRecording || !hasStoppedRecording) { + return; + } + + // To avoid race conditions where this is called multiple times, we check here again that we are still buffering + if ((this.recordingMode ) === 'session') { + return; + } + + // Re-start recording in session-mode + this.recordingMode = 'session'; + + // Once this session ends, we do not want to refresh it + if (this.session) { + this._updateUserActivity(activityTime); + this._updateSessionActivity(activityTime); + this._maybeSaveSession(); + } + + this.startRecording(); + } + + /** + * We want to batch uploads of replay events. Save events only if + * `` milliseconds have elapsed since the last event + * *OR* if `` milliseconds have elapsed. + * + * Accepts a callback to perform side-effects and returns true to stop batch + * processing and hand back control to caller. + */ + addUpdate(cb) { + // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'buffer'`) + const cbResult = cb(); + + // If this option is turned on then we will only want to call `flush` + // explicitly + if (this.recordingMode === 'buffer') { + return; + } + + // If callback is true, we do not want to continue with flushing -- the + // caller will need to handle it. + if (cbResult === true) { + return; + } + + // addUpdate is called quite frequently - use _debouncedFlush so that it + // respects the flush delays and does not flush immediately + this._debouncedFlush(); + } + + /** + * Updates the user activity timestamp and resumes recording. This should be + * called in an event handler for a user action that we consider as the user + * being "active" (e.g. a mouse click). + */ + triggerUserActivity() { + this._updateUserActivity(); + + // This case means that recording was once stopped due to inactivity. + // Ensure that recording is resumed. + if (!this._stopRecording) { + // Create a new session, otherwise when the user action is flushed, it + // will get rejected due to an expired session. + if (!this._checkSession()) { + return; + } + + // Note: This will cause a new DOM checkout + this.resume(); + return; + } + + // Otherwise... recording was never suspended, continue as normalish + this.checkAndHandleExpiredSession(); + + this._updateSessionActivity(); + } + + /** + * Updates the user activity timestamp *without* resuming + * recording. Some user events (e.g. keydown) can be create + * low-value replays that only contain the keypress as a + * breadcrumb. Instead this would require other events to + * create a new replay after a session has expired. + */ + updateUserActivity() { + this._updateUserActivity(); + this._updateSessionActivity(); + } + + /** + * Only flush if `this.recordingMode === 'session'` + */ + conditionalFlush() { + if (this.recordingMode === 'buffer') { + return Promise.resolve(); + } + + return this.flushImmediate(); + } + + /** + * Flush using debounce flush + */ + flush() { + return this._debouncedFlush() ; + } + + /** + * Always flush via `_debouncedFlush` so that we do not have flushes triggered + * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be + * cases of multiple flushes happening closely together. + */ + flushImmediate() { + this._debouncedFlush(); + // `.flush` is provided by the debounced function, analogously to lodash.debounce + return this._debouncedFlush.flush() ; + } + + /** + * Cancels queued up flushes. + */ + cancelFlush() { + this._debouncedFlush.cancel(); + } + + /** Get the current session (=replay) ID */ + getSessionId() { + return this.session && this.session.id; + } + + /** + * Checks if recording should be stopped due to user inactivity. Otherwise + * check if session is expired and create a new session if so. Triggers a new + * full snapshot on new session. + * + * Returns true if session is not expired, false otherwise. + * @hidden + */ + checkAndHandleExpiredSession() { + // Prevent starting a new session if the last user activity is older than + // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new + // session+recording. This creates noisy replays that do not have much + // content in them. + if ( + this._lastActivity && + isExpired(this._lastActivity, this.timeouts.sessionIdlePause) && + this.session && + this.session.sampled === 'session' + ) { + // Pause recording only for session-based replays. Otherwise, resuming + // will create a new replay and will conflict with users who only choose + // to record error-based replays only. (e.g. the resumed replay will not + // contain a reference to an error) + this.pause(); + return; + } + + // --- There is recent user activity --- // + // This will create a new session if expired, based on expiry length + if (!this._checkSession()) { + // Check session handles the refreshing itself + return false; + } + + return true; + } + + /** + * Capture some initial state that can change throughout the lifespan of the + * replay. This is required because otherwise they would be captured at the + * first flush. + */ + setInitialState() { + const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`; + const url = `${WINDOW.location.origin}${urlPath}`; + + this.performanceEntries = []; + this.replayPerformanceEntries = []; + + // Reset _context as well + this._clearContext(); + + this._context.initialUrl = url; + this._context.initialTimestamp = Date.now(); + this._context.urls.push(url); + } + + /** + * Add a breadcrumb event, that may be throttled. + * If it was throttled, we add a custom breadcrumb to indicate that. + */ + throttledAddEvent( + event, + isCheckout, + ) { + const res = this._throttledAddEvent(event, isCheckout); + + // If this is THROTTLED, it means we have throttled the event for the first time + // In this case, we want to add a breadcrumb indicating that something was skipped + if (res === THROTTLED) { + const breadcrumb = createBreadcrumb({ + category: 'replay.throttled', + }); + + this.addUpdate(() => { + // Return `false` if the event _was_ added, as that means we schedule a flush + return !addEventSync(this, { + type: ReplayEventTypeCustom, + timestamp: breadcrumb.timestamp || 0, + data: { + tag: 'breadcrumb', + payload: breadcrumb, + metric: true, + }, + }); + }); + } + + return res; + } + + /** + * This will get the parametrized route name of the current page. + * This is only available if performance is enabled, and if an instrumented router is used. + */ + getCurrentRoute() { + const lastActiveSpan = this.lastActiveSpan || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.getActiveSpan)(); + const lastRootSpan = lastActiveSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.getRootSpan)(lastActiveSpan); + + const attributes = (lastRootSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.spanToJSON)(lastRootSpan).data) || {}; + const source = attributes[_sentry_core__WEBPACK_IMPORTED_MODULE_26__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + if (!lastRootSpan || !source || !['route', 'custom'].includes(source)) { + return undefined; + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.spanToJSON)(lastRootSpan).description; + } + + /** + * Initialize and start all listeners to varying events (DOM, + * Performance Observer, Recording, Sentry SDK, etc) + */ + _initializeRecording() { + this.setInitialState(); + + // this method is generally called on page load or manually - in both cases + // we should treat it as an activity + this._updateSessionActivity(); + + this.eventBuffer = createEventBuffer({ + useCompression: this._options.useCompression, + workerUrl: this._options.workerUrl, + }); + + this._removeListeners(); + this._addListeners(); + + // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout + this._isEnabled = true; + this._isPaused = false; + + this.startRecording(); + } + + /** + * Loads (or refreshes) the current session. + */ + _initializeSessionForSampling(previousSessionId) { + // Whenever there is _any_ error sample rate, we always allow buffering + // Because we decide on sampling when an error occurs, we need to buffer at all times if sampling for errors + const allowBuffering = this._options.errorSampleRate > 0; + + const session = loadOrCreateSession( + { + sessionIdleExpire: this.timeouts.sessionIdleExpire, + maxReplayDuration: this._options.maxReplayDuration, + previousSessionId, + }, + { + stickySession: this._options.stickySession, + sessionSampleRate: this._options.sessionSampleRate, + allowBuffering, + }, + ); + + this.session = session; + } + + /** + * Checks and potentially refreshes the current session. + * Returns false if session is not recorded. + */ + _checkSession() { + // If there is no session yet, we do not want to refresh anything + // This should generally not happen, but to be safe.... + if (!this.session) { + return false; + } + + const currentSession = this.session; + + if ( + shouldRefreshSession(currentSession, { + sessionIdleExpire: this.timeouts.sessionIdleExpire, + maxReplayDuration: this._options.maxReplayDuration, + }) + ) { + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this._refreshSession(currentSession); + return false; + } + + return true; + } + + /** + * Refresh a session with a new one. + * This stops the current session (without forcing a flush, as that would never work since we are expired), + * and then does a new sampling based on the refreshed session. + */ + async _refreshSession(session) { + if (!this._isEnabled) { + return; + } + await this.stop({ reason: 'refresh session' }); + this.initializeSampling(session.id); + } + + /** + * Adds listeners to record events for the replay + */ + _addListeners() { + try { + WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange); + WINDOW.addEventListener('blur', this._handleWindowBlur); + WINDOW.addEventListener('focus', this._handleWindowFocus); + WINDOW.addEventListener('keydown', this._handleKeyboardEvent); + + if (this.clickDetector) { + this.clickDetector.addListeners(); + } + + // There is no way to remove these listeners, so ensure they are only added once + if (!this._hasInitializedCoreListeners) { + addGlobalListeners(this); + + this._hasInitializedCoreListeners = true; + } + } catch (err) { + this.handleException(err); + } + + this._performanceCleanupCallback = setupPerformanceObserver(this); + } + + /** + * Cleans up listeners that were created in `_addListeners` + */ + _removeListeners() { + try { + WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange); + + WINDOW.removeEventListener('blur', this._handleWindowBlur); + WINDOW.removeEventListener('focus', this._handleWindowFocus); + WINDOW.removeEventListener('keydown', this._handleKeyboardEvent); + + if (this.clickDetector) { + this.clickDetector.removeListeners(); + } + + if (this._performanceCleanupCallback) { + this._performanceCleanupCallback(); + } + } catch (err) { + this.handleException(err); + } + } + + /** + * Handle when visibility of the page content changes. Opening a new tab will + * cause the state to change to hidden because of content of current page will + * be hidden. Likewise, moving a different window to cover the contents of the + * page will also trigger a change to a hidden state. + */ + __init() {this._handleVisibilityChange = () => { + if (WINDOW.document.visibilityState === 'visible') { + this._doChangeToForegroundTasks(); + } else { + this._doChangeToBackgroundTasks(); + } + };} + + /** + * Handle when page is blurred + */ + __init2() {this._handleWindowBlur = () => { + const breadcrumb = createBreadcrumb({ + category: 'ui.blur', + }); + + // Do not count blur as a user action -- it's part of the process of them + // leaving the page + this._doChangeToBackgroundTasks(breadcrumb); + };} + + /** + * Handle when page is focused + */ + __init3() {this._handleWindowFocus = () => { + const breadcrumb = createBreadcrumb({ + category: 'ui.focus', + }); + + // Do not count focus as a user action -- instead wait until they focus and + // interactive with page + this._doChangeToForegroundTasks(breadcrumb); + };} + + /** Ensure page remains active when a key is pressed. */ + __init4() {this._handleKeyboardEvent = (event) => { + handleKeyboardEvent(this, event); + };} + + /** + * Tasks to run when we consider a page to be hidden (via blurring and/or visibility) + */ + _doChangeToBackgroundTasks(breadcrumb) { + if (!this.session) { + return; + } + + const expired = isSessionExpired(this.session, { + maxReplayDuration: this._options.maxReplayDuration, + sessionIdleExpire: this.timeouts.sessionIdleExpire, + }); + + if (expired) { + return; + } + + if (breadcrumb) { + this._createCustomBreadcrumb(breadcrumb); + } + + // Send replay when the page/tab becomes hidden. There is no reason to send + // replay if it becomes visible, since no actions we care about were done + // while it was hidden + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + void this.conditionalFlush(); + } + + /** + * Tasks to run when we consider a page to be visible (via focus and/or visibility) + */ + _doChangeToForegroundTasks(breadcrumb) { + if (!this.session) { + return; + } + + const isSessionActive = this.checkAndHandleExpiredSession(); + + if (!isSessionActive) { + // If the user has come back to the page within SESSION_IDLE_PAUSE_DURATION + // ms, we will re-use the existing session, otherwise create a new + // session + DEBUG_BUILD && logger.info('Document has become active, but session has expired'); + return; + } + + if (breadcrumb) { + this._createCustomBreadcrumb(breadcrumb); + } + } + + /** + * Update user activity (across session lifespans) + */ + _updateUserActivity(_lastActivity = Date.now()) { + this._lastActivity = _lastActivity; + } + + /** + * Updates the session's last activity timestamp + */ + _updateSessionActivity(_lastActivity = Date.now()) { + if (this.session) { + this.session.lastActivity = _lastActivity; + this._maybeSaveSession(); + } + } + + /** + * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb + */ + _createCustomBreadcrumb(breadcrumb) { + this.addUpdate(() => { + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.throttledAddEvent({ + type: EventType.Custom, + timestamp: breadcrumb.timestamp || 0, + data: { + tag: 'breadcrumb', + payload: breadcrumb, + }, + }); + }); + } + + /** + * Observed performance events are added to `this.performanceEntries`. These + * are included in the replay event before it is finished and sent to Sentry. + */ + _addPerformanceEntries() { + let performanceEntries = createPerformanceEntries(this.performanceEntries).concat(this.replayPerformanceEntries); + + this.performanceEntries = []; + this.replayPerformanceEntries = []; + + // If we are manually starting, we want to ensure we only include performance entries + // that are after the initial timestamp + // The reason for this is that we may have performance entries from the page load, but may decide to start + // the replay later on, in which case we do not want to include these entries. + // without this, manually started replays can have events long before the actual replay recording starts, + // which messes with the timeline etc. + if (this._requiresManualStart) { + const initialTimestampInSeconds = this._context.initialTimestamp / 1000; + performanceEntries = performanceEntries.filter(entry => entry.start >= initialTimestampInSeconds); + } + + return Promise.all(createPerformanceSpans(this, performanceEntries)); + } + + /** + * Clear _context + */ + _clearContext() { + // XXX: `initialTimestamp` and `initialUrl` do not get cleared + this._context.errorIds.clear(); + this._context.traceIds.clear(); + this._context.urls = []; + } + + /** Update the initial timestamp based on the buffer content. */ + _updateInitialTimestampFromEventBuffer() { + const { session, eventBuffer } = this; + // If replay was started manually (=no sample rate was given), + // We do not want to back-port the initial timestamp + if (!session || !eventBuffer || this._requiresManualStart) { + return; + } + + // we only ever update this on the initial segment + if (session.segmentId) { + return; + } + + const earliestEvent = eventBuffer.getEarliestTimestamp(); + if (earliestEvent && earliestEvent < this._context.initialTimestamp) { + this._context.initialTimestamp = earliestEvent; + } + } + + /** + * Return and clear _context + */ + _popEventContext() { + const _context = { + initialTimestamp: this._context.initialTimestamp, + initialUrl: this._context.initialUrl, + errorIds: Array.from(this._context.errorIds), + traceIds: Array.from(this._context.traceIds), + urls: this._context.urls, + }; + + this._clearContext(); + + return _context; + } + + /** + * Flushes replay event buffer to Sentry. + * + * Performance events are only added right before flushing - this is + * due to the buffered performance observer events. + * + * Should never be called directly, only by `flush` + */ + async _runFlush() { + const replayId = this.getSessionId(); + + if (!this.session || !this.eventBuffer || !replayId) { + DEBUG_BUILD && logger.error('No session or eventBuffer found to flush.'); + return; + } + + await this._addPerformanceEntries(); + + // Check eventBuffer again, as it could have been stopped in the meanwhile + if (!this.eventBuffer || !this.eventBuffer.hasEvents) { + return; + } + + // Only attach memory event if eventBuffer is not empty + await addMemoryEntry(this); + + // Check eventBuffer again, as it could have been stopped in the meanwhile + if (!this.eventBuffer) { + return; + } + + // if this changed in the meanwhile, e.g. because the session was refreshed or similar, we abort here + if (replayId !== this.getSessionId()) { + return; + } + + try { + // This uses the data from the eventBuffer, so we need to call this before `finish() + this._updateInitialTimestampFromEventBuffer(); + + const timestamp = Date.now(); + + // Check total duration again, to avoid sending outdated stuff + // We leave 30s wiggle room to accommodate late flushing etc. + // This _could_ happen when the browser is suspended during flushing, in which case we just want to stop + if (timestamp - this._context.initialTimestamp > this._options.maxReplayDuration + 30000) { + throw new Error('Session is too long, not sending replay'); + } + + const eventContext = this._popEventContext(); + // Always increment segmentId regardless of outcome of sending replay + const segmentId = this.session.segmentId++; + this._maybeSaveSession(); + + // Note this empties the event buffer regardless of outcome of sending replay + const recordingData = await this.eventBuffer.finish(); + + await sendReplay({ + replayId, + recordingData, + segmentId, + eventContext, + session: this.session, + timestamp, + onError: err => this.handleException(err), + }); + } catch (err) { + this.handleException(err); + + // This means we retried 3 times and all of them failed, + // or we ran into a problem we don't want to retry, like rate limiting. + // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.stop({ reason: 'sendReplay' }); + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + + if (client) { + const dropReason = err instanceof RateLimitError ? 'ratelimit_backoff' : 'send_error'; + client.recordDroppedEvent(dropReason, 'replay'); + } + } + } + + /** + * Flush recording data to Sentry. Creates a lock so that only a single flush + * can be active at a time. Do not call this directly. + */ + __init5() {this._flush = async ({ + force = false, + } + + = {}) => { + if (!this._isEnabled && !force) { + // This can happen if e.g. the replay was stopped because of exceeding the retry limit + return; + } + + if (!this.checkAndHandleExpiredSession()) { + DEBUG_BUILD && logger.error('Attempting to finish replay event after session expired.'); + return; + } + + if (!this.session) { + // should never happen, as we would have bailed out before + return; + } + + const start = this.session.started; + const now = Date.now(); + const duration = now - start; + + // A flush is about to happen, cancel any queued flushes + this._debouncedFlush.cancel(); + + // If session is too short, or too long (allow some wiggle room over maxReplayDuration), do not send it + // This _should_ not happen, but it may happen if flush is triggered due to a page activity change or similar + const tooShort = duration < this._options.minReplayDuration; + const tooLong = duration > this._options.maxReplayDuration + 5000; + if (tooShort || tooLong) { + DEBUG_BUILD && + logger.info( + `Session duration (${Math.floor(duration / 1000)}s) is too ${ + tooShort ? 'short' : 'long' + }, not sending replay.`, + ); + + if (tooShort) { + this._debouncedFlush(); + } + return; + } + + const eventBuffer = this.eventBuffer; + if (eventBuffer && this.session.segmentId === 0 && !eventBuffer.hasCheckout) { + DEBUG_BUILD && logger.info('Flushing initial segment without checkout.'); + // TODO FN: Evaluate if we want to stop here, or remove this again? + } + + const _flushInProgress = !!this._flushLock; + + // this._flushLock acts as a lock so that future calls to `_flush()` will + // be blocked until current flush is finished (i.e. this promise resolves) + if (!this._flushLock) { + this._flushLock = this._runFlush(); + } + + try { + await this._flushLock; + } catch (err) { + this.handleException(err); + } finally { + this._flushLock = undefined; + + if (_flushInProgress) { + // Wait for previous flush to finish, then call the debounced + // `_flush()`. It's possible there are other flush requests queued and + // waiting for it to resolve. We want to reduce all outstanding + // requests (as well as any new flush requests that occur within a + // second of the locked flush completing) into a single flush. + this._debouncedFlush(); + } + } + };} + + /** Save the session, if it is sticky */ + _maybeSaveSession() { + if (this.session && this._options.stickySession) { + saveSession(this.session); + } + } + + /** Handler for rrweb.record.onMutation */ + __init6() {this._onMutationHandler = (mutations) => { + const count = mutations.length; + + const mutationLimit = this._options.mutationLimit; + const mutationBreadcrumbLimit = this._options.mutationBreadcrumbLimit; + const overMutationLimit = mutationLimit && count > mutationLimit; + + // Create a breadcrumb if a lot of mutations happen at the same time + // We can show this in the UI as an information with potential performance improvements + if (count > mutationBreadcrumbLimit || overMutationLimit) { + const breadcrumb = createBreadcrumb({ + category: 'replay.mutations', + data: { + count, + limit: overMutationLimit, + }, + }); + this._createCustomBreadcrumb(breadcrumb); + } + + // Stop replay if over the mutation limit + if (overMutationLimit) { + // This should never reject + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.stop({ reason: 'mutationLimit', forceFlush: this.recordingMode === 'session' }); + return false; + } + + // `true` means we use the regular mutation handling by rrweb + return true; + };} +} + +function getOption(selectors, defaultSelectors) { + return [ + ...selectors, + // sentry defaults + ...defaultSelectors, + ].join(','); +} + +/** + * Returns privacy related configuration for use in rrweb + */ +function getPrivacyOptions({ mask, unmask, block, unblock, ignore }) { + const defaultBlockedElements = ['base[href="/"]']; + + const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]']); + const unmaskSelector = getOption(unmask, []); + + const options = { + // We are making the decision to make text and input selectors the same + maskTextSelector: maskSelector, + unmaskTextSelector: unmaskSelector, + + blockSelector: getOption(block, ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements]), + unblockSelector: getOption(unblock, []), + ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type="file"]']), + }; + + return options; +} + +/** + * Masks an attribute if necessary, otherwise return attribute value as-is. + */ +function maskAttribute({ + el, + key, + maskAttributes, + maskAllText, + privacyOptions, + value, +}) { + // We only mask attributes if `maskAllText` is true + if (!maskAllText) { + return value; + } + + // unmaskTextSelector takes precedence + if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) { + return value; + } + + if ( + maskAttributes.includes(key) || + // Need to mask `value` attribute for `` if it's a button-like + // type + (key === 'value' && el.tagName === 'INPUT' && ['submit', 'button'].includes(el.getAttribute('type') || '')) + ) { + return value.replace(/[\S]/g, '*'); + } + + return value; +} + +const MEDIA_SELECTORS = + 'img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]'; + +const DEFAULT_NETWORK_HEADERS = ['content-length', 'content-type', 'accept']; + +let _initialized = false; + +/** + * Sentry integration for [Session Replay](https://sentry.io/for/session-replay/). + * + * See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information. + * + * @example + * + * ``` + * Sentry.init({ + * dsn: '__DSN__', + * integrations: [Sentry.replayIntegration()], + * }); + * ``` + */ +const replayIntegration = ((options) => { + return new Replay(options); +}) ; + +/** + * Replay integration + * + * TODO: Rewrite this to be functional integration + * Exported for tests. + */ +class Replay { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Replay';} + + /** + * @inheritDoc + */ + + /** + * Options to pass to `rrweb.record()` + */ + + /** + * Initial options passed to the replay integration, merged with default values. + * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they + * can only be finally set when setupOnce() is called. + * + * @private + */ + + constructor({ + flushMinDelay = DEFAULT_FLUSH_MIN_DELAY, + flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY, + minReplayDuration = MIN_REPLAY_DURATION, + maxReplayDuration = MAX_REPLAY_DURATION, + stickySession = true, + useCompression = true, + workerUrl, + _experiments = {}, + maskAllText = true, + maskAllInputs = true, + blockAllMedia = true, + + mutationBreadcrumbLimit = 750, + mutationLimit = 10000, + + slowClickTimeout = 7000, + slowClickIgnoreSelectors = [], + + networkDetailAllowUrls = [], + networkDetailDenyUrls = [], + networkCaptureBodies = true, + networkRequestHeaders = [], + networkResponseHeaders = [], + + mask = [], + maskAttributes = ['title', 'placeholder'], + unmask = [], + block = [], + unblock = [], + ignore = [], + maskFn, + + beforeAddRecordingEvent, + beforeErrorSampling, + onError, + } = {}) { + this.name = Replay.id; + + const privacyOptions = getPrivacyOptions({ + mask, + unmask, + block, + unblock, + ignore, + }); + + this._recordingOptions = { + maskAllInputs, + maskAllText, + maskInputOptions: { password: true }, + maskTextFn: maskFn, + maskInputFn: maskFn, + maskAttributeFn: (key, value, el) => + maskAttribute({ + maskAttributes, + maskAllText, + privacyOptions, + key, + value, + el, + }), + + ...privacyOptions, + + // Our defaults + slimDOMOptions: 'all', + inlineStylesheet: true, + // Disable inline images as it will increase segment/replay size + inlineImages: false, + // collect fonts, but be aware that `sentry.io` needs to be an allowed + // origin for playback + collectFonts: true, + errorHandler: (err) => { + try { + err.__rrweb__ = true; + } catch (error) { + // ignore errors here + // this can happen if the error is frozen or does not allow mutation for other reasons + } + }, + }; + + this._initialOptions = { + flushMinDelay, + flushMaxDelay, + minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT), + maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION), + stickySession, + useCompression, + workerUrl, + blockAllMedia, + maskAllInputs, + maskAllText, + mutationBreadcrumbLimit, + mutationLimit, + slowClickTimeout, + slowClickIgnoreSelectors, + networkDetailAllowUrls, + networkDetailDenyUrls, + networkCaptureBodies, + networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders), + networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders), + beforeAddRecordingEvent, + beforeErrorSampling, + onError, + + _experiments, + }; + + if (this._initialOptions.blockAllMedia) { + // `blockAllMedia` is a more user friendly option to configure blocking + // embedded media elements + this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector + ? MEDIA_SELECTORS + : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`; + } + + if (this._isInitialized && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_27__.isBrowser)()) { + throw new Error('Multiple Sentry Session Replay instances are not supported'); + } + + this._isInitialized = true; + } + + /** If replay has already been initialized */ + get _isInitialized() { + return _initialized; + } + + /** Update _isInitialized */ + set _isInitialized(value) { + _initialized = value; + } + + /** + * Setup and initialize replay container + */ + afterAllSetup(client) { + if (!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_27__.isBrowser)() || this._replay) { + return; + } + + this._setup(client); + this._initialize(client); + } + + /** + * Start a replay regardless of sampling rate. Calling this will always + * create a new session. Will log a message if replay is already in progress. + * + * Creates or loads a session, attaches listeners to varying events (DOM, + * PerformanceObserver, Recording, Sentry SDK, etc) + */ + start() { + if (!this._replay) { + return; + } + this._replay.start(); + } + + /** + * Start replay buffering. Buffers until `flush()` is called or, if + * `replaysOnErrorSampleRate` > 0, until an error occurs. + */ + startBuffering() { + if (!this._replay) { + return; + } + + this._replay.startBuffering(); + } + + /** + * Currently, this needs to be manually called (e.g. for tests). Sentry SDK + * does not support a teardown + */ + stop() { + if (!this._replay) { + return Promise.resolve(); + } + + return this._replay.stop({ forceFlush: this._replay.recordingMode === 'session' }); + } + + /** + * If not in "session" recording mode, flush event buffer which will create a new replay. + * If replay is not enabled, a new session replay is started. + * Unless `continueRecording` is false, the replay will continue to record and + * behave as a "session"-based replay. + * + * Otherwise, queue up a flush. + */ + flush(options) { + if (!this._replay) { + return Promise.resolve(); + } + + // assuming a session should be recorded in this case + if (!this._replay.isEnabled()) { + this._replay.start(); + return Promise.resolve(); + } + + return this._replay.sendBufferedReplayOrFlush(options); + } + + /** + * Get the current session ID. + */ + getReplayId() { + if (!this._replay || !this._replay.isEnabled()) { + return; + } + + return this._replay.getSessionId(); + } + + /** + * Get the current recording mode. This can be either `session` or `buffer`. + * + * `session`: Recording the whole session, sending it continuously + * `buffer`: Always keeping the last 60s of recording, requires: + * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs + * - or calling `flush()` to send the replay + */ + getRecordingMode() { + if (!this._replay || !this._replay.isEnabled()) { + return; + } + + return this._replay.recordingMode; + } + + /** + * Initializes replay. + */ + _initialize(client) { + if (!this._replay) { + return; + } + + this._maybeLoadFromReplayCanvasIntegration(client); + this._replay.initializeSampling(); + } + + /** Setup the integration. */ + _setup(client) { + // Client is not available in constructor, so we need to wait until setupOnce + const finalOptions = loadReplayOptionsFromClient(this._initialOptions, client); + + this._replay = new ReplayContainer({ + options: finalOptions, + recordingOptions: this._recordingOptions, + }); + } + + /** Get canvas options from ReplayCanvas integration, if it is also added. */ + _maybeLoadFromReplayCanvasIntegration(client) { + // To save bundle size, we skip checking for stuff here + // and instead just try-catch everything - as generally this should all be defined + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + try { + const canvasIntegration = client.getIntegrationByName('ReplayCanvas') + +; + if (!canvasIntegration) { + return; + } + + this._replay['_canvas'] = canvasIntegration.getOptions(); + } catch (e) { + // ignore errors here + } + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + } +}Replay.__initStatic(); + +/** Parse Replay-related options from SDK options */ +function loadReplayOptionsFromClient(initialOptions, client) { + const opt = client.getOptions() ; + + const finalOptions = { + sessionSampleRate: 0, + errorSampleRate: 0, + ...(0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.dropUndefinedKeys)(initialOptions), + }; + + const replaysSessionSampleRate = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_28__.parseSampleRate)(opt.replaysSessionSampleRate); + const replaysOnErrorSampleRate = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_28__.parseSampleRate)(opt.replaysOnErrorSampleRate); + + if (replaysSessionSampleRate == null && replaysOnErrorSampleRate == null) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.consoleSandbox)(() => { + // eslint-disable-next-line no-console + console.warn( + 'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.', + ); + }); + } + + if (replaysSessionSampleRate != null) { + finalOptions.sessionSampleRate = replaysSessionSampleRate; + } + + if (replaysOnErrorSampleRate != null) { + finalOptions.errorSampleRate = replaysOnErrorSampleRate; + } + + return finalOptions; +} + +function _getMergedNetworkHeaders(headers) { + return [...DEFAULT_NETWORK_HEADERS, ...headers.map(header => header.toLowerCase())]; +} + +/** + * This is a small utility to get a type-safe instance of the Replay integration. + */ +function getReplay() { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getClient)(); + return client && client.getIntegrationByName('Replay'); +} + + +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/client.js": +/*!******************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/client.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BrowserClient: () => (/* binding */ BrowserClient) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/baseclient.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/env.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/sdkMetadata.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./eventbuilder.js */ "../../node_modules/@sentry/browser/build/npm/esm/eventbuilder.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); +/* harmony import */ var _userfeedback_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./userfeedback.js */ "../../node_modules/@sentry/browser/build/npm/esm/userfeedback.js"); + + + + + + +/** + * Configuration options for the Sentry Browser SDK. + * @see @sentry/types Options for more information. + */ + +/** + * The Sentry Browser SDK Client. + * + * @see BrowserOptions for documentation on configuration options. + * @see SentryClient for usage documentation. + */ +class BrowserClient extends _sentry_core__WEBPACK_IMPORTED_MODULE_0__.BaseClient { + /** + * Creates a new Browser SDK instance. + * + * @param options Configuration options for this SDK. + */ + constructor(options) { + const opts = { + // We default this to true, as it is the safer scenario + parentSpanIsAlwaysRootSpan: true, + ...options, + }; + const sdkSource = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.SENTRY_SDK_SOURCE || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getSDKSource)(); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.applySdkMetadata)(opts, 'browser', ['browser'], sdkSource); + + super(opts); + + if (opts.sendClientReports && _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document) { + _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.addEventListener('visibilitychange', () => { + if (_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.visibilityState === 'hidden') { + this._flushOutcomes(); + } + }); + } + } + + /** + * @inheritDoc + */ + eventFromException(exception, hint) { + return (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__.eventFromException)(this._options.stackParser, exception, hint, this._options.attachStacktrace); + } + + /** + * @inheritDoc + */ + eventFromMessage( + message, + level = 'info', + hint, + ) { + return (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__.eventFromMessage)(this._options.stackParser, message, level, hint, this._options.attachStacktrace); + } + + /** + * Sends user feedback to Sentry. + * + * @deprecated Use `captureFeedback` instead. + */ + captureUserFeedback(feedback) { + if (!this._isEnabled()) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_5__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_6__.logger.warn('SDK not enabled, will not capture user feedback.'); + return; + } + + const envelope = (0,_userfeedback_js__WEBPACK_IMPORTED_MODULE_7__.createUserFeedbackEnvelope)(feedback, { + metadata: this.getSdkMetadata(), + dsn: this.getDsn(), + tunnel: this.getOptions().tunnel, + }); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.sendEnvelope(envelope); + } + + /** + * @inheritDoc + */ + _prepareEvent(event, hint, scope) { + event.platform = event.platform || 'javascript'; + return super._prepareEvent(event, hint, scope); + } +} + + +//# sourceMappingURL=client.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/debug-build.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEBUG_BUILD: () => (/* binding */ DEBUG_BUILD) +/* harmony export */ }); +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + + +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/eventbuilder.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/eventbuilder.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ eventFromException: () => (/* binding */ eventFromException), +/* harmony export */ eventFromMessage: () => (/* binding */ eventFromMessage), +/* harmony export */ eventFromUnknownInput: () => (/* binding */ eventFromUnknownInput), +/* harmony export */ exceptionFromError: () => (/* binding */ exceptionFromError), +/* harmony export */ extractMessage: () => (/* binding */ extractMessage), +/* harmony export */ extractType: () => (/* binding */ extractType) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/normalize.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + +/** + * This function creates an exception from a JavaScript Error + */ +function exceptionFromError(stackParser, ex) { + // Get the frames first since Opera can lose the stack if we touch anything else first + const frames = parseStackFrames(stackParser, ex); + + const exception = { + type: extractType(ex), + value: extractMessage(ex), + }; + + if (frames.length) { + exception.stacktrace = { frames }; + } + + if (exception.type === undefined && exception.value === '') { + exception.value = 'Unrecoverable error caught'; + } + + return exception; +} + +function eventFromPlainObject( + stackParser, + exception, + syntheticException, + isUnhandledRejection, +) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + const normalizeDepth = client && client.getOptions().normalizeDepth; + + // If we can, we extract an exception from the object properties + const errorFromProp = getErrorPropertyFromObject(exception); + + const extra = { + __serialized__: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.normalizeToSize)(exception, normalizeDepth), + }; + + if (errorFromProp) { + return { + exception: { + values: [exceptionFromError(stackParser, errorFromProp)], + }, + extra, + }; + } + + const event = { + exception: { + values: [ + { + type: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isEvent)(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error', + value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }), + } , + ], + }, + extra, + } ; + + if (syntheticException) { + const frames = parseStackFrames(stackParser, syntheticException); + if (frames.length) { + // event.exception.values[0] has been set above + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values[0].stacktrace = { frames }; + } + } + + return event; +} + +function eventFromError(stackParser, ex) { + return { + exception: { + values: [exceptionFromError(stackParser, ex)], + }, + }; +} + +/** Parses stack frames from an error */ +function parseStackFrames( + stackParser, + ex, +) { + // Access and store the stacktrace property before doing ANYTHING + // else to it because Opera is not very good at providing it + // reliably in other circumstances. + const stacktrace = ex.stacktrace || ex.stack || ''; + + const skipLines = getSkipFirstStackStringLines(ex); + const framesToPop = getPopFirstTopFrames(ex); + + try { + return stackParser(stacktrace, skipLines, framesToPop); + } catch (e) { + // no-empty + } + + return []; +} + +// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108 +const reactMinifiedRegexp = /Minified React error #\d+;/i; + +/** + * Certain known React errors contain links that would be falsely + * parsed as frames. This function check for these errors and + * returns number of the stack string lines to skip. + */ +function getSkipFirstStackStringLines(ex) { + if (ex && reactMinifiedRegexp.test(ex.message)) { + return 1; + } + + return 0; +} + +/** + * If error has `framesToPop` property, it means that the + * creator tells us the first x frames will be useless + * and should be discarded. Typically error from wrapper function + * which don't point to the actual location in the developer's code. + * + * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46 + */ +function getPopFirstTopFrames(ex) { + if (typeof ex.framesToPop === 'number') { + return ex.framesToPop; + } + + return 0; +} + +// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception +// @ts-expect-error - WebAssembly.Exception is a valid class +function isWebAssemblyException(exception) { + // Check for support + // @ts-expect-error - WebAssembly.Exception is a valid class + if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') { + // @ts-expect-error - WebAssembly.Exception is a valid class + return exception instanceof WebAssembly.Exception; + } else { + return false; + } +} + +/** + * Extracts from errors what we use as the exception `type` in error events. + * + * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently. + */ +function extractType(ex) { + const name = ex && ex.name; + + // The name for WebAssembly.Exception Errors needs to be extracted differently. + // Context: https://github.com/getsentry/sentry-javascript/issues/13787 + if (!name && isWebAssemblyException(ex)) { + // Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object + const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2; + return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception'; + } + + return name; +} + +/** + * There are cases where stacktrace.message is an Event object + * https://github.com/getsentry/sentry-javascript/issues/1949 + * In this specific case we try to extract stacktrace.message.error.message + */ +function extractMessage(ex) { + const message = ex && ex.message; + + if (!message) { + return 'No error message'; + } + + if (message.error && typeof message.error.message === 'string') { + return message.error.message; + } + + // Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object + if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) { + return ex.message[1]; + } + + return message; +} + +/** + * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. + * @hidden + */ +function eventFromException( + stackParser, + exception, + hint, + attachStacktrace, +) { + const syntheticException = (hint && hint.syntheticException) || undefined; + const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event); // defaults to { type: 'generic', handled: true } + event.level = 'error'; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.resolvedSyncPromise)(event); +} + +/** + * Builds and Event from a Message + * @hidden + */ +function eventFromMessage( + stackParser, + message, + level = 'info', + hint, + attachStacktrace, +) { + const syntheticException = (hint && hint.syntheticException) || undefined; + const event = eventFromString(stackParser, message, syntheticException, attachStacktrace); + event.level = level; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.resolvedSyncPromise)(event); +} + +/** + * @hidden + */ +function eventFromUnknownInput( + stackParser, + exception, + syntheticException, + attachStacktrace, + isUnhandledRejection, +) { + let event; + + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isErrorEvent)(exception ) && (exception ).error) { + // If it is an ErrorEvent with `error` property, extract it to get actual Error + const errorEvent = exception ; + return eventFromError(stackParser, errorEvent.error ); + } + + // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name + // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be + // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`. + // + // https://developer.mozilla.org/en-US/docs/Web/API/DOMError + // https://developer.mozilla.org/en-US/docs/Web/API/DOMException + // https://webidl.spec.whatwg.org/#es-DOMException-specialness + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isDOMError)(exception) || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isDOMException)(exception )) { + const domException = exception ; + + if ('stack' in (exception )) { + event = eventFromError(stackParser, exception ); + } else { + const name = domException.name || ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isDOMError)(domException) ? 'DOMError' : 'DOMException'); + const message = domException.message ? `${name}: ${domException.message}` : name; + event = eventFromString(stackParser, message, syntheticException, attachStacktrace); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionTypeValue)(event, message); + } + if ('code' in domException) { + // eslint-disable-next-line deprecation/deprecation + event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` }; + } + + return event; + } + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isError)(exception)) { + // we have a real Error object, do nothing + return eventFromError(stackParser, exception); + } + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isPlainObject)(exception) || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isEvent)(exception)) { + // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize + // it manually. This will allow us to group events based on top-level keys which is much better than creating a new + // group on any key/value change. + const objectException = exception ; + event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event, { + synthetic: true, + }); + return event; + } + + // If none of previous checks were valid, then it means that it's not: + // - an instance of DOMError + // - an instance of DOMException + // - an instance of Event + // - an instance of Error + // - a valid ErrorEvent (one with an error property) + // - a plain Object + // + // So bail out and capture it as a simple message: + event = eventFromString(stackParser, exception , syntheticException, attachStacktrace); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionTypeValue)(event, `${exception}`, undefined); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event, { + synthetic: true, + }); + + return event; +} + +function eventFromString( + stackParser, + message, + syntheticException, + attachStacktrace, +) { + const event = {}; + + if (attachStacktrace && syntheticException) { + const frames = parseStackFrames(stackParser, syntheticException); + if (frames.length) { + event.exception = { + values: [{ value: message, stacktrace: { frames } }], + }; + } + } + + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isParameterizedString)(message)) { + const { __sentry_template_string__, __sentry_template_values__ } = message; + + event.logentry = { + message: __sentry_template_string__, + params: __sentry_template_values__, + }; + return event; + } + + event.message = message; + return event; +} + +function getNonErrorObjectExceptionValue( + exception, + { isUnhandledRejection }, +) { + const keys = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.extractExceptionKeysForMessage)(exception); + const captureType = isUnhandledRejection ? 'promise rejection' : 'exception'; + + // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before + // We still want to try to get a decent message for these cases + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isErrorEvent)(exception)) { + return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``; + } + + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.isEvent)(exception)) { + const className = getObjectClassName(exception); + return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`; + } + + return `Object captured as ${captureType} with keys: ${keys}`; +} + +function getObjectClassName(obj) { + try { + const prototype = Object.getPrototypeOf(obj); + return prototype ? prototype.constructor.name : undefined; + } catch (e) { + // ignore errors here + } +} + +/** If a plain object has a property that is an `Error`, return this error. */ +function getErrorPropertyFromObject(obj) { + for (const prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + const value = obj[prop]; + if (value instanceof Error) { + return value; + } + } + } + + return undefined; +} + + +//# sourceMappingURL=eventbuilder.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/feedbackAsync.js": +/*!*************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/feedbackAsync.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ feedbackAsyncIntegration: () => (/* binding */ feedbackAsyncIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry-internal/feedback */ "../../node_modules/@sentry-internal/feedback/build/npm/esm/index.js"); +/* harmony import */ var _utils_lazyLoadIntegration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/lazyLoadIntegration.js */ "../../node_modules/@sentry/browser/build/npm/esm/utils/lazyLoadIntegration.js"); + + + +/** + * An integration to add user feedback to your application, + * while loading most of the code lazily only when it's needed. + */ +const feedbackAsyncIntegration = (0,_sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_0__.buildFeedbackIntegration)({ + lazyLoadIntegration: _utils_lazyLoadIntegration_js__WEBPACK_IMPORTED_MODULE_1__.lazyLoadIntegration, +}); + + +//# sourceMappingURL=feedbackAsync.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/feedbackSync.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/feedbackSync.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ feedbackSyncIntegration: () => (/* binding */ feedbackSyncIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry-internal/feedback */ "../../node_modules/@sentry-internal/feedback/build/npm/esm/index.js"); +/* harmony import */ var _utils_lazyLoadIntegration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/lazyLoadIntegration.js */ "../../node_modules/@sentry/browser/build/npm/esm/utils/lazyLoadIntegration.js"); + + + +/** Add a widget to capture user feedback to your application. */ +const feedbackSyncIntegration = (0,_sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_0__.buildFeedbackIntegration)({ + lazyLoadIntegration: _utils_lazyLoadIntegration_js__WEBPACK_IMPORTED_MODULE_1__.lazyLoadIntegration, + getModalIntegration: () => _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_0__.feedbackModalIntegration, + getScreenshotIntegration: () => _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_0__.feedbackScreenshotIntegration, +}); + + +//# sourceMappingURL=feedbackSync.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js": +/*!*******************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/helpers.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ WINDOW: () => (/* binding */ WINDOW), +/* harmony export */ ignoreNextOnError: () => (/* binding */ ignoreNextOnError), +/* harmony export */ shouldIgnoreOnError: () => (/* binding */ shouldIgnoreOnError), +/* harmony export */ wrap: () => (/* binding */ wrap) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/exports.js"); + + +const WINDOW = _sentry_core__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +let ignoreOnError = 0; + +/** + * @hidden + */ +function shouldIgnoreOnError() { + return ignoreOnError > 0; +} + +/** + * @hidden + */ +function ignoreNextOnError() { + // onerror should trigger before setTimeout + ignoreOnError++; + setTimeout(() => { + ignoreOnError--; + }); +} + +/** + * Instruments the given function and sends an event to Sentry every time the + * function throws an exception. + * + * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always + * has a correct `this` context. + * @returns The wrapped function. + * @hidden + */ +function wrap( + fn, + options + + = {}, + before, + // eslint-disable-next-line @typescript-eslint/no-explicit-any +) { + // for future readers what this does is wrap a function and then create + // a bi-directional wrapping between them. + // + // example: wrapped = wrap(original); + // original.__sentry_wrapped__ -> wrapped + // wrapped.__sentry_original__ -> original + + if (typeof fn !== 'function') { + return fn; + } + + try { + // if we're dealing with a function that was previously wrapped, return + // the original wrapper. + const wrapper = fn.__sentry_wrapped__; + if (wrapper) { + if (typeof wrapper === 'function') { + return wrapper; + } else { + // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means + // that something messed with it. In that case we want to return the originally passed function. + return fn; + } + } + + // We don't wanna wrap it twice + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getOriginalFunction)(fn)) { + return fn; + } + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + // Bail on wrapping and return the function as-is (defers to window.onerror). + return fn; + } + + /* eslint-disable prefer-rest-params */ + // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this` + const sentryWrapped = function () { + const args = Array.prototype.slice.call(arguments); + + try { + if (before && typeof before === 'function') ; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + const wrappedArguments = args.map((arg) => wrap(arg, options)); + + // Attempt to invoke user-land function + // NOTE: If you are a Sentry user, and you are seeing this stack frame, it + // means the sentry.javascript SDK caught an error invoking your application code. This + // is expected behavior and NOT indicative of a bug with sentry.javascript. + return fn.apply(this, wrappedArguments); + } catch (ex) { + ignoreNextOnError(); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.withScope)(scope => { + scope.addEventProcessor(event => { + if (options.mechanism) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionTypeValue)(event, undefined, undefined); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event, options.mechanism); + } + + event.extra = { + ...event.extra, + arguments: args, + }; + + return event; + }); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.captureException)(ex); + }); + + throw ex; + } + }; + /* eslint-enable prefer-rest-params */ + + // Accessing some objects may throw + // ref: https://github.com/getsentry/sentry-javascript/issues/1168 + try { + for (const property in fn) { + if (Object.prototype.hasOwnProperty.call(fn, property)) { + sentryWrapped[property] = fn[property]; + } + } + } catch (_oO) {} // eslint-disable-line no-empty + + // Signal that this function has been wrapped/filled already + // for both debugging and to prevent it to being wrapped/filled twice + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.markFunctionWrapped)(sentryWrapped, fn); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.addNonEnumerableProperty)(fn, '__sentry_wrapped__', sentryWrapped); + + // Restore original function name (not all browsers allow that) + try { + const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ; + if (descriptor.configurable) { + Object.defineProperty(sentryWrapped, 'name', { + get() { + return fn.name; + }, + }); + } + // eslint-disable-next-line no-empty + } catch (_oO) {} + + return sentryWrapped; +} + + +//# sourceMappingURL=helpers.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/index.js": +/*!*****************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/index.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BrowserClient: () => (/* reexport safe */ _client_js__WEBPACK_IMPORTED_MODULE_32__.BrowserClient), +/* harmony export */ SDK_VERSION: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_OP: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_1__.SEMANTIC_ATTRIBUTE_SENTRY_OP), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_1__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_1__.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_1__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE), +/* harmony export */ Scope: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_2__.Scope), +/* harmony export */ WINDOW: () => (/* reexport safe */ _helpers_js__WEBPACK_IMPORTED_MODULE_31__.WINDOW), +/* harmony export */ addBreadcrumb: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_3__.addBreadcrumb), +/* harmony export */ addEventProcessor: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.addEventProcessor), +/* harmony export */ addIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_5__.addIntegration), +/* harmony export */ addTracingExtensions: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_6__.addTracingExtensions), +/* harmony export */ breadcrumbsIntegration: () => (/* reexport safe */ _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_38__.breadcrumbsIntegration), +/* harmony export */ browserApiErrorsIntegration: () => (/* reexport safe */ _integrations_browserapierrors_js__WEBPACK_IMPORTED_MODULE_42__.browserApiErrorsIntegration), +/* harmony export */ browserProfilingIntegration: () => (/* reexport safe */ _profiling_integration_js__WEBPACK_IMPORTED_MODULE_56__.browserProfilingIntegration), +/* harmony export */ browserTracingIntegration: () => (/* reexport safe */ _tracing_browserTracingIntegration_js__WEBPACK_IMPORTED_MODULE_54__.browserTracingIntegration), +/* harmony export */ captureConsoleIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_7__.captureConsoleIntegration), +/* harmony export */ captureEvent: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.captureEvent), +/* harmony export */ captureException: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.captureException), +/* harmony export */ captureFeedback: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_8__.captureFeedback), +/* harmony export */ captureMessage: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.captureMessage), +/* harmony export */ captureSession: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.captureSession), +/* harmony export */ captureUserFeedback: () => (/* reexport safe */ _sdk_js__WEBPACK_IMPORTED_MODULE_37__.captureUserFeedback), +/* harmony export */ chromeStackLineParser: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.chromeStackLineParser), +/* harmony export */ close: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.close), +/* harmony export */ contextLinesIntegration: () => (/* reexport safe */ _integrations_contextlines_js__WEBPACK_IMPORTED_MODULE_46__.contextLinesIntegration), +/* harmony export */ continueTrace: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.continueTrace), +/* harmony export */ createTransport: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_10__.createTransport), +/* harmony export */ createUserFeedbackEnvelope: () => (/* reexport safe */ _userfeedback_js__WEBPACK_IMPORTED_MODULE_36__.createUserFeedbackEnvelope), +/* harmony export */ debugIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_11__.debugIntegration), +/* harmony export */ dedupeIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_12__.dedupeIntegration), +/* harmony export */ defaultRequestInstrumentationOptions: () => (/* reexport safe */ _tracing_request_js__WEBPACK_IMPORTED_MODULE_53__.defaultRequestInstrumentationOptions), +/* harmony export */ defaultStackLineParsers: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.defaultStackLineParsers), +/* harmony export */ defaultStackParser: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.defaultStackParser), +/* harmony export */ endSession: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.endSession), +/* harmony export */ eventFromException: () => (/* reexport safe */ _eventbuilder_js__WEBPACK_IMPORTED_MODULE_35__.eventFromException), +/* harmony export */ eventFromMessage: () => (/* reexport safe */ _eventbuilder_js__WEBPACK_IMPORTED_MODULE_35__.eventFromMessage), +/* harmony export */ exceptionFromError: () => (/* reexport safe */ _eventbuilder_js__WEBPACK_IMPORTED_MODULE_35__.exceptionFromError), +/* harmony export */ extraErrorDataIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_13__.extraErrorDataIntegration), +/* harmony export */ feedbackAsyncIntegration: () => (/* reexport safe */ _feedbackAsync_js__WEBPACK_IMPORTED_MODULE_49__.feedbackAsyncIntegration), +/* harmony export */ feedbackIntegration: () => (/* reexport safe */ _feedbackSync_js__WEBPACK_IMPORTED_MODULE_50__.feedbackSyncIntegration), +/* harmony export */ feedbackSyncIntegration: () => (/* reexport safe */ _feedbackSync_js__WEBPACK_IMPORTED_MODULE_50__.feedbackSyncIntegration), +/* harmony export */ flush: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.flush), +/* harmony export */ forceLoad: () => (/* reexport safe */ _sdk_js__WEBPACK_IMPORTED_MODULE_37__.forceLoad), +/* harmony export */ functionToStringIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_14__.functionToStringIntegration), +/* harmony export */ geckoStackLineParser: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.geckoStackLineParser), +/* harmony export */ getActiveSpan: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_15__.getActiveSpan), +/* harmony export */ getClient: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_16__.getClient), +/* harmony export */ getCurrentHub: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub), +/* harmony export */ getCurrentScope: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_16__.getCurrentScope), +/* harmony export */ getDefaultIntegrations: () => (/* reexport safe */ _sdk_js__WEBPACK_IMPORTED_MODULE_37__.getDefaultIntegrations), +/* harmony export */ getFeedback: () => (/* reexport safe */ _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_51__.getFeedback), +/* harmony export */ getGlobalScope: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_16__.getGlobalScope), +/* harmony export */ getIsolationScope: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_16__.getIsolationScope), +/* harmony export */ getReplay: () => (/* reexport safe */ _sentry_internal_replay__WEBPACK_IMPORTED_MODULE_47__.getReplay), +/* harmony export */ getRootSpan: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_15__.getRootSpan), +/* harmony export */ getSpanDescendants: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_15__.getSpanDescendants), +/* harmony export */ getSpanStatusFromHttpCode: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_18__.getSpanStatusFromHttpCode), +/* harmony export */ globalHandlersIntegration: () => (/* reexport safe */ _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_39__.globalHandlersIntegration), +/* harmony export */ httpClientIntegration: () => (/* reexport safe */ _integrations_httpclient_js__WEBPACK_IMPORTED_MODULE_45__.httpClientIntegration), +/* harmony export */ httpContextIntegration: () => (/* reexport safe */ _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_40__.httpContextIntegration), +/* harmony export */ inboundFiltersIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_19__.inboundFiltersIntegration), +/* harmony export */ init: () => (/* reexport safe */ _sdk_js__WEBPACK_IMPORTED_MODULE_37__.init), +/* harmony export */ instrumentOutgoingRequests: () => (/* reexport safe */ _tracing_request_js__WEBPACK_IMPORTED_MODULE_53__.instrumentOutgoingRequests), +/* harmony export */ isInitialized: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.isInitialized), +/* harmony export */ lastEventId: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.lastEventId), +/* harmony export */ lazyLoadIntegration: () => (/* reexport safe */ _utils_lazyLoadIntegration_js__WEBPACK_IMPORTED_MODULE_43__.lazyLoadIntegration), +/* harmony export */ linkedErrorsIntegration: () => (/* reexport safe */ _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_41__.linkedErrorsIntegration), +/* harmony export */ makeBrowserOfflineTransport: () => (/* reexport safe */ _transports_offline_js__WEBPACK_IMPORTED_MODULE_55__.makeBrowserOfflineTransport), +/* harmony export */ makeFetchTransport: () => (/* reexport safe */ _transports_fetch_js__WEBPACK_IMPORTED_MODULE_33__.makeFetchTransport), +/* harmony export */ makeMultiplexedTransport: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_20__.makeMultiplexedTransport), +/* harmony export */ metrics: () => (/* reexport safe */ _metrics_js__WEBPACK_IMPORTED_MODULE_52__.metrics), +/* harmony export */ moduleMetadataIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_21__.moduleMetadataIntegration), +/* harmony export */ onLoad: () => (/* reexport safe */ _sdk_js__WEBPACK_IMPORTED_MODULE_37__.onLoad), +/* harmony export */ opera10StackLineParser: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.opera10StackLineParser), +/* harmony export */ opera11StackLineParser: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.opera11StackLineParser), +/* harmony export */ parameterize: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_22__.parameterize), +/* harmony export */ registerSpanErrorInstrumentation: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_23__.registerSpanErrorInstrumentation), +/* harmony export */ replayCanvasIntegration: () => (/* reexport safe */ _sentry_internal_replay_canvas__WEBPACK_IMPORTED_MODULE_48__.replayCanvasIntegration), +/* harmony export */ replayIntegration: () => (/* reexport safe */ _sentry_internal_replay__WEBPACK_IMPORTED_MODULE_47__.replayIntegration), +/* harmony export */ reportingObserverIntegration: () => (/* reexport safe */ _integrations_reportingobserver_js__WEBPACK_IMPORTED_MODULE_44__.reportingObserverIntegration), +/* harmony export */ rewriteFramesIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_24__.rewriteFramesIntegration), +/* harmony export */ sendFeedback: () => (/* reexport safe */ _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_51__.sendFeedback), +/* harmony export */ sessionTimingIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_25__.sessionTimingIntegration), +/* harmony export */ setContext: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.setContext), +/* harmony export */ setCurrentClient: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_26__.setCurrentClient), +/* harmony export */ setExtra: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.setExtra), +/* harmony export */ setExtras: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.setExtras), +/* harmony export */ setHttpStatus: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_18__.setHttpStatus), +/* harmony export */ setMeasurement: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_27__.setMeasurement), +/* harmony export */ setTag: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.setTag), +/* harmony export */ setTags: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.setTags), +/* harmony export */ setUser: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.setUser), +/* harmony export */ showReportDialog: () => (/* reexport safe */ _sdk_js__WEBPACK_IMPORTED_MODULE_37__.showReportDialog), +/* harmony export */ spanToBaggageHeader: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_28__.spanToBaggageHeader), +/* harmony export */ spanToJSON: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_15__.spanToJSON), +/* harmony export */ spanToTraceHeader: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_15__.spanToTraceHeader), +/* harmony export */ spotlightBrowserIntegration: () => (/* reexport safe */ _integrations_spotlight_js__WEBPACK_IMPORTED_MODULE_57__.spotlightBrowserIntegration), +/* harmony export */ startBrowserTracingNavigationSpan: () => (/* reexport safe */ _tracing_browserTracingIntegration_js__WEBPACK_IMPORTED_MODULE_54__.startBrowserTracingNavigationSpan), +/* harmony export */ startBrowserTracingPageLoadSpan: () => (/* reexport safe */ _tracing_browserTracingIntegration_js__WEBPACK_IMPORTED_MODULE_54__.startBrowserTracingPageLoadSpan), +/* harmony export */ startInactiveSpan: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.startInactiveSpan), +/* harmony export */ startNewTrace: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.startNewTrace), +/* harmony export */ startSession: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_4__.startSession), +/* harmony export */ startSpan: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.startSpan), +/* harmony export */ startSpanManual: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.startSpanManual), +/* harmony export */ suppressTracing: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.suppressTracing), +/* harmony export */ thirdPartyErrorFilterIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_29__.thirdPartyErrorFilterIntegration), +/* harmony export */ winjsStackLineParser: () => (/* reexport safe */ _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__.winjsStackLineParser), +/* harmony export */ withActiveSpan: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_9__.withActiveSpan), +/* harmony export */ withIsolationScope: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_16__.withIsolationScope), +/* harmony export */ withScope: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_16__.withScope), +/* harmony export */ zodErrorsIntegration: () => (/* reexport safe */ _sentry_core__WEBPACK_IMPORTED_MODULE_30__.zodErrorsIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/version.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/scope.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/breadcrumbs.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/hubextensions.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/captureconsole.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/feedback.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/trace.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/transports/base.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/debug.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/dedupe.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/extraerrordata.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/functiontostring.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/getCurrentHubShim.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/inboundfilters.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/transports/multiplexed.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/metadata.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/parameterize.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/errors.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/rewriteframes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/sessiontiming.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/sdk.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/measurement.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/third-party-errors-filter.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/zoderrors.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); +/* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./client.js */ "../../node_modules/@sentry/browser/build/npm/esm/client.js"); +/* harmony import */ var _transports_fetch_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./transports/fetch.js */ "../../node_modules/@sentry/browser/build/npm/esm/transports/fetch.js"); +/* harmony import */ var _stack_parsers_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./stack-parsers.js */ "../../node_modules/@sentry/browser/build/npm/esm/stack-parsers.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./eventbuilder.js */ "../../node_modules/@sentry/browser/build/npm/esm/eventbuilder.js"); +/* harmony import */ var _userfeedback_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./userfeedback.js */ "../../node_modules/@sentry/browser/build/npm/esm/userfeedback.js"); +/* harmony import */ var _sdk_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sdk.js */ "../../node_modules/@sentry/browser/build/npm/esm/sdk.js"); +/* harmony import */ var _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./integrations/breadcrumbs.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js"); +/* harmony import */ var _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./integrations/globalhandlers.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js"); +/* harmony import */ var _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./integrations/httpcontext.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js"); +/* harmony import */ var _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./integrations/linkederrors.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js"); +/* harmony import */ var _integrations_browserapierrors_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./integrations/browserapierrors.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js"); +/* harmony import */ var _utils_lazyLoadIntegration_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./utils/lazyLoadIntegration.js */ "../../node_modules/@sentry/browser/build/npm/esm/utils/lazyLoadIntegration.js"); +/* harmony import */ var _integrations_reportingobserver_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./integrations/reportingobserver.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/reportingobserver.js"); +/* harmony import */ var _integrations_httpclient_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./integrations/httpclient.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/httpclient.js"); +/* harmony import */ var _integrations_contextlines_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./integrations/contextlines.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/contextlines.js"); +/* harmony import */ var _sentry_internal_replay__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! @sentry-internal/replay */ "../../node_modules/@sentry-internal/replay/build/npm/esm/index.js"); +/* harmony import */ var _sentry_internal_replay_canvas__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! @sentry-internal/replay-canvas */ "../../node_modules/@sentry-internal/replay-canvas/build/npm/esm/index.js"); +/* harmony import */ var _feedbackAsync_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./feedbackAsync.js */ "../../node_modules/@sentry/browser/build/npm/esm/feedbackAsync.js"); +/* harmony import */ var _feedbackSync_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./feedbackSync.js */ "../../node_modules/@sentry/browser/build/npm/esm/feedbackSync.js"); +/* harmony import */ var _sentry_internal_feedback__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! @sentry-internal/feedback */ "../../node_modules/@sentry-internal/feedback/build/npm/esm/index.js"); +/* harmony import */ var _metrics_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./metrics.js */ "../../node_modules/@sentry/browser/build/npm/esm/metrics.js"); +/* harmony import */ var _tracing_request_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./tracing/request.js */ "../../node_modules/@sentry/browser/build/npm/esm/tracing/request.js"); +/* harmony import */ var _tracing_browserTracingIntegration_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./tracing/browserTracingIntegration.js */ "../../node_modules/@sentry/browser/build/npm/esm/tracing/browserTracingIntegration.js"); +/* harmony import */ var _transports_offline_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./transports/offline.js */ "../../node_modules/@sentry/browser/build/npm/esm/transports/offline.js"); +/* harmony import */ var _profiling_integration_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./profiling/integration.js */ "../../node_modules/@sentry/browser/build/npm/esm/profiling/integration.js"); +/* harmony import */ var _integrations_spotlight_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./integrations/spotlight.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/spotlight.js"); + + + + + + + + + + + + + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js": +/*!************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ breadcrumbsIntegration: () => (/* binding */ breadcrumbsIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js"); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js"); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/console.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/breadcrumbs.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/severity.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/breadcrumb-log-level.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/url.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + + + +/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */ +const MAX_ALLOWED_STRING_LENGTH = 1024; + +const INTEGRATION_NAME = 'Breadcrumbs'; + +const _breadcrumbsIntegration = ((options = {}) => { + const _options = { + console: true, + dom: true, + fetch: true, + history: true, + sentry: true, + xhr: true, + ...options, + }; + + return { + name: INTEGRATION_NAME, + setup(client) { + if (_options.console) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.addConsoleInstrumentationHandler)(_getConsoleBreadcrumbHandler(client)); + } + if (_options.dom) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_1__.addClickKeypressInstrumentationHandler)(_getDomBreadcrumbHandler(client, _options.dom)); + } + if (_options.xhr) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_2__.addXhrInstrumentationHandler)(_getXhrBreadcrumbHandler(client)); + } + if (_options.fetch) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addFetchInstrumentationHandler)(_getFetchBreadcrumbHandler(client)); + } + if (_options.history) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_4__.addHistoryInstrumentationHandler)(_getHistoryBreadcrumbHandler(client)); + } + if (_options.sentry) { + client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client)); + } + }, + }; +}) ; + +const breadcrumbsIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.defineIntegration)(_breadcrumbsIntegration); + +/** + * Adds a breadcrumb for Sentry events or transactions if this option is enabled. + */ +function _getSentryBreadcrumbHandler(client) { + return function addSentryBreadcrumb(event) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getClient)() !== client) { + return; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)( + { + category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`, + event_id: event.event_id, + level: event.level, + message: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getEventDescription)(event), + }, + { + event, + }, + ); + }; +} + +/** + * A HOC that creates a function that creates breadcrumbs from DOM API calls. + * This is a HOC so that we get access to dom options in the closure. + */ +function _getDomBreadcrumbHandler( + client, + dom, +) { + return function _innerDomBreadcrumb(handlerData) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getClient)() !== client) { + return; + } + + let target; + let componentName; + let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined; + + let maxStringLength = + typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined; + if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD && + _sentry_core__WEBPACK_IMPORTED_MODULE_10__.logger.warn( + `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`, + ); + maxStringLength = MAX_ALLOWED_STRING_LENGTH; + } + + if (typeof keyAttrs === 'string') { + keyAttrs = [keyAttrs]; + } + + // Accessing event.target can throw (see getsentry/raven-js#838, #768) + try { + const event = handlerData.event ; + const element = _isEvent(event) ? event.target : event; + + target = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.htmlTreeAsString)(element, { keyAttrs, maxStringLength }); + componentName = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getComponentName)(element); + } catch (e) { + target = ''; + } + + if (target.length === 0) { + return; + } + + const breadcrumb = { + category: `ui.${handlerData.name}`, + message: target, + }; + + if (componentName) { + breadcrumb.data = { 'ui.component_name': componentName }; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)(breadcrumb, { + event: handlerData.event, + name: handlerData.name, + global: handlerData.global, + }); + }; +} + +/** + * Creates breadcrumbs from console API calls + */ +function _getConsoleBreadcrumbHandler(client) { + return function _consoleBreadcrumb(handlerData) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getClient)() !== client) { + return; + } + + const breadcrumb = { + category: 'console', + data: { + arguments: handlerData.args, + logger: 'console', + }, + level: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_12__.severityLevelFromString)(handlerData.level), + message: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_13__.safeJoin)(handlerData.args, ' '), + }; + + if (handlerData.level === 'assert') { + if (handlerData.args[0] === false) { + breadcrumb.message = `Assertion failed: ${(0,_sentry_core__WEBPACK_IMPORTED_MODULE_13__.safeJoin)(handlerData.args.slice(1), ' ') || 'console.assert'}`; + breadcrumb.data.arguments = handlerData.args.slice(1); + } else { + // Don't capture a breadcrumb for passed assertions + return; + } + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)(breadcrumb, { + input: handlerData.args, + level: handlerData.level, + }); + }; +} + +/** + * Creates breadcrumbs from XHR API calls + */ +function _getXhrBreadcrumbHandler(client) { + return function _xhrBreadcrumb(handlerData) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getClient)() !== client) { + return; + } + + const { startTimestamp, endTimestamp } = handlerData; + + const sentryXhrData = handlerData.xhr[_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_2__.SENTRY_XHR_DATA_KEY]; + + // We only capture complete, non-sentry requests + if (!startTimestamp || !endTimestamp || !sentryXhrData) { + return; + } + + const { method, url, status_code, body } = sentryXhrData; + + const data = { + method, + url, + status_code, + }; + + const hint = { + xhr: handlerData.xhr, + input: body, + startTimestamp, + endTimestamp, + }; + + const level = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getBreadcrumbLogLevelFromHttpStatusCode)(status_code); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)( + { + category: 'xhr', + data, + type: 'http', + level, + }, + hint, + ); + }; +} + +/** + * Creates breadcrumbs from fetch API calls + */ +function _getFetchBreadcrumbHandler(client) { + return function _fetchBreadcrumb(handlerData) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getClient)() !== client) { + return; + } + + const { startTimestamp, endTimestamp } = handlerData; + + // We only capture complete fetch requests + if (!endTimestamp) { + return; + } + + if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') { + // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests) + return; + } + + if (handlerData.error) { + const data = handlerData.fetchData; + const hint = { + data: handlerData.error, + input: handlerData.args, + startTimestamp, + endTimestamp, + }; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)( + { + category: 'fetch', + data, + level: 'error', + type: 'http', + }, + hint, + ); + } else { + const response = handlerData.response ; + const data = { + ...handlerData.fetchData, + status_code: response && response.status, + }; + const hint = { + input: handlerData.args, + response, + startTimestamp, + endTimestamp, + }; + const level = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getBreadcrumbLogLevelFromHttpStatusCode)(data.status_code); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)( + { + category: 'fetch', + data, + type: 'http', + level, + }, + hint, + ); + } + }; +} + +/** + * Creates breadcrumbs from history API calls + */ +function _getHistoryBreadcrumbHandler(client) { + return function _historyBreadcrumb(handlerData) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getClient)() !== client) { + return; + } + + let from = handlerData.from; + let to = handlerData.to; + const parsedLoc = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.parseUrl)(_helpers_js__WEBPACK_IMPORTED_MODULE_16__.WINDOW.location.href); + let parsedFrom = from ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.parseUrl)(from) : undefined; + const parsedTo = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.parseUrl)(to); + + // Initial pushState doesn't provide `from` information + if (!parsedFrom || !parsedFrom.path) { + parsedFrom = parsedLoc; + } + + // Use only the path component of the URL if the URL matches the current + // document (almost all the time when using pushState) + if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { + to = parsedTo.relative; + } + if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { + from = parsedFrom.relative; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.addBreadcrumb)({ + category: 'navigation', + data: { + from, + to, + }, + }); + }; +} + +function _isEvent(event) { + return !!event && !!(event ).target; +} + + +//# sourceMappingURL=breadcrumbs.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js": +/*!*****************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ browserApiErrorsIntegration: () => (/* binding */ browserApiErrorsIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + +const DEFAULT_EVENT_TARGET = [ + 'EventTarget', + 'Window', + 'Node', + 'ApplicationCache', + 'AudioTrackList', + 'BroadcastChannel', + 'ChannelMergerNode', + 'CryptoOperation', + 'EventSource', + 'FileReader', + 'HTMLUnknownElement', + 'IDBDatabase', + 'IDBRequest', + 'IDBTransaction', + 'KeyOperation', + 'MediaController', + 'MessagePort', + 'ModalWindow', + 'Notification', + 'SVGElementInstance', + 'Screen', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebSocket', + 'WebSocketWorker', + 'Worker', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload', +]; + +const INTEGRATION_NAME = 'BrowserApiErrors'; + +const _browserApiErrorsIntegration = ((options = {}) => { + const _options = { + XMLHttpRequest: true, + eventTarget: true, + requestAnimationFrame: true, + setInterval: true, + setTimeout: true, + ...options, + }; + + return { + name: INTEGRATION_NAME, + // TODO: This currently only works for the first client this is setup + // We may want to adjust this to check for client etc. + setupOnce() { + if (_options.setTimeout) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW, 'setTimeout', _wrapTimeFunction); + } + + if (_options.setInterval) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW, 'setInterval', _wrapTimeFunction); + } + + if (_options.requestAnimationFrame) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW, 'requestAnimationFrame', _wrapRAF); + } + + if (_options.XMLHttpRequest && "XMLHttpRequest" in _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)(XMLHttpRequest.prototype, 'send', _wrapXHR); + } + + const eventTargetOption = _options.eventTarget; + if (eventTargetOption) { + const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; + eventTarget.forEach(_wrapEventTarget); + } + }, + }; +}) ; + +/** + * Wrap timer functions and event targets to catch errors and provide better meta data. + */ +const browserApiErrorsIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.defineIntegration)(_browserApiErrorsIntegration); + +function _wrapTimeFunction(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( ...args) { + const originalCallback = args[0]; + args[0] = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(originalCallback, { + mechanism: { + data: { function: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(original) }, + handled: false, + type: 'instrument', + }, + }); + return original.apply(this, args); + }; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _wrapRAF(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( callback) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return original.apply(this, [ + (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(callback, { + mechanism: { + data: { + function: 'requestAnimationFrame', + handler: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(original), + }, + handled: false, + type: 'instrument', + }, + }), + ]); + }; +} + +function _wrapXHR(originalSend) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( ...args) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const xhr = this; + const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange']; + + xmlHttpRequestProps.forEach(prop => { + if (prop in xhr && typeof xhr[prop] === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)(xhr, prop, function (original) { + const wrapOptions = { + mechanism: { + data: { + function: prop, + handler: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(original), + }, + handled: false, + type: 'instrument', + }, + }; + + // If Instrument integration has been called before BrowserApiErrors, get the name of original function + const originalFunction = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.getOriginalFunction)(original); + if (originalFunction) { + wrapOptions.mechanism.data.handler = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(originalFunction); + } + + // Otherwise wrap directly + return (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(original, wrapOptions); + }); + } + }); + + return originalSend.apply(this, args); + }; +} + +function _wrapEventTarget(target) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const globalObject = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW ; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const proto = globalObject[target] && globalObject[target].prototype; + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)(proto, 'addEventListener', function (original,) + + { + return function ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + eventName, + fn, + options, + ) { + try { + if (typeof fn.handleEvent === 'function') { + // ESlint disable explanation: + // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would + // introduce a bug here, because bind returns a new function that doesn't have our + // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping. + // Without those flags, every call to addEventListener wraps the function again, causing a memory leak. + // eslint-disable-next-line @typescript-eslint/unbound-method + fn.handleEvent = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(fn.handleEvent, { + mechanism: { + data: { + function: 'handleEvent', + handler: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(fn), + target, + }, + handled: false, + type: 'instrument', + }, + }); + } + } catch (err) { + // can sometimes get 'Permission denied to access property "handle Event' + } + + return original.apply(this, [ + eventName, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(fn , { + mechanism: { + data: { + function: 'addEventListener', + handler: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(fn), + target, + }, + handled: false, + type: 'instrument', + }, + }), + options, + ]); + }; + }); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.fill)( + proto, + 'removeEventListener', + function ( + originalRemoveEventListener, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) { + return function ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + eventName, + fn, + options, + ) { + /** + * There are 2 possible scenarios here: + * + * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified + * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function + * as a pass-through, and call original `removeEventListener` with it. + * + * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using + * our wrapped version of `addEventListener`, which internally calls `wrap` helper. + * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it, + * in order for us to make a distinction between wrapped/non-wrapped functions possible. + * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler. + * + * When someone adds a handler prior to initialization, and then do it again, but after, + * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible + * to get rid of the initial handler and it'd stick there forever. + */ + const wrappedEventHandler = fn ; + try { + const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__; + if (originalEventHandler) { + originalRemoveEventListener.call(this, eventName, originalEventHandler, options); + } + } catch (e) { + // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments + } + return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options); + }; + }, + ); +} + + +//# sourceMappingURL=browserapierrors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/contextlines.js": +/*!*************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/contextlines.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applySourceContextToFrame: () => (/* binding */ applySourceContextToFrame), +/* harmony export */ contextLinesIntegration: () => (/* binding */ contextLinesIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/url.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); + + +const WINDOW = _sentry_core__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +const DEFAULT_LINES_OF_CONTEXT = 7; + +const INTEGRATION_NAME = 'ContextLines'; + +const _contextLinesIntegration = ((options = {}) => { + const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT; + + return { + name: INTEGRATION_NAME, + processEvent(event) { + return addSourceContext(event, contextLines); + }, + }; +}) ; + +/** + * Collects source context lines around the lines of stackframes pointing to JS embedded in + * the current page's HTML. + * + * This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser. + * For frames pointing to files, context lines are added during ingestion and symbolication + * by attempting to download the JS files to the Sentry backend. + * + * Use this integration if you have inline JS code in HTML pages that can't be accessed + * by our backend (e.g. due to a login-protected page). + */ +const contextLinesIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.defineIntegration)(_contextLinesIntegration); + +/** + * Processes an event and adds context lines. + */ +function addSourceContext(event, contextLines) { + const doc = WINDOW.document; + const htmlFilename = WINDOW.location && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.stripUrlQueryAndFragment)(WINDOW.location.href); + if (!doc || !htmlFilename) { + return event; + } + + const exceptions = event.exception && event.exception.values; + if (!exceptions || !exceptions.length) { + return event; + } + + const html = doc.documentElement.innerHTML; + if (!html) { + return event; + } + + const htmlLines = ['', '', ...html.split('\n'), '']; + + exceptions.forEach(exception => { + const stacktrace = exception.stacktrace; + if (stacktrace && stacktrace.frames) { + stacktrace.frames = stacktrace.frames.map(frame => + applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines), + ); + } + }); + + return event; +} + +/** + * Only exported for testing + */ +function applySourceContextToFrame( + frame, + htmlLines, + htmlFilename, + linesOfContext, +) { + if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) { + return frame; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addContextToFrame)(htmlLines, frame, linesOfContext); + + return frame; +} + + +//# sourceMappingURL=contextlines.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js": +/*!***************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ globalHandlersIntegration: () => (/* binding */ globalHandlersIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalError.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalUnhandledRejection.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../eventbuilder.js */ "../../node_modules/@sentry/browser/build/npm/esm/eventbuilder.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + + + +const INTEGRATION_NAME = 'GlobalHandlers'; + +const _globalHandlersIntegration = ((options = {}) => { + const _options = { + onerror: true, + onunhandledrejection: true, + ...options, + }; + + return { + name: INTEGRATION_NAME, + setupOnce() { + Error.stackTraceLimit = 50; + }, + setup(client) { + if (_options.onerror) { + _installGlobalOnErrorHandler(client); + globalHandlerLog('onerror'); + } + if (_options.onunhandledrejection) { + _installGlobalOnUnhandledRejectionHandler(client); + globalHandlerLog('onunhandledrejection'); + } + }, + }; +}) ; + +const globalHandlersIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)(_globalHandlersIntegration); + +function _installGlobalOnErrorHandler(client) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.addGlobalErrorInstrumentationHandler)(data => { + const { stackParser, attachStacktrace } = getOptions(); + + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getClient)() !== client || (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.shouldIgnoreOnError)()) { + return; + } + + const { msg, url, line, column, error } = data; + + const event = _enhanceEventWithInitialFrame( + (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__.eventFromUnknownInput)(stackParser, error || msg, undefined, attachStacktrace, false), + url, + line, + column, + ); + + event.level = 'error'; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.captureEvent)(event, { + originalException: error, + mechanism: { + handled: false, + type: 'onerror', + }, + }); + }); +} + +function _installGlobalOnUnhandledRejectionHandler(client) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.addGlobalUnhandledRejectionInstrumentationHandler)(e => { + const { stackParser, attachStacktrace } = getOptions(); + + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getClient)() !== client || (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.shouldIgnoreOnError)()) { + return; + } + + const error = _getUnhandledRejectionError(e ); + + const event = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.isPrimitive)(error) + ? _eventFromRejectionWithPrimitive(error) + : (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__.eventFromUnknownInput)(stackParser, error, undefined, attachStacktrace, true); + + event.level = 'error'; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.captureEvent)(event, { + originalException: error, + mechanism: { + handled: false, + type: 'onunhandledrejection', + }, + }); + }); +} + +function _getUnhandledRejectionError(error) { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.isPrimitive)(error)) { + return error; + } + + // dig the object of the rejection out of known event types + try { + + // PromiseRejectionEvents store the object of the rejection under 'reason' + // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent + if ('reason' in (error )) { + return (error ).reason; + } + + // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents + // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into + // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec + // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and + // https://github.com/getsentry/sentry-javascript/issues/2380 + if ('detail' in (error ) && 'reason' in (error ).detail) { + return (error ).detail.reason; + } + } catch (e2) {} // eslint-disable-line no-empty + + return error; +} + +/** + * Create an event from a promise rejection where the `reason` is a primitive. + * + * @param reason: The `reason` property of the promise rejection + * @returns An Event object with an appropriate `exception` value + */ +function _eventFromRejectionWithPrimitive(reason) { + return { + exception: { + values: [ + { + type: 'UnhandledRejection', + // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) + value: `Non-Error promise rejection captured with value: ${String(reason)}`, + }, + ], + }, + }; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _enhanceEventWithInitialFrame(event, url, line, column) { + // event.exception + const e = (event.exception = event.exception || {}); + // event.exception.values + const ev = (e.values = e.values || []); + // event.exception.values[0] + const ev0 = (ev[0] = ev[0] || {}); + // event.exception.values[0].stacktrace + const ev0s = (ev0.stacktrace = ev0.stacktrace || {}); + // event.exception.values[0].stacktrace.frames + const ev0sf = (ev0s.frames = ev0s.frames || []); + + const colno = isNaN(parseInt(column, 10)) ? undefined : column; + const lineno = isNaN(parseInt(line, 10)) ? undefined : line; + const filename = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.isString)(url) && url.length > 0 ? url : (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getLocationHref)(); + + // event.exception.values[0].stacktrace.frames + if (ev0sf.length === 0) { + ev0sf.push({ + colno, + filename, + function: _sentry_core__WEBPACK_IMPORTED_MODULE_9__.UNKNOWN_FUNCTION, + in_app: true, + lineno, + }); + } + + return event; +} + +function globalHandlerLog(type) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_10__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_11__.logger.log(`Global Handler attached: ${type}`); +} + +function getOptions() { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.getClient)(); + const options = (client && client.getOptions()) || { + stackParser: () => [], + attachStacktrace: false, + }; + return options; +} + + +//# sourceMappingURL=globalhandlers.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/httpclient.js": +/*!***********************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/httpclient.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ httpClientIntegration: () => (/* binding */ httpClientIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/isSentryRequestUrl.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); + + + + +const INTEGRATION_NAME = 'HttpClient'; + +const _httpClientIntegration = ((options = {}) => { + const _options = { + failedRequestStatusCodes: [[500, 599]], + failedRequestTargets: [/.*/], + ...options, + }; + + return { + name: INTEGRATION_NAME, + setup(client) { + _wrapFetch(client, _options); + _wrapXHR(client, _options); + }, + }; +}) ; + +/** + * Create events for failed client side HTTP requests. + */ +const httpClientIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)(_httpClientIntegration); + +/** + * Interceptor function for fetch requests + * + * @param requestInfo The Fetch API request info + * @param response The Fetch API response + * @param requestInit The request init object + */ +function _fetchResponseHandler( + options, + requestInfo, + response, + requestInit, +) { + if (_shouldCaptureResponse(options, response.status, response.url)) { + const request = _getRequest(requestInfo, requestInit); + + let requestHeaders, responseHeaders, requestCookies, responseCookies; + + if (_shouldSendDefaultPii()) { + [requestHeaders, requestCookies] = _parseCookieHeaders('Cookie', request); + [responseHeaders, responseCookies] = _parseCookieHeaders('Set-Cookie', response); + } + + const event = _createEvent({ + url: request.url, + method: request.method, + status: response.status, + requestHeaders, + responseHeaders, + requestCookies, + responseCookies, + }); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.captureEvent)(event); + } +} + +function _parseCookieHeaders( + cookieHeader, + obj, +) { + const headers = _extractFetchHeaders(obj.headers); + let cookies; + + try { + const cookieString = headers[cookieHeader] || headers[cookieHeader.toLowerCase()] || undefined; + + if (cookieString) { + cookies = _parseCookieString(cookieString); + } + } catch (e2) { + // ignore it if parsing fails + } + + return [headers, cookies]; +} + +/** + * Interceptor function for XHR requests + * + * @param xhr The XHR request + * @param method The HTTP method + * @param headers The HTTP headers + */ +function _xhrResponseHandler( + options, + xhr, + method, + headers, +) { + if (_shouldCaptureResponse(options, xhr.status, xhr.responseURL)) { + let requestHeaders, responseCookies, responseHeaders; + + if (_shouldSendDefaultPii()) { + try { + const cookieString = xhr.getResponseHeader('Set-Cookie') || xhr.getResponseHeader('set-cookie') || undefined; + + if (cookieString) { + responseCookies = _parseCookieString(cookieString); + } + } catch (e3) { + // ignore it if parsing fails + } + + try { + responseHeaders = _getXHRResponseHeaders(xhr); + } catch (e4) { + // ignore it if parsing fails + } + + requestHeaders = headers; + } + + const event = _createEvent({ + url: xhr.responseURL, + method, + status: xhr.status, + requestHeaders, + // Can't access request cookies from XHR + responseHeaders, + responseCookies, + }); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.captureEvent)(event); + } +} + +/** + * Extracts response size from `Content-Length` header when possible + * + * @param headers + * @returns The response size in bytes or undefined + */ +function _getResponseSizeFromHeaders(headers) { + if (headers) { + const contentLength = headers['Content-Length'] || headers['content-length']; + + if (contentLength) { + return parseInt(contentLength, 10); + } + } + + return undefined; +} + +/** + * Creates an object containing cookies from the given cookie string + * + * @param cookieString The cookie string to parse + * @returns The parsed cookies + */ +function _parseCookieString(cookieString) { + return cookieString.split('; ').reduce((acc, cookie) => { + const [key, value] = cookie.split('='); + if (key && value) { + acc[key] = value; + } + return acc; + }, {}); +} + +/** + * Extracts the headers as an object from the given Fetch API request or response object + * + * @param headers The headers to extract + * @returns The extracted headers as an object + */ +function _extractFetchHeaders(headers) { + const result = {}; + + headers.forEach((value, key) => { + result[key] = value; + }); + + return result; +} + +/** + * Extracts the response headers as an object from the given XHR object + * + * @param xhr The XHR object to extract the response headers from + * @returns The response headers as an object + */ +function _getXHRResponseHeaders(xhr) { + const headers = xhr.getAllResponseHeaders(); + + if (!headers) { + return {}; + } + + return headers.split('\r\n').reduce((acc, line) => { + const [key, value] = line.split(': '); + if (key && value) { + acc[key] = value; + } + return acc; + }, {}); +} + +/** + * Checks if the given target url is in the given list of targets + * + * @param target The target url to check + * @returns true if the target url is in the given list of targets, false otherwise + */ +function _isInGivenRequestTargets( + failedRequestTargets, + target, +) { + return failedRequestTargets.some((givenRequestTarget) => { + if (typeof givenRequestTarget === 'string') { + return target.includes(givenRequestTarget); + } + + return givenRequestTarget.test(target); + }); +} + +/** + * Checks if the given status code is in the given range + * + * @param status The status code to check + * @returns true if the status code is in the given range, false otherwise + */ +function _isInGivenStatusRanges( + failedRequestStatusCodes, + status, +) { + return failedRequestStatusCodes.some((range) => { + if (typeof range === 'number') { + return range === status; + } + + return status >= range[0] && status <= range[1]; + }); +} + +/** + * Wraps `fetch` function to capture request and response data + */ +function _wrapFetch(client, options) { + if (!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.supportsNativeFetch)()) { + return; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.addFetchInstrumentationHandler)(handlerData => { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.getClient)() !== client) { + return; + } + + const { response, args } = handlerData; + const [requestInfo, requestInit] = args ; + + if (!response) { + return; + } + + _fetchResponseHandler(options, requestInfo, response , requestInit); + }); +} + +/** + * Wraps XMLHttpRequest to capture request and response data + */ +function _wrapXHR(client, options) { + if (!("XMLHttpRequest" in _sentry_core__WEBPACK_IMPORTED_MODULE_5__.GLOBAL_OBJ)) { + return; + } + + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_6__.addXhrInstrumentationHandler)(handlerData => { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.getClient)() !== client) { + return; + } + + const xhr = handlerData.xhr ; + + const sentryXhrData = xhr[_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_6__.SENTRY_XHR_DATA_KEY]; + + if (!sentryXhrData) { + return; + } + + const { method, request_headers: headers } = sentryXhrData; + + try { + _xhrResponseHandler(options, xhr, method, headers); + } catch (e) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_7__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_8__.logger.warn('Error while extracting response event form XHR response', e); + } + }); +} + +/** + * Checks whether to capture given response as an event + * + * @param status response status code + * @param url response url + */ +function _shouldCaptureResponse(options, status, url) { + return ( + _isInGivenStatusRanges(options.failedRequestStatusCodes, status) && + _isInGivenRequestTargets(options.failedRequestTargets, url) && + !(0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.isSentryRequestUrl)(url, (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.getClient)()) + ); +} + +/** + * Creates a synthetic Sentry event from given response data + * + * @param data response data + * @returns event + */ +function _createEvent(data + +) { + const message = `HTTP Client Error with status code: ${data.status}`; + + const event = { + message, + exception: { + values: [ + { + type: 'Error', + value: message, + }, + ], + }, + request: { + url: data.url, + method: data.method, + headers: data.requestHeaders, + cookies: data.requestCookies, + }, + contexts: { + response: { + status_code: data.status, + headers: data.responseHeaders, + cookies: data.responseCookies, + body_size: _getResponseSizeFromHeaders(data.responseHeaders), + }, + }, + }; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__.addExceptionMechanism)(event, { + type: 'http.client', + handled: false, + }); + + return event; +} + +function _getRequest(requestInfo, requestInit) { + if (!requestInit && requestInfo instanceof Request) { + return requestInfo; + } + + // If both are set, we try to construct a new Request with the given arguments + // However, if e.g. the original request has a `body`, this will throw an error because it was already accessed + // In this case, as a fallback, we just use the original request - using both is rather an edge case + if (requestInfo instanceof Request && requestInfo.bodyUsed) { + return requestInfo; + } + + return new Request(requestInfo, requestInit); +} + +function _shouldSendDefaultPii() { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.getClient)(); + return client ? Boolean(client.getOptions().sendDefaultPii) : false; +} + + +//# sourceMappingURL=httpclient.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js": +/*!************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ httpContextIntegration: () => (/* binding */ httpContextIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + +/** + * Collects information about HTTP request headers and + * attaches them to the event. + */ +const httpContextIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)(() => { + return { + name: 'HttpContext', + preprocessEvent(event) { + // if none of the information we want exists, don't bother + if (!_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.navigator && !_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.location && !_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document) { + return; + } + + // grab as much info as exists and add it to the event + const url = (event.request && event.request.url) || (_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.location && _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.location.href); + const { referrer } = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document || {}; + const { userAgent } = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.navigator || {}; + + const headers = { + ...(event.request && event.request.headers), + ...(referrer && { Referer: referrer }), + ...(userAgent && { 'User-Agent': userAgent }), + }; + const request = { ...event.request, ...(url && { url }), headers }; + + event.request = request; + }, + }; +}); + + +//# sourceMappingURL=httpcontext.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js": +/*!*************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ linkedErrorsIntegration: () => (/* binding */ linkedErrorsIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/aggregate-errors.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../eventbuilder.js */ "../../node_modules/@sentry/browser/build/npm/esm/eventbuilder.js"); + + + +const DEFAULT_KEY = 'cause'; +const DEFAULT_LIMIT = 5; + +const INTEGRATION_NAME = 'LinkedErrors'; + +const _linkedErrorsIntegration = ((options = {}) => { + const limit = options.limit || DEFAULT_LIMIT; + const key = options.key || DEFAULT_KEY; + + return { + name: INTEGRATION_NAME, + preprocessEvent(event, hint, client) { + const options = client.getOptions(); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.applyAggregateErrorsToEvent)( + // This differs from the LinkedErrors integration in core by using a different exceptionFromError function + _eventbuilder_js__WEBPACK_IMPORTED_MODULE_1__.exceptionFromError, + options.stackParser, + options.maxValueLength, + key, + limit, + event, + hint, + ); + }, + }; +}) ; + +/** + * Aggregrate linked errors in an event. + */ +const linkedErrorsIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.defineIntegration)(_linkedErrorsIntegration); + + +//# sourceMappingURL=linkederrors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/reportingobserver.js": +/*!******************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/reportingobserver.js ***! + \******************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ reportingObserverIntegration: () => (/* binding */ reportingObserverIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); + + +const WINDOW = _sentry_core__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +const INTEGRATION_NAME = 'ReportingObserver'; + +const SETUP_CLIENTS = new WeakMap(); + +const _reportingObserverIntegration = ((options = {}) => { + const types = options.types || ['crash', 'deprecation', 'intervention']; + + /** Handler for the reporting observer. */ + function handler(reports) { + if (!SETUP_CLIENTS.has((0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getClient)() )) { + return; + } + + for (const report of reports) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.withScope)(scope => { + scope.setExtra('url', report.url); + + const label = `ReportingObserver [${report.type}]`; + let details = 'No details available'; + + if (report.body) { + // Object.keys doesn't work on ReportBody, as all properties are inherited + const plainBody + + = {}; + + // eslint-disable-next-line guard-for-in + for (const prop in report.body) { + plainBody[prop] = report.body[prop]; + } + + scope.setExtra('body', plainBody); + + if (report.type === 'crash') { + const body = report.body ; + // A fancy way to create a message out of crashId OR reason OR both OR fallback + details = [body.crashId || '', body.reason || ''].join(' ').trim() || details; + } else { + const body = report.body ; + details = body.message || details; + } + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.captureMessage)(`${label}: ${details}`); + }); + } + } + + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.supportsReportingObserver)()) { + return; + } + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any + const observer = new (WINDOW ).ReportingObserver(handler, { + buffered: true, + types, + }); + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + observer.observe(); + }, + + setup(client) { + SETUP_CLIENTS.set(client, true); + }, + }; +}) ; + +/** + * Reporting API integration - https://w3c.github.io/reporting/ + */ +const reportingObserverIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.defineIntegration)(_reportingObserverIntegration); + + +//# sourceMappingURL=reportingobserver.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/integrations/spotlight.js": +/*!**********************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/integrations/spotlight.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ INTEGRATION_NAME: () => (/* binding */ INTEGRATION_NAME), +/* harmony export */ isSpotlightInteraction: () => (/* binding */ isSpotlightInteraction), +/* harmony export */ spotlightBrowserIntegration: () => (/* binding */ spotlightBrowserIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); + + + + +const INTEGRATION_NAME = 'SpotlightBrowser'; + +const _spotlightIntegration = ((options = {}) => { + const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream'; + + return { + name: INTEGRATION_NAME, + setup: () => { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_1__.logger.log('Using Sidecar URL', sidecarUrl); + }, + // We don't want to send interaction transactions/root spans created from + // clicks within Spotlight to Sentry. Neither do we want them to be sent to + // spotlight. + processEvent: event => (isSpotlightInteraction(event) ? null : event), + afterAllSetup: (client) => { + setupSidecarForwarding(client, sidecarUrl); + }, + }; +}) ; + +function setupSidecarForwarding(client, sidecarUrl) { + const makeFetch = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_2__.getNativeImplementation)('fetch'); + let failCount = 0; + + client.on('beforeEnvelope', (envelope) => { + if (failCount > 3) { + _sentry_core__WEBPACK_IMPORTED_MODULE_1__.logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:', failCount); + return; + } + + makeFetch(sidecarUrl, { + method: 'POST', + body: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.serializeEnvelope)(envelope), + headers: { + 'Content-Type': 'application/x-sentry-envelope', + }, + mode: 'cors', + }).then( + res => { + if (res.status >= 200 && res.status < 400) { + // Reset failed requests counter on success + failCount = 0; + } + }, + err => { + failCount++; + _sentry_core__WEBPACK_IMPORTED_MODULE_1__.logger.error( + "Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/", + err, + ); + }, + ); + }); +} + +/** + * Use this integration to send errors and transactions to Spotlight. + * + * Learn more about spotlight at https://spotlightjs.com + */ +const spotlightBrowserIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.defineIntegration)(_spotlightIntegration); + +/** + * Flags if the event is a transaction created from an interaction with the spotlight UI. + */ +function isSpotlightInteraction(event) { + return Boolean( + event.type === 'transaction' && + event.spans && + event.contexts && + event.contexts.trace && + event.contexts.trace.op === 'ui.action.click' && + event.spans.some(({ description }) => description && description.includes('#sentry-spotlight')), + ); +} + + +//# sourceMappingURL=spotlight.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/metrics.js": +/*!*******************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/metrics.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ metrics: () => (/* binding */ metrics) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/metrics/exports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/metrics/browser-aggregator.js"); + + +/** + * Adds a value to a counter metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function increment(name, value = 1, data) { + // eslint-disable-next-line deprecation/deprecation + _sentry_core__WEBPACK_IMPORTED_MODULE_0__.metrics.increment(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.BrowserMetricsAggregator, name, value, data); +} + +/** + * Adds a value to a distribution metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function distribution(name, value, data) { + // eslint-disable-next-line deprecation/deprecation + _sentry_core__WEBPACK_IMPORTED_MODULE_0__.metrics.distribution(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.BrowserMetricsAggregator, name, value, data); +} + +/** + * Adds a value to a set metric. Value must be a string or integer. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function set(name, value, data) { + // eslint-disable-next-line deprecation/deprecation + _sentry_core__WEBPACK_IMPORTED_MODULE_0__.metrics.set(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.BrowserMetricsAggregator, name, value, data); +} + +/** + * Adds a value to a gauge metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function gauge(name, value, data) { + // eslint-disable-next-line deprecation/deprecation + _sentry_core__WEBPACK_IMPORTED_MODULE_0__.metrics.gauge(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.BrowserMetricsAggregator, name, value, data); +} + +/** + * Adds a timing metric. + * The metric is added as a distribution metric. + * + * You can either directly capture a numeric `value`, or wrap a callback function in `timing`. + * In the latter case, the duration of the callback execution will be captured as a span & a metric. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ + +function timing( + name, + value, + unit = 'second', + data, +) { + // eslint-disable-next-line deprecation/deprecation + return _sentry_core__WEBPACK_IMPORTED_MODULE_0__.metrics.timing(_sentry_core__WEBPACK_IMPORTED_MODULE_1__.BrowserMetricsAggregator, name, value, unit, data); +} + +/** + * The metrics API is used to capture custom metrics in Sentry. + * + * @deprecated The Sentry metrics beta has ended. This export will be removed in a future release. + */ +const metrics = { + increment, + distribution, + set, + gauge, + timing, +}; + + +//# sourceMappingURL=metrics.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/profiling/integration.js": +/*!*********************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/profiling/integration.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ browserProfilingIntegration: () => (/* binding */ browserProfilingIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _startProfileForSpan_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startProfileForSpan.js */ "../../node_modules/@sentry/browser/build/npm/esm/profiling/startProfileForSpan.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/browser/build/npm/esm/profiling/utils.js"); + + + + + +const INTEGRATION_NAME = 'BrowserProfiling'; + +const _browserProfilingIntegration = (() => { + return { + name: INTEGRATION_NAME, + setup(client) { + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.getActiveSpan)(); + const rootSpan = activeSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.getRootSpan)(activeSpan); + + if (rootSpan && (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.isAutomatedPageLoadSpan)(rootSpan)) { + if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.shouldProfileSpan)(rootSpan)) { + (0,_startProfileForSpan_js__WEBPACK_IMPORTED_MODULE_2__.startProfileForSpan)(rootSpan); + } + } + + client.on('spanStart', (span) => { + if (span === (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.getRootSpan)(span) && (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.shouldProfileSpan)(span)) { + (0,_startProfileForSpan_js__WEBPACK_IMPORTED_MODULE_2__.startProfileForSpan)(span); + } + }); + + client.on('beforeEnvelope', (envelope) => { + // if not profiles are in queue, there is nothing to add to the envelope. + if (!(0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.getActiveProfilesCount)()) { + return; + } + + const profiledTransactionEvents = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.findProfiledTransactionsFromEnvelope)(envelope); + if (!profiledTransactionEvents.length) { + return; + } + + const profilesToAddToEnvelope = []; + + for (const profiledTransaction of profiledTransactionEvents) { + const context = profiledTransaction && profiledTransaction.contexts; + const profile_id = context && context['profile'] && context['profile']['profile_id']; + const start_timestamp = context && context['profile'] && context['profile']['start_timestamp']; + + if (typeof profile_id !== 'string') { + _debug_build_js__WEBPACK_IMPORTED_MODULE_3__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_4__.logger.log('[Profiling] cannot find profile for a span without a profile context'); + continue; + } + + if (!profile_id) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_3__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_4__.logger.log('[Profiling] cannot find profile for a span without a profile context'); + continue; + } + + // Remove the profile from the span context before sending, relay will take care of the rest. + if (context && context['profile']) { + delete context.profile; + } + + const profile = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.takeProfileFromGlobalCache)(profile_id); + if (!profile) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_3__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_4__.logger.log(`[Profiling] Could not retrieve profile for span: ${profile_id}`); + continue; + } + + const profileEvent = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.createProfilingEvent)( + profile_id, + start_timestamp , + profile, + profiledTransaction , + ); + if (profileEvent) { + profilesToAddToEnvelope.push(profileEvent); + } + } + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.addProfilesToEnvelope)(envelope , profilesToAddToEnvelope); + }); + }, + }; +}) ; + +const browserProfilingIntegration = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.defineIntegration)(_browserProfilingIntegration); + + +//# sourceMappingURL=integration.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/profiling/startProfileForSpan.js": +/*!*****************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/profiling/startProfileForSpan.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ startProfileForSpan: () => (/* binding */ startProfileForSpan) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/browser/build/npm/esm/profiling/utils.js"); + + + + + +/** + * Wraps startTransaction and stopTransaction with profiling related logic. + * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from + * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction. + */ +function startProfileForSpan(span) { + // Start the profiler and get the profiler instance. + let startTimestamp; + if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isAutomatedPageLoadSpan)(span)) { + startTimestamp = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)() * 1000; + } + + const profiler = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.startJSSelfProfile)(); + + // We failed to construct the profiler, so we skip. + // No need to log anything as this has already been logged in startProfile. + if (!profiler) { + return; + } + + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.log(`[Profiling] started profiling span: ${(0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(span).description}`); + } + + // We create "unique" span names to avoid concurrent spans with same names + // from being ignored by the profiler. From here on, only this span name should be used when + // calling the profiler methods. Note: we log the original name to the user to avoid confusion. + const profileId = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.uuid4)(); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getCurrentScope)().setContext('profile', { + profile_id: profileId, + start_timestamp: startTimestamp, + }); + + /** + * Idempotent handler for profile stop + */ + async function onProfileHandler() { + // Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times. + if (!span) { + return; + } + // Satisfy the type checker, but profiler will always be defined here. + if (!profiler) { + return; + } + + return profiler + .stop() + .then((profile) => { + if (maxDurationTimeoutID) { + _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.clearTimeout(maxDurationTimeoutID); + maxDurationTimeoutID = undefined; + } + + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.log(`[Profiling] stopped profiling of span: ${(0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(span).description}`); + } + + // In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile. + if (!profile) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.log( + `[Profiling] profiler returned null profile for: ${(0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(span).description}`, + 'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started', + ); + } + return; + } + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.addProfileToGlobalCache)(profileId, profile); + }) + .catch(error => { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Profiling] error while stopping profiler:', error); + } + }); + } + + // Enqueue a timeout to prevent profiles from running over max duration. + let maxDurationTimeoutID = _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.setTimeout(() => { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Profiling] max profile duration elapsed, stopping profiling for:', (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(span).description); + } + // If the timeout exceeds, we want to stop profiling, but not finish the span + // eslint-disable-next-line @typescript-eslint/no-floating-promises + onProfileHandler(); + }, _utils_js__WEBPACK_IMPORTED_MODULE_0__.MAX_PROFILE_DURATION_MS); + + // We need to reference the original end call to avoid creating an infinite loop + const originalEnd = span.end.bind(span); + + /** + * Wraps span `end()` with profiling related logic. + * startProfiling is called after the call to spanStart in order to avoid our own code from + * being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd. + */ + function profilingWrappedSpanEnd() { + if (!span) { + return originalEnd(); + } + // onProfileHandler should always return the same profile even if this is called multiple times. + // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared. + void onProfileHandler().then( + () => { + originalEnd(); + }, + () => { + // If onProfileHandler fails, we still want to call the original finish method. + originalEnd(); + }, + ); + + return span; + } + + span.end = profilingWrappedSpanEnd; +} + + +//# sourceMappingURL=startProfileForSpan.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/profiling/utils.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/profiling/utils.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MAX_PROFILE_DURATION_MS: () => (/* binding */ MAX_PROFILE_DURATION_MS), +/* harmony export */ addProfileToGlobalCache: () => (/* binding */ addProfileToGlobalCache), +/* harmony export */ addProfilesToEnvelope: () => (/* binding */ addProfilesToEnvelope), +/* harmony export */ applyDebugMetadata: () => (/* binding */ applyDebugMetadata), +/* harmony export */ convertJSSelfProfileToSampledFormat: () => (/* binding */ convertJSSelfProfileToSampledFormat), +/* harmony export */ createProfilePayload: () => (/* binding */ createProfilePayload), +/* harmony export */ createProfilingEvent: () => (/* binding */ createProfilingEvent), +/* harmony export */ enrichWithThreadInformation: () => (/* binding */ enrichWithThreadInformation), +/* harmony export */ findProfiledTransactionsFromEnvelope: () => (/* binding */ findProfiledTransactionsFromEnvelope), +/* harmony export */ getActiveProfilesCount: () => (/* binding */ getActiveProfilesCount), +/* harmony export */ isAutomatedPageLoadSpan: () => (/* binding */ isAutomatedPageLoadSpan), +/* harmony export */ isValidSampleRate: () => (/* binding */ isValidSampleRate), +/* harmony export */ shouldProfileSpan: () => (/* binding */ shouldProfileSpan), +/* harmony export */ startJSSelfProfile: () => (/* binding */ startJSSelfProfile), +/* harmony export */ takeProfileFromGlobalCache: () => (/* binding */ takeProfileFromGlobalCache) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/constants.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-ids.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + + +/* eslint-disable max-lines */ + + +const MS_TO_NS = 1e6; +// Use 0 as main thread id which is identical to threadId in node:worker_threads +// where main logs 0 and workers seem to log in increments of 1 +const THREAD_ID_STRING = String(0); +const THREAD_NAME = 'main'; + +// Machine properties (eval only once) +let OS_PLATFORM = ''; +let OS_PLATFORM_VERSION = ''; +let OS_ARCH = ''; +let OS_BROWSER = (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator.userAgent) || ''; +let OS_MODEL = ''; +const OS_LOCALE = + (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator.language) || + (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator.languages && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator.languages[0]) || + ''; + +function isUserAgentData(data) { + return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data; +} + +// @ts-expect-error userAgentData is not part of the navigator interface yet +const userAgentData = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator.userAgentData; + +if (isUserAgentData(userAgentData)) { + userAgentData + .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList']) + .then((ua) => { + OS_PLATFORM = ua.platform || ''; + OS_ARCH = ua.architecture || ''; + OS_MODEL = ua.model || ''; + OS_PLATFORM_VERSION = ua.platformVersion || ''; + + if (ua.fullVersionList && ua.fullVersionList.length > 0) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1]; + OS_BROWSER = `${firstUa.brand} ${firstUa.version}`; + } + }) + .catch(e => void e); +} + +function isProcessedJSSelfProfile(profile) { + return !('thread_metadata' in profile); +} + +// Enriches the profile with threadId of the current thread. +// This is done in node as we seem to not be able to get the info from C native code. +/** + * + */ +function enrichWithThreadInformation(profile) { + if (!isProcessedJSSelfProfile(profile)) { + return profile; + } + + return convertJSSelfProfileToSampledFormat(profile); +} + +// Profile is marked as optional because it is deleted from the metadata +// by the integration before the event is processed by other integrations. + +function getTraceId(event) { + const traceId = event && event.contexts && event.contexts['trace'] && event.contexts['trace']['trace_id']; + // Log a warning if the profile has an invalid traceId (should be uuidv4). + // All profiles and transactions are rejected if this is the case and we want to + // warn users that this is happening if they enable debug flag + if (typeof traceId === 'string' && traceId.length !== 32) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`); + } + } + if (typeof traceId !== 'string') { + return ''; + } + + return traceId; +} +/** + * Creates a profiling event envelope from a Sentry event. If profile does not pass + * validation, returns null. + * @param event + * @param dsn + * @param metadata + * @param tunnel + * @returns {EventEnvelope | null} + */ + +/** + * Creates a profiling event envelope from a Sentry event. + */ +function createProfilePayload( + profile_id, + start_timestamp, + processed_profile, + event, +) { + if (event.type !== 'transaction') { + // createProfilingEventEnvelope should only be called for transactions, + // we type guard this behavior with isProfiledTransactionEvent. + throw new TypeError('Profiling events may only be attached to transactions, this should never occur.'); + } + + if (processed_profile === undefined || processed_profile === null) { + throw new TypeError( + `Cannot construct profiling event envelope without a valid profile. Got ${processed_profile} instead.`, + ); + } + + const traceId = getTraceId(event); + const enrichedThreadProfile = enrichWithThreadInformation(processed_profile); + const transactionStartMs = start_timestamp + ? start_timestamp + : typeof event.start_timestamp === 'number' + ? event.start_timestamp * 1000 + : (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.timestampInSeconds)() * 1000; + const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.timestampInSeconds)() * 1000; + + const profile = { + event_id: profile_id, + timestamp: new Date(transactionStartMs).toISOString(), + platform: 'javascript', + version: '1', + release: event.release || '', + environment: event.environment || _sentry_core__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_ENVIRONMENT, + runtime: { + name: 'javascript', + version: _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator.userAgent, + }, + os: { + name: OS_PLATFORM, + version: OS_PLATFORM_VERSION, + build_number: OS_BROWSER, + }, + device: { + locale: OS_LOCALE, + model: OS_MODEL, + manufacturer: OS_BROWSER, + architecture: OS_ARCH, + is_emulator: false, + }, + debug_meta: { + images: applyDebugMetadata(processed_profile.resources), + }, + profile: enrichedThreadProfile, + transactions: [ + { + name: event.transaction || '', + id: event.event_id || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.uuid4)(), + trace_id: traceId, + active_thread_id: THREAD_ID_STRING, + relative_start_ns: '0', + relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0), + }, + ], + }; + + return profile; +} + +/* + See packages/browser-utils/src/browser/router.ts +*/ +/** + * + */ +function isAutomatedPageLoadSpan(span) { + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.spanToJSON)(span).op === 'pageload'; +} + +/** + * Converts a JSSelfProfile to a our sampled format. + * Does not currently perform stack indexing. + */ +function convertJSSelfProfileToSampledFormat(input) { + let EMPTY_STACK_ID = undefined; + let STACK_ID = 0; + + // Initialize the profile that we will fill with data + const profile = { + samples: [], + stacks: [], + frames: [], + thread_metadata: { + [THREAD_ID_STRING]: { name: THREAD_NAME }, + }, + }; + + const firstSample = input.samples[0]; + if (!firstSample) { + return profile; + } + + // We assert samples.length > 0 above and timestamp should always be present + const start = firstSample.timestamp; + // The JS SDK might change it's time origin based on some heuristic (see See packages/utils/src/time.ts) + // when that happens, we need to ensure we are correcting the profile timings so the two timelines stay in sync. + // Since JS self profiling time origin is always initialized to performance.timeOrigin, we need to adjust for + // the drift between the SDK selected value and our profile time origin. + const origin = + typeof performance.timeOrigin === 'number' ? performance.timeOrigin : _sentry_core__WEBPACK_IMPORTED_MODULE_3__.browserPerformanceTimeOrigin || 0; + const adjustForOriginChange = origin - (_sentry_core__WEBPACK_IMPORTED_MODULE_3__.browserPerformanceTimeOrigin || origin); + + input.samples.forEach((jsSample, i) => { + // If sample has no stack, add an empty sample + if (jsSample.stackId === undefined) { + if (EMPTY_STACK_ID === undefined) { + EMPTY_STACK_ID = STACK_ID; + profile.stacks[EMPTY_STACK_ID] = []; + STACK_ID++; + } + + profile['samples'][i] = { + // convert ms timestamp to ns + elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0), + stack_id: EMPTY_STACK_ID, + thread_id: THREAD_ID_STRING, + }; + return; + } + + let stackTop = input.stacks[jsSample.stackId]; + + // Functions in top->down order (root is last) + // We follow the stackTop.parentId trail and collect each visited frameId + const stack = []; + + while (stackTop) { + stack.push(stackTop.frameId); + + const frame = input.frames[stackTop.frameId]; + + // If our frame has not been indexed yet, index it + if (frame && profile.frames[stackTop.frameId] === undefined) { + profile.frames[stackTop.frameId] = { + function: frame.name, + abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined, + lineno: frame.line, + colno: frame.column, + }; + } + + stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId]; + } + + const sample = { + // convert ms timestamp to ns + elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0), + stack_id: STACK_ID, + thread_id: THREAD_ID_STRING, + }; + + profile['stacks'][STACK_ID] = stack; + profile['samples'][i] = sample; + STACK_ID++; + }); + + return profile; +} + +/** + * Adds items to envelope if they are not already present - mutates the envelope. + * @param envelope + */ +function addProfilesToEnvelope(envelope, profiles) { + if (!profiles.length) { + return envelope; + } + + for (const profile of profiles) { + envelope[1].push([{ type: 'profile' }, profile]); + } + return envelope; +} + +/** + * Finds transactions with profile_id context in the envelope + * @param envelope + * @returns + */ +function findProfiledTransactionsFromEnvelope(envelope) { + const events = []; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.forEachEnvelopeItem)(envelope, (item, type) => { + if (type !== 'transaction') { + return; + } + + for (let j = 1; j < item.length; j++) { + const event = item[j] ; + + if (event && event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id']) { + events.push(item[j] ); + } + } + }); + + return events; +} + +/** + * Applies debug meta data to an event from a list of paths to resources (sourcemaps) + */ +function applyDebugMetadata(resource_paths) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getClient)(); + const options = client && client.getOptions(); + const stackParser = options && options.stackParser; + + if (!stackParser) { + return []; + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.getDebugImagesForResources)(stackParser, resource_paths); +} + +/** + * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1). + */ +function isValidSampleRate(rate) { + // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck + if ((typeof rate !== 'number' && typeof rate !== 'boolean') || (typeof rate === 'number' && isNaN(rate))) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( + rate, + )} of type ${JSON.stringify(typeof rate)}.`, + ); + return false; + } + + // Boolean sample rates are always valid + if (rate === true || rate === false) { + return true; + } + + // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false + if (rate < 0 || rate > 1) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`); + return false; + } + return true; +} + +function isValidProfile(profile) { + if (profile.samples.length < 2) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + // Log a warning if the profile has less than 2 samples so users can know why + // they are not seeing any profiling data and we cant avoid the back and forth + // of asking them to provide us with a dump of the profile data. + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log('[Profiling] Discarding profile because it contains less than 2 samples'); + } + return false; + } + + if (!profile.frames.length) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log('[Profiling] Discarding profile because it contains no frames'); + } + return false; + } + + return true; +} + +// Keep a flag value to avoid re-initializing the profiler constructor. If it fails +// once, it will always fail and this allows us to early return. +let PROFILING_CONSTRUCTOR_FAILED = false; +const MAX_PROFILE_DURATION_MS = 30000; + +/** + * Check if profiler constructor is available. + * @param maybeProfiler + */ +function isJSProfilerSupported(maybeProfiler) { + return typeof maybeProfiler === 'function'; +} + +/** + * Starts the profiler and returns the profiler instance. + */ +function startJSSelfProfile() { + // Feature support check first + const JSProfilerConstructor = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.Profiler; + + if (!isJSProfilerSupported(JSProfilerConstructor)) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log( + '[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.', + ); + } + return; + } + + // From initial testing, it seems that the minimum value for sampleInterval is 10ms. + const samplingIntervalMS = 10; + // Start the profiler + const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS); + + // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session. + // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens + // as we risk breaking the user's application, so just disable profiling and log an error. + try { + return new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples }); + } catch (e) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log( + "[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.", + ); + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log('[Profiling] Disabling profiling for current user session.'); + } + PROFILING_CONSTRUCTOR_FAILED = true; + } + + return; +} + +/** + * Determine if a profile should be profiled. + */ +function shouldProfileSpan(span) { + // If constructor failed once, it will always fail, so we can early return. + if (PROFILING_CONSTRUCTOR_FAILED) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log('[Profiling] Profiling has been disabled for the duration of the current user session.'); + } + return false; + } + + if (!span.isRecording()) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log('[Profiling] Discarding profile because transaction was not sampled.'); + } + return false; + } + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getClient)(); + const options = client && client.getOptions(); + if (!options) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log('[Profiling] Profiling disabled, no options found.'); + return false; + } + + // @ts-expect-error profilesSampleRate is not part of the browser options yet + const profilesSampleRate = options.profilesSampleRate; + + // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The + // only valid values are booleans or numbers between 0 and 1.) + if (!isValidSampleRate(profilesSampleRate)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.warn('[Profiling] Discarding profile because of invalid sample rate.'); + return false; + } + + // if the function returned 0 (or false), or if `profileSampleRate` is 0, it's a sign the profile should be dropped + if (!profilesSampleRate) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log( + '[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0', + ); + return false; + } + + // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is + // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false. + const sampled = profilesSampleRate === true ? true : Math.random() < profilesSampleRate; + // Check if we should sample this profile + if (!sampled) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _sentry_core__WEBPACK_IMPORTED_MODULE_2__.logger.log( + `[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number( + profilesSampleRate, + )})`, + ); + return false; + } + + return true; +} + +/** + * Creates a profiling envelope item, if the profile does not pass validation, returns null. + * @param event + * @returns {Profile | null} + */ +function createProfilingEvent( + profile_id, + start_timestamp, + profile, + event, +) { + if (!isValidProfile(profile)) { + return null; + } + + return createProfilePayload(profile_id, start_timestamp, profile, event); +} + +// TODO (v8): We need to obtain profile ids in @sentry-internal/tracing, +// but we don't have access to this map because importing this map would +// cause a circular dependency. We need to resolve this in v8. +const PROFILE_MAP = new Map(); +/** + * + */ +function getActiveProfilesCount() { + return PROFILE_MAP.size; +} + +/** + * Retrieves profile from global cache and removes it. + */ +function takeProfileFromGlobalCache(profile_id) { + const profile = PROFILE_MAP.get(profile_id); + if (profile) { + PROFILE_MAP.delete(profile_id); + } + return profile; +} +/** + * Adds profile to global cache and evicts the oldest profile if the cache is full. + */ +function addProfileToGlobalCache(profile_id, profile) { + PROFILE_MAP.set(profile_id, profile); + + if (PROFILE_MAP.size > 30) { + const last = PROFILE_MAP.keys().next().value; + PROFILE_MAP.delete(last); + } +} + + +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/sdk.js": +/*!***************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/sdk.js ***! + \***************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ captureUserFeedback: () => (/* binding */ captureUserFeedback), +/* harmony export */ forceLoad: () => (/* binding */ forceLoad), +/* harmony export */ getDefaultIntegrations: () => (/* binding */ getDefaultIntegrations), +/* harmony export */ init: () => (/* binding */ init), +/* harmony export */ onLoad: () => (/* binding */ onLoad), +/* harmony export */ showReportDialog: () => (/* binding */ showReportDialog) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/inboundfilters.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/functiontostring.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integrations/dedupe.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/sdk.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/api.js"); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js"); +/* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./client.js */ "../../node_modules/@sentry/browser/build/npm/esm/client.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); +/* harmony import */ var _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./integrations/breadcrumbs.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js"); +/* harmony import */ var _integrations_browserapierrors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./integrations/browserapierrors.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js"); +/* harmony import */ var _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./integrations/globalhandlers.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js"); +/* harmony import */ var _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./integrations/httpcontext.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js"); +/* harmony import */ var _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./integrations/linkederrors.js */ "../../node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js"); +/* harmony import */ var _stack_parsers_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./stack-parsers.js */ "../../node_modules/@sentry/browser/build/npm/esm/stack-parsers.js"); +/* harmony import */ var _transports_fetch_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./transports/fetch.js */ "../../node_modules/@sentry/browser/build/npm/esm/transports/fetch.js"); + + + + + + + + + + + + + +/** Get the default integrations for the browser SDK. */ +function getDefaultIntegrations(_options) { + /** + * Note: Please make sure this stays in sync with Angular SDK, which re-exports + * `getDefaultIntegrations` but with an adjusted set of integrations. + */ + return [ + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.inboundFiltersIntegration)(), + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.functionToStringIntegration)(), + (0,_integrations_browserapierrors_js__WEBPACK_IMPORTED_MODULE_2__.browserApiErrorsIntegration)(), + (0,_integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_3__.breadcrumbsIntegration)(), + (0,_integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_4__.globalHandlersIntegration)(), + (0,_integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_5__.linkedErrorsIntegration)(), + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.dedupeIntegration)(), + (0,_integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_7__.httpContextIntegration)(), + ]; +} + +function applyDefaultOptions(optionsArg = {}) { + const defaultOptions = { + defaultIntegrations: getDefaultIntegrations(), + release: + typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value + ? __SENTRY_RELEASE__ + : _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.SENTRY_RELEASE && _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.SENTRY_RELEASE.id // This supports the variable that sentry-webpack-plugin injects + ? _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.SENTRY_RELEASE.id + : undefined, + autoSessionTracking: true, + sendClientReports: true, + }; + + // TODO: Instead of dropping just `defaultIntegrations`, we should simply + // call `dropUndefinedKeys` on the entire `optionsArg`. + // However, for this to work we need to adjust the `hasTracingEnabled()` logic + // first as it differentiates between `undefined` and the key not being in the object. + if (optionsArg.defaultIntegrations == null) { + delete optionsArg.defaultIntegrations; + } + + return { ...defaultOptions, ...optionsArg }; +} + +function shouldShowBrowserExtensionError() { + const windowWithMaybeExtension = + typeof _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.window !== 'undefined' && (_helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW ); + if (!windowWithMaybeExtension) { + // No need to show the error if we're not in a browser window environment (e.g. service workers) + return false; + } + + const extensionKey = windowWithMaybeExtension.chrome ? 'chrome' : 'browser'; + const extensionObject = windowWithMaybeExtension[extensionKey]; + + const runtimeId = extensionObject && extensionObject.runtime && extensionObject.runtime.id; + const href = (_helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.location && _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.location.href) || ''; + + const extensionProtocols = ['chrome-extension:', 'moz-extension:', 'ms-browser-extension:', 'safari-web-extension:']; + + // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage + const isDedicatedExtensionPage = + !!runtimeId && _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW === _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.top && extensionProtocols.some(protocol => href.startsWith(`${protocol}//`)); + + // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine + // see: https://github.com/getsentry/sentry-javascript/issues/12668 + const isNWjs = typeof windowWithMaybeExtension.nw !== 'undefined'; + + return !!runtimeId && !isDedicatedExtensionPage && !isNWjs; +} + +/** + * A magic string that build tooling can leverage in order to inject a release value into the SDK. + */ + +/** + * The Sentry Browser SDK Client. + * + * To use this SDK, call the {@link init} function as early as possible when + * loading the web page. To set context information or send manual events, use + * the provided methods. + * + * @example + * + * ``` + * + * import { init } from '@sentry/browser'; + * + * init({ + * dsn: '__DSN__', + * // ... + * }); + * ``` + * + * @example + * ``` + * + * import { addBreadcrumb } from '@sentry/browser'; + * addBreadcrumb({ + * message: 'My Breadcrumb', + * // ... + * }); + * ``` + * + * @example + * + * ``` + * + * import * as Sentry from '@sentry/browser'; + * Sentry.captureMessage('Hello, world!'); + * Sentry.captureException(new Error('Good bye')); + * Sentry.captureEvent({ + * message: 'Manual', + * stacktrace: [ + * // ... + * ], + * }); + * ``` + * + * @see {@link BrowserOptions} for documentation on configuration options. + */ +function init(browserOptions = {}) { + const options = applyDefaultOptions(browserOptions); + + if (!options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.consoleSandbox)(() => { + // eslint-disable-next-line no-console + console.error( + '[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/', + ); + }); + return; + } + + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_10__.DEBUG_BUILD) { + if (!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.supportsFetch)()) { + _sentry_core__WEBPACK_IMPORTED_MODULE_9__.logger.warn( + 'No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.', + ); + } + } + const clientOptions = { + ...options, + stackParser: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_12__.stackParserFromStackParserOptions)(options.stackParser || _stack_parsers_js__WEBPACK_IMPORTED_MODULE_13__.defaultStackParser), + integrations: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getIntegrationsToSetup)(options), + transport: options.transport || _transports_fetch_js__WEBPACK_IMPORTED_MODULE_15__.makeFetchTransport, + }; + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_16__.initAndBind)(_client_js__WEBPACK_IMPORTED_MODULE_17__.BrowserClient, clientOptions); + + if (options.autoSessionTracking) { + startSessionTracking(); + } + + return client; +} + +/** + * All properties the report dialog supports + */ + +/** + * Present the user with a report dialog. + * + * @param options Everything is optional, we try to fetch all info need from the global scope. + */ +function showReportDialog(options = {}) { + // doesn't work without a document (React Native) + if (!_helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_10__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_9__.logger.error('Global document not defined in showReportDialog call'); + return; + } + + const scope = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_18__.getCurrentScope)(); + const client = scope.getClient(); + const dsn = client && client.getDsn(); + + if (!dsn) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_10__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_9__.logger.error('DSN not configured for showReportDialog call'); + return; + } + + if (scope) { + options.user = { + ...scope.getUser(), + ...options.user, + }; + } + + if (!options.eventId) { + const eventId = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_19__.lastEventId)(); + if (eventId) { + options.eventId = eventId; + } + } + + const script = _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document.createElement('script'); + script.async = true; + script.crossOrigin = 'anonymous'; + script.src = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_20__.getReportDialogEndpoint)(dsn, options); + + if (options.onLoad) { + script.onload = options.onLoad; + } + + const { onClose } = options; + if (onClose) { + const reportDialogClosedMessageHandler = (event) => { + if (event.data === '__sentry_reportdialog_closed__') { + try { + onClose(); + } finally { + _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.removeEventListener('message', reportDialogClosedMessageHandler); + } + } + }; + _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.addEventListener('message', reportDialogClosedMessageHandler); + } + + const injectionPoint = _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document.head || _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document.body; + if (injectionPoint) { + injectionPoint.appendChild(script); + } else { + _debug_build_js__WEBPACK_IMPORTED_MODULE_10__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_9__.logger.error('Not injecting report dialog. No injection point found in HTML'); + } +} + +/** + * This function is here to be API compatible with the loader. + * @hidden + */ +function forceLoad() { + // Noop +} + +/** + * This function is here to be API compatible with the loader. + * @hidden + */ +function onLoad(callback) { + callback(); +} + +/** + * Enable automatic Session Tracking for the initial page load. + */ +function startSessionTracking() { + if (typeof _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document === 'undefined') { + _debug_build_js__WEBPACK_IMPORTED_MODULE_10__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_9__.logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.'); + return; + } + + // The session duration for browser sessions does not track a meaningful + // concept that can be used as a metric. + // Automatically captured sessions are akin to page views, and thus we + // discard their duration. + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_19__.startSession)({ ignoreDuration: true }); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_19__.captureSession)(); + + // We want to create a session for every navigation as well + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_21__.addHistoryInstrumentationHandler)(({ from, to }) => { + // Don't create an additional session for the initial route or if the location did not change + if (from !== undefined && from !== to) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_19__.startSession)({ ignoreDuration: true }); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_19__.captureSession)(); + } + }); +} + +/** + * Captures user feedback and sends it to Sentry. + * + * @deprecated Use `captureFeedback` instead. + */ +function captureUserFeedback(feedback) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_18__.getClient)(); + if (client) { + // eslint-disable-next-line deprecation/deprecation + client.captureUserFeedback(feedback); + } +} + + +//# sourceMappingURL=sdk.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/stack-parsers.js": +/*!*************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/stack-parsers.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ chromeStackLineParser: () => (/* binding */ chromeStackLineParser), +/* harmony export */ defaultStackLineParsers: () => (/* binding */ defaultStackLineParsers), +/* harmony export */ defaultStackParser: () => (/* binding */ defaultStackParser), +/* harmony export */ geckoStackLineParser: () => (/* binding */ geckoStackLineParser), +/* harmony export */ opera10StackLineParser: () => (/* binding */ opera10StackLineParser), +/* harmony export */ opera11StackLineParser: () => (/* binding */ opera11StackLineParser), +/* harmony export */ winjsStackLineParser: () => (/* binding */ winjsStackLineParser) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); + + +// This was originally forked from https://github.com/csnover/TraceKit, and was largely +// re - written as part of raven - js. +// +// This code was later copied to the JavaScript mono - repo and further modified and +// refactored over the years. + + +const OPERA10_PRIORITY = 10; +const OPERA11_PRIORITY = 20; +const CHROME_PRIORITY = 30; +const WINJS_PRIORITY = 40; +const GECKO_PRIORITY = 50; + +function createFrame(filename, func, lineno, colno) { + const frame = { + filename, + function: func === '' ? _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION : func, + in_app: true, // All browser frames are considered in_app + }; + + if (lineno !== undefined) { + frame.lineno = lineno; + } + + if (colno !== undefined) { + frame.colno = colno; + } + + return frame; +} + +// This regex matches frames that have no function name (ie. are at the top level of a module). +// For example "at http://localhost:5000//script.js:1:126" +// Frames _with_ function names usually look as follows: "at commitLayoutEffects (react-dom.development.js:23426:1)" +const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; + +// This regex matches all the frames that have a function name. +const chromeRegex = + /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; + +const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; + +// Chromium based browsers: Chrome, Brave, new Opera, new Edge +// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments +// See: https://github.com/getsentry/sentry-javascript/issues/6880 +const chromeStackParserFn = line => { + // If the stack line has no function name, we need to parse it differently + const noFnParts = chromeRegexNoFnName.exec(line) ; + + if (noFnParts) { + const [, filename, line, col] = noFnParts; + return createFrame(filename, _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION, +line, +col); + } + + const parts = chromeRegex.exec(line) ; + + if (parts) { + const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + + if (isEval) { + const subMatch = chromeEvalRegex.exec(parts[2]) ; + + if (subMatch) { + // throw out eval line/column and use top-most line/column number + parts[2] = subMatch[1]; // url + parts[3] = subMatch[2]; // line + parts[4] = subMatch[3]; // column + } + } + + // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now + // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable) + const [func, filename] = extractSafariExtensionDetails(parts[1] || _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION, parts[2]); + + return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined); + } + + return; +}; + +const chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn]; + +// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it +// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js +// We need this specific case for now because we want no other regex to match. +const geckoREgex = + /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; +const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + +const gecko = line => { + const parts = geckoREgex.exec(line) ; + + if (parts) { + const isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval) { + const subMatch = geckoEvalRegex.exec(parts[3]) ; + + if (subMatch) { + // throw out eval line/column and use top-most line number + parts[1] = parts[1] || 'eval'; + parts[3] = subMatch[1]; + parts[4] = subMatch[2]; + parts[5] = ''; // no column when eval + } + } + + let filename = parts[3]; + let func = parts[1] || _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION; + [func, filename] = extractSafariExtensionDetails(func, filename); + + return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined); + } + + return; +}; + +const geckoStackLineParser = [GECKO_PRIORITY, gecko]; + +const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i; + +const winjs = line => { + const parts = winjsRegex.exec(line) ; + + return parts + ? createFrame(parts[2], parts[1] || _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) + : undefined; +}; + +const winjsStackLineParser = [WINJS_PRIORITY, winjs]; + +const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; + +const opera10 = line => { + const parts = opera10Regex.exec(line) ; + return parts ? createFrame(parts[2], parts[3] || _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION, +parts[1]) : undefined; +}; + +const opera10StackLineParser = [OPERA10_PRIORITY, opera10]; + +const opera11Regex = + / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i; + +const opera11 = line => { + const parts = opera11Regex.exec(line) ; + return parts ? createFrame(parts[5], parts[3] || parts[4] || _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined; +}; + +const opera11StackLineParser = [OPERA11_PRIORITY, opera11]; + +const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser]; + +const defaultStackParser = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.createStackParser)(...defaultStackLineParsers); + +/** + * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces. + * What it means, is that instead of format like: + * + * Error: wat + * at function@url:row:col + * at function@url:row:col + * at function@url:row:col + * + * it produces something like: + * + * function@url:row:col + * function@url:row:col + * function@url:row:col + * + * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch. + * This function is extracted so that we can use it in both places without duplicating the logic. + * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests + * and fix this case seems like an impossible, or at least way too time-consuming task. + */ +const extractSafariExtensionDetails = (func, filename) => { + const isSafariExtension = func.indexOf('safari-extension') !== -1; + const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1; + + return isSafariExtension || isSafariWebExtension + ? [ + func.indexOf('@') !== -1 ? (func.split('@')[0] ) : _sentry_core__WEBPACK_IMPORTED_MODULE_0__.UNKNOWN_FUNCTION, + isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`, + ] + : [func, filename]; +}; + + +//# sourceMappingURL=stack-parsers.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/tracing/backgroundtab.js": +/*!*********************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/tracing/backgroundtab.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ registerBackgroundTabDetection: () => (/* binding */ registerBackgroundTabDetection) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + + +/** + * Add a listener that cancels and finishes a transaction when the global + * document is hidden. + */ +function registerBackgroundTabDetection() { + if (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document) { + _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.addEventListener('visibilitychange', () => { + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getActiveSpan)(); + if (!activeSpan) { + return; + } + + const rootSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getRootSpan)(activeSpan); + + if (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.hidden && rootSpan) { + const cancelledStatus = 'cancelled'; + + const { op, status } = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.spanToJSON)(rootSpan); + + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD) { + _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`); + } + + // We should not set status if it is already set, this prevent important statuses like + // error or data loss from being overwritten on transaction. + if (!status) { + rootSpan.setStatus({ code: _sentry_core__WEBPACK_IMPORTED_MODULE_4__.SPAN_STATUS_ERROR, message: cancelledStatus }); + } + + rootSpan.setAttribute('sentry.cancellation_reason', 'document.hidden'); + rootSpan.end(); + } + }); + } else { + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_3__.logger.warn('[Tracing] Could not set up background tab detection due to lack of global document'); + } +} + + +//# sourceMappingURL=backgroundtab.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/tracing/browserTracingIntegration.js": +/*!*********************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/tracing/browserTracingIntegration.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BROWSER_TRACING_INTEGRATION_ID: () => (/* binding */ BROWSER_TRACING_INTEGRATION_ID), +/* harmony export */ browserTracingIntegration: () => (/* binding */ browserTracingIntegration), +/* harmony export */ getMetaContent: () => (/* binding */ getMetaContent), +/* harmony export */ startBrowserTracingNavigationSpan: () => (/* binding */ startBrowserTracingNavigationSpan), +/* harmony export */ startBrowserTracingPageLoadSpan: () => (/* binding */ startBrowserTracingPageLoadSpan) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js"); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/inp.js"); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/idleSpan.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/errors.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/tracing.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/browser/build/npm/esm/debug-build.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); +/* harmony import */ var _backgroundtab_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./backgroundtab.js */ "../../node_modules/@sentry/browser/build/npm/esm/tracing/backgroundtab.js"); +/* harmony import */ var _request_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./request.js */ "../../node_modules/@sentry/browser/build/npm/esm/tracing/request.js"); + + + + + + + +/* eslint-disable max-lines */ + +const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing'; + +const DEFAULT_BROWSER_TRACING_OPTIONS = { + ..._sentry_core__WEBPACK_IMPORTED_MODULE_0__.TRACING_DEFAULTS, + instrumentNavigation: true, + instrumentPageLoad: true, + markBackgroundSpan: true, + enableLongTask: true, + enableLongAnimationFrame: true, + enableInp: true, + _experiments: {}, + ..._request_js__WEBPACK_IMPORTED_MODULE_1__.defaultRequestInstrumentationOptions, +}; + +/** + * The Browser Tracing integration automatically instruments browser pageload/navigation + * actions as transactions, and captures requests, metrics and errors as spans. + * + * The integration can be configured with a variety of options, and can be extended to use + * any routing library. + * + * We explicitly export the proper type here, as this has to be extended in some cases. + */ +const browserTracingIntegration = ((_options = {}) => { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.registerSpanErrorInstrumentation)(); + + const { + enableInp, + enableLongTask, + enableLongAnimationFrame, + _experiments: { enableInteractions, enableStandaloneClsSpans }, + beforeStartSpan, + idleTimeout, + finalTimeout, + childSpanTimeout, + markBackgroundSpan, + traceFetch, + traceXHR, + trackFetchStreamPerformance, + shouldCreateSpanForRequest, + enableHTTPTimings, + instrumentPageLoad, + instrumentNavigation, + } = { + ...DEFAULT_BROWSER_TRACING_OPTIONS, + ..._options, + }; + + const _collectWebVitals = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.startTrackingWebVitals)({ recordClsStandaloneSpans: enableStandaloneClsSpans || false }); + + if (enableInp) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_4__.startTrackingINP)(); + } + + if ( + enableLongAnimationFrame && + _sentry_core__WEBPACK_IMPORTED_MODULE_5__.GLOBAL_OBJ.PerformanceObserver && + PerformanceObserver.supportedEntryTypes && + PerformanceObserver.supportedEntryTypes.includes('long-animation-frame') + ) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.startTrackingLongAnimationFrames)(); + } else if (enableLongTask) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.startTrackingLongTasks)(); + } + + if (enableInteractions) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.startTrackingInteractions)(); + } + + const latestRoute = { + name: undefined, + source: undefined, + }; + + /** Create routing idle transaction. */ + function _createRouteSpan(client, startSpanOptions) { + const isPageloadTransaction = startSpanOptions.op === 'pageload'; + + const finalStartSpanOptions = beforeStartSpan + ? beforeStartSpan(startSpanOptions) + : startSpanOptions; + + const attributes = finalStartSpanOptions.attributes || {}; + + // If `finalStartSpanOptions.name` is different than `startSpanOptions.name` + // it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'. + if (startSpanOptions.name !== finalStartSpanOptions.name) { + attributes[_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'custom'; + finalStartSpanOptions.attributes = attributes; + } + + latestRoute.name = finalStartSpanOptions.name; + latestRoute.source = attributes[_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + + const idleSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.startIdleSpan)(finalStartSpanOptions, { + idleTimeout, + finalTimeout, + childSpanTimeout, + // should wait for finish signal if it's a pageload transaction + disableAutoFinish: isPageloadTransaction, + beforeSpanEnd: span => { + _collectWebVitals(); + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.addPerformanceEntries)(span, { recordClsOnPageloadSpan: !enableStandaloneClsSpans }); + }, + }); + + function emitFinish() { + if (['interactive', 'complete'].includes(_helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.document.readyState)) { + client.emit('idleSpanEnableAutoFinish', idleSpan); + } + } + + if (isPageloadTransaction && _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.document) { + _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.document.addEventListener('readystatechange', () => { + emitFinish(); + }); + + emitFinish(); + } + + return idleSpan; + } + + return { + name: BROWSER_TRACING_INTEGRATION_ID, + afterAllSetup(client) { + let activeSpan; + let startingUrl = _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location && _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location.href; + + function maybeEndActiveSpan() { + if (activeSpan && !(0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanToJSON)(activeSpan).timestamp) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_10__.logger.log(`[Tracing] Finishing current active span with op: ${(0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanToJSON)(activeSpan).op}`); + // If there's an open active span, we need to finish it before creating an new one. + activeSpan.end(); + } + } + + client.on('startNavigationSpan', startSpanOptions => { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getClient)() !== client) { + return; + } + + maybeEndActiveSpan(); + + activeSpan = _createRouteSpan(client, { + op: 'navigation', + ...startSpanOptions, + }); + }); + + client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => { + if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getClient)() !== client) { + return; + } + maybeEndActiveSpan(); + + const sentryTrace = traceOptions.sentryTrace || getMetaContent('sentry-trace'); + const baggage = traceOptions.baggage || getMetaContent('baggage'); + + const propagationContext = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_12__.propagationContextFromHeaders)(sentryTrace, baggage); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getCurrentScope)().setPropagationContext(propagationContext); + + activeSpan = _createRouteSpan(client, { + op: 'pageload', + ...startSpanOptions, + }); + }); + + // A trace should to stay the consistent over the entire time span of one route. + // Therefore, when the initial pageload or navigation root span ends, we update the + // scope's propagation context to keep span-specific attributes like the `sampled` decision and + // the dynamic sampling context valid, even after the root span has ended. + // This ensures that the trace data is consistent for the entire duration of the route. + client.on('spanEnd', span => { + const op = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanToJSON)(span).op; + if (span !== (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getRootSpan)(span) || (op !== 'navigation' && op !== 'pageload')) { + return; + } + + const scope = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getCurrentScope)(); + const oldPropagationContext = scope.getPropagationContext(); + + scope.setPropagationContext({ + ...oldPropagationContext, + sampled: oldPropagationContext.sampled !== undefined ? oldPropagationContext.sampled : (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanIsSampled)(span), + dsc: oldPropagationContext.dsc || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_13__.getDynamicSamplingContextFromSpan)(span), + }); + }); + + if (_helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location) { + if (instrumentPageLoad) { + startBrowserTracingPageLoadSpan(client, { + name: _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location.pathname, + // pageload should always start at timeOrigin (and needs to be in s, not ms) + startTime: _sentry_core__WEBPACK_IMPORTED_MODULE_14__.browserPerformanceTimeOrigin ? _sentry_core__WEBPACK_IMPORTED_MODULE_14__.browserPerformanceTimeOrigin / 1000 : undefined, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser', + }, + }); + } + + if (instrumentNavigation) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_15__.addHistoryInstrumentationHandler)(({ to, from }) => { + /** + * This early return is there to account for some cases where a navigation transaction starts right after + * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't + * create an uneccessary navigation transaction. + * + * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also + * only be caused in certain development environments where the usage of a hot module reloader is causing + * errors. + */ + if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) { + startingUrl = undefined; + return; + } + + if (from !== to) { + startingUrl = undefined; + startBrowserTracingNavigationSpan(client, { + name: _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location.pathname, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser', + }, + }); + } + }); + } + } + + if (markBackgroundSpan) { + (0,_backgroundtab_js__WEBPACK_IMPORTED_MODULE_16__.registerBackgroundTabDetection)(); + } + + if (enableInteractions) { + registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute); + } + + if (enableInp) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_4__.registerInpInteractionListener)(); + } + + (0,_request_js__WEBPACK_IMPORTED_MODULE_1__.instrumentOutgoingRequests)(client, { + traceFetch, + traceXHR, + trackFetchStreamPerformance, + tracePropagationTargets: client.getOptions().tracePropagationTargets, + shouldCreateSpanForRequest, + enableHTTPTimings, + }); + }, + }; +}) ; + +/** + * Manually start a page load span. + * This will only do something if a browser tracing integration integration has been setup. + * + * If you provide a custom `traceOptions` object, it will be used to continue the trace + * instead of the default behavior, which is to look it up on the tags. + */ +function startBrowserTracingPageLoadSpan( + client, + spanOptions, + traceOptions, +) { + client.emit('startPageLoadSpan', spanOptions, traceOptions); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getCurrentScope)().setTransactionName(spanOptions.name); + + const span = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getActiveSpan)(); + const op = span && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanToJSON)(span).op; + return op === 'pageload' ? span : undefined; +} + +/** + * Manually start a navigation span. + * This will only do something if a browser tracing integration has been setup. + */ +function startBrowserTracingNavigationSpan(client, spanOptions) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getIsolationScope)().setPropagationContext((0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.generatePropagationContext)()); + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getCurrentScope)().setPropagationContext((0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.generatePropagationContext)()); + + client.emit('startNavigationSpan', spanOptions); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getCurrentScope)().setTransactionName(spanOptions.name); + + const span = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getActiveSpan)(); + const op = span && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanToJSON)(span).op; + return op === 'navigation' ? span : undefined; +} + +/** Returns the value of a meta tag */ +function getMetaContent(metaName) { + // Can't specify generic to `getDomElement` because tracing can be used + // in a variety of environments, have to disable `no-unsafe-member-access` + // as a result. + const metaTag = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_18__.getDomElement)(`meta[name=${metaName}]`); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return metaTag ? metaTag.getAttribute('content') : undefined; +} + +/** Start listener for interaction transactions */ +function registerInteractionListener( + idleTimeout, + finalTimeout, + childSpanTimeout, + latestRoute, +) { + let inflightInteractionSpan; + const registerInteractionTransaction = () => { + const op = 'ui.action.click'; + + const activeSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getActiveSpan)(); + const rootSpan = activeSpan && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.getRootSpan)(activeSpan); + if (rootSpan) { + const currentRootSpanOp = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.spanToJSON)(rootSpan).op; + if (['navigation', 'pageload'].includes(currentRootSpanOp )) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD && + _sentry_core__WEBPACK_IMPORTED_MODULE_10__.logger.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`); + return undefined; + } + } + + if (inflightInteractionSpan) { + inflightInteractionSpan.setAttribute(_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'interactionInterrupted'); + inflightInteractionSpan.end(); + inflightInteractionSpan = undefined; + } + + if (!latestRoute.name) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD && _sentry_core__WEBPACK_IMPORTED_MODULE_10__.logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); + return undefined; + } + + inflightInteractionSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.startIdleSpan)( + { + name: latestRoute.name, + op, + attributes: { + [_sentry_core__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url', + }, + }, + { + idleTimeout, + finalTimeout, + childSpanTimeout, + }, + ); + }; + + if (_helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.document) { + addEventListener('click', registerInteractionTransaction, { once: false, capture: true }); + } +} + + +//# sourceMappingURL=browserTracingIntegration.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/tracing/request.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/tracing/request.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ defaultRequestInstrumentationOptions: () => (/* binding */ defaultRequestInstrumentationOptions), +/* harmony export */ extractNetworkProtocol: () => (/* binding */ extractNetworkProtocol), +/* harmony export */ instrumentOutgoingRequests: () => (/* binding */ instrumentOutgoingRequests), +/* harmony export */ shouldAttachHeaders: () => (/* binding */ shouldAttachHeaders), +/* harmony export */ xhrCallback: () => (/* binding */ xhrCallback) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js"); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/fetch.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/url.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/trace.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils/traceData.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + + +/* eslint-disable max-lines */ + +/** Options for Request Instrumentation */ + +const responseToSpanId = new WeakMap(); +const spanIdToEndTimestamp = new Map(); + +const defaultRequestInstrumentationOptions = { + traceFetch: true, + traceXHR: true, + enableHTTPTimings: true, + trackFetchStreamPerformance: false, +}; + +/** Registers span creators for xhr and fetch requests */ +function instrumentOutgoingRequests(client, _options) { + const { + traceFetch, + traceXHR, + trackFetchStreamPerformance, + shouldCreateSpanForRequest, + enableHTTPTimings, + tracePropagationTargets, + } = { + traceFetch: defaultRequestInstrumentationOptions.traceFetch, + traceXHR: defaultRequestInstrumentationOptions.traceXHR, + trackFetchStreamPerformance: defaultRequestInstrumentationOptions.trackFetchStreamPerformance, + ..._options, + }; + + const shouldCreateSpan = + typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_) => true; + + const shouldAttachHeadersWithTargets = (url) => shouldAttachHeaders(url, tracePropagationTargets); + + const spans = {}; + + if (traceFetch) { + // Keeping track of http requests, whose body payloads resolved later than the initial resolved request + // e.g. streaming using server sent events (SSE) + client.addEventProcessor(event => { + if (event.type === 'transaction' && event.spans) { + event.spans.forEach(span => { + if (span.op === 'http.client') { + const updatedTimestamp = spanIdToEndTimestamp.get(span.span_id); + if (updatedTimestamp) { + span.timestamp = updatedTimestamp / 1000; + spanIdToEndTimestamp.delete(span.span_id); + } + } + }); + } + return event; + }); + + if (trackFetchStreamPerformance) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.addFetchEndInstrumentationHandler)(handlerData => { + if (handlerData.response) { + const span = responseToSpanId.get(handlerData.response); + if (span && handlerData.endTimestamp) { + spanIdToEndTimestamp.set(span, handlerData.endTimestamp); + } + } + }); + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.addFetchInstrumentationHandler)(handlerData => { + const createdSpan = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.instrumentFetchRequest)(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); + + if (handlerData.response && handlerData.fetchData.__span) { + responseToSpanId.set(handlerData.response, handlerData.fetchData.__span); + } + + // We cannot use `window.location` in the generic fetch instrumentation, + // but we need it for reliable `server.address` attribute. + // so we extend this in here + if (createdSpan) { + const fullUrl = getFullURL(handlerData.fetchData.url); + const host = fullUrl ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.parseUrl)(fullUrl).host : undefined; + createdSpan.setAttributes({ + 'http.url': fullUrl, + 'server.address': host, + }); + } + + if (enableHTTPTimings && createdSpan) { + addHTTPTimings(createdSpan); + } + }); + } + + if (traceXHR) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.addXhrInstrumentationHandler)(handlerData => { + const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); + if (enableHTTPTimings && createdSpan) { + addHTTPTimings(createdSpan); + } + }); + } +} + +function isPerformanceResourceTiming(entry) { + return ( + entry.entryType === 'resource' && + 'initiatorType' in entry && + typeof (entry ).nextHopProtocol === 'string' && + (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest') + ); +} + +/** + * Creates a temporary observer to listen to the next fetch/xhr resourcing timings, + * so that when timings hit their per-browser limit they don't need to be removed. + * + * @param span A span that has yet to be finished, must contain `url` on data. + */ +function addHTTPTimings(span) { + const { url } = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(span).data || {}; + + if (!url || typeof url !== 'string') { + return; + } + + const cleanup = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_5__.addPerformanceInstrumentationHandler)('resource', ({ entries }) => { + entries.forEach(entry => { + if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) { + const spanData = resourceTimingEntryToSpanData(entry); + spanData.forEach(data => span.setAttribute(...data)); + // In the next tick, clean this handler up + // We have to wait here because otherwise this cleans itself up before it is fully done + setTimeout(cleanup); + } + }); + }); +} + +/** + * Converts ALPN protocol ids to name and version. + * + * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids) + * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol + */ +function extractNetworkProtocol(nextHopProtocol) { + let name = 'unknown'; + let version = 'unknown'; + let _name = ''; + for (const char of nextHopProtocol) { + // http/1.1 etc. + if (char === '/') { + [name, version] = nextHopProtocol.split('/') ; + break; + } + // h2, h3 etc. + if (!isNaN(Number(char))) { + name = _name === 'h' ? 'http' : _name; + version = nextHopProtocol.split(_name)[1] ; + break; + } + _name += char; + } + if (_name === nextHopProtocol) { + // webrtc, ftp, etc. + name = _name; + } + return { name, version }; +} + +function getAbsoluteTime(time = 0) { + return ((_sentry_core__WEBPACK_IMPORTED_MODULE_6__.browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000; +} + +function resourceTimingEntryToSpanData(resourceTiming) { + const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol); + + const timingSpanData = []; + + timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]); + + if (!_sentry_core__WEBPACK_IMPORTED_MODULE_6__.browserPerformanceTimeOrigin) { + return timingSpanData; + } + return [ + ...timingSpanData, + ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)], + ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)], + ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)], + ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)], + ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)], + ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)], + ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)], + ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)], + ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)], + ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)], + ]; +} + +/** + * A function that determines whether to attach tracing headers to a request. + * We only export this function for testing purposes. + */ +function shouldAttachHeaders( + targetUrl, + tracePropagationTargets, +) { + // window.location.href not being defined is an edge case in the browser but we need to handle it. + // Potentially dangerous situations where it may not be defined: Browser Extensions, Web Workers, patching of the location obj + const href = _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location && _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location.href; + + if (!href) { + // If there is no window.location.origin, we default to only attaching tracing headers to relative requests, i.e. ones that start with `/` + // BIG DISCLAIMER: Users can call URLs with a double slash (fetch("//example.com/api")), this is a shorthand for "send to the same protocol", + // so we need a to exclude those requests, because they might be cross origin. + const isRelativeSameOriginRequest = !!targetUrl.match(/^\/(?!\/)/); + if (!tracePropagationTargets) { + return isRelativeSameOriginRequest; + } else { + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.stringMatchesSomePattern)(targetUrl, tracePropagationTargets); + } + } else { + let resolvedUrl; + let currentOrigin; + + // URL parsing may fail, we default to not attaching trace headers in that case. + try { + resolvedUrl = new URL(targetUrl, href); + currentOrigin = new URL(href).origin; + } catch (e) { + return false; + } + + const isSameOriginRequest = resolvedUrl.origin === currentOrigin; + if (!tracePropagationTargets) { + return isSameOriginRequest; + } else { + return ( + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.stringMatchesSomePattern)(resolvedUrl.toString(), tracePropagationTargets) || + (isSameOriginRequest && (0,_sentry_core__WEBPACK_IMPORTED_MODULE_8__.stringMatchesSomePattern)(resolvedUrl.pathname, tracePropagationTargets)) + ); + } + } +} + +/** + * Create and track xhr request spans + * + * @returns Span if a span was created, otherwise void. + */ +function xhrCallback( + handlerData, + shouldCreateSpan, + shouldAttachHeaders, + spans, +) { + const xhr = handlerData.xhr; + const sentryXhrData = xhr && xhr[_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_3__.SENTRY_XHR_DATA_KEY]; + + if (!xhr || xhr.__sentry_own_request__ || !sentryXhrData) { + return undefined; + } + + const shouldCreateSpanResult = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.hasTracingEnabled)() && shouldCreateSpan(sentryXhrData.url); + + // check first if the request has finished and is tracked by an existing span which should now end + if (handlerData.endTimestamp && shouldCreateSpanResult) { + const spanId = xhr.__sentry_xhr_span_id__; + if (!spanId) return; + + const span = spans[spanId]; + if (span && sentryXhrData.status_code !== undefined) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__.setHttpStatus)(span, sentryXhrData.status_code); + span.end(); + + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete spans[spanId]; + } + return undefined; + } + + const fullUrl = getFullURL(sentryXhrData.url); + const host = fullUrl ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.parseUrl)(fullUrl).host : undefined; + + const hasParent = !!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_4__.getActiveSpan)(); + + const span = + shouldCreateSpanResult && hasParent + ? (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.startInactiveSpan)({ + name: `${sentryXhrData.method} ${sentryXhrData.url}`, + attributes: { + type: 'xhr', + 'http.method': sentryXhrData.method, + 'http.url': fullUrl, + url: sentryXhrData.url, + 'server.address': host, + [_sentry_core__WEBPACK_IMPORTED_MODULE_12__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser', + [_sentry_core__WEBPACK_IMPORTED_MODULE_12__.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', + }, + }) + : new _sentry_core__WEBPACK_IMPORTED_MODULE_13__.SentryNonRecordingSpan(); + + xhr.__sentry_xhr_span_id__ = span.spanContext().spanId; + spans[xhr.__sentry_xhr_span_id__] = span; + + if (shouldAttachHeaders(sentryXhrData.url)) { + addTracingHeadersToXhrRequest( + xhr, + // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), + // we do not want to use the span as base for the trace headers, + // which means that the headers will be generated from the scope and the sampling decision is deferred + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__.hasTracingEnabled)() && hasParent ? span : undefined, + ); + } + + return span; +} + +function addTracingHeadersToXhrRequest(xhr, span) { + const { 'sentry-trace': sentryTrace, baggage } = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.getTraceData)({ span }); + + if (sentryTrace) { + setHeaderOnXhr(xhr, sentryTrace, baggage); + } +} + +function setHeaderOnXhr( + xhr, + sentryTraceHeader, + sentryBaggageHeader, +) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + xhr.setRequestHeader('sentry-trace', sentryTraceHeader); + if (sentryBaggageHeader) { + // From MDN: "If this method is called several times with the same header, the values are merged into one single request header." + // We can therefore simply set a baggage header without checking what was there before + // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + xhr.setRequestHeader('baggage', sentryBaggageHeader); + } + } catch (_) { + // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED. + } +} + +function getFullURL(url) { + try { + // By adding a base URL to new URL(), this will also work for relative urls + // If `url` is a full URL, the base URL is ignored anyhow + const parsed = new URL(url, _helpers_js__WEBPACK_IMPORTED_MODULE_7__.WINDOW.location.origin); + return parsed.href; + } catch (e2) { + return undefined; + } +} + + +//# sourceMappingURL=request.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/transports/fetch.js": +/*!****************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/transports/fetch.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ makeFetchTransport: () => (/* binding */ makeFetchTransport) +/* harmony export */ }); +/* harmony import */ var _sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry-internal/browser-utils */ "../../node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/transports/base.js"); + + + +/** + * Creates a Transport that uses the Fetch API to send events to Sentry. + */ +function makeFetchTransport( + options, + nativeFetch = (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_0__.getNativeImplementation)('fetch'), +) { + let pendingBodySize = 0; + let pendingCount = 0; + + function makeRequest(request) { + const requestSize = request.body.length; + pendingBodySize += requestSize; + pendingCount++; + + const requestOptions = { + body: request.body, + method: 'POST', + referrerPolicy: 'origin', + headers: options.headers, + // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to + // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)". + // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're + // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions). + // Gotchas: + // - `keepalive` isn't supported by Firefox + // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch): + // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error. + // We will therefore only activate the flag when we're below that limit. + // There is also a limit of requests that can be open at the same time, so we also limit this to 15 + // See https://github.com/getsentry/sentry-javascript/pull/7553 for details + keepalive: pendingBodySize <= 60000 && pendingCount < 15, + ...options.fetchOptions, + }; + + if (!nativeFetch) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_0__.clearCachedImplementation)('fetch'); + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.rejectedSyncPromise)('No fetch implementation available'); + } + + try { + // TODO: This may need a `suppressTracing` call in the future when we switch the browser SDK to OTEL + return nativeFetch(options.url, requestOptions).then(response => { + pendingBodySize -= requestSize; + pendingCount--; + return { + statusCode: response.status, + headers: { + 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), + 'retry-after': response.headers.get('Retry-After'), + }, + }; + }); + } catch (e) { + (0,_sentry_internal_browser_utils__WEBPACK_IMPORTED_MODULE_0__.clearCachedImplementation)('fetch'); + pendingBodySize -= requestSize; + pendingCount--; + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.rejectedSyncPromise)(e); + } + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.createTransport)(options, makeRequest); +} + + +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/transports/offline.js": +/*!******************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/transports/offline.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createStore: () => (/* binding */ createStore), +/* harmony export */ makeBrowserOfflineTransport: () => (/* binding */ makeBrowserOfflineTransport), +/* harmony export */ push: () => (/* binding */ push), +/* harmony export */ shift: () => (/* binding */ shift), +/* harmony export */ unshift: () => (/* binding */ unshift) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/transports/offline.js"); +/* harmony import */ var _fetch_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fetch.js */ "../../node_modules/@sentry/browser/build/npm/esm/transports/fetch.js"); + + + +// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being +// modified and simplified: https://github.com/jakearchibald/idb-keyval +// +// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca +// Original license: + +// Copyright 2016, Jake Archibald +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +function promisifyRequest(request) { + return new Promise((resolve, reject) => { + // @ts-expect-error - file size hacks + request.oncomplete = request.onsuccess = () => resolve(request.result); + // @ts-expect-error - file size hacks + request.onabort = request.onerror = () => reject(request.error); + }); +} + +/** Create or open an IndexedDb store */ +function createStore(dbName, storeName) { + const request = indexedDB.open(dbName); + request.onupgradeneeded = () => request.result.createObjectStore(storeName); + const dbp = promisifyRequest(request); + + return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName))); +} + +function keys(store) { + return promisifyRequest(store.getAllKeys() ); +} + +/** Insert into the end of the store */ +function push(store, value, maxQueueSize) { + return store(store => { + return keys(store).then(keys => { + if (keys.length >= maxQueueSize) { + return; + } + + // We insert with an incremented key so that the entries are popped in order + store.put(value, Math.max(...keys, 0) + 1); + return promisifyRequest(store.transaction); + }); + }); +} + +/** Insert into the front of the store */ +function unshift(store, value, maxQueueSize) { + return store(store => { + return keys(store).then(keys => { + if (keys.length >= maxQueueSize) { + return; + } + + // We insert with an decremented key so that the entries are popped in order + store.put(value, Math.min(...keys, 0) - 1); + return promisifyRequest(store.transaction); + }); + }); +} + +/** Pop the oldest value from the store */ +function shift(store) { + return store(store => { + return keys(store).then(keys => { + const firstKey = keys[0]; + if (firstKey == null) { + return undefined; + } + + return promisifyRequest(store.get(firstKey)).then(value => { + store.delete(firstKey); + return promisifyRequest(store.transaction).then(() => value); + }); + }); + }); +} + +function createIndexedDbStore(options) { + let store; + + // Lazily create the store only when it's needed + function getStore() { + if (store == undefined) { + store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue'); + } + + return store; + } + + return { + push: async (env) => { + try { + const serialized = await (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.serializeEnvelope)(env); + await push(getStore(), serialized, options.maxQueueSize || 30); + } catch (_) { + // + } + }, + unshift: async (env) => { + try { + const serialized = await (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.serializeEnvelope)(env); + await unshift(getStore(), serialized, options.maxQueueSize || 30); + } catch (_) { + // + } + }, + shift: async () => { + try { + const deserialized = await shift(getStore()); + if (deserialized) { + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.parseEnvelope)(deserialized); + } + } catch (_) { + // + } + + return undefined; + }, + }; +} + +function makeIndexedDbOfflineTransport( + createTransport, +) { + return options => createTransport({ ...options, createStore: createIndexedDbStore }); +} + +/** + * Creates a transport that uses IndexedDb to store events when offline. + */ +function makeBrowserOfflineTransport( + createTransport = _fetch_js__WEBPACK_IMPORTED_MODULE_1__.makeFetchTransport, +) { + return makeIndexedDbOfflineTransport((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.makeOfflineTransport)(createTransport)); +} + + +//# sourceMappingURL=offline.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/userfeedback.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/userfeedback.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createUserFeedbackEnvelope: () => (/* binding */ createUserFeedbackEnvelope) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); + + +/** + * Creates an envelope from a user feedback. + */ +function createUserFeedbackEnvelope( + feedback, + { + metadata, + tunnel, + dsn, + } + +, +) { + const headers = { + event_id: feedback.event_id, + sent_at: new Date().toISOString(), + ...(metadata && + metadata.sdk && { + sdk: { + name: metadata.sdk.name, + version: metadata.sdk.version, + }, + }), + ...(!!tunnel && !!dsn && { dsn: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.dsnToString)(dsn) }), + }; + const item = createUserFeedbackEnvelopeItem(feedback); + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(headers, [item]); +} + +function createUserFeedbackEnvelopeItem(feedback) { + const feedbackHeaders = { + type: 'user_report', + }; + return [feedbackHeaders, feedback]; +} + + +//# sourceMappingURL=userfeedback.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/browser/build/npm/esm/utils/lazyLoadIntegration.js": +/*!*************************************************************************************!*\ + !*** ../../node_modules/@sentry/browser/build/npm/esm/utils/lazyLoadIntegration.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ lazyLoadIntegration: () => (/* binding */ lazyLoadIntegration) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "../../node_modules/@sentry/core/build/esm/utils-hoist/version.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers.js */ "../../node_modules/@sentry/browser/build/npm/esm/helpers.js"); + + + +// This is a map of integration function method to bundle file name. +const LazyLoadableIntegrations = { + replayIntegration: 'replay', + replayCanvasIntegration: 'replay-canvas', + feedbackIntegration: 'feedback', + feedbackModalIntegration: 'feedback-modal', + feedbackScreenshotIntegration: 'feedback-screenshot', + captureConsoleIntegration: 'captureconsole', + contextLinesIntegration: 'contextlines', + linkedErrorsIntegration: 'linkederrors', + debugIntegration: 'debug', + dedupeIntegration: 'dedupe', + extraErrorDataIntegration: 'extraerrordata', + httpClientIntegration: 'httpclient', + reportingObserverIntegration: 'reportingobserver', + rewriteFramesIntegration: 'rewriteframes', + sessionTimingIntegration: 'sessiontiming', + browserProfilingIntegration: 'browserprofiling', + moduleMetadataIntegration: 'modulemetadata', +} ; + +const WindowWithMaybeIntegration = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW + +; + +/** + * Lazy load an integration from the CDN. + * Rejects if the integration cannot be loaded. + */ +async function lazyLoadIntegration( + name, + scriptNonce, +) { + const bundle = LazyLoadableIntegrations[name]; + + // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package + const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {}); + + if (!bundle) { + throw new Error(`Cannot lazy load integration: ${name}`); + } + + // Bail if the integration already exists + const existing = sentryOnWindow[name]; + // The `feedbackIntegration` is loaded by default in the CDN bundles, + // so we need to differentiate between the real integration and the shim. + // if only the shim exists, we still want to lazy load the real integration. + if (typeof existing === 'function' && !('_isShim' in existing)) { + return existing; + } + + const url = getScriptURL(bundle); + const script = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.createElement('script'); + script.src = url; + script.crossOrigin = 'anonymous'; + script.referrerPolicy = 'origin'; + + if (scriptNonce) { + script.setAttribute('nonce', scriptNonce); + } + + const waitForLoad = new Promise((resolve, reject) => { + script.addEventListener('load', () => resolve()); + script.addEventListener('error', reject); + }); + + const currentScript = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.currentScript; + const parent = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.body || _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document.head || (currentScript && currentScript.parentElement); + + if (parent) { + parent.appendChild(script); + } else { + throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`); + } + + try { + await waitForLoad; + } catch (e) { + throw new Error(`Error when loading integration: ${name}`); + } + + const integrationFn = sentryOnWindow[name]; + + if (typeof integrationFn !== 'function') { + throw new Error(`Could not load integration: ${name}`); + } + + return integrationFn; +} + +function getScriptURL(bundle) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getClient)(); + const options = client && client.getOptions(); + const baseURL = (options && options.cdnBaseUrl) || 'https://browser.sentry-cdn.com'; + + return new URL(`/${_sentry_core__WEBPACK_IMPORTED_MODULE_2__.SDK_VERSION}/${bundle}.min.js`, baseURL).toString(); +} + + +//# sourceMappingURL=lazyLoadIntegration.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/api.js": +/*!********************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/api.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getEnvelopeEndpointWithUrlEncodedAuth: () => (/* binding */ getEnvelopeEndpointWithUrlEncodedAuth), +/* harmony export */ getReportDialogEndpoint: () => (/* binding */ getReportDialogEndpoint) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/dsn.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); + + +const SENTRY_API_VERSION = '7'; + +/** Returns the prefix to construct Sentry ingestion API endpoints. */ +function getBaseApiEndpoint(dsn) { + const protocol = dsn.protocol ? `${dsn.protocol}:` : ''; + const port = dsn.port ? `:${dsn.port}` : ''; + return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`; +} + +/** Returns the ingest API endpoint for target. */ +function _getIngestEndpoint(dsn) { + return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; +} + +/** Returns a URL-encoded string with auth config suitable for a query string. */ +function _encodedAuth(dsn, sdkInfo) { + const params = { + sentry_version: SENTRY_API_VERSION, + }; + + if (dsn.publicKey) { + // We send only the minimum set of required information. See + // https://github.com/getsentry/sentry-javascript/issues/2572. + params.sentry_key = dsn.publicKey; + } + + if (sdkInfo) { + params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; + } + + return new URLSearchParams(params).toString(); +} + +/** + * Returns the envelope endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ +function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { + return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; +} + +/** Returns the url to the report dialog endpoint. */ +function getReportDialogEndpoint( + dsnLike, + dialogOptions + +, +) { + const dsn = (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_0__.makeDsn)(dsnLike); + if (!dsn) { + return ''; + } + + const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`; + + let encodedOptions = `dsn=${(0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_0__.dsnToString)(dsn)}`; + for (const key in dialogOptions) { + if (key === 'dsn') { + continue; + } + + if (key === 'onClose') { + continue; + } + + if (key === 'user') { + const user = dialogOptions.user; + if (!user) { + continue; + } + if (user.name) { + encodedOptions += `&name=${encodeURIComponent(user.name)}`; + } + if (user.email) { + encodedOptions += `&email=${encodeURIComponent(user.email)}`; + } + } else { + encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`; + } + } + + return `${endpoint}?${encodedOptions}`; +} + + +//# sourceMappingURL=api.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/asyncContext/index.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/asyncContext/index.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getAsyncContextStrategy: () => (/* binding */ getAsyncContextStrategy), +/* harmony export */ setAsyncContextStrategy: () => (/* binding */ setAsyncContextStrategy) +/* harmony export */ }); +/* harmony import */ var _carrier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../carrier.js */ "../../node_modules/@sentry/core/build/esm/carrier.js"); +/* harmony import */ var _stackStrategy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stackStrategy.js */ "../../node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js"); + + + +/** + * @private Private API with no semver guarantees! + * + * Sets the global async context strategy + */ +function setAsyncContextStrategy(strategy) { + // Get main carrier (global for every environment) + const registry = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getMainCarrier)(); + const sentry = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getSentryCarrier)(registry); + sentry.acs = strategy; +} + +/** + * Get the current async context strategy. + * If none has been setup, the default will be used. + */ +function getAsyncContextStrategy(carrier) { + const sentry = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getSentryCarrier)(carrier); + + if (sentry.acs) { + return sentry.acs; + } + + // Otherwise, use the default one (stack) + return (0,_stackStrategy_js__WEBPACK_IMPORTED_MODULE_1__.getStackAsyncContextStrategy)(); +} + + +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js": +/*!*******************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AsyncContextStack: () => (/* binding */ AsyncContextStack), +/* harmony export */ getStackAsyncContextStrategy: () => (/* binding */ getStackAsyncContextStrategy) +/* harmony export */ }); +/* harmony import */ var _defaultScopes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../defaultScopes.js */ "../../node_modules/@sentry/core/build/esm/defaultScopes.js"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scope.js */ "../../node_modules/@sentry/core/build/esm/scope.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _carrier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../carrier.js */ "../../node_modules/@sentry/core/build/esm/carrier.js"); + + + + + + + + + + +/** + * This is an object that holds a stack of scopes. + */ +class AsyncContextStack { + + constructor(scope, isolationScope) { + let assignedScope; + if (!scope) { + assignedScope = new _scope_js__WEBPACK_IMPORTED_MODULE_0__.Scope(); + } else { + assignedScope = scope; + } + + let assignedIsolationScope; + if (!isolationScope) { + assignedIsolationScope = new _scope_js__WEBPACK_IMPORTED_MODULE_0__.Scope(); + } else { + assignedIsolationScope = isolationScope; + } + + // scope stack for domains or the process + this._stack = [{ scope: assignedScope }]; + this._isolationScope = assignedIsolationScope; + } + + /** + * Fork a scope for the stack. + */ + withScope(callback) { + const scope = this._pushScope(); + + let maybePromiseResult; + try { + maybePromiseResult = callback(scope); + } catch (e) { + this._popScope(); + throw e; + } + + if ((0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__.isThenable)(maybePromiseResult)) { + // @ts-expect-error - isThenable returns the wrong type + return maybePromiseResult.then( + res => { + this._popScope(); + return res; + }, + e => { + this._popScope(); + throw e; + }, + ); + } + + this._popScope(); + return maybePromiseResult; + } + + /** + * Get the client of the stack. + */ + getClient() { + return this.getStackTop().client ; + } + + /** + * Returns the scope of the top stack. + */ + getScope() { + return this.getStackTop().scope; + } + + /** + * Get the isolation scope for the stack. + */ + getIsolationScope() { + return this._isolationScope; + } + + /** + * Returns the topmost scope layer in the order domain > local > process. + */ + getStackTop() { + return this._stack[this._stack.length - 1] ; + } + + /** + * Push a scope to the stack. + */ + _pushScope() { + // We want to clone the content of prev scope + const scope = this.getScope().clone(); + this._stack.push({ + client: this.getClient(), + scope, + }); + return scope; + } + + /** + * Pop a scope from the stack. + */ + _popScope() { + if (this._stack.length <= 1) return false; + return !!this._stack.pop(); + } +} + +/** + * Get the global async context stack. + * This will be removed during the v8 cycle and is only here to make migration easier. + */ +function getAsyncContextStack() { + const registry = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_2__.getMainCarrier)(); + const sentry = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_2__.getSentryCarrier)(registry); + + return (sentry.stack = sentry.stack || new AsyncContextStack((0,_defaultScopes_js__WEBPACK_IMPORTED_MODULE_3__.getDefaultCurrentScope)(), (0,_defaultScopes_js__WEBPACK_IMPORTED_MODULE_3__.getDefaultIsolationScope)())); +} + +function withScope(callback) { + return getAsyncContextStack().withScope(callback); +} + +function withSetScope(scope, callback) { + const stack = getAsyncContextStack() ; + return stack.withScope(() => { + stack.getStackTop().scope = scope; + return callback(scope); + }); +} + +function withIsolationScope(callback) { + return getAsyncContextStack().withScope(() => { + return callback(getAsyncContextStack().getIsolationScope()); + }); +} + +/** + * Get the stack-based async context strategy. + */ +function getStackAsyncContextStrategy() { + return { + withIsolationScope, + withScope, + withSetScope, + withSetIsolationScope: (_isolationScope, callback) => { + return withIsolationScope(callback); + }, + getCurrentScope: () => getAsyncContextStack().getScope(), + getIsolationScope: () => getAsyncContextStack().getIsolationScope(), + }; +} + + +//# sourceMappingURL=stackStrategy.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/baseclient.js": +/*!***************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/baseclient.js ***! + \***************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BaseClient: () => (/* binding */ BaseClient) +/* harmony export */ }); +/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./api.js */ "../../node_modules/@sentry/core/build/esm/api.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./envelope.js */ "../../node_modules/@sentry/core/build/esm/envelope.js"); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./session.js */ "../../node_modules/@sentry/core/build/esm/session.js"); +/* harmony import */ var _tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./tracing/dynamicSamplingContext.js */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _utils_hoist_clientreport_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils-hoist/clientreport.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/clientreport.js"); +/* harmony import */ var _utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/dsn.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils-hoist/error.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/error.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils-hoist/syncpromise.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js"); +/* harmony import */ var _utils_parseSampleRate_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/parseSampleRate.js */ "../../node_modules/@sentry/core/build/esm/utils/parseSampleRate.js"); +/* harmony import */ var _utils_prepareEvent_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/prepareEvent.js */ "../../node_modules/@sentry/core/build/esm/utils/prepareEvent.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + + + + + + + + + + + + + + + + + +const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; + +/** + * Base implementation for all JavaScript SDK clients. + * + * Call the constructor with the corresponding options + * specific to the client subclass. To access these options later, use + * {@link Client.getOptions}. + * + * If a Dsn is specified in the options, it will be parsed and stored. Use + * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is + * invalid, the constructor will throw a {@link SentryException}. Note that + * without a valid Dsn, the SDK will not send any events to Sentry. + * + * Before sending an event, it is passed through + * {@link BaseClient._prepareEvent} to add SDK information and scope data + * (breadcrumbs and context). To add more custom information, override this + * method and extend the resulting prepared event. + * + * To issue automatically created events (e.g. via instrumentation), use + * {@link Client.captureEvent}. It will prepare the event and pass it through + * the callback lifecycle. To issue auto-breadcrumbs, use + * {@link Client.addBreadcrumb}. + * + * @example + * class NodeClient extends BaseClient { + * public constructor(options: NodeOptions) { + * super(options); + * } + * + * // ... + * } + */ +class BaseClient { + /** Options passed to the SDK. */ + + /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ + + /** Array of set up integrations. */ + + /** Number of calls being processed */ + + /** Holds flushable */ + + // eslint-disable-next-line @typescript-eslint/ban-types + + /** + * Initializes this client instance. + * + * @param options Options for the client. + */ + constructor(options) { + this._options = options; + this._integrations = {}; + this._numProcessing = 0; + this._outcomes = {}; + this._hooks = {}; + this._eventProcessors = []; + + if (options.dsn) { + this._dsn = (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_0__.makeDsn)(options.dsn); + } else { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn('No DSN provided, client will not send events.'); + } + + if (this._dsn) { + const url = (0,_api_js__WEBPACK_IMPORTED_MODULE_3__.getEnvelopeEndpointWithUrlEncodedAuth)( + this._dsn, + options.tunnel, + options._metadata ? options._metadata.sdk : undefined, + ); + this._transport = options.transport({ + tunnel: this._options.tunnel, + recordDroppedEvent: this.recordDroppedEvent.bind(this), + ...options.transportOptions, + url, + }); + } + + // TODO(v9): Remove this deprecation warning + const tracingOptions = ['enableTracing', 'tracesSampleRate', 'tracesSampler'] ; + const undefinedOption = tracingOptions.find(option => option in options && options[option] == undefined); + if (undefinedOption) { + (0,_utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.consoleSandbox)(() => { + // eslint-disable-next-line no-console + console.warn( + `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`, + ); + }); + } + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + captureException(exception, hint, scope) { + const eventId = (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__.uuid4)(); + + // ensure we haven't captured this very object before + if ((0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__.checkOrSetAlreadyCaught)(exception)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(ALREADY_SEEN_ERROR); + return eventId; + } + + const hintWithEventId = { + event_id: eventId, + ...hint, + }; + + this._process( + this.eventFromException(exception, hintWithEventId).then(event => + this._captureEvent(event, hintWithEventId, scope), + ), + ); + + return hintWithEventId.event_id; + } + + /** + * @inheritDoc + */ + captureMessage( + message, + level, + hint, + currentScope, + ) { + const hintWithEventId = { + event_id: (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__.uuid4)(), + ...hint, + }; + + const eventMessage = (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_5__.isParameterizedString)(message) ? message : String(message); + + const promisedEvent = (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_5__.isPrimitive)(message) + ? this.eventFromMessage(eventMessage, level, hintWithEventId) + : this.eventFromException(message, hintWithEventId); + + this._process(promisedEvent.then(event => this._captureEvent(event, hintWithEventId, currentScope))); + + return hintWithEventId.event_id; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint, currentScope) { + const eventId = (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__.uuid4)(); + + // ensure we haven't captured this very object before + if (hint && hint.originalException && (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__.checkOrSetAlreadyCaught)(hint.originalException)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(ALREADY_SEEN_ERROR); + return eventId; + } + + const hintWithEventId = { + event_id: eventId, + ...hint, + }; + + const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; + const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; + + this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope)); + + return hintWithEventId.event_id; + } + + /** + * @inheritDoc + */ + captureSession(session) { + if (!(typeof session.release === 'string')) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn('Discarded session because of missing or non-string release'); + } else { + this.sendSession(session); + // After sending, we set init false to indicate it's not the first occurrence + (0,_session_js__WEBPACK_IMPORTED_MODULE_6__.updateSession)(session, { init: false }); + } + } + + /** + * @inheritDoc + */ + getDsn() { + return this._dsn; + } + + /** + * @inheritDoc + */ + getOptions() { + return this._options; + } + + /** + * @see SdkMetadata in @sentry/types + * + * @return The metadata of the SDK + */ + getSdkMetadata() { + return this._options._metadata; + } + + /** + * @inheritDoc + */ + getTransport() { + return this._transport; + } + + /** + * @inheritDoc + */ + flush(timeout) { + const transport = this._transport; + if (transport) { + this.emit('flush'); + return this._isClientDoneProcessing(timeout).then(clientFinished => { + return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed); + }); + } else { + return (0,_utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_7__.resolvedSyncPromise)(true); + } + } + + /** + * @inheritDoc + */ + close(timeout) { + return this.flush(timeout).then(result => { + this.getOptions().enabled = false; + this.emit('close'); + return result; + }); + } + + /** Get all installed event processors. */ + getEventProcessors() { + return this._eventProcessors; + } + + /** @inheritDoc */ + addEventProcessor(eventProcessor) { + this._eventProcessors.push(eventProcessor); + } + + /** @inheritdoc */ + init() { + if ( + this._isEnabled() || + // Force integrations to be setup even if no DSN was set when we have + // Spotlight enabled. This is particularly important for browser as we + // don't support the `spotlight` option there and rely on the users + // adding the `spotlightBrowserIntegration()` to their integrations which + // wouldn't get initialized with the check below when there's no DSN set. + this._options.integrations.some(({ name }) => name.startsWith('Spotlight')) + ) { + this._setupIntegrations(); + } + } + + /** + * Gets an installed integration by its name. + * + * @returns The installed integration or `undefined` if no integration with that `name` was installed. + */ + getIntegrationByName(integrationName) { + return this._integrations[integrationName] ; + } + + /** + * @inheritDoc + */ + addIntegration(integration) { + const isAlreadyInstalled = this._integrations[integration.name]; + + // This hook takes care of only installing if not already installed + (0,_integration_js__WEBPACK_IMPORTED_MODULE_8__.setupIntegration)(this, integration, this._integrations); + // Here we need to check manually to make sure to not run this multiple times + if (!isAlreadyInstalled) { + (0,_integration_js__WEBPACK_IMPORTED_MODULE_8__.afterSetupIntegrations)(this, [integration]); + } + } + + /** + * @inheritDoc + */ + sendEvent(event, hint = {}) { + this.emit('beforeSendEvent', event, hint); + + let env = (0,_envelope_js__WEBPACK_IMPORTED_MODULE_9__.createEventEnvelope)(event, this._dsn, this._options._metadata, this._options.tunnel); + + for (const attachment of hint.attachments || []) { + env = (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_10__.addItemToEnvelope)(env, (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_10__.createAttachmentEnvelopeItem)(attachment)); + } + + const promise = this.sendEnvelope(env); + if (promise) { + promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null); + } + } + + /** + * @inheritDoc + */ + sendSession(session) { + const env = (0,_envelope_js__WEBPACK_IMPORTED_MODULE_9__.createSessionEnvelope)(session, this._dsn, this._options._metadata, this._options.tunnel); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.sendEnvelope(env); + } + + /** + * @inheritDoc + */ + recordDroppedEvent(reason, category, eventOrCount) { + if (this._options.sendClientReports) { + // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload + // If event is passed as third argument, we assume this is a count of 1 + const count = typeof eventOrCount === 'number' ? eventOrCount : 1; + + // We want to track each category (error, transaction, session, replay_event) separately + // but still keep the distinction between different type of outcomes. + // We could use nested maps, but it's much easier to read and type this way. + // A correct type for map-based implementation if we want to go that route + // would be `Partial>>>` + // With typescript 4.1 we could even use template literal types + const key = `${reason}:${category}`; + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ''}`); + this._outcomes[key] = (this._outcomes[key] || 0) + count; + } + } + + // Keep on() & emit() signatures in sync with types' client.ts interface + /* eslint-disable @typescript-eslint/unified-signatures */ + + /** @inheritdoc */ + + /** @inheritdoc */ + on(hook, callback) { + const hooks = (this._hooks[hook] = this._hooks[hook] || []); + + // @ts-expect-error We assume the types are correct + hooks.push(callback); + + // This function returns a callback execution handler that, when invoked, + // deregisters a callback. This is crucial for managing instances where callbacks + // need to be unregistered to prevent self-referencing in callback closures, + // ensuring proper garbage collection. + return () => { + // @ts-expect-error We assume the types are correct + const cbIndex = hooks.indexOf(callback); + if (cbIndex > -1) { + hooks.splice(cbIndex, 1); + } + }; + } + + /** @inheritdoc */ + + /** @inheritdoc */ + emit(hook, ...rest) { + const callbacks = this._hooks[hook]; + if (callbacks) { + callbacks.forEach(callback => callback(...rest)); + } + } + + /** + * @inheritdoc + */ + sendEnvelope(envelope) { + this.emit('beforeEnvelope', envelope); + + if (this._isEnabled() && this._transport) { + return this._transport.send(envelope).then(null, reason => { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.error('Error while sending envelope:', reason); + return reason; + }); + } + + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.error('Transport disabled'); + + return (0,_utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_7__.resolvedSyncPromise)({}); + } + + /* eslint-enable @typescript-eslint/unified-signatures */ + + /** Setup integrations for this client. */ + _setupIntegrations() { + const { integrations } = this._options; + this._integrations = (0,_integration_js__WEBPACK_IMPORTED_MODULE_8__.setupIntegrations)(this, integrations); + (0,_integration_js__WEBPACK_IMPORTED_MODULE_8__.afterSetupIntegrations)(this, integrations); + } + + /** Updates existing session based on the provided event */ + _updateSessionFromEvent(session, event) { + let crashed = false; + let errored = false; + const exceptions = event.exception && event.exception.values; + + if (exceptions) { + errored = true; + + for (const ex of exceptions) { + const mechanism = ex.mechanism; + if (mechanism && mechanism.handled === false) { + crashed = true; + break; + } + } + } + + // A session is updated and that session update is sent in only one of the two following scenarios: + // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update + // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update + const sessionNonTerminal = session.status === 'ok'; + const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed); + + if (shouldUpdateAndSend) { + (0,_session_js__WEBPACK_IMPORTED_MODULE_6__.updateSession)(session, { + ...(crashed && { status: 'crashed' }), + errors: session.errors || Number(errored || crashed), + }); + this.captureSession(session); + } + } + + /** + * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying + * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not + * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to + * `true`. + * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and + * `false` otherwise + */ + _isClientDoneProcessing(timeout) { + return new _utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_7__.SyncPromise(resolve => { + let ticked = 0; + const tick = 1; + + const interval = setInterval(() => { + if (this._numProcessing == 0) { + clearInterval(interval); + resolve(true); + } else { + ticked += tick; + if (timeout && ticked >= timeout) { + clearInterval(interval); + resolve(false); + } + } + }, tick); + }); + } + + /** Determines whether this SDK is enabled and a transport is present. */ + _isEnabled() { + return this.getOptions().enabled !== false && this._transport !== undefined; + } + + /** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param currentScope A scope containing event metadata. + * @returns A new event with more information. + */ + _prepareEvent( + event, + hint, + currentScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_11__.getCurrentScope)(), + isolationScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_11__.getIsolationScope)(), + ) { + const options = this.getOptions(); + const integrations = Object.keys(this._integrations); + if (!hint.integrations && integrations.length > 0) { + hint.integrations = integrations; + } + + this.emit('preprocessEvent', event, hint); + + if (!event.type) { + isolationScope.setLastEventId(event.event_id || hint.event_id); + } + + return (0,_utils_prepareEvent_js__WEBPACK_IMPORTED_MODULE_12__.prepareEvent)(options, event, hint, currentScope, this, isolationScope).then(evt => { + if (evt === null) { + return evt; + } + + evt.contexts = { + trace: (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_11__.getTraceContextFromScope)(currentScope), + ...evt.contexts, + }; + + const dynamicSamplingContext = (0,_tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_13__.getDynamicSamplingContextFromScope)(this, currentScope); + + evt.sdkProcessingMetadata = { + dynamicSamplingContext, + ...evt.sdkProcessingMetadata, + }; + + return evt; + }); + } + + /** + * Processes the event and logs an error in case of rejection + * @param event + * @param hint + * @param scope + */ + _captureEvent(event, hint = {}, scope) { + return this._processEvent(event, hint, scope).then( + finalEvent => { + return finalEvent.event_id; + }, + reason => { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for + // control flow, log just the message (no stack) as a log-level log. + const sentryError = reason ; + if (sentryError.logLevel === 'log') { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(sentryError.message); + } else { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn(sentryError); + } + } + return undefined; + }, + ); + } + + /** + * Processes an event (either error or message) and sends it to Sentry. + * + * This also adds breadcrumbs and context information to the event. However, + * platform specific meta data (such as the User's IP address) must be added + * by the SDK implementor. + * + * + * @param event The event to send to Sentry. + * @param hint May contain additional information about the original exception. + * @param currentScope A scope containing event metadata. + * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. + */ + _processEvent(event, hint, currentScope) { + const options = this.getOptions(); + const { sampleRate } = options; + + const isTransaction = isTransactionEvent(event); + const isError = isErrorEvent(event); + const eventType = event.type || 'error'; + const beforeSendLabel = `before send for type \`${eventType}\``; + + // 1.0 === 100% events are sent + // 0.0 === 0% events are sent + // Sampling for transaction happens somewhere else + const parsedSampleRate = typeof sampleRate === 'undefined' ? undefined : (0,_utils_parseSampleRate_js__WEBPACK_IMPORTED_MODULE_14__.parseSampleRate)(sampleRate); + if (isError && typeof parsedSampleRate === 'number' && Math.random() > parsedSampleRate) { + this.recordDroppedEvent('sample_rate', 'error', event); + return (0,_utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_7__.rejectedSyncPromise)( + new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError( + `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, + 'log', + ), + ); + } + + const dataCategory = eventType === 'replay_event' ? 'replay' : eventType; + + const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; + const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; + + return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope) + .then(prepared => { + if (prepared === null) { + this.recordDroppedEvent('event_processor', dataCategory, event); + throw new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError('An event processor returned `null`, will not send event.', 'log'); + } + + const isInternalException = hint.data && (hint.data ).__sentry__ === true; + if (isInternalException) { + return prepared; + } + + const result = processBeforeSend(this, options, prepared, hint); + return _validateBeforeSendResult(result, beforeSendLabel); + }) + .then(processedEvent => { + if (processedEvent === null) { + this.recordDroppedEvent('before_send', dataCategory, event); + if (isTransaction) { + const spans = event.spans || []; + // the transaction itself counts as one span, plus all the child spans that are added + const spanCount = 1 + spans.length; + this.recordDroppedEvent('before_send', 'span', spanCount); + } + throw new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); + } + + const session = currentScope && currentScope.getSession(); + if (!isTransaction && session) { + this._updateSessionFromEvent(session, processedEvent); + } + + if (isTransaction) { + const spanCountBefore = + (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) || + 0; + const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; + + const droppedSpanCount = spanCountBefore - spanCountAfter; + if (droppedSpanCount > 0) { + this.recordDroppedEvent('before_send', 'span', droppedSpanCount); + } + } + + // None of the Sentry built event processor will update transaction name, + // so if the transaction name has been changed by an event processor, we know + // it has to come from custom event processor added by a user + const transactionInfo = processedEvent.transaction_info; + if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { + const source = 'custom'; + processedEvent.transaction_info = { + ...transactionInfo, + source, + }; + } + + this.sendEvent(processedEvent, hint); + return processedEvent; + }) + .then(null, reason => { + if (reason instanceof _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError) { + throw reason; + } + + this.captureException(reason, { + data: { + __sentry__: true, + }, + originalException: reason, + }); + throw new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError( + `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`, + ); + }); + } + + /** + * Occupies the client with processing and event + */ + _process(promise) { + this._numProcessing++; + void promise.then( + value => { + this._numProcessing--; + return value; + }, + reason => { + this._numProcessing--; + return reason; + }, + ); + } + + /** + * Clears outcomes on this client and returns them. + */ + _clearOutcomes() { + const outcomes = this._outcomes; + this._outcomes = {}; + return Object.entries(outcomes).map(([key, quantity]) => { + const [reason, category] = key.split(':') ; + return { + reason, + category, + quantity, + }; + }); + } + + /** + * Sends client reports as an envelope. + */ + _flushOutcomes() { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log('Flushing outcomes...'); + + const outcomes = this._clearOutcomes(); + + if (outcomes.length === 0) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log('No outcomes to send'); + return; + } + + // This is really the only place where we want to check for a DSN and only send outcomes then + if (!this._dsn) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log('No dsn provided, will not send outcomes'); + return; + } + + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log('Sending outcomes:', outcomes); + + const envelope = (0,_utils_hoist_clientreport_js__WEBPACK_IMPORTED_MODULE_16__.createClientReportEnvelope)(outcomes, this._options.tunnel && (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_0__.dsnToString)(this._dsn)); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.sendEnvelope(envelope); + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + +} + +/** + * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. + */ +function _validateBeforeSendResult( + beforeSendResult, + beforeSendLabel, +) { + const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; + if ((0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_5__.isThenable)(beforeSendResult)) { + return beforeSendResult.then( + event => { + if (!(0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_5__.isPlainObject)(event) && event !== null) { + throw new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError(invalidValueError); + } + return event; + }, + e => { + throw new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError(`${beforeSendLabel} rejected with ${e}`); + }, + ); + } else if (!(0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_5__.isPlainObject)(beforeSendResult) && beforeSendResult !== null) { + throw new _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_15__.SentryError(invalidValueError); + } + return beforeSendResult; +} + +/** + * Process the matching `beforeSendXXX` callback. + */ +function processBeforeSend( + client, + options, + event, + hint, +) { + const { beforeSend, beforeSendTransaction, beforeSendSpan } = options; + + if (isErrorEvent(event) && beforeSend) { + return beforeSend(event, hint); + } + + if (isTransactionEvent(event)) { + if (event.spans && beforeSendSpan) { + const processedSpans = []; + for (const span of event.spans) { + const processedSpan = beforeSendSpan(span); + if (processedSpan) { + processedSpans.push(processedSpan); + } else { + (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_17__.showSpanDropWarning)(); + client.recordDroppedEvent('before_send', 'span'); + } + } + event.spans = processedSpans; + } + + if (beforeSendTransaction) { + if (event.spans) { + // We store the # of spans before processing in SDK metadata, + // so we can compare it afterwards to determine how many spans were dropped + const spanCountBefore = event.spans.length; + event.sdkProcessingMetadata = { + ...event.sdkProcessingMetadata, + spanCountBeforeProcessing: spanCountBefore, + }; + } + return beforeSendTransaction(event, hint); + } + } + + return event; +} + +function isErrorEvent(event) { + return event.type === undefined; +} + +function isTransactionEvent(event) { + return event.type === 'transaction'; +} + + +//# sourceMappingURL=baseclient.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/breadcrumbs.js": +/*!****************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/breadcrumbs.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addBreadcrumb: () => (/* binding */ addBreadcrumb) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); + + + + +/** + * Default maximum number of breadcrumbs added to an event. Can be overwritten + * with {@link Options.maxBreadcrumbs}. + */ +const DEFAULT_BREADCRUMBS = 100; + +/** + * Records a new breadcrumb which will be attached to future events. + * + * Breadcrumbs will be added to subsequent events to provide more context on + * user's actions prior to an error or crash. + */ +function addBreadcrumb(breadcrumb, hint) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + const isolationScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)(); + + if (!client) return; + + const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions(); + + if (maxBreadcrumbs <= 0) return; + + const timestamp = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__.dateTimestampInSeconds)(); + const mergedBreadcrumb = { timestamp, ...breadcrumb }; + const finalBreadcrumb = beforeBreadcrumb + ? ((0,_utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.consoleSandbox)(() => beforeBreadcrumb(mergedBreadcrumb, hint)) ) + : mergedBreadcrumb; + + if (finalBreadcrumb === null) return; + + if (client.emit) { + client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint); + } + + isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); +} + + +//# sourceMappingURL=breadcrumbs.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/carrier.js": +/*!************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/carrier.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getMainCarrier: () => (/* binding */ getMainCarrier), +/* harmony export */ getSentryCarrier: () => (/* binding */ getSentryCarrier) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/version.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/version.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + +/** + * An object that contains globally accessible properties and maintains a scope stack. + * @hidden + */ + +/** + * Returns the global shim registry. + * + * FIXME: This function is problematic, because despite always returning a valid Carrier, + * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check + * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there. + **/ +function getMainCarrier() { + // This ensures a Sentry carrier exists + getSentryCarrier(_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ); + return _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ; +} + +/** Will either get the existing sentry carrier, or create a new one. */ +function getSentryCarrier(carrier) { + const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {}); + + // For now: First SDK that sets the .version property wins + __SENTRY__.version = __SENTRY__.version || _utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION; + + // Intentionally populating and returning the version of "this" SDK instance + // rather than what's set in .version so that "this" SDK always gets its carrier + return (__SENTRY__[_utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION] = __SENTRY__[_utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION] || {}); +} + + +//# sourceMappingURL=carrier.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/constants.js": +/*!**************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/constants.js ***! + \**************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_ENVIRONMENT: () => (/* binding */ DEFAULT_ENVIRONMENT) +/* harmony export */ }); +const DEFAULT_ENVIRONMENT = 'production'; + + +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/currentScopes.js": +/*!******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/currentScopes.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getClient: () => (/* binding */ getClient), +/* harmony export */ getCurrentScope: () => (/* binding */ getCurrentScope), +/* harmony export */ getGlobalScope: () => (/* binding */ getGlobalScope), +/* harmony export */ getIsolationScope: () => (/* binding */ getIsolationScope), +/* harmony export */ getTraceContextFromScope: () => (/* binding */ getTraceContextFromScope), +/* harmony export */ withIsolationScope: () => (/* binding */ withIsolationScope), +/* harmony export */ withScope: () => (/* binding */ withScope) +/* harmony export */ }); +/* harmony import */ var _asyncContext_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./asyncContext/index.js */ "../../node_modules/@sentry/core/build/esm/asyncContext/index.js"); +/* harmony import */ var _carrier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./carrier.js */ "../../node_modules/@sentry/core/build/esm/carrier.js"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scope.js */ "../../node_modules/@sentry/core/build/esm/scope.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + + + + +/** + * Get the currently active scope. + */ +function getCurrentScope() { + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getMainCarrier)(); + const acs = (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_1__.getAsyncContextStrategy)(carrier); + return acs.getCurrentScope(); +} + +/** + * Get the currently active isolation scope. + * The isolation scope is active for the current execution context. + */ +function getIsolationScope() { + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getMainCarrier)(); + const acs = (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_1__.getAsyncContextStrategy)(carrier); + return acs.getIsolationScope(); +} + +/** + * Get the global scope. + * This scope is applied to _all_ events. + */ +function getGlobalScope() { + return (0,_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_2__.getGlobalSingleton)('globalScope', () => new _scope_js__WEBPACK_IMPORTED_MODULE_3__.Scope()); +} + +/** + * Creates a new scope with and executes the given operation within. + * The scope is automatically removed once the operation + * finishes or throws. + */ + +/** + * Either creates a new active scope, or sets the given scope as active scope in the given callback. + */ +function withScope( + ...rest +) { + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getMainCarrier)(); + const acs = (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_1__.getAsyncContextStrategy)(carrier); + + // If a scope is defined, we want to make this the active scope instead of the default one + if (rest.length === 2) { + const [scope, callback] = rest; + + if (!scope) { + return acs.withScope(callback); + } + + return acs.withSetScope(scope, callback); + } + + return acs.withScope(rest[0]); +} + +/** + * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no + * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the + * case, for example, in the browser). + * + * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour. + * + * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal" + * applications directly because it comes with pitfalls. Use at your own risk! + */ + +/** + * Either creates a new active isolation scope, or sets the given isolation scope as active scope in the given callback. + */ +function withIsolationScope( + ...rest + +) { + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_0__.getMainCarrier)(); + const acs = (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_1__.getAsyncContextStrategy)(carrier); + + // If a scope is defined, we want to make this the active scope instead of the default one + if (rest.length === 2) { + const [isolationScope, callback] = rest; + + if (!isolationScope) { + return acs.withIsolationScope(callback); + } + + return acs.withSetIsolationScope(isolationScope, callback); + } + + return acs.withIsolationScope(rest[0]); +} + +/** + * Get the currently active client. + */ +function getClient() { + return getCurrentScope().getClient(); +} + +/** + * Get a trace context for the given scope. + */ +function getTraceContextFromScope(scope) { + const propagationContext = scope.getPropagationContext(); + + const { traceId, spanId, parentSpanId } = propagationContext; + + const traceContext = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_4__.dropUndefinedKeys)({ + trace_id: traceId, + span_id: spanId, + parent_span_id: parentSpanId, + }); + + return traceContext; +} + + +//# sourceMappingURL=currentScopes.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/debug-build.js": +/*!****************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/debug-build.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEBUG_BUILD: () => (/* binding */ DEBUG_BUILD) +/* harmony export */ }); +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + + +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/defaultScopes.js": +/*!******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/defaultScopes.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getDefaultCurrentScope: () => (/* binding */ getDefaultCurrentScope), +/* harmony export */ getDefaultIsolationScope: () => (/* binding */ getDefaultIsolationScope) +/* harmony export */ }); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scope.js */ "../../node_modules/@sentry/core/build/esm/scope.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + +/** Get the default current scope. */ +function getDefaultCurrentScope() { + return (0,_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalSingleton)('defaultCurrentScope', () => new _scope_js__WEBPACK_IMPORTED_MODULE_1__.Scope()); +} + +/** Get the default isolation scope. */ +function getDefaultIsolationScope() { + return (0,_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalSingleton)('defaultIsolationScope', () => new _scope_js__WEBPACK_IMPORTED_MODULE_1__.Scope()); +} + + +//# sourceMappingURL=defaultScopes.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/envelope.js": +/*!*************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/envelope.js ***! + \*************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createEventEnvelope: () => (/* binding */ createEventEnvelope), +/* harmony export */ createSessionEnvelope: () => (/* binding */ createSessionEnvelope), +/* harmony export */ createSpanEnvelope: () => (/* binding */ createSpanEnvelope) +/* harmony export */ }); +/* harmony import */ var _tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tracing/dynamicSamplingContext.js */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/dsn.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + + + +/** + * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. + * Merge with existing data if any. + **/ +function enhanceEventWithSdkInfo(event, sdkInfo) { + if (!sdkInfo) { + return event; + } + event.sdk = event.sdk || {}; + event.sdk.name = event.sdk.name || sdkInfo.name; + event.sdk.version = event.sdk.version || sdkInfo.version; + event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])]; + event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])]; + return event; +} + +/** Creates an envelope from a Session */ +function createSessionEnvelope( + session, + dsn, + metadata, + tunnel, +) { + const sdkInfo = (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.getSdkMetadataForEnvelopeHeader)(metadata); + const envelopeHeaders = { + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && dsn && { dsn: (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__.dsnToString)(dsn) }), + }; + + const envelopeItem = + 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()]; + + return (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.createEnvelope)(envelopeHeaders, [envelopeItem]); +} + +/** + * Create an Envelope from an event. + */ +function createEventEnvelope( + event, + dsn, + metadata, + tunnel, +) { + const sdkInfo = (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.getSdkMetadataForEnvelopeHeader)(metadata); + + /* + Note: Due to TS, event.type may be `replay_event`, theoretically. + In practice, we never call `createEventEnvelope` with `replay_event` type, + and we'd have to adjust a looot of types to make this work properly. + We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type) + So the safe choice is to really guard against the replay_event type here. + */ + const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event'; + + enhanceEventWithSdkInfo(event, metadata && metadata.sdk); + + const envelopeHeaders = (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.createEventEnvelopeHeaders)(event, sdkInfo, tunnel, dsn); + + // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to + // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may + // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid + // of this `delete`, lest we miss putting it back in the next time the property is in use.) + delete event.sdkProcessingMetadata; + + const eventItem = [{ type: eventType }, event]; + return (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.createEnvelope)(envelopeHeaders, [eventItem]); +} + +/** + * Create envelope from Span item. + * + * Takes an optional client and runs spans through `beforeSendSpan` if available. + */ +function createSpanEnvelope(spans, client) { + function dscHasRequiredProps(dsc) { + return !!dsc.trace_id && !!dsc.public_key; + } + + // For the moment we'll obtain the DSC from the first span in the array + // This might need to be changed if we permit sending multiple spans from + // different segments in one envelope + const dsc = (0,_tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_2__.getDynamicSamplingContextFromSpan)(spans[0]); + + const dsn = client && client.getDsn(); + const tunnel = client && client.getOptions().tunnel; + + const headers = { + sent_at: new Date().toISOString(), + ...(dscHasRequiredProps(dsc) && { trace: dsc }), + ...(!!tunnel && dsn && { dsn: (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__.dsnToString)(dsn) }), + }; + + const beforeSendSpan = client && client.getOptions().beforeSendSpan; + const convertToSpanJSON = beforeSendSpan + ? (span) => { + const spanJson = beforeSendSpan((0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(span) ); + if (!spanJson) { + (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.showSpanDropWarning)(); + } + return spanJson; + } + : (span) => (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(span); + + const items = []; + for (const span of spans) { + const spanJson = convertToSpanJSON(span); + if (spanJson) { + items.push((0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.createSpanEnvelopeItem)(spanJson)); + } + } + + return (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.createEnvelope)(headers, items); +} + + +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/eventProcessors.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/eventProcessors.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ notifyEventProcessors: () => (/* binding */ notifyEventProcessors) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/syncpromise.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js"); + + + + + +/** + * Process an array of event processors, returning the processed event (or `null` if the event was dropped). + */ +function notifyEventProcessors( + processors, + event, + hint, + index = 0, +) { + return new _utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.SyncPromise((resolve, reject) => { + const processor = processors[index]; + if (event === null || typeof processor !== 'function') { + resolve(event); + } else { + const result = processor({ ...event }, hint) ; + + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && processor.id && result === null && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(`Event processor "${processor.id}" dropped event`); + + if ((0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_3__.isThenable)(result)) { + void result + .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve)) + .then(null, reject); + } else { + void notifyEventProcessors(processors, result, hint, index + 1) + .then(resolve) + .then(null, reject); + } + } + }); +} + + +//# sourceMappingURL=eventProcessors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/exports.js": +/*!************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/exports.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addEventProcessor: () => (/* binding */ addEventProcessor), +/* harmony export */ captureCheckIn: () => (/* binding */ captureCheckIn), +/* harmony export */ captureEvent: () => (/* binding */ captureEvent), +/* harmony export */ captureException: () => (/* binding */ captureException), +/* harmony export */ captureMessage: () => (/* binding */ captureMessage), +/* harmony export */ captureSession: () => (/* binding */ captureSession), +/* harmony export */ close: () => (/* binding */ close), +/* harmony export */ endSession: () => (/* binding */ endSession), +/* harmony export */ flush: () => (/* binding */ flush), +/* harmony export */ isEnabled: () => (/* binding */ isEnabled), +/* harmony export */ isInitialized: () => (/* binding */ isInitialized), +/* harmony export */ lastEventId: () => (/* binding */ lastEventId), +/* harmony export */ setContext: () => (/* binding */ setContext), +/* harmony export */ setExtra: () => (/* binding */ setExtra), +/* harmony export */ setExtras: () => (/* binding */ setExtras), +/* harmony export */ setTag: () => (/* binding */ setTag), +/* harmony export */ setTags: () => (/* binding */ setTags), +/* harmony export */ setUser: () => (/* binding */ setUser), +/* harmony export */ startSession: () => (/* binding */ startSession), +/* harmony export */ withMonitor: () => (/* binding */ withMonitor) +/* harmony export */ }); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constants.js */ "../../node_modules/@sentry/core/build/esm/constants.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./session.js */ "../../node_modules/@sentry/core/build/esm/session.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _utils_prepareEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/prepareEvent.js */ "../../node_modules/@sentry/core/build/esm/utils/prepareEvent.js"); + + + + + + + + + + + +/** + * Captures an exception event and sends it to Sentry. + * + * @param exception The exception to capture. + * @param hint Optional additional data to attach to the Sentry event. + * @returns the id of the captured Sentry event. + */ +function captureException( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + exception, + hint, +) { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)().captureException(exception, (0,_utils_prepareEvent_js__WEBPACK_IMPORTED_MODULE_1__.parseEventHintOrCaptureContext)(hint)); +} + +/** + * Captures a message event and sends it to Sentry. + * + * @param message The message to send to Sentry. + * @param captureContext Define the level of the message or pass in additional data to attach to the message. + * @returns the id of the captured message. + */ +function captureMessage(message, captureContext) { + // This is necessary to provide explicit scopes upgrade, without changing the original + // arity of the `captureMessage(message, level)` method. + const level = typeof captureContext === 'string' ? captureContext : undefined; + const context = typeof captureContext !== 'string' ? { captureContext } : undefined; + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)().captureMessage(message, level, context); +} + +/** + * Captures a manually created event and sends it to Sentry. + * + * @param event The event to send to Sentry. + * @param hint Optional additional data to attach to the Sentry event. + * @returns the id of the captured event. + */ +function captureEvent(event, hint) { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)().captureEvent(event, hint); +} + +/** + * Sets context data with the given name. + * @param name of the context + * @param context Any kind of data. This data will be normalized. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setContext(name, context) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().setContext(name, context); +} + +/** + * Set an object that will be merged sent as extra data with the event. + * @param extras Extras object to merge into current context. + */ +function setExtras(extras) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().setExtras(extras); +} + +/** + * Set key:value that will be sent as extra data with the event. + * @param key String of extra + * @param extra Any kind of data. This data will be normalized. + */ +function setExtra(key, extra) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().setExtra(key, extra); +} + +/** + * Set an object that will be merged sent as tags data with the event. + * @param tags Tags context object to merge into current context. + */ +function setTags(tags) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().setTags(tags); +} + +/** + * Set key:value that will be sent as tags data with the event. + * + * Can also be used to unset a tag, by passing `undefined`. + * + * @param key String key of tag + * @param value Value of tag + */ +function setTag(key, value) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().setTag(key, value); +} + +/** + * Updates user context information for future events. + * + * @param user User context object to be set in the current context. Pass `null` to unset the user. + */ +function setUser(user) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().setUser(user); +} + +/** + * The last error event id of the isolation scope. + * + * Warning: This function really returns the last recorded error event id on the current + * isolation scope. If you call this function after handling a certain error and another error + * is captured in between, the last one is returned instead of the one you might expect. + * Also, ids of events that were never sent to Sentry (for example because + * they were dropped in `beforeSend`) could be returned. + * + * @returns The last event id of the isolation scope. + */ +function lastEventId() { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().lastEventId(); +} + +/** + * Create a cron monitor check in and send it to Sentry. + * + * @param checkIn An object that describes a check in. + * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want + * to create a monitor automatically when sending a check in. + */ +function captureCheckIn(checkIn, upsertMonitorConfig) { + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + if (!client) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Cannot capture check-in. No client defined.'); + } else if (!client.captureCheckIn) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Cannot capture check-in. Client does not support sending check-ins.'); + } else { + return client.captureCheckIn(checkIn, upsertMonitorConfig, scope); + } + + return (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_4__.uuid4)(); +} + +/** + * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes. + * + * @param monitorSlug The distinct slug of the monitor. + * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want + * to create a monitor automatically when sending a check in. + */ +function withMonitor( + monitorSlug, + callback, + upsertMonitorConfig, +) { + const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig); + const now = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_5__.timestampInSeconds)(); + + function finishCheckIn(status) { + captureCheckIn({ monitorSlug, status, checkInId, duration: (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_5__.timestampInSeconds)() - now }); + } + + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withIsolationScope)(() => { + let maybePromiseResult; + try { + maybePromiseResult = callback(); + } catch (e) { + finishCheckIn('error'); + throw e; + } + + if ((0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_6__.isThenable)(maybePromiseResult)) { + Promise.resolve(maybePromiseResult).then( + () => { + finishCheckIn('ok'); + }, + e => { + finishCheckIn('error'); + throw e; + }, + ); + } else { + finishCheckIn('ok'); + } + + return maybePromiseResult; + }); +} + +/** + * Call `flush()` on the current client, if there is one. See {@link Client.flush}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause + * the client to wait until all events are sent before resolving the promise. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +async function flush(timeout) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + if (client) { + return client.flush(timeout); + } + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Cannot flush events. No client defined.'); + return Promise.resolve(false); +} + +/** + * Call `close()` on the current client, if there is one. See {@link Client.close}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this + * parameter will cause the client to wait until all events are sent before disabling itself. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +async function close(timeout) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + if (client) { + return client.close(timeout); + } + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Cannot flush events and disable SDK. No client defined.'); + return Promise.resolve(false); +} + +/** + * Returns true if Sentry has been properly initialized. + */ +function isInitialized() { + return !!(0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); +} + +/** If the SDK is initialized & enabled. */ +function isEnabled() { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + return !!client && client.getOptions().enabled !== false && !!client.getTransport(); +} + +/** + * Add an event processor. + * This will be added to the current isolation scope, ensuring any event that is processed in the current execution + * context will have the processor applied. + */ +function addEventProcessor(callback) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)().addEventProcessor(callback); +} + +/** + * Start a session on the current isolation scope. + * + * @param context (optional) additional properties to be applied to the returned session object + * + * @returns the new active session + */ +function startSession(context) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + const isolationScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)(); + const currentScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + + const { release, environment = _constants_js__WEBPACK_IMPORTED_MODULE_7__.DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {}; + + // Will fetch userAgent if called from browser sdk + const { userAgent } = _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_8__.GLOBAL_OBJ.navigator || {}; + + const session = (0,_session_js__WEBPACK_IMPORTED_MODULE_9__.makeSession)({ + release, + environment, + user: currentScope.getUser() || isolationScope.getUser(), + ...(userAgent && { userAgent }), + ...context, + }); + + // End existing session if there's one + const currentSession = isolationScope.getSession(); + if (currentSession && currentSession.status === 'ok') { + (0,_session_js__WEBPACK_IMPORTED_MODULE_9__.updateSession)(currentSession, { status: 'exited' }); + } + + endSession(); + + // Afterwards we set the new session on the scope + isolationScope.setSession(session); + + // TODO (v8): Remove this and only use the isolation scope(?). + // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() + currentScope.setSession(session); + + return session; +} + +/** + * End the session on the current isolation scope. + */ +function endSession() { + const isolationScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)(); + const currentScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + + const session = currentScope.getSession() || isolationScope.getSession(); + if (session) { + (0,_session_js__WEBPACK_IMPORTED_MODULE_9__.closeSession)(session); + } + _sendSessionUpdate(); + + // the session is over; take it off of the scope + isolationScope.setSession(); + + // TODO (v8): Remove this and only use the isolation scope(?). + // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() + currentScope.setSession(); +} + +/** + * Sends the current Session on the scope + */ +function _sendSessionUpdate() { + const isolationScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)(); + const currentScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + // TODO (v8): Remove currentScope and only use the isolation scope(?). + // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() + const session = currentScope.getSession() || isolationScope.getSession(); + if (session && client) { + client.captureSession(session); + } +} + +/** + * Sends the current session on the scope to Sentry + * + * @param end If set the session will be marked as exited and removed from the scope. + * Defaults to `false`. + */ +function captureSession(end = false) { + // both send the update and pull the session from the scope + if (end) { + endSession(); + return; + } + + // only send the update + _sendSessionUpdate(); +} + + +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/feedback.js": +/*!*************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/feedback.js ***! + \*************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ captureFeedback: () => (/* binding */ captureFeedback) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + + +/** + * Send user feedback to Sentry. + */ +function captureFeedback( + params, + hint = {}, + scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(), +) { + const { message, name, email, url, source, associatedEventId, tags } = params; + + const feedbackEvent = { + contexts: { + feedback: (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)({ + contact_email: email, + name, + message, + url, + source, + associated_event_id: associatedEventId, + }), + }, + type: 'feedback', + level: 'info', + tags, + }; + + const client = (scope && scope.getClient()) || (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + + if (client) { + client.emit('beforeSendFeedback', feedbackEvent, hint); + } + + const eventId = scope.captureEvent(feedbackEvent, hint); + + return eventId; +} + + +//# sourceMappingURL=feedback.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/fetch.js": +/*!**********************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/fetch.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addTracingHeadersToFetchRequest: () => (/* binding */ addTracingHeadersToFetchRequest), +/* harmony export */ instrumentFetchRequest: () => (/* binding */ instrumentFetchRequest) +/* harmony export */ }); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_url_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/url.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/url.js"); +/* harmony import */ var _utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils-hoist/baggage.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/baggage.js"); +/* harmony import */ var _utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/hasTracingEnabled.js */ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _tracing_sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tracing/sentryNonRecordingSpan.js */ "../../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js"); +/* harmony import */ var _tracing_spanstatus_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tracing/spanstatus.js */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _tracing_trace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tracing/trace.js */ "../../node_modules/@sentry/core/build/esm/tracing/trace.js"); +/* harmony import */ var _utils_traceData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/traceData.js */ "../../node_modules/@sentry/core/build/esm/utils/traceData.js"); + + + + + + + + + + + + + + + + + + +/** + * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`. + * + * @returns Span if a span was created, otherwise void. + */ +function instrumentFetchRequest( + handlerData, + shouldCreateSpan, + shouldAttachHeaders, + spans, + spanOrigin = 'auto.http.browser', +) { + if (!handlerData.fetchData) { + return undefined; + } + + const shouldCreateSpanResult = (0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__.hasTracingEnabled)() && shouldCreateSpan(handlerData.fetchData.url); + + if (handlerData.endTimestamp && shouldCreateSpanResult) { + const spanId = handlerData.fetchData.__span; + if (!spanId) return; + + const span = spans[spanId]; + if (span) { + endSpan(span, handlerData); + + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete spans[spanId]; + } + return undefined; + } + + const { method, url } = handlerData.fetchData; + + const fullUrl = getFullURL(url); + const host = fullUrl ? (0,_utils_hoist_url_js__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(fullUrl).host : undefined; + + const hasParent = !!(0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.getActiveSpan)(); + + const span = + shouldCreateSpanResult && hasParent + ? (0,_tracing_trace_js__WEBPACK_IMPORTED_MODULE_3__.startInactiveSpan)({ + name: `${method} ${url}`, + attributes: { + url, + type: 'fetch', + 'http.method': method, + 'http.url': fullUrl, + 'server.address': host, + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_4__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_4__.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', + }, + }) + : new _tracing_sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_5__.SentryNonRecordingSpan(); + + handlerData.fetchData.__span = span.spanContext().spanId; + spans[span.spanContext().spanId] = span; + + if (shouldAttachHeaders(handlerData.fetchData.url)) { + const request = handlerData.args[0]; + + const options = handlerData.args[1] || {}; + + const headers = _addTracingHeadersToFetchRequest( + request, + options, + // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), + // we do not want to use the span as base for the trace headers, + // which means that the headers will be generated from the scope and the sampling decision is deferred + (0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__.hasTracingEnabled)() && hasParent ? span : undefined, + ); + if (headers) { + // Ensure this is actually set, if no options have been passed previously + handlerData.args[1] = options; + options.headers = headers; + } + } + + return span; +} + +/** + * Adds sentry-trace and baggage headers to the various forms of fetch headers. + */ +function _addTracingHeadersToFetchRequest( + request, + fetchOptionsObj + +, + span, +) { + const traceHeaders = (0,_utils_traceData_js__WEBPACK_IMPORTED_MODULE_6__.getTraceData)({ span }); + const sentryTrace = traceHeaders['sentry-trace']; + const baggage = traceHeaders.baggage; + + // Nothing to do, when we return undefined here, the original headers will be used + if (!sentryTrace) { + return undefined; + } + + const headers = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined); + + if (!headers) { + return { ...traceHeaders }; + } else if (isHeaders(headers)) { + const newHeaders = new Headers(headers); + newHeaders.set('sentry-trace', sentryTrace); + + if (baggage) { + const prevBaggageHeader = newHeaders.get('baggage'); + if (prevBaggageHeader) { + const prevHeaderStrippedFromSentryBaggage = stripBaggageHeaderOfSentryBaggageValues(prevBaggageHeader); + newHeaders.set( + 'baggage', + // If there are non-sentry entries (i.e. if the stripped string is non-empty/truthy) combine the stripped header and sentry baggage header + // otherwise just set the sentry baggage header + prevHeaderStrippedFromSentryBaggage ? `${prevHeaderStrippedFromSentryBaggage},${baggage}` : baggage, + ); + } else { + newHeaders.set('baggage', baggage); + } + } + + return newHeaders; + } else if (Array.isArray(headers)) { + const newHeaders = [ + ...headers + // Remove any existing sentry-trace headers + .filter(header => { + return !(Array.isArray(header) && header[0] === 'sentry-trace'); + }) + // Get rid of previous sentry baggage values in baggage header + .map(header => { + if (Array.isArray(header) && header[0] === 'baggage' && typeof header[1] === 'string') { + const [headerName, headerValue, ...rest] = header; + return [headerName, stripBaggageHeaderOfSentryBaggageValues(headerValue), ...rest]; + } else { + return header; + } + }), + // Attach the new sentry-trace header + ['sentry-trace', sentryTrace], + ]; + + if (baggage) { + // If there are multiple entries with the same key, the browser will merge the values into a single request header. + // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header. + newHeaders.push(['baggage', baggage]); + } + + return newHeaders ; + } else { + const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined; + let newBaggageHeaders = []; + + if (Array.isArray(existingBaggageHeader)) { + newBaggageHeaders = existingBaggageHeader + .map(headerItem => + typeof headerItem === 'string' ? stripBaggageHeaderOfSentryBaggageValues(headerItem) : headerItem, + ) + .filter(headerItem => headerItem === ''); + } else if (existingBaggageHeader) { + newBaggageHeaders.push(stripBaggageHeaderOfSentryBaggageValues(existingBaggageHeader)); + } + + if (baggage) { + newBaggageHeaders.push(baggage); + } + + return { + ...(headers ), + 'sentry-trace': sentryTrace, + baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined, + }; + } +} + +/** + * Adds sentry-trace and baggage headers to the various forms of fetch headers. + * + * @deprecated This function will not be exported anymore in v9. + */ +function addTracingHeadersToFetchRequest( + request, + _client, + _scope, + fetchOptionsObj + +, + span, +) { + return _addTracingHeadersToFetchRequest(request , fetchOptionsObj, span); +} + +function getFullURL(url) { + try { + const parsed = new URL(url); + return parsed.href; + } catch (e) { + return undefined; + } +} + +function endSpan(span, handlerData) { + if (handlerData.response) { + (0,_tracing_spanstatus_js__WEBPACK_IMPORTED_MODULE_7__.setHttpStatus)(span, handlerData.response.status); + + const contentLength = + handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length'); + + if (contentLength) { + const contentLengthNum = parseInt(contentLength); + if (contentLengthNum > 0) { + span.setAttribute('http.response_content_length', contentLengthNum); + } + } + } else if (handlerData.error) { + span.setStatus({ code: _tracing_spanstatus_js__WEBPACK_IMPORTED_MODULE_7__.SPAN_STATUS_ERROR, message: 'internal_error' }); + } + span.end(); +} + +function stripBaggageHeaderOfSentryBaggageValues(baggageHeader) { + return ( + baggageHeader + .split(',') + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + .filter(baggageEntry => !baggageEntry.split('=')[0].startsWith(_utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_8__.SENTRY_BAGGAGE_KEY_PREFIX)) + .join(',') + ); +} + +function isRequest(request) { + return typeof Request !== 'undefined' && (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_9__.isInstanceOf)(request, Request); +} + +function isHeaders(headers) { + return typeof Headers !== 'undefined' && (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_9__.isInstanceOf)(headers, Headers); +} + + +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/getCurrentHubShim.js": +/*!**********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/getCurrentHubShim.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getCurrentHub: () => (/* binding */ getCurrentHub), +/* harmony export */ getCurrentHubShim: () => (/* binding */ getCurrentHubShim) +/* harmony export */ }); +/* harmony import */ var _breadcrumbs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./breadcrumbs.js */ "../../node_modules/@sentry/core/build/esm/breadcrumbs.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _exports_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./exports.js */ "../../node_modules/@sentry/core/build/esm/exports.js"); + + + + +/** + * This is for legacy reasons, and returns a proxy object instead of a hub to be used. + * + * @deprecated Use the methods directly from the top level Sentry API (e.g. `Sentry.withScope`) + * For more information see our migration guide for + * [replacing `getCurrentHub` and `Hub`](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub) + * usage + */ +// eslint-disable-next-line deprecation/deprecation +function getCurrentHubShim() { + return { + bindClient(client) { + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + scope.setClient(client); + }, + + withScope: _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope, + getClient: () => (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)() , + getScope: _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope, + getIsolationScope: _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope, + captureException: (exception, hint) => { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)().captureException(exception, hint); + }, + captureMessage: (message, level, hint) => { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)().captureMessage(message, level, hint); + }, + captureEvent: _exports_js__WEBPACK_IMPORTED_MODULE_1__.captureEvent, + addBreadcrumb: _breadcrumbs_js__WEBPACK_IMPORTED_MODULE_2__.addBreadcrumb, + setUser: _exports_js__WEBPACK_IMPORTED_MODULE_1__.setUser, + setTags: _exports_js__WEBPACK_IMPORTED_MODULE_1__.setTags, + setTag: _exports_js__WEBPACK_IMPORTED_MODULE_1__.setTag, + setExtra: _exports_js__WEBPACK_IMPORTED_MODULE_1__.setExtra, + setExtras: _exports_js__WEBPACK_IMPORTED_MODULE_1__.setExtras, + setContext: _exports_js__WEBPACK_IMPORTED_MODULE_1__.setContext, + + getIntegration(integration) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + return (client && client.getIntegrationByName(integration.id)) || null; + }, + + startSession: _exports_js__WEBPACK_IMPORTED_MODULE_1__.startSession, + endSession: _exports_js__WEBPACK_IMPORTED_MODULE_1__.endSession, + captureSession(end) { + // both send the update and pull the session from the scope + if (end) { + return (0,_exports_js__WEBPACK_IMPORTED_MODULE_1__.endSession)(); + } + + // only send the update + _sendSessionUpdate(); + }, + }; +} + +/** + * Returns the default hub instance. + * + * If a hub is already registered in the global carrier but this module + * contains a more recent version, it replaces the registered version. + * Otherwise, the currently registered hub will be returned. + * + * @deprecated Use the respective replacement method directly instead. + */ +// eslint-disable-next-line deprecation/deprecation +const getCurrentHub = getCurrentHubShim; + +/** + * Sends the current Session on the scope + */ +function _sendSessionUpdate() { + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + + const session = scope.getSession(); + if (client && session) { + client.captureSession(session); + } +} + + +//# sourceMappingURL=getCurrentHubShim.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integration.js": +/*!****************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integration.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addIntegration: () => (/* binding */ addIntegration), +/* harmony export */ afterSetupIntegrations: () => (/* binding */ afterSetupIntegrations), +/* harmony export */ defineIntegration: () => (/* binding */ defineIntegration), +/* harmony export */ getIntegrationsToSetup: () => (/* binding */ getIntegrationsToSetup), +/* harmony export */ installedIntegrations: () => (/* binding */ installedIntegrations), +/* harmony export */ setupIntegration: () => (/* binding */ setupIntegration), +/* harmony export */ setupIntegrations: () => (/* binding */ setupIntegrations) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); + + + + +const installedIntegrations = []; + +/** Map of integrations assigned to a client */ + +/** + * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to + * preserve the order of integrations in the array. + * + * @private + */ +function filterDuplicates(integrations) { + const integrationsByName = {}; + + integrations.forEach(currentInstance => { + const { name } = currentInstance; + + const existingInstance = integrationsByName[name]; + + // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a + // default instance to overwrite an existing user instance + if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { + return; + } + + integrationsByName[name] = currentInstance; + }); + + return Object.values(integrationsByName); +} + +/** Gets integrations to install */ +function getIntegrationsToSetup(options) { + const defaultIntegrations = options.defaultIntegrations || []; + const userIntegrations = options.integrations; + + // We flag default instances, so that later we can tell them apart from any user-created instances of the same class + defaultIntegrations.forEach(integration => { + integration.isDefaultInstance = true; + }); + + let integrations; + + if (Array.isArray(userIntegrations)) { + integrations = [...defaultIntegrations, ...userIntegrations]; + } else if (typeof userIntegrations === 'function') { + const resolvedUserIntegrations = userIntegrations(defaultIntegrations); + integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; + } else { + integrations = defaultIntegrations; + } + + const finalIntegrations = filterDuplicates(integrations); + + // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or + // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event + // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore + // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array. + const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug'); + if (debugIndex > -1) { + const [debugInstance] = finalIntegrations.splice(debugIndex, 1) ; + finalIntegrations.push(debugInstance); + } + + return finalIntegrations; +} + +/** + * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default + * integrations are added unless they were already provided before. + * @param integrations array of integration instances + * @param withDefault should enable default integrations + */ +function setupIntegrations(client, integrations) { + const integrationIndex = {}; + + integrations.forEach(integration => { + // guard against empty provided integrations + if (integration) { + setupIntegration(client, integration, integrationIndex); + } + }); + + return integrationIndex; +} + +/** + * Execute the `afterAllSetup` hooks of the given integrations. + */ +function afterSetupIntegrations(client, integrations) { + for (const integration of integrations) { + // guard against empty provided integrations + if (integration && integration.afterAllSetup) { + integration.afterAllSetup(client); + } + } +} + +/** Setup a single integration. */ +function setupIntegration(client, integration, integrationIndex) { + if (integrationIndex[integration.name]) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.log(`Integration skipped because it was already installed: ${integration.name}`); + return; + } + integrationIndex[integration.name] = integration; + + // `setupOnce` is only called the first time + if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') { + integration.setupOnce(); + installedIntegrations.push(integration.name); + } + + // `setup` is run for each client + if (integration.setup && typeof integration.setup === 'function') { + integration.setup(client); + } + + if (typeof integration.preprocessEvent === 'function') { + const callback = integration.preprocessEvent.bind(integration) ; + client.on('preprocessEvent', (event, hint) => callback(event, hint, client)); + } + + if (typeof integration.processEvent === 'function') { + const callback = integration.processEvent.bind(integration) ; + + const processor = Object.assign((event, hint) => callback(event, hint, client), { + id: integration.name, + }); + + client.addEventProcessor(processor); + } + + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.log(`Integration installed: ${integration.name}`); +} + +/** Add an integration to the current scope's client. */ +function addIntegration(integration) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_2__.getClient)(); + + if (!client) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`); + return; + } + + client.addIntegration(integration); +} + +/** + * Define an integration function that can be used to create an integration instance. + * Note that this by design hides the implementation details of the integration, as they are considered internal. + */ +function defineIntegration(fn) { + return fn; +} + + +//# sourceMappingURL=integration.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/captureconsole.js": +/*!********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/captureconsole.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ captureConsoleIntegration: () => (/* binding */ captureConsoleIntegration) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _exports_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../exports.js */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_instrument_console_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/instrument/console.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/console.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_severity_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils-hoist/severity.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/severity.js"); +/* harmony import */ var _utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils-hoist/string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + + + + + + + + +const INTEGRATION_NAME = 'CaptureConsole'; + +const _captureConsoleIntegration = ((options = {}) => { + const levels = options.levels || _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_0__.CONSOLE_LEVELS; + + return { + name: INTEGRATION_NAME, + setup(client) { + if (!("console" in _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ)) { + return; + } + + (0,_utils_hoist_instrument_console_js__WEBPACK_IMPORTED_MODULE_2__.addConsoleInstrumentationHandler)(({ args, level }) => { + if ((0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_3__.getClient)() !== client || !levels.includes(level)) { + return; + } + + consoleHandler(args, level); + }); + }, + }; +}) ; + +/** + * Send Console API calls as Sentry Events. + */ +const captureConsoleIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_4__.defineIntegration)(_captureConsoleIntegration); + +function consoleHandler(args, level) { + const captureContext = { + level: (0,_utils_hoist_severity_js__WEBPACK_IMPORTED_MODULE_5__.severityLevelFromString)(level), + extra: { + arguments: args, + }, + }; + + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_3__.withScope)(scope => { + scope.addEventProcessor(event => { + event.logger = 'console'; + + (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_6__.addExceptionMechanism)(event, { + handled: false, + type: 'console', + }); + + return event; + }); + + if (level === 'assert') { + if (!args[0]) { + const message = `Assertion failed: ${(0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_7__.safeJoin)(args.slice(1), ' ') || 'console.assert'}`; + scope.setExtra('arguments', args.slice(1)); + (0,_exports_js__WEBPACK_IMPORTED_MODULE_8__.captureMessage)(message, captureContext); + } + return; + } + + const error = args.find(arg => arg instanceof Error); + if (error) { + (0,_exports_js__WEBPACK_IMPORTED_MODULE_8__.captureException)(error, captureContext); + return; + } + + const message = (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_7__.safeJoin)(args, ' '); + (0,_exports_js__WEBPACK_IMPORTED_MODULE_8__.captureMessage)(message, captureContext); + }); +} + + +//# sourceMappingURL=captureconsole.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/debug.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/debug.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ debugIntegration: () => (/* binding */ debugIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); + + + +const INTEGRATION_NAME = 'Debug'; + +const _debugIntegration = ((options = {}) => { + const _options = { + debugger: false, + stringify: false, + ...options, + }; + + return { + name: INTEGRATION_NAME, + setup(client) { + client.on('beforeSendEvent', (event, hint) => { + if (_options.debugger) { + // eslint-disable-next-line no-debugger + debugger; + } + + /* eslint-disable no-console */ + (0,_utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_0__.consoleSandbox)(() => { + if (_options.stringify) { + console.log(JSON.stringify(event, null, 2)); + if (hint && Object.keys(hint).length) { + console.log(JSON.stringify(hint, null, 2)); + } + } else { + console.log(event); + if (hint && Object.keys(hint).length) { + console.log(hint); + } + } + }); + /* eslint-enable no-console */ + }); + }, + }; +}) ; + +/** + * Integration to debug sent Sentry events. + * This integration should not be used in production. + * + * @deprecated This integration is deprecated and will be removed in the next major version of the SDK. + * To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...). + */ +const debugIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_1__.defineIntegration)(_debugIntegration); + + +//# sourceMappingURL=debug.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/dedupe.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/dedupe.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _shouldDropEvent: () => (/* binding */ _shouldDropEvent), +/* harmony export */ dedupeIntegration: () => (/* binding */ dedupeIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/stacktrace.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); + + + + + +const INTEGRATION_NAME = 'Dedupe'; + +const _dedupeIntegration = (() => { + let previousEvent; + + return { + name: INTEGRATION_NAME, + processEvent(currentEvent) { + // We want to ignore any non-error type events, e.g. transactions or replays + // These should never be deduped, and also not be compared against as _previousEvent. + if (currentEvent.type) { + return currentEvent; + } + + // Juuust in case something goes wrong + try { + if (_shouldDropEvent(currentEvent, previousEvent)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Event dropped due to being a duplicate of previously captured event.'); + return null; + } + } catch (_oO) {} // eslint-disable-line no-empty + + return (previousEvent = currentEvent); + }, + }; +}) ; + +/** + * Deduplication filter. + */ +const dedupeIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_2__.defineIntegration)(_dedupeIntegration); + +/** only exported for tests. */ +function _shouldDropEvent(currentEvent, previousEvent) { + if (!previousEvent) { + return false; + } + + if (_isSameMessageEvent(currentEvent, previousEvent)) { + return true; + } + + if (_isSameExceptionEvent(currentEvent, previousEvent)) { + return true; + } + + return false; +} + +function _isSameMessageEvent(currentEvent, previousEvent) { + const currentMessage = currentEvent.message; + const previousMessage = previousEvent.message; + + // If neither event has a message property, they were both exceptions, so bail out + if (!currentMessage && !previousMessage) { + return false; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { + return false; + } + + if (currentMessage !== previousMessage) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; +} + +function _isSameExceptionEvent(currentEvent, previousEvent) { + const previousException = _getExceptionFromEvent(previousEvent); + const currentException = _getExceptionFromEvent(currentEvent); + + if (!previousException || !currentException) { + return false; + } + + if (previousException.type !== currentException.type || previousException.value !== currentException.value) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; +} + +function _isSameStacktrace(currentEvent, previousEvent) { + let currentFrames = (0,_utils_hoist_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__.getFramesFromEvent)(currentEvent); + let previousFrames = (0,_utils_hoist_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__.getFramesFromEvent)(previousEvent); + + // If neither event has a stacktrace, they are assumed to be the same + if (!currentFrames && !previousFrames) { + return true; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { + return false; + } + + currentFrames = currentFrames ; + previousFrames = previousFrames ; + + // If number of frames differ, they are not the same + if (previousFrames.length !== currentFrames.length) { + return false; + } + + // Otherwise, compare the two + for (let i = 0; i < previousFrames.length; i++) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const frameA = previousFrames[i]; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const frameB = currentFrames[i]; + + if ( + frameA.filename !== frameB.filename || + frameA.lineno !== frameB.lineno || + frameA.colno !== frameB.colno || + frameA.function !== frameB.function + ) { + return false; + } + } + + return true; +} + +function _isSameFingerprint(currentEvent, previousEvent) { + let currentFingerprint = currentEvent.fingerprint; + let previousFingerprint = previousEvent.fingerprint; + + // If neither event has a fingerprint, they are assumed to be the same + if (!currentFingerprint && !previousFingerprint) { + return true; + } + + // If only one event has a fingerprint, but not the other one, they are not the same + if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { + return false; + } + + currentFingerprint = currentFingerprint ; + previousFingerprint = previousFingerprint ; + + // Otherwise, compare the two + try { + return !!(currentFingerprint.join('') === previousFingerprint.join('')); + } catch (_oO) { + return false; + } +} + +function _getExceptionFromEvent(event) { + return event.exception && event.exception.values && event.exception.values[0]; +} + + +//# sourceMappingURL=dedupe.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/extraerrordata.js": +/*!********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/extraerrordata.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ extraErrorDataIntegration: () => (/* binding */ extraErrorDataIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/normalize.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/normalize.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils-hoist/string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); + + + + + + + + +const INTEGRATION_NAME = 'ExtraErrorData'; + +/** + * Extract additional data for from original exceptions. + */ +const _extraErrorDataIntegration = ((options = {}) => { + const { depth = 3, captureErrorCause = true } = options; + return { + name: INTEGRATION_NAME, + processEvent(event, hint, client) { + const { maxValueLength = 250 } = client.getOptions(); + return _enhanceEventWithErrorData(event, hint, depth, captureErrorCause, maxValueLength); + }, + }; +}) ; + +const extraErrorDataIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)(_extraErrorDataIntegration); + +function _enhanceEventWithErrorData( + event, + hint = {}, + depth, + captureErrorCause, + maxValueLength, +) { + if (!hint.originalException || !(0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__.isError)(hint.originalException)) { + return event; + } + const exceptionName = (hint.originalException ).name || hint.originalException.constructor.name; + + const errorData = _extractErrorData(hint.originalException , captureErrorCause, maxValueLength); + + if (errorData) { + const contexts = { + ...event.contexts, + }; + + const normalizedErrorData = (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_2__.normalize)(errorData, depth); + + if ((0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(normalizedErrorData)) { + // We mark the error data as "already normalized" here, because we don't want other normalization procedures to + // potentially truncate the data we just already normalized, with a certain depth setting. + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_3__.addNonEnumerableProperty)(normalizedErrorData, '__sentry_skip_normalization__', true); + contexts[exceptionName] = normalizedErrorData; + } + + return { + ...event, + contexts, + }; + } + + return event; +} + +/** + * Extract extra information from the Error object + */ +function _extractErrorData( + error, + captureErrorCause, + maxValueLength, +) { + // We are trying to enhance already existing event, so no harm done if it won't succeed + try { + const nativeKeys = [ + 'name', + 'message', + 'stack', + 'line', + 'column', + 'fileName', + 'lineNumber', + 'columnNumber', + 'toJSON', + ]; + + const extraErrorInfo = {}; + + // We want only enumerable properties, thus `getOwnPropertyNames` is redundant here, as we filter keys anyway. + for (const key of Object.keys(error)) { + if (nativeKeys.indexOf(key) !== -1) { + continue; + } + const value = error[key]; + extraErrorInfo[key] = (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__.isError)(value) || typeof value === 'string' ? (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__.truncate)(`${value}`, maxValueLength) : value; + } + + // Error.cause is a standard property that is non enumerable, we therefore need to access it separately. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause + if (captureErrorCause && error.cause !== undefined) { + extraErrorInfo.cause = (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__.isError)(error.cause) ? error.cause.toString() : error.cause; + } + + // Check if someone attached `toJSON` method to grab even more properties (eg. axios is doing that) + if (typeof error.toJSON === 'function') { + const serializedError = error.toJSON() ; + + for (const key of Object.keys(serializedError)) { + const value = serializedError[key]; + extraErrorInfo[key] = (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_1__.isError)(value) ? value.toString() : value; + } + } + + return extraErrorInfo; + } catch (oO) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_5__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_6__.logger.error('Unable to extract extra data from the Error object:', oO); + } + + return null; +} + + +//# sourceMappingURL=extraerrordata.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/functiontostring.js": +/*!**********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/functiontostring.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ functionToStringIntegration: () => (/* binding */ functionToStringIntegration) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + + + +let originalFunctionToString; + +const INTEGRATION_NAME = 'FunctionToString'; + +const SETUP_CLIENTS = new WeakMap(); + +const _functionToStringIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + // eslint-disable-next-line @typescript-eslint/unbound-method + originalFunctionToString = Function.prototype.toString; + + // intrinsics (like Function.prototype) might be immutable in some environments + // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal) + try { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Function.prototype.toString = function ( ...args) { + const originalFunction = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.getOriginalFunction)(this); + const context = + SETUP_CLIENTS.has((0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_1__.getClient)() ) && originalFunction !== undefined ? originalFunction : this; + return originalFunctionToString.apply(context, args); + }; + } catch (e) { + // ignore errors here, just don't patch this + } + }, + setup(client) { + SETUP_CLIENTS.set(client, true); + }, + }; +}) ; + +/** + * Patch toString calls to return proper name for wrapped functions. + * + * ```js + * Sentry.init({ + * integrations: [ + * functionToStringIntegration(), + * ], + * }); + * ``` + */ +const functionToStringIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_2__.defineIntegration)(_functionToStringIntegration); + + +//# sourceMappingURL=functiontostring.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/inboundfilters.js": +/*!********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/inboundfilters.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ inboundFiltersIntegration: () => (/* binding */ inboundFiltersIntegration) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils-hoist/string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); + + + + + + +// "Script error." is hard coded into browsers for errors that it can't read. +// this is the result of a script being pulled in from an external domain and CORS. +const DEFAULT_IGNORE_ERRORS = [ + /^Script error\.?$/, + /^Javascript error: Script error\.? on line 0$/, + /^ResizeObserver loop completed with undelivered notifications.$/, // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. + /^Cannot redefine property: googletag$/, // This is thrown when google tag manager is used in combination with an ad blocker + "undefined is not an object (evaluating 'a.L')", // Random error that happens but not actionable or noticeable to end-users. + 'can\'t redefine non-configurable property "solana"', // Probably a browser extension or custom browser (Brave) throwing this error + "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", // Error thrown by GTM, seemingly not affecting end-users + "Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ +]; + +/** Options for the InboundFilters integration */ + +const INTEGRATION_NAME = 'InboundFilters'; +const _inboundFiltersIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + processEvent(event, _hint, client) { + const clientOptions = client.getOptions(); + const mergedOptions = _mergeOptions(options, clientOptions); + return _shouldDropEvent(event, mergedOptions) ? null : event; + }, + }; +}) ; + +const inboundFiltersIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)(_inboundFiltersIntegration); + +function _mergeOptions( + internalOptions = {}, + clientOptions = {}, +) { + return { + allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])], + denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])], + ignoreErrors: [ + ...(internalOptions.ignoreErrors || []), + ...(clientOptions.ignoreErrors || []), + ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS), + ], + ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])], + ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, + }; +} + +function _shouldDropEvent(event, options) { + if (options.ignoreInternal && _isSentryError(event)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)(event)}`); + return true; + } + if (_isIgnoredError(event, options.ignoreErrors)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)(event)}`, + ); + return true; + } + if (_isUselessError(event)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)( + event, + )}`, + ); + return true; + } + if (_isIgnoredTransaction(event, options.ignoreTransactions)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)(event)}`, + ); + return true; + } + if (_isDeniedUrl(event, options.denyUrls)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + if (!_isAllowedUrl(event, options.allowUrls)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + return false; +} + +function _isIgnoredError(event, ignoreErrors) { + // If event.type, this is not an error + if (event.type || !ignoreErrors || !ignoreErrors.length) { + return false; + } + + return _getPossibleEventMessages(event).some(message => (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__.stringMatchesSomePattern)(message, ignoreErrors)); +} + +function _isIgnoredTransaction(event, ignoreTransactions) { + if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) { + return false; + } + + const name = event.transaction; + return name ? (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__.stringMatchesSomePattern)(name, ignoreTransactions) : false; +} + +function _isDeniedUrl(event, denyUrls) { + // TODO: Use Glob instead? + if (!denyUrls || !denyUrls.length) { + return false; + } + const url = _getEventFilterUrl(event); + return !url ? false : (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__.stringMatchesSomePattern)(url, denyUrls); +} + +function _isAllowedUrl(event, allowUrls) { + // TODO: Use Glob instead? + if (!allowUrls || !allowUrls.length) { + return true; + } + const url = _getEventFilterUrl(event); + return !url ? true : (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_4__.stringMatchesSomePattern)(url, allowUrls); +} + +function _getPossibleEventMessages(event) { + const possibleMessages = []; + + if (event.message) { + possibleMessages.push(event.message); + } + + let lastException; + try { + // @ts-expect-error Try catching to save bundle size + lastException = event.exception.values[event.exception.values.length - 1]; + } catch (e) { + // try catching to save bundle size checking existence of variables + } + + if (lastException) { + if (lastException.value) { + possibleMessages.push(lastException.value); + if (lastException.type) { + possibleMessages.push(`${lastException.type}: ${lastException.value}`); + } + } + } + + return possibleMessages; +} + +function _isSentryError(event) { + try { + // @ts-expect-error can't be a sentry error if undefined + return event.exception.values[0].type === 'SentryError'; + } catch (e) { + // ignore + } + return false; +} + +function _getLastValidUrl(frames = []) { + for (let i = frames.length - 1; i >= 0; i--) { + const frame = frames[i]; + + if (frame && frame.filename !== '' && frame.filename !== '[native code]') { + return frame.filename || null; + } + } + + return null; +} + +function _getEventFilterUrl(event) { + try { + let frames; + try { + // @ts-expect-error we only care about frames if the whole thing here is defined + frames = event.exception.values[0].stacktrace.frames; + } catch (e) { + // ignore + } + return frames ? _getLastValidUrl(frames) : null; + } catch (oO) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.error(`Cannot extract url for event ${(0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_3__.getEventDescription)(event)}`); + return null; + } +} + +function _isUselessError(event) { + if (event.type) { + // event is not an error + return false; + } + + // We only want to consider events for dropping that actually have recorded exception values. + if (!event.exception || !event.exception.values || event.exception.values.length === 0) { + return false; + } + + return ( + // No top-level message + !event.message && + // There are no exception values that have a stacktrace, a non-generic-Error type or value + !event.exception.values.some(value => value.stacktrace || (value.type && value.type !== 'Error') || value.value) + ); +} + + +//# sourceMappingURL=inboundfilters.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/metadata.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/metadata.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ moduleMetadataIntegration: () => (/* binding */ moduleMetadataIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _metadata_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../metadata.js */ "../../node_modules/@sentry/core/build/esm/metadata.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); + + + + +/** + * Adds module metadata to stack frames. + * + * Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option. + * + * When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events + * under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams + * our sources + */ +const moduleMetadataIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)(() => { + return { + name: 'ModuleMetadata', + setup(client) { + // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. + client.on('beforeEnvelope', envelope => { + (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(envelope, (item, type) => { + if (type === 'event') { + const event = Array.isArray(item) ? (item )[1] : undefined; + + if (event) { + (0,_metadata_js__WEBPACK_IMPORTED_MODULE_2__.stripMetadataFromStackFrames)(event); + item[1] = event; + } + } + }); + }); + + client.on('applyFrameMetadata', event => { + // Only apply stack frame metadata to error events + if (event.type) { + return; + } + + const stackParser = client.getOptions().stackParser; + (0,_metadata_js__WEBPACK_IMPORTED_MODULE_2__.addMetadataToStackFrames)(stackParser, event); + }); + }, + }; +}); + + +//# sourceMappingURL=metadata.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/rewriteframes.js": +/*!*******************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/rewriteframes.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ generateIteratee: () => (/* binding */ generateIteratee), +/* harmony export */ rewriteFramesIntegration: () => (/* binding */ rewriteFramesIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_path_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/path.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/path.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + + +const INTEGRATION_NAME = 'RewriteFrames'; + +/** + * Rewrite event frames paths. + */ +const rewriteFramesIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)((options = {}) => { + const root = options.root; + const prefix = options.prefix || 'app:///'; + + const isBrowser = "window" in _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ && _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.window !== undefined; + + const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix }); + + /** Process an exception event. */ + function _processExceptionsEvent(event) { + try { + return { + ...event, + exception: { + ...event.exception, + // The check for this is performed inside `process` call itself, safe to skip here + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + values: event.exception.values.map(value => ({ + ...value, + ...(value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) }), + })), + }, + }; + } catch (_oO) { + return event; + } + } + + /** Process a stack trace. */ + function _processStacktrace(stacktrace) { + return { + ...stacktrace, + frames: stacktrace && stacktrace.frames && stacktrace.frames.map(f => iteratee(f)), + }; + } + + return { + name: INTEGRATION_NAME, + processEvent(originalEvent) { + let processedEvent = originalEvent; + + if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) { + processedEvent = _processExceptionsEvent(processedEvent); + } + + return processedEvent; + }, + }; +}); + +/** + * Exported only for tests. + */ +function generateIteratee({ + isBrowser, + root, + prefix, +} + +) { + return (frame) => { + if (!frame.filename) { + return frame; + } + + // Determine if this is a Windows frame by checking for a Windows-style prefix such as `C:\` + const isWindowsFrame = + /^[a-zA-Z]:\\/.test(frame.filename) || + // or the presence of a backslash without a forward slash (which are not allowed on Windows) + (frame.filename.includes('\\') && !frame.filename.includes('/')); + + // Check if the frame filename begins with `/` + const startsWithSlash = /^\//.test(frame.filename); + + if (isBrowser) { + if (root) { + const oldFilename = frame.filename; + if (oldFilename.indexOf(root) === 0) { + frame.filename = oldFilename.replace(root, prefix); + } + } + } else { + if (isWindowsFrame || startsWithSlash) { + const filename = isWindowsFrame + ? frame.filename + .replace(/^[a-zA-Z]:/, '') // remove Windows-style prefix + .replace(/\\/g, '/') // replace all `\\` instances with `/` + : frame.filename; + const base = root ? (0,_utils_hoist_path_js__WEBPACK_IMPORTED_MODULE_2__.relative)(root, filename) : (0,_utils_hoist_path_js__WEBPACK_IMPORTED_MODULE_2__.basename)(filename); + frame.filename = `${prefix}${base}`; + } + } + + return frame; + }; +} + + +//# sourceMappingURL=rewriteframes.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/sessiontiming.js": +/*!*******************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/sessiontiming.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ sessionTimingIntegration: () => (/* binding */ sessionTimingIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); + + + +const INTEGRATION_NAME = 'SessionTiming'; + +const _sessionTimingIntegration = (() => { + const startTime = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_0__.timestampInSeconds)() * 1000; + + return { + name: INTEGRATION_NAME, + processEvent(event) { + const now = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_0__.timestampInSeconds)() * 1000; + + return { + ...event, + extra: { + ...event.extra, + ['session:start']: startTime, + ['session:duration']: now - startTime, + ['session:end']: now, + }, + }; + }, + }; +}) ; + +/** + * This function adds duration since the sessionTimingIntegration was initialized + * till the time event was sent. + * + * @deprecated This integration is deprecated and will be removed in the next major version of the SDK. + * To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`). + */ +const sessionTimingIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_1__.defineIntegration)(_sessionTimingIntegration); + + +//# sourceMappingURL=sessiontiming.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/third-party-errors-filter.js": +/*!*******************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/third-party-errors-filter.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ thirdPartyErrorFilterIntegration: () => (/* binding */ thirdPartyErrorFilterIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _metadata_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../metadata.js */ "../../node_modules/@sentry/core/build/esm/metadata.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _utils_hoist_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/stacktrace.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); + + + + + +/** + * This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins. + */ +const thirdPartyErrorFilterIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_0__.defineIntegration)((options) => { + return { + name: 'ThirdPartyErrorsFilter', + setup(client) { + // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. + // TODO(lforst): Move this cleanup logic into a more central place in the SDK. + client.on('beforeEnvelope', envelope => { + (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(envelope, (item, type) => { + if (type === 'event') { + const event = Array.isArray(item) ? (item )[1] : undefined; + + if (event) { + (0,_metadata_js__WEBPACK_IMPORTED_MODULE_2__.stripMetadataFromStackFrames)(event); + item[1] = event; + } + } + }); + }); + + client.on('applyFrameMetadata', event => { + // Only apply stack frame metadata to error events + if (event.type) { + return; + } + + const stackParser = client.getOptions().stackParser; + (0,_metadata_js__WEBPACK_IMPORTED_MODULE_2__.addMetadataToStackFrames)(stackParser, event); + }); + }, + + processEvent(event) { + const frameKeys = getBundleKeysForAllFramesWithFilenames(event); + + if (frameKeys) { + const arrayMethod = + options.behaviour === 'drop-error-if-contains-third-party-frames' || + options.behaviour === 'apply-tag-if-contains-third-party-frames' + ? 'some' + : 'every'; + + const behaviourApplies = frameKeys[arrayMethod](keys => !keys.some(key => options.filterKeys.includes(key))); + + if (behaviourApplies) { + const shouldDrop = + options.behaviour === 'drop-error-if-contains-third-party-frames' || + options.behaviour === 'drop-error-if-exclusively-contains-third-party-frames'; + if (shouldDrop) { + return null; + } else { + event.tags = { + ...event.tags, + third_party_code: true, + }; + } + } + } + + return event; + }, + }; +}); + +function getBundleKeysForAllFramesWithFilenames(event) { + const frames = (0,_utils_hoist_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__.getFramesFromEvent)(event); + + if (!frames) { + return undefined; + } + + return ( + frames + // Exclude frames without a filename since these are likely native code or built-ins + .filter(frame => !!frame.filename) + .map(frame => { + if (frame.module_metadata) { + return Object.keys(frame.module_metadata) + .filter(key => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX)) + .map(key => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length)); + } + return []; + }) + ); +} + +const BUNDLER_PLUGIN_APP_KEY_PREFIX = '_sentryBundlerPluginAppKey:'; + + +//# sourceMappingURL=third-party-errors-filter.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/integrations/zoderrors.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/integrations/zoderrors.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyZodErrorsToEvent: () => (/* binding */ applyZodErrorsToEvent), +/* harmony export */ zodErrorsIntegration: () => (/* binding */ zodErrorsIntegration) +/* harmony export */ }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../integration.js */ "../../node_modules/@sentry/core/build/esm/integration.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); + + + + +const DEFAULT_LIMIT = 10; +const INTEGRATION_NAME = 'ZodErrors'; + +// Simplified ZodIssue type definition + +function originalExceptionIsZodError(originalException) { + return ( + (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_0__.isError)(originalException) && + originalException.name === 'ZodError' && + Array.isArray((originalException ).errors) + ); +} + +/** + * Formats child objects or arrays to a string + * That is preserved when sent to Sentry + */ +function formatIssueTitle(issue) { + return { + ...issue, + path: 'path' in issue && Array.isArray(issue.path) ? issue.path.join('.') : undefined, + keys: 'keys' in issue ? JSON.stringify(issue.keys) : undefined, + unionErrors: 'unionErrors' in issue ? JSON.stringify(issue.unionErrors) : undefined, + }; +} + +/** + * Zod error message is a stringified version of ZodError.issues + * This doesn't display well in the Sentry UI. Replace it with something shorter. + */ +function formatIssueMessage(zodError) { + const errorKeyMap = new Set(); + for (const iss of zodError.issues) { + if (iss.path && iss.path[0]) { + errorKeyMap.add(iss.path[0]); + } + } + const errorKeys = Array.from(errorKeyMap); + + return `Failed to validate keys: ${(0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_1__.truncate)(errorKeys.join(', '), 100)}`; +} + +/** + * Applies ZodError issues to an event extras and replaces the error message + */ +function applyZodErrorsToEvent(limit, event, hint) { + if ( + !event.exception || + !event.exception.values || + !hint || + !hint.originalException || + !originalExceptionIsZodError(hint.originalException) || + hint.originalException.issues.length === 0 + ) { + return event; + } + + return { + ...event, + exception: { + ...event.exception, + values: [ + { + ...event.exception.values[0], + value: formatIssueMessage(hint.originalException), + }, + ...event.exception.values.slice(1), + ], + }, + extra: { + ...event.extra, + 'zoderror.issues': hint.originalException.errors.slice(0, limit).map(formatIssueTitle), + }, + }; +} + +const _zodErrorsIntegration = ((options = {}) => { + const limit = options.limit || DEFAULT_LIMIT; + + return { + name: INTEGRATION_NAME, + processEvent(originalEvent, hint) { + const processedEvent = applyZodErrorsToEvent(limit, originalEvent, hint); + return processedEvent; + }, + }; +}) ; + +const zodErrorsIntegration = (0,_integration_js__WEBPACK_IMPORTED_MODULE_2__.defineIntegration)(_zodErrorsIntegration); + + +//# sourceMappingURL=zoderrors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metadata.js": +/*!*************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metadata.js ***! + \*************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addMetadataToStackFrames: () => (/* binding */ addMetadataToStackFrames), +/* harmony export */ getMetadataForUrl: () => (/* binding */ getMetadataForUrl), +/* harmony export */ stripMetadataFromStackFrames: () => (/* binding */ stripMetadataFromStackFrames) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + +/** Keys are source filename/url, values are metadata objects. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const filenameMetadataMap = new Map(); +/** Set of stack strings that have already been parsed. */ +const parsedStacks = new Set(); + +function ensureMetadataStacksAreParsed(parser) { + if (!_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ._sentryModuleMetadata) { + return; + } + + for (const stack of Object.keys(_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ._sentryModuleMetadata)) { + const metadata = _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ._sentryModuleMetadata[stack]; + + if (parsedStacks.has(stack)) { + continue; + } + + // Ensure this stack doesn't get parsed again + parsedStacks.add(stack); + + const frames = parser(stack); + + // Go through the frames starting from the top of the stack and find the first one with a filename + for (const frame of frames.reverse()) { + if (frame.filename) { + // Save the metadata for this filename + filenameMetadataMap.set(frame.filename, metadata); + break; + } + } + } +} + +/** + * Retrieve metadata for a specific JavaScript file URL. + * + * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getMetadataForUrl(parser, filename) { + ensureMetadataStacksAreParsed(parser); + return filenameMetadataMap.get(filename); +} + +/** + * Adds metadata to stack frames. + * + * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. + */ +function addMetadataToStackFrames(parser, event) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + if (!exception.stacktrace) { + return; + } + + for (const frame of exception.stacktrace.frames || []) { + if (!frame.filename || frame.module_metadata) { + continue; + } + + const metadata = getMetadataForUrl(parser, frame.filename); + + if (metadata) { + frame.module_metadata = metadata; + } + } + }); + } catch (_) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + +/** + * Strips metadata from stack frames. + */ +function stripMetadataFromStackFrames(event) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + if (!exception.stacktrace) { + return; + } + + for (const frame of exception.stacktrace.frames || []) { + delete frame.module_metadata; + } + }); + } catch (_) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + + +//# sourceMappingURL=metadata.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/browser-aggregator.js": +/*!*******************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/browser-aggregator.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BrowserMetricsAggregator: () => (/* binding */ BrowserMetricsAggregator) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "../../node_modules/@sentry/core/build/esm/metrics/constants.js"); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./envelope.js */ "../../node_modules/@sentry/core/build/esm/metrics/envelope.js"); +/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instance.js */ "../../node_modules/@sentry/core/build/esm/metrics/instance.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/core/build/esm/metrics/utils.js"); + + + + + + + +/** + * A simple metrics aggregator that aggregates metrics in memory and flushes them periodically. + * Default flush interval is 5 seconds. + * + * @experimental This API is experimental and might change in the future. + */ +class BrowserMetricsAggregator { + // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets + // when the aggregator is garbage collected. + // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry + + constructor( _client) {this._client = _client; + this._buckets = new Map(); + this._interval = setInterval(() => this.flush(), _constants_js__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_BROWSER_FLUSH_INTERVAL); + } + + /** + * @inheritDoc + */ + add( + metricType, + unsanitizedName, + value, + unsanitizedUnit = 'none', + unsanitizedTags = {}, + maybeFloatTimestamp = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(), + ) { + const timestamp = Math.floor(maybeFloatTimestamp); + const name = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.sanitizeMetricKey)(unsanitizedName); + const tags = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.sanitizeTags)(unsanitizedTags); + const unit = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.sanitizeUnit)(unsanitizedUnit ); + + const bucketKey = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getBucketKey)(metricType, name, unit, tags); + + let bucketItem = this._buckets.get(bucketKey); + // If this is a set metric, we need to calculate the delta from the previous weight. + const previousWeight = bucketItem && metricType === _constants_js__WEBPACK_IMPORTED_MODULE_0__.SET_METRIC_TYPE ? bucketItem.metric.weight : 0; + + if (bucketItem) { + bucketItem.metric.add(value); + // TODO(abhi): Do we need this check? + if (bucketItem.timestamp < timestamp) { + bucketItem.timestamp = timestamp; + } + } else { + bucketItem = { + // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. + metric: new _instance_js__WEBPACK_IMPORTED_MODULE_3__.METRIC_MAP[metricType](value), + timestamp, + metricType, + name, + unit, + tags, + }; + this._buckets.set(bucketKey, bucketItem); + } + + // If value is a string, it's a set metric so calculate the delta from the previous weight. + const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value; + (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.updateMetricSummaryOnActiveSpan)(metricType, name, val, unit, unsanitizedTags, bucketKey); + } + + /** + * @inheritDoc + */ + flush() { + // short circuit if buckets are empty. + if (this._buckets.size === 0) { + return; + } + + const metricBuckets = Array.from(this._buckets.values()); + (0,_envelope_js__WEBPACK_IMPORTED_MODULE_5__.captureAggregateMetrics)(this._client, metricBuckets); + + this._buckets.clear(); + } + + /** + * @inheritDoc + */ + close() { + clearInterval(this._interval); + this.flush(); + } +} + + +//# sourceMappingURL=browser-aggregator.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/constants.js": +/*!**********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/constants.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ COUNTER_METRIC_TYPE: () => (/* binding */ COUNTER_METRIC_TYPE), +/* harmony export */ DEFAULT_BROWSER_FLUSH_INTERVAL: () => (/* binding */ DEFAULT_BROWSER_FLUSH_INTERVAL), +/* harmony export */ DEFAULT_FLUSH_INTERVAL: () => (/* binding */ DEFAULT_FLUSH_INTERVAL), +/* harmony export */ DISTRIBUTION_METRIC_TYPE: () => (/* binding */ DISTRIBUTION_METRIC_TYPE), +/* harmony export */ GAUGE_METRIC_TYPE: () => (/* binding */ GAUGE_METRIC_TYPE), +/* harmony export */ MAX_WEIGHT: () => (/* binding */ MAX_WEIGHT), +/* harmony export */ SET_METRIC_TYPE: () => (/* binding */ SET_METRIC_TYPE) +/* harmony export */ }); +const COUNTER_METRIC_TYPE = 'c' ; +const GAUGE_METRIC_TYPE = 'g' ; +const SET_METRIC_TYPE = 's' ; +const DISTRIBUTION_METRIC_TYPE = 'd' ; + +/** + * This does not match spec in https://develop.sentry.dev/sdk/metrics + * but was chosen to optimize for the most common case in browser environments. + */ +const DEFAULT_BROWSER_FLUSH_INTERVAL = 5000; + +/** + * SDKs are required to bucket into 10 second intervals (rollup in seconds) + * which is the current lower bound of metric accuracy. + */ +const DEFAULT_FLUSH_INTERVAL = 10000; + +/** + * The maximum number of metrics that should be stored in memory. + */ +const MAX_WEIGHT = 10000; + + +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/envelope.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/envelope.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ captureAggregateMetrics: () => (/* binding */ captureAggregateMetrics), +/* harmony export */ createMetricEnvelope: () => (/* binding */ createMetricEnvelope) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/dsn.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/core/build/esm/metrics/utils.js"); + + + + + +/** + * Captures aggregated metrics to the supplied client. + */ +function captureAggregateMetrics(client, metricBucketItems) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`); + const dsn = client.getDsn(); + const metadata = client.getSdkMetadata(); + const tunnel = client.getOptions().tunnel; + + const metricsEnvelope = createMetricEnvelope(metricBucketItems, dsn, metadata, tunnel); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + client.sendEnvelope(metricsEnvelope); +} + +/** + * Create envelope from a metric aggregate. + */ +function createMetricEnvelope( + metricBucketItems, + dsn, + metadata, + tunnel, +) { + const headers = { + sent_at: new Date().toISOString(), + }; + + if (metadata && metadata.sdk) { + headers.sdk = { + name: metadata.sdk.name, + version: metadata.sdk.version, + }; + } + + if (!!tunnel && dsn) { + headers.dsn = (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__.dsnToString)(dsn); + } + + const item = createMetricEnvelopeItem(metricBucketItems); + return (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_2__.createEnvelope)(headers, [item]); +} + +function createMetricEnvelopeItem(metricBucketItems) { + const payload = (0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.serializeMetricBuckets)(metricBucketItems); + const metricHeaders = { + type: 'statsd', + length: payload.length, + }; + return [metricHeaders, payload]; +} + + +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/exports.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/exports.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ metrics: () => (/* binding */ metrics) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _tracing_trace_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../tracing/trace.js */ "../../node_modules/@sentry/core/build/esm/tracing/trace.js"); +/* harmony import */ var _utils_handleCallbackErrors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/handleCallbackErrors.js */ "../../node_modules/@sentry/core/build/esm/utils/handleCallbackErrors.js"); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants.js */ "../../node_modules/@sentry/core/build/esm/metrics/constants.js"); + + + + + + + + + + + + + + +/** + * Gets the metrics aggregator for a given client. + * @param client The client for which to get the metrics aggregator. + * @param Aggregator Optional metrics aggregator class to use to create an aggregator if one does not exist. + */ +function getMetricsAggregatorForClient( + client, + Aggregator, +) { + const globalMetricsAggregators = (0,_utils_hoist_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalSingleton)( + 'globalMetricsAggregators', + () => new WeakMap(), + ); + + const aggregator = globalMetricsAggregators.get(client); + if (aggregator) { + return aggregator; + } + + const newAggregator = new Aggregator(client); + client.on('flush', () => newAggregator.flush()); + client.on('close', () => newAggregator.close()); + globalMetricsAggregators.set(client, newAggregator); + + return newAggregator; +} + +function addToMetricsAggregator( + Aggregator, + metricType, + name, + value, + data = {}, +) { + const client = data.client || (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_1__.getClient)(); + + if (!client) { + return; + } + + const span = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.getActiveSpan)(); + const rootSpan = span ? (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRootSpan)(span) : undefined; + const transactionName = rootSpan && (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.spanToJSON)(rootSpan).description; + + const { unit, tags, timestamp } = data; + const { release, environment } = client.getOptions(); + const metricTags = {}; + if (release) { + metricTags.release = release; + } + if (environment) { + metricTags.environment = environment; + } + if (transactionName) { + metricTags.transaction = transactionName; + } + + _debug_build_js__WEBPACK_IMPORTED_MODULE_3__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_4__.logger.log(`Adding value of ${value} to ${metricType} metric ${name}`); + + const aggregator = getMetricsAggregatorForClient(client, Aggregator); + aggregator.add(metricType, name, value, unit, { ...metricTags, ...tags }, timestamp); +} + +/** + * Adds a value to a counter metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function increment(aggregator, name, value = 1, data) { + addToMetricsAggregator(aggregator, _constants_js__WEBPACK_IMPORTED_MODULE_5__.COUNTER_METRIC_TYPE, name, ensureNumber(value), data); +} + +/** + * Adds a value to a distribution metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function distribution(aggregator, name, value, data) { + addToMetricsAggregator(aggregator, _constants_js__WEBPACK_IMPORTED_MODULE_5__.DISTRIBUTION_METRIC_TYPE, name, ensureNumber(value), data); +} + +/** + * Adds a timing metric. + * The metric is added as a distribution metric. + * + * You can either directly capture a numeric `value`, or wrap a callback function in `timing`. + * In the latter case, the duration of the callback execution will be captured as a span & a metric. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function timing( + aggregator, + name, + value, + unit = 'second', + data, +) { + // callback form + if (typeof value === 'function') { + const startTime = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_6__.timestampInSeconds)(); + + return (0,_tracing_trace_js__WEBPACK_IMPORTED_MODULE_7__.startSpanManual)( + { + op: 'metrics.timing', + name, + startTime, + onlyIfParent: true, + }, + span => { + return (0,_utils_handleCallbackErrors_js__WEBPACK_IMPORTED_MODULE_8__.handleCallbackErrors)( + () => value(), + () => { + // no special error handling necessary + }, + () => { + const endTime = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_6__.timestampInSeconds)(); + const timeDiff = endTime - startTime; + // eslint-disable-next-line deprecation/deprecation + distribution(aggregator, name, timeDiff, { ...data, unit: 'second' }); + span.end(endTime); + }, + ); + }, + ); + } + + // value form + // eslint-disable-next-line deprecation/deprecation + distribution(aggregator, name, value, { ...data, unit }); +} + +/** + * Adds a value to a set metric. Value must be a string or integer. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function set(aggregator, name, value, data) { + addToMetricsAggregator(aggregator, _constants_js__WEBPACK_IMPORTED_MODULE_5__.SET_METRIC_TYPE, name, value, data); +} + +/** + * Adds a value to a gauge metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function gauge(aggregator, name, value, data) { + addToMetricsAggregator(aggregator, _constants_js__WEBPACK_IMPORTED_MODULE_5__.GAUGE_METRIC_TYPE, name, ensureNumber(value), data); +} + +/** + * The metrics API is used to capture custom metrics in Sentry. + * + * @deprecated The Sentry metrics beta has ended. This export will be removed in a future release. + */ +const metrics = { + increment, + distribution, + set, + gauge, + timing, + /** + * @ignore This is for internal use only. + */ + getMetricsAggregatorForClient, +}; + +// Although this is typed to be a number, we try to handle strings as well here +function ensureNumber(number) { + return typeof number === 'string' ? parseInt(number) : number; +} + + +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/instance.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/instance.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CounterMetric: () => (/* binding */ CounterMetric), +/* harmony export */ DistributionMetric: () => (/* binding */ DistributionMetric), +/* harmony export */ GaugeMetric: () => (/* binding */ GaugeMetric), +/* harmony export */ METRIC_MAP: () => (/* binding */ METRIC_MAP), +/* harmony export */ SetMetric: () => (/* binding */ SetMetric) +/* harmony export */ }); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ "../../node_modules/@sentry/core/build/esm/metrics/constants.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/core/build/esm/metrics/utils.js"); + + + +/** + * A metric instance representing a counter. + */ +class CounterMetric { + constructor( _value) {this._value = _value;} + + /** @inheritDoc */ + get weight() { + return 1; + } + + /** @inheritdoc */ + add(value) { + this._value += value; + } + + /** @inheritdoc */ + toString() { + return `${this._value}`; + } +} + +/** + * A metric instance representing a gauge. + */ +class GaugeMetric { + + constructor(value) { + this._last = value; + this._min = value; + this._max = value; + this._sum = value; + this._count = 1; + } + + /** @inheritDoc */ + get weight() { + return 5; + } + + /** @inheritdoc */ + add(value) { + this._last = value; + if (value < this._min) { + this._min = value; + } + if (value > this._max) { + this._max = value; + } + this._sum += value; + this._count++; + } + + /** @inheritdoc */ + toString() { + return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`; + } +} + +/** + * A metric instance representing a distribution. + */ +class DistributionMetric { + + constructor(first) { + this._value = [first]; + } + + /** @inheritDoc */ + get weight() { + return this._value.length; + } + + /** @inheritdoc */ + add(value) { + this._value.push(value); + } + + /** @inheritdoc */ + toString() { + return this._value.join(':'); + } +} + +/** + * A metric instance representing a set. + */ +class SetMetric { + + constructor( first) {this.first = first; + this._value = new Set([first]); + } + + /** @inheritDoc */ + get weight() { + return this._value.size; + } + + /** @inheritdoc */ + add(value) { + this._value.add(value); + } + + /** @inheritdoc */ + toString() { + return Array.from(this._value) + .map(val => (typeof val === 'string' ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.simpleHash)(val) : val)) + .join(':'); + } +} + +const METRIC_MAP = { + [_constants_js__WEBPACK_IMPORTED_MODULE_1__.COUNTER_METRIC_TYPE]: CounterMetric, + [_constants_js__WEBPACK_IMPORTED_MODULE_1__.GAUGE_METRIC_TYPE]: GaugeMetric, + [_constants_js__WEBPACK_IMPORTED_MODULE_1__.DISTRIBUTION_METRIC_TYPE]: DistributionMetric, + [_constants_js__WEBPACK_IMPORTED_MODULE_1__.SET_METRIC_TYPE]: SetMetric, +}; + + +//# sourceMappingURL=instance.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/metric-summary.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/metric-summary.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getMetricSummaryJsonForSpan: () => (/* binding */ getMetricSummaryJsonForSpan), +/* harmony export */ updateMetricSummaryOnSpan: () => (/* binding */ updateMetricSummaryOnSpan) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + +/** + * key: bucketKey + * value: [exportKey, MetricSummary] + */ + +const METRICS_SPAN_FIELD = '_sentryMetrics'; + +/** + * Fetches the metric summary if it exists for the passed span + */ +function getMetricSummaryJsonForSpan(span) { + const storage = (span )[METRICS_SPAN_FIELD]; + + if (!storage) { + return undefined; + } + const output = {}; + + for (const [, [exportKey, summary]] of storage) { + const arr = output[exportKey] || (output[exportKey] = []); + arr.push((0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)(summary)); + } + + return output; +} + +/** + * Updates the metric summary on a span. + */ +function updateMetricSummaryOnSpan( + span, + metricType, + sanitizedName, + value, + unit, + tags, + bucketKey, +) { + const existingStorage = (span )[METRICS_SPAN_FIELD]; + const storage = + existingStorage || + ((span )[METRICS_SPAN_FIELD] = new Map()); + + const exportKey = `${metricType}:${sanitizedName}@${unit}`; + const bucketItem = storage.get(bucketKey); + + if (bucketItem) { + const [, summary] = bucketItem; + storage.set(bucketKey, [ + exportKey, + { + min: Math.min(summary.min, value), + max: Math.max(summary.max, value), + count: (summary.count += 1), + sum: (summary.sum += value), + tags: summary.tags, + }, + ]); + } else { + storage.set(bucketKey, [ + exportKey, + { + min: value, + max: value, + count: 1, + sum: value, + tags, + }, + ]); + } +} + + +//# sourceMappingURL=metric-summary.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/metrics/utils.js": +/*!******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/metrics/utils.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getBucketKey: () => (/* binding */ getBucketKey), +/* harmony export */ sanitizeMetricKey: () => (/* binding */ sanitizeMetricKey), +/* harmony export */ sanitizeTags: () => (/* binding */ sanitizeTags), +/* harmony export */ sanitizeUnit: () => (/* binding */ sanitizeUnit), +/* harmony export */ serializeMetricBuckets: () => (/* binding */ serializeMetricBuckets), +/* harmony export */ simpleHash: () => (/* binding */ simpleHash) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + +/** + * Generate bucket key from metric properties. + */ +function getBucketKey( + metricType, + name, + unit, + tags, +) { + const stringifiedTags = Object.entries((0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)(tags)).sort((a, b) => a[0].localeCompare(b[0])); + return `${metricType}${name}${unit}${stringifiedTags}`; +} + +/* eslint-disable no-bitwise */ +/** + * Simple hash function for strings. + */ +function simpleHash(s) { + let rv = 0; + for (let i = 0; i < s.length; i++) { + const c = s.charCodeAt(i); + rv = (rv << 5) - rv + c; + rv &= rv; + } + return rv >>> 0; +} +/* eslint-enable no-bitwise */ + +/** + * Serialize metrics buckets into a string based on statsd format. + * + * Example of format: + * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677 + * Segments: + * name: metric.name + * unit: second + * value: [1, 1.2] + * type of metric: d (distribution) + * tags: { a: value, b: anothervalue } + * timestamp: 12345677 + */ +function serializeMetricBuckets(metricBucketItems) { + let out = ''; + for (const item of metricBucketItems) { + const tagEntries = Object.entries(item.tags); + const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : ''; + out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\n`; + } + return out; +} + +/** + * Sanitizes units + * + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +function sanitizeUnit(unit) { + return unit.replace(/[^\w]+/gi, '_'); +} + +/** + * Sanitizes metric keys + * + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +function sanitizeMetricKey(key) { + return key.replace(/[^\w\-.]+/gi, '_'); +} + +/** + * Sanitizes metric keys + * + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +function sanitizeTagKey(key) { + return key.replace(/[^\w\-./]+/gi, ''); +} + +/** + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +const tagValueReplacements = [ + ['\n', '\\n'], + ['\r', '\\r'], + ['\t', '\\t'], + ['\\', '\\\\'], + ['|', '\\u{7c}'], + [',', '\\u{2c}'], +]; + +function getCharOrReplacement(input) { + for (const [search, replacement] of tagValueReplacements) { + if (input === search) { + return replacement; + } + } + + return input; +} + +function sanitizeTagValue(value) { + return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), ''); +} + +/** + * Sanitizes tags. + */ +function sanitizeTags(unsanitizedTags) { + const tags = {}; + for (const key in unsanitizedTags) { + if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) { + const sanitizedKey = sanitizeTagKey(key); + tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key])); + } + } + return tags; +} + + +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/scope.js": +/*!**********************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/scope.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Scope: () => (/* binding */ Scope) +/* harmony export */ }); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./session.js */ "../../node_modules/@sentry/core/build/esm/session.js"); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_propagationContext_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/propagationContext.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_merge_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/merge.js */ "../../node_modules/@sentry/core/build/esm/utils/merge.js"); +/* harmony import */ var _utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/spanOnScope.js */ "../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js"); + + + + + + + + + +/** + * Default value for maximum number of breadcrumbs added to an event. + */ +const DEFAULT_MAX_BREADCRUMBS = 100; + +/** + * Holds additional event information. + */ +class ScopeClass { + /** Flag if notifying is happening. */ + + /** Callback for client to receive scope changes. */ + + /** Callback list that will be called during event processing. */ + + /** Array of breadcrumbs. */ + + /** User */ + + /** Tags */ + + /** Extra */ + + /** Contexts */ + + /** Attachments */ + + /** Propagation Context for distributed tracing */ + + /** + * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get + * sent to Sentry + */ + + /** Fingerprint */ + + /** Severity */ + + /** + * Transaction Name + * + * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. + * It's purpose is to assign a transaction to the scope that's added to non-transaction events. + */ + + /** Session */ + + /** Request Mode Session Status */ + + /** The client on this scope */ + + /** Contains the last event id of a captured event. */ + + // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. + + constructor() { + this._notifyingListeners = false; + this._scopeListeners = []; + this._eventProcessors = []; + this._breadcrumbs = []; + this._attachments = []; + this._user = {}; + this._tags = {}; + this._extra = {}; + this._contexts = {}; + this._sdkProcessingMetadata = {}; + this._propagationContext = (0,_utils_hoist_propagationContext_js__WEBPACK_IMPORTED_MODULE_0__.generatePropagationContext)(); + } + + /** + * @inheritDoc + */ + clone() { + const newScope = new ScopeClass(); + newScope._breadcrumbs = [...this._breadcrumbs]; + newScope._tags = { ...this._tags }; + newScope._extra = { ...this._extra }; + newScope._contexts = { ...this._contexts }; + newScope._user = this._user; + newScope._level = this._level; + newScope._session = this._session; + newScope._transactionName = this._transactionName; + newScope._fingerprint = this._fingerprint; + newScope._eventProcessors = [...this._eventProcessors]; + newScope._requestSession = this._requestSession; + newScope._attachments = [...this._attachments]; + newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }; + newScope._propagationContext = { ...this._propagationContext }; + newScope._client = this._client; + newScope._lastEventId = this._lastEventId; + + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_1__._setSpanForScope)(newScope, (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_1__._getSpanForScope)(this)); + + return newScope; + } + + /** + * @inheritDoc + */ + setClient(client) { + this._client = client; + } + + /** + * @inheritDoc + */ + setLastEventId(lastEventId) { + this._lastEventId = lastEventId; + } + + /** + * @inheritDoc + */ + getClient() { + return this._client ; + } + + /** + * @inheritDoc + */ + lastEventId() { + return this._lastEventId; + } + + /** + * @inheritDoc + */ + addScopeListener(callback) { + this._scopeListeners.push(callback); + } + + /** + * @inheritDoc + */ + addEventProcessor(callback) { + this._eventProcessors.push(callback); + return this; + } + + /** + * @inheritDoc + */ + setUser(user) { + // If null is passed we want to unset everything, but still define keys, + // so that later down in the pipeline any existing values are cleared. + this._user = user || { + email: undefined, + id: undefined, + ip_address: undefined, + username: undefined, + }; + + if (this._session) { + (0,_session_js__WEBPACK_IMPORTED_MODULE_2__.updateSession)(this._session, { user }); + } + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getUser() { + return this._user; + } + + /** + * @inheritDoc + */ + getRequestSession() { + return this._requestSession; + } + + /** + * @inheritDoc + */ + setRequestSession(requestSession) { + this._requestSession = requestSession; + return this; + } + + /** + * @inheritDoc + */ + setTags(tags) { + this._tags = { + ...this._tags, + ...tags, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this._tags = { ...this._tags, [key]: value }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtras(extras) { + this._extra = { + ...this._extra, + ...extras, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtra(key, extra) { + this._extra = { ...this._extra, [key]: extra }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setFingerprint(fingerprint) { + this._fingerprint = fingerprint; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setLevel(level) { + this._level = level; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTransactionName(name) { + this._transactionName = name; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setContext(key, context) { + if (context === null) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._contexts[key]; + } else { + this._contexts[key] = context; + } + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setSession(session) { + if (!session) { + delete this._session; + } else { + this._session = session; + } + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getSession() { + return this._session; + } + + /** + * @inheritDoc + */ + update(captureContext) { + if (!captureContext) { + return this; + } + + const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext; + + const [scopeInstance, requestSession] = + scopeToMerge instanceof Scope + ? [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] + : (0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_3__.isPlainObject)(scopeToMerge) + ? [captureContext , (captureContext ).requestSession] + : []; + + const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {}; + + this._tags = { ...this._tags, ...tags }; + this._extra = { ...this._extra, ...extra }; + this._contexts = { ...this._contexts, ...contexts }; + + if (user && Object.keys(user).length) { + this._user = user; + } + + if (level) { + this._level = level; + } + + if (fingerprint.length) { + this._fingerprint = fingerprint; + } + + if (propagationContext) { + this._propagationContext = propagationContext; + } + + if (requestSession) { + this._requestSession = requestSession; + } + + return this; + } + + /** + * @inheritDoc + */ + clear() { + // client is not cleared here on purpose! + this._breadcrumbs = []; + this._tags = {}; + this._extra = {}; + this._user = {}; + this._contexts = {}; + this._level = undefined; + this._transactionName = undefined; + this._fingerprint = undefined; + this._requestSession = undefined; + this._session = undefined; + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_1__._setSpanForScope)(this, undefined); + this._attachments = []; + this._propagationContext = (0,_utils_hoist_propagationContext_js__WEBPACK_IMPORTED_MODULE_0__.generatePropagationContext)(); + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + addBreadcrumb(breadcrumb, maxBreadcrumbs) { + const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; + + // No data has been changed, so don't notify scope listeners + if (maxCrumbs <= 0) { + return this; + } + + const mergedBreadcrumb = { + timestamp: (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_4__.dateTimestampInSeconds)(), + ...breadcrumb, + }; + + const breadcrumbs = this._breadcrumbs; + breadcrumbs.push(mergedBreadcrumb); + this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs; + + this._notifyScopeListeners(); + + return this; + } + + /** + * @inheritDoc + */ + getLastBreadcrumb() { + return this._breadcrumbs[this._breadcrumbs.length - 1]; + } + + /** + * @inheritDoc + */ + clearBreadcrumbs() { + this._breadcrumbs = []; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + addAttachment(attachment) { + this._attachments.push(attachment); + return this; + } + + /** + * @inheritDoc + */ + clearAttachments() { + this._attachments = []; + return this; + } + + /** @inheritDoc */ + getScopeData() { + return { + breadcrumbs: this._breadcrumbs, + attachments: this._attachments, + contexts: this._contexts, + tags: this._tags, + extra: this._extra, + user: this._user, + level: this._level, + fingerprint: this._fingerprint || [], + eventProcessors: this._eventProcessors, + propagationContext: this._propagationContext, + sdkProcessingMetadata: this._sdkProcessingMetadata, + transactionName: this._transactionName, + span: (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_1__._getSpanForScope)(this), + }; + } + + /** + * @inheritDoc + */ + setSDKProcessingMetadata(newData) { + this._sdkProcessingMetadata = (0,_utils_merge_js__WEBPACK_IMPORTED_MODULE_5__.merge)(this._sdkProcessingMetadata, newData, 2); + return this; + } + + /** + * @inheritDoc + */ + setPropagationContext(context) { + this._propagationContext = context; + return this; + } + + /** + * @inheritDoc + */ + getPropagationContext() { + return this._propagationContext; + } + + /** + * @inheritDoc + */ + captureException(exception, hint) { + const eventId = hint && hint.event_id ? hint.event_id : (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_6__.uuid4)(); + + if (!this._client) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.warn('No client configured on scope - will not capture exception!'); + return eventId; + } + + const syntheticException = new Error('Sentry syntheticException'); + + this._client.captureException( + exception, + { + originalException: exception, + syntheticException, + ...hint, + event_id: eventId, + }, + this, + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureMessage(message, level, hint) { + const eventId = hint && hint.event_id ? hint.event_id : (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_6__.uuid4)(); + + if (!this._client) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.warn('No client configured on scope - will not capture message!'); + return eventId; + } + + const syntheticException = new Error(message); + + this._client.captureMessage( + message, + level, + { + originalException: message, + syntheticException, + ...hint, + event_id: eventId, + }, + this, + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint) { + const eventId = hint && hint.event_id ? hint.event_id : (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_6__.uuid4)(); + + if (!this._client) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.warn('No client configured on scope - will not capture event!'); + return eventId; + } + + this._client.captureEvent(event, { ...hint, event_id: eventId }, this); + + return eventId; + } + + /** + * This will be called on every set call. + */ + _notifyScopeListeners() { + // We need this check for this._notifyingListeners to be able to work on scope during updates + // If this check is not here we'll produce endless recursion when something is done with the scope + // during the callback. + if (!this._notifyingListeners) { + this._notifyingListeners = true; + this._scopeListeners.forEach(callback => { + callback(this); + }); + this._notifyingListeners = false; + } + } +} + +// NOTE: By exporting this here as const & type, instead of doing `export class`, +// We can get the correct class when importing from `@sentry/core`, but the original type (from `@sentry/types`) +// This is helpful for interop, e.g. when doing `import type { Scope } from '@sentry/node';` (which re-exports this) + +/** + * Holds additional event information. + */ +const Scope = ScopeClass; + +/** + * Holds additional event information. + */ + + +//# sourceMappingURL=scope.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/sdk.js": +/*!********************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/sdk.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ initAndBind: () => (/* binding */ initAndBind), +/* harmony export */ setCurrentClient: () => (/* binding */ setCurrentClient) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); + + + + +/** A class object that can instantiate Client objects. */ + +/** + * Internal function to create a new SDK client instance. The client is + * installed and then bound to the current scope. + * + * @param clientClass The client class to instantiate. + * @param options Options to pass to the client. + */ +function initAndBind( + clientClass, + options, +) { + if (options.debug === true) { + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.enable(); + } else { + // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped + (0,_utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.consoleSandbox)(() => { + // eslint-disable-next-line no-console + console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + }); + } + } + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_2__.getCurrentScope)(); + scope.update(options.initialScope); + + const client = new clientClass(options); + setCurrentClient(client); + client.init(); + return client; +} + +/** + * Make the given client the current client. + */ +function setCurrentClient(client) { + (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_2__.getCurrentScope)().setClient(client); +} + + +//# sourceMappingURL=sdk.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/semanticAttributes.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SEMANTIC_ATTRIBUTE_CACHE_HIT: () => (/* binding */ SEMANTIC_ATTRIBUTE_CACHE_HIT), +/* harmony export */ SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE: () => (/* binding */ SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE), +/* harmony export */ SEMANTIC_ATTRIBUTE_CACHE_KEY: () => (/* binding */ SEMANTIC_ATTRIBUTE_CACHE_KEY), +/* harmony export */ SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME: () => (/* binding */ SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME), +/* harmony export */ SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD: () => (/* binding */ SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD), +/* harmony export */ SEMANTIC_ATTRIBUTE_PROFILE_ID: () => (/* binding */ SEMANTIC_ATTRIBUTE_PROFILE_ID), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_OP: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_OP), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE), +/* harmony export */ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE: () => (/* binding */ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE), +/* harmony export */ SEMANTIC_ATTRIBUTE_URL_FULL: () => (/* binding */ SEMANTIC_ATTRIBUTE_URL_FULL) +/* harmony export */ }); +/** + * Use this attribute to represent the source of a span. + * Should be one of: custom, url, route, view, component, task, unknown + * + */ +const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source'; + +/** + * Use this attribute to represent the sample rate used for a span. + */ +const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate'; + +/** + * Use this attribute to represent the operation of a span. + */ +const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op'; + +/** + * Use this attribute to represent the origin of a span. + */ +const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin'; + +/** The reason why an idle span finished. */ +const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason'; + +/** The unit of a measurement, which may be stored as a TimedEvent. */ +const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit'; + +/** The value of a measurement, which may be stored as a TimedEvent. */ +const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value'; + +/** + * The id of the profile that this span occurred in. + */ +const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id'; + +const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time'; + +const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit'; + +const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key'; + +const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size'; + +/** TODO: Remove these once we update to latest semantic conventions */ +const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method'; +const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full'; + + +//# sourceMappingURL=semanticAttributes.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/session.js": +/*!************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/session.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ closeSession: () => (/* binding */ closeSession), +/* harmony export */ makeSession: () => (/* binding */ makeSession), +/* harmony export */ updateSession: () => (/* binding */ updateSession) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); + + + + + + + + +/** + * Creates a new `Session` object by setting certain default parameters. If optional @param context + * is passed, the passed properties are applied to the session object. + * + * @param context (optional) additional properties to be applied to the returned session object + * + * @returns a new `Session` object + */ +function makeSession(context) { + // Both timestamp and started are in seconds since the UNIX epoch. + const startingTime = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_0__.timestampInSeconds)(); + + const session = { + sid: (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_1__.uuid4)(), + init: true, + timestamp: startingTime, + started: startingTime, + duration: 0, + status: 'ok', + errors: 0, + ignoreDuration: false, + toJSON: () => sessionToJSON(session), + }; + + if (context) { + updateSession(session, context); + } + + return session; +} + +/** + * Updates a session object with the properties passed in the context. + * + * Note that this function mutates the passed object and returns void. + * (Had to do this instead of returning a new and updated session because closing and sending a session + * makes an update to the session after it was passed to the sending logic. + * @see BaseClient.captureSession ) + * + * @param session the `Session` to update + * @param context the `SessionContext` holding the properties that should be updated in @param session + */ +// eslint-disable-next-line complexity +function updateSession(session, context = {}) { + if (context.user) { + if (!session.ipAddress && context.user.ip_address) { + session.ipAddress = context.user.ip_address; + } + + if (!session.did && !context.did) { + session.did = context.user.id || context.user.email || context.user.username; + } + } + + session.timestamp = context.timestamp || (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_0__.timestampInSeconds)(); + + if (context.abnormal_mechanism) { + session.abnormal_mechanism = context.abnormal_mechanism; + } + + if (context.ignoreDuration) { + session.ignoreDuration = context.ignoreDuration; + } + if (context.sid) { + // Good enough uuid validation. — Kamil + session.sid = context.sid.length === 32 ? context.sid : (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_1__.uuid4)(); + } + if (context.init !== undefined) { + session.init = context.init; + } + if (!session.did && context.did) { + session.did = `${context.did}`; + } + if (typeof context.started === 'number') { + session.started = context.started; + } + if (session.ignoreDuration) { + session.duration = undefined; + } else if (typeof context.duration === 'number') { + session.duration = context.duration; + } else { + const duration = session.timestamp - session.started; + session.duration = duration >= 0 ? duration : 0; + } + if (context.release) { + session.release = context.release; + } + if (context.environment) { + session.environment = context.environment; + } + if (!session.ipAddress && context.ipAddress) { + session.ipAddress = context.ipAddress; + } + if (!session.userAgent && context.userAgent) { + session.userAgent = context.userAgent; + } + if (typeof context.errors === 'number') { + session.errors = context.errors; + } + if (context.status) { + session.status = context.status; + } +} + +/** + * Closes a session by setting its status and updating the session object with it. + * Internally calls `updateSession` to update the passed session object. + * + * Note that this function mutates the passed session (@see updateSession for explanation). + * + * @param session the `Session` object to be closed + * @param status the `SessionStatus` with which the session was closed. If you don't pass a status, + * this function will keep the previously set status, unless it was `'ok'` in which case + * it is changed to `'exited'`. + */ +function closeSession(session, status) { + let context = {}; + if (status) { + context = { status }; + } else if (session.status === 'ok') { + context = { status: 'exited' }; + } + + updateSession(session, context); +} + +/** + * Serializes a passed session object to a JSON object with a slightly different structure. + * This is necessary because the Sentry backend requires a slightly different schema of a session + * than the one the JS SDKs use internally. + * + * @param session the session to be converted + * + * @returns a JSON object of the passed session + */ +function sessionToJSON(session) { + return (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)({ + sid: `${session.sid}`, + init: session.init, + // Make sure that sec is converted to ms for date constructor + started: new Date(session.started * 1000).toISOString(), + timestamp: new Date(session.timestamp * 1000).toISOString(), + status: session.status, + errors: session.errors, + did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined, + duration: session.duration, + abnormal_mechanism: session.abnormal_mechanism, + attrs: { + release: session.release, + environment: session.environment, + ip_address: session.ipAddress, + user_agent: session.userAgent, + }, + }); +} + + +//# sourceMappingURL=session.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js": +/*!***********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ freezeDscOnSpan: () => (/* binding */ freezeDscOnSpan), +/* harmony export */ getDynamicSamplingContextFromClient: () => (/* binding */ getDynamicSamplingContextFromClient), +/* harmony export */ getDynamicSamplingContextFromScope: () => (/* binding */ getDynamicSamplingContextFromScope), +/* harmony export */ getDynamicSamplingContextFromSpan: () => (/* binding */ getDynamicSamplingContextFromSpan), +/* harmony export */ spanToBaggageHeader: () => (/* binding */ spanToBaggageHeader) +/* harmony export */ }); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants.js */ "../../node_modules/@sentry/core/build/esm/constants.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils-hoist/baggage.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/baggage.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/hasTracingEnabled.js */ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + + + + + + +/** + * If you change this value, also update the terser plugin config to + * avoid minification of the object property! + */ +const FROZEN_DSC_FIELD = '_frozenDsc'; + +/** + * Freeze the given DSC on the given span. + */ +function freezeDscOnSpan(span, dsc) { + const spanWithMaybeDsc = span ; + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.addNonEnumerableProperty)(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); +} + +/** + * Creates a dynamic sampling context from a client. + * + * Dispatches the `createDsc` lifecycle hook as a side effect. + */ +function getDynamicSamplingContextFromClient(trace_id, client) { + const options = client.getOptions(); + + const { publicKey: public_key } = client.getDsn() || {}; + + const dsc = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)({ + environment: options.environment || _constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ENVIRONMENT, + release: options.release, + public_key, + trace_id, + }) ; + + client.emit('createDsc', dsc); + + return dsc; +} + +/** + * Get the dynamic sampling context for the currently active scopes. + */ +function getDynamicSamplingContextFromScope(client, scope) { + const propagationContext = scope.getPropagationContext(); + return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client); +} + +/** + * Creates a dynamic sampling context from a span (and client and scope) + * + * @param span the span from which a few values like the root span name and sample rate are extracted. + * + * @returns a dynamic sampling context + */ +function getDynamicSamplingContextFromSpan(span) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_2__.getClient)(); + if (!client) { + return {}; + } + + const rootSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(span); + + // For core implementation, we freeze the DSC onto the span as a non-enumerable property + const frozenDsc = (rootSpan )[FROZEN_DSC_FIELD]; + if (frozenDsc) { + return frozenDsc; + } + + // For OpenTelemetry, we freeze the DSC on the trace state + const traceState = rootSpan.spanContext().traceState; + const traceStateDsc = traceState && traceState.get('sentry.dsc'); + + // If the span has a DSC, we want it to take precedence + const dscOnTraceState = traceStateDsc && (0,_utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_4__.baggageHeaderToDynamicSamplingContext)(traceStateDsc); + + if (dscOnTraceState) { + return dscOnTraceState; + } + + // Else, we generate it from the span + const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client); + const jsonSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(rootSpan); + const attributes = jsonSpan.data || {}; + const maybeSampleRate = attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_5__.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; + + if (maybeSampleRate != null) { + dsc.sample_rate = `${maybeSampleRate}`; + } + + // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII + const source = attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_5__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + + // after JSON conversion, txn.name becomes jsonSpan.description + const name = jsonSpan.description; + if (source !== 'url' && name) { + dsc.transaction = name; + } + + // How can we even land here with hasTracingEnabled() returning false? + // Otel creates a Non-recording span in Tracing Without Performance mode when handling incoming requests + // So we end up with an active span that is not sampled (neither positively nor negatively) + if ((0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_6__.hasTracingEnabled)()) { + dsc.sampled = String((0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanIsSampled)(rootSpan)); + } + + client.emit('createDsc', dsc, rootSpan); + + return dsc; +} + +/** + * Convert a Span to a baggage header. + */ +function spanToBaggageHeader(span) { + const dsc = getDynamicSamplingContextFromSpan(span); + return (0,_utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_4__.dynamicSamplingContextToSentryBaggageHeader)(dsc); +} + + +//# sourceMappingURL=dynamicSamplingContext.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/errors.js": +/*!*******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/errors.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ registerSpanErrorInstrumentation: () => (/* binding */ registerSpanErrorInstrumentation) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_instrument_globalError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/instrument/globalError.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalError.js"); +/* harmony import */ var _utils_hoist_instrument_globalUnhandledRejection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/instrument/globalUnhandledRejection.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalUnhandledRejection.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _spanstatus_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./spanstatus.js */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); + + + + + + + +let errorsInstrumented = false; + +/** + * Ensure that global errors automatically set the active span status. + */ +function registerSpanErrorInstrumentation() { + if (errorsInstrumented) { + return; + } + + errorsInstrumented = true; + (0,_utils_hoist_instrument_globalError_js__WEBPACK_IMPORTED_MODULE_0__.addGlobalErrorInstrumentationHandler)(errorCallback); + (0,_utils_hoist_instrument_globalUnhandledRejection_js__WEBPACK_IMPORTED_MODULE_1__.addGlobalUnhandledRejectionInstrumentationHandler)(errorCallback); +} + +/** + * If an error or unhandled promise occurs, we mark the active root span as failed + */ +function errorCallback() { + const activeSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.getActiveSpan)(); + const rootSpan = activeSpan && (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRootSpan)(activeSpan); + if (rootSpan) { + const message = 'internal_error'; + _debug_build_js__WEBPACK_IMPORTED_MODULE_3__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_4__.logger.log(`[Tracing] Root span: ${message} -> Global error occurred`); + rootSpan.setStatus({ code: _spanstatus_js__WEBPACK_IMPORTED_MODULE_5__.SPAN_STATUS_ERROR, message }); + } +} + +// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the +// node.js default exit behaviour +errorCallback.tag = 'sentry_tracingErrorCallback'; + + +//# sourceMappingURL=errors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/hubextensions.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/hubextensions.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addTracingExtensions: () => (/* binding */ addTracingExtensions) +/* harmony export */ }); +/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "../../node_modules/@sentry/core/build/esm/tracing/errors.js"); + + +/** + * @deprecated Use `registerSpanErrorInstrumentation()` instead. In v9, this function will be removed. Note that you don't need to call this in Node-based SDKs or when using `browserTracingIntegration`. + */ +function addTracingExtensions() { + (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__.registerSpanErrorInstrumentation)(); +} + + +//# sourceMappingURL=hubextensions.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/idleSpan.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/idleSpan.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TRACING_DEFAULTS: () => (/* binding */ TRACING_DEFAULTS), +/* harmony export */ startIdleSpan: () => (/* binding */ startIdleSpan) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/hasTracingEnabled.js */ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/spanOnScope.js */ "../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sentryNonRecordingSpan.js */ "../../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js"); +/* harmony import */ var _spanstatus_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./spanstatus.js */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _trace_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./trace.js */ "../../node_modules/@sentry/core/build/esm/tracing/trace.js"); + + + + + + + + + + + + +const TRACING_DEFAULTS = { + idleTimeout: 1000, + finalTimeout: 30000, + childSpanTimeout: 15000, +}; + +const FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed'; +const FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout'; +const FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout'; +const FINISH_REASON_EXTERNAL_FINISH = 'externalFinish'; + +/** + * An idle span is a span that automatically finishes. It does this by tracking child spans as activities. + * An idle span is always the active span. + */ +function startIdleSpan(startSpanOptions, options = {}) { + // Activities store a list of active spans + const activities = new Map(); + + // We should not use heartbeat if we finished a span + let _finished = false; + + // Timer that tracks idleTimeout + let _idleTimeoutID; + + // The reason why the span was finished + let _finishReason = FINISH_REASON_EXTERNAL_FINISH; + + let _autoFinishAllowed = !options.disableAutoFinish; + + const _cleanupHooks = []; + + const { + idleTimeout = TRACING_DEFAULTS.idleTimeout, + finalTimeout = TRACING_DEFAULTS.finalTimeout, + childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout, + beforeSpanEnd, + } = options; + + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + + if (!client || !(0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_1__.hasTracingEnabled)()) { + return new _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_2__.SentryNonRecordingSpan(); + } + + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const previousActiveSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getActiveSpan)(); + const span = _startIdleSpan(startSpanOptions); + + // We patch span.end to ensure we can run some things before the span is ended + // eslint-disable-next-line @typescript-eslint/unbound-method + span.end = new Proxy(span.end, { + apply(target, thisArg, args) { + if (beforeSpanEnd) { + beforeSpanEnd(span); + } + + // Just ensuring that this keeps working, even if we ever have more arguments here + const [definedEndTimestamp, ...rest] = args; + const timestamp = definedEndTimestamp || (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)(); + const spanEndTimestamp = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanTimeInputToSeconds)(timestamp); + + // Ensure we end with the last span timestamp, if possible + const spans = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getSpanDescendants)(span).filter(child => child !== span); + + // If we have no spans, we just end, nothing else to do here + if (!spans.length) { + onIdleSpanEnded(spanEndTimestamp); + return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]); + } + + const childEndTimestamps = spans + .map(span => (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(span).timestamp) + .filter(timestamp => !!timestamp) ; + const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined; + + // In reality this should always exist here, but type-wise it may be undefined... + const spanStartTimestamp = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(span).start_timestamp; + + // The final endTimestamp should: + // * Never be before the span start timestamp + // * Be the latestSpanEndTimestamp, if there is one, and it is smaller than the passed span end timestamp + // * Otherwise be the passed end timestamp + // Final timestamp can never be after finalTimeout + const endTimestamp = Math.min( + spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1000 : Infinity, + Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)), + ); + + onIdleSpanEnded(endTimestamp); + return Reflect.apply(target, thisArg, [endTimestamp, ...rest]); + }, + }); + + /** + * Cancels the existing idle timeout, if there is one. + */ + function _cancelIdleTimeout() { + if (_idleTimeoutID) { + clearTimeout(_idleTimeoutID); + _idleTimeoutID = undefined; + } + } + + /** + * Restarts idle timeout, if there is no running idle timeout it will start one. + */ + function _restartIdleTimeout(endTimestamp) { + _cancelIdleTimeout(); + _idleTimeoutID = setTimeout(() => { + if (!_finished && activities.size === 0 && _autoFinishAllowed) { + _finishReason = FINISH_REASON_IDLE_TIMEOUT; + span.end(endTimestamp); + } + }, idleTimeout); + } + + /** + * Restarts child span timeout, if there is none running it will start one. + */ + function _restartChildSpanTimeout(endTimestamp) { + _idleTimeoutID = setTimeout(() => { + if (!_finished && _autoFinishAllowed) { + _finishReason = FINISH_REASON_HEARTBEAT_FAILED; + span.end(endTimestamp); + } + }, childSpanTimeout); + } + + /** + * Start tracking a specific activity. + * @param spanId The span id that represents the activity + */ + function _pushActivity(spanId) { + _cancelIdleTimeout(); + activities.set(spanId, true); + + const endTimestamp = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)(); + // We need to add the timeout here to have the real endtimestamp of the idle span + // Remember timestampInSeconds is in seconds, timeout is in ms + _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1000); + } + + /** + * Remove an activity from usage + * @param spanId The span id that represents the activity + */ + function _popActivity(spanId) { + if (activities.has(spanId)) { + activities.delete(spanId); + } + + if (activities.size === 0) { + const endTimestamp = (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)(); + // We need to add the timeout here to have the real endtimestamp of the idle span + // Remember timestampInSeconds is in seconds, timeout is in ms + _restartIdleTimeout(endTimestamp + idleTimeout / 1000); + } + } + + function onIdleSpanEnded(endTimestamp) { + _finished = true; + activities.clear(); + + _cleanupHooks.forEach(cleanup => cleanup()); + + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_5__._setSpanForScope)(scope, previousActiveSpan); + + const spanJSON = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(span); + + const { start_timestamp: startTimestamp } = spanJSON; + // This should never happen, but to make TS happy... + if (!startTimestamp) { + return; + } + + const attributes = spanJSON.data || {}; + if (!attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) { + span.setAttribute(_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_6__.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason); + } + + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.log(`[Tracing] Idle span "${spanJSON.op}" finished`); + + const childSpans = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getSpanDescendants)(span).filter(child => child !== span); + + let discardedSpans = 0; + childSpans.forEach(childSpan => { + // We cancel all pending spans with status "cancelled" to indicate the idle span was finished early + if (childSpan.isRecording()) { + childSpan.setStatus({ code: _spanstatus_js__WEBPACK_IMPORTED_MODULE_8__.SPAN_STATUS_ERROR, message: 'cancelled' }); + childSpan.end(endTimestamp); + _debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.log('[Tracing] Cancelling span since span ended early', JSON.stringify(childSpan, undefined, 2)); + } + + const childSpanJSON = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(childSpan); + const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON; + + const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp; + + // Add a delta with idle timeout so that we prevent false positives + const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1000; + const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; + + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD) { + const stringifiedSpan = JSON.stringify(childSpan, undefined, 2); + if (!spanStartedBeforeIdleSpanEnd) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.log('[Tracing] Discarding span since it happened after idle span was finished', stringifiedSpan); + } else if (!spanEndedBeforeFinalTimeout) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.log('[Tracing] Discarding span since it finished after idle span final timeout', stringifiedSpan); + } + } + + if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) { + (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.removeChildSpanFromSpan)(span, childSpan); + discardedSpans++; + } + }); + + if (discardedSpans > 0) { + span.setAttribute('sentry.idle_span_discarded_spans', discardedSpans); + } + } + + _cleanupHooks.push( + client.on('spanStart', startedSpan => { + // If we already finished the idle span, + // or if this is the idle span itself being started, + // or if the started span has already been closed, + // we don't care about it for activity + if (_finished || startedSpan === span || !!(0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(startedSpan).timestamp) { + return; + } + + const allSpans = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getSpanDescendants)(span); + + // If the span that was just started is a child of the idle span, we should track it + if (allSpans.includes(startedSpan)) { + _pushActivity(startedSpan.spanContext().spanId); + } + }), + ); + + _cleanupHooks.push( + client.on('spanEnd', endedSpan => { + if (_finished) { + return; + } + + _popActivity(endedSpan.spanContext().spanId); + }), + ); + + _cleanupHooks.push( + client.on('idleSpanEnableAutoFinish', spanToAllowAutoFinish => { + if (spanToAllowAutoFinish === span) { + _autoFinishAllowed = true; + _restartIdleTimeout(); + + if (activities.size) { + _restartChildSpanTimeout(); + } + } + }), + ); + + // We only start the initial idle timeout if we are not delaying the auto finish + if (!options.disableAutoFinish) { + _restartIdleTimeout(); + } + + setTimeout(() => { + if (!_finished) { + span.setStatus({ code: _spanstatus_js__WEBPACK_IMPORTED_MODULE_8__.SPAN_STATUS_ERROR, message: 'deadline_exceeded' }); + _finishReason = FINISH_REASON_FINAL_TIMEOUT; + span.end(); + } + }, finalTimeout); + + return span; +} + +function _startIdleSpan(options) { + const span = (0,_trace_js__WEBPACK_IMPORTED_MODULE_10__.startInactiveSpan)(options); + + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_5__._setSpanForScope)((0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(), span); + + _debug_build_js__WEBPACK_IMPORTED_MODULE_9__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_7__.logger.log('[Tracing] Started span is an idle span'); + + return span; +} + + +//# sourceMappingURL=idleSpan.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/logSpans.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/logSpans.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ logSpanEnd: () => (/* binding */ logSpanEnd), +/* harmony export */ logSpanStart: () => (/* binding */ logSpanStart) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + + +/** + * Print a log message for a started span. + */ +function logSpanStart(span) { + if (!_debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD) return; + + const { description = '< unknown name >', op = '< unknown op >', parent_span_id: parentSpanId } = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.spanToJSON)(span); + const { spanId } = span.spanContext(); + + const sampled = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.spanIsSampled)(span); + const rootSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.getRootSpan)(span); + const isRootSpan = rootSpan === span; + + const header = `[Tracing] Starting ${sampled ? 'sampled' : 'unsampled'} ${isRootSpan ? 'root ' : ''}span`; + + const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; + + if (parentSpanId) { + infoParts.push(`parent ID: ${parentSpanId}`); + } + + if (!isRootSpan) { + const { op, description } = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.spanToJSON)(rootSpan); + infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); + if (op) { + infoParts.push(`root op: ${op}`); + } + if (description) { + infoParts.push(`root description: ${description}`); + } + } + + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(`${header} + ${infoParts.join('\n ')}`); +} + +/** + * Print a log message for an ended span. + */ +function logSpanEnd(span) { + if (!_debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD) return; + + const { description = '< unknown name >', op = '< unknown op >' } = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.spanToJSON)(span); + const { spanId } = span.spanContext(); + const rootSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.getRootSpan)(span); + const isRootSpan = rootSpan === span; + + const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? 'root ' : ''}span "${description}" with ID ${spanId}`; + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(msg); +} + + +//# sourceMappingURL=logSpans.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/measurement.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/measurement.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ setMeasurement: () => (/* binding */ setMeasurement), +/* harmony export */ timedEventsToMeasurements: () => (/* binding */ timedEventsToMeasurements) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + + + + + + + +/** + * Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span + * as the 4th parameter. + */ +function setMeasurement(name, value, unit, activeSpan = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_0__.getActiveSpan)()) { + const rootSpan = activeSpan && (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_0__.getRootSpan)(activeSpan); + + if (rootSpan) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`); + rootSpan.addEvent(name, { + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value, + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit , + }); + } +} + +/** + * Convert timed events to measurements. + */ +function timedEventsToMeasurements(events) { + if (!events || events.length === 0) { + return undefined; + } + + const measurements = {}; + events.forEach(event => { + const attributes = event.attributes || {}; + const unit = attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] ; + const value = attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] ; + + if (typeof unit === 'string' && typeof value === 'number') { + measurements[event.name] = { value, unit }; + } + }); + + return measurements; +} + + +//# sourceMappingURL=measurement.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/sampling.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/sampling.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ sampleSpan: () => (/* binding */ sampleSpan) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/hasTracingEnabled.js */ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _utils_parseSampleRate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/parseSampleRate.js */ "../../node_modules/@sentry/core/build/esm/utils/parseSampleRate.js"); + + + + + +/** + * Makes a sampling decision for the given options. + * + * Called every time a root span is created. Only root spans which emerge with a `sampled` value of `true` will be + * sent to Sentry. + */ +function sampleSpan( + options, + samplingContext, +) { + // nothing to do if tracing is not enabled + if (!(0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__.hasTracingEnabled)(options)) { + return [false]; + } + + // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should + // work; prefer the hook if so + let sampleRate; + if (typeof options.tracesSampler === 'function') { + sampleRate = options.tracesSampler(samplingContext); + } else if (samplingContext.parentSampled !== undefined) { + sampleRate = samplingContext.parentSampled; + } else if (typeof options.tracesSampleRate !== 'undefined') { + sampleRate = options.tracesSampleRate; + } else { + // When `enableTracing === true`, we use a sample rate of 100% + sampleRate = 1; + } + + // Since this is coming from the user (or from a function provided by the user), who knows what we might get. + // (The only valid values are booleans or numbers between 0 and 1.) + const parsedSampleRate = (0,_utils_parseSampleRate_js__WEBPACK_IMPORTED_MODULE_1__.parseSampleRate)(sampleRate); + + if (parsedSampleRate === undefined) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.warn('[Tracing] Discarding transaction because of invalid sample rate.'); + return [false]; + } + + // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped + if (!parsedSampleRate) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.log( + `[Tracing] Discarding transaction because ${ + typeof options.tracesSampler === 'function' + ? 'tracesSampler returned 0 or false' + : 'a negative sampling decision was inherited or tracesSampleRate is set to 0' + }`, + ); + return [false, parsedSampleRate]; + } + + // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is + // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false. + const shouldSample = Math.random() < parsedSampleRate; + + // if we're not going to keep it, we're done + if (!shouldSample) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_2__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.log( + `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( + sampleRate, + )})`, + ); + return [false, parsedSampleRate]; + } + + return [true, parsedSampleRate]; +} + + +//# sourceMappingURL=sampling.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js": +/*!***********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SentryNonRecordingSpan: () => (/* binding */ SentryNonRecordingSpan) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + +/** + * A Sentry Span that is non-recording, meaning it will not be sent to Sentry. + */ +class SentryNonRecordingSpan { + + constructor(spanContext = {}) { + this._traceId = spanContext.traceId || (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)(); + this._spanId = spanContext.spanId || (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)().substring(16); + } + + /** @inheritdoc */ + spanContext() { + return { + spanId: this._spanId, + traceId: this._traceId, + traceFlags: _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_1__.TRACE_FLAG_NONE, + }; + } + + /** @inheritdoc */ + // eslint-disable-next-line @typescript-eslint/no-empty-function + end(_timestamp) {} + + /** @inheritdoc */ + setAttribute(_key, _value) { + return this; + } + + /** @inheritdoc */ + setAttributes(_values) { + return this; + } + + /** @inheritdoc */ + setStatus(_status) { + return this; + } + + /** @inheritdoc */ + updateName(_name) { + return this; + } + + /** @inheritdoc */ + isRecording() { + return false; + } + + /** @inheritdoc */ + addEvent( + _name, + _attributesOrStartTime, + _startTime, + ) { + return this; + } + + /** + * This should generally not be used, + * but we need it for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLink(_link) { + return this; + } + + /** + * This should generally not be used, + * but we need it for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLinks(_links) { + return this; + } + + /** + * This should generally not be used, + * but we need it for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + recordException(_exception, _time) { + // noop + } +} + + +//# sourceMappingURL=sentryNonRecordingSpan.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/sentrySpan.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/sentrySpan.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SentrySpan: () => (/* binding */ SentrySpan) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../envelope.js */ "../../node_modules/@sentry/core/build/esm/envelope.js"); +/* harmony import */ var _metrics_metric_summary_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../metrics/metric-summary.js */ "../../node_modules/@sentry/core/build/esm/metrics/metric-summary.js"); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dynamicSamplingContext.js */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _logSpans_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logSpans.js */ "../../node_modules/@sentry/core/build/esm/tracing/logSpans.js"); +/* harmony import */ var _measurement_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./measurement.js */ "../../node_modules/@sentry/core/build/esm/tracing/measurement.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/core/build/esm/tracing/utils.js"); + + + + + + + + + + + + + + + +const MAX_SPAN_COUNT = 1000; + +/** + * Span contains all data about a span + */ +class SentrySpan { + + /** Epoch timestamp in seconds when the span started. */ + + /** Epoch timestamp in seconds when the span ended. */ + + /** Internal keeper of the status */ + + /** The timed events added to this span. */ + + /** if true, treat span as a standalone span (not part of a transaction) */ + + /** + * You should never call the constructor manually, always use `Sentry.startSpan()` + * or other span methods. + * @internal + * @hideconstructor + * @hidden + */ + constructor(spanContext = {}) { + this._traceId = spanContext.traceId || (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)(); + this._spanId = spanContext.spanId || (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)().substring(16); + this._startTime = spanContext.startTimestamp || (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(); + + this._attributes = {}; + this.setAttributes({ + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual', + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op, + ...spanContext.attributes, + }); + + this._name = spanContext.name; + + if (spanContext.parentSpanId) { + this._parentSpanId = spanContext.parentSpanId; + } + // We want to include booleans as well here + if ('sampled' in spanContext) { + this._sampled = spanContext.sampled; + } + if (spanContext.endTimestamp) { + this._endTime = spanContext.endTimestamp; + } + + this._events = []; + + this._isStandaloneSpan = spanContext.isStandalone; + + // If the span is already ended, ensure we finalize the span immediately + if (this._endTime) { + this._onSpanEnded(); + } + } + + /** + * This should generally not be used, + * but it is needed for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLink(_link) { + return this; + } + + /** + * This should generally not be used, + * but it is needed for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLinks(_links) { + return this; + } + + /** + * This should generally not be used, + * but it is needed for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + recordException(_exception, _time) { + // noop + } + + /** @inheritdoc */ + spanContext() { + const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; + return { + spanId, + traceId, + traceFlags: sampled ? _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.TRACE_FLAG_SAMPLED : _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.TRACE_FLAG_NONE, + }; + } + + /** @inheritdoc */ + setAttribute(key, value) { + if (value === undefined) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._attributes[key]; + } else { + this._attributes[key] = value; + } + + return this; + } + + /** @inheritdoc */ + setAttributes(attributes) { + Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key])); + return this; + } + + /** + * This should generally not be used, + * but we need it for browser tracing where we want to adjust the start time afterwards. + * USE THIS WITH CAUTION! + * + * @hidden + * @internal + */ + updateStartTime(timeInput) { + this._startTime = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanTimeInputToSeconds)(timeInput); + } + + /** + * @inheritDoc + */ + setStatus(value) { + this._status = value; + return this; + } + + /** + * @inheritDoc + */ + updateName(name) { + this._name = name; + this.setAttribute(_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'custom'); + return this; + } + + /** @inheritdoc */ + end(endTimestamp) { + // If already ended, skip + if (this._endTime) { + return; + } + + this._endTime = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanTimeInputToSeconds)(endTimestamp); + (0,_logSpans_js__WEBPACK_IMPORTED_MODULE_4__.logSpanEnd)(this); + + this._onSpanEnded(); + } + + /** + * Get JSON representation of this span. + * + * @hidden + * @internal This method is purely for internal purposes and should not be used outside + * of SDK code. If you need to get a JSON representation of a span, + * use `spanToJSON(span)` instead. + */ + getSpanJSON() { + return (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_5__.dropUndefinedKeys)({ + data: this._attributes, + description: this._name, + op: this._attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_SENTRY_OP], + parent_span_id: this._parentSpanId, + span_id: this._spanId, + start_timestamp: this._startTime, + status: (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getStatusMessage)(this._status), + timestamp: this._endTime, + trace_id: this._traceId, + origin: this._attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] , + _metrics_summary: (0,_metrics_metric_summary_js__WEBPACK_IMPORTED_MODULE_6__.getMetricSummaryJsonForSpan)(this), + profile_id: this._attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_PROFILE_ID] , + exclusive_time: this._attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] , + measurements: (0,_measurement_js__WEBPACK_IMPORTED_MODULE_7__.timedEventsToMeasurements)(this._events), + is_segment: (this._isStandaloneSpan && (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(this) === this) || undefined, + segment_id: this._isStandaloneSpan ? (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(this).spanContext().spanId : undefined, + }); + } + + /** @inheritdoc */ + isRecording() { + return !this._endTime && !!this._sampled; + } + + /** + * @inheritdoc + */ + addEvent( + name, + attributesOrStartTime, + startTime, + ) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_8__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__.logger.log('[Tracing] Adding an event to span:', name); + + const time = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(); + const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; + + const event = { + name, + time: (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanTimeInputToSeconds)(time), + attributes, + }; + + this._events.push(event); + + return this; + } + + /** + * This method should generally not be used, + * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set. + * USE THIS WITH CAUTION! + * @internal + * @hidden + * @experimental + */ + isStandaloneSpan() { + return !!this._isStandaloneSpan; + } + + /** Emit `spanEnd` when the span is ended. */ + _onSpanEnded() { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_10__.getClient)(); + if (client) { + client.emit('spanEnd', this); + } + + // A segment span is basically the root span of a local span tree. + // So for now, this is either what we previously refer to as the root span, + // or a standalone span. + const isSegmentSpan = this._isStandaloneSpan || this === (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getRootSpan)(this); + + if (!isSegmentSpan) { + return; + } + + // if this is a standalone span, we send it immediately + if (this._isStandaloneSpan) { + if (this._sampled) { + sendSpanEnvelope((0,_envelope_js__WEBPACK_IMPORTED_MODULE_11__.createSpanEnvelope)([this], client)); + } else { + _debug_build_js__WEBPACK_IMPORTED_MODULE_8__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__.logger.log('[Tracing] Discarding standalone span because its trace was not chosen to be sampled.'); + if (client) { + client.recordDroppedEvent('sample_rate', 'span'); + } + } + return; + } + + const transactionEvent = this._convertSpanToTransaction(); + if (transactionEvent) { + const scope = (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.getCapturedScopesOnSpan)(this).scope || (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_10__.getCurrentScope)(); + scope.captureEvent(transactionEvent); + } + } + + /** + * Finish the transaction & prepare the event to send to Sentry. + */ + _convertSpanToTransaction() { + // We can only convert finished spans + if (!isFullFinishedSpan((0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(this))) { + return undefined; + } + + if (!this._name) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_8__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__.logger.warn('Transaction has no name, falling back to ``.'); + this._name = ''; + } + + const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.getCapturedScopesOnSpan)(this); + const scope = capturedSpanScope || (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_10__.getCurrentScope)(); + const client = scope.getClient() || (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_10__.getClient)(); + + if (this._sampled !== true) { + // At this point if `sampled !== true` we want to discard the transaction. + _debug_build_js__WEBPACK_IMPORTED_MODULE_8__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__.logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.'); + + if (client) { + client.recordDroppedEvent('sample_rate', 'transaction'); + } + + return undefined; + } + + // The transaction span itself as well as any potential standalone spans should be filtered out + const finishedSpans = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.getSpanDescendants)(this).filter(span => span !== this && !isStandaloneSpan(span)); + + const spans = finishedSpans.map(span => (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToJSON)(span)).filter(isFullFinishedSpan); + + const source = this._attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_2__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ; + + const transaction = { + contexts: { + trace: (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_3__.spanToTransactionTraceContext)(this), + }, + spans: + // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here + // we do not use spans anymore after this point + spans.length > MAX_SPAN_COUNT + ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) + : spans, + start_timestamp: this._startTime, + timestamp: this._endTime, + transaction: this._name, + type: 'transaction', + sdkProcessingMetadata: { + capturedSpanScope, + capturedSpanIsolationScope, + ...(0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_5__.dropUndefinedKeys)({ + dynamicSamplingContext: (0,_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_13__.getDynamicSamplingContextFromSpan)(this), + }), + }, + _metrics_summary: (0,_metrics_metric_summary_js__WEBPACK_IMPORTED_MODULE_6__.getMetricSummaryJsonForSpan)(this), + ...(source && { + transaction_info: { + source, + }, + }), + }; + + const measurements = (0,_measurement_js__WEBPACK_IMPORTED_MODULE_7__.timedEventsToMeasurements)(this._events); + const hasMeasurements = measurements && Object.keys(measurements).length; + + if (hasMeasurements) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_8__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__.logger.log( + '[Measurements] Adding measurements to transaction event', + JSON.stringify(measurements, undefined, 2), + ); + transaction.measurements = measurements; + } + + return transaction; + } +} + +function isSpanTimeInput(value) { + return (value && typeof value === 'number') || value instanceof Date || Array.isArray(value); +} + +// We want to filter out any incomplete SpanJSON objects +function isFullFinishedSpan(input) { + return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; +} + +/** `SentrySpan`s can be sent as a standalone span rather than belonging to a transaction */ +function isStandaloneSpan(span) { + return span instanceof SentrySpan && span.isStandaloneSpan(); +} + +/** + * Sends a `SpanEnvelope`. + * + * Note: If the envelope's spans are dropped, e.g. via `beforeSendSpan`, + * the envelope will not be sent either. + */ +function sendSpanEnvelope(envelope) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_10__.getClient)(); + if (!client) { + return; + } + + const spanItems = envelope[1]; + if (!spanItems || spanItems.length === 0) { + client.recordDroppedEvent('before_send', 'span'); + return; + } + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + client.sendEnvelope(envelope); +} + + +//# sourceMappingURL=sentrySpan.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SPAN_STATUS_ERROR: () => (/* binding */ SPAN_STATUS_ERROR), +/* harmony export */ SPAN_STATUS_OK: () => (/* binding */ SPAN_STATUS_OK), +/* harmony export */ SPAN_STATUS_UNSET: () => (/* binding */ SPAN_STATUS_UNSET), +/* harmony export */ getSpanStatusFromHttpCode: () => (/* binding */ getSpanStatusFromHttpCode), +/* harmony export */ setHttpStatus: () => (/* binding */ setHttpStatus) +/* harmony export */ }); +const SPAN_STATUS_UNSET = 0; +const SPAN_STATUS_OK = 1; +const SPAN_STATUS_ERROR = 2; + +/** + * Converts a HTTP status code into a sentry status with a message. + * + * @param httpStatus The HTTP response status code. + * @returns The span status or unknown_error. + */ +// https://develop.sentry.dev/sdk/event-payloads/span/ +function getSpanStatusFromHttpCode(httpStatus) { + if (httpStatus < 400 && httpStatus >= 100) { + return { code: SPAN_STATUS_OK }; + } + + if (httpStatus >= 400 && httpStatus < 500) { + switch (httpStatus) { + case 401: + return { code: SPAN_STATUS_ERROR, message: 'unauthenticated' }; + case 403: + return { code: SPAN_STATUS_ERROR, message: 'permission_denied' }; + case 404: + return { code: SPAN_STATUS_ERROR, message: 'not_found' }; + case 409: + return { code: SPAN_STATUS_ERROR, message: 'already_exists' }; + case 413: + return { code: SPAN_STATUS_ERROR, message: 'failed_precondition' }; + case 429: + return { code: SPAN_STATUS_ERROR, message: 'resource_exhausted' }; + case 499: + return { code: SPAN_STATUS_ERROR, message: 'cancelled' }; + default: + return { code: SPAN_STATUS_ERROR, message: 'invalid_argument' }; + } + } + + if (httpStatus >= 500 && httpStatus < 600) { + switch (httpStatus) { + case 501: + return { code: SPAN_STATUS_ERROR, message: 'unimplemented' }; + case 503: + return { code: SPAN_STATUS_ERROR, message: 'unavailable' }; + case 504: + return { code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' }; + default: + return { code: SPAN_STATUS_ERROR, message: 'internal_error' }; + } + } + + return { code: SPAN_STATUS_ERROR, message: 'unknown_error' }; +} + +/** + * Sets the Http status attributes on the current span based on the http code. + * Additionally, the span's status is updated, depending on the http code. + */ +function setHttpStatus(span, httpStatus) { + span.setAttribute('http.response.status_code', httpStatus); + + const spanStatus = getSpanStatusFromHttpCode(httpStatus); + if (spanStatus.message !== 'unknown_error') { + span.setStatus(spanStatus); + } +} + + +//# sourceMappingURL=spanstatus.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/trace.js": +/*!******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/trace.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ continueTrace: () => (/* binding */ continueTrace), +/* harmony export */ startInactiveSpan: () => (/* binding */ startInactiveSpan), +/* harmony export */ startNewTrace: () => (/* binding */ startNewTrace), +/* harmony export */ startSpan: () => (/* binding */ startSpan), +/* harmony export */ startSpanManual: () => (/* binding */ startSpanManual), +/* harmony export */ suppressTracing: () => (/* binding */ suppressTracing), +/* harmony export */ withActiveSpan: () => (/* binding */ withActiveSpan) +/* harmony export */ }); +/* harmony import */ var _carrier_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../carrier.js */ "../../node_modules/@sentry/core/build/esm/carrier.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _asyncContext_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../asyncContext/index.js */ "../../node_modules/@sentry/core/build/esm/asyncContext/index.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_propagationContext_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils-hoist/propagationContext.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js"); +/* harmony import */ var _utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/tracing.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/tracing.js"); +/* harmony import */ var _utils_handleCallbackErrors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/handleCallbackErrors.js */ "../../node_modules/@sentry/core/build/esm/utils/handleCallbackErrors.js"); +/* harmony import */ var _utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/hasTracingEnabled.js */ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/spanOnScope.js */ "../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js"); +/* harmony import */ var _utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dynamicSamplingContext.js */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _logSpans_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./logSpans.js */ "../../node_modules/@sentry/core/build/esm/tracing/logSpans.js"); +/* harmony import */ var _sampling_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./sampling.js */ "../../node_modules/@sentry/core/build/esm/tracing/sampling.js"); +/* harmony import */ var _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sentryNonRecordingSpan.js */ "../../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js"); +/* harmony import */ var _sentrySpan_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./sentrySpan.js */ "../../node_modules/@sentry/core/build/esm/tracing/sentrySpan.js"); +/* harmony import */ var _spanstatus_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./spanstatus.js */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils.js */ "../../node_modules/@sentry/core/build/esm/tracing/utils.js"); + + + + + + + + + + + + + + + + + + + + +const SUPPRESS_TRACING_KEY = '__SENTRY_SUPPRESS_TRACING__'; + +/** + * Wraps a function with a transaction/span and finishes the span after the function is done. + * The created span is the active span and will be used as parent by other spans created inside the function + * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. + * + * If you want to create a span that is not set as active, use {@link startInactiveSpan}. + * + * You'll always get a span passed to the callback, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startSpan(options, callback) { + const acs = getAcs(); + if (acs.startSpan) { + return acs.startSpan(options, callback); + } + + const spanArguments = parseSentrySpanArguments(options); + const { forceTransaction, parentSpan: customParentSpan } = options; + + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(options.scope, () => { + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const parentSpan = getParentSpan(scope); + + const shouldSkipSpan = options.onlyIfParent && !parentSpan; + const activeSpan = shouldSkipSpan + ? new _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_1__.SentryNonRecordingSpan() + : createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, + }); + + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_2__._setSpanForScope)(scope, activeSpan); + + return (0,_utils_handleCallbackErrors_js__WEBPACK_IMPORTED_MODULE_3__.handleCallbackErrors)( + () => callback(activeSpan), + () => { + // Only update the span status if it hasn't been changed yet, and the span is not yet finished + const { status } = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(activeSpan); + if (activeSpan.isRecording() && (!status || status === 'ok')) { + activeSpan.setStatus({ code: _spanstatus_js__WEBPACK_IMPORTED_MODULE_5__.SPAN_STATUS_ERROR, message: 'internal_error' }); + } + }, + () => activeSpan.end(), + ); + }); + }); +} + +/** + * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span + * after the function is done automatically. You'll have to call `span.end()` manually. + * + * The created span is the active span and will be used as parent by other spans created inside the function + * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. + * + * You'll always get a span passed to the callback, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startSpanManual(options, callback) { + const acs = getAcs(); + if (acs.startSpanManual) { + return acs.startSpanManual(options, callback); + } + + const spanArguments = parseSentrySpanArguments(options); + const { forceTransaction, parentSpan: customParentSpan } = options; + + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(options.scope, () => { + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const parentSpan = getParentSpan(scope); + + const shouldSkipSpan = options.onlyIfParent && !parentSpan; + const activeSpan = shouldSkipSpan + ? new _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_1__.SentryNonRecordingSpan() + : createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, + }); + + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_2__._setSpanForScope)(scope, activeSpan); + + function finishAndSetSpan() { + activeSpan.end(); + } + + return (0,_utils_handleCallbackErrors_js__WEBPACK_IMPORTED_MODULE_3__.handleCallbackErrors)( + () => callback(activeSpan, finishAndSetSpan), + () => { + // Only update the span status if it hasn't been changed yet, and the span is not yet finished + const { status } = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.spanToJSON)(activeSpan); + if (activeSpan.isRecording() && (!status || status === 'ok')) { + activeSpan.setStatus({ code: _spanstatus_js__WEBPACK_IMPORTED_MODULE_5__.SPAN_STATUS_ERROR, message: 'internal_error' }); + } + }, + ); + }); + }); +} + +/** + * Creates a span. This span is not set as active, so will not get automatic instrumentation spans + * as children or be able to be accessed via `Sentry.getActiveSpan()`. + * + * If you want to create a span that is set as active, use {@link startSpan}. + * + * This function will always return a span, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startInactiveSpan(options) { + const acs = getAcs(); + if (acs.startInactiveSpan) { + return acs.startInactiveSpan(options); + } + + const spanArguments = parseSentrySpanArguments(options); + const { forceTransaction, parentSpan: customParentSpan } = options; + + // If `options.scope` is defined, we use this as as a wrapper, + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = options.scope + ? (callback) => (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(options.scope, callback) + : customParentSpan !== undefined + ? (callback) => withActiveSpan(customParentSpan, callback) + : (callback) => callback(); + + return wrapper(() => { + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const parentSpan = getParentSpan(scope); + + const shouldSkipSpan = options.onlyIfParent && !parentSpan; + + if (shouldSkipSpan) { + return new _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_1__.SentryNonRecordingSpan(); + } + + return createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, + }); + }); +} + +/** + * Continue a trace from `sentry-trace` and `baggage` values. + * These values can be obtained from incoming request headers, or in the browser from `` + * and `` HTML tags. + * + * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically + * be attached to the incoming trace. + */ +const continueTrace = ( + { + sentryTrace, + baggage, + } + +, + callback, +) => { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(scope => { + const propagationContext = (0,_utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_6__.propagationContextFromHeaders)(sentryTrace, baggage); + scope.setPropagationContext(propagationContext); + return callback(); + }); +}; + +/** + * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be + * passed `null` to start an entirely new span tree. + * + * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed, + * spans started within the callback will not be attached to a parent span. + * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope. + * @returns the value returned from the provided callback function. + */ +function withActiveSpan(span, callback) { + const acs = getAcs(); + if (acs.withActiveSpan) { + return acs.withActiveSpan(span, callback); + } + + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(scope => { + (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_2__._setSpanForScope)(scope, span || undefined); + return callback(scope); + }); +} + +/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */ +function suppressTracing(callback) { + const acs = getAcs(); + + if (acs.suppressTracing) { + return acs.suppressTracing(callback); + } + + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(scope => { + scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true }); + return callback(); + }); +} + +/** + * Starts a new trace for the duration of the provided callback. Spans started within the + * callback will be part of the new trace instead of a potentially previously started trace. + * + * Important: Only use this function if you want to override the default trace lifetime and + * propagation mechanism of the SDK for the duration and scope of the provided callback. + * The newly created trace will also be the root of a new distributed trace, for example if + * you make http requests within the callback. + * This function might be useful if the operation you want to instrument should not be part + * of a potentially ongoing trace. + * + * Default behavior: + * - Server-side: A new trace is started for each incoming request. + * - Browser: A new trace is started for each page our route. Navigating to a new route + * or page will automatically create a new trace. + */ +function startNewTrace(callback) { + return (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.withScope)(scope => { + scope.setPropagationContext((0,_utils_hoist_propagationContext_js__WEBPACK_IMPORTED_MODULE_7__.generatePropagationContext)()); + _debug_build_js__WEBPACK_IMPORTED_MODULE_8__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_9__.logger.info(`Starting a new trace with id ${scope.getPropagationContext().traceId}`); + return withActiveSpan(null, callback); + }); +} + +function createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, +} + +) { + if (!(0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_10__.hasTracingEnabled)()) { + return new _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_1__.SentryNonRecordingSpan(); + } + + const isolationScope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getIsolationScope)(); + + let span; + if (parentSpan && !forceTransaction) { + span = _startChildSpan(parentSpan, scope, spanArguments); + (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.addChildSpanToSpan)(parentSpan, span); + } else if (parentSpan) { + // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope + const dsc = (0,_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_11__.getDynamicSamplingContextFromSpan)(parentSpan); + const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); + const parentSampled = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.spanIsSampled)(parentSpan); + + span = _startRootSpan( + { + traceId, + parentSpanId, + ...spanArguments, + }, + scope, + parentSampled, + ); + + (0,_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_11__.freezeDscOnSpan)(span, dsc); + } else { + const { + traceId, + dsc, + parentSpanId, + sampled: parentSampled, + } = { + ...isolationScope.getPropagationContext(), + ...scope.getPropagationContext(), + }; + + span = _startRootSpan( + { + traceId, + parentSpanId, + ...spanArguments, + }, + scope, + parentSampled, + ); + + if (dsc) { + (0,_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_11__.freezeDscOnSpan)(span, dsc); + } + } + + (0,_logSpans_js__WEBPACK_IMPORTED_MODULE_12__.logSpanStart)(span); + + (0,_utils_js__WEBPACK_IMPORTED_MODULE_13__.setCapturedScopesOnSpan)(span, scope, isolationScope); + + return span; +} + +/** + * This converts StartSpanOptions to SentrySpanArguments. + * For the most part (for now) we accept the same options, + * but some of them need to be transformed. + */ +function parseSentrySpanArguments(options) { + const exp = options.experimental || {}; + const initialCtx = { + isStandalone: exp.standalone, + ...options, + }; + + if (options.startTime) { + const ctx = { ...initialCtx }; + ctx.startTimestamp = (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.spanTimeInputToSeconds)(options.startTime); + delete ctx.startTime; + return ctx; + } + + return initialCtx; +} + +function getAcs() { + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_14__.getMainCarrier)(); + return (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_15__.getAsyncContextStrategy)(carrier); +} + +function _startRootSpan(spanArguments, scope, parentSampled) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + const options = (client && client.getOptions()) || {}; + + const { name = '', attributes } = spanArguments; + const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] + ? [false] + : (0,_sampling_js__WEBPACK_IMPORTED_MODULE_16__.sampleSpan)(options, { + name, + parentSampled, + attributes, + transactionContext: { + name, + parentSampled, + }, + }); + + const rootSpan = new _sentrySpan_js__WEBPACK_IMPORTED_MODULE_17__.SentrySpan({ + ...spanArguments, + attributes: { + [_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_18__.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', + ...spanArguments.attributes, + }, + sampled, + }); + if (sampleRate !== undefined) { + rootSpan.setAttribute(_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_18__.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate); + } + + if (client) { + client.emit('spanStart', rootSpan); + } + + return rootSpan; +} + +/** + * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`. + * This inherits the sampling decision from the parent span. + */ +function _startChildSpan(parentSpan, scope, spanArguments) { + const { spanId, traceId } = parentSpan.spanContext(); + const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.spanIsSampled)(parentSpan); + + const childSpan = sampled + ? new _sentrySpan_js__WEBPACK_IMPORTED_MODULE_17__.SentrySpan({ + ...spanArguments, + parentSpanId: spanId, + traceId, + sampled, + }) + : new _sentryNonRecordingSpan_js__WEBPACK_IMPORTED_MODULE_1__.SentryNonRecordingSpan({ traceId }); + + (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.addChildSpanToSpan)(parentSpan, childSpan); + + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + if (client) { + client.emit('spanStart', childSpan); + // If it has an endTimestamp, it's already ended + if (spanArguments.endTimestamp) { + client.emit('spanEnd', childSpan); + } + } + + return childSpan; +} + +function getParentSpan(scope) { + const span = (0,_utils_spanOnScope_js__WEBPACK_IMPORTED_MODULE_2__._getSpanForScope)(scope) ; + + if (!span) { + return undefined; + } + + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + const options = client ? client.getOptions() : {}; + if (options.parentSpanIsAlwaysRootSpan) { + return (0,_utils_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.getRootSpan)(span) ; + } + + return span; +} + +function getActiveSpanWrapper(parentSpan) { + return parentSpan !== undefined + ? (callback) => { + return withActiveSpan(parentSpan, callback); + } + : (callback) => callback(); +} + + +//# sourceMappingURL=trace.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/tracing/utils.js": +/*!******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/tracing/utils.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getCapturedScopesOnSpan: () => (/* binding */ getCapturedScopesOnSpan), +/* harmony export */ setCapturedScopesOnSpan: () => (/* binding */ setCapturedScopesOnSpan) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + +const SCOPE_ON_START_SPAN_FIELD = '_sentryScope'; +const ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope'; + +/** Store the scope & isolation scope for a span, which can the be used when it is finished. */ +function setCapturedScopesOnSpan(span, scope, isolationScope) { + if (span) { + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.addNonEnumerableProperty)(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope); + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.addNonEnumerableProperty)(span, SCOPE_ON_START_SPAN_FIELD, scope); + } +} + +/** + * Grabs the scope and isolation scope off a span that were active when the span was started. + */ +function getCapturedScopesOnSpan(span) { + return { + scope: (span )[SCOPE_ON_START_SPAN_FIELD], + isolationScope: (span )[ISOLATION_SCOPE_ON_START_SPAN_FIELD], + }; +} + + +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/transports/base.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/transports/base.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_TRANSPORT_BUFFER_SIZE: () => (/* binding */ DEFAULT_TRANSPORT_BUFFER_SIZE), +/* harmony export */ createTransport: () => (/* binding */ createTransport) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/error.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/error.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_promisebuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/promisebuffer.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/promisebuffer.js"); +/* harmony import */ var _utils_hoist_ratelimit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/ratelimit.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/ratelimit.js"); +/* harmony import */ var _utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/syncpromise.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js"); + + + + + + + + +const DEFAULT_TRANSPORT_BUFFER_SIZE = 64; + +/** + * Creates an instance of a Sentry `Transport` + * + * @param options + * @param makeRequest + */ +function createTransport( + options, + makeRequest, + buffer = (0,_utils_hoist_promisebuffer_js__WEBPACK_IMPORTED_MODULE_0__.makePromiseBuffer)( + options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE, + ), +) { + let rateLimits = {}; + const flush = (timeout) => buffer.drain(timeout); + + function send(envelope) { + const filteredEnvelopeItems = []; + + // Drop rate limited items from envelope + (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(envelope, (item, type) => { + const dataCategory = (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.envelopeItemTypeToDataCategory)(type); + if ((0,_utils_hoist_ratelimit_js__WEBPACK_IMPORTED_MODULE_2__.isRateLimited)(rateLimits, dataCategory)) { + const event = getEventForEnvelopeItem(item, type); + options.recordDroppedEvent('ratelimit_backoff', dataCategory, event); + } else { + filteredEnvelopeItems.push(item); + } + }); + + // Skip sending if envelope is empty after filtering out rate limited events + if (filteredEnvelopeItems.length === 0) { + return (0,_utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)({}); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const filteredEnvelope = (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(envelope[0], filteredEnvelopeItems ); + + // Creates client report for each item in an envelope + const recordEnvelopeLoss = (reason) => { + (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(filteredEnvelope, (item, type) => { + const event = getEventForEnvelopeItem(item, type); + options.recordDroppedEvent(reason, (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.envelopeItemTypeToDataCategory)(type), event); + }); + }; + + const requestTask = () => + makeRequest({ body: (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_1__.serializeEnvelope)(filteredEnvelope) }).then( + response => { + // We don't want to throw on NOK responses, but we want to at least log them + if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_4__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_5__.logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); + } + + rateLimits = (0,_utils_hoist_ratelimit_js__WEBPACK_IMPORTED_MODULE_2__.updateRateLimits)(rateLimits, response); + return response; + }, + error => { + recordEnvelopeLoss('network_error'); + throw error; + }, + ); + + return buffer.add(requestTask).then( + result => result, + error => { + if (error instanceof _utils_hoist_error_js__WEBPACK_IMPORTED_MODULE_6__.SentryError) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_4__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_5__.logger.error('Skipped sending event because buffer is full.'); + recordEnvelopeLoss('queue_overflow'); + return (0,_utils_hoist_syncpromise_js__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)({}); + } else { + throw error; + } + }, + ); + } + + return { + send, + flush, + }; +} + +function getEventForEnvelopeItem(item, type) { + if (type !== 'event' && type !== 'transaction') { + return undefined; + } + + return Array.isArray(item) ? (item )[1] : undefined; +} + + +//# sourceMappingURL=base.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/transports/multiplexed.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/transports/multiplexed.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ eventFromEnvelope: () => (/* binding */ eventFromEnvelope), +/* harmony export */ makeMultiplexedTransport: () => (/* binding */ makeMultiplexedTransport) +/* harmony export */ }); +/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../api.js */ "../../node_modules/@sentry/core/build/esm/api.js"); +/* harmony import */ var _utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/dsn.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); + + + + +/** + * Gets an event from an envelope. + * + * This is only exported for use in the tests + */ +function eventFromEnvelope(env, types) { + let event; + + (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.forEachEnvelopeItem)(env, (item, type) => { + if (types.includes(type)) { + event = Array.isArray(item) ? (item )[1] : undefined; + } + // bail out if we found an event + return !!event; + }); + + return event; +} + +/** + * Creates a transport that overrides the release on all events. + */ +function makeOverrideReleaseTransport( + createTransport, + release, +) { + return options => { + const transport = createTransport(options); + + return { + ...transport, + send: async (envelope) => { + const event = eventFromEnvelope(envelope, ['event', 'transaction', 'profile', 'replay_event']); + + if (event) { + event.release = release; + } + return transport.send(envelope); + }, + }; + }; +} + +/** Overrides the DSN in the envelope header */ +function overrideDsn(envelope, dsn) { + return (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_0__.createEnvelope)( + dsn + ? { + ...envelope[0], + dsn, + } + : envelope[0], + envelope[1], + ); +} + +/** + * Creates a transport that can send events to different DSNs depending on the envelope contents. + */ +function makeMultiplexedTransport( + createTransport, + matcher, +) { + return options => { + const fallbackTransport = createTransport(options); + const otherTransports = new Map(); + + function getTransport(dsn, release) { + // We create a transport for every unique dsn/release combination as there may be code from multiple releases in + // use at the same time + const key = release ? `${dsn}:${release}` : dsn; + + let transport = otherTransports.get(key); + + if (!transport) { + const validatedDsn = (0,_utils_hoist_dsn_js__WEBPACK_IMPORTED_MODULE_1__.dsnFromString)(dsn); + if (!validatedDsn) { + return undefined; + } + const url = (0,_api_js__WEBPACK_IMPORTED_MODULE_2__.getEnvelopeEndpointWithUrlEncodedAuth)(validatedDsn, options.tunnel); + + transport = release + ? makeOverrideReleaseTransport(createTransport, release)({ ...options, url }) + : createTransport({ ...options, url }); + + otherTransports.set(key, transport); + } + + return [dsn, transport]; + } + + async function send(envelope) { + function getEvent(types) { + const eventTypes = types && types.length ? types : ['event']; + return eventFromEnvelope(envelope, eventTypes); + } + + const transports = matcher({ envelope, getEvent }) + .map(result => { + if (typeof result === 'string') { + return getTransport(result, undefined); + } else { + return getTransport(result.dsn, result.release); + } + }) + .filter((t) => !!t); + + // If we have no transports to send to, use the fallback transport + // Don't override the DSN in the header for the fallback transport. '' is falsy + const transportsWithFallback = transports.length ? transports : [['', fallbackTransport]]; + + const results = (await Promise.all( + transportsWithFallback.map(([dsn, transport]) => transport.send(overrideDsn(envelope, dsn))), + )) ; + + return results[0]; + } + + async function flush(timeout) { + const allTransports = [...otherTransports.values(), fallbackTransport]; + const results = await Promise.all(allTransports.map(transport => transport.flush(timeout))); + return results.every(r => r); + } + + return { + send, + flush, + }; + }; +} + + +//# sourceMappingURL=multiplexed.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/transports/offline.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/transports/offline.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MIN_DELAY: () => (/* binding */ MIN_DELAY), +/* harmony export */ START_DELAY: () => (/* binding */ START_DELAY), +/* harmony export */ makeOfflineTransport: () => (/* binding */ makeOfflineTransport) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_ratelimit_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils-hoist/ratelimit.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/ratelimit.js"); + + + + + +const MIN_DELAY = 100; // 100 ms +const START_DELAY = 5000; // 5 seconds +const MAX_DELAY = 3.6e6; // 1 hour + +/** + * Wraps a transport and stores and retries events when they fail to send. + * + * @param createTransport The transport to wrap. + */ +function makeOfflineTransport( + createTransport, +) { + function log(...args) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.info('[Offline]:', ...args); + } + + return options => { + const transport = createTransport(options); + + if (!options.createStore) { + throw new Error('No `createStore` function was provided'); + } + + const store = options.createStore(options); + + let retryDelay = START_DELAY; + let flushTimer; + + function shouldQueue(env, error, retryDelay) { + // We want to drop client reports because they can be generated when we retry sending events while offline. + if ((0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_2__.envelopeContainsItemType)(env, ['client_report'])) { + return false; + } + + if (options.shouldStore) { + return options.shouldStore(env, error, retryDelay); + } + + return true; + } + + function flushIn(delay) { + if (flushTimer) { + clearTimeout(flushTimer ); + } + + flushTimer = setTimeout(async () => { + flushTimer = undefined; + + const found = await store.shift(); + if (found) { + log('Attempting to send previously queued event'); + + // We should to update the sent_at timestamp to the current time. + found[0].sent_at = new Date().toISOString(); + + void send(found, true).catch(e => { + log('Failed to retry sending', e); + }); + } + }, delay) ; + + // We need to unref the timer in node.js, otherwise the node process never exit. + if (typeof flushTimer !== 'number' && flushTimer.unref) { + flushTimer.unref(); + } + } + + function flushWithBackOff() { + if (flushTimer) { + return; + } + + flushIn(retryDelay); + + retryDelay = Math.min(retryDelay * 2, MAX_DELAY); + } + + async function send(envelope, isRetry = false) { + // We queue all replay envelopes to avoid multiple replay envelopes being sent at the same time. If one fails, we + // need to retry them in order. + if (!isRetry && (0,_utils_hoist_envelope_js__WEBPACK_IMPORTED_MODULE_2__.envelopeContainsItemType)(envelope, ['replay_event', 'replay_recording'])) { + await store.push(envelope); + flushIn(MIN_DELAY); + return {}; + } + + try { + const result = await transport.send(envelope); + + let delay = MIN_DELAY; + + if (result) { + // If there's a retry-after header, use that as the next delay. + if (result.headers && result.headers['retry-after']) { + delay = (0,_utils_hoist_ratelimit_js__WEBPACK_IMPORTED_MODULE_3__.parseRetryAfterHeader)(result.headers['retry-after']); + } else if (result.headers && result.headers['x-sentry-rate-limits']) { + delay = 60000; // 60 seconds + } // If we have a server error, return now so we don't flush the queue. + else if ((result.statusCode || 0) >= 400) { + return result; + } + } + + flushIn(delay); + retryDelay = START_DELAY; + return result; + } catch (e) { + if (await shouldQueue(envelope, e , retryDelay)) { + // If this envelope was a retry, we want to add it to the front of the queue so it's retried again first. + if (isRetry) { + await store.unshift(envelope); + } else { + await store.push(envelope); + } + flushWithBackOff(); + log('Error sending. Event queued.', e ); + return {}; + } else { + throw e; + } + } + } + + if (options.flushAtStartup) { + flushWithBackOff(); + } + + return { + send, + flush: t => transport.flush(t), + }; + }; +} + + +//# sourceMappingURL=offline.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/aggregate-errors.js": +/*!*********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/aggregate-errors.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyAggregateErrorsToEvent: () => (/* binding */ applyAggregateErrorsToEvent) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); + + + +/** + * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter. + */ +function applyAggregateErrorsToEvent( + exceptionFromErrorImplementation, + parser, + maxValueLimit = 250, + key, + limit, + event, + hint, +) { + if (!event.exception || !event.exception.values || !hint || !(0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(hint.originalException, Error)) { + return; + } + + // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error + const originalException = + event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined; + + // We only create exception grouping if there is an exception in the event. + if (originalException) { + event.exception.values = truncateAggregateExceptions( + aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + hint.originalException , + key, + event.exception.values, + originalException, + 0, + ), + maxValueLimit, + ); + } +} + +function aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + error, + key, + prevExceptions, + exception, + exceptionId, +) { + if (prevExceptions.length >= limit + 1) { + return prevExceptions; + } + + let newExceptions = [...prevExceptions]; + + // Recursively call this function in order to walk down a chain of errors + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(error[key], Error)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId); + const newException = exceptionFromErrorImplementation(parser, error[key]); + const newExceptionId = newExceptions.length; + applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); + newExceptions = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + error[key], + key, + [newException, ...newExceptions], + newException, + newExceptionId, + ); + } + + // This will create exception grouping for AggregateErrors + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError + if (Array.isArray(error.errors)) { + error.errors.forEach((childError, i) => { + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(childError, Error)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId); + const newException = exceptionFromErrorImplementation(parser, childError); + const newExceptionId = newExceptions.length; + applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); + newExceptions = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + childError, + key, + [newException, ...newExceptions], + newException, + newExceptionId, + ); + } + }); + } + + return newExceptions; +} + +function applyExceptionGroupFieldsForParentException(exception, exceptionId) { + // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. + exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; + + exception.mechanism = { + ...exception.mechanism, + ...(exception.type === 'AggregateError' && { is_exception_group: true }), + exception_id: exceptionId, + }; +} + +function applyExceptionGroupFieldsForChildException( + exception, + source, + exceptionId, + parentId, +) { + // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. + exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; + + exception.mechanism = { + ...exception.mechanism, + type: 'chained', + source, + exception_id: exceptionId, + parent_id: parentId, + }; +} + +/** + * Truncate the message (exception.value) of all exceptions in the event. + * Because this event processor is ran after `applyClientOptions`, + * we need to truncate the message of the added exceptions here. + */ +function truncateAggregateExceptions(exceptions, maxValueLength) { + return exceptions.map(exception => { + if (exception.value) { + exception.value = (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.truncate)(exception.value, maxValueLength); + } + return exception; + }); +} + + +//# sourceMappingURL=aggregate-errors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/baggage.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/baggage.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BAGGAGE_HEADER_NAME: () => (/* binding */ BAGGAGE_HEADER_NAME), +/* harmony export */ MAX_BAGGAGE_STRING_LENGTH: () => (/* binding */ MAX_BAGGAGE_STRING_LENGTH), +/* harmony export */ SENTRY_BAGGAGE_KEY_PREFIX: () => (/* binding */ SENTRY_BAGGAGE_KEY_PREFIX), +/* harmony export */ SENTRY_BAGGAGE_KEY_PREFIX_REGEX: () => (/* binding */ SENTRY_BAGGAGE_KEY_PREFIX_REGEX), +/* harmony export */ baggageHeaderToDynamicSamplingContext: () => (/* binding */ baggageHeaderToDynamicSamplingContext), +/* harmony export */ dynamicSamplingContextToSentryBaggageHeader: () => (/* binding */ dynamicSamplingContextToSentryBaggageHeader), +/* harmony export */ parseBaggageHeader: () => (/* binding */ parseBaggageHeader) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); + + + + +/** + * @deprecated Use a `"baggage"` string directly + */ +const BAGGAGE_HEADER_NAME = 'baggage'; + +const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-'; + +const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; + +/** + * Max length of a serialized baggage string + * + * https://www.w3.org/TR/baggage/#limits + */ +const MAX_BAGGAGE_STRING_LENGTH = 8192; + +/** + * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values + * from it. + * + * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks. + * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise. + */ +function baggageHeaderToDynamicSamplingContext( + // Very liberal definition of what any incoming header might look like + baggageHeader, +) { + const baggageObject = parseBaggageHeader(baggageHeader); + + if (!baggageObject) { + return undefined; + } + + // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object. + const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { + if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { + const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); + acc[nonPrefixedKey] = value; + } + return acc; + }, {}); + + // Only return a dynamic sampling context object if there are keys in it. + // A keyless object means there were no sentry values on the header, which means that there is no DSC. + if (Object.keys(dynamicSamplingContext).length > 0) { + return dynamicSamplingContext ; + } else { + return undefined; + } +} + +/** + * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-". + * + * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility + * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is + * `undefined` the function will return `undefined`. + * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext` + * was `undefined`, or if `dynamicSamplingContext` didn't contain any values. + */ +function dynamicSamplingContextToSentryBaggageHeader( + // this also takes undefined for convenience and bundle size in other places + dynamicSamplingContext, +) { + if (!dynamicSamplingContext) { + return undefined; + } + + // Prefix all DSC keys with "sentry-" and put them into a new object + const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( + (acc, [dscKey, dscValue]) => { + if (dscValue) { + acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; + } + return acc; + }, + {}, + ); + + return objectToBaggageHeader(sentryPrefixedDSC); +} + +/** + * Take a baggage header and parse it into an object. + */ +function parseBaggageHeader( + baggageHeader, +) { + if (!baggageHeader || (!(0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isString)(baggageHeader) && !Array.isArray(baggageHeader))) { + return undefined; + } + + if (Array.isArray(baggageHeader)) { + // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it + return baggageHeader.reduce((acc, curr) => { + const currBaggageObject = baggageHeaderToObject(curr); + Object.entries(currBaggageObject).forEach(([key, value]) => { + acc[key] = value; + }); + return acc; + }, {}); + } + + return baggageHeaderToObject(baggageHeader); +} + +/** + * Will parse a baggage header, which is a simple key-value map, into a flat object. + * + * @param baggageHeader The baggage header to parse. + * @returns a flat object containing all the key-value pairs from `baggageHeader`. + */ +function baggageHeaderToObject(baggageHeader) { + return baggageHeader + .split(',') + .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim()))) + .reduce((acc, [key, value]) => { + if (key && value) { + acc[key] = value; + } + return acc; + }, {}); +} + +/** + * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs. + * + * @param object The object to turn into a baggage header. + * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header + * is not spec compliant. + */ +function objectToBaggageHeader(object) { + if (Object.keys(object).length === 0) { + // An empty baggage header is not spec compliant: We return undefined. + return undefined; + } + + return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { + const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; + const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; + if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn( + `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`, + ); + return baggageHeader; + } else { + return newBaggageHeader; + } + }, ''); +} + + +//# sourceMappingURL=baggage.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/breadcrumb-log-level.js": +/*!*************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/breadcrumb-log-level.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getBreadcrumbLogLevelFromHttpStatusCode: () => (/* binding */ getBreadcrumbLogLevelFromHttpStatusCode) +/* harmony export */ }); +/** + * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code. + */ +function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { + // NOTE: undefined defaults to 'info' in Sentry + if (statusCode === undefined) { + return undefined; + } else if (statusCode >= 400 && statusCode < 500) { + return 'warning'; + } else if (statusCode >= 500) { + return 'error'; + } else { + return undefined; + } +} + + +//# sourceMappingURL=breadcrumb-log-level.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getComponentName: () => (/* binding */ getComponentName), +/* harmony export */ getDomElement: () => (/* binding */ getDomElement), +/* harmony export */ getLocationHref: () => (/* binding */ getLocationHref), +/* harmony export */ htmlTreeAsString: () => (/* binding */ htmlTreeAsString) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + +const WINDOW = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +const DEFAULT_MAX_STRING_LENGTH = 80; + +/** + * Given a child DOM element, returns a query-selector statement describing that + * and its ancestors + * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] + * @returns generated DOM path + */ +function htmlTreeAsString( + elem, + options = {}, +) { + if (!elem) { + return ''; + } + + // try/catch both: + // - accessing event.target (see getsentry/raven-js#838, #768) + // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly + // - can throw an exception in some circumstances. + try { + let currentElem = elem ; + const MAX_TRAVERSE_HEIGHT = 5; + const out = []; + let height = 0; + let len = 0; + const separator = ' > '; + const sepLength = separator.length; + let nextStr; + const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; + const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH; + + while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { + nextStr = _htmlElementAsString(currentElem, keyAttrs); + // bail out if + // - nextStr is the 'html' element + // - the length of the string that would be created exceeds maxStringLength + // (ignore this limit if we are on the first iteration) + if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) { + break; + } + + out.push(nextStr); + + len += nextStr.length; + currentElem = currentElem.parentNode; + } + + return out.reverse().join(separator); + } catch (_oO) { + return ''; + } +} + +/** + * Returns a simple, query-selector representation of a DOM element + * e.g. [HTMLElement] => input#foo.btn[name=baz] + * @returns generated DOM path + */ +function _htmlElementAsString(el, keyAttrs) { + const elem = el + +; + + const out = []; + + if (!elem || !elem.tagName) { + return ''; + } + + // @ts-expect-error WINDOW has HTMLElement + if (WINDOW.HTMLElement) { + // If using the component name annotation plugin, this value may be available on the DOM node + if (elem instanceof HTMLElement && elem.dataset) { + if (elem.dataset['sentryComponent']) { + return elem.dataset['sentryComponent']; + } + if (elem.dataset['sentryElement']) { + return elem.dataset['sentryElement']; + } + } + } + + out.push(elem.tagName.toLowerCase()); + + // Pairs of attribute keys defined in `serializeAttribute` and their values on element. + const keyAttrPairs = + keyAttrs && keyAttrs.length + ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)]) + : null; + + if (keyAttrPairs && keyAttrPairs.length) { + keyAttrPairs.forEach(keyAttrPair => { + out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); + }); + } else { + if (elem.id) { + out.push(`#${elem.id}`); + } + + const className = elem.className; + if (className && (0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isString)(className)) { + const classes = className.split(/\s+/); + for (const c of classes) { + out.push(`.${c}`); + } + } + } + const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt']; + for (const k of allowedAttrs) { + const attr = elem.getAttribute(k); + if (attr) { + out.push(`[${k}="${attr}"]`); + } + } + + return out.join(''); +} + +/** + * A safe form of location.href + */ +function getLocationHref() { + try { + return WINDOW.document.location.href; + } catch (oO) { + return ''; + } +} + +/** + * Gets a DOM element by using document.querySelector. + * + * This wrapper will first check for the existence of the function before + * actually calling it so that we don't have to take care of this check, + * every time we want to access the DOM. + * + * Reason: DOM/querySelector is not available in all environments. + * + * We have to cast to any because utils can be consumed by a variety of environments, + * and we don't want to break TS users. If you know what element will be selected by + * `document.querySelector`, specify it as part of the generic call. For example, + * `const element = getDomElement('selector');` + * + * @param selector the selector string passed on to document.querySelector + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getDomElement(selector) { + if (WINDOW.document && WINDOW.document.querySelector) { + return WINDOW.document.querySelector(selector) ; + } + return null; +} + +/** + * Given a DOM element, traverses up the tree until it finds the first ancestor node + * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking + * precedence. This attribute is added at build-time by projects that have the component name annotation plugin installed. + * + * @returns a string representation of the component for the provided DOM element, or `null` if not found + */ +function getComponentName(elem) { + // @ts-expect-error WINDOW has HTMLElement + if (!WINDOW.HTMLElement) { + return null; + } + + let currentElem = elem ; + const MAX_TRAVERSE_HEIGHT = 5; + for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) { + if (!currentElem) { + return null; + } + + if (currentElem instanceof HTMLElement) { + if (currentElem.dataset['sentryComponent']) { + return currentElem.dataset['sentryComponent']; + } + if (currentElem.dataset['sentryElement']) { + return currentElem.dataset['sentryElement']; + } + } + + currentElem = currentElem.parentNode; + } + + return null; +} + + +//# sourceMappingURL=browser.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/buildPolyfills/_nullishCoalesce.js": +/*!************************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/buildPolyfills/_nullishCoalesce.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _nullishCoalesce: () => (/* binding */ _nullishCoalesce) +/* harmony export */ }); +// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f +// +// The MIT License (MIT) +// +// Copyright (c) 2012-2018 various contributors (see AUTHORS) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +/** + * Polyfill for the nullish coalescing operator (`??`). + * + * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the + * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param lhs The value of the expression to the left of the `??` + * @param rhsFn A function returning the value of the expression to the right of the `??` + * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value + */ +function _nullishCoalesce(lhs, rhsFn) { + // by checking for loose equality to `null`, we catch both `null` and `undefined` + return lhs != null ? lhs : rhsFn(); +} + +// Sucrase version: +// function _nullishCoalesce(lhs, rhsFn) { +// if (lhs != null) { +// return lhs; +// } else { +// return rhsFn(); +// } +// } + + +//# sourceMappingURL=_nullishCoalesce.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/buildPolyfills/_optionalChain.js": +/*!**********************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/buildPolyfills/_optionalChain.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _optionalChain: () => (/* binding */ _optionalChain) +/* harmony export */ }); +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The value of the expression + */ +function _optionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i] ; + const fn = ops[i + 1] ; + i += 2; + // by checking for loose equality to `null`, we catch both `null` and `undefined` + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it + return; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = fn((...args) => (value ).call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; +} + +// Sucrase version +// function _optionalChain(ops) { +// let lastAccessLHS = undefined; +// let value = ops[0]; +// let i = 1; +// while (i < ops.length) { +// const op = ops[i]; +// const fn = ops[i + 1]; +// i += 2; +// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { +// return undefined; +// } +// if (op === 'access' || op === 'optionalAccess') { +// lastAccessLHS = value; +// value = fn(value); +// } else if (op === 'call' || op === 'optionalCall') { +// value = fn((...args) => value.call(lastAccessLHS, ...args)); +// lastAccessLHS = undefined; +// } +// } +// return value; +// } + + +//# sourceMappingURL=_optionalChain.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/clientreport.js": +/*!*****************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/clientreport.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createClientReportEnvelope: () => (/* binding */ createClientReportEnvelope) +/* harmony export */ }); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./envelope.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js"); +/* harmony import */ var _time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); + + + +/** + * Creates client report envelope + * @param discarded_events An array of discard events + * @param dsn A DSN that can be set on the header. Optional. + */ +function createClientReportEnvelope( + discarded_events, + dsn, + timestamp, +) { + const clientReportItem = [ + { type: 'client_report' }, + { + timestamp: timestamp || (0,_time_js__WEBPACK_IMPORTED_MODULE_0__.dateTimestampInSeconds)(), + discarded_events, + }, + ]; + return (0,_envelope_js__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(dsn ? { dsn } : {}, [clientReportItem]); +} + + +//# sourceMappingURL=clientreport.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js": +/*!****************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEBUG_BUILD: () => (/* binding */ DEBUG_BUILD) +/* harmony export */ }); +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + + +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-ids.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/debug-ids.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getDebugImagesForResources: () => (/* binding */ getDebugImagesForResources), +/* harmony export */ getFilenameToDebugIdMap: () => (/* binding */ getFilenameToDebugIdMap) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + +let parsedStackResults; +let lastKeysCount; +let cachedFilenameDebugIds; + +/** + * Returns a map of filenames to debug identifiers. + */ +function getFilenameToDebugIdMap(stackParser) { + const debugIdMap = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ._sentryDebugIds; + if (!debugIdMap) { + return {}; + } + + const debugIdKeys = Object.keys(debugIdMap); + + // If the count of registered globals hasn't changed since the last call, we + // can just return the cached result. + if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) { + return cachedFilenameDebugIds; + } + + lastKeysCount = debugIdKeys.length; + + // Build a map of filename -> debug_id. + cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => { + if (!parsedStackResults) { + parsedStackResults = {}; + } + + const result = parsedStackResults[stackKey]; + + if (result) { + acc[result[0]] = result[1]; + } else { + const parsedStack = stackParser(stackKey); + + for (let i = parsedStack.length - 1; i >= 0; i--) { + const stackFrame = parsedStack[i]; + const filename = stackFrame && stackFrame.filename; + const debugId = debugIdMap[stackKey]; + + if (filename && debugId) { + acc[filename] = debugId; + parsedStackResults[stackKey] = [filename, debugId]; + break; + } + } + } + + return acc; + }, {}); + + return cachedFilenameDebugIds; +} + +/** + * Returns a list of debug images for the given resources. + */ +function getDebugImagesForResources( + stackParser, + resource_paths, +) { + const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); + + if (!filenameDebugIdMap) { + return []; + } + + const images = []; + for (const path of resource_paths) { + if (path && filenameDebugIdMap[path]) { + images.push({ + type: 'sourcemap', + code_file: path, + debug_id: filenameDebugIdMap[path] , + }); + } + } + + return images; +} + + +//# sourceMappingURL=debug-ids.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ dsnFromString: () => (/* binding */ dsnFromString), +/* harmony export */ dsnToString: () => (/* binding */ dsnToString), +/* harmony export */ makeDsn: () => (/* binding */ makeDsn) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); + + + +/** Regular expression used to parse a Dsn. */ +const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; + +function isValidProtocol(protocol) { + return protocol === 'http' || protocol === 'https'; +} + +/** + * Renders the string representation of this Dsn. + * + * By default, this will render the public representation without the password + * component. To get the deprecated private representation, set `withPassword` + * to true. + * + * @param withPassword When set to true, the password will be included. + */ +function dsnToString(dsn, withPassword = false) { + const { host, path, pass, port, projectId, protocol, publicKey } = dsn; + return ( + `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + + `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` + ); +} + +/** + * Parses a Dsn from a given string. + * + * @param str A Dsn as string + * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string + */ +function dsnFromString(str) { + const match = DSN_REGEX.exec(str); + + if (!match) { + // This should be logged to the console + (0,_logger_js__WEBPACK_IMPORTED_MODULE_0__.consoleSandbox)(() => { + // eslint-disable-next-line no-console + console.error(`Invalid Sentry Dsn: ${str}`); + }); + return undefined; + } + + const [protocol, publicKey, pass = '', host = '', port = '', lastPath = ''] = match.slice(1); + let path = ''; + let projectId = lastPath; + + const split = projectId.split('/'); + if (split.length > 1) { + path = split.slice(0, -1).join('/'); + projectId = split.pop() ; + } + + if (projectId) { + const projectMatch = projectId.match(/^\d+/); + if (projectMatch) { + projectId = projectMatch[0]; + } + } + + return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey }); +} + +function dsnFromComponents(components) { + return { + protocol: components.protocol, + publicKey: components.publicKey || '', + pass: components.pass || '', + host: components.host, + port: components.port || '', + path: components.path || '', + projectId: components.projectId, + }; +} + +function validateDsn(dsn) { + if (!_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + return true; + } + + const { port, projectId, protocol } = dsn; + + const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; + const hasMissingRequiredComponent = requiredComponents.find(component => { + if (!dsn[component]) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: ${component} missing`); + return true; + } + return false; + }); + + if (hasMissingRequiredComponent) { + return false; + } + + if (!projectId.match(/^\d+$/)) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); + return false; + } + + if (!isValidProtocol(protocol)) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); + return false; + } + + if (port && isNaN(parseInt(port, 10))) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); + return false; + } + + return true; +} + +/** + * Creates a valid Sentry Dsn object, identifying a Sentry instance and project. + * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source + */ +function makeDsn(from) { + const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + if (!components || !validateDsn(components)) { + return undefined; + } + return components; +} + + +//# sourceMappingURL=dsn.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/env.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/env.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getSDKSource: () => (/* binding */ getSDKSource), +/* harmony export */ isBrowserBundle: () => (/* binding */ isBrowserBundle) +/* harmony export */ }); +/* + * This module exists for optimizations in the build process through rollup and terser. We define some global + * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these + * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will + * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to + * `logger` and preventing node-related code from appearing in browser bundles. + * + * Attention: + * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by + * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack) + * having issues tree-shaking these constants across package boundaries. + * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want + * users to be able to shake away expressions that it guards. + */ + +/** + * Figures out if we're building a browser bundle. + * + * @returns true if this is a browser bundle build. + */ +function isBrowserBundle() { + return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; +} + +/** + * Get source of SDK. + */ +function getSDKSource() { + // This comment is used to identify this line in the CDN bundle build step and replace this with "return 'cdn';" + /* __SENTRY_SDK_SOURCE__ */ return 'npm'; +} + + +//# sourceMappingURL=env.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js": +/*!*************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/envelope.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addItemToEnvelope: () => (/* binding */ addItemToEnvelope), +/* harmony export */ createAttachmentEnvelopeItem: () => (/* binding */ createAttachmentEnvelopeItem), +/* harmony export */ createEnvelope: () => (/* binding */ createEnvelope), +/* harmony export */ createEventEnvelopeHeaders: () => (/* binding */ createEventEnvelopeHeaders), +/* harmony export */ createSpanEnvelopeItem: () => (/* binding */ createSpanEnvelopeItem), +/* harmony export */ envelopeContainsItemType: () => (/* binding */ envelopeContainsItemType), +/* harmony export */ envelopeItemTypeToDataCategory: () => (/* binding */ envelopeItemTypeToDataCategory), +/* harmony export */ forEachEnvelopeItem: () => (/* binding */ forEachEnvelopeItem), +/* harmony export */ getSdkMetadataForEnvelopeHeader: () => (/* binding */ getSdkMetadataForEnvelopeHeader), +/* harmony export */ parseEnvelope: () => (/* binding */ parseEnvelope), +/* harmony export */ serializeEnvelope: () => (/* binding */ serializeEnvelope) +/* harmony export */ }); +/* harmony import */ var _dsn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dsn.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/dsn.js"); +/* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normalize.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/normalize.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + + + +/** + * Creates an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function createEnvelope(headers, items = []) { + return [headers, items] ; +} + +/** + * Add an item to an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function addItemToEnvelope(envelope, newItem) { + const [headers, items] = envelope; + return [headers, [...items, newItem]] ; +} + +/** + * Convenience function to loop through the items and item types of an envelope. + * (This function was mostly created because working with envelope types is painful at the moment) + * + * If the callback returns true, the rest of the items will be skipped. + */ +function forEachEnvelopeItem( + envelope, + callback, +) { + const envelopeItems = envelope[1]; + + for (const envelopeItem of envelopeItems) { + const envelopeItemType = envelopeItem[0].type; + const result = callback(envelopeItem, envelopeItemType); + + if (result) { + return true; + } + } + + return false; +} + +/** + * Returns true if the envelope contains any of the given envelope item types + */ +function envelopeContainsItemType(envelope, types) { + return forEachEnvelopeItem(envelope, (_, type) => types.includes(type)); +} + +/** + * Encode a string to UTF8 array. + */ +function encodeUTF8(input) { + return _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.__SENTRY__ && _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.__SENTRY__.encodePolyfill + ? _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) + : new TextEncoder().encode(input); +} + +/** + * Decode a UTF8 array to string. + */ +function decodeUTF8(input) { + return _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.__SENTRY__ && _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.__SENTRY__.decodePolyfill + ? _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.__SENTRY__.decodePolyfill(input) + : new TextDecoder().decode(input); +} + +/** + * Serializes an envelope. + */ +function serializeEnvelope(envelope) { + const [envHeaders, items] = envelope; + + // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data + let parts = JSON.stringify(envHeaders); + + function append(next) { + if (typeof parts === 'string') { + parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next]; + } else { + parts.push(typeof next === 'string' ? encodeUTF8(next) : next); + } + } + + for (const item of items) { + const [itemHeaders, payload] = item; + + append(`\n${JSON.stringify(itemHeaders)}\n`); + + if (typeof payload === 'string' || payload instanceof Uint8Array) { + append(payload); + } else { + let stringifiedPayload; + try { + stringifiedPayload = JSON.stringify(payload); + } catch (e) { + // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.stringify()` still + // fails, we try again after normalizing it again with infinite normalization depth. This of course has a + // performance impact but in this case a performance hit is better than throwing. + stringifiedPayload = JSON.stringify((0,_normalize_js__WEBPACK_IMPORTED_MODULE_1__.normalize)(payload)); + } + append(stringifiedPayload); + } + } + + return typeof parts === 'string' ? parts : concatBuffers(parts); +} + +function concatBuffers(buffers) { + const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); + + const merged = new Uint8Array(totalLength); + let offset = 0; + for (const buffer of buffers) { + merged.set(buffer, offset); + offset += buffer.length; + } + + return merged; +} + +/** + * Parses an envelope + */ +function parseEnvelope(env) { + let buffer = typeof env === 'string' ? encodeUTF8(env) : env; + + function readBinary(length) { + const bin = buffer.subarray(0, length); + // Replace the buffer with the remaining data excluding trailing newline + buffer = buffer.subarray(length + 1); + return bin; + } + + function readJson() { + let i = buffer.indexOf(0xa); + // If we couldn't find a newline, we must have found the end of the buffer + if (i < 0) { + i = buffer.length; + } + + return JSON.parse(decodeUTF8(readBinary(i))) ; + } + + const envelopeHeader = readJson(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const items = []; + + while (buffer.length) { + const itemHeader = readJson(); + const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined; + + items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); + } + + return [envelopeHeader, items]; +} + +/** + * Creates envelope item for a single span + */ +function createSpanEnvelopeItem(spanJson) { + const spanHeaders = { + type: 'span', + }; + + return [spanHeaders, spanJson]; +} + +/** + * Creates attachment envelope items + */ +function createAttachmentEnvelopeItem(attachment) { + const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data; + + return [ + (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)({ + type: 'attachment', + length: buffer.length, + filename: attachment.filename, + content_type: attachment.contentType, + attachment_type: attachment.attachmentType, + }), + buffer, + ]; +} + +const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { + session: 'session', + sessions: 'session', + attachment: 'attachment', + transaction: 'transaction', + event: 'error', + client_report: 'internal', + user_report: 'default', + profile: 'profile', + profile_chunk: 'profile', + replay_event: 'replay', + replay_recording: 'replay', + check_in: 'monitor', + feedback: 'feedback', + span: 'span', + statsd: 'metric_bucket', +}; + +/** + * Maps the type of an envelope item to a data category. + */ +function envelopeItemTypeToDataCategory(type) { + return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; +} + +/** Extracts the minimal SDK info from the metadata or an events */ +function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { + if (!metadataOrEvent || !metadataOrEvent.sdk) { + return; + } + const { name, version } = metadataOrEvent.sdk; + return { name, version }; +} + +/** + * Creates event envelope headers, based on event, sdk info and tunnel + * Note: This function was extracted from the core package to make it available in Replay + */ +function createEventEnvelopeHeaders( + event, + sdkInfo, + tunnel, + dsn, +) { + const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; + return { + event_id: event.event_id , + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && dsn && { dsn: (0,_dsn_js__WEBPACK_IMPORTED_MODULE_3__.dsnToString)(dsn) }), + ...(dynamicSamplingContext && { + trace: (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)({ ...dynamicSamplingContext }), + }), + }; +} + + +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/error.js": +/*!**********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/error.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SentryError: () => (/* binding */ SentryError) +/* harmony export */ }); +/** An error emitted by Sentry SDKs and related utilities. */ +class SentryError extends Error { + /** Display name of this error instance. */ + + constructor( message, logLevel = 'warn') { + super(message);this.message = message; + this.name = new.target.prototype.constructor.name; + // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line + // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes + // instances of `SentryError` fail `obj instanceof SentryError` checks. + Object.setPrototypeOf(this, new.target.prototype); + this.logLevel = logLevel; + } +} + + +//# sourceMappingURL=error.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/console.js": +/*!***********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/console.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addConsoleInstrumentationHandler: () => (/* binding */ addConsoleInstrumentationHandler) +/* harmony export */ }); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _handlers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); + + + + + +/** + * Add an instrumentation handler for when a console.xxx method is called. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addConsoleInstrumentationHandler(handler) { + const type = 'console'; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, instrumentConsole); +} + +function instrumentConsole() { + if (!("console" in _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ)) { + return; + } + + _logger_js__WEBPACK_IMPORTED_MODULE_2__.CONSOLE_LEVELS.forEach(function (level) { + if (!(level in _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.console)) { + return; + } + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.console, level, function (originalConsoleMethod) { + _logger_js__WEBPACK_IMPORTED_MODULE_2__.originalConsoleMethods[level] = originalConsoleMethod; + + return function (...args) { + const handlerData = { args, level }; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('console', handlerData); + + const log = _logger_js__WEBPACK_IMPORTED_MODULE_2__.originalConsoleMethods[level]; + log && log.apply(_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.console, args); + }; + }); + }); +} + + +//# sourceMappingURL=console.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js": +/*!*********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addFetchEndInstrumentationHandler: () => (/* binding */ addFetchEndInstrumentationHandler), +/* harmony export */ addFetchInstrumentationHandler: () => (/* binding */ addFetchInstrumentationHandler), +/* harmony export */ parseFetchArgs: () => (/* binding */ parseFetchArgs) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _supports_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../supports.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js"); +/* harmony import */ var _time_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _handlers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); + + + + + + + +/** + * Add an instrumentation handler for when a fetch request happens. + * The handler function is called once when the request starts and once when it ends, + * which can be identified by checking if it has an `endTimestamp`. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addFetchInstrumentationHandler( + handler, + skipNativeFetchCheck, +) { + const type = 'fetch'; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, () => instrumentFetch(undefined, skipNativeFetchCheck)); +} + +/** + * Add an instrumentation handler for long-lived fetch requests, like consuming server-sent events (SSE) via fetch. + * The handler will resolve the request body and emit the actual `endTimestamp`, so that the + * span can be updated accordingly. + * + * Only used internally + * @hidden + */ +function addFetchEndInstrumentationHandler(handler) { + const type = 'fetch-body-resolved'; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, () => instrumentFetch(streamHandler)); +} + +function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { + if (skipNativeFetchCheck && !(0,_supports_js__WEBPACK_IMPORTED_MODULE_1__.supportsNativeFetch)()) { + return; + } + + (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.fill)(_worldwide_js__WEBPACK_IMPORTED_MODULE_3__.GLOBAL_OBJ, 'fetch', function (originalFetch) { + return function (...args) { + const { method, url } = parseFetchArgs(args); + const handlerData = { + args, + fetchData: { + method, + url, + }, + startTimestamp: (0,_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)() * 1000, + }; + + // if there is no callback, fetch is instrumented directly + if (!onFetchResolved) { + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('fetch', { + ...handlerData, + }); + } + + // We capture the stack right here and not in the Promise error callback because Safari (and probably other + // browsers too) will wipe the stack trace up to this point, only leaving us with this file which is useless. + + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the error, that was caused by your fetch call did not + // have a stack trace, so the SDK backfilled the stack trace so + // you can see which fetch call failed. + const virtualStackTrace = new Error().stack; + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(_worldwide_js__WEBPACK_IMPORTED_MODULE_3__.GLOBAL_OBJ, args).then( + async (response) => { + if (onFetchResolved) { + onFetchResolved(response); + } else { + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('fetch', { + ...handlerData, + endTimestamp: (0,_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)() * 1000, + response, + }); + } + + return response; + }, + (error) => { + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('fetch', { + ...handlerData, + endTimestamp: (0,_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)() * 1000, + error, + }); + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_5__.isError)(error) && error.stack === undefined) { + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the error, that was caused by your fetch call did not + // have a stack trace, so the SDK backfilled the stack trace so + // you can see which fetch call failed. + error.stack = virtualStackTrace; + (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.addNonEnumerableProperty)(error, 'framesToPop', 1); + } + + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; + }, + ); + }; + }); +} + +async function resolveResponse(res, onFinishedResolving) { + if (res && res.body) { + const body = res.body; + const responseReader = body.getReader(); + + // Define a maximum duration after which we just cancel + const maxFetchDurationTimeout = setTimeout( + () => { + body.cancel().then(null, () => { + // noop + }); + }, + 90 * 1000, // 90s + ); + + let readingActive = true; + while (readingActive) { + let chunkTimeout; + try { + // abort reading if read op takes more than 5s + chunkTimeout = setTimeout(() => { + body.cancel().then(null, () => { + // noop on error + }); + }, 5000); + + // This .read() call will reject/throw when we abort due to timeouts through `body.cancel()` + const { done } = await responseReader.read(); + + clearTimeout(chunkTimeout); + + if (done) { + onFinishedResolving(); + readingActive = false; + } + } catch (error) { + readingActive = false; + } finally { + clearTimeout(chunkTimeout); + } + } + + clearTimeout(maxFetchDurationTimeout); + + responseReader.releaseLock(); + body.cancel().then(null, () => { + // noop on error + }); + } +} + +function streamHandler(response) { + // clone response for awaiting stream + let clonedResponseForResolving; + try { + clonedResponseForResolving = response.clone(); + } catch (e) { + return; + } + + // eslint-disable-next-line @typescript-eslint/no-floating-promises + resolveResponse(clonedResponseForResolving, () => { + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('fetch-body-resolved', { + endTimestamp: (0,_time_js__WEBPACK_IMPORTED_MODULE_4__.timestampInSeconds)() * 1000, + response, + }); + }); +} + +function hasProp(obj, prop) { + return !!obj && typeof obj === 'object' && !!(obj )[prop]; +} + +function getUrlFromResource(resource) { + if (typeof resource === 'string') { + return resource; + } + + if (!resource) { + return ''; + } + + if (hasProp(resource, 'url')) { + return resource.url; + } + + if (resource.toString) { + return resource.toString(); + } + + return ''; +} + +/** + * Parses the fetch arguments to find the used Http method and the url of the request. + * Exported for tests only. + */ +function parseFetchArgs(fetchArgs) { + if (fetchArgs.length === 0) { + return { method: 'GET', url: '' }; + } + + if (fetchArgs.length === 2) { + const [url, options] = fetchArgs ; + + return { + url: getUrlFromResource(url), + method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET', + }; + } + + const arg = fetchArgs[0]; + return { + url: getUrlFromResource(arg ), + method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET', + }; +} + + +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalError.js": +/*!***************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalError.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addGlobalErrorInstrumentationHandler: () => (/* binding */ addGlobalErrorInstrumentationHandler) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _handlers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); + + + +let _oldOnErrorHandler = null; + +/** + * Add an instrumentation handler for when an error is captured by the global error handler. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addGlobalErrorInstrumentationHandler(handler) { + const type = 'error'; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, instrumentError); +} + +function instrumentError() { + _oldOnErrorHandler = _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.onerror; + + _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.onerror = function ( + msg, + url, + line, + column, + error, + ) { + const handlerData = { + column, + error, + line, + msg, + url, + }; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('error', handlerData); + + if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) { + // eslint-disable-next-line prefer-rest-params + return _oldOnErrorHandler.apply(this, arguments); + } + + return false; + }; + + _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; +} + + +//# sourceMappingURL=globalError.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalUnhandledRejection.js": +/*!****************************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalUnhandledRejection.js ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addGlobalUnhandledRejectionInstrumentationHandler: () => (/* binding */ addGlobalUnhandledRejectionInstrumentationHandler) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); +/* harmony import */ var _handlers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js"); + + + +let _oldOnUnhandledRejectionHandler = null; + +/** + * Add an instrumentation handler for when an unhandled promise rejection is captured. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addGlobalUnhandledRejectionInstrumentationHandler( + handler, +) { + const type = 'unhandledrejection'; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.addHandler)(type, handler); + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.maybeInstrument)(type, instrumentUnhandledRejection); +} + +function instrumentUnhandledRejection() { + _oldOnUnhandledRejectionHandler = _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.onunhandledrejection; + + _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.onunhandledrejection = function (e) { + const handlerData = e; + (0,_handlers_js__WEBPACK_IMPORTED_MODULE_0__.triggerHandlers)('unhandledrejection', handlerData); + + if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) { + // eslint-disable-next-line prefer-rest-params + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + + return true; + }; + + _worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; +} + + +//# sourceMappingURL=globalUnhandledRejection.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js": +/*!************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addHandler: () => (/* binding */ addHandler), +/* harmony export */ maybeInstrument: () => (/* binding */ maybeInstrument), +/* harmony export */ resetInstrumentationHandlers: () => (/* binding */ resetInstrumentationHandlers), +/* harmony export */ triggerHandlers: () => (/* binding */ triggerHandlers) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../stacktrace.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); + + + + +// We keep the handlers globally +const handlers = {}; +const instrumented = {}; + +/** Add a handler function. */ +function addHandler(type, handler) { + handlers[type] = handlers[type] || []; + (handlers[type] ).push(handler); +} + +/** + * Reset all instrumentation handlers. + * This can be used by tests to ensure we have a clean slate of instrumentation handlers. + */ +function resetInstrumentationHandlers() { + Object.keys(handlers).forEach(key => { + handlers[key ] = undefined; + }); +} + +/** Maybe run an instrumentation function, unless it was already called. */ +function maybeInstrument(type, instrumentFn) { + if (!instrumented[type]) { + instrumented[type] = true; + try { + instrumentFn(); + } catch (e) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.error(`Error while instrumenting ${type}`, e); + } + } +} + +/** Trigger handlers for a given instrumentation type. */ +function triggerHandlers(type, data) { + const typeHandlers = type && handlers[type]; + if (!typeHandlers) { + return; + } + + for (const handler of typeHandlers) { + try { + handler(data); + } catch (e) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && + _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.error( + `Error while triggering instrumentation handler.\nType: ${type}\nName: ${(0,_stacktrace_js__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(handler)}\nError:`, + e, + ); + } + } +} + + +//# sourceMappingURL=handlers.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js": +/*!*******************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/is.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isDOMError: () => (/* binding */ isDOMError), +/* harmony export */ isDOMException: () => (/* binding */ isDOMException), +/* harmony export */ isElement: () => (/* binding */ isElement), +/* harmony export */ isError: () => (/* binding */ isError), +/* harmony export */ isErrorEvent: () => (/* binding */ isErrorEvent), +/* harmony export */ isEvent: () => (/* binding */ isEvent), +/* harmony export */ isInstanceOf: () => (/* binding */ isInstanceOf), +/* harmony export */ isParameterizedString: () => (/* binding */ isParameterizedString), +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), +/* harmony export */ isPrimitive: () => (/* binding */ isPrimitive), +/* harmony export */ isRegExp: () => (/* binding */ isRegExp), +/* harmony export */ isString: () => (/* binding */ isString), +/* harmony export */ isSyntheticEvent: () => (/* binding */ isSyntheticEvent), +/* harmony export */ isThenable: () => (/* binding */ isThenable), +/* harmony export */ isVueViewModel: () => (/* binding */ isVueViewModel) +/* harmony export */ }); +// eslint-disable-next-line @typescript-eslint/unbound-method +const objectToString = Object.prototype.toString; + +/** + * Checks whether given value's type is one of a few Error or Error-like + * {@link isError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isError(wat) { + switch (objectToString.call(wat)) { + case '[object Error]': + case '[object Exception]': + case '[object DOMException]': + case '[object WebAssembly.Exception]': + return true; + default: + return isInstanceOf(wat, Error); + } +} +/** + * Checks whether given value is an instance of the given built-in class. + * + * @param wat The value to be checked + * @param className + * @returns A boolean representing the result. + */ +function isBuiltin(wat, className) { + return objectToString.call(wat) === `[object ${className}]`; +} + +/** + * Checks whether given value's type is ErrorEvent + * {@link isErrorEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isErrorEvent(wat) { + return isBuiltin(wat, 'ErrorEvent'); +} + +/** + * Checks whether given value's type is DOMError + * {@link isDOMError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMError(wat) { + return isBuiltin(wat, 'DOMError'); +} + +/** + * Checks whether given value's type is DOMException + * {@link isDOMException}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMException(wat) { + return isBuiltin(wat, 'DOMException'); +} + +/** + * Checks whether given value's type is a string + * {@link isString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isString(wat) { + return isBuiltin(wat, 'String'); +} + +/** + * Checks whether given string is parameterized + * {@link isParameterizedString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isParameterizedString(wat) { + return ( + typeof wat === 'object' && + wat !== null && + '__sentry_template_string__' in wat && + '__sentry_template_values__' in wat + ); +} + +/** + * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) + * {@link isPrimitive}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPrimitive(wat) { + return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function'); +} + +/** + * Checks whether given value's type is an object literal, or a class instance. + * {@link isPlainObject}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPlainObject(wat) { + return isBuiltin(wat, 'Object'); +} + +/** + * Checks whether given value's type is an Event instance + * {@link isEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isEvent(wat) { + return typeof Event !== 'undefined' && isInstanceOf(wat, Event); +} + +/** + * Checks whether given value's type is an Element instance + * {@link isElement}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isElement(wat) { + return typeof Element !== 'undefined' && isInstanceOf(wat, Element); +} + +/** + * Checks whether given value's type is an regexp + * {@link isRegExp}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isRegExp(wat) { + return isBuiltin(wat, 'RegExp'); +} + +/** + * Checks whether given value has a then function. + * @param wat A value to be checked. + */ +function isThenable(wat) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); +} + +/** + * Checks whether given value's type is a SyntheticEvent + * {@link isSyntheticEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isSyntheticEvent(wat) { + return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; +} + +/** + * Checks whether given value's type is an instance of provided constructor. + * {@link isInstanceOf}. + * + * @param wat A value to be checked. + * @param base A constructor to be used in a check. + * @returns A boolean representing the result. + */ +function isInstanceOf(wat, base) { + try { + return wat instanceof base; + } catch (_e) { + return false; + } +} + +/** + * Checks whether given value's type is a Vue ViewModel. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isVueViewModel(wat) { + // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property. + return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue)); +} + + +//# sourceMappingURL=is.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/isBrowser.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/isBrowser.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isBrowser: () => (/* binding */ isBrowser) +/* harmony export */ }); +/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/node.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + +/** + * Returns true if we are in the browser. + */ +function isBrowser() { + // eslint-disable-next-line no-restricted-globals + return typeof window !== 'undefined' && (!(0,_node_js__WEBPACK_IMPORTED_MODULE_0__.isNodeEnv)() || isElectronNodeRenderer()); +} + +// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them +function isElectronNodeRenderer() { + return ( + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any + (_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ ).process !== undefined && ((_worldwide_js__WEBPACK_IMPORTED_MODULE_1__.GLOBAL_OBJ ).process ).type === 'renderer' + ); +} + + +//# sourceMappingURL=isBrowser.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CONSOLE_LEVELS: () => (/* binding */ CONSOLE_LEVELS), +/* harmony export */ consoleSandbox: () => (/* binding */ consoleSandbox), +/* harmony export */ logger: () => (/* binding */ logger), +/* harmony export */ originalConsoleMethods: () => (/* binding */ originalConsoleMethods) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + +/** Prefix for logging strings */ +const PREFIX = 'Sentry Logger '; + +const CONSOLE_LEVELS = [ + 'debug', + 'info', + 'warn', + 'error', + 'log', + 'assert', + 'trace', +] ; + +/** This may be mutated by the console instrumentation. */ +const originalConsoleMethods + + = {}; + +/** JSDoc */ + +/** + * Temporarily disable sentry console instrumentations. + * + * @param callback The function to run against the original `console` messages + * @returns The results of the callback + */ +function consoleSandbox(callback) { + if (!("console" in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ)) { + return callback(); + } + + const console = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console ; + const wrappedFuncs = {}; + + const wrappedLevels = Object.keys(originalConsoleMethods) ; + + // Restore all wrapped console methods + wrappedLevels.forEach(level => { + const originalConsoleMethod = originalConsoleMethods[level] ; + wrappedFuncs[level] = console[level] ; + console[level] = originalConsoleMethod; + }); + + try { + return callback(); + } finally { + // Revert restoration to wrapped state + wrappedLevels.forEach(level => { + console[level] = wrappedFuncs[level] ; + }); + } +} + +function makeLogger() { + let enabled = false; + const logger = { + enable: () => { + enabled = true; + }, + disable: () => { + enabled = false; + }, + isEnabled: () => enabled, + }; + + if (_debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD) { + CONSOLE_LEVELS.forEach(name => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + logger[name] = (...args) => { + if (enabled) { + consoleSandbox(() => { + _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); + }); + } + }; + }); + } else { + CONSOLE_LEVELS.forEach(name => { + logger[name] = () => undefined; + }); + } + + return logger ; +} + +/** + * This is a logger singleton which either logs things or no-ops if logging is not enabled. + * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK. + */ +const logger = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalSingleton)('logger', makeLogger); + + +//# sourceMappingURL=logger.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/memo.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/memo.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ memoBuilder: () => (/* binding */ memoBuilder) +/* harmony export */ }); +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** + * Helper to decycle json objects + * + * @deprecated This function is deprecated and will be removed in the next major version. + */ +// TODO(v9): Move this function into normalize() directly +function memoBuilder() { + const hasWeakSet = typeof WeakSet === 'function'; + const inner = hasWeakSet ? new WeakSet() : []; + function memoize(obj) { + if (hasWeakSet) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; + } + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < inner.length; i++) { + const value = inner[i]; + if (value === obj) { + return true; + } + } + inner.push(obj); + return false; + } + + function unmemoize(obj) { + if (hasWeakSet) { + inner.delete(obj); + } else { + for (let i = 0; i < inner.length; i++) { + if (inner[i] === obj) { + inner.splice(i, 1); + break; + } + } + } + } + return [memoize, unmemoize]; +} + + +//# sourceMappingURL=memo.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addContextToFrame: () => (/* binding */ addContextToFrame), +/* harmony export */ addExceptionMechanism: () => (/* binding */ addExceptionMechanism), +/* harmony export */ addExceptionTypeValue: () => (/* binding */ addExceptionTypeValue), +/* harmony export */ arrayify: () => (/* binding */ arrayify), +/* harmony export */ checkOrSetAlreadyCaught: () => (/* binding */ checkOrSetAlreadyCaught), +/* harmony export */ getEventDescription: () => (/* binding */ getEventDescription), +/* harmony export */ parseSemver: () => (/* binding */ parseSemver), +/* harmony export */ uuid4: () => (/* binding */ uuid4) +/* harmony export */ }); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + + +/** + * UUID4 generator + * + * @returns string Generated UUID4. + */ +function uuid4() { + const gbl = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + const crypto = gbl.crypto || gbl.msCrypto; + + let getRandomByte = () => Math.random() * 16; + try { + if (crypto && crypto.randomUUID) { + return crypto.randomUUID().replace(/-/g, ''); + } + if (crypto && crypto.getRandomValues) { + getRandomByte = () => { + // crypto.getRandomValues might return undefined instead of the typed array + // in old Chromium versions (e.g. 23.0.1235.0 (151422)) + // However, `typedArray` is still filled in-place. + // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray + const typedArray = new Uint8Array(1); + crypto.getRandomValues(typedArray); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return typedArray[0]; + }; + } + } catch (_) { + // some runtimes can crash invoking crypto + // https://github.com/getsentry/sentry-javascript/issues/8935 + } + + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 + // Concatenating the following numbers as strings results in '10000000100040008000100000000000' + return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c => + // eslint-disable-next-line no-bitwise + ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16), + ); +} + +function getFirstException(event) { + return event.exception && event.exception.values ? event.exception.values[0] : undefined; +} + +/** + * Extracts either message or type+value from an event that can be used for user-facing logs + * @returns event's description + */ +function getEventDescription(event) { + const { message, event_id: eventId } = event; + if (message) { + return message; + } + + const firstException = getFirstException(event); + if (firstException) { + if (firstException.type && firstException.value) { + return `${firstException.type}: ${firstException.value}`; + } + return firstException.type || firstException.value || eventId || ''; + } + return eventId || ''; +} + +/** + * Adds exception values, type and value to an synthetic Exception. + * @param event The event to modify. + * @param value Value of the exception. + * @param type Type of the exception. + * @hidden + */ +function addExceptionTypeValue(event, value, type) { + const exception = (event.exception = event.exception || {}); + const values = (exception.values = exception.values || []); + const firstException = (values[0] = values[0] || {}); + if (!firstException.value) { + firstException.value = value || ''; + } + if (!firstException.type) { + firstException.type = type || 'Error'; + } +} + +/** + * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. + * + * @param event The event to modify. + * @param newMechanism Mechanism data to add to the event. + * @hidden + */ +function addExceptionMechanism(event, newMechanism) { + const firstException = getFirstException(event); + if (!firstException) { + return; + } + + const defaultMechanism = { type: 'generic', handled: true }; + const currentMechanism = firstException.mechanism; + firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; + + if (newMechanism && 'data' in newMechanism) { + const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data }; + firstException.mechanism.data = mergedData; + } +} + +// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string +const SEMVER_REGEXP = + /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; + +/** + * Represents Semantic Versioning object + */ + +function _parseInt(input) { + return parseInt(input || '', 10); +} + +/** + * Parses input into a SemVer interface + * @param input string representation of a semver version + */ +function parseSemver(input) { + const match = input.match(SEMVER_REGEXP) || []; + const major = _parseInt(match[1]); + const minor = _parseInt(match[2]); + const patch = _parseInt(match[3]); + return { + buildmetadata: match[5], + major: isNaN(major) ? undefined : major, + minor: isNaN(minor) ? undefined : minor, + patch: isNaN(patch) ? undefined : patch, + prerelease: match[4], + }; +} + +/** + * This function adds context (pre/post/line) lines to the provided frame + * + * @param lines string[] containing all lines + * @param frame StackFrame that will be mutated + * @param linesOfContext number of context lines we want to add pre/post + */ +function addContextToFrame(lines, frame, linesOfContext = 5) { + // When there is no line number in the frame, attaching context is nonsensical and will even break grouping + if (frame.lineno === undefined) { + return; + } + + const maxLines = lines.length; + const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0); + + frame.pre_context = lines + .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) + .map((line) => (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.snipLine)(line, 0)); + + // We guard here to ensure this is not larger than the existing number of lines + const lineIndex = Math.min(maxLines - 1, sourceLine); + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + frame.context_line = (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.snipLine)(lines[lineIndex], frame.colno || 0); + + frame.post_context = lines + .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) + .map((line) => (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.snipLine)(line, 0)); +} + +/** + * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object + * in question), and marks it captured if not. + * + * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and + * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so + * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because + * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not + * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This + * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we + * see it. + * + * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on + * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent + * object wrapper forms so that this check will always work. However, because we need to flag the exact object which + * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification + * must be done before the exception captured. + * + * @param A thrown exception to check or flag as having been seen + * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) + */ +function checkOrSetAlreadyCaught(exception) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (exception && (exception ).__sentry_captured__) { + return true; + } + + try { + // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the + // `ExtraErrorData` integration + (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.addNonEnumerableProperty)(exception , '__sentry_captured__', true); + } catch (err) { + // `exception` is a primitive, so we can't mark it seen + } + + return false; +} + +/** + * Checks whether the given input is already an array, and if it isn't, wraps it in one. + * + * @param maybeArray Input to turn into an array, if necessary + * @returns The input, if already an array, or an array with the input as the only element, if not + * + * @deprecated This function has been deprecated and will not be replaced. + */ +function arrayify(maybeArray) { + return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; +} + + +//# sourceMappingURL=misc.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/node.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/node.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ dynamicRequire: () => (/* binding */ dynamicRequire), +/* harmony export */ isNodeEnv: () => (/* binding */ isNodeEnv), +/* harmony export */ loadModule: () => (/* binding */ loadModule) +/* harmony export */ }); +/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/env.js"); + + +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + + +/** + * Checks whether we're in the Node.js or Browser environment + * + * @returns Answer to given question + */ +function isNodeEnv() { + // explicitly check for browser bundles as those can be optimized statically + // by terser/rollup. + return ( + !(0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isBrowserBundle)() && + Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]' + ); +} + +/** + * Requires a module which is protected against bundler minification. + * + * @param request The module path to resolve + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function dynamicRequire(mod, request) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return mod.require(request); +} + +/** + * Helper for dynamically loading module that should work with linked dependencies. + * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` + * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during + * build time. `require.resolve` is also not available in any other way, so we cannot create, + * a fake helper like we do with `dynamicRequire`. + * + * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. + * That is to mimic the behavior of `require.resolve` exactly. + * + * @param moduleName module name to require + * @returns possibly required module + */ +function loadModule(moduleName) { + let mod; + + try { + mod = dynamicRequire(module, moduleName); + } catch (e) { + // no-empty + } + + if (!mod) { + try { + const { cwd } = dynamicRequire(module, 'process'); + mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ; + } catch (e) { + // no-empty + } + } + + return mod; +} + + +//# sourceMappingURL=node.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/normalize.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/normalize.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ normalize: () => (/* binding */ normalize), +/* harmony export */ normalizeToSize: () => (/* binding */ normalizeToSize), +/* harmony export */ normalizeUrlToBase: () => (/* binding */ normalizeUrlToBase) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _memo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memo.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/memo.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stacktrace.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js"); + + + + + +/** + * Recursively normalizes the given object. + * + * - Creates a copy to prevent original input mutation + * - Skips non-enumerable properties + * - When stringifying, calls `toJSON` if implemented + * - Removes circular references + * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format + * - Translates known global objects/classes to a string representations + * - Takes care of `Error` object serialization + * - Optionally limits depth of final output + * - Optionally limits number of properties/elements included in any single object/array + * + * @param input The object to be normalized. + * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) + * @param maxProperties The max number of elements or properties to be included in any single array or + * object in the normalized output. + * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function normalize(input, depth = 100, maxProperties = +Infinity) { + try { + // since we're at the outermost level, we don't provide a key + return visit('', input, depth, maxProperties); + } catch (err) { + return { ERROR: `**non-serializable** (${err})` }; + } +} + +/** JSDoc */ +function normalizeToSize( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + object, + // Default Node.js REPL depth + depth = 3, + // 100kB, as 200kB is max payload size, so half sounds reasonable + maxSize = 100 * 1024, +) { + const normalized = normalize(object, depth); + + if (jsonSize(normalized) > maxSize) { + return normalizeToSize(object, depth - 1, maxSize); + } + + return normalized ; +} + +/** + * Visits a node to perform normalization on it + * + * @param key The key corresponding to the given node + * @param value The node to be visited + * @param depth Optional number indicating the maximum recursion depth + * @param maxProperties Optional maximum number of properties/elements included in any single object/array + * @param memo Optional Memo class handling decycling + */ +function visit( + key, + value, + depth = +Infinity, + maxProperties = +Infinity, + // eslint-disable-next-line deprecation/deprecation + memo = (0,_memo_js__WEBPACK_IMPORTED_MODULE_0__.memoBuilder)(), +) { + const [memoize, unmemoize] = memo; + + // Get the simple cases out of the way first + if ( + value == null || // this matches null and undefined -> eqeq not eqeqeq + ['boolean', 'string'].includes(typeof value) || + (typeof value === 'number' && Number.isFinite(value)) + ) { + return value ; + } + + const stringified = stringifyValue(key, value); + + // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. + // Everything else will have already been serialized, so if we don't see that pattern, we're done. + if (!stringified.startsWith('[object ')) { + return stringified; + } + + // From here on, we can assert that `value` is either an object or an array. + + // Do not normalize objects that we know have already been normalized. As a general rule, the + // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that + // have already been normalized. + if ((value )['__sentry_skip_normalization__']) { + return value ; + } + + // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there + // We keep a certain amount of depth. + // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state. + const remainingDepth = + typeof (value )['__sentry_override_normalization_depth__'] === 'number' + ? ((value )['__sentry_override_normalization_depth__'] ) + : depth; + + // We're also done if we've reached the max depth + if (remainingDepth === 0) { + // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. + return stringified.replace('object ', ''); + } + + // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. + if (memoize(value)) { + return '[Circular ~]'; + } + + // If the value has a `toJSON` method, we call it to extract more information + const valueWithToJSON = value ; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + try { + const jsonValue = valueWithToJSON.toJSON(); + // We need to normalize the return value of `.toJSON()` in case it has circular references + return visit('', jsonValue, remainingDepth - 1, maxProperties, memo); + } catch (err) { + // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) + } + } + + // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse + // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each + // property/entry, and keep track of the number of items we add to it. + const normalized = (Array.isArray(value) ? [] : {}) ; + let numAdded = 0; + + // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant + // properties are non-enumerable and otherwise would get missed. + const visitable = (0,_object_js__WEBPACK_IMPORTED_MODULE_1__.convertToPlainObject)(value ); + + for (const visitKey in visitable) { + // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. + if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { + continue; + } + + if (numAdded >= maxProperties) { + normalized[visitKey] = '[MaxProperties ~]'; + break; + } + + // Recursively visit all the child nodes + const visitValue = visitable[visitKey]; + normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo); + + numAdded++; + } + + // Once we've visited all the branches, remove the parent from memo storage + unmemoize(value); + + // Return accumulated values + return normalized; +} + +/* eslint-disable complexity */ +/** + * Stringify the given value. Handles various known special values and types. + * + * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn + * the number 1231 into "[Object Number]", nor on `null`, as it will throw. + * + * @param value The value to stringify + * @returns A stringified representation of the given value + */ +function stringifyValue( + key, + // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for + // our internal use, it'll do + value, +) { + try { + if (key === 'domain' && value && typeof value === 'object' && (value )._events) { + return '[Domain]'; + } + + if (key === 'domainEmitter') { + return '[DomainEmitter]'; + } + + // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first + // which won't throw if they are not present. + + if (typeof global !== 'undefined' && value === global) { + return '[Global]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof window !== 'undefined' && value === window) { + return '[Window]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof document !== 'undefined' && value === document) { + return '[Document]'; + } + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isVueViewModel)(value)) { + return '[VueViewModel]'; + } + + // React's SyntheticEvent thingy + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isSyntheticEvent)(value)) { + return '[SyntheticEvent]'; + } + + if (typeof value === 'number' && !Number.isFinite(value)) { + return `[${value}]`; + } + + if (typeof value === 'function') { + return `[Function: ${(0,_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(value)}]`; + } + + if (typeof value === 'symbol') { + return `[${String(value)}]`; + } + + // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion + if (typeof value === 'bigint') { + return `[BigInt: ${String(value)}]`; + } + + // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting + // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as + // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), + // we can make sure that only plain objects come out that way. + const objName = getConstructorName(value); + + // Handle HTML Elements + if (/^HTML(\w*)Element$/.test(objName)) { + return `[HTMLElement: ${objName}]`; + } + + return `[object ${objName}]`; + } catch (err) { + return `**non-serializable** (${err})`; + } +} +/* eslint-enable complexity */ + +function getConstructorName(value) { + const prototype = Object.getPrototypeOf(value); + + return prototype ? prototype.constructor.name : 'null prototype'; +} + +/** Calculates bytes size of input string */ +function utf8Length(value) { + // eslint-disable-next-line no-bitwise + return ~-encodeURI(value).split(/%..|./).length; +} + +/** Calculates bytes size of input object */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function jsonSize(value) { + return utf8Length(JSON.stringify(value)); +} + +/** + * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint + * across platforms and working directory. + * + * @param url The URL to be normalized. + * @param basePath The application base path. + * @returns The normalized URL. + */ +function normalizeUrlToBase(url, basePath) { + const escapedBase = basePath + // Backslash to forward + .replace(/\\/g, '/') + // Escape RegExp special characters + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); + + let newUrl = url; + try { + newUrl = decodeURI(url); + } catch (_Oo) { + // Sometime this breaks + } + return ( + newUrl + .replace(/\\/g, '/') + .replace(/webpack:\/?/g, '') // Remove intermediate base path + // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor + .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///') + ); +} + + +//# sourceMappingURL=normalize.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/object.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addNonEnumerableProperty: () => (/* binding */ addNonEnumerableProperty), +/* harmony export */ convertToPlainObject: () => (/* binding */ convertToPlainObject), +/* harmony export */ dropUndefinedKeys: () => (/* binding */ dropUndefinedKeys), +/* harmony export */ extractExceptionKeysForMessage: () => (/* binding */ extractExceptionKeysForMessage), +/* harmony export */ fill: () => (/* binding */ fill), +/* harmony export */ getOriginalFunction: () => (/* binding */ getOriginalFunction), +/* harmony export */ markFunctionWrapped: () => (/* binding */ markFunctionWrapped), +/* harmony export */ objectify: () => (/* binding */ objectify), +/* harmony export */ urlEncode: () => (/* binding */ urlEncode) +/* harmony export */ }); +/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./browser.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/browser.js"); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); + + + + + + +/** + * Replace a method in an object with a wrapped version of itself. + * + * @param source An object that contains a method to be wrapped. + * @param name The name of the method to be wrapped. + * @param replacementFactory A higher-order function that takes the original version of the given method and returns a + * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to + * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`. + * @returns void + */ +function fill(source, name, replacementFactory) { + if (!(name in source)) { + return; + } + + const original = source[name] ; + const wrapped = replacementFactory(original) ; + + // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work + // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" + if (typeof wrapped === 'function') { + markFunctionWrapped(wrapped, original); + } + + try { + source[name] = wrapped; + } catch (e) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.log(`Failed to replace method "${name}" in object`, source); + } +} + +/** + * Defines a non-enumerable property on the given object. + * + * @param obj The object on which to set the property + * @param name The name of the property to be set + * @param value The value to which to set the property + */ +function addNonEnumerableProperty(obj, name, value) { + try { + Object.defineProperty(obj, name, { + // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it + value: value, + writable: true, + configurable: true, + }); + } catch (o_O) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); + } +} + +/** + * Remembers the original function on the wrapped function and + * patches up the prototype. + * + * @param wrapped the wrapper function + * @param original the original function that gets wrapped + */ +function markFunctionWrapped(wrapped, original) { + try { + const proto = original.prototype || {}; + wrapped.prototype = original.prototype = proto; + addNonEnumerableProperty(wrapped, '__sentry_original__', original); + } catch (o_O) {} // eslint-disable-line no-empty +} + +/** + * This extracts the original function if available. See + * `markFunctionWrapped` for more information. + * + * @param func the function to unwrap + * @returns the unwrapped version of the function if available. + */ +function getOriginalFunction(func) { + return func.__sentry_original__; +} + +/** + * Encodes given object into url-friendly format + * + * @param object An object that contains serializable values + * @returns string Encoded + * + * @deprecated This function is deprecated and will be removed in the next major version of the SDK. + */ +function urlEncode(object) { + return Object.keys(object) + .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`) + .join('&'); +} + +/** + * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their + * non-enumerable properties attached. + * + * @param value Initial source that we have to transform in order for it to be usable by the serializer + * @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor + * an Error. + */ +function convertToPlainObject( + value, +) + + { + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isError)(value)) { + return { + message: value.message, + name: value.name, + stack: value.stack, + ...getOwnProperties(value), + }; + } else if ((0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isEvent)(value)) { + const newObj + + = { + type: value.type, + target: serializeEventTarget(value.target), + currentTarget: serializeEventTarget(value.currentTarget), + ...getOwnProperties(value), + }; + + if (typeof CustomEvent !== 'undefined' && (0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isInstanceOf)(value, CustomEvent)) { + newObj.detail = value.detail; + } + + return newObj; + } else { + return value; + } +} + +/** Creates a string representation of the target of an `Event` object */ +function serializeEventTarget(target) { + try { + return (0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isElement)(target) ? (0,_browser_js__WEBPACK_IMPORTED_MODULE_3__.htmlTreeAsString)(target) : Object.prototype.toString.call(target); + } catch (_oO) { + return ''; + } +} + +/** Filters out all but an object's own properties */ +function getOwnProperties(obj) { + if (typeof obj === 'object' && obj !== null) { + const extractedProps = {}; + for (const property in obj) { + if (Object.prototype.hasOwnProperty.call(obj, property)) { + extractedProps[property] = (obj )[property]; + } + } + return extractedProps; + } else { + return {}; + } +} + +/** + * Given any captured exception, extract its keys and create a sorted + * and truncated list that will be used inside the event message. + * eg. `Non-error exception captured with keys: foo, bar, baz` + */ +function extractExceptionKeysForMessage(exception, maxLength = 40) { + const keys = Object.keys(convertToPlainObject(exception)); + keys.sort(); + + const firstKey = keys[0]; + + if (!firstKey) { + return '[object has no keys]'; + } + + if (firstKey.length >= maxLength) { + return (0,_string_js__WEBPACK_IMPORTED_MODULE_4__.truncate)(firstKey, maxLength); + } + + for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { + const serialized = keys.slice(0, includedKeys).join(', '); + if (serialized.length > maxLength) { + continue; + } + if (includedKeys === keys.length) { + return serialized; + } + return (0,_string_js__WEBPACK_IMPORTED_MODULE_4__.truncate)(serialized, maxLength); + } + + return ''; +} + +/** + * Given any object, return a new object having removed all fields whose value was `undefined`. + * Works recursively on objects and arrays. + * + * Attention: This function keeps circular references in the returned object. + */ +function dropUndefinedKeys(inputValue) { + // This map keeps track of what already visited nodes map to. + // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular + // references as the input object. + const memoizationMap = new Map(); + + // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API + return _dropUndefinedKeys(inputValue, memoizationMap); +} + +function _dropUndefinedKeys(inputValue, memoizationMap) { + if (isPojo(inputValue)) { + // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = {}; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + for (const key of Object.getOwnPropertyNames(inputValue)) { + if (typeof inputValue[key] !== 'undefined') { + returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); + } + } + + return returnValue ; + } + + if (Array.isArray(inputValue)) { + // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = []; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + inputValue.forEach((item) => { + returnValue.push(_dropUndefinedKeys(item, memoizationMap)); + }); + + return returnValue ; + } + + return inputValue; +} + +function isPojo(input) { + if (!(0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isPlainObject)(input)) { + return false; + } + + try { + const name = (Object.getPrototypeOf(input) ).constructor.name; + return !name || name === 'Object'; + } catch (e2) { + return true; + } +} + +/** + * Ensure that something is an object. + * + * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper + * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. + * + * @param wat The subject of the objectification + * @returns A version of `wat` which can safely be used with `Object` class methods + */ +function objectify(wat) { + let objectified; + switch (true) { + case wat === undefined || wat === null: + objectified = new String(wat); + break; + + // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason + // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as + // an object in order to wrap it. + case typeof wat === 'symbol' || typeof wat === 'bigint': + objectified = Object(wat); + break; + + // this will catch the remaining primitives: `String`, `Number`, and `Boolean` + case (0,_is_js__WEBPACK_IMPORTED_MODULE_2__.isPrimitive)(wat): + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + objectified = new (wat ).constructor(wat); + break; + + // by process of elimination, at this point we know that `wat` must already be an object + default: + objectified = wat; + break; + } + return objectified; +} + + +//# sourceMappingURL=object.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/path.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/path.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ basename: () => (/* binding */ basename), +/* harmony export */ dirname: () => (/* binding */ dirname), +/* harmony export */ isAbsolute: () => (/* binding */ isAbsolute), +/* harmony export */ join: () => (/* binding */ join), +/* harmony export */ normalizePath: () => (/* binding */ normalizePath), +/* harmony export */ relative: () => (/* binding */ relative), +/* harmony export */ resolve: () => (/* binding */ resolve) +/* harmony export */ }); +// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript +// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js +// +// Copyright Joyent, Inc.and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +/** JSDoc */ +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + let up = 0; + for (let i = parts.length - 1; i >= 0; i--) { + const last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; +/** JSDoc */ +function splitPath(filename) { + // Truncate files names greater than 1024 characters to avoid regex dos + // https://github.com/getsentry/sentry-javascript/pull/8737#discussion_r1285719172 + const truncated = filename.length > 1024 ? `${filename.slice(-1024)}` : filename; + const parts = splitPathRe.exec(truncated); + return parts ? parts.slice(1) : []; +} + +// path.resolve([from ...], to) +// posix version +/** JSDoc */ +function resolve(...args) { + let resolvedPath = ''; + let resolvedAbsolute = false; + + for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { + const path = i >= 0 ? args[i] : '/'; + + // Skip empty entries + if (!path) { + continue; + } + + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray( + resolvedPath.split('/').filter(p => !!p), + !resolvedAbsolute, + ).join('/'); + + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; +} + +/** JSDoc */ +function trim(arr) { + let start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') { + break; + } + } + + let end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') { + break; + } + } + + if (start > end) { + return []; + } + return arr.slice(start, end - start + 1); +} + +// path.relative(from, to) +// posix version +/** JSDoc */ +function relative(from, to) { + /* eslint-disable no-param-reassign */ + from = resolve(from).slice(1); + to = resolve(to).slice(1); + /* eslint-enable no-param-reassign */ + + const fromParts = trim(from.split('/')); + const toParts = trim(to.split('/')); + + const length = Math.min(fromParts.length, toParts.length); + let samePartsLength = length; + for (let i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + let outputParts = []; + for (let i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +} + +// path.normalize(path) +// posix version +/** JSDoc */ +function normalizePath(path) { + const isPathAbsolute = isAbsolute(path); + const trailingSlash = path.slice(-1) === '/'; + + // Normalize the path + let normalizedPath = normalizeArray( + path.split('/').filter(p => !!p), + !isPathAbsolute, + ).join('/'); + + if (!normalizedPath && !isPathAbsolute) { + normalizedPath = '.'; + } + if (normalizedPath && trailingSlash) { + normalizedPath += '/'; + } + + return (isPathAbsolute ? '/' : '') + normalizedPath; +} + +// posix version +/** JSDoc */ +function isAbsolute(path) { + return path.charAt(0) === '/'; +} + +// posix version +/** JSDoc */ +function join(...args) { + return normalizePath(args.join('/')); +} + +/** JSDoc */ +function dirname(path) { + const result = splitPath(path); + const root = result[0] || ''; + let dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.slice(0, dir.length - 1); + } + + return root + dir; +} + +/** JSDoc */ +function basename(path, ext) { + let f = splitPath(path)[2] || ''; + if (ext && f.slice(ext.length * -1) === ext) { + f = f.slice(0, f.length - ext.length); + } + return f; +} + + +//# sourceMappingURL=path.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/promisebuffer.js": +/*!******************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/promisebuffer.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ makePromiseBuffer: () => (/* binding */ makePromiseBuffer) +/* harmony export */ }); +/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/error.js"); +/* harmony import */ var _syncpromise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./syncpromise.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js"); + + + +/** + * Creates an new PromiseBuffer object with the specified limit + * @param limit max number of promises that can be stored in the buffer + */ +function makePromiseBuffer(limit) { + const buffer = []; + + function isReady() { + return limit === undefined || buffer.length < limit; + } + + /** + * Remove a promise from the queue. + * + * @param task Can be any PromiseLike + * @returns Removed promise. + */ + function remove(task) { + return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(undefined); + } + + /** + * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. + * + * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task: + * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor + * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By + * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer + * limit check. + * @returns The original promise. + */ + function add(taskProducer) { + if (!isReady()) { + return (0,_syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.rejectedSyncPromise)(new _error_js__WEBPACK_IMPORTED_MODULE_1__.SentryError('Not adding Promise because buffer limit was reached.')); + } + + // start the task and add its promise to the queue + const task = taskProducer(); + if (buffer.indexOf(task) === -1) { + buffer.push(task); + } + void task + .then(() => remove(task)) + // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` + // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't + // have promises, so TS has to polyfill when down-compiling.) + .then(null, () => + remove(task).then(null, () => { + // We have to add another catch here because `remove()` starts a new promise chain. + }), + ); + return task; + } + + /** + * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or + * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to + * `true`. + * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and + * `false` otherwise + */ + function drain(timeout) { + return new _syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.SyncPromise((resolve, reject) => { + let counter = buffer.length; + + if (!counter) { + return resolve(true); + } + + // wait for `timeout` ms and then resolve to `false` (if not cancelled first) + const capturedSetTimeout = setTimeout(() => { + if (timeout && timeout > 0) { + resolve(false); + } + }, timeout); + + // if all promises resolve in time, cancel the timer and resolve to `true` + buffer.forEach(item => { + void (0,_syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.resolvedSyncPromise)(item).then(() => { + if (!--counter) { + clearTimeout(capturedSetTimeout); + resolve(true); + } + }, reject); + }); + }); + } + + return { + $: buffer, + add, + drain, + }; +} + + +//# sourceMappingURL=promisebuffer.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js": +/*!***********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ generatePropagationContext: () => (/* binding */ generatePropagationContext) +/* harmony export */ }); +/* harmony import */ var _misc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); + + +/** + * Returns a new minimal propagation context + */ +function generatePropagationContext() { + return { + traceId: (0,_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)(), + spanId: (0,_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)().substring(16), + }; +} + + +//# sourceMappingURL=propagationContext.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/ratelimit.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/ratelimit.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_RETRY_AFTER: () => (/* binding */ DEFAULT_RETRY_AFTER), +/* harmony export */ disabledUntil: () => (/* binding */ disabledUntil), +/* harmony export */ isRateLimited: () => (/* binding */ isRateLimited), +/* harmony export */ parseRetryAfterHeader: () => (/* binding */ parseRetryAfterHeader), +/* harmony export */ updateRateLimits: () => (/* binding */ updateRateLimits) +/* harmony export */ }); +// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend + +const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds + +/** + * Extracts Retry-After value from the request header or returns default value + * @param header string representation of 'Retry-After' header + * @param now current unix timestamp + * + */ +function parseRetryAfterHeader(header, now = Date.now()) { + const headerDelay = parseInt(`${header}`, 10); + if (!isNaN(headerDelay)) { + return headerDelay * 1000; + } + + const headerDate = Date.parse(`${header}`); + if (!isNaN(headerDate)) { + return headerDate - now; + } + + return DEFAULT_RETRY_AFTER; +} + +/** + * Gets the time that the given category is disabled until for rate limiting. + * In case no category-specific limit is set but a general rate limit across all categories is active, + * that time is returned. + * + * @return the time in ms that the category is disabled until or 0 if there's no active rate limit. + */ +function disabledUntil(limits, dataCategory) { + return limits[dataCategory] || limits.all || 0; +} + +/** + * Checks if a category is rate limited + */ +function isRateLimited(limits, dataCategory, now = Date.now()) { + return disabledUntil(limits, dataCategory) > now; +} + +/** + * Update ratelimits from incoming headers. + * + * @return the updated RateLimits object. + */ +function updateRateLimits( + limits, + { statusCode, headers }, + now = Date.now(), +) { + const updatedRateLimits = { + ...limits, + }; + + // "The name is case-insensitive." + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + const rateLimitHeader = headers && headers['x-sentry-rate-limits']; + const retryAfterHeader = headers && headers['retry-after']; + + if (rateLimitHeader) { + /** + * rate limit headers are of the form + *
,
,.. + * where each
is of the form + * : : : : + * where + * is a delay in seconds + * is the event type(s) (error, transaction, etc) being rate limited and is of the form + * ;;... + * is what's being limited (org, project, or key) - ignored by SDK + * is an arbitrary string like "org_quota" - ignored by SDK + * Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected. + * Only present if rate limit applies to the metric_bucket data category. + */ + for (const limit of rateLimitHeader.trim().split(',')) { + const [retryAfter, categories, , , namespaces] = limit.split(':', 5) ; + const headerDelay = parseInt(retryAfter, 10); + const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + if (!categories) { + updatedRateLimits.all = now + delay; + } else { + for (const category of categories.split(';')) { + if (category === 'metric_bucket') { + // namespaces will be present when category === 'metric_bucket' + if (!namespaces || namespaces.split(';').includes('custom')) { + updatedRateLimits[category] = now + delay; + } + } else { + updatedRateLimits[category] = now + delay; + } + } + } + } + } else if (retryAfterHeader) { + updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); + } else if (statusCode === 429) { + updatedRateLimits.all = now + 60 * 1000; + } + + return updatedRateLimits; +} + + +//# sourceMappingURL=ratelimit.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/severity.js": +/*!*************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/severity.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ severityLevelFromString: () => (/* binding */ severityLevelFromString), +/* harmony export */ validSeverityLevels: () => (/* binding */ validSeverityLevels) +/* harmony export */ }); +/** + * @deprecated This variable has been deprecated and will be removed in the next major version. + */ +const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; + +/** + * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. + * + * @param level String representation of desired `SeverityLevel`. + * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level. + */ +function severityLevelFromString(level) { + return ( + level === 'warn' ? 'warning' : ['fatal', 'error', 'warning', 'log', 'info', 'debug'].includes(level) ? level : 'log' + ) ; +} + + +//# sourceMappingURL=severity.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js": +/*!***************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ UNKNOWN_FUNCTION: () => (/* binding */ UNKNOWN_FUNCTION), +/* harmony export */ createStackParser: () => (/* binding */ createStackParser), +/* harmony export */ getFramesFromEvent: () => (/* binding */ getFramesFromEvent), +/* harmony export */ getFunctionName: () => (/* binding */ getFunctionName), +/* harmony export */ stackParserFromStackParserOptions: () => (/* binding */ stackParserFromStackParserOptions), +/* harmony export */ stripSentryFramesAndReverse: () => (/* binding */ stripSentryFramesAndReverse) +/* harmony export */ }); +const STACKTRACE_FRAME_LIMIT = 50; +const UNKNOWN_FUNCTION = '?'; +// Used to sanitize webpack (error: *) wrapped stack errors +const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; +const STRIP_FRAME_REGEXP = /captureMessage|captureException/; + +/** + * Creates a stack parser with the supplied line parsers + * + * StackFrames are returned in the correct order for Sentry Exception + * frames and with Sentry SDK internal frames removed from the top and bottom + * + */ +function createStackParser(...parsers) { + const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); + + return (stack, skipFirstLines = 0, framesToPop = 0) => { + const frames = []; + const lines = stack.split('\n'); + + for (let i = skipFirstLines; i < lines.length; i++) { + const line = lines[i] ; + // Ignore lines over 1kb as they are unlikely to be stack frames. + // Many of the regular expressions use backtracking which results in run time that increases exponentially with + // input size. Huge strings can result in hangs/Denial of Service: + // https://github.com/getsentry/sentry-javascript/issues/2286 + if (line.length > 1024) { + continue; + } + + // https://github.com/getsentry/sentry-javascript/issues/5459 + // Remove webpack (error: *) wrappers + const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line; + + // https://github.com/getsentry/sentry-javascript/issues/7813 + // Skip Error: lines + if (cleanedLine.match(/\S*Error: /)) { + continue; + } + + for (const parser of sortedParsers) { + const frame = parser(cleanedLine); + + if (frame) { + frames.push(frame); + break; + } + } + + if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { + break; + } + } + + return stripSentryFramesAndReverse(frames.slice(framesToPop)); + }; +} + +/** + * Gets a stack parser implementation from Options.stackParser + * @see Options + * + * If options contains an array of line parsers, it is converted into a parser + */ +function stackParserFromStackParserOptions(stackParser) { + if (Array.isArray(stackParser)) { + return createStackParser(...stackParser); + } + return stackParser; +} + +/** + * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames. + * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the + * function that caused the crash is the last frame in the array. + * @hidden + */ +function stripSentryFramesAndReverse(stack) { + if (!stack.length) { + return []; + } + + const localStack = Array.from(stack); + + // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) + if (/sentryWrapped/.test(getLastStackFrame(localStack).function || '')) { + localStack.pop(); + } + + // Reversing in the middle of the procedure allows us to just pop the values off the stack + localStack.reverse(); + + // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call) + if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) { + localStack.pop(); + + // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')` + // is produced within the hub itself, making it: + // + // Sentry.captureException() + // getCurrentHub().captureException() + // + // instead of just the top `Sentry` call itself. + // This forces us to possibly strip an additional frame in the exact same was as above. + if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) { + localStack.pop(); + } + } + + return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({ + ...frame, + filename: frame.filename || getLastStackFrame(localStack).filename, + function: frame.function || UNKNOWN_FUNCTION, + })); +} + +function getLastStackFrame(arr) { + return arr[arr.length - 1] || {}; +} + +const defaultFunctionName = ''; + +/** + * Safely extract function name from itself + */ +function getFunctionName(fn) { + try { + if (!fn || typeof fn !== 'function') { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + return defaultFunctionName; + } +} + +/** + * Get's stack frames from an event without needing to check for undefined properties. + */ +function getFramesFromEvent(event) { + const exception = event.exception; + + if (exception) { + const frames = []; + try { + // @ts-expect-error Object could be undefined + exception.values.forEach(value => { + // @ts-expect-error Value could be undefined + if (value.stacktrace.frames) { + // @ts-expect-error Value could be undefined + frames.push(...value.stacktrace.frames); + } + }); + return frames; + } catch (_oO) { + return undefined; + } + } + return undefined; +} + + +//# sourceMappingURL=stacktrace.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/string.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isMatchingPattern: () => (/* binding */ isMatchingPattern), +/* harmony export */ safeJoin: () => (/* binding */ safeJoin), +/* harmony export */ snipLine: () => (/* binding */ snipLine), +/* harmony export */ stringMatchesSomePattern: () => (/* binding */ stringMatchesSomePattern), +/* harmony export */ truncate: () => (/* binding */ truncate) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); + + +/** + * Truncates given string to the maximum characters count + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string (0 = unlimited) + * @returns string Encoded + */ +function truncate(str, max = 0) { + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : `${str.slice(0, max)}...`; +} + +/** + * This is basically just `trim_line` from + * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string + * @returns string Encoded + */ +function snipLine(line, colno) { + let newLine = line; + const lineLength = newLine.length; + if (lineLength <= 150) { + return newLine; + } + if (colno > lineLength) { + // eslint-disable-next-line no-param-reassign + colno = lineLength; + } + + let start = Math.max(colno - 60, 0); + if (start < 5) { + start = 0; + } + + let end = Math.min(start + 140, lineLength); + if (end > lineLength - 5) { + end = lineLength; + } + if (end === lineLength) { + start = Math.max(end - 140, 0); + } + + newLine = newLine.slice(start, end); + if (start > 0) { + newLine = `'{snip} ${newLine}`; + } + if (end < lineLength) { + newLine += ' {snip}'; + } + + return newLine; +} + +/** + * Join values in array + * @param input array of values to be joined together + * @param delimiter string to be placed in-between values + * @returns Joined values + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function safeJoin(input, delimiter) { + if (!Array.isArray(input)) { + return ''; + } + + const output = []; + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < input.length; i++) { + const value = input[i]; + try { + // This is a hack to fix a Vue3-specific bug that causes an infinite loop of + // console warnings. This happens when a Vue template is rendered with + // an undeclared variable, which we try to stringify, ultimately causing + // Vue to issue another warning which repeats indefinitely. + // see: https://github.com/getsentry/sentry-javascript/pull/8981 + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isVueViewModel)(value)) { + output.push('[VueViewModel]'); + } else { + output.push(String(value)); + } + } catch (e) { + output.push('[value cannot be serialized]'); + } + } + + return output.join(delimiter); +} + +/** + * Checks if the given value matches a regex or string + * + * @param value The string to test + * @param pattern Either a regex or a string against which `value` will be matched + * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match + * `pattern` if it contains `pattern`. Only applies to string-type patterns. + */ +function isMatchingPattern( + value, + pattern, + requireExactStringMatch = false, +) { + if (!(0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value)) { + return false; + } + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isRegExp)(pattern)) { + return pattern.test(value); + } + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isString)(pattern)) { + return requireExactStringMatch ? value === pattern : value.includes(pattern); + } + + return false; +} + +/** + * Test the given string against an array of strings and regexes. By default, string matching is done on a + * substring-inclusion basis rather than a strict equality basis + * + * @param testString The string to test + * @param patterns The patterns against which to test the string + * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to + * count. If false, `testString` will match a string pattern if it contains that pattern. + * @returns + */ +function stringMatchesSomePattern( + testString, + patterns = [], + requireExactStringMatch = false, +) { + return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch)); +} + + +//# sourceMappingURL=string.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js": +/*!*************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/supports.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isNativeFunction: () => (/* binding */ isNativeFunction), +/* harmony export */ supportsDOMError: () => (/* binding */ supportsDOMError), +/* harmony export */ supportsDOMException: () => (/* binding */ supportsDOMException), +/* harmony export */ supportsErrorEvent: () => (/* binding */ supportsErrorEvent), +/* harmony export */ supportsFetch: () => (/* binding */ supportsFetch), +/* harmony export */ supportsNativeFetch: () => (/* binding */ supportsNativeFetch), +/* harmony export */ supportsReferrerPolicy: () => (/* binding */ supportsReferrerPolicy), +/* harmony export */ supportsReportingObserver: () => (/* binding */ supportsReportingObserver) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debug-build.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + + + +const WINDOW = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +/** + * Tells whether current environment supports ErrorEvent objects + * {@link supportsErrorEvent}. + * + * @returns Answer to the given question. + */ +function supportsErrorEvent() { + try { + new ErrorEvent(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports DOMError objects + * {@link supportsDOMError}. + * + * @returns Answer to the given question. + */ +function supportsDOMError() { + try { + // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': + // 1 argument required, but only 0 present. + // @ts-expect-error It really needs 1 argument, not 0. + new DOMError(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports DOMException objects + * {@link supportsDOMException}. + * + * @returns Answer to the given question. + */ +function supportsDOMException() { + try { + new DOMException(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports Fetch API + * {@link supportsFetch}. + * + * @returns Answer to the given question. + */ +function supportsFetch() { + if (!('fetch' in WINDOW)) { + return false; + } + + try { + new Headers(); + new Request('http://www.example.com'); + new Response(); + return true; + } catch (e) { + return false; + } +} + +/** + * isNative checks if the given function is a native implementation + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function isNativeFunction(func) { + return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); +} + +/** + * Tells whether current environment supports Fetch API natively + * {@link supportsNativeFetch}. + * + * @returns true if `window.fetch` is natively implemented, false otherwise + */ +function supportsNativeFetch() { + if (typeof EdgeRuntime === 'string') { + return true; + } + + if (!supportsFetch()) { + return false; + } + + // Fast path to avoid DOM I/O + // eslint-disable-next-line @typescript-eslint/unbound-method + if (isNativeFunction(WINDOW.fetch)) { + return true; + } + + // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) + // so create a "pure" iframe to see if that has native fetch + let result = false; + const doc = WINDOW.document; + // eslint-disable-next-line deprecation/deprecation + if (doc && typeof (doc.createElement ) === 'function') { + try { + const sandbox = doc.createElement('iframe'); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow && sandbox.contentWindow.fetch) { + // eslint-disable-next-line @typescript-eslint/unbound-method + result = isNativeFunction(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } catch (err) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.DEBUG_BUILD && + _logger_js__WEBPACK_IMPORTED_MODULE_2__.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); + } + } + + return result; +} + +/** + * Tells whether current environment supports ReportingObserver API + * {@link supportsReportingObserver}. + * + * @returns Answer to the given question. + */ +function supportsReportingObserver() { + return 'ReportingObserver' in WINDOW; +} + +/** + * Tells whether current environment supports Referrer Policy API + * {@link supportsReferrerPolicy}. + * + * @returns Answer to the given question. + */ +function supportsReferrerPolicy() { + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + + if (!supportsFetch()) { + return false; + } + + try { + new Request('_', { + referrerPolicy: 'origin' , + }); + return true; + } catch (e) { + return false; + } +} + + +//# sourceMappingURL=supports.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js": +/*!****************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SyncPromise: () => (/* binding */ SyncPromise), +/* harmony export */ rejectedSyncPromise: () => (/* binding */ rejectedSyncPromise), +/* harmony export */ resolvedSyncPromise: () => (/* binding */ resolvedSyncPromise) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); + + +/* eslint-disable @typescript-eslint/explicit-function-return-type */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** SyncPromise internal states */ +var States; (function (States) { + /** Pending */ + const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING"; + /** Resolved / OK */ + const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED"; + /** Rejected / Error */ + const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED"; +})(States || (States = {})); + +// Overloads so we can call resolvedSyncPromise without arguments and generic argument + +/** + * Creates a resolved sync promise. + * + * @param value the value to resolve the promise with + * @returns the resolved sync promise + */ +function resolvedSyncPromise(value) { + return new SyncPromise(resolve => { + resolve(value); + }); +} + +/** + * Creates a rejected sync promise. + * + * @param value the value to reject the promise with + * @returns the rejected sync promise + */ +function rejectedSyncPromise(reason) { + return new SyncPromise((_, reject) => { + reject(reason); + }); +} + +/** + * Thenable class that behaves like a Promise and follows it's interface + * but is not async internally + */ +class SyncPromise { + + constructor( + executor, + ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this); + this._state = States.PENDING; + this._handlers = []; + + try { + executor(this._resolve, this._reject); + } catch (e) { + this._reject(e); + } + } + + /** JSDoc */ + then( + onfulfilled, + onrejected, + ) { + return new SyncPromise((resolve, reject) => { + this._handlers.push([ + false, + result => { + if (!onfulfilled) { + // TODO: ¯\_(ツ)_/¯ + // TODO: FIXME + resolve(result ); + } else { + try { + resolve(onfulfilled(result)); + } catch (e) { + reject(e); + } + } + }, + reason => { + if (!onrejected) { + reject(reason); + } else { + try { + resolve(onrejected(reason)); + } catch (e) { + reject(e); + } + } + }, + ]); + this._executeHandlers(); + }); + } + + /** JSDoc */ + catch( + onrejected, + ) { + return this.then(val => val, onrejected); + } + + /** JSDoc */ + finally(onfinally) { + return new SyncPromise((resolve, reject) => { + let val; + let isRejected; + + return this.then( + value => { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, + reason => { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + }, + ).then(() => { + if (isRejected) { + reject(val); + return; + } + + resolve(val ); + }); + }); + } + + /** JSDoc */ + __init() {this._resolve = (value) => { + this._setResult(States.RESOLVED, value); + };} + + /** JSDoc */ + __init2() {this._reject = (reason) => { + this._setResult(States.REJECTED, reason); + };} + + /** JSDoc */ + __init3() {this._setResult = (state, value) => { + if (this._state !== States.PENDING) { + return; + } + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isThenable)(value)) { + void (value ).then(this._resolve, this._reject); + return; + } + + this._state = state; + this._value = value; + + this._executeHandlers(); + };} + + /** JSDoc */ + __init4() {this._executeHandlers = () => { + if (this._state === States.PENDING) { + return; + } + + const cachedHandlers = this._handlers.slice(); + this._handlers = []; + + cachedHandlers.forEach(handler => { + if (handler[0]) { + return; + } + + if (this._state === States.RESOLVED) { + handler[1](this._value ); + } + + if (this._state === States.REJECTED) { + handler[2](this._value); + } + + handler[0] = true; + }); + };} +} + + +//# sourceMappingURL=syncpromise.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js": +/*!*********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/time.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _browserPerformanceTimeOriginMode: () => (/* binding */ _browserPerformanceTimeOriginMode), +/* harmony export */ browserPerformanceTimeOrigin: () => (/* binding */ browserPerformanceTimeOrigin), +/* harmony export */ dateTimestampInSeconds: () => (/* binding */ dateTimestampInSeconds), +/* harmony export */ timestampInSeconds: () => (/* binding */ timestampInSeconds) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + +const ONE_SECOND_IN_MS = 1000; + +/** + * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance} + * for accessing a high-resolution monotonic clock. + */ + +/** + * Returns a timestamp in seconds since the UNIX epoch using the Date API. + * + * TODO(v8): Return type should be rounded. + */ +function dateTimestampInSeconds() { + return Date.now() / ONE_SECOND_IN_MS; +} + +/** + * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not + * support the API. + * + * Wrapping the native API works around differences in behavior from different browsers. + */ +function createUnixTimestampInSecondsFunc() { + const { performance } = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + if (!performance || !performance.now) { + return dateTimestampInSeconds; + } + + // Some browser and environments don't have a timeOrigin, so we fallback to + // using Date.now() to compute the starting time. + const approxStartingTimeOrigin = Date.now() - performance.now(); + const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin; + + // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current + // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed. + // + // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the + // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and + // correct for this. + // See: https://github.com/getsentry/sentry-javascript/issues/2590 + // See: https://github.com/mdn/content/issues/4713 + // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6 + return () => { + return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS; + }; +} + +/** + * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the + * availability of the Performance API. + * + * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is + * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The + * skew can grow to arbitrary amounts like days, weeks or months. + * See https://github.com/getsentry/sentry-javascript/issues/2590. + */ +const timestampInSeconds = createUnixTimestampInSecondsFunc(); + +/** + * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. + */ +let _browserPerformanceTimeOriginMode; + +/** + * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the + * performance API is available. + */ +const browserPerformanceTimeOrigin = (() => { + // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or + // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin + // data as reliable if they are within a reasonable threshold of the current time. + + const { performance } = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + if (!performance || !performance.now) { + _browserPerformanceTimeOriginMode = 'none'; + return undefined; + } + + const threshold = 3600 * 1000; + const performanceNow = performance.now(); + const dateNow = Date.now(); + + // if timeOrigin isn't available set delta to threshold so it isn't used + const timeOriginDelta = performance.timeOrigin + ? Math.abs(performance.timeOrigin + performanceNow - dateNow) + : threshold; + const timeOriginIsReliable = timeOriginDelta < threshold; + + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always + // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the + // Date API. + // eslint-disable-next-line deprecation/deprecation + const navigationStart = performance.timing && performance.timing.navigationStart; + const hasNavigationStart = typeof navigationStart === 'number'; + // if navigationStart isn't available set delta to threshold so it isn't used + const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; + const navigationStartIsReliable = navigationStartDelta < threshold; + + if (timeOriginIsReliable || navigationStartIsReliable) { + // Use the more reliable time origin + if (timeOriginDelta <= navigationStartDelta) { + _browserPerformanceTimeOriginMode = 'timeOrigin'; + return performance.timeOrigin; + } else { + _browserPerformanceTimeOriginMode = 'navigationStart'; + return navigationStart; + } + } + + // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. + _browserPerformanceTimeOriginMode = 'dateNow'; + return dateNow; +})(); + + +//# sourceMappingURL=time.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/tracing.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/tracing.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TRACEPARENT_REGEXP: () => (/* binding */ TRACEPARENT_REGEXP), +/* harmony export */ extractTraceparentData: () => (/* binding */ extractTraceparentData), +/* harmony export */ generateSentryTraceHeader: () => (/* binding */ generateSentryTraceHeader), +/* harmony export */ propagationContextFromHeaders: () => (/* binding */ propagationContextFromHeaders) +/* harmony export */ }); +/* harmony import */ var _baggage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baggage.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/baggage.js"); +/* harmony import */ var _misc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _propagationContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./propagationContext.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js"); + + + + +// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here +const TRACEPARENT_REGEXP = new RegExp( + '^[ \\t]*' + // whitespace + '([0-9a-f]{32})?' + // trace_id + '-?([0-9a-f]{16})?' + // span_id + '-?([01])?' + // sampled + '[ \\t]*$', // whitespace +); + +/** + * Extract transaction context data from a `sentry-trace` header. + * + * @param traceparent Traceparent string + * + * @returns Object containing data from the header, or undefined if traceparent string is malformed + */ +function extractTraceparentData(traceparent) { + if (!traceparent) { + return undefined; + } + + const matches = traceparent.match(TRACEPARENT_REGEXP); + if (!matches) { + return undefined; + } + + let parentSampled; + if (matches[3] === '1') { + parentSampled = true; + } else if (matches[3] === '0') { + parentSampled = false; + } + + return { + traceId: matches[1], + parentSampled, + parentSpanId: matches[2], + }; +} + +/** + * Create a propagation context from incoming headers or + * creates a minimal new one if the headers are undefined. + */ +function propagationContextFromHeaders( + sentryTrace, + baggage, +) { + const traceparentData = extractTraceparentData(sentryTrace); + const dynamicSamplingContext = (0,_baggage_js__WEBPACK_IMPORTED_MODULE_0__.baggageHeaderToDynamicSamplingContext)(baggage); + + if (!traceparentData || !traceparentData.traceId) { + return (0,_propagationContext_js__WEBPACK_IMPORTED_MODULE_1__.generatePropagationContext)(); + } + + const { traceId, parentSpanId, parentSampled } = traceparentData; + + const virtualSpanId = (0,_misc_js__WEBPACK_IMPORTED_MODULE_2__.uuid4)().substring(16); + + return { + traceId, + parentSpanId, + spanId: virtualSpanId, + sampled: parentSampled, + dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it + }; +} + +/** + * Create sentry-trace header from span context values. + */ +function generateSentryTraceHeader( + traceId = (0,_misc_js__WEBPACK_IMPORTED_MODULE_2__.uuid4)(), + spanId = (0,_misc_js__WEBPACK_IMPORTED_MODULE_2__.uuid4)().substring(16), + sampled, +) { + let sampledString = ''; + if (sampled !== undefined) { + sampledString = sampled ? '-1' : '-0'; + } + return `${traceId}-${spanId}${sampledString}`; +} + + +//# sourceMappingURL=tracing.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/url.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/url.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getNumberOfUrlSegments: () => (/* binding */ getNumberOfUrlSegments), +/* harmony export */ getSanitizedUrlString: () => (/* binding */ getSanitizedUrlString), +/* harmony export */ parseUrl: () => (/* binding */ parseUrl), +/* harmony export */ stripUrlQueryAndFragment: () => (/* binding */ stripUrlQueryAndFragment) +/* harmony export */ }); +/** + * Parses string form of URL into an object + * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B + * // intentionally using regex and not href parsing trick because React Native and other + * // environments where DOM might not be available + * @returns parsed URL object + */ +function parseUrl(url) { + if (!url) { + return {}; + } + + const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + + if (!match) { + return {}; + } + + // coerce to undefined values to empty string so we don't get 'undefined' + const query = match[6] || ''; + const fragment = match[8] || ''; + return { + host: match[4], + path: match[5], + protocol: match[2], + search: query, + hash: fragment, + relative: match[5] + query + fragment, // everything minus origin + }; +} + +/** + * Strip the query string and fragment off of a given URL or path (if present) + * + * @param urlPath Full URL or path, including possible query string and/or fragment + * @returns URL or path without query string or fragment + */ +function stripUrlQueryAndFragment(urlPath) { + return (urlPath.split(/[?#]/, 1) )[0]; +} + +/** + * Returns number of URL segments of a passed string URL. + * + * @deprecated This function will be removed in the next major version. + */ +// TODO(v9): Hoist this function into the places where we use it. (as it stands only react router v6 instrumentation) +function getNumberOfUrlSegments(url) { + // split at '/' or at '\/' to split regex urls correctly + return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length; +} + +/** + * Takes a URL object and returns a sanitized string which is safe to use as span name + * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data + */ +function getSanitizedUrlString(url) { + const { protocol, host, path } = url; + + const filteredHost = + (host && + host + // Always filter out authority + .replace(/^.*@/, '[filtered]:[filtered]@') + // Don't show standard :80 (http) and :443 (https) ports to reduce the noise + // TODO: Use new URL global if it exists + .replace(/(:80)$/, '') + .replace(/(:443)$/, '')) || + ''; + + return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`; +} + + +//# sourceMappingURL=url.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/vendor/supportsHistory.js": +/*!***************************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/vendor/supportsHistory.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ supportsHistory: () => (/* binding */ supportsHistory) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../worldwide.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js"); + + +// Based on https://github.com/angular/angular.js/pull/13945/files +// The MIT License + + +const WINDOW = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +/** + * Tells whether current environment supports History API + * {@link supportsHistory}. + * + * @returns Answer to the given question. + */ +function supportsHistory() { + // NOTE: in Chrome App environment, touching history.pushState, *even inside + // a try/catch block*, will cause Chrome to output an error to console.error + // borrowed from: https://github.com/angular/angular.js/pull/13945/files + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const chromeVar = (WINDOW ).chrome; + const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; + + return !isChromePackagedApp && hasHistoryApi; +} + + +//# sourceMappingURL=supportsHistory.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/version.js": +/*!************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/version.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SDK_VERSION: () => (/* binding */ SDK_VERSION) +/* harmony export */ }); +// This is a magic string replaced by rollup + +const SDK_VERSION = "8.41.0" ; + + +//# sourceMappingURL=version.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ GLOBAL_OBJ: () => (/* binding */ GLOBAL_OBJ), +/* harmony export */ getGlobalSingleton: () => (/* binding */ getGlobalSingleton) +/* harmony export */ }); +/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/version.js"); + + +/** Get's the global object for the current JavaScript runtime */ +const GLOBAL_OBJ = globalThis ; + +/** + * Returns a global singleton contained in the global `__SENTRY__[]` object. + * + * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory + * function and added to the `__SENTRY__` object. + * + * @param name name of the global singleton on __SENTRY__ + * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` + * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value + * @returns the singleton + */ +function getGlobalSingleton(name, creator, obj) { + const gbl = (obj || GLOBAL_OBJ) ; + const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {}); + const versionedCarrier = (__SENTRY__[_version_js__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION] = __SENTRY__[_version_js__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION] || {}); + return versionedCarrier[name] || (versionedCarrier[name] = creator()); +} + + +//# sourceMappingURL=worldwide.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js": +/*!********************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyScopeDataToEvent: () => (/* binding */ applyScopeDataToEvent), +/* harmony export */ mergeAndOverwriteScopeData: () => (/* binding */ mergeAndOverwriteScopeData), +/* harmony export */ mergeScopeData: () => (/* binding */ mergeScopeData) +/* harmony export */ }); +/* harmony import */ var _tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tracing/dynamicSamplingContext.js */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./merge.js */ "../../node_modules/@sentry/core/build/esm/utils/merge.js"); +/* harmony import */ var _spanUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); + + + + + + + + + + +/** + * Applies data from the scope to the event and runs all event processors on it. + */ +function applyScopeDataToEvent(event, data) { + const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data; + + // Apply general data + applyDataToEvent(event, data); + + // We want to set the trace context for normal events only if there isn't already + // a trace context on the event. There is a product feature in place where we link + // errors with transaction and it relies on that. + if (span) { + applySpanToEvent(event, span); + } + + applyFingerprintToEvent(event, fingerprint); + applyBreadcrumbsToEvent(event, breadcrumbs); + applySdkMetadataToEvent(event, sdkProcessingMetadata); +} + +/** Merge data of two scopes together. */ +function mergeScopeData(data, mergeData) { + const { + extra, + tags, + user, + contexts, + level, + sdkProcessingMetadata, + breadcrumbs, + fingerprint, + eventProcessors, + attachments, + propagationContext, + transactionName, + span, + } = mergeData; + + mergeAndOverwriteScopeData(data, 'extra', extra); + mergeAndOverwriteScopeData(data, 'tags', tags); + mergeAndOverwriteScopeData(data, 'user', user); + mergeAndOverwriteScopeData(data, 'contexts', contexts); + + data.sdkProcessingMetadata = (0,_merge_js__WEBPACK_IMPORTED_MODULE_0__.merge)(data.sdkProcessingMetadata, sdkProcessingMetadata, 2); + + if (level) { + data.level = level; + } + + if (transactionName) { + data.transactionName = transactionName; + } + + if (span) { + data.span = span; + } + + if (breadcrumbs.length) { + data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs]; + } + + if (fingerprint.length) { + data.fingerprint = [...data.fingerprint, ...fingerprint]; + } + + if (eventProcessors.length) { + data.eventProcessors = [...data.eventProcessors, ...eventProcessors]; + } + + if (attachments.length) { + data.attachments = [...data.attachments, ...attachments]; + } + + data.propagationContext = { ...data.propagationContext, ...propagationContext }; +} + +/** + * Merges certain scope data. Undefined values will overwrite any existing values. + * Exported only for tests. + */ +function mergeAndOverwriteScopeData + +(data, prop, mergeVal) { + data[prop] = (0,_merge_js__WEBPACK_IMPORTED_MODULE_0__.merge)(data[prop], mergeVal, 1); +} + +function applyDataToEvent(event, data) { + const { extra, tags, user, contexts, level, transactionName } = data; + + const cleanedExtra = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)(extra); + if (cleanedExtra && Object.keys(cleanedExtra).length) { + event.extra = { ...cleanedExtra, ...event.extra }; + } + + const cleanedTags = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)(tags); + if (cleanedTags && Object.keys(cleanedTags).length) { + event.tags = { ...cleanedTags, ...event.tags }; + } + + const cleanedUser = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)(user); + if (cleanedUser && Object.keys(cleanedUser).length) { + event.user = { ...cleanedUser, ...event.user }; + } + + const cleanedContexts = (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)(contexts); + if (cleanedContexts && Object.keys(cleanedContexts).length) { + event.contexts = { ...cleanedContexts, ...event.contexts }; + } + + if (level) { + event.level = level; + } + + // transaction events get their `transaction` from the root span name + if (transactionName && event.type !== 'transaction') { + event.transaction = transactionName; + } +} + +function applyBreadcrumbsToEvent(event, breadcrumbs) { + const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs]; + event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined; +} + +function applySdkMetadataToEvent(event, sdkProcessingMetadata) { + event.sdkProcessingMetadata = { + ...event.sdkProcessingMetadata, + ...sdkProcessingMetadata, + }; +} + +function applySpanToEvent(event, span) { + event.contexts = { + trace: (0,_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.spanToTraceContext)(span), + ...event.contexts, + }; + + event.sdkProcessingMetadata = { + dynamicSamplingContext: (0,_tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_3__.getDynamicSamplingContextFromSpan)(span), + ...event.sdkProcessingMetadata, + }; + + const rootSpan = (0,_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRootSpan)(span); + const transactionName = (0,_spanUtils_js__WEBPACK_IMPORTED_MODULE_2__.spanToJSON)(rootSpan).description; + if (transactionName && !event.transaction && event.type === 'transaction') { + event.transaction = transactionName; + } +} + +/** + * Applies fingerprint from the scope to the event if there's one, + * uses message if there's one instead or get rid of empty fingerprint + */ +function applyFingerprintToEvent(event, fingerprint) { + // Make sure it's an array first and we actually have something in place + event.fingerprint = event.fingerprint + ? Array.isArray(event.fingerprint) + ? event.fingerprint + : [event.fingerprint] + : []; + + // If we have something on the scope, then merge it with event + if (fingerprint) { + event.fingerprint = event.fingerprint.concat(fingerprint); + } + + // If we have no data at all, remove empty array default + if (event.fingerprint && !event.fingerprint.length) { + delete event.fingerprint; + } +} + + +//# sourceMappingURL=applyScopeDataToEvent.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/handleCallbackErrors.js": +/*!*******************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/handleCallbackErrors.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ handleCallbackErrors: () => (/* binding */ handleCallbackErrors) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/is.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/is.js"); + + +/** + * Wrap a callback function with error handling. + * If an error is thrown, it will be passed to the `onError` callback and re-thrown. + * + * If the return value of the function is a promise, it will be handled with `maybeHandlePromiseRejection`. + * + * If an `onFinally` callback is provided, this will be called when the callback has finished + * - so if it returns a promise, once the promise resolved/rejected, + * else once the callback has finished executing. + * The `onFinally` callback will _always_ be called, no matter if an error was thrown or not. + */ +function handleCallbackErrors + +( + fn, + onError, + // eslint-disable-next-line @typescript-eslint/no-empty-function + onFinally = () => {}, +) { + let maybePromiseResult; + try { + maybePromiseResult = fn(); + } catch (e) { + onError(e); + onFinally(); + throw e; + } + + return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally); +} + +/** + * Maybe handle a promise rejection. + * This expects to be given a value that _may_ be a promise, or any other value. + * If it is a promise, and it rejects, it will call the `onError` callback. + * Other than this, it will generally return the given value as-is. + */ +function maybeHandlePromiseRejection( + value, + onError, + onFinally, +) { + if ((0,_utils_hoist_is_js__WEBPACK_IMPORTED_MODULE_0__.isThenable)(value)) { + // @ts-expect-error - the isThenable check returns the "wrong" type here + return value.then( + res => { + onFinally(); + return res; + }, + e => { + onError(e); + onFinally(); + throw e; + }, + ); + } + + onFinally(); + return value; +} + + +//# sourceMappingURL=handleCallbackErrors.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js": +/*!****************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ hasTracingEnabled: () => (/* binding */ hasTracingEnabled) +/* harmony export */ }); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); + + +// Treeshakable guard to remove all code related to tracing + +/** + * Determines if tracing is currently enabled. + * + * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config. + */ +function hasTracingEnabled( + maybeOptions, +) { + if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) { + return false; + } + + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + const options = maybeOptions || (client && client.getOptions()); + // eslint-disable-next-line deprecation/deprecation + return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); +} + + +//# sourceMappingURL=hasTracingEnabled.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/isSentryRequestUrl.js": +/*!*****************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/isSentryRequestUrl.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isSentryRequestUrl: () => (/* binding */ isSentryRequestUrl) +/* harmony export */ }); +/** + * Checks whether given url points to Sentry server + * + * @param url url to verify + */ +function isSentryRequestUrl(url, client) { + const dsn = client && client.getDsn(); + const tunnel = client && client.getOptions().tunnel; + return checkDsn(url, dsn) || checkTunnel(url, tunnel); +} + +function checkTunnel(url, tunnel) { + if (!tunnel) { + return false; + } + + return removeTrailingSlash(url) === removeTrailingSlash(tunnel); +} + +function checkDsn(url, dsn) { + return dsn ? url.includes(dsn.host) : false; +} + +function removeTrailingSlash(str) { + return str[str.length - 1] === '/' ? str.slice(0, -1) : str; +} + + +//# sourceMappingURL=isSentryRequestUrl.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/merge.js": +/*!****************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/merge.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ merge: () => (/* binding */ merge) +/* harmony export */ }); +/** + * Shallow merge two objects. + * Does not mutate the passed in objects. + * Undefined/empty values in the merge object will overwrite existing values. + * + * By default, this merges 2 levels deep. + */ +function merge(initialObj, mergeObj, levels = 2) { + // If the merge value is not an object, or we have no merge levels left, + // we just set the value to the merge value + if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) { + return mergeObj; + } + + // If the merge object is an empty object, and the initial object is not undefined, we return the initial object + if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) { + return initialObj; + } + + // Clone object + const output = { ...initialObj }; + + // Merge values into output, resursively + for (const key in mergeObj) { + if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { + output[key] = merge(output[key], mergeObj[key], levels - 1); + } + } + + return output; +} + + +//# sourceMappingURL=merge.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/parameterize.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/parameterize.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ parameterize: () => (/* binding */ parameterize) +/* harmony export */ }); +/** + * Tagged template function which returns parameterized representation of the message + * For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: + * "__sentry_template_string__": 'This is a log statement with %s and %s params', + * "__sentry_template_values__": ['first', 'second'] + * @param strings An array of string values splitted between expressions + * @param values Expressions extracted from template string + * @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties + */ +function parameterize(strings, ...values) { + const formatted = new String(String.raw(strings, ...values)) ; + formatted.__sentry_template_string__ = strings.join('\x00').replace(/%/g, '%%').replace(/\0/g, '%s'); + formatted.__sentry_template_values__ = values; + return formatted; +} + + +//# sourceMappingURL=parameterize.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/parseSampleRate.js": +/*!**************************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/parseSampleRate.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ parseSampleRate: () => (/* binding */ parseSampleRate) +/* harmony export */ }); +/* harmony import */ var _debug_build_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../debug-build.js */ "../../node_modules/@sentry/core/build/esm/debug-build.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); + + + +/** + * Parse a sample rate from a given value. + * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1). + * If a string is passed, we try to convert it to a number. + * + * Any invalid sample rate will return `undefined`. + */ +function parseSampleRate(sampleRate) { + if (typeof sampleRate === 'boolean') { + return Number(sampleRate); + } + + const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate; + if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) { + _debug_build_js__WEBPACK_IMPORTED_MODULE_0__.DEBUG_BUILD && + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn( + `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( + sampleRate, + )} of type ${JSON.stringify(typeof sampleRate)}.`, + ); + return undefined; + } + + return rate; +} + + +//# sourceMappingURL=parseSampleRate.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/prepareEvent.js": +/*!***********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/prepareEvent.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyClientOptions: () => (/* binding */ applyClientOptions), +/* harmony export */ applyDebugIds: () => (/* binding */ applyDebugIds), +/* harmony export */ applyDebugMeta: () => (/* binding */ applyDebugMeta), +/* harmony export */ parseEventHintOrCaptureContext: () => (/* binding */ parseEventHintOrCaptureContext), +/* harmony export */ prepareEvent: () => (/* binding */ prepareEvent) +/* harmony export */ }); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants.js */ "../../node_modules/@sentry/core/build/esm/constants.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _eventProcessors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../eventProcessors.js */ "../../node_modules/@sentry/core/build/esm/eventProcessors.js"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../scope.js */ "../../node_modules/@sentry/core/build/esm/scope.js"); +/* harmony import */ var _utils_hoist_debug_ids_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils-hoist/debug-ids.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/debug-ids.js"); +/* harmony import */ var _utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/misc.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/misc.js"); +/* harmony import */ var _utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils-hoist/normalize.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/normalize.js"); +/* harmony import */ var _utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/string.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/string.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _applyScopeDataToEvent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./applyScopeDataToEvent.js */ "../../node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js"); + + + + + + + + + + + +/** + * This type makes sure that we get either a CaptureContext, OR an EventHint. + * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed: + * { user: { id: '123' }, mechanism: { handled: false } } + */ + +/** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A new event with more information. + * @hidden + */ +function prepareEvent( + options, + event, + hint, + scope, + client, + isolationScope, +) { + const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options; + const prepared = { + ...event, + event_id: event.event_id || hint.event_id || (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__.uuid4)(), + timestamp: event.timestamp || (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_1__.dateTimestampInSeconds)(), + }; + const integrations = hint.integrations || options.integrations.map(i => i.name); + + applyClientOptions(prepared, options); + applyIntegrationsMetadata(prepared, integrations); + + if (client) { + client.emit('applyFrameMetadata', event); + } + + // Only put debug IDs onto frames for error events. + if (event.type === undefined) { + applyDebugIds(prepared, options.stackParser); + } + + // If we have scope given to us, use it as the base for further modifications. + // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. + const finalScope = getFinalScope(scope, hint.captureContext); + + if (hint.mechanism) { + (0,_utils_hoist_misc_js__WEBPACK_IMPORTED_MODULE_0__.addExceptionMechanism)(prepared, hint.mechanism); + } + + const clientEventProcessors = client ? client.getEventProcessors() : []; + + // This should be the last thing called, since we want that + // {@link Scope.addEventProcessor} gets the finished prepared event. + // Merge scope data together + const data = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_2__.getGlobalScope)().getScopeData(); + + if (isolationScope) { + const isolationData = isolationScope.getScopeData(); + (0,_applyScopeDataToEvent_js__WEBPACK_IMPORTED_MODULE_3__.mergeScopeData)(data, isolationData); + } + + if (finalScope) { + const finalScopeData = finalScope.getScopeData(); + (0,_applyScopeDataToEvent_js__WEBPACK_IMPORTED_MODULE_3__.mergeScopeData)(data, finalScopeData); + } + + const attachments = [...(hint.attachments || []), ...data.attachments]; + if (attachments.length) { + hint.attachments = attachments; + } + + (0,_applyScopeDataToEvent_js__WEBPACK_IMPORTED_MODULE_3__.applyScopeDataToEvent)(prepared, data); + + const eventProcessors = [ + ...clientEventProcessors, + // Run scope event processors _after_ all other processors + ...data.eventProcessors, + ]; + + const result = (0,_eventProcessors_js__WEBPACK_IMPORTED_MODULE_4__.notifyEventProcessors)(eventProcessors, prepared, hint); + + return result.then(evt => { + if (evt) { + // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified + // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed. + // This should not cause any PII issues, since we're only moving data that is already on the event and not adding + // any new data + applyDebugMeta(evt); + } + + if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { + return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); + } + return evt; + }); +} + +/** + * Enhances event using the client configuration. + * It takes care of all "static" values like environment, release and `dist`, + * as well as truncating overly long values. + * + * Only exported for tests. + * + * @param event event instance to be enhanced + */ +function applyClientOptions(event, options) { + const { environment, release, dist, maxValueLength = 250 } = options; + + // empty strings do not make sense for environment, release, and dist + // so we handle them the same as if they were not provided + event.environment = event.environment || environment || _constants_js__WEBPACK_IMPORTED_MODULE_5__.DEFAULT_ENVIRONMENT; + + if (!event.release && release) { + event.release = release; + } + + if (!event.dist && dist) { + event.dist = dist; + } + + if (event.message) { + event.message = (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_6__.truncate)(event.message, maxValueLength); + } + + const exception = event.exception && event.exception.values && event.exception.values[0]; + if (exception && exception.value) { + exception.value = (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_6__.truncate)(exception.value, maxValueLength); + } + + const request = event.request; + if (request && request.url) { + request.url = (0,_utils_hoist_string_js__WEBPACK_IMPORTED_MODULE_6__.truncate)(request.url, maxValueLength); + } +} + +/** + * Puts debug IDs into the stack frames of an error event. + */ +function applyDebugIds(event, stackParser) { + // Build a map of filename -> debug_id + const filenameDebugIdMap = (0,_utils_hoist_debug_ids_js__WEBPACK_IMPORTED_MODULE_7__.getFilenameToDebugIdMap)(stackParser); + + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + exception.stacktrace.frames.forEach(frame => { + if (filenameDebugIdMap && frame.filename) { + frame.debug_id = filenameDebugIdMap[frame.filename]; + } + }); + }); + } catch (e) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + +/** + * Moves debug IDs from the stack frames of an error event into the debug_meta field. + */ +function applyDebugMeta(event) { + // Extract debug IDs and filenames from the stack frames on the event. + const filenameDebugIdMap = {}; + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + exception.stacktrace.frames.forEach(frame => { + if (frame.debug_id) { + if (frame.abs_path) { + filenameDebugIdMap[frame.abs_path] = frame.debug_id; + } else if (frame.filename) { + filenameDebugIdMap[frame.filename] = frame.debug_id; + } + delete frame.debug_id; + } + }); + }); + } catch (e) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } + + if (Object.keys(filenameDebugIdMap).length === 0) { + return; + } + + // Fill debug_meta information + event.debug_meta = event.debug_meta || {}; + event.debug_meta.images = event.debug_meta.images || []; + const images = event.debug_meta.images; + Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { + images.push({ + type: 'sourcemap', + code_file: filename, + debug_id, + }); + }); +} + +/** + * This function adds all used integrations to the SDK info in the event. + * @param event The event that will be filled with all integrations. + */ +function applyIntegrationsMetadata(event, integrationNames) { + if (integrationNames.length > 0) { + event.sdk = event.sdk || {}; + event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames]; + } +} + +/** + * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. + * Normalized keys: + * - `breadcrumbs.data` + * - `user` + * - `contexts` + * - `extra` + * @param event Event + * @returns Normalized event + */ +function normalizeEvent(event, depth, maxBreadth) { + if (!event) { + return null; + } + + const normalized = { + ...event, + ...(event.breadcrumbs && { + breadcrumbs: event.breadcrumbs.map(b => ({ + ...b, + ...(b.data && { + data: (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__.normalize)(b.data, depth, maxBreadth), + }), + })), + }), + ...(event.user && { + user: (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.user, depth, maxBreadth), + }), + ...(event.contexts && { + contexts: (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.contexts, depth, maxBreadth), + }), + ...(event.extra && { + extra: (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.extra, depth, maxBreadth), + }), + }; + + // event.contexts.trace stores information about a Transaction. Similarly, + // event.spans[] stores information about child Spans. Given that a + // Transaction is conceptually a Span, normalization should apply to both + // Transactions and Spans consistently. + // For now the decision is to skip normalization of Transactions and Spans, + // so this block overwrites the normalized event to add back the original + // Transaction information prior to normalization. + if (event.contexts && event.contexts.trace && normalized.contexts) { + normalized.contexts.trace = event.contexts.trace; + + // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it + if (event.contexts.trace.data) { + normalized.contexts.trace.data = (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.contexts.trace.data, depth, maxBreadth); + } + } + + // event.spans[].data may contain circular/dangerous data so we need to normalize it + if (event.spans) { + normalized.spans = event.spans.map(span => { + return { + ...span, + ...(span.data && { + data: (0,_utils_hoist_normalize_js__WEBPACK_IMPORTED_MODULE_8__.normalize)(span.data, depth, maxBreadth), + }), + }; + }); + } + + return normalized; +} + +function getFinalScope( + scope, + captureContext, +) { + if (!captureContext) { + return scope; + } + + const finalScope = scope ? scope.clone() : new _scope_js__WEBPACK_IMPORTED_MODULE_9__.Scope(); + finalScope.update(captureContext); + return finalScope; +} + +/** + * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`. + * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`. + */ +function parseEventHintOrCaptureContext( + hint, +) { + if (!hint) { + return undefined; + } + + // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext + if (hintIsScopeOrFunction(hint)) { + return { captureContext: hint }; + } + + if (hintIsScopeContext(hint)) { + return { + captureContext: hint, + }; + } + + return hint; +} + +function hintIsScopeOrFunction( + hint, +) { + return hint instanceof _scope_js__WEBPACK_IMPORTED_MODULE_9__.Scope || typeof hint === 'function'; +} + +const captureContextKeys = [ + 'user', + 'level', + 'extra', + 'contexts', + 'tags', + 'fingerprint', + 'requestSession', + 'propagationContext', +] ; + +function hintIsScopeContext(hint) { + return Object.keys(hint).some(key => captureContextKeys.includes(key )); +} + + +//# sourceMappingURL=prepareEvent.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/sdkMetadata.js": +/*!**********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/sdkMetadata.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applySdkMetadata: () => (/* binding */ applySdkMetadata) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/version.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/version.js"); + + +/** + * A builder for the SDK metadata in the options for the SDK initialization. + * + * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit. + * We don't extract it for bundle size reasons. + * @see https://github.com/getsentry/sentry-javascript/pull/7404 + * @see https://github.com/getsentry/sentry-javascript/pull/4196 + * + * If you make changes to this function consider updating the others as well. + * + * @param options SDK options object that gets mutated + * @param names list of package names + */ +function applySdkMetadata(options, name, names = [name], source = 'npm') { + const metadata = options._metadata || {}; + + if (!metadata.sdk) { + metadata.sdk = { + name: `sentry.javascript.${name}`, + packages: names.map(name => ({ + name: `${source}:@sentry/${name}`, + version: _utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION, + })), + version: _utils_hoist_version_js__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION, + }; + } + + options._metadata = metadata; +} + + +//# sourceMappingURL=sdkMetadata.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js": +/*!**********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _getSpanForScope: () => (/* binding */ _getSpanForScope), +/* harmony export */ _setSpanForScope: () => (/* binding */ _setSpanForScope) +/* harmony export */ }); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); + + +const SCOPE_SPAN_FIELD = '_sentrySpan'; + +/** + * Set the active span for a given scope. + * NOTE: This should NOT be used directly, but is only used internally by the trace methods. + */ +function _setSpanForScope(scope, span) { + if (span) { + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.addNonEnumerableProperty)(scope , SCOPE_SPAN_FIELD, span); + } else { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete (scope )[SCOPE_SPAN_FIELD]; + } +} + +/** + * Get the active span for a given scope. + * NOTE: This should NOT be used directly, but is only used internally by the trace methods. + */ +function _getSpanForScope(scope) { + return scope[SCOPE_SPAN_FIELD]; +} + + +//# sourceMappingURL=spanOnScope.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/spanUtils.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TRACE_FLAG_NONE: () => (/* binding */ TRACE_FLAG_NONE), +/* harmony export */ TRACE_FLAG_SAMPLED: () => (/* binding */ TRACE_FLAG_SAMPLED), +/* harmony export */ addChildSpanToSpan: () => (/* binding */ addChildSpanToSpan), +/* harmony export */ getActiveSpan: () => (/* binding */ getActiveSpan), +/* harmony export */ getRootSpan: () => (/* binding */ getRootSpan), +/* harmony export */ getSpanDescendants: () => (/* binding */ getSpanDescendants), +/* harmony export */ getStatusMessage: () => (/* binding */ getStatusMessage), +/* harmony export */ removeChildSpanFromSpan: () => (/* binding */ removeChildSpanFromSpan), +/* harmony export */ showSpanDropWarning: () => (/* binding */ showSpanDropWarning), +/* harmony export */ spanIsSampled: () => (/* binding */ spanIsSampled), +/* harmony export */ spanTimeInputToSeconds: () => (/* binding */ spanTimeInputToSeconds), +/* harmony export */ spanToJSON: () => (/* binding */ spanToJSON), +/* harmony export */ spanToTraceContext: () => (/* binding */ spanToTraceContext), +/* harmony export */ spanToTraceHeader: () => (/* binding */ spanToTraceHeader), +/* harmony export */ spanToTransactionTraceContext: () => (/* binding */ spanToTransactionTraceContext), +/* harmony export */ updateMetricSummaryOnActiveSpan: () => (/* binding */ updateMetricSummaryOnActiveSpan) +/* harmony export */ }); +/* harmony import */ var _asyncContext_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../asyncContext/index.js */ "../../node_modules/@sentry/core/build/esm/asyncContext/index.js"); +/* harmony import */ var _carrier_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../carrier.js */ "../../node_modules/@sentry/core/build/esm/carrier.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _metrics_metric_summary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../metrics/metric-summary.js */ "../../node_modules/@sentry/core/build/esm/metrics/metric-summary.js"); +/* harmony import */ var _semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../semanticAttributes.js */ "../../node_modules/@sentry/core/build/esm/semanticAttributes.js"); +/* harmony import */ var _tracing_spanstatus_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tracing/spanstatus.js */ "../../node_modules/@sentry/core/build/esm/tracing/spanstatus.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils-hoist/object.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/object.js"); +/* harmony import */ var _utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils-hoist/time.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/time.js"); +/* harmony import */ var _utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils-hoist/tracing.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/tracing.js"); +/* harmony import */ var _spanOnScope_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./spanOnScope.js */ "../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js"); + + + + + + + + + + + + +// These are aligned with OpenTelemetry trace flags +const TRACE_FLAG_NONE = 0x0; +const TRACE_FLAG_SAMPLED = 0x1; + +// todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan` +let hasShownSpanDropWarning = false; + +/** + * Convert a span to a trace context, which can be sent as the `trace` context in an event. + * By default, this will only include trace_id, span_id & parent_span_id. + * If `includeAllData` is true, it will also include data, op, status & origin. + */ +function spanToTransactionTraceContext(span) { + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + const { data, op, parent_span_id, status, origin } = spanToJSON(span); + + return (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)({ + parent_span_id, + span_id, + trace_id, + data, + op, + status, + origin, + }); +} + +/** + * Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event. + */ +function spanToTraceContext(span) { + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + const { parent_span_id } = spanToJSON(span); + + return (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)({ parent_span_id, span_id, trace_id }); +} + +/** + * Convert a Span to a Sentry trace header. + */ +function spanToTraceHeader(span) { + const { traceId, spanId } = span.spanContext(); + const sampled = spanIsSampled(span); + return (0,_utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_1__.generateSentryTraceHeader)(traceId, spanId, sampled); +} + +/** + * Convert a span time input into a timestamp in seconds. + */ +function spanTimeInputToSeconds(input) { + if (typeof input === 'number') { + return ensureTimestampInSeconds(input); + } + + if (Array.isArray(input)) { + // See {@link HrTime} for the array-based time format + return input[0] + input[1] / 1e9; + } + + if (input instanceof Date) { + return ensureTimestampInSeconds(input.getTime()); + } + + return (0,_utils_hoist_time_js__WEBPACK_IMPORTED_MODULE_2__.timestampInSeconds)(); +} + +/** + * Converts a timestamp to second, if it was in milliseconds, or keeps it as second. + */ +function ensureTimestampInSeconds(timestamp) { + const isMs = timestamp > 9999999999; + return isMs ? timestamp / 1000 : timestamp; +} + +/** + * Convert a span to a JSON representation. + */ +// Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json). +// This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility. +// And `spanToJSON` needs the Span class from `span.ts` to check here. +function spanToJSON(span) { + if (spanIsSentrySpan(span)) { + return span.getSpanJSON(); + } + + try { + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + + // Handle a span from @opentelemetry/sdk-base-trace's `Span` class + if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { + const { attributes, startTime, name, endTime, parentSpanId, status } = span; + + return (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)({ + span_id, + trace_id, + data: attributes, + description: name, + parent_span_id: parentSpanId, + start_timestamp: spanTimeInputToSeconds(startTime), + // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time + timestamp: spanTimeInputToSeconds(endTime) || undefined, + status: getStatusMessage(status), + op: attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__.SEMANTIC_ATTRIBUTE_SENTRY_OP], + origin: attributes[_semanticAttributes_js__WEBPACK_IMPORTED_MODULE_3__.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] , + _metrics_summary: (0,_metrics_metric_summary_js__WEBPACK_IMPORTED_MODULE_4__.getMetricSummaryJsonForSpan)(span), + }); + } + + // Finally, at least we have `spanContext()`.... + return { + span_id, + trace_id, + }; + } catch (e) { + return {}; + } +} + +function spanIsOpenTelemetrySdkTraceBaseSpan(span) { + const castSpan = span ; + return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; +} + +/** Exported only for tests. */ + +/** + * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof. + * :( So instead we approximate this by checking if it has the `getSpanJSON` method. + */ +function spanIsSentrySpan(span) { + return typeof (span ).getSpanJSON === 'function'; +} + +/** + * Returns true if a span is sampled. + * In most cases, you should just use `span.isRecording()` instead. + * However, this has a slightly different semantic, as it also returns false if the span is finished. + * So in the case where this distinction is important, use this method. + */ +function spanIsSampled(span) { + // We align our trace flags with the ones OpenTelemetry use + // So we also check for sampled the same way they do. + const { traceFlags } = span.spanContext(); + return traceFlags === TRACE_FLAG_SAMPLED; +} + +/** Get the status message to use for a JSON representation of a span. */ +function getStatusMessage(status) { + if (!status || status.code === _tracing_spanstatus_js__WEBPACK_IMPORTED_MODULE_5__.SPAN_STATUS_UNSET) { + return undefined; + } + + if (status.code === _tracing_spanstatus_js__WEBPACK_IMPORTED_MODULE_5__.SPAN_STATUS_OK) { + return 'ok'; + } + + return status.message || 'unknown_error'; +} + +const CHILD_SPANS_FIELD = '_sentryChildSpans'; +const ROOT_SPAN_FIELD = '_sentryRootSpan'; + +/** + * Adds an opaque child span reference to a span. + */ +function addChildSpanToSpan(span, childSpan) { + // We store the root span reference on the child span + // We need this for `getRootSpan()` to work + const rootSpan = span[ROOT_SPAN_FIELD] || span; + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.addNonEnumerableProperty)(childSpan , ROOT_SPAN_FIELD, rootSpan); + + // We store a list of child spans on the parent span + // We need this for `getSpanDescendants()` to work + if (span[CHILD_SPANS_FIELD]) { + span[CHILD_SPANS_FIELD].add(childSpan); + } else { + (0,_utils_hoist_object_js__WEBPACK_IMPORTED_MODULE_0__.addNonEnumerableProperty)(span, CHILD_SPANS_FIELD, new Set([childSpan])); + } +} + +/** This is only used internally by Idle Spans. */ +function removeChildSpanFromSpan(span, childSpan) { + if (span[CHILD_SPANS_FIELD]) { + span[CHILD_SPANS_FIELD].delete(childSpan); + } +} + +/** + * Returns an array of the given span and all of its descendants. + */ +function getSpanDescendants(span) { + const resultSet = new Set(); + + function addSpanChildren(span) { + // This exit condition is required to not infinitely loop in case of a circular dependency. + if (resultSet.has(span)) { + return; + // We want to ignore unsampled spans (e.g. non recording spans) + } else if (spanIsSampled(span)) { + resultSet.add(span); + const childSpans = span[CHILD_SPANS_FIELD] ? Array.from(span[CHILD_SPANS_FIELD]) : []; + for (const childSpan of childSpans) { + addSpanChildren(childSpan); + } + } + } + + addSpanChildren(span); + + return Array.from(resultSet); +} + +/** + * Returns the root span of a given span. + */ +function getRootSpan(span) { + return span[ROOT_SPAN_FIELD] || span; +} + +/** + * Returns the currently active span. + */ +function getActiveSpan() { + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_6__.getMainCarrier)(); + const acs = (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_7__.getAsyncContextStrategy)(carrier); + if (acs.getActiveSpan) { + return acs.getActiveSpan(); + } + + return (0,_spanOnScope_js__WEBPACK_IMPORTED_MODULE_8__._getSpanForScope)((0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_9__.getCurrentScope)()); +} + +/** + * Updates the metric summary on the currently active span + */ +function updateMetricSummaryOnActiveSpan( + metricType, + sanitizedName, + value, + unit, + tags, + bucketKey, +) { + const span = getActiveSpan(); + if (span) { + (0,_metrics_metric_summary_js__WEBPACK_IMPORTED_MODULE_4__.updateMetricSummaryOnSpan)(span, metricType, sanitizedName, value, unit, tags, bucketKey); + } +} + +/** + * Logs a warning once if `beforeSendSpan` is used to drop spans. + * + * todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan`. + */ +function showSpanDropWarning() { + if (!hasShownSpanDropWarning) { + (0,_utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_10__.consoleSandbox)(() => { + // eslint-disable-next-line no-console + console.warn( + '[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.', + ); + }); + hasShownSpanDropWarning = true; + } +} + + +//# sourceMappingURL=spanUtils.js.map + + +/***/ }), + +/***/ "../../node_modules/@sentry/core/build/esm/utils/traceData.js": +/*!********************************************************************!*\ + !*** ../../node_modules/@sentry/core/build/esm/utils/traceData.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getTraceData: () => (/* binding */ getTraceData) +/* harmony export */ }); +/* harmony import */ var _asyncContext_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../asyncContext/index.js */ "../../node_modules/@sentry/core/build/esm/asyncContext/index.js"); +/* harmony import */ var _carrier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../carrier.js */ "../../node_modules/@sentry/core/build/esm/carrier.js"); +/* harmony import */ var _currentScopes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../currentScopes.js */ "../../node_modules/@sentry/core/build/esm/currentScopes.js"); +/* harmony import */ var _exports_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../exports.js */ "../../node_modules/@sentry/core/build/esm/exports.js"); +/* harmony import */ var _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils-hoist/logger.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js"); +/* harmony import */ var _spanUtils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./spanUtils.js */ "../../node_modules/@sentry/core/build/esm/utils/spanUtils.js"); +/* harmony import */ var _utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils-hoist/tracing.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/tracing.js"); +/* harmony import */ var _tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tracing/dynamicSamplingContext.js */ "../../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils-hoist/baggage.js */ "../../node_modules/@sentry/core/build/esm/utils-hoist/baggage.js"); + + + + + + + + + + + + + + + + +/** + * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation + * context) and serializes it to `sentry-trace` and `baggage` values to strings. These values can be used to propagate + * a trace via our tracing Http headers or Html `` tags. + * + * This function also applies some validation to the generated sentry-trace and baggage values to ensure that + * only valid strings are returned. + * + * @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header + * or meta tag name. + */ +function getTraceData(options = {}) { + const client = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getClient)(); + if (!(0,_exports_js__WEBPACK_IMPORTED_MODULE_1__.isEnabled)() || !client) { + return {}; + } + + const carrier = (0,_carrier_js__WEBPACK_IMPORTED_MODULE_2__.getMainCarrier)(); + const acs = (0,_asyncContext_index_js__WEBPACK_IMPORTED_MODULE_3__.getAsyncContextStrategy)(carrier); + if (acs.getTraceData) { + return acs.getTraceData(options); + } + + const scope = (0,_currentScopes_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const span = options.span || (0,_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.getActiveSpan)(); + const sentryTrace = span ? (0,_spanUtils_js__WEBPACK_IMPORTED_MODULE_4__.spanToTraceHeader)(span) : scopeToTraceHeader(scope); + const dsc = span ? (0,_tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_5__.getDynamicSamplingContextFromSpan)(span) : (0,_tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_5__.getDynamicSamplingContextFromScope)(client, scope); + const baggage = (0,_utils_hoist_baggage_js__WEBPACK_IMPORTED_MODULE_6__.dynamicSamplingContextToSentryBaggageHeader)(dsc); + + const isValidSentryTraceHeader = _utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_7__.TRACEPARENT_REGEXP.test(sentryTrace); + if (!isValidSentryTraceHeader) { + _utils_hoist_logger_js__WEBPACK_IMPORTED_MODULE_8__.logger.warn('Invalid sentry-trace data. Cannot generate trace data'); + return {}; + } + + return { + 'sentry-trace': sentryTrace, + baggage, + }; +} + +/** + * Get a sentry-trace header value for the given scope. + */ +function scopeToTraceHeader(scope) { + const { traceId, sampled, spanId } = scope.getPropagationContext(); + return (0,_utils_hoist_tracing_js__WEBPACK_IMPORTED_MODULE_7__.generateSentryTraceHeader)(traceId, spanId, sampled); +} + + +//# sourceMappingURL=traceData.js.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. +(() => { +/*!***********************!*\ + !*** ./src/sentry.js ***! + \***********************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/browser */ "../../node_modules/@sentry/browser/build/npm/esm/index.js"); +/* eslint-disable no-unused-vars */ + +window.Sentry = _sentry_browser__WEBPACK_IMPORTED_MODULE_0__; +})(); + +/******/ })() +; +//# sourceMappingURL=sentry.js.map \ No newline at end of file diff --git a/plinko/Plinko_files/wrapper.js b/plinko/Plinko_files/wrapper.js new file mode 100644 index 0000000..93d723b --- /dev/null +++ b/plinko/Plinko_files/wrapper.js @@ -0,0 +1,74 @@ +/******/ (() => { // webpackBootstrap +/*!**********************!*\ + !*** ./src/index.js ***! + \**********************/ +// eslint-disable-next-line no-undef +var basePath = "https://boost.bgaming-network.com/"; +console.log(basePath); +// Feature flag configuration +var featureFlags = { + amplitude: false, + actioncable: false, + sentry: true +}; +var boostModules = { + amplitude: { + src: '/static/analytics/amplitude.js' + }, + actioncable: { + src: '/static/websockets.js' + }, + sentry: { + src: 'sentry.js' + } +}; + +// Function to dynamically load scripts based on feature flags with an onComplete callback +function loadFeatureScripts(flags, onComplete) { + console.log('load feature scripts', flags); + var featuresToLoad = Object.keys(flags).filter(function (feature) { + return flags[feature]; + }); + var loadedCount = 0; + + // If there are no scripts to load, call onComplete immediately + if (featuresToLoad.length === 0) { + onComplete && onComplete(); + return; + } + + // Load each feature script by ID + featuresToLoad.forEach(function (featureID) { + loadScript(featureID, function () { + loadedCount++; + // Call onComplete when all scripts are loaded + if (loadedCount === featuresToLoad.length && typeof onComplete === 'function') { + onComplete(); + } + }); + }); +} + +// Function to load an individual script by ID with a callback +function loadScript(moduleID, callback) { + console.log('load script', moduleID, boostModules[moduleID].src); + var script = document.createElement('script'); + script.src = "".concat(basePath).concat(boostModules[moduleID].src); + script.onload = function () { + console.log("Loaded script with ID: ".concat(moduleID)); + callback && callback(); + }; + script.onerror = function () { + console.error("Failed to load script with ID: ".concat(moduleID)); + callback && callback(); + }; + document.head.appendChild(script); +} + +// Example usage: Load scripts based on feature flags, and log a message when complete +loadFeatureScripts(featureFlags, function () { + console.log('All feature scripts loaded successfully.'); +}); +/******/ })() +; +//# sourceMappingURL=wrapper.js.map \ No newline at end of file diff --git a/plinko/index.html b/plinko/index.html index fdaf55e..9fc9253 100644 --- a/plinko/index.html +++ b/plinko/index.html @@ -1,20 +1,62 @@ - - - - - - Plinko - - - - - -
- -
- - - - + + + Plinko + + + + + + + + + + + + + + +
+
+

+ Loading +

+
+ + + diff --git a/plinko/style.css b/plinko/style.css deleted file mode 100644 index b0cc35e..0000000 --- a/plinko/style.css +++ /dev/null @@ -1,17 +0,0 @@ -html, body { - margin: 0; - height: 100%; - width: 100%; -} - -.iframe-wrapper { - height: 100%; - width: 100%; - display: flex; -} - -iframe { - width: 100%; - height: 100%; - border: none; -}