@xysfe/memento-core
Version:
record and replay the web
15 lines (13 loc) • 156 kB
JavaScript
var mementoCore=function(e){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!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"}(t||(t={}));var l=1,c=RegExp("[^a-z1-6-]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce((function(e,t){return e+(function(e){return"styleSheet"in e}(n=t)?u(n.styleSheet)||"":n.cssText);var n}),""):null}catch(e){return null}}var d=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,f=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,h=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function g(e,t){return(e||"").replace(d,(function(e,n,r,i){var a,o=n||r||i;if(!o)return e;if(!f.test(o))return"url('"+o+"')";if(h.test(o))return"url("+o+")";if("/"===o[0])return"url('"+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+o+"')");var s=t.split("/"),l=o.split("/");s.pop();for(var c=0,u=l;c<u.length;c++){var d=u[c];"."!==d&&(".."===d?s.pop():s.push(d))}return"url('"+s.join("/")+"')"}))}function p(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function m(e,t,n){return"src"===t||"href"===t&&n?p(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?p(e,n[0])+" "+n[1]:1===n.length?""+p(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?g(n,location.href):n}function v(e,n,r,i,a,o,s){switch(void 0===a&&(a={}),void 0===o&&(o=[]),void 0===s&&(s=!1),e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var l=!1,d="";"string"==typeof r?l=e.classList.contains(r):e.classList&&e.classList.forEach&&e.classList.forEach((function(e){r.test(e)&&(l=!0)}));var f=function(e){var t=e.toLowerCase().trim();return c.test(t)?"div":t}(e.tagName);if(!l)for(var h=0,p=o;h<p.length;h++){var v=p[h];if(f===v.tagName){l=!0,v.placeholder&&(d=v.placeholder);break}}for(var y={},I=0,C=Array.from(e.attributes);I<C.length;I++){var b=C[I],A=b.name,w=b.value;y[A]=m(n,A,w);var _="img"===f&&"src"===A||"link"===f&&"href"===A,S=e.rel;!_||("dns-prefetch"===S||"preload"===S)||/^data:image/i.test(y[A])||(y["_memimage_"+A]=y[A])}var k=e.rel;if("link"===f&&!("dns-prefetch"===k||"preload"===k||"prefetch"===k)&&i){var x,E=Array.from(n.styleSheets).find((function(t){return t.href===e.href}));(x=u(E))&&(delete y.rel,delete y.href,"_memimage_href"in y&&delete y._memimage_href,y._cssText=g(x,E.href))}if("style"===f&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(x=u(e.sheet))&&(y._cssText=g(x,location.href));if("input"===f||"textarea"===f||"select"===f){w=e.value;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&w?y.value=a[y.type]||a[f]?"*".repeat(w.length):w:e.checked&&(y.checked=e.checked)}if("option"===f){var N=e.parentElement;y.value===N.value&&(y.selected=e.selected)}if("canvas"===f&&s&&(y.mem_dataURL=e.toDataURL()),e.scrollLeft&&(y.mem_scrollLeft=e.scrollLeft),e.scrollTop&&(y.mem_scrollTop=e.scrollTop),l){var T=e.getBoundingClientRect(),B=T.width,M=T.height;y.mem_width=B+"px",y.mem_height=M+"px",d&&(y.mem_placeholder=d)}return{type:t.Element,tagName:f,attributes:y,childNodes:[],isSVG:(O=e,"svg"===O.tagName||O instanceof SVGElement||void 0),needBlock:l};case e.TEXT_NODE:var R=e.parentNode&&e.parentNode.tagName,D=e.textContent,F="STYLE"===R||void 0;return F&&D&&(D=g(D,location.href)),"SCRIPT"===R&&(D="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:D||"",isStyle:F};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var O}function y(e,n,r,i,a,o,s,c,u){void 0===a&&(a=!1),void 0===o&&(o=!0),void 0===c&&(c=[]),void 0===u&&(u=!1);var d,f=v(e,n,i,o,s,c,u);if(!f)return console.warn(e,"not serialized"),null;d="__sn"in e?e.__sn.id:l++;var h=Object.assign(f,{id:d});e.__sn=h,r[d]=e;var g=!a;if(h.type===t.Element&&(g=g&&!h.needBlock,delete h.needBlock),(h.type===t.Document||h.type===t.Element)&&g)for(var p=0,m=Array.from(e.childNodes);p<m.length;p++){var I=y(m[p],n,r,i,a,o,s,c,u);I&&h.childNodes.push(I)}return h}var I=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function C(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),h(),t}}var o=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};o.prototype.content=e;var s=[];function l(i){var a=new Error(t.source+":"+n+":"+r+": "+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a;s.push(a)}function c(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,n=[];for(h(),g(n);e.length&&"}"!==e.charAt(0)&&(t=x()||E());)!1!==t&&(n.push(t),g(n));return n}function f(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function h(){f(/^\s*/)}function g(e){var t;for(void 0===e&&(e=[]);t=p();)!1!==t&&e.push(t),t=p();return e}function p(){var t=a();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:"comment",comment:o})}}function m(){var e=f(/^([^{]+)/);if(e)return b(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){var e=a(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=b(t[0]);if(!f(/^:\s*/))return l("property missing ':'");var r=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(I,""),value:r?b(r[0]).replace(I,""):""});return f(/^[;\s]*/),i}}function y(){var e,t=[];if(!c())return l("missing '{'");for(g(t);e=v();)!1!==e&&(t.push(e),g(t)),e=v();return u()?t:l("missing '}'")}function C(){for(var e,t=[],n=a();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:y()})}var A,w=k("import"),_=k("charset"),S=k("namespace");function k(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=a(),r=f(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function x(){if("@"===e[0])return function(){var e=a(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=f(/^([-\w]+)\s*/)))return l("@keyframes missing name");var r,i=t[1];if(!c())return l("@keyframes missing '{'");for(var o=g();r=C();)o.push(r),o=o.concat(g());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:o}):l("@keyframes missing '}'")}}()||function(){var e=a(),t=f(/^@media *([^{]+)/);if(t){var n=b(t[1]);if(!c())return l("@media missing '{'");var r=g().concat(d());return u()?e({type:"media",media:n,rules:r}):l("@media missing '}'")}}()||function(){var e=a(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:b(t[1]),media:b(t[2])})}()||function(){var e=a(),t=f(/^@supports *([^{]+)/);if(t){var n=b(t[1]);if(!c())return l("@supports missing '{'");var r=g().concat(d());return u()?e({type:"supports",supports:n,rules:r}):l("@supports missing '}'")}}()||w()||_()||S()||function(){var e=a(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var n=b(t[1]),r=b(t[2]);if(!c())return l("@document missing '{'");var i=g().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:i}):l("@document missing '}'")}}()||function(){var e=a();if(f(/^@page */)){var t=m()||[];if(!c())return l("@page missing '{'");for(var n,r=g();n=v();)r.push(n),r=r.concat(g());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}}()||function(){var e=a();if(f(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=g().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=a();if(f(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,n=g();t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}}()}function E(){var e=a(),t=m();return t?(g(),e({type:"rule",selectors:t,declarations:y()})):l("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,i=r?t:n,a=0,o=Object.keys(t);a<o.length;a++){var s=o[a],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,i)})):l&&"object"==typeof l&&e(l,i)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((A=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:A,parsingErrors:s}}))}function b(e){return e?e.replace(/^\s+|\s+$/g,""):""}var A={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var w=/([^\\]):hover/g,_=/(\s|;|\{)inset\s*:([^;}]+)/gi;function S(e){var t=C(e,{silent:!0});return t.stylesheet&&t.stylesheet.rules?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(w.test(t)){var n=t.replace(w,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e.replace(_,"$1top: $2; right: $2; bottom: $2; left: $2;")):e}var k,x,E,N,T,B,M,R,D=/url\((data:image\/svg\+xml;charset=[\w-].*?)\)\s*(;|\}|$)/gi;function F(e){return e?e.replace(D,(function(e,t,n){return'url("'+t+'")'+n})):e}function O(e,n,r,i){switch(void 0===i&&(i=!0),e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var a,o=function(e){var t=A[e.tagName]?A[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);a=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";if(e.attributes.hasOwnProperty("_memimage_"+t))return"continue";var s=e.attributes[t];s="boolean"==typeof s||"number"==typeof s?"":s;var l=t;if((t=t.replace("_memimage_","")).startsWith("mem_")){if("canvas"===o&&"mem_dataURL"===t){var c=document.createElement("img");c.src=s,c.onload=function(){var e=a.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}"mem_imgwidth"===t||"mem_width"===t?a.style.width=s:"mem_imgheight"===t||"mem_height"===t?a.style.height=s:"video"===o&&"mem_placeholder"===l&&(a.style.background="center / cover no-repeat url("+s+") !important")}else{var u="textarea"===o&&"value"===t,d="style"===o&&"_cssText"===t;if(d&&r&&(s=F(s=S(s))),u||d){for(var f=n.createTextNode(s),h=0,g=Array.from(a.childNodes);h<g.length;h++){var p=g[h];p.nodeType===a.TEXT_NODE&&a.removeChild(p)}return a.appendChild(f),"continue"}if("iframe"===o&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?a.setAttributeNS("http://www.w3.org/1999/xlink",t,s):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?a.setAttribute("_"+t,s):(i&&"link"===o&&"_memimage_href"===l&&s&&s.match(/memento\.oss/)&&(s=s.replace(/^http\:\/\//,"https://")),a.setAttribute(t,s))}catch(e){}}};for(var l in e.attributes)s(l);return a;case t.Text:var c=e.isStyle?F(e.textContent):e.textContent;return n.createTextNode(e.isStyle&&r?S(c):c);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function Z(e,n,r,i,a,o){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=!0);var s=O(e,n,a,o);if(!s)return null;if(e.type===t.Document&&(n.close(),n.open(),s=n),s.__sn=e,r[e.id]=s,(e.type===t.Document||e.type===t.Element)&&!i)for(var l=0,c=e.childNodes;l<c.length;l++){var u=c[l],d=Z(u,n,r,!1,a,o);d?s.appendChild(d):console.warn("Failed to rebuild",u)}return s}function z(e,n,r,i){void 0===r&&(r=!0),void 0===i&&(i=!0);var a={},o=Z(e,n,a,!1,r,i);return function(e){for(var n in e){var r=e[n],i=r.__sn;if(i.type===t.Element){var a=r;for(var o in i.attributes)if(i.attributes.hasOwnProperty(o)&&o.startsWith("mem_")){var s=i.attributes[o];"mem_scrollLeft"===o&&(a.scrollLeft=s),"mem_scrollTop"===o&&(a.scrollTop=s)}}}}(a),[o,a]}function L(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}e.EventType=void 0,(k=e.EventType||(e.EventType={}))[k.DomContentLoaded=0]="DomContentLoaded",k[k.Load=1]="Load",k[k.FullSnapshot=2]="FullSnapshot",k[k.IncrementalSnapshot=3]="IncrementalSnapshot",k[k.Meta=4]="Meta",k[k.PageChange=5]="PageChange",k[k.Custom=9]="Custom",k[k.Other=99]="Other",e.IncrementalSource=void 0,(x=e.IncrementalSource||(e.IncrementalSource={}))[x.Mutation=0]="Mutation",x[x.MouseMove=1]="MouseMove",x[x.MouseInteraction=2]="MouseInteraction",x[x.Scroll=3]="Scroll",x[x.ViewportResize=4]="ViewportResize",x[x.Input=5]="Input",x[x.TouchMove=6]="TouchMove",x[x.MediaInteraction=7]="MediaInteraction",x[x.StyleSheetRule=8]="StyleSheetRule",x[x.CanvasMutation=9]="CanvasMutation",x[x.Drag=10]="Drag",x[x.UserDefinedEvent=11]="UserDefinedEvent",function(e){e[e.LivePlay=0]="LivePlay"}(E||(E={})),function(e){e[e.Console=1]="Console",e[e.Network=2]="Network"}(N||(N={})),e.MouseInteractions=void 0,(T=e.MouseInteractions||(e.MouseInteractions={}))[T.MouseUp=0]="MouseUp",T[T.MouseDown=1]="MouseDown",T[T.Click=2]="Click",T[T.ContextMenu=3]="ContextMenu",T[T.DblClick=4]="DblClick",T[T.Focus=5]="Focus",T[T.Blur=6]="Blur",T[T.TouchStart=7]="TouchStart",T[T.TouchMove_Departed=8]="TouchMove_Departed",T[T.TouchEnd=9]="TouchEnd",function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(B||(B={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(M||(M={})),e.ReplayerEvents=void 0,(R=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",R.Pause="pause",R.Resume="resume",R.Resize="resize",R.Finish="finish",R.FullsnapshotRebuilded="fullsnapshot-rebuilded",R.LoadStylesheetStart="load-stylesheet-start",R.LoadStylesheetEnd="load-stylesheet-end",R.SkipStart="skip-start",R.SkipEnd="skip-end",R.MouseInteraction="mouse-interaction",R.EventCast="event-cast",R.CustomEvent="custom-event",R.Flush="flush",R.AddEvents="add-events";var G={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return G.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete G.map[t],e.childNodes&&e.childNodes.forEach((function(e){return G.removeNodeFromMap(e)}))},has:function(e){return G.map.hasOwnProperty(e)}};function W(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(a){var o=Date.now();i||!1!==n.leading||(i=o);var s=t-(o-i),l=this,c=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),i=o,e.apply(l,c)):r||!1===n.trailing||(r=window.setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(l,c)}),s))}}function V(e,t,n,r,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return V(e,t,a||{},!0)}}function U(e,t,n){if(!(t in e))return function(){};var r=e[t],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__memento_original__:{enumerable:!1,value:r}})}catch(e){}return e[t]=i,function(){e[t]=r}}function K(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function X(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function H(e,t,n){var r,i;if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var o=!1;if("string"==typeof t?o=e.classList.contains(t):e.classList&&e.classList&&e.classList.forEach((function(e){t.test(e)&&(o=!0)})),!o&&e.tagName&&n)try{for(var s=a(n),l=s.next();!l.done;l=s.next()){if(l.value.tagName===e.tagName.toLowerCase()){o=!0;break}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o||H(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,H(e.parentNode,t,n)}function Y(e){var t=G.getId(e);return!G.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Y(e.parentNode))}function P(e){return Boolean(e.changedTouches)}function J(){"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)}function j(e,t){var n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var r in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+r+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return t}function Q(t){switch(t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:case e.EventType.PageChange:case e.EventType.Custom:return!1;case e.EventType.FullSnapshot:case e.EventType.Meta:return!0}switch(t.data.source){case e.IncrementalSource.MouseMove:case e.IncrementalSource.MouseInteraction:case e.IncrementalSource.TouchMove:case e.IncrementalSource.MediaInteraction:return!1;case e.IncrementalSource.ViewportResize:case e.IncrementalSource.StyleSheetRule:case e.IncrementalSource.Scroll:case e.IncrementalSource.Input:return!0}return!0}var q=function(){function t(){this.reset()}return t.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},t.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),i=function(e){t.removeIdSet.add(e);var n=G.getNode(e);null==n||n.childNodes.forEach((function(e){return i(e.__sn.id)}))},a=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return a(e)}));var r=t.indexes.get(n.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),a(r)):(delete this.tree[r.id],this.indexes.delete(r.id),a(r)):(this.removeNodeMutations.push(e),i(e.id))},t.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},t.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},t.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},t.prototype.input=function(e){this.inputMap.set(e.id,e)},t.prototype.flush=function(){var t,n,r,i,o=this,s=this.tree,l=this.removeNodeMutations,c=this.textMutations,u=this.attributeMutations,d={source:e.IncrementalSource.Mutation,removes:l,texts:c,attributes:u,adds:[]},f=function(e,t){t&&o.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),d.attributes=d.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(s).forEach((function(e){return f(e,!1)}));try{for(var h=a(this.scrollMap.keys()),g=h.next();!g.done;g=h.next()){var p=g.value;this.removeIdSet.has(p)&&this.scrollMap.delete(p)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}try{for(var m=a(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){p=v.value;this.removeIdSet.has(p)&&this.inputMap.delete(p)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}var y=new Map(this.scrollMap),I=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:y,inputMap:I}},t.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},t}();function $(e){return"[object Number]"==Object.prototype.toString.call(e)}function ee(e){return"[object String]"==Object.prototype.toString.call(e)}function te(e){return"[object Array]"==Object.prototype.toString.call(e)}function ne(e){return"[object Boolean]"==Object.prototype.toString.call(e)}function re(e){return void 0===e}function ie(e){return null===e}function ae(e){return"[object Symbol]"==Object.prototype.toString.call(e)}function oe(e){return!("[object Object]"!=Object.prototype.toString.call(e)&&($(e)||ee(e)||ne(e)||te(e)||ie(e)||se(e)||re(e)||ae(e)))}function se(e){return"[object Function]"==Object.prototype.toString.call(e)}function le(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function ce(e){var t=Object.prototype.toString.call(e);return"[object global]"==t||"[object Window]"==t||"[object DOMWindow]"==t}function ue(e){var t,n=Object.prototype.hasOwnProperty;if(!e||"object"!=typeof e||e.nodeType||ce(e))return!1;try{if(e.constructor&&!n.call(e,"constructor")&&!n.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(t in e);return void 0===t||n.call(e,t)}function de(e,t){var n,r,i=null===(r=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=i.getBoundingClientRect(),o=de(i,t),s=a.height/i.clientHeight;return{x:a.x*o.relativeScale+o.x,y:a.y*o.relativeScale+o.y,relativeScale:s,absoluteScale:o.absoluteScale*s}}var fe=Object.freeze({__proto__:null,on:L,mirror:G,throttle:W,hookSetter:V,patch:U,getWindowHeight:K,getWindowWidth:X,isBlocked:H,isAncestorRemoved:Y,isTouchEvent:P,polyfill:J,dateFormat:j,needCastInSyncMode:Q,TreeIndex:q,isNumber:$,isString:ee,isArray:te,isBoolean:ne,isUndefined:re,isNull:ie,isSymbol:ae,isObject:oe,isFunction:se,isElement:le,isWindow:ce,isPlainObject:ue,getBaseDimension:de}),he=function(e,t){return e+"@"+t};function ge(e){return"__sn"in e}function pe(e){return"__ln"in e}var me=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var 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&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){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++},e.prototype.removeNode=function(e){var 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--)},e}(),ve=function(e,t,n,r,i,o){var l=this;void 0===i&&(i=[]),this.texts=[],this.attributes=[],this.removes=[],this.adds=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){var t,n,r,i,o,c,u,d;l.reset(),e.forEach(l.processMutation);var f=l.texts,h=l.attributes,g=l.removes,p=l.adds,m=l.addedSet,v=l.movedSet,I=l.droppedSet,C=s(m,v),b=[],A=new me,w=function(e){var t=e.nextSibling&&G.getId(e.nextSibling);return-1===t&&H(e.nextSibling,l.blockClass)&&(t=null),t},_=!1;if(l.asyncClass){try{for(var S=a(C),k=S.next();!k.done;k=S.next())if(H(k.value.parentNode,l.asyncClass)){_=!0;break}}catch(e){t={error:e}}finally{try{k&&!k.done&&(n=S.return)&&n.call(S)}finally{if(t)throw t.error}}if(!_)try{for(var x=a(h),E=x.next();!E.done;E=x.next())if(H(E.value.node.parentNode,l.asyncClass)){_=!0;break}}catch(e){r={error:e}}finally{try{E&&!E.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}}var N=function(e){if(e.parentNode){var t=G.getId(e.parentNode),n=w(e);if(-1===t||-1===n)return A.addNode(e);p.push({parentId:t,nextId:n,node:y(e,document,G.map,l.blockClass,!0,l.inlineStylesheet,l.maskInputOptions,l.blockElements)})}},T=function(e){_?b.push(new Promise((function(t){l.requestIdleCallback((function(){N(e),t()}))}))):N(e)};try{for(var B=a(v),M=B.next();!M.done;M=B.next())T(F=M.value)}catch(e){o={error:e}}finally{try{M&&!M.done&&(c=B.return)&&c.call(B)}finally{if(o)throw o.error}}try{for(var R=a(m),D=R.next();!D.done;D=R.next()){var F;Ce(I,F=D.value)||Ie(g,F)?Ce(v,F)?T(F):I.add(F):T(F)}}catch(e){u={error:e}}finally{try{D&&!D.done&&(d=R.return)&&d.call(R)}finally{if(u)throw u.error}}var O=function(){for(var e=null;A.length;){var t=null;if(e){var n=G.getId(e.value.parentNode),r=w(e.value);-1!==n&&-1!==r&&(t=e)}if(!t)for(var i=A.length-1;i>=0;i--){var a=A.get(i);if(n=G.getId(a.value.parentNode),r=w(a.value),-1!==n&&-1!==r){t=a;break}}if(!t){for(;A.head;)A.removeNode(A.head.value);break}e=t.previous,A.removeNode(t.value),N(t.value)}};if(_){var Z=Date.now();Promise.all(b).then((function(){O(),l.emit(f,h,g,p,Z)}))}else O(),l.emit(f,h,g,p)},this.emit=function(e,t,n,r,i){var a={texts:e.map((function(e){return{id:G.getId(e.node),value:e.value}})).filter((function(e){return G.has(e.id)})),attributes:t.map((function(e){return{id:G.getId(e.node),attributes:e.attributes}})).filter((function(e){return G.has(e.id)})),removes:n,adds:r,timestamp:i};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&l.emissionCallback(a)},this.processMutation=function(e){switch(e.type){case"characterData":var t=e.target.textContent;H(e.target,l.blockClass,l.blockElements)||t===e.oldValue||l.texts.push({value:t,node:e.target});break;case"attributes":if(t=e.target.getAttribute(e.attributeName),H(e.target,l.blockClass,l.blockElements)||t===e.oldValue)return;var n=l.attributes.find((function(t){return t.node===e.target}));n||(n={node:e.target,attributes:{}},l.attributes.push(n)),n.attributes[e.attributeName]=m(document,e.attributeName,t);var r=e.target.tagName.toLowerCase().trim(),i="img"===r&&"src"===e.attributeName||"link"===r&&"href"===e.attributeName,a=e.target.rel;!i||"dns-prefetch"===a||"preload"===a||/^data:image/i.test(n.attributes[e.attributeName])||(n.attributes["_memimage_"+e.attributeName]=n.attributes[e.attributeName]);break;case"childList":e.addedNodes.forEach((function(t){return l.genAdds(t,e.target)})),e.removedNodes.forEach((function(t){var n=G.getId(t),r=G.getId(e.target);H(t,l.blockClass,l.blockElements)||H(e.target,l.blockClass,l.blockElements)||(l.addedSet.has(t)?(ye(l.addedSet,t),l.droppedSet.add(t)):l.addedSet.has(e.target)&&-1===n||Y(e.target)||(l.movedSet.has(t)&&l.movedMap[he(n,r)]?ye(l.movedSet,t):l.removes.push({parentId:r,id:n})),G.removeNodeFromMap(t))}))}},this.genAdds=function(e,t){if(!H(e.parentNode,l.blockClass,l.blockElements)){if(ge(e)){l.movedSet.add(e);var n=null;t&&ge(t)&&(n=t.__sn.id),n&&(l.movedMap[he(e.__sn.id,n)]=!0)}else l.addedSet.add(e),l.droppedSet.delete(e);e.childNodes.forEach((function(e){return l.genAdds(e)}))}},this.reset=function(){l.texts=[],l.attributes=[],l.removes=[],l.adds=[],l.addedSet=new Set,l.movedSet=new Set,l.droppedSet=new Set,l.movedMap={}},this.requestIdleCallback=function(e,t){if(window.requestIdleCallback)window.requestIdleCallback(e,t);else{var n=(t||{timeout:0}).timeout;window.setTimeout(e,n)}},this.blockClass=t,this.blockElements=i,this.asyncClass=o,this.inlineStylesheet=n,this.maskInputOptions=r,this.emissionCallback=e};function ye(e,t){e.delete(t),t.childNodes.forEach((function(t){return ye(e,t)}))}function Ie(e,t){var n=t.parentNode;if(!n)return!1;var r=G.getId(n);return!!e.some((function(e){return e.id===r}))||Ie(e,n)}function Ce(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Ce(e,n))}var be=window.matchMedia("(orientation: portrait)"),Ae=be.matches;function we(t,n,r,i){if(void 0===i&&(i=[]),!1===r.mouseInteraction)return function(){};var a=!0===r.mouseInteraction||void 0===r.mouseInteraction?{}:r.mouseInteraction,o=[];return Object.keys(e.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(r){var a=r.toLowerCase(),s=function(r){return function(a){if(!H(a.target,n,i)){var o=G.getId(a.target),s=P(a)?a.changedTouches[0]:a,l=s.clientX,c=s.clientY;t({type:e.MouseInteractions[r],id:o,x:l,y:c})}}}(r);o.push(L(a,s))})),function(){o.forEach((function(e){return e()}))}}var _e=["INPUT","TEXTAREA","SELECT"],Se=new WeakMap;function ke(t,r){void 0===r&&(r={}),function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,l=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,s(e)),n.apply(void 0,s(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,s(e)),r.apply(void 0,s(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,s(e)),i.apply(void 0,s(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,s(e)),a.apply(void 0,s(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,s(e)),o.apply(void 0,s(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,s(e)),l.apply(void 0,s(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,s(e)),c.apply(void 0,s(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,s(e)),u.apply(void 0,s(e))}}(t,r);var i,a,o,l,c=function(e,t,n,r,i,a){void 0===i&&(i=[]);var o=new ve(e,t,n,r,i,a),s=new MutationObserver(o.processMutations);return s.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}(t.mutationCb,t.blockClass,t.inlineStylesheet,t.maskInputOptions,t.blockElements,t.asyncClass),u=function(t,n){if(!1===n.mousemove)return function(){};var r,i="number"==typeof n.mousemove?n.mousemove:50,a=[],o=W((function(n){var i=Date.now()-r;t(a.map((function(e){return e.timeOffset-=i,e})),n?e.IncrementalSource.TouchMove:e.IncrementalSource.MouseMove),a=[],r=null}),500),s=W((function(e){var t=e.target,n=P(e)?e.changedTouches[0]:e,i=n.clientX,s=n.clientY;r||(r=Date.now()),a.push({x:i,y:s,id:G.getId(t),timeOffset:Date.now()-r}),o(P(e))}),i,{trailing:!1}),l=[L("mousemove",s),L("touchmove",s)];return function(){l.forEach((function(e){return e()}))}}(t.mousemoveCb,t.sampling),d=we(t.mouseInteractionCb,t.blockClass,t.sampling,t.blockElements),f=(i=t.scrollCb,a=t.blockClass,o=t.sampling,void 0===(l=t.blockElements)&&(l=[]),L("scroll",W((function(e){if(e.target&&!H(e.target,a,l)){var t=G.getId(e.target);if(e.target===document){var n=document.scrollingElement||document.documentElement;i({id:t,x:n.scrollLeft,y:n.scrollTop})}else i({id:t,x:e.target.scrollLeft,y:e.target.scrollTop})}}),o.scroll||100))),h=function(e){return L("resize",W((function(){var t=K(),n=X();e({width:Number(n),height:Number(t),rotate:Ae!==be.matches?1:0}),Ae=be.matches}),200),window)}(t.viewportResizeCb),g=function(e,t,r,i,a,o){function l(e){var n=e.target;if(n&&n.tagName&&!(_e.indexOf(n.tagName)<0)&&!H(n,t,o)){var a=n.type;if("password"!==a&&!n.classList.contains(r)){var s=n.value,l=!1;"radio"===a||"checkbox"===a?l=n.checked:(i[n.tagName.toLowerCase()]||i[a])&&(s="*".repeat(s.length)),c(n,{text:s,isChecked:l});var u=n.name;"radio"===a&&u&&l&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach((function(e){e!==n&&c(e,{text:e.value,isChecked:!l})}))}}}function c(t,r){var i=Se.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Se.set(t,r);var a=G.getId(t);e(n(n({},r),{id:a}))}}void 0===o&&(o=[]);var u=("last"===a.input?["change"]:["input","change"]).map((function(e){return L(e,l)})),d=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),f=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return d&&d.set&&u.push.apply(u,s(f.map((function(e){return V(e[0],e[1],{set:function(){l({target:this})}})})))),function(){u.forEach((function(e){return e()}))}}(t.inputCb,t.blockClass,t.ignoreClass,t.maskInputOptions,t.sampling);!function(e,t,n){void 0===n&&(n=[]);var r=function(r){return function(i){var a=i.target;a&&!H(a,t,n)&&e({type:"play"===r?M.Play:M.Pause,id:G.getId(a)})}},i=[L("play",r("play")),L("pause",r("pause"))]}(t.mediaInteractionCb,t.blockClass,t.blockElements);var p,m,v,y=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,r){var i=G.getId(this.ownerNode);return-1!==i&&e({id:i,adds:[{rule:n,index:r}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var r=G.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(t.styleSheetRuleCb),I=(p=t.userDefinedEventCb,v=[L("memento-live-play",(m=E.LivePlay,function(e){if("detail"in e&&e.detail){var t=e.detail;p(n({evt:m},t))}}))],function(){v.forEach((function(e){return e()}))});return function(){c.disconnect(),u(),d(),f(),h(),g(),y(),I()}}function xe(e,t){!function(e,t){void 0===t&&(t={});var n=e.consoleCb,r=e.networkCb;e.consoleCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.console&&t.console.apply(t,s(e)),n.apply(void 0,s(e))},e.networkCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.network&&t.network.apply(t,s(e)),r.apply(void 0,s(e))}}(e,t);var n=function(e){var t={},n=["script","img","link","video","audio"],r=["log","info","warn","error"],i=[];window.console?r.map((function(e){t[e]=window.console[e]})):window.console={},r.map((function(n){window.console[n]=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];t[n].apply(window.console,r);for(var a=r,o=0;o<a.length;o++)te(a[o])?a[o]="[Array]":le(a[o])?a[o]="[HTMLElement]":se(a[o])?a[o]="[Function]":ce(a[o])?a[o]="[Window]":oe(a[o])&&(a[o]="[Object]");"__memento__"!==r[0]&&e({logType:n,logs:a})}})),window.addEventListener("error",(function(t){var r=t.target||t.srcElement,a=r.attributes&&r.attributes.src&&r.attributes.src.value||"";if((r.nodeName&&n.indexOf(r.nodeName.toLowerCase())>=0||r.tagName&&n.indexOf(r.tagName.toLowerCase())>=0)&&a&&i.indexOf(a.toLowerCase())<0){i.push(a.toLowerCase());var o=(r.nodeName||r.tagName||"")+" "+(a||"unkonw")+" loaded fail";e({logType:"resourceError",logs:[o]})}}));var a=window.onerror;return window.onerror=function(t,n,r,i,o){return!t||t.indexOf("WeixinJSBridge")>=0||e({logType:"jsError",logs:["pageUrl => "+window.location.href,"errorMsg => "+(t||""),"scriptUrl => "+(n||""),"lineNo => "+r,"columnNo => "+i,"errorType => "+(o?o.name:""),"errorStack => "+(o?o.stack:"")]}),a.apply(this,arguments)},function(){window.console.log=t.log,window.console.info=t.info,window.console.warn=t.warn,window.console.error=t.error,window.onerror=a}}(e.consoleCb),r=function(e){if(!window.XMLHttpRequest)return function(){};var t=window.XMLHttpRequest.prototype.open,n=window.XMLHttpRequest.prototype.send,r={};function i(t,n){var i=r[t]||{};for(var a in n)i[a]=n[a];if(r[t]=i,i.hasOwnProperty("getData")||i.hasOwnProperty("postData")||delete r[t],i&&i.requestSize&&i.requestSize>1e4&&(i.postData="Post Request => Too long has been blocked"),i&&i.getSize&&i.getSize>1e4&&(i.getData="Get Request => Too long has been blocked"),i&&(""===i.responseType||"text"===i.responseType))if(ee(i.response)&&""!==i.response)try{i.response=JSON.parse(i.response)}catch(e){i.response=i.response}else void 0!==i.response&&(""===i.response?i.response="":i.response=Object.prototype.toString.call(i.response));i.readyState&&4===i.readyState&&(i&&0==+i.status?("timeout_error"===i.errorType?(i.errorMsg="request error => timeout ( responseTime > "+(i.timeOut||i.costTime)+"ms )",delete i.timeOut):(i.errorMsg="request error => cross_domain_error",i.errorType="cross_domain_error"),e(i)):e(i||{}))}function o(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}return window.XMLHttpRequest.prototype.open=function(){var e=this,n=[].slice.call(arguments),a=n[0],s=n[1],l=o(),c=null;e._mockRequestID=l,e._mockMethod=a,e._mockUrl=s;var u=e.onreadystatechange||function(){},d=function(){var t=r[l]||{};if(t.readyState=e.readyState,t.status=0,e.readyState>1&&(t.status=e.status),t.responseType=e.responseType,0==e.readyState)t.startTime||(t.startTime=+new Date);else if(1==e.readyState)t.startTime||(t.startTime=+new Date);else if(2==e.readyState);else if(3==e.readyState);else if(4==e.readyState){clearInterval(c);var n=e._mockUrl.split("?");t.url=n.shift()||e._mockUrl,t.endTime=+new Date,t.costTime=t.endTime-(t.startTime||t.endTime),t.ua=window.navigator&&window.navigator.userAgent||"",t.response=e.response,t.responseSize=e.response.length}else clearInterval(c);return e._noMementoConsole||i(l,t),u.apply(e,arguments)};e.onreadystatechange=d;var f=-1;return c=setInterval((function(){f!=e.readyState&&(f=e.readyState,d.call(e))}),10),t.apply(e,n)},window.XMLHttpRequest.prototype.send=function(){var e,t,o,s,l=this,c=[].slice.call(arguments),u=c[0],d=r[l._mockRequestID]||{};d.method=l._mockMethod.toUpperCase(),d.ck=document.cookie;var f=l._mockUrl.split("?");if(f.shift()&&f.length>0){d.getData={},f=(f=f.join("?")).split("&");try{for(var h=a(f),g=h.next();!g.done;g=h.next()){y=(y=g.value).split("="),d.getData[y[0]]=decodeURIComponent(y[1])}}catch(t){e={error:t}}finally{try{g&&!g.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}d.getData&&(d.getSize=JSON.stringify(d.getData).length)}if("POST"==d.method){if(ee(u)&&""!==u){var p=u.split("&");d.postData={};try{for(var m=a(p),v=m.next();!v.done;v=m.next()){var y;y=(y=v.value).split("="),d.postData[decodeURIComponent(y[0])]=decodeURIComponent(y[1])}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}}else ue(u)&&(d.postData=u);d.postData&&(d.requestSize=JSON.stringify(d.postData).length)}var I=l.ontimeout||function(){},C=function(){var e=arguments[0].target||arguments[0].srcElement;return d.timeOut=e.timeout,d.errorType="timeout_error",i(l._mockRequestID,d),I.apply(l,arguments)};return l.ontimeout=C,l._noMementoConsole||i(l._mockRequestID,d),n.apply(l,c)},function(){window.XMLHttpRequest.prototype.open=t,window.XMLHttpRequest.prototype.send=n}}(e.networkCb);return function(){n(),r()}}for(var Ee=function(){function e(){this.handlerHistory()}return e.getInstance=function(){return this.instance=this.instance||new e,this.instance},e.prototype.handlerHistory=function(){var e=function(){if(window.Event)return new window.Event("__changestate__");if(document){var e=document.createEvent("HTMLEvents");return e.initEvent("__changestate__",!1,!0),e}return null},t=function(t){var n=window.history[t];return function(){var t=n.apply(this,arguments),r=e();return r&&window.dispatchEvent(r),t}};window.history.pushState=t("pushState"),window.history.replaceState=t("replaceState")},e}(),Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Te="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Be=0;Be<Ne.length;Be++)Te[Ne.charCodeAt(Be)]=Be;var Me=function(e){var t,n,r,i,a,o=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),u=new Uint8Array(c);for(t=0;t<s;t+=4)n=Te[e.charCodeAt(t)],r=Te[e.charCodeAt(t+1)],i=Te[e.charCodeAt(t+2)],a=Te[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|i>>2,u[l++]=(3&i)<<6|63&a;return c},Re=new Map;var De=function(e,t,n){if(e&&(Ze(e,t)||"object"==typeof e)){var r=function(e,t){var n=Re.get(e);return n||(n=new Map,Re.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function Fe(e,t,n){return e instanceof Array?e.map((function(e){return Fe(e,t,n)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Ne[n[t]>>2],i+=Ne[(3&n[t])<<4|n[t+1]>>4],i+=Ne[(15&n[t+1])<<2|n[t+2]>>6],i+=Ne[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Fe(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Fe(e.data,t,n),e.width,e.height]}:Ze(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:De(e,t,n)}:e}var Oe=function(e,t,n){return s(e).map((function(e){return Fe(e,t,n)}))},Ze=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t){var n=[];try{var r=U(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return H(this,t)||"__context"in this||(this.__context=n),e.apply(this,s([n],r))}}));n.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}function Le(e,t,n,r,i,o){var l,c,u=[],d=Object.getOwnPropertyNames(e),f=function(a){try{if("function"!=typeof e[a])return"continue";var l=U(e,a,(function(l){return function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var d=l.apply(this,c);if(De(d,o,e),!H(this.canvas,r)){i.getId(this.canvas);var f=Oe(s(c),o,e),h={type:t,property:a,args:f};n(this.canvas,h)}return d}}));u.push(l)}catch(r){var c=V(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(c)}};try{for(var h=a(d),g=h.next();!g.done;g=h.next()){f(g.value)}}catch(e){l={error:e}}finally{try{g&&!g.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}return u}var Ge=null;try{var We="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");Ge=We.Worker}catch(ut){}function Ve(e,t,n){var r=void 0===t?null:t,i=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),a=i.indexOf("\n",10)+1,o=i.substring(a)+(r?"//# sourceMappingURL="+r:"");return function(e){return new Ge(o,Object.assign({},e,{eval:!0}))}}function Ue(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,a=n.length;i<a;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),a=i.indexOf("\n",10)+1,o=i.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Ke="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Xe,He,Ye,Pe,Je=(Xe="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1