@launchdarkly/browser-telemetry 0.0.9 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -5
  3. package/dist/index.cjs +16 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +746 -0
  6. package/dist/index.d.ts +746 -0
  7. package/dist/index.js +16 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +22 -32
  10. package/dist/cjs/bundle.cjs.js +0 -21
  11. package/dist/cjs/bundle.cjs.js.map +0 -1
  12. package/dist/cjs/package.json +0 -5
  13. package/dist/cjs/src/BrowserTelemetryImpl.d.ts +0 -31
  14. package/dist/cjs/src/BrowserTelemetryImpl.d.ts.map +0 -1
  15. package/dist/cjs/src/api/Breadcrumb.d.ts +0 -105
  16. package/dist/cjs/src/api/Breadcrumb.d.ts.map +0 -1
  17. package/dist/cjs/src/api/BrowserTelemetry.d.ts +0 -13
  18. package/dist/cjs/src/api/BrowserTelemetry.d.ts.map +0 -1
  19. package/dist/cjs/src/api/Collector.d.ts +0 -10
  20. package/dist/cjs/src/api/Collector.d.ts.map +0 -1
  21. package/dist/cjs/src/api/ErrorData.d.ts +0 -10
  22. package/dist/cjs/src/api/ErrorData.d.ts.map +0 -1
  23. package/dist/cjs/src/api/EventData.d.ts +0 -4
  24. package/dist/cjs/src/api/EventData.d.ts.map +0 -1
  25. package/dist/cjs/src/api/Options.d.ts +0 -133
  26. package/dist/cjs/src/api/Options.d.ts.map +0 -1
  27. package/dist/cjs/src/collectors/dom/ClickCollector.d.ts +0 -12
  28. package/dist/cjs/src/collectors/dom/ClickCollector.d.ts.map +0 -1
  29. package/dist/cjs/src/collectors/dom/KeypressCollector.d.ts +0 -14
  30. package/dist/cjs/src/collectors/dom/KeypressCollector.d.ts.map +0 -1
  31. package/dist/cjs/src/collectors/dom/getTarget.d.ts +0 -11
  32. package/dist/cjs/src/collectors/dom/getTarget.d.ts.map +0 -1
  33. package/dist/cjs/src/collectors/dom/toSelector.d.ts +0 -59
  34. package/dist/cjs/src/collectors/dom/toSelector.d.ts.map +0 -1
  35. package/dist/cjs/src/collectors/error.d.ts +0 -9
  36. package/dist/cjs/src/collectors/error.d.ts.map +0 -1
  37. package/dist/cjs/src/collectors/http/HttpCollectorOptions.d.ts +0 -13
  38. package/dist/cjs/src/collectors/http/HttpCollectorOptions.d.ts.map +0 -1
  39. package/dist/cjs/src/collectors/http/fetch.d.ts +0 -13
  40. package/dist/cjs/src/collectors/http/fetch.d.ts.map +0 -1
  41. package/dist/cjs/src/collectors/http/fetchDecorator.d.ts +0 -22
  42. package/dist/cjs/src/collectors/http/fetchDecorator.d.ts.map +0 -1
  43. package/dist/cjs/src/collectors/http/xhr.d.ts +0 -14
  44. package/dist/cjs/src/collectors/http/xhr.d.ts.map +0 -1
  45. package/dist/cjs/src/collectors/http/xhrDecorator.d.ts +0 -8
  46. package/dist/cjs/src/collectors/http/xhrDecorator.d.ts.map +0 -1
  47. package/dist/cjs/src/collectors/rrweb/ContinuousReplay.d.ts +0 -20
  48. package/dist/cjs/src/collectors/rrweb/ContinuousReplay.d.ts.map +0 -1
  49. package/dist/cjs/src/collectors/rrweb/EventBuffer.d.ts +0 -10
  50. package/dist/cjs/src/collectors/rrweb/EventBuffer.d.ts.map +0 -1
  51. package/dist/cjs/src/collectors/rrweb/RollingBuffer.d.ts +0 -19
  52. package/dist/cjs/src/collectors/rrweb/RollingBuffer.d.ts.map +0 -1
  53. package/dist/cjs/src/collectors/rrweb/RollingReplay.d.ts +0 -18
  54. package/dist/cjs/src/collectors/rrweb/RollingReplay.d.ts.map +0 -1
  55. package/dist/cjs/src/collectors/rrweb/SessionReplay.d.ts +0 -17
  56. package/dist/cjs/src/collectors/rrweb/SessionReplay.d.ts.map +0 -1
  57. package/dist/cjs/src/collectors/rrweb/SessionReplayOptions.d.ts +0 -13
  58. package/dist/cjs/src/collectors/rrweb/SessionReplayOptions.d.ts.map +0 -1
  59. package/dist/cjs/src/filters/defaultUrlFilter.d.ts +0 -8
  60. package/dist/cjs/src/filters/defaultUrlFilter.d.ts.map +0 -1
  61. package/dist/cjs/src/filters/filterHttpBreadcrumb.d.ts +0 -9
  62. package/dist/cjs/src/filters/filterHttpBreadcrumb.d.ts.map +0 -1
  63. package/dist/cjs/src/filters/filterUrl.d.ts +0 -3
  64. package/dist/cjs/src/filters/filterUrl.d.ts.map +0 -1
  65. package/dist/cjs/src/index.d.ts +0 -9
  66. package/dist/cjs/src/index.d.ts.map +0 -1
  67. package/dist/cjs/src/inspectors.d.ts +0 -5
  68. package/dist/cjs/src/inspectors.d.ts.map +0 -1
  69. package/dist/cjs/src/options.d.ts +0 -81
  70. package/dist/cjs/src/options.d.ts.map +0 -1
  71. package/dist/cjs/src/randomUuidV4.d.ts +0 -12
  72. package/dist/cjs/src/randomUuidV4.d.ts.map +0 -1
  73. package/dist/cjs/src/stack/StackFrame.d.ts +0 -37
  74. package/dist/cjs/src/stack/StackFrame.d.ts.map +0 -1
  75. package/dist/cjs/src/stack/StackParser.d.ts +0 -56
  76. package/dist/cjs/src/stack/StackParser.d.ts.map +0 -1
  77. package/dist/cjs/src/stack/StackTrace.d.ts +0 -5
  78. package/dist/cjs/src/stack/StackTrace.d.ts.map +0 -1
  79. package/dist/esm/bundle.es.js +0 -21
  80. package/dist/esm/bundle.es.js.map +0 -1
  81. package/dist/esm/package.json +0 -5
  82. package/dist/esm/src/BrowserTelemetryImpl.d.ts +0 -31
  83. package/dist/esm/src/BrowserTelemetryImpl.d.ts.map +0 -1
  84. package/dist/esm/src/api/Breadcrumb.d.ts +0 -105
  85. package/dist/esm/src/api/Breadcrumb.d.ts.map +0 -1
  86. package/dist/esm/src/api/BrowserTelemetry.d.ts +0 -13
  87. package/dist/esm/src/api/BrowserTelemetry.d.ts.map +0 -1
  88. package/dist/esm/src/api/Collector.d.ts +0 -10
  89. package/dist/esm/src/api/Collector.d.ts.map +0 -1
  90. package/dist/esm/src/api/ErrorData.d.ts +0 -10
  91. package/dist/esm/src/api/ErrorData.d.ts.map +0 -1
  92. package/dist/esm/src/api/EventData.d.ts +0 -4
  93. package/dist/esm/src/api/EventData.d.ts.map +0 -1
  94. package/dist/esm/src/api/Options.d.ts +0 -133
  95. package/dist/esm/src/api/Options.d.ts.map +0 -1
  96. package/dist/esm/src/collectors/dom/ClickCollector.d.ts +0 -12
  97. package/dist/esm/src/collectors/dom/ClickCollector.d.ts.map +0 -1
  98. package/dist/esm/src/collectors/dom/KeypressCollector.d.ts +0 -14
  99. package/dist/esm/src/collectors/dom/KeypressCollector.d.ts.map +0 -1
  100. package/dist/esm/src/collectors/dom/getTarget.d.ts +0 -11
  101. package/dist/esm/src/collectors/dom/getTarget.d.ts.map +0 -1
  102. package/dist/esm/src/collectors/dom/toSelector.d.ts +0 -59
  103. package/dist/esm/src/collectors/dom/toSelector.d.ts.map +0 -1
  104. package/dist/esm/src/collectors/error.d.ts +0 -9
  105. package/dist/esm/src/collectors/error.d.ts.map +0 -1
  106. package/dist/esm/src/collectors/http/HttpCollectorOptions.d.ts +0 -13
  107. package/dist/esm/src/collectors/http/HttpCollectorOptions.d.ts.map +0 -1
  108. package/dist/esm/src/collectors/http/fetch.d.ts +0 -13
  109. package/dist/esm/src/collectors/http/fetch.d.ts.map +0 -1
  110. package/dist/esm/src/collectors/http/fetchDecorator.d.ts +0 -22
  111. package/dist/esm/src/collectors/http/fetchDecorator.d.ts.map +0 -1
  112. package/dist/esm/src/collectors/http/xhr.d.ts +0 -14
  113. package/dist/esm/src/collectors/http/xhr.d.ts.map +0 -1
  114. package/dist/esm/src/collectors/http/xhrDecorator.d.ts +0 -8
  115. package/dist/esm/src/collectors/http/xhrDecorator.d.ts.map +0 -1
  116. package/dist/esm/src/collectors/rrweb/ContinuousReplay.d.ts +0 -20
  117. package/dist/esm/src/collectors/rrweb/ContinuousReplay.d.ts.map +0 -1
  118. package/dist/esm/src/collectors/rrweb/EventBuffer.d.ts +0 -10
  119. package/dist/esm/src/collectors/rrweb/EventBuffer.d.ts.map +0 -1
  120. package/dist/esm/src/collectors/rrweb/RollingBuffer.d.ts +0 -19
  121. package/dist/esm/src/collectors/rrweb/RollingBuffer.d.ts.map +0 -1
  122. package/dist/esm/src/collectors/rrweb/RollingReplay.d.ts +0 -18
  123. package/dist/esm/src/collectors/rrweb/RollingReplay.d.ts.map +0 -1
  124. package/dist/esm/src/collectors/rrweb/SessionReplay.d.ts +0 -17
  125. package/dist/esm/src/collectors/rrweb/SessionReplay.d.ts.map +0 -1
  126. package/dist/esm/src/collectors/rrweb/SessionReplayOptions.d.ts +0 -13
  127. package/dist/esm/src/collectors/rrweb/SessionReplayOptions.d.ts.map +0 -1
  128. package/dist/esm/src/filters/defaultUrlFilter.d.ts +0 -8
  129. package/dist/esm/src/filters/defaultUrlFilter.d.ts.map +0 -1
  130. package/dist/esm/src/filters/filterHttpBreadcrumb.d.ts +0 -9
  131. package/dist/esm/src/filters/filterHttpBreadcrumb.d.ts.map +0 -1
  132. package/dist/esm/src/filters/filterUrl.d.ts +0 -3
  133. package/dist/esm/src/filters/filterUrl.d.ts.map +0 -1
  134. package/dist/esm/src/index.d.ts +0 -9
  135. package/dist/esm/src/index.d.ts.map +0 -1
  136. package/dist/esm/src/inspectors.d.ts +0 -5
  137. package/dist/esm/src/inspectors.d.ts.map +0 -1
  138. package/dist/esm/src/options.d.ts +0 -81
  139. package/dist/esm/src/options.d.ts.map +0 -1
  140. package/dist/esm/src/randomUuidV4.d.ts +0 -12
  141. package/dist/esm/src/randomUuidV4.d.ts.map +0 -1
  142. package/dist/esm/src/stack/StackFrame.d.ts +0 -37
  143. package/dist/esm/src/stack/StackFrame.d.ts.map +0 -1
  144. package/dist/esm/src/stack/StackParser.d.ts +0 -56
  145. package/dist/esm/src/stack/StackParser.d.ts.map +0 -1
  146. package/dist/esm/src/stack/StackTrace.d.ts +0 -5
  147. package/dist/esm/src/stack/StackTrace.d.ts.map +0 -1
@@ -1,21 +0,0 @@
1
- "use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};
2
- /**
3
- * https://github.com/csnover/TraceKit
4
- * @license MIT
5
- * @namespace TraceKit
6
- */!function(t){!function(e){if(e){var n={},r=e.TraceKit,o=[].slice,s="?",i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;n.noConflict=function(){return e.TraceKit=r,n},n.wrap=function(e){return function(){try{return e.apply(this,arguments)}catch(e){throw n.report(e),e}}},n.report=function(){var t,r,o,s,l=[],c=null,u=null;function d(e,t,r){var o=null;if(!t||n.collectWindowErrors){for(var s in l)if(a(l,s))try{l[s](e,t,r)}catch(e){o=e}if(o)throw o}}function h(e,r,o,s,a){if(u)n.computeStackTrace.augmentStackTraceWithInitialElement(u,r,o,e),m();else if(a)d(n.computeStackTrace(a),!0,a);else{var l,c={url:r,line:o,column:s},h=e;if("[object String]"==={}.toString.call(e)){var p=e.match(i);p&&(l=p[1],h=p[2])}c.func=n.computeStackTrace.guessFunctionName(c.url,c.line),c.context=n.computeStackTrace.gatherContext(c.url,c.line),d({name:l,message:h,mode:"onerror",stack:[c]},!0,null)}return!!t&&t.apply(this,arguments)}function p(e){d(n.computeStackTrace(e.reason),!0,e.reason)}function m(){var e=u,t=c;u=null,c=null,d(e,!1,t)}function g(e){if(u){if(c===e)return;m()}var t=n.computeStackTrace(e);throw u=t,c=e,setTimeout((function(){c===e&&m()}),t.incomplete?2e3:0),e}return g.subscribe=function(n){!function(){if(!0===r)return;t=e.onerror,e.onerror=h,r=!0}(),function(){if(!0===s)return;o=e.onunhandledrejection,e.onunhandledrejection=p,s=!0}(),l.push(n)},g.unsubscribe=function(n){for(var i=l.length-1;i>=0;--i)l[i]===n&&l.splice(i,1);0===l.length&&(r&&(e.onerror=t,r=!1),s&&(e.onunhandledrejection=o,s=!1))},g}(),n.computeStackTrace=function(){var t={};function r(r){if("string"!=typeof r)return[];if(!a(t,r)){var o="",s="";try{s=e.document.domain}catch(e){}var i=/(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(r);i&&i[2]===s&&(o=function(t){if(!n.remoteFetching)return"";try{var r=function(){try{return new e.XMLHttpRequest}catch(t){return new e.ActiveXObject("Microsoft.XMLHTTP")}}();return r.open("GET",t,!1),r.send(""),r.responseText}catch(e){return""}}(r)),t[r]=o?o.split("\n"):[]}return t[r]}function o(e,t){var n,o=/function ([^(]*)\(([^)]*)\)/,i=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,a="",c=r(e);if(!c.length)return s;for(var u=0;u<10;++u)if(!l(a=c[t-u]+a)){if(n=i.exec(a))return n[1];if(n=o.exec(a))return n[1]}return s}function i(e,t){var o=r(e);if(!o.length)return null;var s=[],i=Math.floor(n.linesOfContext/2),a=i+n.linesOfContext%2,c=Math.max(0,t-i-1),u=Math.min(o.length,t+a-1);t-=1;for(var d=c;d<u;++d)l(o[d])||s.push(o[d]);return s.length>0?s:null}function c(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function u(e){return c(e).replace("<","(?:<|&lt;)").replace(">","(?:>|&gt;)").replace("&","(?:&|&amp;)").replace('"','(?:"|&quot;)').replace(/\s+/g,"\\s+")}function d(e,t){for(var n,o,s=0,i=t.length;s<i;++s)if((n=r(t[s])).length&&(n=n.join("\n"),o=e.exec(n)))return{url:t[s],line:n.substring(0,o.index).split("\n").length,column:o.index-n.lastIndexOf("\n",o.index)-1};return null}function h(e,t,n){var o,s=r(t),i=new RegExp("\\b"+c(e)+"\\b");return n-=1,s&&s.length>n&&(o=i.exec(s[n]))?o.index:null}function p(t){if(!l(e&&e.document)){for(var n,r,o,s,i=[e.location.href],a=e.document.getElementsByTagName("script"),h=""+t,p=0;p<a.length;++p){var m=a[p];m.src&&i.push(m.src)}if(o=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(h)){var g=o[1]?"\\s+"+o[1]:"",f=o[2].split(",").join("\\s*,\\s*");n=c(o[3]).replace(/;$/,";?"),r=new RegExp("function"+g+"\\s*\\(\\s*"+f+"\\s*\\)\\s*{\\s*"+n+"\\s*}")}else r=new RegExp(c(h).replace(/\s+/g,"\\s+"));if(s=d(r,i))return s;if(o=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(h)){var I=o[1];if(n=u(o[2]),s=d(r=new RegExp("on"+I+"=[\\'\"]\\s*"+n+"\\s*[\\'\"]","i"),i[0]))return s;if(s=d(r=new RegExp(n),i))return s}return null}}function m(e){if(!e.stack)return null;for(var t,n,r,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,c=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,d=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,p=/\((\S*)(?::(\d+))(?::(\d+))\)/,m=e.stack.split("\n"),g=[],f=/^(.*) is undefined$/.exec(e.message),I=0,C=m.length;I<C;++I){if(n=a.exec(m[I])){var y=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=p.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]),r={url:y?null:n[2],func:n[1]||s,args:y?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=u.exec(m[I]))r={url:n[2],func:n[1]||s,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=c.exec(m[I])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=d.exec(n[3]))?(n[3]=t[1],n[4]=t[2],n[5]=null):0!==I||n[5]||l(e.columnNumber)||(g[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||s,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=o(r.url,r.line)),r.context=r.line?i(r.url,r.line):null,g.push(r)}return g.length?(g[0]&&g[0].line&&!g[0].column&&f&&(g[0].column=h(f[1],g[0].url,g[0].line)),{mode:"stack",name:e.name,message:e.message,stack:g}):null}function g(e,t,n,r){var s={url:t,line:n};if(s.url&&s.line){e.incomplete=!1,s.func||(s.func=o(s.url,s.line)),s.context||(s.context=i(s.url,s.line));var a=/ '([^']+)' /.exec(r);if(a&&(s.column=h(a[1],s.url,s.line)),e.stack.length>0&&e.stack[0].url===s.url){if(e.stack[0].line===s.line)return!1;if(!e.stack[0].line&&e.stack[0].func===s.func)return e.stack[0].line=s.line,e.stack[0].context=s.context,!1}return e.stack.unshift(s),e.partial=!0,!0}return e.incomplete=!0,!1}function f(e,t){for(var r,i,a,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],u={},d=!1,m=f.caller;m&&!d;m=m.caller)if(m!==I&&m!==n.report){if(i={url:null,func:s,args:[],line:null,column:null},m.name?i.func=m.name:(r=l.exec(m.toString()))&&(i.func=r[1]),void 0===i.func)try{i.func=r.input.substring(0,r.input.indexOf("{"))}catch(e){}if(a=p(m)){i.url=a.url,i.line=a.line,i.func===s&&(i.func=o(i.url,i.line));var C=/ '([^']+)' /.exec(e.message||e.description);C&&(i.column=h(C[1],a.url,a.line))}u[""+m]?d=!0:u[""+m]=!0,c.push(i)}t&&c.splice(0,t);var y={mode:"callers",name:e.name,message:e.message,stack:c};return g(y,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),y}function I(t,n){var s=null;n=null==n?0:+n;try{if(s=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,s=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,a=t.split("\n"),l=[],c=0;c<a.length;c+=2){var u=null;if((n=r.exec(a[c]))?u={url:n[2],line:+n[1],column:null,func:n[3],args:[]}:(n=s.exec(a[c]))&&(u={url:n[6],line:+n[1],column:+n[2],func:n[3]||n[4],args:n[5]?n[5].split(","):[]}),u){if(!u.func&&u.line&&(u.func=o(u.url,u.line)),u.line)try{u.context=i(u.url,u.line)}catch(e){}u.context||(u.context=[a[c+1]]),l.push(u)}}return l.length?{mode:"stacktrace",name:e.name,message:e.message,stack:l}:null}}(t),s)return s}catch(e){}try{if(s=m(t))return s}catch(e){}try{if(s=function(t){var n=t.message.split("\n");if(n.length<4)return null;var s,l=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,c=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,h=/^\s*Line (\d+) of function script\s*$/i,p=[],m=e&&e.document&&e.document.getElementsByTagName("script"),g=[];for(var f in m)a(m,f)&&!m[f].src&&g.push(m[f]);for(var I=2;I<n.length;I+=2){var C=null;if(s=l.exec(n[I]))C={url:s[2],func:s[3],args:[],line:+s[1],column:null};else if(s=c.exec(n[I])){C={url:s[3],func:s[4],args:[],line:+s[1],column:null};var y=+s[1],v=g[s[2]-1];if(v){var b=r(C.url);if(b){var S=(b=b.join("\n")).indexOf(v.innerText);S>=0&&(C.line=y+b.substring(0,S).split("\n").length)}}}else if(s=h.exec(n[I])){var A=e.location.href.replace(/#.*$/,""),k=d(new RegExp(u(n[I+1])),[A]);C={url:A,func:"",args:[],line:k?k.line:s[1],column:null}}if(C){C.func||(C.func=o(C.url,C.line));var w=i(C.url,C.line),M=w?w[Math.floor(w.length/2)]:null;w&&M.replace(/^\s*/,"")===n[I+1].replace(/^\s*/,"")?C.context=w:C.context=[n[I+1]],p.push(C)}}return p.length?{mode:"multiline",name:t.name,message:n[0],stack:p}:null}(t),s)return s}catch(e){}try{if(s=f(t,n+1))return s}catch(e){}return{name:t.name,message:t.message,mode:"failed"}}return I.augmentStackTraceWithInitialElement=g,I.computeStackTraceFromStackProp=m,I.guessFunctionName=o,I.gatherContext=i,I.ofCaller=function(e){e=1+(null==e?0:+e);try{throw new Error}catch(t){return I(t,e+1)}},I.getSource=r,I}(),n.extendToAsynchronousCallbacks=function(){var t=function(t){var r=e[t];e[t]=function(){var e=o.call(arguments),t=e[0];return"function"==typeof t&&(e[0]=n.wrap(t)),r.apply?r.apply(this,e):r(e[0],e[1])}};t("setTimeout"),t("setInterval")},n.remoteFetching||(n.remoteFetching=!0),n.collectWindowErrors||(n.collectWindowErrors=!0),(!n.linesOfContext||n.linesOfContext<1)&&(n.linesOfContext=11),t.exports&&e.module!==t?t.exports=n:e.TraceKit=n}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){return void 0===e}}("undefined"!=typeof window?window:e)}(n);var r=n.exports,o=t(r);function s(e){try{return e.target}catch(e){return}}function i(e){return"object"==typeof e&&null!=e&&e.parentNode}function a(e){if(!e.tagName)return"";const t=[];t.push(e.tagName.toLowerCase()),e.id&&t.push(`#${e.id}`);const n=function(e){if("string"!=typeof e.className)return;let t=e.className;return e.className.includes(" ")&&(t=e.className.replace(" ",".")),""!==t?`.${t}`:void 0}(e);return n&&t.push(n),t.join("")}function l(e,t={maxDepth:10}){const n=[];let r=e;for(;i(r)&&r.parentNode&&n.length<t.maxDepth;){const e=a(r);if("html"===e)break;n.push(e),r=r.parentNode}return n.reverse().join(" > ")}class c{constructor(){window.addEventListener("click",(e=>{var t;const n=s(e);if(n){const e={class:"ui",type:"click",level:"info",timestamp:Date.now(),message:l(n)};null===(t=this.destination)||void 0===t||t.addBreadcrumb(e)}}),!0)}register(e,t){this.destination=e}unregister(){this.destination=void 0}}const u=["INPUT","TEXTAREA"];class d{constructor(){window.addEventListener("keypress",(e=>{var t;const n=s(e),r=n;if(n&&(u.includes(n.tagName)||(null==r?void 0:r.isContentEditable))){const e={class:"ui",type:"input",level:"info",timestamp:Date.now(),message:l(n)};this.shouldDeduplicate(e)||(null===(t=this.destination)||void 0===t||t.addBreadcrumb(e),this.lastEvent=e)}}),!0)}register(e,t){this.destination=e}unregister(){this.destination=void 0}shouldDeduplicate(e){if(this.lastEvent){const t=Math.abs(e.timestamp-this.lastEvent.timestamp);return this.lastEvent.message===e.message&&t<=1e3}return!1}}class h{constructor(){window.addEventListener("error",(e=>{var t;null===(t=this.destination)||void 0===t||t.captureErrorEvent(e)}),!0),window.addEventListener("unhandledrejection",(e=>{var t;e.reason&&(null===(t=this.destination)||void 0===t||t.captureError(e.reason))}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}function p(e,t){var n,r,o;(null===(n=e.data)||void 0===n?void 0:n.url)&&(e.data.url=(r=t.urlFilters,(o=e.data.url)?r.reduce(((e,t)=>t(e)),o):""))}const m=window.fetch;function g(e,t){var n;let r="",o="GET";return"string"==typeof e&&(r=e),e instanceof Request&&(r=e.url),e instanceof URL&&(r=e.toString()),t&&(o=null!==(n=t.method)&&void 0!==n?n:o),{url:r,method:o}}class f{constructor(e){!function(e){function t(...t){const n=Date.now();return m.apply(this,t).then((r=>{const o={class:"http",timestamp:n,level:r.ok?"info":"error",type:"fetch",data:Object.assign(Object.assign({},g(t[0],t[1])),{statusCode:r.status,statusText:r.statusText})};return e(o),r}))}t.prototype=m.prototype;try{Object.defineProperty(t,"__LaunchDarkly_original_fetch",{value:m,writable:!0,configurable:!0})}catch(e){}window.fetch=t}((t=>{var n;p(t,e),null===(n=this.destination)||void 0===n||n.addBreadcrumb(t)}))}register(e,t){this.destination=e}unregister(){this.destination=void 0}}const I="__LaunchDarkly_original_xhr",C=`${I}_open`,y=`${I}_send`,v="__LaunchDarkly_data_xhr",b=window.XMLHttpRequest.prototype.open,S=window.XMLHttpRequest.prototype.send;class A{constructor(e){!function(e){window.XMLHttpRequest.prototype.open=function(...t){this.addEventListener("error",(function(e){this[v].error=!0})),this.addEventListener("loadend",(function(t){const n=this[v];n&&n.timestamp&&e({class:"http",timestamp:n.timestamp,level:n.error?"error":"info",type:"xhr",data:{url:n.url,method:n.method,statusCode:this.status,statusText:this.statusText}})}),!0),b.apply(this,t);try{const e={method:null==t?void 0:t[0],url:null==t?void 0:t[1]};Object.defineProperty(this,v,{value:e,writable:!0,configurable:!0})}catch(e){}},window.XMLHttpRequest.prototype.send=function(...e){S.apply(this,e);const t=this[v];t&&(t.timestamp=Date.now())};try{Object.defineProperties(window.XMLHttpRequest,{[C]:{value:b,writable:!0,configurable:!0},[y]:{value:S,writable:!0,configurable:!0}})}catch(e){}}((t=>{var n;p(t,e),null===(n=this.destination)||void 0===n||n.addBreadcrumb(t)}))}register(e,t){this.destination=e}unregister(){this.destination=void 0}}const k=/sdk\/evalx\/[^/]+\/contexts\/(?<context>[^/?]*)\??.*?/,w=/\/eval\/[^/]+\/(?<context>[^/?]*)\??.*?/;function M(e){var t,n;if(e.includes("/sdk/evalx")){const n=e.match(k),r=null===(t=null==n?void 0:n.groups)||void 0===t?void 0:t.context;if(r)return e.replace(r,"*".repeat(r.length))}if(e.includes("/eval/")){const t=e.match(w),r=null===(n=null==t?void 0:t.groups)||void 0===n?void 0:n.context;if(r)return e.replace(r,"*".repeat(r.length))}return e}const x={start:0,end:3},T={start:4,end:5},E={start:6,end:7},N={start:8,end:8},R={start:9,end:9},F={start:10,end:15};function O(e,t){let n="";for(let r=t.start;r<=t.end;r+=1)n+=e[r].toString(16).padStart(2,"0");return n}function L(){return function(e){return e[N.start]=191&e[N.start]|128,e[E.start]=15&e[E.start]|64,`${O(e,x)}-${O(e,T)}-${O(e,E)}-${O(e,N)}${O(e,R)}-${O(e,F)}`}(function(){if(crypto&&crypto.getRandomValues){const e=new Uint8Array(16);return crypto.getRandomValues(e),[...e.values()]}const e=[];for(let t=0;t<16;t+=1)e.push(Math.floor(256*Math.random()));return e}())}const D="(index)";function B(e,t){let n=e;return e.startsWith(t)&&(n=e.slice(t.length),n.startsWith("/")&&(n=n.slice(1)),""===n&&(n=D),n.endsWith("/")&&(n+=D)),n}function W(e,t,n){if(t.length<=e.maxLength)return t;const r=Math.max(0,n-e.beforeColumnCharacters),o=Math.min(t.length,r+e.maxLength);return t.slice(r,o)}function U(e,t,n,r){const o=e<0?0:e,s=t>n.length?n.length:t;return o<s?n.slice(o,s).map(r):[]}function Z(e,t){const n=r.computeStackTrace(e).stack.reverse().map((e=>Object.assign({fileName:B(e.url,window.location.origin),function:e.func,line:e.line,col:e.column},function(e,t){const{context:n}=e;if(!n)return{};const{maxLineLength:r}=t.source,o=Math.floor(r/2),s=e=>W({maxLength:t.source.maxLineLength,beforeColumnCharacters:o},e,0),i=Math.floor(n.length/2);return{srcBefore:U(i-t.source.beforeLines,i,n,s),srcLine:W({maxLength:r,beforeColumnCharacters:o},n[i],e.column||0),srcAfter:U(i+1,i+1+t.source.afterLines,n,s)}}(e,t))));return{frames:n}}const G="$ld:telemetry",V=`${G}:error`,K=`${G}:sessionCapture`,_="generic";function P(e){switch(typeof e){case"string":case"boolean":case"number":return e;default:return}}class Y{constructor(e){this.options=e,this.pendingEvents=[],this.breadcrumbs=[],this.inspectorInstances=[],this.collectors=[],this.sessionId=void 0!==typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():L(),function(e){const t=Math.max(e.source.afterLines,e.source.beforeLines);o.linesOfContext=2*t+1}(e.stack),this.collectors.push(new h),this.collectors.push(...e.collectors),this.maxPendingEvents=e.maxPendingEvents,this.maxBreadcrumbs=e.breadcrumbs.maxBreadcrumbs;const t=[M];e.breadcrumbs.http.customUrlFilter&&t.push(e.breadcrumbs.http.customUrlFilter),e.breadcrumbs.http.instrumentFetch&&this.collectors.push(new f({urlFilters:t})),e.breadcrumbs.http.instrumentXhr&&this.collectors.push(new A({urlFilters:t})),e.breadcrumbs.click&&this.collectors.push(new c),e.breadcrumbs.keyboardInput&&this.collectors.push(new d),this.collectors.forEach((e=>e.register(this,this.sessionId)));const n=[];!function(e,t,n){e.breadcrumbs.evaluations&&t.push({type:"flag-used",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t,r){n.handleFlagUsed(e,t,r)}}),e.breadcrumbs.flagChange&&t.push({type:"flag-detail-changed",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t){n.handleFlagDetailChanged(e,t)}})}(e,n,this),this.inspectorInstances.push(...n)}register(e){this.client=e,this.pendingEvents.forEach((e=>{var t;null===(t=this.client)||void 0===t||t.track(e.type,e.data)}))}inspectors(){return this.inspectorInstances}capture(e,t){var n;void 0===this.client&&(this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>this.maxPendingEvents&&this.pendingEvents.shift()),null===(n=this.client)||void 0===n||n.track(e,t)}captureError(e){var t,n;const r=null!=e?{type:e.name||(null===(t=e.constructor)||void 0===t?void 0:t.name)||_,message:null!==(n=e.message)&&void 0!==n?n:"exception had no message",stack:Z(e,this.options.stack),breadcrumbs:[...this.breadcrumbs],sessionId:this.sessionId}:{type:_,message:"exception was null or undefined",stack:{frames:[]},breadcrumbs:[...this.breadcrumbs],sessionId:this.sessionId};this.capture(V,r),this.dispatchError(r)}captureErrorEvent(e){this.captureError(e.error)}captureSession(e){this.capture(K,Object.assign(Object.assign({},e),{breadcrumbs:[...this.breadcrumbs]}))}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}close(){this.collectors.forEach((e=>e.unregister()))}handleFlagUsed(e,t,n){const r={type:"flag-evaluated",data:{key:e,value:P(t.value)},timestamp:(new Date).getTime(),class:"feature-management",level:"info"};this.addBreadcrumb(r),this.dispatchFlagUsed(e,t,n)}handleFlagDetailChanged(e,t){const n={type:"flag-detail-changed",data:{key:e,value:P(t.value)},timestamp:(new Date).getTime(),class:"feature-management",level:"info"};this.addBreadcrumb(n),this.dispatchFlagDetailChanged(e,t)}dispatchError(e){this.collectors.forEach((t=>{var n;null===(n=t.handleErrorEvent)||void 0===n||n.call(t,e.type,e.message)}))}dispatchFlagUsed(e,t,n){this.collectors.forEach((r=>{var o;null===(o=r.handleFlagUsed)||void 0===o||o.call(r,e,t,n)}))}dispatchFlagDetailChanged(e,t){this.collectors.forEach((n=>{var r;null===(r=n.handleFlagDetailChanged)||void 0===r||r.call(n,e,t)}))}}var z;function j(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function J(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function H(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(Q).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function Q(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=H(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(z||(z={}));var X=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function q(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(i=s?s(i):"*".repeat(i.length)),i}var $="__rrweb_original__";var ee,te,ne=1,re=new RegExp("[^a-z0-9-_:]"),oe=-2;function se(){return ne++}var ie=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ae=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,le=/^(data:)([^,]*),(.*)/i;function ce(e,t){return(e||"").replace(ie,(function(e,n,r,o,s,i){var a,l=r||s||i,c=n||o||"";if(!l)return e;if(!ae.test(l))return"url(".concat(c).concat(l).concat(c,")");if(le.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),d=l.split("/");u.pop();for(var h=0,p=d;h<p.length;h++){var m=p[h];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(c).concat(u.join("/")).concat(c,")")}))}var ue=/^[^ \t\n\r\u000c]+/,de=/^[, \t\n\r\u000c]+/;function he(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function pe(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function me(){var e=document.createElement("a");return e.href="",e.href}function ge(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?he(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(de),!(n>=t.length);){var s=r(ue);if(","===s.slice(-1))s=he(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=he(e,s);for(var a=!1;;){var l=t.charAt(n);if(""===l){o.push((s+i).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,o.push((s+i).trim());break}"("===l&&(a=!0)}i+=l,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?ce(r,me()):"object"===t&&"data"===n&&r?he(e,r):r:he(e,r)}function fe(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&fe(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&fe(e.parentNode,t,n)}function Ie(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(fe(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function Ce(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,d=t.maskTextFn,h=t.maskInputFn,p=t.dataURLOptions,m=void 0===p?{}:p,g=t.inlineImages,f=t.recordCanvas,I=t.keepIframeSrcFn,C=t.newlyAddedElement,y=void 0!==C&&C,v=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:z.Document,childNodes:[],compatMode:e.compatMode}:{type:z.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:z.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,l=t.maskInputFn,c=t.dataURLOptions,u=void 0===c?{}:c,d=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,g=void 0!==m&&m,f=t.rootId,I=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(e,r,o),C=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return re.test(t)?"div":t}(e),y={},v=e.attributes.length,b=0;b<v;b++){var S=e.attributes[b];y[S.name]=ge(n,C,S.name,S.value)}if("link"===C&&s){var A=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),k=null;A&&(k=H(A)),k&&(delete y.rel,delete y.href,y._cssText=ce(k,A.href))}if("style"===C&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(k=H(e.sheet))&&(y._cssText=ce(k,me()))}if("input"===C||"textarea"===C||"select"===C){var w=e.value,M=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&w?y.value=q({type:y.type,tagName:C,value:w,maskInputOptions:a,maskInputFn:l}):M&&(y.checked=M)}"option"===C&&(e.selected&&!a.select?y.selected=!0:delete y.selected);if("canvas"===C&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,s=$ in o?o[$]:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var x=e.toDataURL(u.type,u.quality),T=document.createElement("canvas");T.width=e.width,T.height=e.height,x!==T.toDataURL(u.type,u.quality)&&(y.rr_dataURL=x)}if("img"===C&&d){ee||(ee=n.createElement("canvas"),te=ee.getContext("2d"));var E=e,N=E.crossOrigin;E.crossOrigin="anonymous";var R=function(){try{ee.width=E.naturalWidth,ee.height=E.naturalHeight,te.drawImage(E,0,0),y.rr_dataURL=ee.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(E.currentSrc,"! Error: ").concat(e))}N?y.crossOrigin=N:E.removeAttribute("crossorigin")};E.complete&&0!==E.naturalWidth?R():E.onload=R}"audio"!==C&&"video"!==C||(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(I){var F=e.getBoundingClientRect(),O=F.width,L=F.height;y={class:y.class,rr_width:"".concat(O,"px"),rr_height:"".concat(L,"px")}}"iframe"!==C||p(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);return{type:z.Element,tagName:C,attributes:y,childNodes:[],isSVG:pe(e)||void 0,needBlock:I,rootId:f}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,dataURLOptions:m,inlineImages:g,recordCanvas:f,keepIframeSrcFn:I,newlyAddedElement:y,rootId:v});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(d=e.parentNode.sheet).cssRules?Array.from(d.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=ce(l,me())}var d;u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&Ie(e,r,o)&&(l=s?s(l):l.replace(/[\S]/g,"*"));return{type:z.Text,textContent:l||"",isStyle:c,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:d,rootId:v});case e.CDATA_SECTION_NODE:return{type:z.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:z.Comment,textContent:e.textContent||"",rootId:v};default:return!1}}function ye(e){return void 0===e?"":e.toLowerCase()}function ve(e,t){var n,r=t.doc,o=t.mirror,s=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,d=t.inlineStylesheet,h=void 0===d||d,p=t.maskInputOptions,m=void 0===p?{}:p,g=t.maskTextFn,f=t.maskInputFn,I=t.slimDOMOptions,C=t.dataURLOptions,y=void 0===C?{}:C,v=t.inlineImages,b=void 0!==v&&v,S=t.recordCanvas,A=void 0!==S&&S,k=t.onSerialize,w=t.onIframeLoad,M=t.iframeLoadTimeout,x=void 0===M?5e3:M,T=t.onStylesheetLoad,E=t.stylesheetLoadTimeout,N=void 0===E?5e3:E,R=t.keepIframeSrcFn,F=void 0===R?function(){return!1}:R,O=t.newlyAddedElement,L=void 0!==O&&O,D=t.preserveWhiteSpace,B=void 0===D||D,W=Ce(e,{doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:h,maskInputOptions:m,maskTextFn:g,maskInputFn:f,dataURLOptions:y,inlineImages:b,recordCanvas:A,keepIframeSrcFn:F,newlyAddedElement:L});if(!W)return console.warn(e,"not serialized"),null;n=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===z.Comment)return!0;if(e.type===z.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ye(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ye(e.attributes.name)||"icon"===ye(e.attributes.rel)||"apple-touch-icon"===ye(e.attributes.rel)||"shortcut icon"===ye(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ye(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ye(e.attributes.property).match(/^(og|twitter|fb):/)||ye(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ye(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ye(e.attributes.name)||"googlebot"===ye(e.attributes.name)||"bingbot"===ye(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ye(e.attributes.name)||"generator"===ye(e.attributes.name)||"framework"===ye(e.attributes.name)||"publisher"===ye(e.attributes.name)||"progid"===ye(e.attributes.name)||ye(e.attributes.property).match(/^article:/)||ye(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ye(e.attributes.name)||"yandex-verification"===ye(e.attributes.name)||"csrf-token"===ye(e.attributes.name)||"p:domain_verify"===ye(e.attributes.name)||"verify-v1"===ye(e.attributes.name)||"verification"===ye(e.attributes.name)||"shopify-checkout-api-token"===ye(e.attributes.name)))return!0}}return!1}(W,I)&&(B||W.type!==z.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?se():oe;var U=Object.assign(W,{id:n});if(o.add(e,U),n===oe)return null;k&&k(e);var Z=!u;if(U.type===z.Element){Z=Z&&!U.needBlock,delete U.needBlock;var G=e.shadowRoot;G&&J(G)&&(U.isShadowHost=!0)}if((U.type===z.Document||U.type===z.Element)&&Z){I.headWhitespace&&U.type===z.Element&&"head"===U.tagName&&(B=!1);for(var V={doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:h,maskInputOptions:m,maskTextFn:g,maskInputFn:f,slimDOMOptions:I,dataURLOptions:y,inlineImages:b,recordCanvas:A,preserveWhiteSpace:B,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:T,stylesheetLoadTimeout:N,keepIframeSrcFn:F},K=0,_=Array.from(e.childNodes);K<_.length;K++){(H=ve(_[K],V))&&U.childNodes.push(H)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var P=0,Y=Array.from(e.shadowRoot.childNodes);P<Y.length;P++){var H;(H=ve(Y[P],V))&&(J(e.shadowRoot)&&(H.isShadow=!0),U.childNodes.push(H))}}return e.parentNode&&j(e.parentNode)&&J(e.parentNode)&&(U.isShadow=!0),U.type===z.Element&&"iframe"===U.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((function(){s||(t(),s=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&w){var n=ve(t,{doc:t,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskTextFn:g,maskInputFn:f,slimDOMOptions:I,dataURLOptions:y,inlineImages:b,recordCanvas:A,preserveWhiteSpace:B,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:T,stylesheetLoadTimeout:N,keepIframeSrcFn:F});n&&w(e,n)}}),x),U.type===z.Element&&"link"===U.tagName&&"stylesheet"===U.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}(e,(function(){if(T){var t=ve(e,{doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskTextFn:g,maskInputFn:f,slimDOMOptions:I,dataURLOptions:y,inlineImages:b,recordCanvas:A,preserveWhiteSpace:B,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:T,stylesheetLoadTimeout:N,keepIframeSrcFn:F});t&&T(e,t)}}),N),U}function be(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Se="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ae={map:{},getId:()=>(console.error(Se),-1),getNode:()=>(console.error(Se),null),removeNodeFromMap(){console.error(Se)},has:()=>(console.error(Se),!1),reset(){console.error(Se)}};function ke(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();o||!1!==n.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=i,e.apply(l,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(l,s)}),a))}}function we(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>we(e,t,s||{},!0)}function Me(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}function xe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Te(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ee(e,t,n,r){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(fe(o,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function Ne(e,t){return t.getId(e)===oe}function Re(e,t){if(j(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Re(e.parentNode,t))}function Fe(e){return Boolean(e.changedTouches)}function Oe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Le(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function De(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ae=new Proxy(Ae,{get:(e,t,n)=>("map"===t&&console.error(Se),Reflect.get(e,t,n))}));class Be{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var We=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(We||{}),Ue=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(Ue||{}),Ze=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ze||{}),Ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ge||{});function Ve(e){return"__ln"in e}class Ke{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const _e=(e,t)=>`${e}@${t}`;class Pe{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Ke,n=e=>{let t=e,n=oe;for(;n===oe;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var o,s,i,a;let l=null;(null===(s=null===(o=r.getRootNode)||void 0===o?void 0:o.call(r))||void 0===s?void 0:s.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(l=r.getRootNode().host);let c=l;for(;(null===(a=null===(i=null==c?void 0:c.getRootNode)||void 0===i?void 0:i.call(c))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&c.getRootNode().host;)c=c.getRootNode().host;const u=!(this.doc.contains(r)||c&&this.doc.contains(c));if(!r.parentNode||u)return;const d=j(r.parentNode)?this.mirror.getId(l):this.mirror.getId(r.parentNode),h=n(r);if(-1===d||-1===h)return t.addNode(r);const p=ve(r,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Oe(e,this.mirror)&&this.iframeManager.addIframe(e),Le(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),De(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});p&&e.push({parentId:d,nextId:h,node:p})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))ze(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))Je(this.droppedSet,e)||ze(this.removes,e,this.mirror)?Je(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;t.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e)for(let r=t.length-1;r>=0;r--){const o=t.get(r);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===n(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}o=e.previous,t.removeNode(e.value),r(e.value)}const s={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{if(!Ne(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Ie(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=q({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),Ee(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let r=this.attributes.find((t=>t.node===e.target));if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(r||(r={node:e.target,attributes:{}},this.attributes.push(r)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==r.attributes.style&&null!==r.attributes.style||(r.attributes.style={});const o=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&s===n.style.getPropertyPriority(e)||(o[e]=""===s?r:[r,s])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else r.attributes[e.attributeName]=ge(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(Ee(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=j(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||Ne(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ye(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Re(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[_e(n,r)]?Ye(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!j(e.target)||!J(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(Ne(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[_e(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ee(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach((e=>this.genAdds(e)))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ye(e,t){e.delete(t),t.childNodes.forEach((t=>Ye(e,t)))}function ze(e,t,n){return 0!==e.length&&je(e,t,n)}function je(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some((e=>e.id===o))||je(e,r,n)}function Je(e,t){return 0!==e.size&&He(e,t)}function He(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||He(e,n))}const Qe=[],Xe="undefined"!=typeof CSSGroupingRule,qe="undefined"!=typeof CSSMediaRule,$e="undefined"!=typeof CSSSupportsRule,et="undefined"!=typeof CSSConditionRule;function tt(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function nt(e,t){var n,r;const o=new Pe;Qe.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function rt({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(Ze).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((s=>{const i=s.toLowerCase(),l=(t=>s=>{const i=tt(s);if(Ee(i,r,o,!0))return;const a=Fe(s)?s.changedTouches[0]:s;if(!a)return;const l=n.getId(i),{clientX:c,clientY:u}=a;e({type:Ze[t],id:l,x:c,y:u})})(s);a.push(be(i,l,t))})),()=>{a.forEach((e=>e()))}}function ot({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){return be("scroll",ke((s=>{const i=tt(s);if(!i||Ee(i,r,o,!0))return;const a=n.getId(i);if(i===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),s.scroll||100),t)}function st(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const it=["INPUT","TEXTAREA","SELECT"],at=new WeakMap;function lt(e){return function(e,t){if(Xe&&e.parentRule instanceof CSSGroupingRule||qe&&e.parentRule instanceof CSSMediaRule||$e&&e.parentRule instanceof CSSSupportsRule||et&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ct(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ut({mirror:e,stylesheetManager:t},n){var r,o,s;let i=null;i="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(s=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=l.set)||void 0===n?void 0:n.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function dt(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=nt(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=ke((t=>{const n=Date.now()-i;e(a.map((e=>(e.timeOffset-=n,e))),t),a=[],i=null}),s),c=ke((e=>{const t=tt(e),{clientX:n,clientY:o}=Fe(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Date.now()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ue.Drag:e instanceof MouseEvent?Ue.MouseMove:Ue.TouchMove)}),o,{trailing:!1}),u=[be("mousemove",c,n),be("touchmove",c,n),be("drag",c,n)];return()=>{u.forEach((e=>e()))}}(e),s=rt(e),i=ot(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return be("resize",ke((()=>{const r=xe(),o=Te();t===r&&n===o||(e({width:Number(o),height:Number(r)}),t=r,n=o)}),200),window)}(e),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(e){let n=tt(e);const l=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||it.indexOf(n.tagName)<0||Ee(n,r,o,!0))return;const u=n.type;if(n.classList.contains(s))return;let h=n.value,p=!1;"radio"===u||"checkbox"===u?p=n.checked:(i[n.tagName.toLowerCase()]||i[u])&&(h=q({maskInputOptions:i,tagName:n.tagName,type:u,value:h,maskInputFn:a})),d(n,st({text:h,isChecked:p,userTriggered:l},c));const m=n.name;"radio"===u&&m&&p&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{e!==n&&d(e,st({text:e.value,isChecked:!p,userTriggered:!1},c))}))}function d(t,r){const o=at.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){at.set(t,r);const o=n.getId(t);e(Object.assign(Object.assign({},r),{id:o}))}}const h=("last"===l.input?["change"]:["input","change"]).map((e=>be(e,u,t))),p=t.defaultView;if(!p)return()=>{h.forEach((e=>e()))};const m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),g=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&h.push(...g.map((e=>we(e[0],e[1],{set(){u({target:this})}},!1,p)))),()=>{h.forEach((e=>e()))}}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){const s=s=>ke((o=>{const i=tt(o);if(!i||Ee(i,t,n,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u}=i;e({type:s,id:r.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u})}),o.media||500),i=[be("play",s(0)),be("pause",s(1)),be("seeked",s(2)),be("volumechange",s(3)),be("ratechange",s(4))];return()=>{i.forEach((e=>e()))}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,s){const{id:i,styleId:a}=ct(this,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:r,index:s}]}),o.apply(this,[r,s])};const s=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:o,styleId:i}=ct(this,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:r}]}),s.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:o,styleId:s}=ct(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:r}),i.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:o,styleId:s}=ct(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:r}),a.apply(this,[r])});const l={};Xe?l.CSSGroupingRule=r.CSSGroupingRule:(qe&&(l.CSSMediaRule=r.CSSMediaRule),et&&(l.CSSConditionRule=r.CSSConditionRule),$e&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach((([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=ct(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...lt(this),s||0]}]}),c[r].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=ct(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...lt(this),o]}]}),c[r].deleteRule.apply(this,[o])}})),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}}(e,{win:n}),d=ut(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var l;if(n.has(o))return s.apply(this,[o,i,a]);const{id:c,styleId:u}=ct(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,set:{property:o,value:i,priority:a},index:lt(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(n.has(o))return i.apply(this,[o]);const{id:a,styleId:l}=ct(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:o},index:lt(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:n}),p=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=Me(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=s})),r.push(i),()=>{r.forEach((e=>e()))}}(e):()=>{},m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:s}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=s;Ee(i,r,o,!0)||Ee(c,r,o,!0)||a.push({start:n.getId(i),startOffset:l,end:n.getId(c),endOffset:u})}s({ranges:a})};return a(),be("selectionchange",a)}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return()=>{Qe.forEach((e=>e.reset())),r.disconnect(),o(),s(),i(),a(),l(),c(),u(),d(),h(),p(),m(),g.forEach((e=>e()))}}class ht{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class pt{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ht(se),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case We.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:We.IncrementalSnapshot,data:{source:Ue.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case We.Meta:case We.Load:case We.DomContentLoaded:return!1;case We.Plugin:return t;case We.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case We.IncrementalSnapshot:switch(t.data.source){case Ue.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ue.Drag:case Ue.TouchMove:case Ue.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ue.ViewportResize:return!1;case Ue.MediaInteraction:case Ue.MouseInteraction:case Ue.Scroll:case Ue.CanvasMutation:case Ue.Input:return this.replaceIds(t.data,e,["id"]),t;case Ue.StyleSheetRule:case Ue.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ue.Font:return t;case Ue.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Ue.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}}class mt{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(Me(Element.prototype,"attachShadow",(function(e){return function(n){const r=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}})))}addShadowRoot(e,t){J(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),nt(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),ot(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),ut({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)}),0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(Me(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(r){const o=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}reset(){this.restorePatches.forEach((e=>e())),this.shadowDoms=new WeakSet}}
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */function gt(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}l((r=r.apply(e,t||[])).next())}))}for(var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",It="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ct=0;Ct<64;Ct++)It[ft.charCodeAt(Ct)]=Ct;const yt=new Map;const vt=(e,t,n)=>{if(!e||!At(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=yt.get(e);return n||(n=new Map,yt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function bt(e,t,n){if(e instanceof Array)return e.map((e=>bt(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=ft[n[t]>>2],o+=ft[(3&n[t])<<4|n[t+1]>>4],o+=ft[(15&n[t+1])<<2|n[t+2]>>6],o+=ft[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[bt(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[bt(e.data,t,n),e.width,e.height]}}if(At(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:vt(e,t,n)}}return e}const St=(e,t,n)=>[...e].map((e=>bt(e,t,n))),At=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function kt(e,t,n){const r=[];try{const o=Me(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r,...o){return Ee(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}}));r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function wt(e,t,n,r,o,s,i){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const l=Me(e,s,(function(e){return function(...a){const l=e.apply(this,a);if(vt(l,i,this),!Ee(this.canvas,r,o,!0)){const e=St([...a],i,this),r={type:t,property:s,args:e};n(this.canvas,r)}return l}}));a.push(l)}catch(r){const o=we(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var Mt=null;try{var xt="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");Mt=xt.Worker}catch(e){}function Tt(e,t,n){var r=void 0===t?null:t,o=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),s=o.indexOf("\n",10)+1,i=o.substring(s)+(r?"//# sourceMappingURL="+r:"");return function(e){return new Mt(i,Object.assign({},e,{eval:!0}))}}function Et(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),s=o.indexOf("\n",10)+1,i=o.substring(s)+(r?"//# sourceMappingURL="+r:""),a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var Nt="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Rt,Ft,Ot,Lt=(Rt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ft=null,Ot=!1,Nt?Tt(Rt,Ft,Ot):function(e,t,n){var r;return function(o){return r=r||Et(e,t,n),new Worker(r,o)}}(Rt,Ft,Ot));class Dt{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const s=kt(t,n,r),i=new Map,a=new Lt;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:Ge["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{Ee(t,n,r,!0)||e.push(t)})),e})().forEach((e=>gt(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=kt(e,t,n),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=Me(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(...s){return Ee(this.canvas,n,r,!0)||setTimeout((()=>{const n=St([...s],t,this);e(this.canvas,{type:Ge["2D"],property:i,args:n})}),0),o.apply(this,s)}}));o.push(s)}catch(n){const r=we(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Ge["2D"],property:i,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r){const o=[];return o.push(...wt(t.WebGLRenderingContext.prototype,Ge.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...wt(t.WebGL2RenderingContext.prototype,Ge.WebGL2,e,n,r,0,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Bt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Be,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map(((e,t)=>({rule:Q(e),index:t})))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Wt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Ut,Zt,Gt,Vt=!1;const Kt=new X;function _t(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:p,maskTextFn:m,hooks:g,packFn:f,sampling:I={},dataURLOptions:C={},mousemoveWait:y,recordCanvas:v=!1,recordCrossOriginIframes:b=!1,userTriggeredOnInput:S=!1,collectFonts:A=!1,inlineImages:k=!1,plugins:w,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:x=new Set([])}=e,T=!b||window.parent===window;let E=!1;if(!T)try{window.parent.document,E=!1}catch(e){E=!0}if(T&&!t)throw new Error("emit function is required");void 0!==y&&void 0===I.mousemove&&(I.mousemove=y),Kt.reset();const N=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},R=!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===h,headMetaDescKeywords:"all"===h}:h||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let O=0;const L=e=>{for(const t of w||[])t.eventProcessor&&(e=t.eventProcessor(e));return f&&(e=f(e)),e};Ut=(e,o)=>{var s;if(!(null===(s=Qe[0])||void 0===s?void 0:s.isFrozen())||e.type===We.FullSnapshot||e.type===We.IncrementalSnapshot&&e.data.source===Ue.Mutation||Qe.forEach((e=>e.unfreeze())),T)null==t||t(L(e),o);else if(E){const t={type:"rrweb",event:L(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===We.FullSnapshot)F=e,O=0;else if(e.type===We.IncrementalSnapshot){if(e.data.source===Ue.Mutation&&e.data.isAttachIframe)return;O++;const t=r&&O>=r,o=n&&e.timestamp-F.timestamp>n;(t||o)&&Zt(!0)}};const D=e=>{Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.Mutation},e)}))},B=e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.Scroll},e)})),W=e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.CanvasMutation},e)})),U=new Bt({mutationCb:D,adoptedStyleSheetCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.AdoptedStyleSheet},e)}))}),Z=new pt({mirror:Kt,mutationCb:D,stylesheetManager:U,recordCrossOriginIframes:b,wrappedEmit:Ut});for(const e of w||[])e.getMirror&&e.getMirror({nodeMirror:Kt,crossOriginIframeMirror:Z.crossOriginIframeMirror,crossOriginIframeStyleMirror:Z.crossOriginIframeStyleMirror});Gt=new Dt({recordCanvas:v,mutationCb:W,win:window,blockClass:o,blockSelector:s,mirror:Kt,sampling:I.canvas,dataURLOptions:C});const G=new mt({mutationCb:D,scrollCb:B,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:N,dataURLOptions:C,maskTextFn:m,maskInputFn:p,recordCanvas:v,inlineImages:k,sampling:I,slimDOMOptions:R,iframeManager:Z,stylesheetManager:U,canvasManager:Gt,keepIframeSrcFn:M},mirror:Kt});Zt=(e=!1)=>{var t,n,r,i,u,d;Ut(Wt({type:We.Meta,data:{href:window.location.href,width:Te(),height:xe()}}),e),U.reset(),Qe.forEach((e=>e.lock()));const h=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new X:r,s=n.blockClass,i=void 0===s?"rr-block":s,a=n.blockSelector,l=void 0===a?null:a,c=n.maskTextClass,u=void 0===c?"rr-mask":c,d=n.maskTextSelector,h=void 0===d?null:d,p=n.inlineStylesheet,m=void 0===p||p,g=n.inlineImages,f=void 0!==g&&g,I=n.recordCanvas,C=void 0!==I&&I,y=n.maskAllInputs,v=void 0!==y&&y,b=n.maskTextFn,S=n.maskInputFn,A=n.slimDOM,k=void 0!==A&&A,w=n.dataURLOptions,M=n.preserveWhiteSpace,x=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,N=n.onStylesheetLoad,R=n.stylesheetLoadTimeout,F=n.keepIframeSrcFn;return ve(e,{doc:e,mirror:o,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:b,maskInputFn:S,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:w,inlineImages:f,recordCanvas:C,preserveWhiteSpace:M,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:N,stylesheetLoadTimeout:R,keepIframeSrcFn:void 0===F?function(){return!1}:F,newlyAddedElement:!1})}(document,{mirror:Kt,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:N,maskTextFn:m,slimDOM:R,dataURLOptions:C,recordCanvas:v,inlineImages:k,onSerialize:e=>{Oe(e,Kt)&&Z.addIframe(e),Le(e,Kt)&&U.trackLinkElement(e),De(e)&&G.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Z.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{U.attachLinkElement(e,t)},keepIframeSrcFn:M});if(!h)return console.warn("Failed to snapshot the document");Ut(Wt({type:We.FullSnapshot,data:{node:h,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(d=null===document||void 0===document?void 0:document.body)||void 0===d?void 0:d.scrollTop)||0}}})),Qe.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&U.adoptStyleSheets(document.adoptedStyleSheets,Kt.getId(document))};try{const e=[];e.push(be("DOMContentLoaded",(()=>{Ut(Wt({type:We.DomContentLoaded,data:{}}))})));const t=e=>{var t;return dt({mutationCb:D,mousemoveCb:(e,t)=>Ut(Wt({type:We.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.MouseInteraction},e)})),scrollCb:B,viewportResizeCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.ViewportResize},e)})),inputCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.Input},e)})),mediaInteractionCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.MediaInteraction},e)})),styleSheetRuleCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.StyleSheetRule},e)})),styleDeclarationCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.StyleDeclaration},e)})),canvasMutationCb:W,fontCb:e=>Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.Font},e)})),selectionCb:e=>{Ut(Wt({type:We.IncrementalSnapshot,data:Object.assign({source:Ue.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:N,inlineStylesheet:c,sampling:I,recordCanvas:v,inlineImages:k,userTriggeredOnInput:S,collectFonts:A,doc:e,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:R,dataURLOptions:C,mirror:Kt,iframeManager:Z,stylesheetManager:U,shadowDomManager:G,canvasManager:Gt,ignoreCSSAttributes:x,plugins:(null===(t=null==w?void 0:w.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Ut(Wt({type:We.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},g)};Z.addLoadListener((n=>{e.push(t(n.contentDocument))}));const n=()=>{Zt(),e.push(t(document)),Vt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(be("load",(()=>{Ut(Wt({type:We.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e())),Vt=!1}}catch(e){console.warn(e)}}_t.addCustomEvent=(e,t)=>{if(!Vt)throw new Error("please add custom event after start recording");Ut(Wt({type:We.Custom,data:{tag:e,payload:t}}))},_t.freezePage=()=>{Qe.forEach((e=>e.freeze()))},_t.takeFullSnapshot=e=>{if(!Vt)throw new Error("please take full snapshot after start recording");Zt(e)},_t.mirror=Kt;class Pt{constructor(e){this.buffer=[],this.index=0,this.visibilityHandler=()=>{this.handleVisibilityChange()},document.addEventListener("visibilitychange",this.visibilityHandler,!0),this.timerHandle=setInterval((()=>{2!==this.buffer.length&&(this.recordCapture(),this.restartCapture())}),e.intervalMs),this.startCapture()}register(e,t){this.telemetry=e,this.sessionId=t}unregister(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.telemetry=void 0,document.removeEventListener("visibilitychange",this.visibilityHandler),clearInterval(this.timerHandle)}handleVisibilityChange(){"hidden"===document.visibilityState&&(this.recordCapture(),this.restartCapture())}recordCapture(){this.telemetry&&this.sessionId&&this.telemetry.captureSession({id:this.sessionId,events:[...this.buffer],index:this.index}),this.index+=1}startCapture(){const{buffer:e}=this;this.stopper=_t({emit:t=>{e.push(t)}})}restartCapture(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.buffer.length=0,this.startCapture()}}class Yt{constructor(e){this.content=[],this.size=e}push(e){this.content.length<this.size&&this.content.push(e)}hasSpace(){return this.content.length<this.size}isPopulated(){return 0!==this.content.length}clear(){this.content=[]}}class zt{constructor(e,t){this.buffers=[],this.writePointer=0,this.headPointer=0;for(let n=0;n<t;n+=1)this.buffers.push(new Yt(e))}push(e){const t=this.buffers[this.writePointer];if(!t.hasSpace())return this.writePointer<this.buffers.length-1?this.writePointer+=1:this.writePointer=0,this.buffers[this.writePointer].clear(),this.writePointer===this.headPointer&&(this.headPointer+=1,this.headPointer>=this.buffers.length-1&&(this.headPointer=0)),void this.push(e);t.push(e)}toArray(){const e=[],t=this.buffers.reduce(((e,t)=>t.isPopulated()?e+1:e),0);for(let n=this.headPointer;n<this.headPointer+t;n+=1){const t=n%this.buffers.length;e.push(...this.buffers[t].content)}return e}reset(){this.writePointer=0,this.headPointer=0,this.buffers.forEach((e=>e.clear()))}}class jt{constructor(e){this.options=e,this.index=0,this.buffer=new zt(e.eventSegmentLength,e.segmentBufferLength),this.startCapture()}startCapture(){this.stopper=_t({checkoutEveryNth:this.options.eventSegmentLength,emit:e=>{this.buffer.push(e)}})}register(e,t){this.telemetry=e,this.sessionId=t}unregister(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.telemetry=void 0}capture(){var e;this.telemetry&&this.sessionId&&(null===(e=this.telemetry)||void 0===e||e.captureSession({id:this.sessionId,events:this.buffer.toArray(),index:this.index})),this.index+=1,this.restartCapture()}restartCapture(){var e;this.buffer.reset(),null===(e=this.stopper)||void 0===e||e.call(this),this.startCapture()}}function Jt(e,t){return null!=e?e:t}function Ht(e,t){if(!1===e)return{instrumentFetch:!1,instrumentXhr:!1};const n=(null==e?void 0:e.customUrlFilter)&&"function"==typeof(null==e?void 0:e.customUrlFilter)?e.customUrlFilter:void 0;return{instrumentFetch:Jt(null==e?void 0:e.instrumentFetch,t.instrumentFetch),instrumentXhr:Jt(null==e?void 0:e.instrumentFetch,t.instrumentXhr),customUrlFilter:n}}function Qt(e,t){var n,r,o;return{source:{beforeLines:Jt(null===(n=null==e?void 0:e.source)||void 0===n?void 0:n.beforeLines,t.source.beforeLines),afterLines:Jt(null===(r=null==e?void 0:e.source)||void 0===r?void 0:r.afterLines,t.source.afterLines),maxLineLength:Jt(null===(o=null==e?void 0:e.source)||void 0===o?void 0:o.maxLineLength,t.source.maxLineLength)}}}exports.SessionReplay=class{constructor(e){const t=null==e?void 0:e.capture;var n;"continuous"===(null==(n=t)?void 0:n.type)?this.impl=new Pt(t):!function(e){return"rolling"===(null==e?void 0:e.type)}(t)?this.impl=new Pt({type:"continuous",intervalMs:5e3}):this.impl=new jt(t)}register(e,t){this.impl.register(e,t)}unregister(){this.impl.unregister()}handleFlagUsed(e,t,n){_t.addCustomEvent("flag-used",{key:e,detail:t})}handleFlagDetailChanged(e,t){_t.addCustomEvent("flag-detail-changed",{key:e,detail:t})}handleErrorEvent(e,t){_t.addCustomEvent("error",{name:e,message:t})}},exports.initializeTelemetry=function(e){const t=function(e){var t,n,r,o,s,i;const a={breadcrumbs:{maxBreadcrumbs:50,evaluations:!0,flagChange:!0,click:!0,keyboardInput:!0,http:{instrumentFetch:!0,instrumentXhr:!0}},stack:{source:{beforeLines:3,afterLines:3,maxLineLength:280}},maxPendingEvents:100,collectors:[]};return{breadcrumbs:{maxBreadcrumbs:Jt(null===(t=e.breadcrumbs)||void 0===t?void 0:t.maxBreadcrumbs,a.breadcrumbs.maxBreadcrumbs),evaluations:Jt(null===(n=e.breadcrumbs)||void 0===n?void 0:n.evaluations,a.breadcrumbs.evaluations),flagChange:Jt(null===(r=e.breadcrumbs)||void 0===r?void 0:r.flagChange,a.breadcrumbs.flagChange),click:Jt(null===(o=e.breadcrumbs)||void 0===o?void 0:o.click,a.breadcrumbs.click),keyboardInput:Jt(null===(s=e.breadcrumbs)||void 0===s?void 0:s.keyboardInput,a.breadcrumbs.keyboardInput),http:Ht(null===(i=e.breadcrumbs)||void 0===i?void 0:i.http,a.breadcrumbs.http)},stack:Qt(e.stack,a.stack),maxPendingEvents:Jt(e.maxPendingEvents,a.maxPendingEvents),collectors:[...Jt(e.collectors,a.collectors)]}}(e||{});return new Y(t)};
21
- //# sourceMappingURL=bundle.cjs.js.map