tdem-web-sdk 1.0.1 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tdem.f.min.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * ===============================================================
3
- * tdem-web-sdk@1.0.1 (c) 2026 TencentCloud Real User Monitoring.
2
+ * ===========================================================================
3
+ * tdem-web-sdk@1.0.7 (c) 2026 TencentCloud Real User Monitoring.
4
4
  * Author pumpkincai.
5
- * Last Release Time Wed Apr 22 2026 11:00:35 GMT+0800 (中国标准时间).
5
+ * Last Release Time Thu Jul 30 2026 15:20:53 GMT+0800 (China Standard Time).
6
6
  * Released under the MIT License.
7
7
  * Thanks for supporting TDEM!
8
- * ===============================================================
8
+ * ===========================================================================
9
9
  **/
10
- ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TDEM=t()})(this,function(){var T,R;function M(e){this.name="__st"+(1e9*Math.random()>>>0)+T+"__",null!=e&&e.forEach(this.add,this),T+=1}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{configurable:!0,writable:!0,value:function(e){if(null===this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],i=0;i<r;){var o=t[i];if(e.call(n,o,i,t))return o;i+=1}}}),window.WeakSet||(T=Date.now()%1e9,M.prototype.add=function(e){var t=this.name;return e[t]||Object.defineProperty(e,t,{value:!0,writable:!0}),this},M.prototype.delete=function(e){return!!e[this.name]&&!(e[this.name]=void 0)},M.prototype.has=function(e){return!!e[this.name]},R=M,Object.defineProperty(window,"WeakSet",{value:function(e){return new R(e)}})),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),r=1;r<arguments.length;r++)if(null!=(n=arguments[r]))for(var n=Object(n),i=Object.keys(Object(n)),o=0,s=i.length;o<s;o++){var a=i[o],l=Object.getOwnPropertyDescriptor(n,a);null!=l&&l.enumerable&&(t[a]=n[a])}return t}});var P=function(e,t){return(P=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},f=function(){return(f=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function L(e,s,a,l){return new(a=a||Promise)(function(r,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((l=l.apply(e,s||[])).next())})}function F(n,i){var o,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!((a=0<(a=l.trys).length&&a[a.length-1])||6!==t[0]&&2!==t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=i.call(n,l)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function B(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function D(e){try{return localStorage.getItem(e)}catch(e){return null}}function U(e,t){try{localStorage.setItem(e,t)}catch(e){}}function z(e,t){try{return e?JSON.parse(e):t}catch(e){return t}}var W,G=/_?t(\d)?(imestamp)?=\d+&?/g,H=["aegis.qq.com","tamaegis.com","/aegis-sdk","rumt-","/flog.core.min.js","pingfore.qq.com","pingfore.tencent.com","zhiyan.tencent-cloud.net","h.trace.qq.com","btrace.qq.com","beacon.qq.com","dmplog.qq.com","qq.com/report","svibeacon.onezapp.com","cube.weixinbridge.com","doubleclick.net","pcmgrmonitor.3g.qq.com","tdm.qq.com","report.qqweb.qq.com","tpstelemetry.tencent.com","galileotelemetry.tencent.com","insight.cloud.tencent.com","facebook.com","facebook.net","google","yahoo.com","twitter.com","ga-audiences","report.idqqimg.com","arms-retcode.aliyuncs.com","px.effirst.com","sentry","baidu.com","hot-update.json","u.c.b.r.o.w.s.e.r","report.url.cn","sockjs-node","m3u8","flv"],j=["ResizeObserver loop limit exceeded","ResizeObserver loop completed","Failed to execute 'transaction'","window.indexedDB.deleteDatabase is not a function"],Z=["ext1","ext2","ext3","ext4","ext5","ext6","ext7","ext8","ext9","ext10","level","trace","tag","seq","code"],V=["static","fetch"],$="unknown",Q=(ee.prototype.indexOf=function(e,t){for(var r=0;r<e.length;r++)if(e[r].callback===t)return r;return-1},ee.prototype.on=function(e,t,r){var n;if(void 0===r&&(r=0),this)return(n=this.eventsList[e])||(this.eventsList[e]=[],n=this.eventsList[e]),-1===this.indexOf(n,t)&&n.push({name:e,type:r||0,callback:t}),this},ee.prototype.one=function(e,t){this.on(e,t,1)},ee.prototype.remove=function(e,t){if(this){var r=this.eventsList[e];if(r){if(t)return r.length&&(t=this.indexOf(r,t),r.splice(t,1)),this;try{delete this.eventsList[e]}catch(e){}}return null}},ee.prototype.clear=function(){this.eventsList={}},ee);function ee(){var s=this;this.emit=function(e,t){if(s){var r;if(null!=(n=s.eventsList[e])&&n.length)for(var n=n.slice(),i=0;i<n.length;i++){r=n[i];try{var o=r.callback.apply(s,[t]);if(1===r.type&&s.remove(e,r.callback),!1===o)break}catch(e){throw e}}return s}},this.eventsList={}}(e=W=W||{})[e.number=-1]="number",e.string="";function te(e,t){return"number"==typeof e||"string"==typeof e?e:t?W.string:W.number}function re(e,t){return"string"==typeof e?e.split("?")[t?1:0]||"":e}function ne(e,t){return void 0===t&&(t=2048),String(e).replace(G,"").slice(0,t)}function ie(e){return"string"==typeof e&&/^\//.test(e)?"https:"===(null==location?void 0:location.protocol):/^https/.test(e)}function oe(e,t,r){var n,i,o;try{if("function"==typeof(null==t?void 0:t.retCodeHandler))return{code:void 0===(o=(i=t.retCodeHandler(e,null==r?void 0:r.url,null==r?void 0:r.ctx,null==r?void 0:r.payload)||{}).code)?$:o,isErr:i.isErr};if(!(e="string"==typeof e?JSON.parse(e):e))return{code:$,isErr:!1};"function"==typeof(null==(n=null==t?void 0:t.ret)?void 0:n.join)&&(fe=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var s=Object.getOwnPropertyNames(e).filter(function(e){return-1!==fe.indexOf(e.toLowerCase())});return s.length?{code:""+(o="未知"!==(o=e[s[0]])&&""!==o?o:$),isErr:0!==o&&"0"!==o&&o!==$}:{code:$,isErr:!1}}catch(e){return{code:$,isErr:!1}}}function se(e,t,r){try{var n="function"==typeof t?t(e,null==r?void 0:r.url,null==r?void 0:r.ctx)||"":e;return ve(n).slice(0,10240)}catch(e){return""}}function ae(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,me(),2)||"undefined").replace(/"/gim,""):JSON.stringify(e,me(),2)||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}}function le(e,t){var r,n={fetch:[],static:[],bridge:[]},i=new FormData;return Array.isArray(e)?e.forEach(function(e){var t=be(e);n[e.type].push(t)}):(r=be(e),n[e.type].push(r)),i.append("payload",ge(f({duration:n},t))),i}function ce(t,e){return"string"!=typeof t||!t||e&&-1<t.indexOf(e)||Se.test(t)||H.some(function(e){return-1<t.indexOf(e)})}var ue,de,p,m,he=["application/xhtml+xml","application/xml","application/pdf","application/pkcs12","application/javascript","application/x-javascript","application/ecmascript","application/vnd.mspowerpoint","application/vnd.apple.mpegurl","application/ogg","text/css","text/javascript","image","audio","video","video/mp2t"],pe=/\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/i,fe=["ret","retcode","code","errcode"],me=function(){var r=new WeakSet;return function(e,t){if(t instanceof Error)return"Error.message: "+t.message+" \n Error.stack: "+t.stack;if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular "+(e||"root")+"]";r.add(t)}return t}},ge=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e,me())||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}},ve=function(r,n){void 0===n&&(n=3);var i,o,s,a="";return Array.isArray(r)?(a+="[",i=r.length,r.forEach(function(e,t){a=(a+="object"==typeof e&&1<n?ve(e,n-1):we(e))+(t===i-1?"":",")}),a+="]"):r instanceof Object||"object"==typeof r?(a="{",o=Object.keys(r),s=o.length,o.forEach(function(e,t){"object"==typeof r[e]&&1<n?a+='"'+e+'":'+ve(r[e],n-1):a+=ye(e,r[e]),a+=t===s-1||t<s-1&&void 0===r[o[t+1]]?"":","}),a+="}"):a+=r,a},ye=function(e,t){var r=typeof t,n="";return"string"==r||"object"==r?n+='"'+e+'":"'+t+'"':"function"==typeof t?n+='"'+e+'":"function '+t.name+'"':"symbol"==typeof t?n+='"'+e+'":"symbol"':"number"!=typeof t&&"boolean"!=r||(n+='"'+e+'": '+t),n},we=function(e){var t=typeof e;return""+("undefined"==t||"symbol"==t||"function"==t?"null":"string"==t||"object"==t?'"'+e+'"':e)},be=function(t){var r;return t.payload?(r={},Object.keys(t).forEach(function(e){"payload"!==e&&(r[e]=t[e])}),r):t},Se=/data:(image|text|application|font)\/.*;base64/;function g(){return"evt_"+Date.now()+"_"+Math.random().toString(36).substring(2,8)}function Ce(e){var t=[];if(e.stack)for(var r=0,n=0,i=e.stack.split("\n");n<i.length;n++){var o,s,a,l,c,u=i[n],d=u.match(/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/);d?(o=d[1],s=d[2],a=d[3],l=d[4],c=s.split("/").pop()||s,t.push({abs_path:s,colno:parseInt(l,10),filename:c,function:o||"(anonymous)",lineno:parseInt(a,10),in_app:s.includes("node_modules")||s.includes("cdn")?0:1,stack_level:r++})):(d=u.match(/at\s+(.+?):(\d+):(\d+)/))&&(s=d[1],a=d[2],l=d[3],c=s.split("/").pop()||s,t.push({abs_path:s,colno:parseInt(l,10),filename:c,function:"(anonymous)",lineno:parseInt(a,10),in_app:s.includes("node_modules")||s.includes("cdn")?0:1,stack_level:r++}))}return t}(e=ue=ue||{}).LOG="log",e.SPEED="speed",e.PERFORMANCE="performance",e.OFFLINE="offline",e.WHITE_LIST="whiteList",e.VITALS="vitals",e.PV="pv",e.CUSTOM_PV="customPV",e.EVENT="event",e.CUSTOM="custom",e.SDK_ERROR="sdkError",e.SET_DATA="setData",e.LOAD_PACKAGE="loadPackage",e.MEMORY="memory",(e=de=de||{}).production="production",e.development="development",e.gray="gray",e.pre="pre",e.daily="daily",e.local="local",e.test="test",e.others="others",(e=p=p||{}).JS_ERROR="js_error",e.PROMISE_ERROR="promise_error",e.RESOURCE_ERROR="resource_error",e.API_ERROR="api_error",e.PAGE_LOAD="page_load",e.RESOURCE_LOAD="resource_load",e.API_CALL="api_call",e.true="web_vitals",e.CLICK="click",e.PAGE_VIEW="page_view",e.FORM_FOCUS="form_focus",e.FORM_BLUR="form_blur",e.FORM_CHANGE="form_change",e.FORM_SUBMIT="form_submit",e.FORM_SUBMIT_RESULT="form_submit_result",e.STRUGGLE="struggle",e.CUSTOM="custom",e.LOG="log",(e=m=m||{}).ERROR="error",e.PERFORMANCE="performance",e.BEHAVIOR="behavior",e.NETWORK="network",e.LOG="log",e.CUSTOM="custom";function ke(c,u){return function(i,o){var a,s,l,e,t,r;null!=i&&i.log&&null!=i&&i.type?(a=function(e,t){var r,n,t=f(f({},c.bean),{from:t}),i=f({},c.bean);return(()=>{try{return"undefined"!=typeof FormData&&"function"==typeof FormData.prototype.append}catch(e){}})()?le(e,t):(t=e,e=i,n={fetch:[],static:[],bridge:[]},i={},Array.isArray(t)?t.forEach(function(e){var t;null!=(t=n[e.type])&&t.push(e)}):null!=(r=n[t.type])&&r.push(t),i.payload=JSON.stringify(f({duration:n},e)),i)},s=function(e,t,r,n){switch(t){case ue.LOG:o=e;var i=(Array.isArray(o)?o:[o]).map(function(r){return Object.getOwnPropertyNames(r).reduce(function(e,t){return"ctx"!==t&&(e[t]=r[t]),e},{level:"2",msg:""})});if(!i||0===i.length)return"{}";i=Array.isArray(i)?i:[i];var o=Array.from(new Set(i.flatMap(function(e){return Object.keys(e)}))),s={};return o.forEach(function(t){s[t]=i.map(function(e){return e[t]||""})}),s.count=i.length,ge(s);case ue.SPEED:return a(e,r);case ue.EVENT:return n;default:return n||{}}var o},1!==(e=Array.isArray(i.log)?i.log:[i.log]).length?(l={},e.forEach(function(e){var t=e.from||"undefined";delete e.from,l[t]||(l[t]=[]),l[t].push(e)}),Object.keys(l).forEach(function(e){var t,r=l[e],n=null!=(n=i.url)&&n.includes("?")?"&":"?";"undefined"===e?(t=""+i.url,o(f(f({},i),{url:t,log:1===r.length?r[0]:r,data:s(r,u,e,i.data)}))):(t=i.url+n+"from="+e,o(f(f({},i),{url:t,log:1===r.length?r[0]:r,beanFilter:B(i.beanFilter||[],["from"]),data:s(r,u,e,i.data)})))})):(t=(e=e[0]).from,delete e.from,r=null!=(r=i.url)&&r.includes("?")?"&":"?",t?(r=i.url+r+"from="+t,o(f(f({},i),{url:r,log:e,beanFilter:B(i.beanFilter||[],["from"]),data:s(e,u,t,i.data)}))):(r=""+i.url,o(f(f({},i),{url:r,log:e,data:s(e,u,t,i.data)}))))):o(i)}}function _e(l,c){return function(e,t){var r,n,i,o=Array.isArray(e),s=o?e:[e],a=(l.lifeCycle.emit("beforeRequest",e),l.config.beforeRequest);(s="function"==typeof a?s.map(function(t){try{var e=a({logs:t,logType:c});return(null==e?void 0:e.logType)===c&&null!=e&&e.logs?e.logs:!1!==e&&t}catch(e){return t}}).filter(function(e){return!1!==e}):s).length&&(r=s,e=Z,!Array.isArray(r)||r.length<=1||(n=[],i=[],!(i="string"==typeof e?[e]:e))||i.length<=0||(i.forEach(function(t){r.forEach(function(e){null!=e&&e[t]&&n.push(t)})}),0<n.length&&(r=r.map(function(e){var t={};return n.forEach(function(e){t[e]=""}),f(f({},t),e)}))),s=r,t(o?s:s[0]))}}function Ie(i){return function(e,t){i.lifeCycle.emit("modifyRequest",e);var r=i.config.modifyRequest;if("function"==typeof r)try{var n=r(e);"object"==typeof n&&"url"in n&&(e=n)}catch(e){console.error(e)}t(e)}}function Ee(n){return function(e,t){null!=(r=n.lifeCycle)&&r.emit("afterRequest",e);var r=(n.config||{}).afterRequest;"function"==typeof r&&!1===r(e)||t(e)}}var xe=function(e){return e.filter(function(r,n){return"static"!==r.type||!e.find(function(e,t){return r.url===e.url&&200===r.status&&n<t})})},Te={},Re={},Ae=function(e){return Te[e]||(Te[e]=setTimeout(function(){Re[e]={},Te[e]=null},6e4)),Te[e]},Me={generateTraceId:Ne(16),generateSpanId:Ne(8)},Oe=Array(32);function Ne(t){return function(){for(var e=0;e<2*t;e++)Oe[e]=Math.floor(16*Math.random())+48,58<=Oe[e]&&(Oe[e]+=39);return String.fromCharCode.apply(null,Oe.slice(0,2*t))}}function Pe(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}function Le(){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)})}function Fe(e){for(var t,r,n,i="",o=0,s=(e=String(e)).length%3;o<e.length;){if(255<(t=e.charCodeAt(o++))||255<(r=e.charCodeAt(o++))||255<(n=e.charCodeAt(o++)))throw new TypeError("Failed to execute 'btoa': The string to be encoded contains characters outside of the Latin1 range.");i+=Ue.charAt((t=t<<16|r<<8|n)>>18&63)+Ue.charAt(t>>12&63)+Ue.charAt(t>>6&63)+Ue.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}function Be(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!ze.test(e))throw new TypeError("Failed to execute 'atob': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var r,n,i="",o=0;o<e.length;)t=Ue.indexOf(e.charAt(o++))<<18|Ue.indexOf(e.charAt(o++))<<12|(r=Ue.indexOf(e.charAt(o++)))<<6|(n=Ue.indexOf(e.charAt(o++))),i+=64===r?String.fromCharCode(t>>16&255):64===n?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}function De(e){var t,r="";return r="object"==typeof e&&(t=(e=((e,t)=>{for(var r=0;r<t.length;r++){var n=t[r],i=e[n]||"function"==typeof e.get&&e.get(n);if(i)return[n,i]}return["",""]})(e,Object.keys(Ge)))[0])?Ge[t](e[1]):r}var Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ze=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,We=(He.prototype.generate=function(e,t,r){if(void 0===t&&(t={}),this.url=e,!this.isUrlIgnored()&&this.isUrlInTraceUrls()&&this.traceType){switch(this.traceType){case"traceparent":this.traceId=this.createTraceparent();break;case"b3":this.traceId=this.createB3();break;case"sw8":this.traceId=this.createSw8(r);break;case"sentry-trace":this.traceId=this.createSentryTrace();break;default:return console.warn("this trace key "+this.traceType+" is not supported"),void(this.traceId="")}return t[this.traceType]&&(this.traceId=t[this.traceType]),{name:this.traceType,value:this.traceId}}},He.prototype.createTraceparent=function(){var e=Me.generateSpanId();return"00-"+Me.generateTraceId()+"-"+e+"-0"+this.traceFlag.toString(16)},He.prototype.createB3=function(){var e=Me.generateSpanId();return Me.generateTraceId()+"-"+e+"-"+this.traceFlag},He.prototype.createSw8=function(e){var t="function"==typeof btoa?btoa:Fe,e=e||{},r=e.host,r=void 0===r?"":r,e=e.pathname,e=void 0===e?"":e,n=Le(),i=Le();return"1-"+String(t(i))+"-"+String(t(n))+"-1-"+String(t("tdem"))+"-"+String(t("1.0.1"))+"-"+String(t(encodeURI(e)))+"-"+String(t(r))},He.prototype.createSentryTrace=function(){var e=Pe().substring(16);return Pe()+"-"+e+"-"+this.traceFlag},He.prototype.isUrlIgnored=function(){if(Array.isArray(this.ignoreUrls)&&0!==this.ignoreUrls.length)for(var e=0,t=this.ignoreUrls;e<t.length;e++){var r=t[e];if(this.urlMatches(this.url,r))return!0}return!1},He.prototype.isUrlInTraceUrls=function(){if(!this.urls)return!0;if(Array.isArray(this.urls)){if(0===this.urls.length)return!1;for(var e=0,t=this.urls;e<t.length;e++){var r=t[e];if(this.urlMatches(this.url,r))return!0}}return!1},He.prototype.urlMatches=function(e,t){return"string"==typeof t?e===t:!!e.match(t)},He),Ge={sw8:function(e){var t="function"==typeof atob?atob:Be,e=e.split("-")[1];return e?t(e):""},traceparent:function(e){return e.split("-")[1]},b3:function(e){return e.split("-")[0]},"sentry-trace":function(e){return e.split("-")[0]}};function He(e,t,r,n){void 0===r&&(r=null),this.traceType=e,this.ignoreUrls=t,this.urls=r,this.traceFlag=null==n?1:Number(!!n)}function je(o){return function(e){e&&0!==e.length&&o.sendPipeline([function(t,e){var r,n,i={protocol_version:2,project_key:String(o.config.id||""),sdk:{name:"tdem-web-sdk",version:Je.version},app:{version:String(o.config.version||"1.0.0")},context:(r=o,i=String((null==(n=null==(n=null==(i=r.sessionManager)?void 0:i.getSession)?void 0:n.call(i))?void 0:n.id)||r.bean.sessionId||""),n=String(r.config.uin||""),r={session_id:i,platform:(i=String(r.runtimePlatform||r.config.platform||"web").trim().toLowerCase(),["web","miniprogram","android","ios","unknown"].includes(i)?i:["wx","my","qq","tt"].includes(i)?"miniprogram":"undefined"!=typeof window?"web":"unknown")},n&&(r.user_id=n),"undefined"!=typeof navigator&&(r.user_agent=navigator.userAgent,r.language=navigator.language),"undefined"!=typeof screen&&(r.screen_resolution=screen.width+"x"+screen.height),r),events:t};e({url:(o.config.apiUrl||o.config.url)+"/api/v1/collect/events",data:JSON.stringify(i),method:"POST",contentType:"application/json",addBean:!1,type:ue.EVENT,log:t,success:function(){o.lifeCycle.emit("afterReport",{success:!0,events:t})},fail:function(e){o.lifeCycle.emit("afterReport",{success:!1,error:e,events:t})}})}],ue.EVENT)(e)}}function Ze(r){if(r&&r.reduce&&r.length)return 1===r.length?function(e,t){r[0](e,t||Ye)}:r.reduce(function(r,n){return function(e,t){return void 0===t&&(t=Ye),r(e,function(e){return null==n?void 0:n(e,t)})}});throw new TypeError("createPipeline need at least one function param")}function Ve(t,r){Object.getOwnPropertyNames(t).forEach(function(e){"function"==typeof t[e]&&"constructor"!==e&&(r?r[e]="sendPipeline"===e?function(){return function(){}}:function(){}:t[e]=function(){})})}var Ye=function(){},Xe={rage_click:3,dead_click:4,error_click:4,form_validation_error:3,slow_page:3,back_forward:2,long_focus_time:2,form_zigzag:2,uncompleted_form:3,custom_struggle:3},Ke={rage_click:4,dead_click:5,error_click:5,form_validation_error:4,slow_page:4,back_forward:3,long_focus_time:3,form_zigzag:3,uncompleted_form:3,custom_struggle:3},Je=(c.use=function(e){-1===c.installedPlugins.indexOf(e)&&e.tdemPlugin&&c.installedPlugins.push(e)},c.unuse=function(e){e=c.installedPlugins.indexOf(e);-1!==e&&c.installedPlugins.splice(e,1)},c.prototype.init=function(e){var t;this.setConfig(e),this.config=(t=this.config,e=e.hostUrl,t.url=""+(e="string"!=typeof(e=void 0===e?"https://rumt-zh.com":e)?"https://rumt-zh.com":e),t.offlineUrl=e+"/offline",t.whiteListUrl=e+"/collect/whitelist",t.pvUrl=e+"/collect/pv",t.eventUrl=e+"/collect/events",t.speedUrl=e+"/speed",t.customTimeUrl=e+"/speed/custom",t.performanceUrl=e+"/speed/performance",t.performanceUrlForHippy=e+"/speed/hippyPerformance",t.webVitalsUrl=e+"/speed/webvitals",t.setDataReportUrl=e+"/speed/miniProgramData",t);for(var r=0;r<c.installedPlugins.length;r++)try{c.installedPlugins[r].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited")},c.prototype.destroy=function(e){void 0===e&&(e=!1);var t,r,n=c.instances.indexOf(this);-1!==n&&c.instances.splice(n,1);for(var i=c.installedPlugins.length-1;0<=i;i--)try{c.installedPlugins[i].unpatch(this)}catch(e){this.sendSDKError(e)}if(this.lifeCycle.emit("destroy"),this.lifeCycle.clear(),e)t=this,r=Object.getOwnPropertyDescriptors(t),Object.keys(r).forEach(function(e){r[e].writable&&(t[e]=null)}),Object.setPrototypeOf(this,null);else{for(var o=this;o.constructor!==Object&&Ve(o,this),o=Object.getPrototypeOf(o););0===c.instances.length&&(n=Object.getPrototypeOf(this).constructor,Ve(n),Ve(c))}},c.prototype.setConfig=function(e){Object.assign(this.config,e);var e=this.config,t=e.id,r=e.uin,n=e.version,i=e.ext1,o=e.ext2,s=e.ext3,a=e.aid,l=e.env,c=void 0===l?"production":l,l=e.pageUrl,e=this.bean.id!==t||this.bean.uin!==r||this.bean.aid!==a;return this.bean.id=t||"",this.bean.uin=r||"",this.bean.version=n||"1.0.1",this.bean.aid=a||"",this.bean.env=(()=>{switch(c){case de.production:case de.development:case de.gray:case de.pre:case de.daily:case de.local:case de.test:case de.others:return 1;default:return}})()?c:de.others,l&&this.extendBean("from",encodeURIComponent(l.slice(0,2048))),i&&this.extendBean("ext1",encodeURIComponent(i)),o&&this.extendBean("ext2",encodeURIComponent(o)),s&&this.extendBean("ext3",encodeURIComponent(s)),e&&this.lifeCycle.emit("onConfigChange",this.config),this.config},c.prototype.extendBean=function(e,t){this.bean[e]=t},c.prototype.send=function(e,i,o){var t=this;return Ze([Ie(this),ke(this,null==e?void 0:e.type),function(r,n){t.request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n({isErr:!1,result:e,logType:r.type,logs:r.log}),null!=i&&i.apply(void 0,e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n({isErr:!0,result:e,logType:r.type,logs:r.log}),null!=o&&o.apply(void 0,e)})},Ee(this)])(e)},c.prototype.sendSDKError=function(e){var r=this;this.sendPipeline([function(e,t){t({url:r.config.url+"?id=1085&msg[0]="+encodeURIComponent(ae(e))+"&level[0]=2&from="+r.config.id+"&count=1&version="+r.config.id+"(1.0.1)",addBean:!1,method:"get",type:ue.SDK_ERROR,log:e})}],ue.SDK_ERROR)(e)},c.prototype.sendPipeline=function(e,t){var r,o=this;return Ze(B([function(e,t){if(e&&e.type===ue.EVENT)return t(e);if("number"!=typeof r.config.random&&(console.warn("random must in [0, 1], default is 1."),r.config.random=1),!r.isHidden||!r.isGetSample)if(r.isGetSample)r.isHidden||t(e);else{if(r.isGetSample=!0,Math.random()<r.config.random)return r.isHidden=!1,t(e);r.isHidden=!0}},_e(r=this,t)],e,[ke(this,t),Ie(this),function(n,i){o.request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=!1;-1<(""+e[o.failRequestCount=0]).indexOf("403 forbidden")&&(r=!0,o.destroy()),i({isErr:r,result:e,logType:null==n?void 0:n.type,logs:null==n?void 0:n.log}),null!=(r=null==n?void 0:n.success)&&r.call.apply(r,B([n],e))},function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];60<=++o.failRequestCount&&o.destroy(),-1<(""+t[0]).indexOf("403 forbidden")&&o.destroy(),i({isErr:!0,result:t,logType:null==n?void 0:n.type,logs:null==n?void 0:n.log}),null!=(e=null==n?void 0:n.fail)&&e.call.apply(e,B([n],t))})},Ee(this)]))},c.prototype.validateRange=function(e){return 0<=e&&e<=127?e:-1},c.prototype.reportEvent=function(e){e&&((e="string"==typeof e?{name:e,ext1:this.config.ext1||"",ext2:this.config.ext2||"",ext3:this.config.ext3||"",originFrom:this.getOriginFrom()}:f(f({},e),{originFrom:e.originFrom||this.getOriginFrom()})).name?("string"!=typeof e.name&&(console.warn("reportEvent params name must be string"),e.name=String(e.name)),e={event_id:g(),event_type:p.CUSTOM,event_category:m.CUSTOM,timestamp:Date.now(),page_url:e.originFrom||"",data:{event_name:e.name,tags:{ext1:String(e.ext1||"").slice(0,1024),ext2:String(e.ext2||"").slice(0,1024),ext3:String(e.ext3||"").slice(0,1024),ext4:String(e.ext4||""),ext5:String(e.ext5||""),ext6:String(e.ext6||""),ext7:String(e.ext7||""),ext8:String(e.ext8||""),ext9:String(e.ext9||""),ext10:String(e.ext10||"")}}},this.reportTDEMEvent(e)):console.warn("reportEvent params error"))},c.prototype.reportTDEMEvent=function(e){var t=this,e=Array.isArray(e)?e:[e];e.length&&(e=e.map(function(e){return f(f({},e),{page_url:e.page_url||t.getCurrentEventPageUrl()})}),this.lifeCycle.emit("tdemEventCreated",e),this.tdemEventPipeline(e))},c.prototype.reportStruggle=function(e){var t,r,n;e&&e.type&&e.ownerType&&e.ownerKey?(n=e.type,t="number"==typeof e.severity?e.severity:Xe[n],r="number"==typeof e.weight?e.weight:Ke[n],n={event_id:g(),event_type:p.STRUGGLE,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:n,replay_id:this.getCurrentReplayId()||void 0,tags:this.sanitizeEventTags(e.tags),is_effective_action:!1,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),struggle_weight:r,struggle_severity:t,struggle_value:"number"==typeof e.value?e.value:r*t,event_properties:{form_id:e.formId||"",field_id:e.fieldId||"",trigger_event_id:e.triggerEventId||"",struggle_status:e.status||"detected",struggle_owner_type:e.ownerType,struggle_owner_key:e.ownerKey,detection_source:e.detectionSource||"sdk_auto",rule_version:e.ruleVersion||this.getDefaultRuleVersion()}}},this.reportTDEMEvent(n)):console.warn("reportStruggle params error")},c.prototype.reportFormSubmitResult=function(e){e&&e.status?(e={event_id:g(),event_type:p.FORM_SUBMIT_RESULT,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:e.eventName||"form_submit_"+e.status,replay_id:this.getCurrentReplayId()||void 0,tags:this.sanitizeEventTags(e.tags),is_effective_action:"boolean"!=typeof e.isEffectiveAction||e.isEffectiveAction,trigger_event_id:e.triggerEventId,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),validation_message:e.validationMessage?e.validationMessage.slice(0,256):void 0,event_properties:{status:e.status,validation_code:e.validationCode||"",form_id:e.formId||"",field_id:e.fieldId||""}}},this.reportTDEMEvent(e)):console.warn("reportFormSubmitResult params error")},c.prototype.setPage=function(e,t){var r,n,i;e&&"string"==typeof e?(r=this._customPageUrl||this.getCurrentEventPageUrl(),this._customPageUrl=e,i=Date.now(),n=this.getCurrentReplayId()||void 0,i={event_id:g(),event_type:p.PAGE_VIEW,event_category:m.BEHAVIOR,timestamp:i,page_url:e,data:{page_title:(null==t?void 0:t.pageTitle)||"",replay_id:n,tags:f({source:"manual",environment:this.config.env||"production",version:String(this.config.version||"")},null!=t&&t.pageGroup?{page_group:t.pageGroup}:{}),event_properties:{navigation_type:"push",from_page:(r||"").slice(0,512),to_page:e.slice(0,512),is_first_visit:"0"}}},this.reportTDEMEvent(i),this.lifeCycle.emit("pageChanged",{pageUrl:e,previousUrl:r,source:"manual"})):console.warn("setPage: pageUrl must be a non-empty string")},c.prototype.leavePage=function(){var e;this._customPageUrl&&(e=this._customPageUrl,this._customPageUrl=null,this.lifeCycle.emit("pageChanged",{pageUrl:this.getCurrentEventPageUrl(),previousUrl:e,source:"auto"}))},c.prototype.infoTDEM=function(e,t){e={event_id:g(),event_type:p.CUSTOM,event_category:m.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(),data:{event_name:"info",replay_id:this.getCurrentReplayId()||void 0,tags:f({message:e},t)}};this.reportTDEMEvent(e)},c.prototype.errorTDEM=function(e,t){e="string"==typeof e?new Error(e):e,e={event_id:g(),event_type:p.JS_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(),data:{exception_stacks:[{type:e.name||"Error",value:e.message,mechanism_type:"manual",mechanism_handled:1}],exception_frames:Ce(e),replay_id:this.getCurrentReplayId()||void 0,tags:t||{}}};this.reportTDEMEvent(e)},c.prototype.getCurrentEventPageUrl=function(e){var t;if(e)return e;if(this._customPageUrl)return this._customPageUrl;try{return this.getOriginFrom()}catch(e){return this.config.pageUrl||"undefined"!=typeof window&&(null==(t=window.location)?void 0:t.href)||""}},c.prototype.getCurrentReplayId=function(){var e,t;return String((null==(t=null==(t=null==(e=this.sessionManager)?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"")},c.prototype.getDefaultRuleVersion=function(){var e;return(null==(e=null==(e=this.config)?void 0:e.struggleMonitor)?void 0:e.ruleVersion)||"1.0.0"},c.prototype.sanitizeEventTags=function(r){var n;if(r&&"object"==typeof r)return n={},Object.keys(r).forEach(function(e){var t=r[e];null!=t&&(n[e]=String(t).slice(0,1024))}),Object.keys(n).length?n:void 0},c.prototype.sanitizeEventPayload=function(r,e){var n;if(r&&"object"==typeof r)return e=(e=this.getPayloadAllowlist(e)).length?e:Object.keys(r),n={},e.forEach(function(e){var t;Object.prototype.hasOwnProperty.call(r,e)&&null!=(t=r[e])&&("string"==typeof t?n[e]=t.slice(0,256):"number"==typeof t||"boolean"==typeof t?n[e]=t:Array.isArray(t)?n[e]=t.slice(0,10).map(function(e){return"string"==typeof e?e.slice(0,256):"number"==typeof e||"boolean"==typeof e?e:String(e).slice(0,256)}):n[e]=String(t).slice(0,256))}),Object.keys(n).length?n:void 0},c.prototype.getPayloadAllowlist=function(e){var t=null==(t=null==(t=this.config)?void 0:t.struggleMonitor)?void 0:t.payloadAllowlist;return Array.from(new Set(B(Array.isArray(t)?t:[],Array.isArray(e)?e:[]).filter(function(e){return!!e})))},c.prototype.normalizeRelatedEventIds=function(e){return Array.isArray(e)&&e.length&&(e=Array.from(new Set(e.filter(function(e){return"string"==typeof e&&e})))).length?e:void 0},c.prototype.reportT=function(e){var t=e.name,r=e.duration,n=e.ext1,n=void 0===n?"":n,i=e.ext2,i=void 0===i?"":i,o=e.ext3,o=void 0===o?"":o,s=e.ext4,a=e.ext5,l=e.ext6,c=e.ext7,u=e.ext8,d=e.ext9,h=e.ext10,e=e.from;if("string"==typeof t&&"number"==typeof r&&"string"==typeof n&&"string"==typeof i&&"string"==typeof o){if(!(r<0||2147483646<r))return this.submitCustomTime(t,r,n,i,o,void 0===s?"":s,void 0===a?"":a,void 0===l?"":l,void 0===c?"":c,void 0===u?"":u,void 0===d?"":d,void 0===h?"":h,void 0===e?"":e);console.warn("reportTime: duration must between 0 and 2147483646")}else console.warn("reportTime: params error")},c.prototype.reportTime=function(e,t){if("object"==typeof e)return this.reportT(e);"string"==typeof e?"number"==typeof t?t<0||2147483646<t?console.warn("reportTime: duration must between 0 and 2147483646"):this.submitCustomTime(e,t):console.warn("reportTime: second param must be number"):console.warn("reportTime: first param must be a string")},c.prototype.time=function(e){"string"==typeof e?this.timeMap[e]?console.warn("Timer "+e+" already exists"):this.timeMap[e]=Date.now():console.warn("time: first param must be a string")},c.prototype.timeEnd=function(e){var t;"object"!=typeof e||null===e?"string"==typeof e?void 0!==(t=this.getTimeEventDuration(e))?(this.submitCustomTime(e,t),delete this.timeMap[e]):console.warn("Timer "+e+" does not exist"):console.warn("timeEnd: first param must be a string"):void 0!==(t=this.getTimeEventDuration(e.name))?(this.reportT(f(f({},e),{duration:t})),delete this.timeMap[e.name]):console.warn("Timer "+e.name+" does not exist")},c.prototype.ready=function(e,t,r){throw new Error('You need to override "ready" method')},c.prototype.request=function(e,t,r){throw new Error('You need to override "request" method')},c.prototype.speedLogPipeline=function(e){throw new Error('You need to override "speedLogPipeline" method')},c.prototype.getOriginFrom=function(){throw new Error('You need to override "getOriginFrom" method')},Object.defineProperty(c.prototype,"__version__",{get:function(){return"1.0.1"},enumerable:!1,configurable:!0}),c.prototype.reportPv=function(e){e&&console.warn("reportPv is deprecated, please use reportEvent")},c.prototype.submitCustomTime=function(e,t,r,n,i,o,s,a,l,c,u,d,h){r={ext1:String(r||this.config.ext1||"").slice(0,1024),ext2:String(n||this.config.ext2||"").slice(0,1024),ext3:String(i||this.config.ext3||"").slice(0,1024)},o&&(r.ext4=String(o||this.config.ext4||"")),s&&(r.ext5=String(s||this.config.ext5||"")),a&&(r.ext6=String(a||this.config.ext6||"")),l&&(r.ext7=String(l||this.config.ext7||"")),c&&(r.ext8=String(c||this.config.ext8||"")),u&&(r.ext9=String(u||this.config.ext9||"")),d&&(r.ext10=String(d||this.config.ext10||"")),h&&(r.from=h),i={event_id:g(),event_type:p.CUSTOM,event_category:m.CUSTOM,timestamp:Date.now(),page_url:(null==(n=this.getOriginFrom)?void 0:n.call(this))||"",data:{event_name:e,measurements:{duration:t},tags:r}};this.reportTDEMEvent(i)},c.prototype.getTimeEventDuration=function(e){if(void 0!==e&&this.timeMap[e])return Date.now()-this.timeMap[e]},c.version="1.0.1",c.instances=[],c.environment=de,c.installedPlugins=[],c),e=(qe.prototype.patch=function(e){this.canUse(e)&&this.exist(e)&&(this.instances.push(e),this.triggerInit(e),this.triggerOnNewTdem(e))},qe.prototype.unpatch=function(e){var t=this.instances.indexOf(e);-1!==t&&(this.instances.splice(t,1),0===this.instances.length)&&this.uninstall(e)},qe.prototype.countInstance=function(){return this.instances.length},qe.prototype.uninstall=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.destroy)&&t.apply(this,[e])},qe.prototype.walk=function(r){var n=this;this.instances.forEach(function(e){var t=n.canUse(e);t&&r(e,t)})},qe.prototype.canUse=function(e){e=this.getConfig(e);return!(!e||"object"!=typeof e)||!!e},qe.prototype.getConfig=function(e){return null==(e=e.config)?void 0:e[this.name]},qe.prototype.exist=function(e){return-1===this.instances.indexOf(e)},qe.prototype.triggerInit=function(e){var t;this.inited||(this.inited=!0,null==(t=null==(t=this.option)?void 0:t.init))||t.call(this.option,this.getConfig(e))},qe.prototype.triggerOnNewTdem=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.onNewTdem)&&t.call(this.option,e,this.getConfig(e))},qe);function qe(e){this.tdemPlugin=!0,this.name="",this.instances=[],this.inited=!1,e.$walk=this.walk.bind(this),e.$getConfig=this.getConfig.bind(this),this.option=e,this.name=e.name}function c(e){var n,i,o,r,s,a,l;this.isGetSample=!1,this.isHidden=!1,this.config={version:0,delay:1e3,onError:!0,repeat:60,random:1,aid:!0,device:!0,pagePerformance:!0,webVitals:!0,speedSample:!0,onClose:!0,reportLoadPackageSpeed:!0,hostUrl:"https://rumt-zh.com",env:"production",url:"",offlineUrl:"",whiteListUrl:"",pvUrl:"",speedUrl:"",customTimeUrl:"",performanceUrl:"",performanceUrlForHippy:"",webVitalsUrl:"",eventUrl:"",setDataReportUrl:"",reportImmediately:!0,tdemConfig:!0},this.isWhiteList=!1,this.lifeCycle=new Q,this.bean={},this._customPageUrl=null,this.tdemEventPipeline=Ze([(s=r=!1,a=[],this._tdemSampleGate={decide:function(e){r=!0,(s=e)&&a.forEach(function(e){var t=e.event;return(0,e.resolve)(t)}),a=[]},reDecide:function(e){return s=!(e<=0)&&(100<=e||100*Math.random()<e)},get isDecided(){return r},get isSampled(){return s}},function(e,t){r?s&&t(e):a.length<1e3&&a.push({event:e,resolve:t})}),(i=Math.max(Number(100)||1,1),o=[],function(e,t){function r(){for(;0<o.length;)t(o.splice(0,i))}e=Array.isArray(e)?e:[e];o.push.apply(o,e);clearTimeout(n),i<=o.length?r():n=setTimeout(function(){0<o.length&&r()},5e3)}),function(t,r){try{var e,n=JSON.parse(JSON.stringify(t)),i=(l.lifeCycle.emit("beforeReport",n),l.config.beforeReport);"function"==typeof i?0<(e=t.filter(function(e){return!1!==i(e)})).length&&r(e):r(t)}catch(e){r(t)}},je(l=this)]),this.timeMap={},this.failRequestCount=0,c.instances.push(this)}new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e||window.localStorage.getItem("TDEM_ID");t||(t=Le(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}});function $e(){return void 0!==window.performance&&"function"==typeof performance.getEntriesByType&&"function"==typeof performance.now}function Qe(e){var t;return-1<(null==(t=null==(t=window.PerformanceObserver)?void 0:t.supportedEntryTypes)?void 0:t.indexOf(e))}function et(e){return e=e.sessionManager,[(null==(t=null==(t=null==e?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"",null==t||t.id,!t||t.sampled,null==t||t.sampled][0];var t}function t(e){return-1!==nt.indexOf(e)}var tt=new e({name:"reportAssetSpeed"}),rt=tt=new e({name:"reportAssetSpeed",collectCur:0,collectEntryType:"resource",ASSETS_INITIATOR_TYPE:["img","css","script","link","audio","video"],getFromParam:function(e){return e.getCurrentPageUrl()},onNewTdem:function(e){var t=this;$e()&&(setTimeout(function(){t.collectSuccessLog(e),t.collectFailLog(e)},5e3),performance.onresourcetimingbufferfull=function(){"function"==typeof performance.clearResourceTimings&&(t.collectCur=0,performance.clearResourceTimings())})},processLog:function(e,t){var r=t.duration||0,n=t.transferSize||0,r={event_id:g(),event_type:p.RESOURCE_LOAD,event_category:m.NETWORK,timestamp:Date.now(),page_url:t.from||window.location.href,data:{url:t.url,resource_type:t.type||"static",measurements:{duration:r,dns_time:t.domainLookup,tcp_time:t.connectTime,transfer_size:0<n?n:void 0},replay_id:et(e),tags:{environment:e.config.env||"production",is_https:t.isHttps?"true":"false"},event_properties:{is_cached:String(0===n),protocol:t.nextHopProtocol||"",http_status:String(t.status||0)}}};null!=(n=e.reportTDEMEvent)&&n.call(e,r)},publish:function(t,r){var n=this;this.$walk(function(e){e===r&&(Array.isArray(t)?t.forEach(n.processLog):n.processLog(r,t))})},publishMany:function(e,t){for(var r=t.config,n=this.getFromParam(t),i=0,o=e.length;i<o;i++){var s=e[i];-1===this.ASSETS_INITIATOR_TYPE.indexOf(s.initiatorType)||ce(s.name,r.hostUrl)||this.publish(this.generateLog(s,r,n),t)}},collectSuccessLog:function(r){var e,t,n=this;"function"==typeof window.PerformanceObserver?(this.publishMany(performance.getEntriesByType(this.collectEntryType),r),(e=new window.PerformanceObserver(function(e){n.publishMany(e.getEntries(),r)})).observe({entryTypes:[this.collectEntryType]}),r.lifeCycle.on("destroy",function(){0===tt.countInstance()&&e.disconnect()})):(t=setInterval(function(){var e=performance.getEntriesByType(n.collectEntryType),t=e.slice(n.collectCur);n.collectCur=e.length,n.publishMany(t,r)},3e3),r.lifeCycle.on("destroy",function(){0===tt.countInstance()&&clearInterval(t)}))},collectFailLog:function(i){function e(e){var t,r,n;e&&(e=e.target||e.srcElement,!(t=(null==e?void 0:e.src)||(null==e?void 0:e.href))||"string"!=typeof t||-1<window.location.href.indexOf(t)||(e="function"==typeof(null==(e=s.api)?void 0:e.resourceTypeHandler)?null==(e=s.api)?void 0:e.resourceTypeHandler(t):"",n=performance.getEntriesByType(o.collectEntryType).find(function(e){return e.name===t}),ce(t,s.hostUrl))||(r=o.getFromParam(i),n={url:ne(t),status:400,duration:Number(((null==n?void 0:n.duration)||0).toFixed(2)),method:"get",type:e||"static",isHttps:ie(t),urlQuery:re(t,!0),nextHopProtocol:"",domainLookup:0,connectTime:0,from:r},o.publish(n,i)))}var o=this,s=i.config;window.document.addEventListener("error",e,!0),i.lifeCycle.on("destroy",function(){0===tt.countInstance()&&window.document.removeEventListener("error",e,!0)})},generateLog:function(e,t,r){var t="function"==typeof(null==(n=t.api)?void 0:n.resourceTypeHandler)?null==(n=t.api)?void 0:n.resourceTypeHandler(e.name):"",n=e.transferSize;return{url:ne(e.name),method:"get",duration:Number(e.duration.toFixed(2)),status:200,type:t||"static",isHttps:ie(e.name),nextHopProtocol:e.nextHopProtocol||"",urlQuery:re(e.name,!0),domainLookup:te(e.domainLookupEnd-e.domainLookupStart),connectTime:te(e.connectEnd-e.connectStart),transferSize:0<n?n:-1,from:r}},collectNotReportedLog:function(e){var t,r;$e()&&(t=(r=performance.getEntriesByType(this.collectEntryType)).length,"function"!=typeof window.PerformanceObserver)&&this.collectCur!==t&&(r=r.slice(this.collectCur),this.collectCur=t,this.publishMany(r,e))},destroy:function(){this.option.publish=function(){}}}),nt=window.navigator.userAgent.toLowerCase(),l={};l.macos=function(){return t("mac")},l.ios=function(){return l.iphone()||l.ipod()||l.ipad()},l.iphone=function(){return!l.windows()&&t("iphone")},l.ipod=function(){return t("ipod")},l.ipad=function(){var e="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return t("ipad")||e},l.android=function(){return!l.windows()&&t("android")},l.androidPhone=function(){return l.android()&&t("mobile")},l.androidTablet=function(){return l.android()&&!t("mobile")},l.blackberry=function(){return t("blackberry")||t("bb10")},l.blackberryPhone=function(){return l.blackberry()&&!t("tablet")},l.blackberryTablet=function(){return l.blackberry()&&t("tablet")},l.windows=function(){return t("windows")},l.windowsPhone=function(){return l.windows()&&t("phone")},l.windowsTablet=function(){return l.windows()&&t("touch")&&!l.windowsPhone()},l.fxos=function(){return(t("(mobile")||t("(tablet"))&&t(" rv:")},l.fxosPhone=function(){return l.fxos()&&t("mobile")},l.fxosTablet=function(){return l.fxos()&&t("tablet")},l.meego=function(){return t("meego")},l.cordova=function(){return window.cordova&&"file:"===location.protocol},l.nodeWebkit=function(){return"object"==typeof window.process},l.mobile=function(){return l.androidPhone()||l.iphone()||l.ipod()||l.windowsPhone()||l.blackberryPhone()||l.fxosPhone()||l.meego()},l.tablet=function(){return l.ipad()||l.androidTablet()||l.blackberryTablet()||l.windowsTablet()||l.fxosTablet()},l.desktop=function(){return!l.tablet()&&!l.mobile()};function it(){return{host:new URL(location.href).host,pathname:location.pathname}}function ot(n,e,i){return null!=e&&e.length&&"object"==typeof n?e.reduce(function(e,t){var r=window.Headers&&n instanceof Headers?n.get(t):n[t];return r?e+(""===e?"":"\n\n")+i+" header "+t+": "+r:e},""):""}function st(e,t){return e&&-1===["null","undefined"].indexOf(e)?t+": "+e:""}function at(e,t,r){void 0===t&&(t="");var n,i,e="function"==typeof(null==(i=e.api)?void 0:i.resourceTypeHandler)?null==(i=e.api)?void 0:i.resourceTypeHandler(r):"";return-1===V.indexOf(e)&&(n=void 0===t?"":t,i=(void 0===r?"":r).split("?")[0],e=pe.test(i)||he.some(function(e){return-1!==String(n).indexOf(e)})?"static":"fetch"),e}function lt(e,t){return e?Ft.AJAX_ERROR:t?Ft.RET_ERROR:Ft.API_RESPONSE}function ct(e,t,r){var n,i;if(!e)return!1;if(null!=(n=null==t?void 0:t.api)&&n.isSlowApi&&"function"==typeof(null==(n=null==t?void 0:t.api)?void 0:n.isSlowApi))try{return null==(i=null==t?void 0:t.api)?void 0:i.isSlowApi(r||{duration:e})}catch(e){return console.warn("[TDEM] isSlowApi function happen error:",e,", this data will not be reported."),!1}return null!=(n=null==t?void 0:t.api)&&n.apiSlowThreshold&&"number"==typeof(null==(i=null==t?void 0:t.api)?void 0:i.apiSlowThreshold)?e>(null==(r=null==t?void 0:t.api)?void 0:r.apiSlowThreshold):1e3<e}function ut(e,t){if(null!=(e=e.api)&&e.usePerformanceTiming&&"string"==typeof t.url){e=null==(e=performance.getEntriesByName(t.url))?void 0:e.pop();if(e)return{url:t.url,isHttps:ie(t.url),method:t.method,type:t.type,status:t.status,duration:Number(e.duration.toFixed(2)),nextHopProtocol:e.nextHopProtocol||"",domainLookup:te(e.domainLookupEnd-e.domainLookupStart),connectTime:te(e.connectEnd-e.connectStart)}}return{url:t.url,isHttps:ie(t.url),method:t.method,type:t.type,status:t.status,duration:Number(t.duration.toFixed(2)),nextHopProtocol:"",domainLookup:W.number,connectTime:W.number}}function dt(e){return(e=(e=>{var t="",r=e.nodeType;if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(var n=e.firstChild;n;n=n.nextSibling)t+=Kt(e)}else if(3===r||4===r)return e.nodeValue;return t})(e))?e.replace(/^\s+|\s+$/g,""):""}var ht,pt,ft,mt,gt,vt,yt,wt,bt,St,Ct,kt,_t,It,Et,xt,Tt,Rt,At=!(l.isIE=function(){return"ActiveXObject"in window}),Mt=[],Ot=/^\/[^/]/,Nt=!1,Pt=[],Lt={maxRetryCount:10,retryInterval:function(e){return 1e3*(2<<e)},whenRetryEndStillFail:"discard"},Ft={API_RESPONSE:"api_response",AJAX_ERROR:"ajax_error",RET_ERROR:"ret_error",SLOW_NET_REQUEST:"slow_net_request"},Bt=(new e({name:"reportApiSpeed"}),new e({name:"reportApiSpeed",override:!1,onNewTdem:function(e){var t,r;this.override||(this.override=!0,null!=(r=e.config.api)&&r.injectTraceHeader&&(this.traceRequestHeader=new We(r.injectTraceHeader,null!=(t=null==r?void 0:r.injectTraceIgnoreUrls)?t:[],null==r?void 0:r.injectTraceUrls,null==r?void 0:r.traceFlag)),this.overrideFetch(e.config,e),this.overrideXhr(e.config,e))},getFromParam:function(e){return e.getCurrentPageUrl()},overrideFetch:function(b,S){var C=this,e=b.api,e={name:this.name,traceRequestHeader:null!=e&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return C.getFromParam(S)},then:function(h,p,f,m,g,v,y){var e,w;ce(f,b.hostUrl)||(e=h.headers?h.headers.get("content-type"):"","fetch"===(w=at(b,e||"",f))?h.clone().text().then(function(n){var e,i=h.status<=0||400<=h.status,t=(null==(t=b.api)?void 0:t.reqHeaders)||[],o=ot(null==m?void 0:m.headers,t,"req"),t=(null==(t=b.api)?void 0:t.resHeaders)||[],s=ot(h.headers,t,"res"),a=De(null==m?void 0:m.headers),t=oe(n,b.api,{url:f,ctx:h,payload:null==m?void 0:m.body}),l=t.code,c=t.isErr,t=null==(t=b.api)?void 0:t.apiDetail,u=t?se(null==m?void 0:m.body,null==(e=b.api)?void 0:e.reqParamHandler,{url:f}):"",d=t?se(n,null==(e=b.api)?void 0:e.resBodyHandler,{url:f,ctx:h}):"";setTimeout(function(){var e=ut(b,{url:f,duration:p,type:w,status:h.status||0,method:(null==m?void 0:m.method)||"get"}),t=[i?"FETCH_ERROR: "+n:"","fetch req url: "+f,"res status: "+(e.status||0),"res duration: "+e.duration+"ms","res startTime: "+g,o,s,"req method: "+(e.method||"GET"),"res retcode: "+l,st(u,"req param"),st(d,"res data")].filter(function(e){return e}).join("\n\n"),t=(e.payload=null==m?void 0:m.body,e.ret=l,e.isErr=+c,e.from=v||C.getFromParam(S),{msg:t,code:l,trace:a,errorMsg:"",from:v||C.getFromParam(S),originFrom:y,level:Ft.API_RESPONSE}),r=b.slowApiLog&&ct(null==e?void 0:e.duration,b,e);t.level=r?Ft.SLOW_NET_REQUEST:lt(i,c),(r||t.level!==Ft.API_RESPONSE||S.isWhiteList||null!=(r=null==(r=S.config)?void 0:r.api)&&r.reportRequest)&&C.publishNormalLog(t,S),C.publishSpeed(e,S)},0)}).catch(function(e){console.info("ignore something error when process resp "+e)}):setTimeout(function(){var e=ut(b,{url:f,duration:p,type:w,status:h.status||0,method:(null==m?void 0:m.method)||"get"});e.type="static",e.urlQuery=re(f,!0),e.from=v||C.getFromParam(S),C.publishSpeed(e,S)},0))},catch:function(t,r,n,i,o,s,a){var l,e,c,u,d;throw ce(n,b.hostUrl)||(l=at(b,"",n),e=(null==(e=b.api)?void 0:e.reqHeaders)||[],c=ot(null==i?void 0:i.headers,e,"req"),u=De(null==i?void 0:i.headers),d=null!=(e=b.api)&&e.apiDetail?se(null==i?void 0:i.body,null==(e=b.api)?void 0:e.reqParamHandler,{url:n}):"",setTimeout(function(){var e=ut(b,{url:n,duration:r,type:l,status:0,method:(null==i?void 0:i.method)||"get"}),e=(e.from=s||C.getFromParam(S),C.publishSpeed(e,S),"AJAX_ERROR: "+t+"\n \nreq url: "+n+"\n \nres status: 0\n \nres duration: "+e.duration+"ms\n \nreq method: "+((null==i?void 0:i.method)||"get")+"\n \nreq param: "+d+"\n \nres startTime: "+o+"\n \n"+c);C.publishNormalLog({msg:e,level:Ft.AJAX_ERROR,code:-400,trace:u,errorMsg:"",from:s||C.getFromParam(S),originFrom:a},S)},0)),t}},h=(this.hackFetchOptions=e,this.hackFetchOptions),p=null==(e=b.api)?void 0:e.ignoreHackReg;if(void 0===p&&(p=/\.flv(\?|$)/i),Pt.find(function(e){return e.name===h.name}))throw new Error("name '"+h.name+"' is already in hackFetch option list");Pt.push(h),!Nt&&window.fetch&&(Nt=!0,mt=window.fetch,window.fetch=function(e,i){void 0===i&&(i={});var o="string"==typeof e?e:null==e?void 0:e.url;if(null!=(s=null==p?void 0:p.test)&&s.call(p,o))return mt(o,i);Ot.test(o)&&(o=""+location.origin+o);var t,r,n,s=(h||{}).traceRequestHeader;s&&(t=void 0===(t=(i||{}).headers)?{}:t,r=(n=it()).host,r=(s=s.generate(o,t,{host:r,pathname:n.pathname})||{}).name,n=s.value)&&r&&(i.headers=Object.assign(t,((s={})[r]=n,s)));for(var a=new Map,l=window.location.href,c=0;c<Pt.length;c++){var u=Pt[c];try{"function"==typeof u.beforeFetch&&u.beforeFetch(o,i),"function"==typeof u.getCurrentFrom&&a.set(u.name,u.getCurrentFrom())}catch(e){}}var d=Date.now();return mt(e,i).then(function(e){for(var t=e.clone(),r=0;r<Pt.length;r++){var n=Pt[r];try{"function"==typeof n.then&&n.then(t,Date.now()-d,o,i,d,a.get(n.name),l)}catch(e){}}return e}).catch(function(e){for(var t=0;t<Pt.length;t++){var r=Pt[t];try{"function"==typeof r.catch&&r.catch(e,Date.now()-d,o,i,d,a.get(r.name),l)}catch(e){}}throw e})})},overrideXhr:function(b,S){var i,C=this,e={name:this.name,ignoreHackReg:null==(e=b.api)?void 0:e.ignoreHackReg,traceRequestHeader:null!=(e=b.api)&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return C.getFromParam(S)},send:function(h,p,f,m){var e,t,g=Date.now(),v=(((null==b?void 0:b.api)||{}).injectTraceHeader&&(t=(e=it()).host,e=(t=C.traceRequestHeader.generate(h.tdemUrl,{},{host:t,pathname:e.pathname})||{}).name,t=t.value,e)&&t&&h.setRequestHeader(e,t),h.addEventListener("loadend",function(){var c,r,e,u,d=h.tdemUrl||"";ce(d,b.hostUrl)||"abort"===h.failType||(c="",(h.failType||!h.status||400<=h.status)&&(c=h.failType||"failed"),r=Date.now()-g,e=h.getResponseHeader("content-type")||"",u=at(b,e,d),setTimeout(function(){var n=ut(b,{url:d,duration:r,type:u,status:h.status,method:h.tdemMethod||"get"});if(n.from=f||C.getFromParam(S),"fetch"===u){var e=(null==(e=b.api)?void 0:e.reqHeaders)||[],i=ot(h.tdemXhrReqHeader,e,"req"),e=(null==(e=b.api)?void 0:e.resHeaders)||[],t=h.getAllResponseHeaders().split("\r\n").reduce(function(e,t){t=t.split(": ");return t[0]&&t[1]&&(e[t[0]]=t[1]),e},{}),o=ot(t,e,"res"),s=De(h.tdemXhrReqHeader),e=null==(t=b.api)?void 0:t.apiDetail,a=e?se(p,null==(t=b.api)?void 0:t.reqParamHandler,{url:d}):"",l=e?se(h.response,null==(t=b.api)?void 0:t.resBodyHandler,{url:d}):"";try{((e,t,r,n)=>{var i,o,s;try{if("function"==typeof(null==t?void 0:t.retCodeHandlerAsync))return t.retCodeHandlerAsync(e,null==r?void 0:r.url,null==r?void 0:r.ctx,function(e){var t=e.code;null!=n&&n({code:void 0===t?$:t,isErr:e.isErr})});if("function"==typeof(null==t?void 0:t.retCodeHandler))return s=(o=t.retCodeHandler(e,null==r?void 0:r.url,null==r?void 0:r.ctx,null==r?void 0:r.payload)||{}).code,null!=n&&n({code:void 0===s?$:s,isErr:o.isErr});if(!(e="string"==typeof e?JSON.parse(e):e))return null!=n&&n({code:$,isErr:!1});"function"==typeof(null==(i=null==t?void 0:t.ret)?void 0:i.join)&&(fe=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var a=Object.getOwnPropertyNames(e).filter(function(e){return-1!==fe.indexOf(e.toLowerCase())});if(a.length)return"未知"!==(s=e[a[0]])&&""!==s||(s=$),null!=n&&n({code:""+s,isErr:0!==s&&"0"!==s&&s!==$});null!=n&&n({code:$,isErr:!1})}catch(e){null!=n&&n({code:$,isErr:!1})}})(h.response,b.api,{url:d,ctx:h,payload:p},function(e){var t=e.code,e=e.isErr,r=[c?"AJAX_ERROR: request "+c:"","fetch req url: "+d,"res status: "+(n.status||0),"res duration: "+n.duration+"ms","res startTime: "+g,i,o,"req method: "+(n.method||"GET"),"res retcode: "+t,st(a,"req param"),st(l,"res data")].filter(function(e){return e}).join("\n\n");n.ret=t,n.isErr=+e,n.payload=p,b.slowApiLog&&ct(null==n?void 0:n.duration,b,n)?C.publishNormalLog({msg:r,level:Ft.SLOW_NET_REQUEST,code:t,trace:s,errorMsg:"",from:f||C.getFromParam(S),originFrom:m},S):C.publishNormalLog({msg:r,level:lt(!!c,e),code:t,trace:s,errorMsg:"",from:f||C.getFromParam(S),originFrom:m},S),C.publishSpeed(n,S)})}catch(e){n.ret=$,C.publishSpeed(n,S)}}else n.type="static",n.urlQuery=re(d,!0),C.publishSpeed(n,S);h.removeEventListener("abort",v),h.removeEventListener("error",y),h.removeEventListener("timeout",w)},0))}),function(){h.failType="abort"}),y=function(){h.failType="error"},w=function(){h.failType="timeout"};h.addEventListener("abort",v),h.addEventListener("error",y),h.addEventListener("timeout",w)}};this.hackXHROptions=e,i=this.hackXHROptions,Mt.find(function(e){return e.name===i.name})||(Mt.push(i),!At&&window.XMLHttpRequest&&(ht=window.XMLHttpRequest.prototype.send,pt=window.XMLHttpRequest.prototype.open,ft=window.XMLHttpRequest.prototype.setRequestHeader,At=!0,window.XMLHttpRequest.prototype.open=function(){this.tdemMethod=arguments[0];var e,t=arguments[1];if(Ot.test(t)&&(t=""+location.origin+t),this.tdemUrl=t,null==(t=null==(e=i.ignoreHackReg)?void 0:e.test)||!t.call(e,this.tdemUrl))if(this.tdemXhrStartTime=Date.now(),this.sendByTdem)l.isIE()||(this.timeout=5e3);else for(var r=0;r<Mt.length;r++){var n=Mt[r];try{"function"==typeof n.open&&n.open(this)}catch(e){}}return pt.apply(this,arguments)},window.XMLHttpRequest.prototype.setRequestHeader=function(){var e,t,r;return null!=(t=null==(r=i.ignoreHackReg)?void 0:r.test)&&t.call(r,this.tdemUrl)?ft.apply(this,arguments):(t=arguments[0],r=arguments[1],this.tdemXhrReqHeader=null!=(e=this.tdemXhrReqHeader)?e:{},null!=i&&i.traceRequestHeader&&-1<["traceparent","b3","sw8","sentry-trace"].indexOf(t)&&(this.tdemXhrReqHeader[t]||(arguments[1]=r),this.tdemXhrReqHeader[t])?void 0:(this.tdemXhrReqHeader[t]=arguments[1],ft.apply(this,arguments)))},window.XMLHttpRequest.prototype.send=function(){var e,t;if(!(null!=(t=null==(e=i.ignoreHackReg)?void 0:e.test)&&t.call(e,this.tdemUrl)||this.sendByTdem))for(var r=0;r<Mt.length;r++){var n=Mt[r];try{"function"==typeof n.send&&n.send(this,arguments[0],"function"==typeof n.getCurrentFrom?n.getCurrentFrom():void 0,window.location.href)}catch(e){}}return ht.apply(this,arguments)}))},publishSpeed:function(e){},publishNormalLog:function(e,t){var r,n,i,o,s,a,l;[Ft.API_RESPONSE,Ft.AJAX_ERROR,Ft.RET_ERROR,Ft.SLOW_NET_REQUEST].includes(e.level)&&(r=(r=null==(r=e.msg)?void 0:r.match(/(?:fetch req url|req url):\s*(.+?)(?:\n|$)/))?r[1].trim():"",n=(n=null==(n=e.msg)?void 0:n.match(/req method:\s*(.+?)(?:\n|$)/i))?n[1].trim().toUpperCase():"GET",i=(i=null==(i=e.msg)?void 0:i.match(/res status:\s*(\d+)/))?parseInt(i[1],10):0,o=(o=null==(o=e.msg)?void 0:o.match(/res duration:\s*([\d.]+)ms/))?parseFloat(o[1]):0,s=(s=null==(s=e.msg)?void 0:s.match(/=+\s*res data\s*=+\s*\n([\s\S]*?)(?:\n=+|$)/))?s[1].trim().slice(0,1e3):void 0,a={},e.trace&&(a.trace_id=e.trace),[Ft.AJAX_ERROR,Ft.RET_ERROR].includes(e.level)||400<=i||0===i?(l={event_id:g(),event_type:p.API_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:e.from||(null==(l=t.getCurrentPageUrl)?void 0:l.call(t))||window.location.href,data:{url:r,measurements:{duration:o},response_body:s,replay_id:et(t),tags:0<Object.keys(a).length?a:void 0,event_properties:{http_method:n,http_status:String(i)}}},null!=(s=t.reportTDEMEvent)&&s.call(t,l)):(l={event_id:g(),event_type:p.API_CALL,event_category:m.NETWORK,timestamp:Date.now(),page_url:e.from||(null==(s=t.getCurrentPageUrl)?void 0:s.call(t))||window.location.href,data:{url:r,measurements:{duration:o},business_code:String(e.code||""),replay_id:et(t),tags:0<Object.keys(a).length?a:void 0,event_properties:{http_method:n,http_status:String(i)}}},null!=(s=t.reportTDEMEvent)&&s.call(t,l)))},destroy:function(){var t,r,e;this.option.publishSpeed=function(){},this.option.publishNormalLog=function(){},this.option.hackXHROptions&&(r=this.option.hackXHROptions,-1!==(e=Mt.findIndex(function(e){return e.name===r.name})))&&Mt.splice(e,1),this.option.hackFetchOptions&&(t=this.option.hackFetchOptions,-1!==(e=Pt.findIndex(function(e){return e.name===t.name})))&&Pt.splice(e,1),this.option.override=!1}})),Dt={},Ut=new e({name:"reportBridgeSpeed",override:!1,onNewTdem:function(e){this.override||(this.override=!0,this.overrideBridge(e))},getFromParam:function(e){return e.getCurrentPageUrl()},publishSpeed:function(t,r){this.$walk(function(e){e===r&&e.speedLogPipeline(t)})},overrideBridge:function(c){var u=this,d=c.config;d.reportBridgeSpeed&&d.h5Bridge&&d.h5BridgeFunc.length&&d.h5BridgeFunc.forEach(function(e){var l=d.h5Bridge[e];Dt[e]=l,d.h5Bridge[e]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[0],i=e[1],r=e[2],o=e[3],s=Date.now(),a=u.getFromParam(c);l(n,i,r,function(e){var t=oe(e,d.api),r=t.code,t=t.isErr,r={url:n+"-"+i,name:n+"-"+i,duration:Date.now()-s,type:"bridge",ret:r,isErr:+t,from:a};u.publishSpeed(r,c),o(e)})}})},unHackBridge:function(t){Object.keys(Dt).forEach(function(e){Dt[e]&&(t.config.h5Bridge[e]=Dt[e])}),Dt={}},destroy:function(e){this.option.publishSpeed=function(){},this.option.unHackBridge(e),this.option.override=!1}}),r=((r=gt=gt||{})[r.unknown=100]="unknown",r[r.wifi=1]="wifi",r[r.net2g=2]="net2g",r[r.net3g=3]="net3g",r[r.net4g=4]="net4g",r[r.net5g=5]="net5g",r[r.net6g=6]="net6g",(r=vt=vt||{})[r.android=1]="android",r[r.ios=2]="ios",r[r.windows=3]="windows",r[r.macos=4]="macos",r[r.linux=5]="linux",r[r.other=100]="other",(r=yt=yt||{})[r.unknown=100]="unknown",r[r.normal=0]="normal",r[r.weak=1]="weak",r[r.disconnected=2]="disconnected",new e({name:"device",onNewTdem:function(e){e.extendBean("platform",this.getPlatform()),e.extendBean("netType",gt.unknown),this.getDpi(e),this.refreshNetworkTypeToBean(e),this.refreshNetworkStatusToBean(e)},getDpi:function(e){e.extendBean("vp",Math.round(window.innerWidth)+" * "+Math.round(window.innerHeight)),window.screen&&e.extendBean("sr",Math.round(window.screen.width)+" * "+Math.round(window.screen.height))},getPlatform:function(){var t={android:/\bAndroid\s*([^;]+)/,ios:/\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/,windows:/\b(Windows NT)/,macos:/\b(Mac OS)/,linux:/\b(Linux)/i},e=Object.keys(t).find(function(e){return t[e].test(navigator.userAgent)});return e?vt[e]:vt.other},refreshNetworkTypeToBean:function(t){var r=this,e=t.config;e&&("function"==typeof e.getNetworkType?e.getNetworkType:zt)(function(e){gt[e]||(e=gt.unknown),t.extendBean("netType",e),r.NetworkRefreshTimer=setTimeout(function(){r.refreshNetworkTypeToBean(t),clearTimeout(r.NetworkRefreshTimer)},1e4)})},refreshNetworkStatusToBean:function(t){var e,r=this,n=t.config;n&&null!=(e="function"==typeof n.getNetworkStatus?n.getNetworkStatus:e)&&e(function(e){void 0===yt[e]&&(e=yt.unknown),t.extendBean("netStatus",e),r.NetworkStatusRefreshTimer=setTimeout(function(){r.refreshNetworkStatusToBean(t),clearTimeout(r.NetworkStatusRefreshTimer)},1e4)})}})),zt=function(e){var t="",r=navigator.userAgent.match(/NetType\/(\w+)/);r?t=r[1]:navigator.connection&&(t=navigator.connection.effectiveType||navigator.connection.type),e((r=t=t||$,0<=(r=String(r).toLowerCase()).indexOf("4g")?gt.net4g:0<=r.indexOf("wifi")?gt.wifi:0<=r.indexOf("5g")?gt.net5g:0<=r.indexOf("6g")?gt.net6g:0<=r.indexOf("3g")?gt.net3g:0<=r.indexOf("2g")?gt.net2g:gt.unknown))},Wt=window.WebSocket,Gt=[],Ht={construct:function(e,t){var n=new e(t[0],t[1]);return n.originSend=n.send,n.addEventListener("error",function(e){var e=(null==e?void 0:e.currentTarget)||{},t=e.url,r=e.readyState;null!=Gt&&Gt.forEach(function(e){e=e.onErr;null!=e&&e({msg:"无法获知具体错误信息,需在浏览器控制台查看!",readyState:r,connectUrl:t})})}),Object.defineProperty(n,"send",{get:function(){return function(e){null!=(t=n.originSend)&&t.call(n,e);var t=n.readyState;if(t!==WebSocket.OPEN){var r={readyState:t,connectUrl:n.url};switch(t){case WebSocket.CLOSED:Gt.forEach(function(e){e=e.sendErr;null!=e&&e(f({msg:"消息发送失败,连接已关闭!"},r))});break;case WebSocket.CONNECTING:Gt.forEach(function(e){(0,e.sendErr)(f({msg:"消息发送失败,正在连接中!"},r))});break;case WebSocket.CLOSING:Gt.forEach(function(e){(0,e.sendErr)(f({msg:"消息发送失败,连接正在关闭!"},r))})}}}}}),n}},jt=new e({name:"onError"}),Zt=jt=new e({name:"onError",onNewTdem:function(e){this.startListen(e)},getFromParam:function(e){return e.getCurrentPageUrl()},startListen:function(l){function e(e){var t,r=e&&ae(e.reason);r&&(t=[{type:(null==(t=e.reason)?void 0:t.name)||"PromiseRejection",value:(null==(t=e.reason)?void 0:t.message)||String(r),mechanism_type:"unhandledrejection",mechanism_handled:0}],r=e.reason instanceof Error?Ce(e.reason):[],e={event_id:g(),event_type:p.PROMISE_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:c.getFromParam(l),data:{exception_stacks:t,exception_frames:r,replay_id:et(l),tags:{environment:l.config.env||"production"}}},null!=(t=l.reportTDEMEvent))&&t.call(l,e)}function t(e){if(e=(null==e?void 0:e.target)||(null==e?void 0:e.srcElement)){var t=e.src||e.href||"",r=e.tagName,r=(void 0===r?"script":r).toLowerCase(),n=["audio","video"].includes(r);if(!n||null!=e&&e.error){if(!(ce(i=t,l.config.hostUrl)||-1<window.location.href.indexOf(i))){var i="other";if(/\.js$/.test(t)||"script"===r)i="script";else if(/\.css$/.test(t)||"link"===r)i="stylesheet";else if("img"===r)i="image";else{if(!n)return;i="media"}t={event_id:g(),event_type:p.RESOURCE_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:c.getFromParam(l),data:{url:t,resource_type:i,replay_id:et(l),tags:f({environment:l.config.env||"production"},n&&null!=e&&e.error?{error_code:String(e.error.code),error_message:e.error.message||""}:{}),event_properties:{element_tag:r}}};null!=(i=l.reportTDEMEvent)&&i.call(l,t)}}else console.log("may be media load success because error is undefine")}}var r,n,i,o,c=this,u=window.onerror;window.onerror=function(e,t,r,n,i){var o,s,a=ae(e);"string"!=typeof(o=a)||!o||j.some(function(e){return-1<o.indexOf(e)})||H.some(function(e){return-1<o.indexOf(e)})||(a=[{type:(null==i?void 0:i.name)||"Error",value:String(e),mechanism_type:"onerror",mechanism_handled:0}],s=i?Ce(i):[{abs_path:t||"",colno:n||0,filename:(null==t?void 0:t.split("/").pop())||"",function:"(anonymous)",lineno:r||0,in_app:1,stack_level:0}],a={event_id:g(),event_type:p.JS_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:c.getFromParam(l),data:{exception_stacks:a,exception_frames:s,replay_id:et(l),tags:{environment:l.config.env||"production",version:String(l.config.version||"")}}},null!=(s=l.reportTDEMEvent)&&s.call(l,a)),null!=u&&u.call(window,e,t,r,n,i)},window.addEventListener("unhandledrejection",e);window.document.addEventListener("error",t,!0),l.lifeCycle.on("destroy",function(){0===jt.countInstance()&&(window.removeEventListener("unhandledrejection",e),window.document.removeEventListener("error",t,!0))}),l.config.websocketHack&&(r={key:l.config.id+"-"+this.name,onErr:function(e){var t;null!=(t=c.publishWsErrorLog)&&t.call(c,e,l)},sendErr:function(e){var t;null!=(t=c.publishWsErrorLog)&&t.call(c,e,l)}},this.hackWebsocketConfig=r,r=this.hackWebsocketConfig,window.Proxy)&&window.WebSocket&&(n=window.WebSocket,window&&!n.isHack&&(i=new Proxy(WebSocket,Ht),n.isHack=!0,window.WebSocket=i),o=r,Gt.find(function(e){return e.key===o.key})||o&&Gt.push(o))},publishWsErrorLog:function(e,r){var t=e.connectUrl,n=e.msg,e=e.readyState,i={event_id:g(),event_type:p.JS_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:this.getFromParam(r),data:{exception_stacks:[{type:"WebSocketError",value:"WEBSOCKET_ERROR: connect: "+t+" readyState: "+e+" msg: "+n,mechanism_type:"websocket",mechanism_handled:0}],exception_frames:[],replay_id:et(r),tags:{environment:r.config.env||"production",websocket_url:t||"",websocket_ready_state:String(null!=e?e:"")}}};this.$walk(function(e){var t;e===r&&null!=(t=e.reportTDEMEvent)&&t.call(e,i)})},destroy:function(){var t,e;this.option.hackWebsocketConfig&&(t=this.option.hackWebsocketConfig,window.WebSocket=Wt,-1!==(e=Gt.findIndex(function(e){return e.key===t.key})))&&Gt.splice(e,1)}}),Vt=(new e({name:"clickElementLog"}),function(e){if(""!==e.id&&e.id)return'id("'+e.id+'")';if(e===document.body)return e.tagName;if(e instanceof Document)return"document";var t=0;if(e.parentNode)for(var r=e.parentNode.childNodes,n=0;n<r.length;n+=1){var i=r[n];if(i===e)return Vt(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&(t+=1)}return 0}),Yt=function(e){return e instanceof Array?new Map(e.map(function(e){return[e,!0]})):new Map},Xt=function(e,t){return"string"==typeof e?e.split(t):[]},Kt=function(e){if(3===e.nodeType||4===e.nodeType)return e.nodeValue||"";if(1!==e.nodeType)return"";if("string"==typeof e.textContent)return e.textContent;for(var t="",r=e.firstChild;r;r=r.nextSibling)t+=Kt(r);return t},Jt=new e({name:"clickElementLog",listeners:[],onNewTdem:function(e){this.startListen(e)},startListen:function(s){for(var e=function(o){t.listeners.push(((e,t,r,n)=>{function i(e){var t=document.documentElement;t&&r.call(t,e,e.target)}return void 0===n&&(n=!0),e.addEventListener(t,i,n),{destroy:function(){e.removeEventListener(t,i,n)}}})(document,o,function(e,t){var r,n,i;t&&!((e,t)=>{r=Yt((null==(r=(e=e).ignoreElements)?void 0:r.ignoreClasses)||[])||new Map;for(var r,n=(e={ignoreIds:Yt((null==(e=e.ignoreElements)?void 0:e.ignoreIds)||[])||new Map,ignoreClasses:r}).ignoreClasses,i=e.ignoreIds,o=!(0===i.size&&0===n.size),s=t,a=(Xt(t.getAttribute("id")||""," "),Xt(t.getAttribute("class")||"",""),0),l=!1;s&&o&&s.getAttribute;){if(l)return!0;if(10<=a)break;for(var c=Xt(s.getAttribute("id")||""," "),u=Xt(s.getAttribute("class")||"",""),d=0,h=c;d<h.length;d++){var p=h[d];if(i.has(p)){l=!0;break}}for(var f=0,m=u;f<m.length;f++){var g=m[f];if(n.has(g)){l=!0;break}}a+=1,s=s.parentNode||s.parentElement}return!1})(s.config,t)&&(i=Vt(t),r=dt(t),n=t.getBoundingClientRect&&t.getBoundingClientRect(),i={event_id:g(),event_type:p.CLICK,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:window.location.href,data:{target_element:String(i),target_text:r.slice(0,127),click_position:n?{x:parseInt(String(n.left+window.scrollX),10)||0,y:parseInt(String(n.top+window.scrollY),10)||0}:void 0,replay_id:et(s),tags:{environment:s.config.env||"production",event_op:o,node_name:(null==t?void 0:t.nodeName)||""},event_properties:{target_id:t.id||"",target_class:"string"==typeof t.className?t.className.slice(0,128):""}}},null!=(r=s.reportTDEMEvent))&&r.call(s,i)},!0))},t=this,r=0,n=Object.entries({click:1,longpress:2});r<n.length;r++)e(n[r][0])},destroy:function(){this.listeners.forEach(function(e){return e.destroy()}),this.listeners=[]}}),qt=(new e({name:"consoleLog"}),{log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace}),$t=new e({name:"consoleLog",onNewTdem:function(e){this.startListen(e)},startListen:function(e){var c;c=e,["log","error","warn","info","debug","trace"].forEach(function(a){var l=qt[a];console[a]=function(){for(var e,t,r,n,i,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];try{l.apply(console,o),!c.isWhiteList&&["log","info","debug","trace"].includes(a)||(n=o.map(function(e){if("object"==typeof e&&null!==e)try{return JSON.stringify(e)}catch(e){}return String(e)}).join(" "),i={event_id:g(),event_type:p.LOG,event_category:m.LOG,timestamp:Date.now(),page_url:(null==(e=c.getOriginFrom)?void 0:e.call(c))||("undefined"!=typeof window?null==(t=window.location)?void 0:t.href:""),data:{log_level:"error"===a?"error":"info",replay_id:et(c),tags:{console_method:a},event_properties:{message:("console."+a+": "+n).slice(0,2048)}}},null!=(r=c.reportTDEMEvent)&&r.call(c,i))}catch(e){qt.error("Console hook error:",e)}}})},destroy:function(){Object.keys(qt).forEach(function(e){console[e]=qt[e]})}});function Qt(){Ct=[],bt=-1,wt=null,Tt(addEventListener)}kt={passive:!0,capture:!0},_t=new Date,It=function(e,t){wt||(wt=t,bt=e,St=new Date,Tt(removeEventListener),Et())},Et=function(){var t;0<=bt&&bt<St-_t&&(t={entryType:"first-input",name:wt.type,target:wt.target,cancelable:wt.cancelable,startTime:wt.timeStamp,processingStart:wt.timeStamp+bt},Ct.forEach(function(e){e(t)}),Ct=[])},xt=function(e){var t,r,n,i,o,s;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(r=t,n=e,i=function(){It(r,n),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,kt),removeEventListener("pointercancel",o,kt)},addEventListener("pointerup",i,kt),addEventListener("pointercancel",o,kt)):It(t,e))},Tt=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,xt,kt)})},Rt="hidden"===document.visibilityState?0:1/0,addEventListener("visibilitychange",function e(t){"hidden"===document.visibilityState&&(Rt=t.timeStamp,removeEventListener("visibilitychange",e,!0))},!0),Qt(),self.webVitals={firstInputPolyfill:function(e){Ct.push(e),Et()},resetFirstInputPolyfill:Qt,get firstHiddenTime(){return Rt}};function er(e,t){var r=_r(),n="navigate";return 0<=Cr?n="back-forward-cache":r&&(document.prerendering||0<Ir()?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}}function tr(e,t,r){try{var n;if(PerformanceObserver.supportedEntryTypes.includes(e))return(n=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},r||{})),n}catch(e){}}function rr(t,r,n,i){var o,s;return function(e){0<=r.value&&(e||i)&&((s=r.value-(o||0))||void 0===o)&&(o=r.value,r.delta=s,r.rating=(e=r.value)>n[1]?"poor":e>n[0]?"needs-improvement":"good",t(r))}}function nr(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function ir(t){function e(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)}addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)}function or(t){var r=!1;return function(e){r||(t(e),r=!0)}}function sr(){return Er<0&&(Er=xr(),Rr(),kr(function(){setTimeout(function(){Er=xr(),Rr()},0)})),{get firstHiddenTime(){return Er}}}function ar(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function lr(o,s){s=s||{},ar(function(){var t,r=sr(),n=er("FCP"),i=tr("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime)&&(n.value=Math.max(e.startTime-Ir(),0),n.entries.push(e),t(!0))})});i&&(t=rr(o,n,Mr,s.reportAllChanges),kr(function(e){n=er("FCP"),t=rr(o,n,Mr,s.reportAllChanges),nr(function(){n.value=performance.now()-e.timeStamp,t(!0)})}))})}function cr(e){var t,r,n,i,o,s;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(r=t,n=e,i=function(){Lr(r,n),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,Nr),removeEventListener("pointercancel",o,Nr)},addEventListener("pointerup",i,Nr),addEventListener("pointercancel",o,Nr)):Lr(t,e))}function ur(e){e.forEach(function(e){e.interactionId&&(zr=Math.min(zr,e.interactionId),Wr=Math.max(Wr,e.interactionId),Ur=Wr?(Wr-zr)/7+1:0)})}function dr(){return Gr()-jr}function hr(e){var t=Zr[Zr.length-1],r=Vr[e.interactionId];(r||Zr.length<10||e.duration>t.latency)&&(r?(r.entries.push(e),r.latency=Math.max(r.latency,e.duration)):(t={id:e.interactionId,latency:e.duration,entries:[e]},Vr[t.id]=t,Zr.push(t)),Zr.sort(function(e,t){return t.latency-e.latency}),Zr.splice(10).forEach(function(e){delete Vr[e.id]}))}function pr(e,t){function r(t,r,n,i){function o(e){"visibilitychange"===t&&"hidden"!==document.visibilityState||(i?setTimeout(function(){return r(e)},i):r(e),n&&removeEventListener(t,o,!0))}addEventListener(t,o,!0)}var n;r("visibilitychange",e,null==t?void 0:t.once,null==(n=null==t?void 0:t.delay)?void 0:n.visibilitychange),r("pagehide",e,null==t?void 0:t.once,null==(n=null==t?void 0:t.delay)?void 0:n.pagehide),r("beforeunload",e,null==t?void 0:t.once,null==(n=null==t?void 0:t.delay)?void 0:n.beforeunload)}function fr(e){var t=e.name;0<(e=e.value)&&(Jr[t]=e)}function mr(e,t,r,n){return void 0===r&&(r=15e3),void 0===n&&(n=0),(t=void 0===t?0:t)<=e&&e<=r?e:n}var gr,vr,yr,wr,br,Sr,Cr=-1,kr=function(t){addEventListener("pageshow",function(e){e.persisted&&(Cr=e.timeStamp,t(e))},!0)},_r=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Ir=function(){var e=_r();return e&&e.activationStart||0},Er=-1,xr=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Tr=function(e){"hidden"===document.visibilityState&&-1<Er&&(Er="visibilitychange"===e.type?e.timeStamp:0,Ar())},Rr=function(){addEventListener("visibilitychange",Tr,!0),addEventListener("prerenderingchange",Tr,!0)},Ar=function(){removeEventListener("visibilitychange",Tr,!0),removeEventListener("prerenderingchange",Tr,!0)},Mr=[1800,3e3],Or=[.1,.25],Nr={passive:!0,capture:!0},Pr=new Date,Lr=function(e,t){gr||(gr=t,vr=e,yr=new Date,Br(removeEventListener),Fr())},Fr=function(){var t;0<=vr&&vr<yr-Pr&&(t={entryType:"first-input",name:gr.type,target:gr.target,cancelable:gr.cancelable,startTime:gr.timeStamp,processingStart:gr.timeStamp+vr},wr.forEach(function(e){e(t)}),wr=[])},Br=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,cr,Nr)})},Dr=[100,300],Ur=0,zr=1/0,Wr=0,Gr=function(){return br?Ur:performance.interactionCount||0},Hr=[200,500],jr=0,Zr=[],Vr={},Yr=[2500,4e3],Xr={},Kr=(sn.prototype.start=function(){var t=this,r=new PerformanceObserver(function(e){e=e.getEntriesByName("first-contentful-paint");0<e.length&&(t.fcp=e[0].startTime,t.slientWindowStartTime=t.fcp,r.disconnect(),setTimeout(function(){t.checkTTI()},Math.max(t.slienceTimeInterval-(performance.now()-t.fcp)+20,1)))});r.observe({entryTypes:["paint"]}),this.longtaskObserver=new PerformanceObserver(function(e){e=e.getEntries();t.longTaskEntries=t.longTaskEntries.concat(e)}),this.longtaskObserver.observe({entryTypes:["longtask"]}),this.resourceObserver=new PerformanceObserver(function(e){e=e.getEntries();t.resourceEntries=t.resourceEntries.concat(e)}),this.resourceObserver.observe({entryTypes:["resource"]})},sn.prototype.checkTTI=function(){var e=this;this.hasSlientWindow()?(this.calculateTTI(),this.longtaskObserver.disconnect(),this.resourceObserver.disconnect()):setTimeout(function(){e.checkTTI()},this.checkInterval)},sn.prototype.hasSlientWindow=function(){var e,t=performance.now();return!(t-this.slientWindowStartTime<5e3||((e=this.getLastLongTaskEndTime())>this.slientWindowStartTime?(this.slientWindowStartTime=e,this.resourceEntries=[]):this.getRequestCount(this.slientWindowStartTime,t)<=2?(this.lastLongtaskEndTime=e,0):(t=this.resourceEntries.sort(function(e,t){return e.startTime-t.startTime}),this.slientWindowStartTime=t[this.resourceEntries.length-2].startTime,1)))},sn.prototype.getLastLongTaskEndTime=function(){var t;return 0===this.longTaskEntries.length?-1:(t=0,this.longTaskEntries.forEach(function(e){e.startTime+e.duration>t&&(t=e.startTime+e.duration)}),t)},sn.prototype.getRequestCount=function(t,r){var n=0;return this.resourceEntries.forEach(function(e){e.startTime>=t&&e.startTime+e.duration<=r&&(n+=1)}),n},sn.prototype.calculateTTI=function(){var e=-1===this.lastLongtaskEndTime?this.slientWindowStartTime:this.lastLongtaskEndTime,t=performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,e=Math.max(t,e);this.onTTICallback(e)},sn),Jr=(new e({name:"webVitals"}),{FCP:-1,LCP:-1,FID:-1,CLS:-1,INP:-1,TTI:-1,from:void 0}),qr=new Map,$r=new e({name:"webVitals",onNewTdem:function(e){var t,r,o,s,a,l,c,u,d,h,n=this;if($e()&&"function"==typeof window.PerformanceObserver&&"function"==typeof performance.getEntriesByName)try{qr.set(e,{isWebVitalsReported:!1,hasFirstEntry:!1,custom:null}),lr(fr),d=fr,h={},ar(function(){function e(e){(e=e[e.length-1])&&e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-Ir(),0),i.entries=[e],t())}var t,r,n=sr(),i=er("LCP"),o=tr("largest-contentful-paint",e);o&&(t=rr(d,i,Yr,h.reportAllChanges),r=or(function(){Xr[i.id]||(e(o.takeRecords()),o.disconnect(),Xr[i.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(r,0)},!0)}),ir(r),kr(function(e){i=er("LCP"),t=rr(d,i,Yr,h.reportAllChanges),nr(function(){i.value=performance.now()-e.timeStamp,Xr[i.id]=!0,t(!0)})}))}),c=fr,u={},ar(function(){function t(e){e.startTime<r.firstHiddenTime&&(n.value=e.processingStart-e.startTime,n.entries.push(e),o(!0))}function e(e){e.forEach(t)}var r=sr(),n=er("FID"),i=tr("first-input",e),o=rr(c,n,Dr,u.reportAllChanges);i&&ir(or(function(){e(i.takeRecords()),i.disconnect()})),i&&kr(function(){n=er("FID"),o=rr(c,n,Dr,u.reportAllChanges),wr=[],vr=-1,gr=null,Br(addEventListener),wr.push(t),Fr()})}),a=fr,l={},lr(or(function(){function e(e){e.forEach(function(e){var t,r;e.hadRecentInput||(t=i[0],r=i[i.length-1],n&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(n+=e.value,i.push(e)):(n=e.value,i=[e]))}),n>r.value&&(r.value=n,r.entries=i,t())}var t,r=er("CLS",0),n=0,i=[],o=tr("layout-shift",e);o&&(t=rr(a,r,Or,l.reportAllChanges),ir(function(){e(o.takeRecords()),t(!0)}),kr(function(){r=er("CLS",n=0),t=rr(a,r,Or,l.reportAllChanges),nr(function(){return t()})}),setTimeout(t,0))})),o=fr,s={},ar(function(){var e;"interactionCount"in performance||(br=br||tr("event",ur,{type:"event",buffered:!0,durationThreshold:0}));function t(e){e.forEach(function(t){t.interactionId&&hr(t),"first-input"!==t.entryType||Zr.some(function(e){return e.entries.some(function(e){return t.duration===e.duration&&t.startTime===e.startTime})})||hr(t)}),e=Math.min(Zr.length-1,Math.floor(dr()/50)),(e=Zr[e])&&e.latency!==r.value&&(r.value=e.latency,r.entries=e.entries,i())}var r=er("INP"),n=tr("event",t,{durationThreshold:null!=(e=s.durationThreshold)?e:40}),i=rr(o,r,Hr,s.reportAllChanges);n&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&n.observe({type:"first-input",buffered:!0}),ir(function(){t(n.takeRecords()),r.value<0&&0<dr()&&(r.value=0,r.entries=[]),i(!0)}),kr(function(){Zr=[],jr=Gr(),r=er("INP"),i=rr(o,r,Hr,s.reportAllChanges)}))}),r=function(e){fr({name:"TTI",value:e})},$e()&&new Kr(r).start(),pr(function(){n.tryReport(e,null,"onHidden")},{once:!0,delay:{visibilitychange:10}}),Jr.from=null==(t=e)?void 0:t.getCurrentPageUrl()}catch(e){}},tryReport:function(t,r,n){var i=this;void 0===n&&(n="manual"),this.$walk(function(e){e===t&&("object"==typeof(e=i.$getConfig(t))&&!0===e.manualReport||"onHidden"!==n?(e=qr.get(t))&&!e.hasFirstEntry?(e.hasFirstEntry=!0,"manual"===n&&r&&(e.custom=r)):i.doReport(t,(null==e?void 0:e.custom)||r):i.doReport(t,null))})},doReport:function(o,s){var e=qr.get(o);if(e){if(null!=e&&e.isWebVitalsReported)return;e.isWebVitalsReported=!0}this.$walk(function(e){var t,r,n,i;e===o&&(t=f({},Jr),s&&Object.keys(s).forEach(function(e){null!=s[e]&&(t[e]=s[e])}),r={environment:e.config.env||"production",version:String(e.config.version||"")},n={},0<t.LCP&&(n.lcp=t.LCP),0<t.FCP&&(n.fcp=t.FCP),0<t.FID&&(n.fid=t.FID),0<=t.CLS&&(n.cls=t.CLS),0<t.TTFB&&(n.ttfb=t.TTFB),0<t.TTI&&(n.tti=t.TTI),0<t.INP&&(n.inp=t.INP),i={event_id:g(),event_type:p.true,event_category:m.PERFORMANCE,timestamp:Date.now(),page_url:t.from||(null==(i=e.getCurrentPageUrl)?void 0:i.call(e))||window.location.href,data:{measurements:n,replay_id:et(e),tags:r}},null!=(n=e.reportTDEMEvent))&&n.call(e,i)})},publish:function(e,t){this.tryReport(e,t,"manual")},destroy:function(){this.option.publish=function(){}}}),Qr=(new e({name:"pagePerformance"}),3),en=new Map,tn=new e({name:"pagePerformance",performanceMap:{},onNewTdem:function(t){var e;$e()&&(en.set(t,{isPagePerformanceReported:!1}),Sr?this.publish(Sr,t):this.startCalcPerformance(t),e=this.publishWhenObHidden.bind(this,t),pr(e,{once:!0}),t.lifeCycle.on("destroy",function(){var e=en.get(t);e&&(e.isPagePerformanceReported=!1)}))},publishWhenObHidden:function(e){var t,r=en.get(e);if(null==r||!r.isPagePerformanceReported){r=0;if(null!=(t=e.firstScreenInfo)&&t.timing)r=e.firstScreenInfo.timing;else if(Qe("paint"))try{var n,i=performance.getEntriesByName("first-contentful-paint");i&&0<i.length&&(n=i[0])&&0<n.startTime&&(r=n.startTime)}catch(e){}(Sr=this.buildPerformanceLog(e,r,this.getPageUrl(e),window.location.href))&&this.publish(Sr,e,!0)}},buildPerformanceLog:function(e,t,r,n){var i=performance.timing;if(i)return r={from:r,originFrom:n,dnsLookup:mr(i.domainLookupEnd-i.domainLookupStart),tcp:mr(i.connectEnd-i.connectStart),ssl:mr(0===i.secureConnectionStart?0:i.requestStart-i.secureConnectionStart),ttfb:mr(i.responseStart-i.requestStart),contentDownload:mr(i.responseEnd-i.responseStart),domParse:mr(i.domInteractive-i.domLoading,0,15e3,1070),resourceDownload:mr(i.loadEventStart-i.domInteractive,0,15e3,1070),firstScreenTiming:mr(Math.floor(t),0,15e3,15e3)},(n=e.config).extraPerformanceData&&"{}"!==JSON.stringify(n.extraPerformanceData)&&(t=(i=n.extraPerformanceData).engineInit,e=i.bundleLoad,r=f(f({},r),{engineInit:mr(t,0,1e4),bundleLoad:mr(e,0,1e4)})),r},publish:function(n,i){var o=this;this.$walk(function(e){var t,r;e===i&&(r=(t=performance.timing).navigationStart,t={event_id:g(),event_type:p.PAGE_LOAD,event_category:m.PERFORMANCE,timestamp:Date.now(),page_url:n.originFrom||window.location.href,data:{measurements:{lcp:Jr.lcp,fcp:Jr.fcp,fid:Jr.fid,cls:Jr.cls,ttfb:Jr.ttfb||n.ttfb,dns_time:n.dnsLookup,tcp_time:n.tcp,ssl_time:n.ssl,request_time:n.ttfb,response_time:n.contentDownload,dom_parse_time:n.domParse,dom_ready:t.domContentLoadedEventEnd-r,load_complete:t.loadEventEnd-r,first_screen_time:n.firstScreenTiming},replay_id:et(e),device_type:o.getDeviceType(),tags:{environment:e.config.env||"production",version:String(e.config.version||"")}}},null!=(r=e.reportTDEMEvent)&&r.call(e,t),r=en.get(e))&&(r.isPagePerformanceReported=!0)})},getPageUrl:function(e){var t=this.$getConfig(e);if(null!=t&&t.urlHandler&&"function"==typeof(null==t?void 0:t.urlHandler)){t=null==t?void 0:t.urlHandler();if(t)return encodeURIComponent(t)}return e.getCurrentPageUrl()},getDeviceType:function(){var e=navigator.userAgent;return/mobile/i.test(e)?"Mobile":/tablet|ipad/i.test(e)?"Tablet":"Desktop"},startCalcPerformance:function(t){var r=this;try{var n=this.getPageUrl(t),i=t.getOriginFrom();this.getFirstScreenTiming(t,function(e){Sr=r.buildPerformanceLog(t,e,n,i);e=en.get(t);!Sr||null!=e&&e.isPagePerformanceReported||r.publish(Sr,t)})}catch(t){}},getFirstScreenTiming:function(a,l){var c=this;a.lifeCycle.on("destroy",function(){g&&clearTimeout(g)});var u,d=this,r=["script","style","link","br"],h=[],p={},f=(Qe("paint")&&(u=new PerformanceObserver(function(e){e.getEntries().forEach(function(e){var t;"paint"===e.entryType&&"first-contentful-paint"===e.name&&0<(t=document.querySelectorAll("[TDEM-FIRST-SCREEN-TIMING],[AEGIS-FIRST-SCREEN-TIMING]")).length&&a.config.id&&!c.performanceMap[a.config.id]&&(c.setFirstScreenInfo(a,e.startTime,t[0],t),null!=l&&l(e.startTime),f.disconnect(),u.disconnect(),g)&&clearTimeout(g)})})).observe({entryTypes:["paint"]}),new MutationObserver(function(e){var t={roots:[],ignores:[],rootsDomNum:[],time:performance.now()};e.forEach(function(e){e&&e.addedNodes&&Array.prototype.slice.call(e.addedNodes).forEach(function(e){d.isEleInArray(e,t.ignores)?t.ignores.push(e):1===e.nodeType&&(e.hasAttribute("TDEM-FIRST-SCREEN-TIMING")||e.hasAttribute("AEGIS-FIRST-SCREEN-TIMING"))?(Object.prototype.hasOwnProperty.apply(p,[t.time])||(p[t.time]=[]),p[t.time].push(e)):1===e.nodeType&&(d.hasAncestorOrSelfWithAttribute(e,"TDEM-IGNORE-FIRST-SCREEN-TIMING")?t.ignores.push(e):-1!==r.indexOf(e.nodeName.toLocaleLowerCase())||d.isEleInArray(e,t.roots)||(t.roots.push(e),t.rootsDomNum.push(d.walkAndCount(e)||0)))})}),t.roots.length&&h.push(t)})),m=(f.observe(document,{childList:!0,subtree:!0}),function(r){(r=void 0===r?0:r)||(n=0,(e=Object.keys(p)).length?(r=Math.max.apply(null,e),c.setFirstScreenInfo(a,r,null==(e=p[r])?void 0:e[0],p)):h.forEach(function(e){for(var t=0;t<e.roots.length;t++)e.rootsDomNum[t]>n&&d.isInFirstScreen(e.roots[t])&&(n=e.rootsDomNum[t],r=e.time,c.setFirstScreenInfo(a,r,e.roots[t]))}),h.length=0,Object.keys(p).forEach(function(e){p[e]=p[e].map(function(e){var t={tagName:e.tagName},r=e.attributes;if(!r)return e;for(var n=0;n<r.length;n++){var i=r[n];i.name&&(t[i.name]=e.getAttribute(i.name))}return t})}));var n,e=performance.timing,t=e.domInteractive-e.domLoading,i=r;g=null;for(var o=0,s=[t,e.loadEventStart-e.domInteractive,i];o<s.length;o++)if(s[o]<=0&&0<Qr){g=setTimeout(function(){return m(i)},3e3);break}g?--Qr:(f.disconnect(),null!=u&&u.disconnect(),null!=l&&l(r))}),g=setTimeout(function(){return m()},3e3)},setFirstScreenInfo:function(e,t,r,n){var i;e.config.id&&this.performanceMap[e.config.id]||(e.config.id&&(this.performanceMap[e.config.id]=!0),("object"!=typeof(null==(i=e.config)?void 0:i.pagePerformance)||null!=(i=e.config.pagePerformance)&&i.firstScreenInfo)&&(e.firstScreenInfo={element:r,timing:t,markDoms:n}))},isEleInArray:function(e,t){return!(!e||e===document.documentElement)&&(-1!==t.indexOf(e)||this.isEleInArray(e.parentElement,t))},isInFirstScreen:function(e){var t;return!(!e||"function"!=typeof e.getBoundingClientRect)&&(e=e.getBoundingClientRect(),t=window.innerHeight,0<=e.left)&&e.left<window.innerWidth&&0<=e.top&&e.top<t&&0<e.width&&0<e.height},walkAndCount:function(e){var t=0;if(e&&1===e.nodeType){t+=1;var r=e.children;if(null!=r&&r.length)for(var n=0;n<r.length;n++)1===r[n].nodeType&&(r[n].hasAttribute("TDEM-IGNORE-FIRST-SCREEN-TIMING")||r[n].hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING"))||(t+=this.walkAndCount(r[n]))}return t},hasAncestorOrSelfWithAttribute:function(e,t){for(var r=t.replace(/^TDEM-/,"AEGIS-"),n=e;n&&n!==document.body;){if(n.hasAttribute(t)||r!==t&&n.hasAttribute(r))return!0;n=n.parentElement}return!1}}),rn=(new e({name:"spa"}),["replaceState","pushState","popstate","hashchange"]),nn=new e({name:"spa",originFireUrl:"",lastPageUrl:"",navigationStack:[],navigationIndex:-1,onNewTdem:function(r){var n=this,e=(history.pushState=this.wr("pushState")||history.pushState,history.replaceState=this.wr("replaceState")||history.replaceState,this.sendPv=this.sendPv.bind(this),location.href);this.navigationStack.length||(this.navigationStack=[e],this.navigationIndex=0),r.config.spa&&this.sendPv(r,"reload"),rn.forEach(function(e){var t=e;window.addEventListener(e,function(){return n.sendPv.call(n,r,t)})})},wr:function(r){var n=history[r],e="__"+r+"__hasWrittenByTamSpa";return"function"==typeof n&&!history[e]&&(Object.defineProperty(history,e,{value:!0,enumerable:!1}),function(){var e=n.apply(this,arguments),t=null;return"function"==typeof Event?t=new Event(r):(t=document.createEvent("HTMLEvents")).initEvent(r,!1,!0),window.dispatchEvent(t),e})},resolveNavigationType:function(e,t){var r;return"pushState"===e?(this.navigationIndex<this.navigationStack.length-1&&(this.navigationStack=this.navigationStack.slice(0,this.navigationIndex+1)),this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"push"):"replaceState"===e?(this.navigationIndex<0?(this.navigationStack=[t],this.navigationIndex=0):this.navigationStack[this.navigationIndex]=t,"replace"):"hashchange"===e?"hashchange":"popstate"===e?0<=(e=this.navigationStack.lastIndexOf(t))?(r=e<this.navigationIndex?"back":"forward",this.navigationIndex=e,r):(this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"forward"):"reload"},sendPv:function(a,e){var l=this;void 0===e&&(e="reload"),setTimeout(function(){a._customPageUrl=null;var n=location.pathname+location.hash+a.config.id,i=a.getOriginFrom(),o=l.lastPageUrl||void 0,s=l.resolveNavigationType(e,location.href);l.$walk(function(e){var t,r;e===a&&n&&n!==l.originFireUrl&&(r={event_id:g(),event_type:p.PAGE_VIEW,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:i,data:{page_title:document.title||"",referrer:document.referrer||void 0,is_effective_action:!0,replay_id:et(e),tags:{environment:e.config.env||"production",version:String(e.config.version||""),is_spa:"true"},event_properties:{navigation_type:s,from_page:(o||"").slice(0,512),to_page:(i||"").slice(0,512)}}},null!=(t=e.reportTDEMEvent)&&t.call(e,r),l.originFireUrl=n,l.lastPageUrl=i)})},0)},destroy:function(){this.option.sendPv=function(){}}}),on="__MONITOR_SESSION_V1__";function sn(e){this.slienceTimeInterval=5e3,this.checkInterval=100,this.fcp=0,this.longTaskEntries=[],this.resourceEntries=[],this.slientWindowStartTime=performance.now(),this.onTTICallback=e}function an(e){try{sessionStorage.setItem("__MONITOR_SESSION_V1__",JSON.stringify(e))}catch(e){}}function ln(e,t){var r;return"undefined"==typeof window?{sessionId:t(),createdAt:Date.now(),lastActivity:Date.now(),source:e,version:1}:null!=(r=window[on])&&r.sessionId?(r.lastActivity=Date.now(),an(r),r):(r=(()=>{try{var e,t,r=sessionStorage.getItem("__MONITOR_SESSION_V1__");return r?"string"!=typeof(e=JSON.parse(r)).sessionId||"number"!=typeof e.createdAt||"number"!=typeof e.lastActivity||36e5<(t=Date.now())-e.createdAt||9e5<t-e.lastActivity?null:(e.lastActivity=t,e):null}catch(r){return null}})())?(an(window[on]=r),r):(r={sessionId:t(),createdAt:Date.now(),lastActivity:Date.now(),source:e,version:1},an(window[on]=r),r)}function cn(e,t){var r,n;"undefined"!=typeof window&&(r=Date.now(),(n=window[on])?(n.sessionId=e,n.version+=1,n.source=t,n.createdAt=r,n.lastActivity=r):window[on]={sessionId:e,createdAt:r,lastActivity:r,source:t,version:1},an(window[on]),window.dispatchEvent(new CustomEvent("monitor-session-update",{detail:{sessionId:e,source:t}})))}var un,dn,hn=new Map,n=(P(dn=pn,n=un=Je),dn.prototype=null===n?Object.create(n):(fn.prototype=n.prototype,new fn),pn.prototype.addExtBean=function(e,t){t&&this.extendBean(e,encodeURIComponent("string"==typeof t&&["ext1","ext2","ext3"].includes(e)?t.slice(0,1024):t))},pn.prototype.getBean=function(t){var r=this;return void 0===t&&(t=[]),""+Object.getOwnPropertyNames(this.bean).filter(function(e){return-1===t.indexOf(e)}).map(function(e){return"from"===e?"from="+r.getCurrentPageUrl():e+"="+r.bean[e]}).join("&")},pn.prototype.getCurrentPageUrl=function(){var e;return this._customPageUrl?encodeURIComponent(this._customPageUrl.slice(0,2048)):(e=this.config.pageUrl||location.href,e=(e="function"==typeof this.config.urlHandler?this.config.urlHandler()||location.href:e).slice(0,2048),encodeURIComponent(e))},pn.prototype.getOriginFrom=function(){if(this._customPageUrl)return this._customPageUrl.slice(0,2048);try{return("undefined"!=typeof window&&window.location?window.location.href:"").slice(0,2048)}catch(e){return""}},pn.prototype.ready=function(){function o(){var e,r,n,i;t.reportRequestQueue.length&&(e=t.reportRequestQueue.splice(0,1)[0],r=e.options,n=e.success,i=e.fail,t.$request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==n?void 0:n.apply(r,e)}finally{o()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==i?void 0:i.apply(r,e)}finally{o()}}))}var t=this;o(),this.isReportReady=!0},pn.prototype.request=function(l,r,c){var u,d,h=this;this.config.reportImmediately||this.isReportReady?this.$request(l,u=function(e){var t=z(D("tdem-web-retry-report-requests"),[]);null!=t&&t.length&&l.extraRetryOptions&&(t.splice(t.findIndex(function(e){return e.extraRetryOptions.requestId===l.extraRetryOptions.requestId}),1),U("tdem-web-retry-report-requests",JSON.stringify(t)),hn.delete(l.extraRetryOptions.success),hn.delete(l.extraRetryOptions.fail)),null!=r&&r(e)},d=function(e){if(!h.config.reportRetry)return null==c?void 0:c(e);var t,r="boolean"==typeof h.config.reportRetry?Lt:f(f({},Lt),h.config.reportRetry),n=r.maxRetryCount,i=void 0===n?Lt.maxRetryCount:n,n=r.retryInterval,n=void 0===n?Lt.retryInterval:n,r=r.whenRetryEndStillFail,o=void 0===r?Lt.whenRetryEndStillFail:r,s=(l.extraRetryOptions||(l.extraRetryOptions={requestId:"",retriedCount:0,success:"",fail:""}),l.extraRetryOptions),a=(s.requestId=s.requestId||l.url+"-"+Date.now()+"-"+Math.random(),s.requestId),r=(s.retriedCount=s.retriedCount||0,s.success=s.success||a+"_successCallback",s.fail=s.fail||a+"_failCallback",z(D("tdem-web-retry-report-requests"),[]));r.find(function(e){return e.extraRetryOptions.requestId===a})?(t=r.findIndex(function(e){return e.extraRetryOptions.requestId===a}),r[t]=l):r.push(l),U("tdem-web-retry-report-requests",JSON.stringify(r)),setTimeout(function(){if(s.retriedCount<i)l.extraRetryOptions.retriedCount+=1,h.$request(l,u,d);else{if("discard"===o){var e=z(D("tdem-web-retry-report-requests"),[]).filter(function(e){return(null==(e=e.extraRetryOptions)?void 0:e.requestId)!==a});if(e.length)U("tdem-web-retry-report-requests",JSON.stringify(e));else try{localStorage.removeItem("tdem-web-retry-report-requests")}catch(e){}}hn.delete(s.success),hn.delete(s.fail)}},"function"==typeof n?n(l.extraRetryOptions.retriedCount):n),null!=c&&c(e),hn.has(s.success)||hn.set(s.success,u),hn.has(s.fail)||hn.set(s.fail,d)}):this.reportRequestQueue.push({options:l,success:r,fail:c})},pn.prototype.$request=function(a,e,t){var r,n,i,o;if(a&&"string"==typeof a.url&&""!==a.url&&this.bean.id)return o=a.url,!1!==a.addBean&&(o=((e,t)=>{var r,n,i,o=e,s=a.beanFilter||[];for(r in t)-1===s.indexOf(r)&&((i=(n=new RegExp("([?&])"+r+"(=([^&]*))?(?=&|$)")).exec(o))?i[2]&&""!==i[3]&&"undefined"!==i[3]||(o=o.replace(n,"$1"+r+"="+t[r])):(i=-1<o.indexOf("?")?"&":"?",o+=i+r+"="+t[r]));return o})(o,f(f({},this.bean),{from:this.getCurrentPageUrl()}))),a.url=o,o=a.method||"get",n=this.config.onBeforeRequest,(a=n?n(a,this):a)?a.url?void((null!=a&&a.sendBeacon||this.sendNow)&&"function"==typeof(null==navigator?void 0:navigator.sendBeacon)?navigator.sendBeacon(a.url,a.data):((r=new XMLHttpRequest).sendByTdem=!0,r.addEventListener("readystatechange",function(){4===r.readyState&&(400<=r.status||0===r.status?null!=t&&t(r.response):null!=e&&e(r.response))}),"get"===o.toLocaleLowerCase()?(r.open("get",(n=a.url,i=a.data,"string"!=typeof n?"":"object"==typeof i&&i?(o=Object.getOwnPropertyNames(i).map(function(e){var t=i[e];return e+"="+("string"==typeof t?encodeURIComponent(t):encodeURIComponent(JSON.stringify(t)))}).join("&").replace(/eval/gi,"evaI"),n+(-1===n.indexOf("?")?"?":"&")+o):n)),r.send()):(r.open("post",a.url),a.contentType&&r.setRequestHeader("Content-Type",a.contentType),"string"==typeof a.data&&(a.data=a.data.replace(/eval/gi,"evaI")),r.send(a.data)))):console.warn("Please handle the parameters reasonably, options.url is necessary"):console.warn("Sending request blocked")},pn.prototype.publishPluginsLogs=function(){var e=pn.installedPlugins.find(function(e){return"reportAssetSpeed"===e.name});null!=e&&e.option.collectNotReportedLog(this)},pn.prototype.uploadLogs=function(e,t){var r;void 0===e&&(e={}),void 0===t&&(t={}),null!=(r=this.lifeCycle)&&r.emit("uploadLogs",e,t)},pn.prototype.reportWebVitals=function(e){try{var t=pn.installedPlugins.find(function(e){return"webVitals"===e.name});t&&this.config.webVitals&&this.config.webVitals.manualReport&&t.option.publish(this,e)}catch(e){}},pn.sessionID=ln("tdem",Pe).sessionId,pn);function pn(e){var t,r,n,o,s,a,i,l,c,u,d,h=un.call(this,e)||this;h.sendNow=!1,h.isReportReady=!1,h.reportRequestQueue=[],h.speedLogPipeline=Ze([(u=[],d=(i=h).config,i.lifeCycle.on("destroy",function(){u.length=0}),function(e,t){Array.isArray(e)?u=u.concat(e):u.push(e),l&&u.length>=l||i.sendNow&&0<u.length?(u=xe(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length)),c&&clearTimeout(c)):(c&&clearTimeout(c),c=setTimeout(function(){c=null,u=xe(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length))},d.delay))}),(a=h.config,function(e,t){var r,n,i,o="number"==typeof a.repeat?a.repeat:60;!a.speedSample||o<=0?t(e):(r=(null==a?void 0:a.id)||"0",n=Re[r]||{},Array.isArray(e)?(i=e.filter(function(e){var t=!n[e.url]||n[e.url]<o;return t?(n[e.url]=1+~~n[e.url],Re[r]=n):Te[r]||Ae(r),t})).length&&t(i):!n[e.url]||n[e.url]<o?(n[e.url]=1+~~n[e.url],Re[r]=n,t(e)):Te[r]||Ae(r))}),(n=h,function(t,r){zt(function(e){n.extendBean("netType",e),r(t)})}),function(e,t){null!=(r=h.lifeCycle)&&r.emit("beforeReportSpeed",e);var r,n=h.config.beforeReportSpeed;if((e="function"==typeof n?e.filter(function(e){return!1!==n(e)}):e).length)return t(e)},function(e,t){t(e.map(function(e){return void 0!==e.payload&&delete e.payload,e}))},function(e){return h.sendPipeline([function(e,t){t({type:ue.SPEED,url:""+h.config.speedUrl,method:"post",data:le(e,f(f({},h.bean),{from:h.getCurrentPageUrl()})),log:e})}],ue.SPEED)(e)}]),e.asyncPlugin=!0;try{"undefined"!=typeof document&&(e.uin=e.uin||(null!=(t=document.cookie.match(/\buin=\D+(\d*)/))?t:[])[1]||(null!=(r=document.cookie.match(/\bilive_uin=\D*(\d+)/))?r:[])[1]||""),h.init(e),h.extendBean("sessionId",pn.sessionID),h.extendBean("from",h.getCurrentPageUrl()),"undefined"!=typeof document&&h.extendBean("referer",encodeURIComponent(document.referrer||"")),o=z(D("tdem-web-retry-report-requests"),[]),(s=function(){var i;o.length&&(i=o.splice(0,1)[0],U("tdem-web-retry-report-requests",JSON.stringify(o)),h.$request(i,function(){for(var e,t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return null==(t=hn.get(null==(e=i.extraRetryOptions)?void 0:e.success))?void 0:t.apply(i,r)}finally{s()}},function(){for(var e,t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return null==(t=hn.get(null==(e=i.extraRetryOptions)?void 0:e.fail))?void 0:t.apply(i,r)}finally{s()}}))})();for(var p=1;p<=10;p++)h.addExtBean("ext"+p,e["ext"+p])}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),h.sendSDKError(e)}return h}function fn(){this.constructor=dn}new e({name:"ie"}),new e({name:"onClose"});function mn(){var e,l,i,t=document.createElement("canvas");return((e=t.getContext("2d"))?(e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText("tdem,sdk <canvas> 1.0",2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText("tdem,sdk <canvas> 1.0",4,17),t.toDataURL("image/jpeg")):"")+(l=["monospace","sans-serif","serif"],i=["default","sans-serif","serif","monospace","Apple LiSung","Apple SD Gothic Neo","Apple Symbols","Baoli SC, Baoli TC","Baskerville","Beirut","GungSeo","Gurmukhi MN","Gurmukhi MT","Hannotate SC, Hannotate TC","HanziPen SC, HanziPen TC","HeadlineA","Hei","LiSong Pro","Libian SC, Libian TC","LingWai SC, LingWai TC","Lucida Grande","Luminari","Nanum Brush Script","Nanum Gothic, NanumGothic","Nanum Myeongjo, NanumMyeongjo","Nanum Pen Script","NanumGothic ExtraBold, NanumGothicExtraBold","New Peninim MT","Noto Serif Kannada","Noto Serif Myanmar","Optima","PilGi","Plantagenet Cherokee","Raanana","STFangSong, STFangsong","STHeiti","STIXGeneral, STIXGeneral-Regular","Tsukushi B Round Gothic, Tsukushi B Round Gothic Regular","Tsukushi B Round Gothic Bold","Verdana","Waseem","Xingkai SC, Xingkai TC","YuGothic, YuGothic Medium","YuGothic Bold","Yuanti SC, Yuanti TC","Yuppy SC, Yuppy TC","Zapf Dingbats","Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"],(()=>{for(var e=(()=>{var e,i=document.getElementsByTagName("head")[0],o=document.createElement("span"),s=(o.style.fontSize="72px",o.innerHTML="mmmmmmmmmmlli",{}),a={};for(e in l)o.style.fontFamily=l[e],i.appendChild(o),s[l[e]]=o.offsetWidth,a[l[e]]=o.offsetHeight,i.removeChild(o);return{detect:function(e){var t,r=!1;for(t in l){o.style.fontFamily=e+","+l[t],i.appendChild(o);var n=o.offsetWidth!==s[l[t]]||o.offsetHeight!==a[l[t]];i.removeChild(o),r=r||n}return r}}})(),t=i,r="",n=0;n<t.length;n++)r+=e.detect(t[n])?"1":"0";return r})())+(()=>{var e=document.createElement("canvas"),a=(e.width=256,e.height=128,e.getContext("webgl2")||e.getContext("experimental-webgl2")||e.getContext("webgl")||e.getContext("experimental-webgl")||e.getContext("moz-webgl")),t=(()=>{var e="";try{var t=a.createBuffer(),r=(a.bindBuffer(a.ARRAY_BUFFER,t),new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0])),n=(a.bufferData(a.ARRAY_BUFFER,r,a.STATIC_DRAW),t.itemSize=3,t.numItems=3,a.createProgram()),i=a.createShader(a.VERTEX_SHADER),o=(a.shaderSource(i,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),a.compileShader(i),a.createShader(a.FRAGMENT_SHADER)),s=(a.shaderSource(o,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),a.compileShader(o),a.attachShader(n,i),a.attachShader(n,o),a.linkProgram(n),a.useProgram(n),n.vertexPosAttrib=a.getAttribLocation(n,"attrVertex"),n.offsetUniform=a.getUniformLocation(n,"uniformOffset"),a.enableVertexAttribArray(n.vertexPosArray),a.vertexAttribPointer(n.vertexPosAttrib,t.itemSize,a.FLOAT,!1,0,0),a.uniform2f(n.offsetUniform,1,1),a.drawArrays(a.TRIANGLE_STRIP,0,t.numItems),new Uint8Array(131072));a.readPixels(0,0,256,128,a.RGBA,a.UNSIGNED_BYTE,s),e=JSON.stringify(s).replace(/,?"[0-9]+":/g,"")}catch(e){console.warn("fAid error: getwebGlHash-getWebglImageHash",e)}return e})(),r=(()=>{var e="";try{var t=null==a?void 0:a.getExtension("WEBGL_debug_renderer_info"),e=(null==a?void 0:a.getParameter(t.UNMASKED_VENDOR_WEBGL))+(null==a?void 0:a.getParameter(t.UNMASKED_RENDERER_WEBGL))}catch(e){console.warn("fAid error: getwebGlHash-getWebglReportHash-vendor&renderer info",e)}var r,n,t="";try{var i=function(e){return a.clearColor(0,0,0,1),a.enable(a.DEPTH_TEST),a.depthFunc(a.LEQUAL),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),"["+e[0]+", "+e[1]+"]"},o=[];o.push("extensions:"+(a.getSupportedExtensions()||[]).join(";")),o.push("webgl aliased line width range:"+i(a.getParameter(a.ALIASED_LINE_WIDTH_RANGE))),o.push("webgl aliased point size range:"+i(a.getParameter(a.ALIASED_POINT_SIZE_RANGE))),o.push("webgl alpha bits:"+a.getParameter(a.ALPHA_BITS)),o.push("webgl antialiasing:"+(a.getContextAttributes().antialias?"yes":"no")),o.push("webgl blue bits:"+a.getParameter(a.BLUE_BITS)),o.push("webgl depth bits:"+a.getParameter(a.DEPTH_BITS)),o.push("webgl green bits:"+a.getParameter(a.GREEN_BITS)),o.push("webgl max anisotropy:"+((n=(r=a).getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic"))?0===(r=r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT))?2:r:null)),o.push("webgl max combined texture image units:"+a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),o.push("webgl max cube map texture size:"+a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE)),o.push("webgl max fragment uniform vectors:"+a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS)),o.push("webgl max render buffer size:"+a.getParameter(a.MAX_RENDERBUFFER_SIZE)),o.push("webgl max texture image units:"+a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),o.push("webgl max texture size:"+a.getParameter(a.MAX_TEXTURE_SIZE)),o.push("webgl max varying vectors:"+a.getParameter(a.MAX_VARYING_VECTORS)),o.push("webgl max vertex attribs:"+a.getParameter(a.MAX_VERTEX_ATTRIBS)),o.push("webgl max vertex texture image units:"+a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),o.push("webgl max vertex uniform vectors:"+a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS)),o.push("webgl max viewport dims:"+i(a.getParameter(a.MAX_VIEWPORT_DIMS))),o.push("webgl red bits:"+a.getParameter(a.RED_BITS)),o.push("webgl renderer:"+a.getParameter(a.RENDERER)),o.push("webgl shading language version:"+a.getParameter(a.SHADING_LANGUAGE_VERSION)),o.push("webgl stencil bits:"+a.getParameter(a.STENCIL_BITS)),o.push("webgl vendor:"+a.getParameter(a.VENDOR)),t=o.join("*")||""}catch(e){console.warn("fAid error: getwebGlHash-getWebglReportHash-vendor&renderer info",e)}return e+t})(),n="";try{n=yn(t+r)}catch(e){console.warn("fAid error: getwebGlHash-hashTo32",e)}return n})()}function gn(){try{var e=(o=window.navigator).userAgent+"*"+o.platform+(i=window.screen).width+"*"+i.height+window.screen.colorDepth+((n=null==(n=window.Intl)?void 0:n.DateTimeFormat)?null==(n=null==(n=new n)?void 0:n.resolvedOptions())?void 0:n.timeZone:"")+" + "+(new Date).getTimezoneOffset()+(()=>{function e(){return 0}var t=Math;try{var r=t.acos||e,n=t.acosh||e,i=t.asin||e,o=t.asinh||e,s=t.atanh||e,a=t.atan||e,l=t.sin||e,c=t.sinh||e,u=t.cos||e,d=t.cosh||e,h=t.tan||e,p=t.tanh||e,f=t.exp||e,m=t.expm1||e,g=t.log1p||e,v={acos:r(.12312423423423424),acosh:n(1e308),acoshPf:t.log(1e154+t.sqrt(1e308)),asin:i(.12312423423423424),asinh:o(1),asinhPf:t.log(1+t.sqrt(2)),atanh:s(.5),atanhPf:t.log(3)/2,atan:a(.5),sin:l(-1e300),sinh:c(1),sinhPf:t.exp(1)-1/t.exp(1)/2,cos:u(10.000000000123),cosh:d(1),coshPf:(t.exp(1)+1/t.exp(1))/2,tan:h(-1e300),tanh:p(1),tanhPf:(t.exp(2)-1)/(t.exp(2)+1),exp:f(1),expm1:m(1),expm1Pf:t.exp(1)-1,log1p:g(10),log1pPf:t.log(11),powPI:t.pow(t.PI,-100)};return Object.values(v).join("*")}catch(e){return""}})()+mn();return t=yn(e),r=0,"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".split("").map(function(e){return"x"===e?t[r++]:e}).join("")}catch(e){console.warn(e)}var t,r,n,i,o;return""}var vn=new e({name:"onClose",onNewTdem:function(r){var n,i=this;l.desktop()?(n=window.onunload,window.onunload=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.publishNotReportedLog(r),null!=n&&n.call.apply(n,B([window],e))}):pr(this.publishNotReportedLog.bind(this,r),{once:!0})},publishNotReportedLog:function(t){var r=this;this.$walk(function(e){e===t&&(e.sendNow=!0,e.publishPluginsLogs(),r.publishThrottlePipeLogs(e))})},publishThrottlePipeLogs:function(e){null!=e&&e.speedLogPipeline([]),null!=e&&e.tdemEventPipeline([])}}),yn=function(e){for(var t=3&e.length,r=e.length-t,n=1,i=3432918353,o=461845907,s=0;s<r;)var a=255&e.charCodeAt(s)|(255&e.charCodeAt(++s))<<8|(255&e.charCodeAt(++s))<<16|(255&e.charCodeAt(++s))<<24,a=(++s,5*(65535&(n=(n^=(65535&(a=(a=(65535&a)*i+(((a>>>16)*i&65535)<<16)&4294967295)<<15|a>>>17))*o+(((a>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295),n=27492+(65535&a)+((58964+(a>>>16)&65535)<<16);var l=0;switch(t){case 3:l^=(255&e.charCodeAt(s+2))<<16;case 2:l^=(255&e.charCodeAt(s+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(s)))*i+(((l>>>16)*i&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}n=2246822507*(65535&(n=(n^=e.length)^n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295;for(var c=(n^=n>>>16)>>>0,u=(c%2).toString();1<c;)u=(c=parseInt((c/2).toString(),10))%2+u;for(;u.length<32;)u="0"+u;return u},wn=(new e({name:"aid"}),new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e;t||(t=gn()||Le(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){console.warn(e)}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}}));kn.generate=function(){return"rep_"+this.uuid32()},kn.uuid32=function(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)})};var bn=kn,Sn="[SessionReplay]",Cn=!1;function kn(){}function v(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];Cn&&console.log.apply(console,B([Sn+"["+e+"]"],t))}function _n(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];Cn&&console.debug.apply(console,B([Sn+"["+e+"]"],t))}function In(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];Cn&&console.log.apply(console,B([Sn+"["+e+"] WARN:"],t))}function En(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];Cn&&console.log.apply(console,B([Sn+"["+e+"] ERROR:"],t))}Mn.prototype.setTdemInstance=function(e){this.tdemInstance=e},Mn.prototype.createSession=function(e){void 0===e&&(e="session");var t=null==(t=this.session)?void 0:t.id,e=f({id:([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)}),replayId:bn.generate(),started:Date.now(),lastActivity:Date.now(),segmentId:0,sampled:e},t?{previousSessionId:t}:{});return this.session=e,this.saveSession(),this.tdemInstance&&this.tdemInstance.extendBean("sessionId",e.id),cn(e.id,"tdem"),v("SessionManager","Session created:",e.id),e},Mn.prototype.restoreSession=function(){var e;if(!this.config.stickySession)return null;try{var t,r=null==(e=this.getSessionStorage())?void 0:e.getItem("tdem_session");return r?(t=JSON.parse(r)).id&&t.started?this.isSessionExpired(t)?(v("SessionManager","Session expired, creating new session"),null):(t.replayId||(t.replayId=bn.generate()),v("SessionManager","Session restored:",(this.session=t).id),this.tdemInstance&&this.tdemInstance.extendBean("sessionId",t.id),cn(t.id,"tdem"),t):(In("SessionManager","Invalid session data"),null):null}catch(e){return En("SessionManager","Failed to restore session:",e),null}},Mn.prototype.saveSession=function(){var e;if(this.session&&this.config.stickySession)try{null!=(e=this.getSessionStorage())&&e.setItem("tdem_session",JSON.stringify(this.session))}catch(e){En("SessionManager","Failed to save session:",e)}},Mn.prototype.refreshSession=function(){var e=null!=(e=null==(e=this.session)?void 0:e.sampled)?e:"session";return this.createSession(e)},Mn.prototype.updateActivity=function(){this.session&&(this.session.lastActivity=Date.now(),this.saveSession())},Mn.prototype.incrementSegmentId=function(){var e;return this.session?(e=this.session.segmentId,this.session.segmentId+=1,this.saveSession(),e):0},Mn.prototype.shouldRefreshSession=function(){return!this.session||this.isSessionExpired(this.session)},Mn.prototype.isSessionExpired=function(e){var t=Date.now();return t-e.started>this.config.maxSessionDuration||t-e.lastActivity>this.config.idleExpireDuration},Mn.prototype.getSession=function(){return this.session},Mn.prototype.getSessionId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.id)?e:""},Mn.prototype.getReplayId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.replayId)?e:""},Mn.prototype.getSessionStorage=function(){try{var e=window.sessionStorage;return e.setItem("__test__","1"),e.removeItem("__test__"),e}catch(e){return null}},Mn.prototype.clearSession=function(){var e;this.session=null;try{null!=(e=this.getSessionStorage())&&e.removeItem("tdem_session")}catch(e){}};var xn=Mn,Tn=((i={})[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i),Rn=(An.prototype.ensureReady=function(){return L(this,void 0,void 0,function(){return F(this,function(e){return[2,this.ready]})})},An.prototype.postMessage=function(r,n){var i=this,o=this.nextId++;return new Promise(function(e,t){i.pendingRequests.set(o,{resolve:e,reject:t}),i.worker.postMessage({id:o,method:r,arg:n})})},An.prototype.destroy=function(){this.pendingRequests.forEach(function(e){return(0,e.reject)(new Error("Worker destroyed"))}),this.pendingRequests.clear(),this.worker.terminate()},An);function An(e){var o=this;this.nextId=0,this.pendingRequests=new Map,this.worker=e,this.worker.addEventListener("message",function(e){var e=e.data,t=e.id,r=e.success,n=e.response;"init"!==e.method&&(e=o.pendingRequests.get(t))&&(o.pendingRequests.delete(t),r?e.resolve(n):e.reject(new Error(n||"Worker request failed")))}),this.ready=new Promise(function(t,r){var n=function(e){e=e.data;"init"===e.method&&e.success&&(o.worker.removeEventListener("message",n),clearTimeout(i),t())},i=(o.worker.addEventListener("message",n),o.worker.addEventListener("error",function(e){o.worker.removeEventListener("message",n),clearTimeout(i),r(new Error("Worker error: "+(e.message||"unknown")))}),setTimeout(function(){o.worker.removeEventListener("message",n),r(new Error("Worker init timeout (5s)"))},5e3))})}function Mn(e){var t;void 0===e&&(e={}),this.session=null,this.tdemInstance=null,this.config={stickySession:null==(t=e.stickySession)||t,idleExpireDuration:null!=(t=e.idleExpireDuration)?t:9e5,maxSessionDuration:null!=(t=e.maxSessionDuration)?t:36e5}}Bn.prototype.initWorker=function(){var t=this,e=(()=>{try{var e,t,r;return"undefined"==typeof Worker||"undefined"==typeof Blob||"undefined"==typeof URL?null:(e=new Blob(["\n(function() {\n var events = [];\n var totalSize = 0;\n\n function handleMessage(data) {\n var method = data.method;\n var id = data.id;\n\n switch (method) {\n case 'addEvent':\n events.push(data.arg);\n totalSize += data.arg.length;\n return { id: id, method: method, success: true, response: totalSize };\n\n case 'finish':\n var json = '[' + events.join(',') + ']';\n events = [];\n totalSize = 0;\n // 返回原始 JSON 字符串,压缩在主线程做(pako 不好内联到 worker)\n return { id: id, method: method, success: true, response: json };\n\n case 'clear':\n events = [];\n totalSize = 0;\n return { id: id, method: method, success: true, response: void 0 };\n\n default:\n return { id: id, method: method, success: false, response: 'Unknown method' };\n }\n }\n\n self.addEventListener('message', function(e) {\n try {\n var result = handleMessage(e.data);\n self.postMessage(result);\n } catch (err) {\n self.postMessage({\n id: e.data.id,\n method: e.data.method,\n success: false,\n response: err.message || 'Worker error'\n });\n }\n });\n\n // 就绪信号\n self.postMessage({ method: 'init', success: true });\n})();\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),r=new Worker(t,{name:"tdem-replay-compressor"}),URL.revokeObjectURL(t),v("CompressionWorker","Worker created successfully"),new Rn(r))}catch(e){return In("CompressionWorker","Failed to create worker, will fallback to sync buffer:",e),null}})();e?(this.workerHandler=e,this.useWorker=!0,e.ensureReady().then(function(){t.workerReady=!0,v("EventBuffer","Worker ready, migrating buffered events"),t.migrateEventsToWorker()}).catch(function(e){In("EventBuffer","Worker init failed, falling back to sync buffer:",e),t.useWorker=!1,t.workerHandler=null})):v("EventBuffer","Worker not available, using sync buffer")},Bn.prototype.migrateEventsToWorker=function(){if(this.workerHandler&&this.workerReady){var e=this.events;this.events=[];for(var t=0,r=e;t<r.length;t++){var n=r[t];this.addEventToWorker(n)}this.currentSize=0}},Bn.prototype.addEventToWorker=function(e){if(this.workerHandler)try{var t=JSON.stringify(e);this.workerHandler.postMessage("addEvent",t),this.workerEventCount++,this.workerSize+=t.length}catch(e){In("EventBuffer","Failed to send event to worker:",e)}},Bn.prototype.addEvent=function(e){var t;this.useWorker&&this.workerReady&&this.workerHandler?(t=this.estimateEventSize(e),this.workerSize+t>this.config.maxSize&&(In("EventBuffer","Worker buffer size limit exceeded, dropping old events"),this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),this.addEventToWorker(e)):(t=this.estimateEventSize(e),this.currentSize+t>this.config.maxSize&&(In("EventBuffer","Size limit exceeded, removing old events"),this.trimOldEvents(t)),this.events.push(e),this.currentSize+=t)},Bn.prototype.getEvents=function(){return B(this.events)},Bn.prototype.getEventCount=function(){return this.useWorker&&this.workerReady?this.workerEventCount+this.events.length:this.events.length},Bn.prototype.getSize=function(){return this.useWorker&&this.workerReady?this.workerSize+this.currentSize:this.currentSize},Bn.prototype.isEmpty=function(){return!(this.useWorker&&this.workerReady&&0!==this.workerEventCount||0!==this.events.length)},Bn.prototype.finishAsync=function(){return L(this,void 0,void 0,function(){var t,r,n;return F(this,function(e){switch(e.label){case 0:if(!(this.useWorker&&this.workerReady&&this.workerHandler&&0<this.workerEventCount))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.workerHandler.postMessage("finish")];case 2:return t=e.sent(),n=this.workerEventCount,r=this.workerSize,this.workerEventCount=0,this.workerSize=0,[2,{events:[],eventCount:n,uncompressedSize:r,eventsJson:t}];case 3:return In("EventBuffer","Worker finish failed, falling back to sync:",e.sent()),[3,4];case 4:return[2,{events:n=this.getEvents(),eventCount:n.length,uncompressedSize:this.currentSize}]}})})},Bn.prototype.finish=function(){var e=this.getEvents();return{events:e,eventCount:e.length,uncompressedSize:this.currentSize}},Bn.prototype.clear=function(){this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0)},Bn.prototype.destroy=function(){this.clear(),this.workerHandler&&(this.workerHandler.destroy(),this.workerHandler=null),this.useWorker=!1,this.workerReady=!1},Bn.prototype.estimateEventSize=function(e){try{return JSON.stringify(e).length}catch(e){return 1024}},Bn.prototype.trimOldEvents=function(e){for(var t=-1,r=this.events.length-1;0<=r;r--)if(this.events[r].type===Tn.FullSnapshot){t=r;break}var n=t;if(0<n)for(r=n-1;0<=r;r--)if(this.events[r].type===Tn.Meta){n=r;break}for(var i,o=0,s=Math.max(e,.2*this.config.maxSize),a=0;a<n&&o<s;)a++,(i=this.events.shift())&&(o+=this.estimateEventSize(i));if(n<0)for(;0<this.events.length&&o<s;)(i=this.events.shift())&&(o+=this.estimateEventSize(i));this.currentSize=Math.max(0,this.currentSize-o)},Bn.prototype.hasCheckout=function(){return this.events.some(function(e){return e.type===Tn.Meta||e.type===Tn.FullSnapshot})},Bn.prototype.getLastCheckoutTime=function(){for(var e=this.events.length-1;0<=e;e--){var t=this.events[e];if(t.type===Tn.FullSnapshot)return t.timestamp}return null},Bn.prototype.isUsingWorker=function(){return this.useWorker&&this.workerReady};var On,Nn=Bn,Pn=Object.defineProperty,a=(e,t,r)=>(r=r,(t="symbol"!=typeof t?t+"":t)in(e=e)?Pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r),Ln=Object.defineProperty,Fn=(e,t,r)=>(r=r,(t="symbol"!=typeof t?t+"":t)in(e=e)?Ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r),O=((i=O||{})[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i);function Bn(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this.events=[],this.currentSize=0,this.workerHandler=null,this.useWorker=!1,this.workerReady=!1,this.workerEventCount=0,this.workerSize=0,this.config={maxSize:null!=(e=e.maxSize)?e:5242880},t&&this.initWorker()}let Dn={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Un={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zn={};function Wn(n){if(zn[n])return zn[n];let i=globalThis[n],o=i.prototype,e=n in Dn?Dn[n]:void 0,t=Boolean(e&&e.every(e=>Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(o,e))?void 0:e.get)?void 0:e.toString().includes("[native code]")))),r=n in Un?Un[n]:void 0,s=Boolean(r&&r.every(e=>"function"==typeof o[e]&&(null==(e=o[e])?void 0:e.toString().includes("[native code]"))));if(t&&s&&!globalThis.Zone)return zn[n]=i.prototype,i.prototype;try{let e=document.createElement("iframe"),t=(document.body.appendChild(e),e.contentWindow);if(!t)return i.prototype;let r=t[n].prototype;return document.body.removeChild(e),r?zn[n]=r:o}catch{return o}}let Gn={};function Hn(e,t,r){var n=e+"."+String(r);return Gn[n]?Gn[n].call(t):(e=Wn(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,r))?void 0:e.get)?(Gn[n]=e).call(t):t[r])}let jn={};function Zn(e,t,r){var n=e+"."+String(r);return jn[n]?jn[n].bind(t):"function"!=typeof(e=Wn(e)[r])?t[r]:(jn[n]=e).bind(t)}let Vn={ownerDocument:function(e){return Hn("Node",e,"ownerDocument")},childNodes:function(e){return Hn("Node",e,"childNodes")},parentNode:function(e){return Hn("Node",e,"parentNode")},parentElement:function(e){return Hn("Node",e,"parentElement")},textContent:function(e){return Hn("Node",e,"textContent")},contains:function(e,t){return Zn("Node",e,"contains")(t)},getRootNode:function(e){return Zn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Hn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Hn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Hn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Hn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Wn("MutationObserver").constructor},patch:function(r,n,i){try{if(!(n in r))return()=>{};let e=r[n],t=i(e);return"function"==typeof t&&(t.prototype=t.prototype||{},Object.defineProperties(t,{__rrweb_original__:{enumerable:!1,value:e}})),r[n]=t,()=>{r[n]=e}}catch{return()=>{}}}};function Yn(e){return e.nodeType===e.ELEMENT_NODE}function Xn(e){var t=e&&"host"in e&&"mode"in e&&Vn.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Vn.shadowRoot(t)===e)}function Kn(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Jn(e){try{var r=e.rules||e.cssRules;if(!r)return null;let t=e.href;return!t&&e.ownerNode&&(t=e.ownerNode.baseURI),n=(n=Array.from(r,e=>qn(e,t)).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")?n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):n}catch(e){return null}var n}function qn(r,t){if("styleSheet"in r){let t;try{t=Jn(r.styleSheet)||((n=(e=r).cssText).split('"').length<3?n:(n=["@import",`url(${JSON.stringify(e.href)})`],""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"))}catch(e){t=r.cssText}return r.styleSheet.href?ai(t,r.styleSheet.href):t}var e,n;{let e=r.cssText;return"selectorText"in r&&r.selectorText.includes(":")&&(e=e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?ai(e,t):e}}class $n{constructor(){Fn(this,"idNodeMap",new Map),Fn(this,"nodeMetaMap",new WeakMap)}getId(e){return e?(null==(e=this.getMeta(e))?void 0:e.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){let e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Qn({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";i=n&&ei(n);return s=t[r.toLowerCase()]||i&&t[i]?o?o(s,e):"*".repeat(s.length):s}function ei(e){return e.toLowerCase()}function ti(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ei(t):null}function ri(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}t=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==t?void 0:t[1])??null}let ni=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ii=/^(?:[a-z+]+:)?\/\//i,oi=/^www\..*/i,si=/^(data:)([^,]*),(.*)/i;function ai(e,a){return(e||"").replace(ni,(e,t,r,n,i,o)=>{r=r||i||o,i=t||n||"";if(!r)return e;if(ii.test(r)||oi.test(r))return`url(${i}${r}${i})`;if(si.test(r))return`url(${i}${r}${i})`;if("/"===r[0])return`url(${i}${(e=>{let t="";return t=(t=-1<e.indexOf("//")?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]})(a)+r}${i})`;var s=a.split("/"),o=r.split("/");s.pop();for(let e of o)"."!==e&&(".."===e?s.pop():s.push(e));return`url(${i}${s.join("/")}${i})`})}function li(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ci(e,t){return((s,a=!1)=>{var l=Array.from(t.childNodes),c=[];let u=0;if(1<l.length&&s&&"string"==typeof s){let o=li(s,a);var d=o.length/s.length;for(let i=1;i<l.length;i++)if(l[i].textContent&&"string"==typeof l[i].textContent){var h=li(l[i].textContent,a);let t=3;for(;t<h.length&&(h[t].match(/[a-zA-Z0-9]/)||-1!==h.indexOf(h.substring(0,t),1));t++);for(;t<h.length;t++){let r=h.substring(0,t),e=o.split(r),n=-1;if(2===e.length)n=e[0].length;else if(2<e.length&&""===e[0]&&""!==l[i-1].textContent)n=o.indexOf(r,1);else if(1===e.length){if(r=r.substring(0,r.length-1),(e=o.split(r)).length<=1)return c.push(s),c;t=101}else t===h.length-1&&(n=o.indexOf(r));if(2<=e.length&&100<t){let t=l[i-1].textContent;if(t&&"string"==typeof t){let e=li(t).length;n=o.indexOf(r,e)}-1===n&&(n=e[0].length)}if(-1!==n){let e=Math.floor(n/d);for(;0<e&&e<s.length;){if((u+=1)>50*l.length)return c.push(s),c;var p=li(s.substring(0,e),a);if(p.length===n){c.push(s.substring(0,e)),s=s.substring(e),o=o.substring(n);break}p.length<n?e+=Math.max(1,Math.floor((n-p.length)/d)):e-=Math.max(1,Math.floor((p.length-n)*d))}break}}}}return c.push(s),c})(e).join("/* rr_split */")}let ui=1,di=new RegExp("[^a-z0-9-_:]");function hi(){return ui++}let pi,fi,mi=/^[^ \t\n\r\u000c]+/,gi=/^[, \t\n\r\u000c]+/,vi=new WeakMap;function yi(e,t){return t&&""!==t.trim()?wi(e,t):t}function wi(e,t){let r=vi.get(e);if(r||(r=e.createElement("a"),vi.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function bi(e,t,r,n){return n&&("src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]||"background"===r&&["table","td","th"].includes(t)?yi(e,n):"srcset"===r?((e,i)=>{if(""===i.trim())return i;let o=0;function t(e){var e=e.exec(i.substring(o));return e?(e=e[0],o+=e.length,e):""}for(var s=[];t(gi),!(o>=i.length);){let n=t(mi);if(","===n.slice(-1))n=yi(e,n.substring(0,n.length-1)),s.push(n);else{let t="",r=(n=yi(e,n),!1);for(;;){let e=i.charAt(o);if(""===e){s.push((n+t).trim());break}if(r)")"===e&&(r=!1);else{if(","===e){o+=1,s.push((n+t).trim());break}"("===e&&(r=!0)}t+=e,o+=1}}}return s.join(", ")})(e,n):"style"===r?ai(n,wi(e)):"object"===t&&"data"===r?yi(e,n):n)}function Si(e,t){return["video","audio"].includes(e)&&"autoplay"===t}function Ci(t,r,e){if(!t)return!1;if(t.nodeType===t.ELEMENT_NODE)for(let e=t.classList.length;e--;){var n=t.classList[e];if(r.test(n))return!0}return!!e&&Ci(Vn.parentNode(t),r,e)}function ki(e,t,r,n){let i;if(Yn(e)){if(i=e,!Vn.childNodes(i).length)return!1}else{if(null===Vn.parentElement(e))return!1;i=Vn.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(Ci(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function _i(g,e){var t,{doc:v,mirror:e,blockClass:y,blockSelector:w,needsMask:r,inlineStylesheet:b,maskInputOptions:S={},maskTextFn:n,maskInputFn:C,dataURLOptions:k={},inlineImages:_,recordCanvas:I,keepIframeSrcFn:E,newlyAddedElement:x=!1,cssCaptured:i=!1}=e,T=(t=v,!(e=e).hasNode(t)||1===(e=e.getId(t))?void 0:e);switch(g.nodeType){case g.DOCUMENT_NODE:return"CSS1Compat"!==g.compatMode?{type:O.Document,childNodes:[],compatMode:g.compatMode}:{type:O.Document,childNodes:[]};case g.DOCUMENT_TYPE_NODE:return{type:O.DocumentType,name:g.name,publicId:g.publicId,systemId:g.systemId,rootId:T};case g.ELEMENT_NODE:{var R=g;var A={doc:v,blockClass:y,blockSelector:w,inlineStylesheet:b,maskInputOptions:S,maskInputFn:C,dataURLOptions:k,inlineImages:_,recordCanvas:I,keepIframeSrcFn:E,newlyAddedElement:x,rootId:T};let{doc:i,blockClass:e,blockSelector:t,inlineStylesheet:r,maskInputOptions:n={},maskInputFn:o,dataURLOptions:s={},inlineImages:a,recordCanvas:l,keepIframeSrcFn:c,newlyAddedElement:u=!1,rootId:d}=A,h=((t,r,e)=>{try{if("string"==typeof r){if(t.classList.contains(r))return!0}else for(let e=t.classList.length;e--;){var n=t.classList[e];if(r.test(n))return!0}if(e)return t.matches(e)}catch(t){}return!1})(R,e,t),p=(A=R)instanceof HTMLFormElement?"form":(A=ei(A.tagName),di.test(A)?"div":A),f={};var M=R.attributes.length;for(let t=0;t<M;t++){let e=R.attributes[t];Si(p,e.name,e)||(f[e.name]=bi(i,p,ei(e.name),e.value))}if("link"===p&&r){let e=Array.from(i.styleSheets).find(e=>e.href===R.href),t=null;(t=e?Jn(e):t)&&(delete f.rel,delete f.href,f._cssText=t)}if("style"===p&&R.sheet){let e=Jn(R.sheet);e&&(1<R.childNodes.length&&(e=ci(e,R)),f._cssText=e)}if(["input","textarea","select"].includes(p)){let e=R.value,t=R.checked;"radio"!==f.type&&"checkbox"!==f.type&&"submit"!==f.type&&"button"!==f.type&&e?f.value=Qn({element:R,type:ti(R),tagName:p,value:e,maskInputOptions:n,maskInputFn:o}):t&&(f.checked=t)}if("option"===p&&(R.selected&&!n.select?f.selected=!0:delete f.selected),"dialog"===p&&R.open&&(f.rr_open_mode=R.matches("dialog:modal")?"modal":"non-modal"),"canvas"===p&&l)if("2d"===R.__context)(r=>{var n=r.getContext("2d");if(n)for(let t=0;t<r.width;t+=50)for(let e=0;e<r.height;e+=50){var i=n.getImageData,i="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(i.call(n,t,e,Math.min(50,r.width-t),Math.min(50,r.height-e)).data.buffer).some(e=>0!==e))return}return 1})(R)||(f.rr_dataURL=R.toDataURL(s.type,s.quality));else if(!("__context"in R)){let e=R.toDataURL(s.type,s.quality),t=i.createElement("canvas"),r=(t.width=R.width,t.height=R.height,t.toDataURL(s.type,s.quality));e!==r&&(f.rr_dataURL=e)}if("img"===p&&a){pi||(pi=i.createElement("canvas"),fi=pi.getContext("2d"));let t=R,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",e=t.crossOrigin,n=()=>{t.removeEventListener("load",n);try{pi.width=t.naturalWidth,pi.height=t.naturalHeight,fi.drawImage(t,0,0),f.rr_dataURL=pi.toDataURL(s.type,s.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?n():t.addEventListener("load",n));console.warn(`Cannot inline img src=${r}! Error: `+e)}"anonymous"===t.crossOrigin&&(e?f.crossOrigin=e:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?n():t.addEventListener("load",n)}if(["audio","video"].includes(p)){let e=f;e.rr_mediaState=R.paused?"paused":"played",e.rr_mediaCurrentTime=R.currentTime,e.rr_mediaPlaybackRate=R.playbackRate,e.rr_mediaMuted=R.muted,e.rr_mediaLoop=R.loop,e.rr_mediaVolume=R.volume}if(u||(R.scrollLeft&&(f.rr_scrollLeft=R.scrollLeft),R.scrollTop&&(f.rr_scrollTop=R.scrollTop)),h){let{width:e,height:t}=R.getBoundingClientRect();f={class:f.class,rr_width:e+"px",rr_height:t+"px"}}"iframe"!==p||c(f.src)||(R.contentDocument||(f.rr_src=f.src),delete f.src);let m;try{customElements.get(p)&&(m=!0)}catch(R){}return{type:O.Element,tagName:p,attributes:f,childNodes:[],isSVG:Boolean("svg"===R.tagName||R.ownerSVGElement)||void 0,needBlock:h,rootId:d,isCustom:m};return}case g.TEXT_NODE:{A=g;var o={doc:v,needsMask:r,maskTextFn:n,rootId:T,cssCaptured:i};var{needsMask:s,maskTextFn:a,rootId:l,cssCaptured:c}=o,u=(u=Vn.parentNode(A))&&u.tagName;let e="";var d="STYLE"===u||void 0;return(u="SCRIPT"===u||void 0)?e="SCRIPT_PLACEHOLDER":c||(e=Vn.textContent(A),d&&(e=e&&ai(e,wi(o.doc)))),!d&&!u&&e&&s&&(e=a?a(e,Vn.parentElement(A)):e.replace(/[\S]/g,"*")),{type:O.Text,textContent:e||"",rootId:l};return}case g.CDATA_SECTION_NODE:return{type:O.CDATA,textContent:"",rootId:T};case g.COMMENT_NODE:return{type:O.Comment,textContent:Vn.textContent(g)||"",rootId:T};default:return!1}}function A(e){return null==e?"":e.toLowerCase()}function Ii(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function Ei(i,e){let{doc:t,mirror:o,blockClass:s,blockSelector:a,maskTextClass:l,maskTextSelector:c,skipChild:u=!1,inlineStylesheet:d=!0,maskInputOptions:h={},maskTextFn:p,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g={},inlineImages:v=!1,recordCanvas:y=!1,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:S=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:_=()=>!1,newlyAddedElement:r=!1,cssCaptured:n=!1}=e,I=e.needsMask,{preserveWhiteSpace:E=!0}=e;I=I||ki(i,l,c,void 0===I);e=_i(i,{doc:t,mirror:o,blockClass:s,blockSelector:a,needsMask:I,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:f,dataURLOptions:g,inlineImages:v,recordCanvas:y,keepIframeSrcFn:_,newlyAddedElement:r,cssCaptured:n});if(!e)return console.warn(i,"not serialized"),null;var x=o.hasNode(i)?o.getId(i):((e,t)=>{if(t.comment&&e.type===O.Comment)return 1;if(e.type===O.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===ri(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(A(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===A(e.attributes.name)||"icon"===A(e.attributes.rel)||"apple-touch-icon"===A(e.attributes.rel)||"shortcut icon"===A(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&A(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(A(e.attributes.property).match(/^(og|twitter|fb):/)||A(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===A(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===A(e.attributes.name)||"googlebot"===A(e.attributes.name)||"bingbot"===A(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===A(e.attributes.name)||"generator"===A(e.attributes.name)||"framework"===A(e.attributes.name)||"publisher"===A(e.attributes.name)||"progid"===A(e.attributes.name)||A(e.attributes.property).match(/^article:/)||A(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===A(e.attributes.name)||"yandex-verification"===A(e.attributes.name)||"csrf-token"===A(e.attributes.name)||"p:domain_verify"===A(e.attributes.name)||"verify-v1"===A(e.attributes.name)||"verification"===A(e.attributes.name)||"shopify-checkout-api-token"===A(e.attributes.name)))return 1}}})(e,m)||!E&&e.type===O.Text&&!e.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ui++,T=Object.assign(e,{id:x});if(o.add(i,T),-2===x)return null;w&&w(i);let R=!u;if(T.type===O.Element){R=R&&!T.needBlock,delete T.needBlock;let e=Vn.shadowRoot(i);e&&Kn(e)&&(T.isShadowHost=!0)}if((T.type===O.Document||T.type===O.Element)&&R){m.headWhitespace&&T.type===O.Element&&"head"===T.tagName&&(E=!1);let r={doc:t,mirror:o,blockClass:s,blockSelector:a,needsMask:I,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:_,cssCaptured:!1};if(T.type!==O.Element||"textarea"!==T.tagName||void 0===T.attributes.value){T.type===O.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(r.cssCaptured=!0);for(let t of Array.from(Vn.childNodes(i))){let e=Ei(t,r);e&&T.childNodes.push(e)}}let n=null;if(Yn(i)&&(n=Vn.shadowRoot(i)))for(let t of Array.from(Vn.childNodes(n))){let e=Ei(t,r);e&&(Kn(n)&&(e.isShadow=!0),T.childNodes.push(e))}}e=Vn.parentNode(i);return e&&Xn(e)&&Kn(e)&&(T.isShadow=!0),T.type===O.Element&&"iframe"===T.tagName&&((r,n,i)=>{let o=r.contentWindow;if(o){let e,t=!1;try{e=o.document.readyState}catch(r){return}if("complete"!==e){let e=setTimeout(()=>{t||(n(),t=!0)},i);return r.addEventListener("load",()=>{clearTimeout(e),t=!0,n()})}if("about:blank"!==o.location.href||"about:blank"===r.src||""===r.src)return setTimeout(n,0),r.addEventListener("load",n);r.addEventListener("load",n)}})(i,()=>{var e=i.contentDocument;e&&b&&(e=Ei(e,{doc:e,mirror:o,blockClass:s,blockSelector:a,needsMask:I,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:_}))&&b(i,e)},S),T.type===O.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===ri(T.attributes.href))&&((t,r,n)=>{let e,i=!1;try{e=t.sheet}catch(t){return}if(!e){let e=setTimeout(()=>{i||(r(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(e),i=!0,r()})}})(i,()=>{var e;C&&(e=Ei(i,{doc:t,mirror:o,blockClass:s,blockSelector:a,needsMask:I,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:_}))&&C(i,e)},k),T}function xi(){return{isColorSupported:!1,reset:o,bold:o,dim:o,italic:o,underline:o,inverse:o,hidden:o,strikethrough:o,black:o,red:o,green:o,yellow:o,blue:o,magenta:o,cyan:o,white:o,gray:o,bgBlack:o,bgRed:o,bgGreen:o,bgYellow:o,bgBlue:o,bgMagenta:o,bgCyan:o,bgWhite:o}}var Ti,Ri,Ai,i={exports:{}},o=String,i=(i.exports=xi(),i.exports.createColors=xi,i.exports),s=(Ti=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?Ti:("function"==typeof(Ri=Ti.default)?(Ai=function e(){return this instanceof e?Reflect.construct(Ri,arguments,this.constructor):Ri.apply(this,arguments)}).prototype=Ri.prototype:Ai={},Object.defineProperty(Ai,"__esModule",{value:!0}),Object.keys(Ti).forEach(function(e){var t=Object.getOwnPropertyDescriptor(Ti,e);Object.defineProperty(Ai,e,t.get?t:{enumerable:!0,get:function(){return Ti[e]}})}),Ai);let Mi=i,Oi=s,Ni=class T extends Error{constructor(e,t,r,n,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,T)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Mi.isColorSupported),Oi&&e&&(t=Oi(t));let i,o,r=t.split(/\r?\n/),n=Math.max(this.line-3,0),s=Math.min(this.line+2,r.length),a=String(s).length;if(e){let{bold:t,gray:r,red:n}=Mi.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t,r=" "+(" "+t).slice(-a)+" | ";return t===this.line?(t=o(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),i(">")+o(r)+e+"\n "+t+i("^")):" "+o(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}},Pi=Ni;Ni.default=Ni;i={};i.isClean=Symbol("isClean"),i.my=Symbol("my");let Li={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var u=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(let e=0;e<i;e++)r+=o}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(r=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(r),this.builder("}",e,"end")}body(t){let r=t.nodes.length-1;for(;0<r&&"comment"===t.nodes[r].type;)--r;var n=this.raw(t,"semicolon");for(let e=0;e<t.nodes.length;e++){var i=t.nodes[e],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,r!==e||n)}}comment(e){var t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r=r||t,!t||void 0===(n=e.raws[t])){var i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Li[r];i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);var o="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[o]?n=this[o](i,e):i.walk(e=>{if(void 0!==(n=e.raws[t]))return!1}),void 0===n&&(n=Li[r]),i.rawCache[r]=n}return n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,"")}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,"")}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,"")}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=(n=t[t.length-1]).replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},d=u;u.default=u;let Fi=d;function Bi(e,t){new Fi(t).stringify(e)}u=Bi;Bi.default=Bi;let{isClean:Di,my:Ui}=i,zi=Pi,Wi=d,Gi=u;var d=class{constructor(e={}){for(var t in this.raws={},this[Di]=!1,this[Ui]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){var t,r=function r(n,i){let o=new n.constructor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&"proxyCache"!==s){let e=n[s],t=typeof e;"parent"===s&&"object"==t?i&&(o[s]=i):"source"===s?o[s]=e:Array.isArray(e)?o[s]=e.map(e=>r(e,o)):("object"==t&&null!==e&&(e=r(e)),o[s]=e)}return o}(this);for(t in e)r[t]=e[t];return r}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new zi(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]!==r&&(e[t]=r,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markDirty(){if(this[Di]){this[Di]=!1;let e=this;for(;e=e.parent;)e[Di]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){let r=e||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let e=0;e<t;e++)"\n"===r[e]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};var n,i;return e.word?-1!==(i=(n=this.toString()).indexOf(e.word))&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n)):(e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1))),{end:r=r.line<t.line||r.line===t.line&&r.column<=t.column?{column:t.column+1,line:t.line}:r,start:t}}raw(e,t){return(new Wi).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...r){if(this.parent){let e=this,t=!1;for(var n of r)n===this?t=!0:t?(this.parent.insertAfter(e,n),e=n):this.parent.insertBefore(e,n);t||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){var r,n={},i=null==t;t=t||new Map;let o=0;for(r in this)if(Object.prototype.hasOwnProperty.call(this,r)&&"parent"!==r&&"proxyCache"!==r){var s=this[r];if(Array.isArray(s))n[r]=s.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)n[r]=s.toJSON(null,t);else if("source"===r){let e=t.get(s.input);null==e&&(e=o,t.set(s.input,o),o++),n[r]={end:s.end,inputId:e,start:s.start}}else n[r]=s}return i&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Gi){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){var n,i={node:this};for(n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}},h=d,d=(d.default=d,h),d=class extends d{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},y=d,d=(d.default=d,{nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,i=21)=>(e=i)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}});let{SourceMapConsumer:Hi,SourceMapGenerator:ji}=s,{existsSync:Zi,readFileSync:Vi}=s,{dirname:Yi,join:Xi}=s;var w=class{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Yi(this.mapFile)),e)&&(this.text=e)}consumer(){return this.consumerCache||(this.consumerCache=new Hi(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){var t,r=e.match(/\/\*\s*# sourceMappingURL=/gm);r&&(r=e.lastIndexOf(r.pop()),t=e.indexOf("*/",r),-1<r)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(r,t)))}loadFile(e){if(this.root=Yi(e),Zi(e))return this.mapFile=e,Vi(e,"utf-8").toString().trim()}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof Hi)return ji.fromSourceMap(e).toString();if(e instanceof ji)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}e=e(t);if(e){var r=this.loadFile(e);if(r)return r;throw new Error("Unable to load previous source map: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=Xi(Yi(t),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}},Ki=w;w.default=w;let{SourceMapConsumer:Ji,SourceMapGenerator:qi}=s,{fileURLToPath:$i,pathToFileURL:Qi}=s,{isAbsolute:eo,resolve:to}=s,ro=d.nanoid,no=s,io=Pi,oo=Ki,so=Symbol("fromOffsetCache"),ao=Boolean(Ji&&qi),lo=Boolean(to&&eo),co=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!lo||/^\w+:\/\//.test(t.from)||eo(t.from)?this.file=t.from:this.file=to(t.from)),lo&&ao&&(e=new oo(this.css,t)).text&&(t=(this.map=e).consumer().file,!this.file)&&t&&(this.file=this.mapResolve(t)),this.file||(this.id="<input css "+ro(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),s="number"==typeof a.offset?(c=this.fromOffset(a.offset),o=c.line,c.col):(o=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,o,s);return(i=c?new io(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new io(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin)).input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Qi&&(i.input.url=Qi(this.file).toString()),i.input.file=this.file),i}fromOffset(r){let n;if(this[so])n=this[so];else{var i=this.css.split("\n");n=new Array(i.length);let r=0;for(let e=0,t=i.length;e<t;e++)n[e]=r,r+=i[e].length+1;this[so]=n}let o=0;if(n[n.length-1]<=r)o=n.length-1;else{let e,t=n.length-2;for(;o<t;)if(e=o+(t-o>>1),r<n[e])t=e-1;else{if(!(r>=n[e+1])){o=e;break}o=e+1}}return{col:r-n[o]+1,line:o+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:to(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=eo(a.source)?Qi(a.source):new URL(a.source,this.map.consumer().sourceRoot||Qi(this.map.mapFile));t={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!$i)throw new Error("file: protocol is not available in this PostCSS build");t.file=$i(o)}e=s.sourceContentFor(a.source);return e&&(t.source=e),t}toJSON(){var e,t={};for(e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache)&&(t.map.consumerCache=void 0),t}get from(){return this.file||this.id}},uo=co,{SourceMapConsumer:ho,SourceMapGenerator:po}=(co.default=co,no&&no.registerInput&&no.registerInput(co),s),{dirname:fo,relative:mo,resolve:go,sep:vo}=s,yo=s.pathToFileURL,wo=uo,bo=Boolean(ho&&po),So=Boolean(fo&&go&&mo&&vo),Co=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var n of this.previous()){let e,t=this.toUrl(this.path(n.file)),r=n.root||fo(n.file);!1===this.mapOpts.sourcesContent?(e=new ho(n.text)).sourcesContent&&(e.sourcesContent=null):e=n.consumer(),this.map.applySourceMap(e,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){var t;for(let e=this.root.nodes.length-1;0<=e;e--)"comment"===(t=this.root.nodes[e]).type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),So&&bo&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=po.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new po({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new po({file:this.outputFile(),ignoreInvalidMapping:!0});let n,i,o=1,s=1,a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(a.generated.line=o,a.generated.column=s-1,t.source&&t.source.start?(a.source=this.sourcePath(t),a.original.line=t.source.start.line,a.original.column=t.source.start.column-1):(a.source="<no source>",a.original.line=1,a.original.column=0),this.map.addMapping(a)),(n=e.match(/\n/g))?(o+=n.length,i=e.lastIndexOf("\n"),s=e.length-i):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(a.source=this.sourcePath(t),a.original.line=t.source.end.line,a.original.column=t.source.end.column-1,a.generated.line=o,a.generated.column=s-2):(a.source="<no source>",a.original.line=1,a.original.column=0,a.generated.line=o,a.generated.column=s-1),this.map.addMapping(a))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?fo(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=fo(go(r,this.mapOpts.annotation)));t=mo(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new wo(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(yo)return t=yo(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===vo&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};w=h,d=class extends w{constructor(e){super(e),this.type="comment"}},s=d;d.default=d;let ko,_o,Io,Eo,{isClean:xo,my:To}=i,Ro=y,Ao=s,Mo=h,Oo=class T extends Mo{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(n){if(this.proxyOf.nodes){let e,t,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(e=this.indexes[r],!1!==(t=n(this.proxyOf.nodes[e],e)));)this.indexes[r]+=1;return delete this.indexes[r],t}}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(t,n)=>"proxyOf"===n?t:t[n]&&("each"===n||"string"==typeof n&&n.startsWith("walk")?(...e)=>t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n]),set:(e,t,r)=>(e[t]!==r&&(e[t]=r,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e);for(n of s)this.proxyOf.nodes.splice(o+1,0,n);for(i in this.indexes)r=this.indexes[i],o<r&&(this.indexes[i]=r+s.length);return this.markDirty(),this}insertBefore(e,t){var r,n,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e);for(n of s)this.proxyOf.nodes.splice(o,0,n);for(i in this.indexes)r=this.indexes[i],o<=r&&(this.indexes[i]=r+s.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(ko(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Ro(e)]}else if(e.selector)e=[new _o(e)];else if(e.name)e=[new Io(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Ao(e)]}return e.map(e=>(e[To]||T.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[xo]&&function e(t){if(t[xo]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,i=this.normalize(t,this.first,"prepend").reverse();for(r of i)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+i.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)t=this.indexes[r],e<=t&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return r=!1!==r&&t.walk?t.walk(n):r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Oo.registerParse=e=>{ko=e},Oo.registerRule=e=>{_o=e},Oo.registerAtRule=e=>{Io=e},Oo.registerRoot=e=>{Eo=e};w=Oo;(Oo.default=Oo).rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Io.prototype):"rule"===e.type?Object.setPrototypeOf(e,_o.prototype):"decl"===e.type?Object.setPrototypeOf(e,Ro.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ao.prototype):"root"===e.type&&Object.setPrototypeOf(e,Eo.prototype),e[To]=!0,e.nodes&&e.nodes.forEach(e=>{Oo.rebuild(e)})};let No,Po,Lo=w,Fo=class extends Lo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new No(new Po,this,e).stringify()}};Fo.registerLazyResult=e=>{No=e},Fo.registerProcessor=e=>{Po=e};d=Fo;Fo.default=Fo;function Bo(e){Do[e]||(Do[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}let Do={};var b=class{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},S=b;b.default=b;let Uo=S,zo=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Uo(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},Wo=zo,Go=(zo.default=zo,"'".charCodeAt(0)),Ho='"'.charCodeAt(0),jo="\\".charCodeAt(0),Zo="/".charCodeAt(0),Vo="\n".charCodeAt(0),Yo=" ".charCodeAt(0),Xo="\f".charCodeAt(0),Ko="\t".charCodeAt(0),Jo="\r".charCodeAt(0),qo="[".charCodeAt(0),$o="]".charCodeAt(0),Qo="(".charCodeAt(0),es=")".charCodeAt(0),ts="{".charCodeAt(0),rs="}".charCodeAt(0),ns=";".charCodeAt(0),is="*".charCodeAt(0),os=":".charCodeAt(0),ss="@".charCodeAt(0),as=/[\t\n\f\r "#'()/;[\\\]{}]/g,ls=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,cs=/.[\r\n"'(/\\]/,us=/[\da-f]/i;var b=w,ds=class extends b{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},C=ds;b.registerAtRule(ds.default=ds);let hs,ps,fs=w,ms=class extends fs{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(var n of e)n.raws.before=t.raws.before;return e}removeChild(e,t){var r=this.index(e);return!t&&0===r&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new hs(new ps,this,e).stringify()}};ms.registerLazyResult=e=>{hs=e},ms.registerProcessor=e=>{ps=e};b=ms;ms.default=ms,fs.registerRoot(ms);let gs={comma:e=>gs.split(e,[","],!0),space:e=>gs.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(var u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?s+=1:")"===u?0<s&&--s:0===s&&t.includes(u)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=u;return!r&&""===i||n.push(i.trim()),n}},vs=gs,ys=(gs.default=gs,w),ws=vs,bs=class extends ys{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ws.comma(this.selector)}set selectors(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}},Ss=bs,Cs=(bs.default=bs,ys.registerRule(bs),y),ks=s,_s=C,Is=b,Es=Ss,xs={empty:!0,space:!0},Ts=w,Rs=class{constructor(e){this.input=e,this.root=new Is,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new _s,o=(i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]),!1),s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(0<a.length){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}}if(a.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(n){var i=this.colon(n);if(!1!==i){let t,r=0;for(let e=i-1;0<=e&&("space"===(t=n[e])[0]||2!==(r+=1));e--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}}colon(e){let t,r,n,i=0;for(var[o,s]of e.entries()){if("("===(r=(t=s)[0])&&(i+=1),")"===r&&--i,0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){var t=new ks,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}createTokenizer(){this.tokenizer=((t,e={})=>{let n,i,o,s,a,l,c,u,d,h,p=t.css.valueOf(),f=e.ignoreErrors,m=p.length,g=0,v=[],y=[];function w(e){throw t.error("Unclosed "+e,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=m},nextToken:function(e){if(y.length)return y.pop();if(!(g>=m)){var t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(g)){case Vo:case Yo:case Ko:case Jo:case Xo:for(i=g;i+=1,(n=p.charCodeAt(i))===Yo||n===Vo||n===Ko||n===Jo||n===Xo;);h=["space",p.slice(g,i)],g=i-1;break;case qo:case $o:case ts:case rs:case os:case ns:case es:var r=String.fromCharCode(n);h=[r,r,g];break;case Qo:if(u=v.length?v.pop()[1]:"",d=p.charCodeAt(g+1),"url"===u&&d!==Go&&d!==Ho&&d!==Yo&&d!==Vo&&d!==Ko&&d!==Xo&&d!==Jo){i=g;do{if(l=!1,-1===(i=p.indexOf(")",i+1))){if(f||t){i=g;break}w("bracket")}for(c=i;p.charCodeAt(c-1)===jo;)--c,l=!l}while(l);h=["brackets",p.slice(g,i+1),g,i],g=i}else i=p.indexOf(")",g+1),s=p.slice(g,i+1),-1===i||cs.test(s)?h=["(","(",g]:(h=["brackets",s,g,i],g=i);break;case Go:case Ho:o=n===Go?"'":'"',i=g;do{if(l=!1,-1===(i=p.indexOf(o,i+1))){if(f||t){i=g+1;break}w("string")}for(c=i;p.charCodeAt(c-1)===jo;)--c,l=!l}while(l);h=["string",p.slice(g,i+1),g,i],g=i;break;case ss:as.lastIndex=g+1,as.test(p),i=0===as.lastIndex?p.length-1:as.lastIndex-2,h=["at-word",p.slice(g,i+1),g,i],g=i;break;case jo:for(i=g,a=!0;p.charCodeAt(i+1)===jo;)i+=1,a=!a;if(n=p.charCodeAt(i+1),a&&n!==Zo&&n!==Yo&&n!==Vo&&n!==Ko&&n!==Jo&&n!==Xo&&(i+=1,us.test(p.charAt(i)))){for(;us.test(p.charAt(i+1));)i+=1;p.charCodeAt(i+1)===Yo&&(i+=1)}h=["word",p.slice(g,i+1),g,i],g=i;break;default:g=(n===Zo&&p.charCodeAt(g+1)===is?(0===(i=p.indexOf("*/",g+2)+1)&&(f||t?i=p.length:w("comment")),h=["comment",p.slice(g,i+1),g,i]):(ls.lastIndex=g+1,ls.test(p),i=0===ls.lastIndex?p.length-1:ls.lastIndex-2,h=["word",p.slice(g,i+1),g,i],v.push(h)),i)}return g++,h}},position:function(){return g}}})(this.input)}decl(e,t){var i=new Cs;this.init(i,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(n[3]||n[2]||(t=>{for(let e=t.length-1;0<=e;e--){var r=t[e],r=r[3]||r[2];if(r)return r}})(e)),i.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;i.prop+=e.shift()[1]}for(i.raws.between="";e.length;){if(":"===(r=e.shift())[0]){i.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),i.raws.between+=r[1]}"_"!==i.prop[0]&&"*"!==i.prop[0]||(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let s,a=[];for(;e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let n=e.length-1;0<=n;n--){if("!important"===(r=e[n])[1].toLowerCase()){i.important=!0;var l=this.stringFrom(e,n);" !important"!==(l=this.spacesFromEnd(e)+l)&&(i.raws.important=l);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=n;0<e;e--){var c=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==c)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(i.important=!0,i.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(i.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(i,"value",a.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){var t=new Es;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i=i||l,o.push("("===r?")":"]");else if(s&&n&&"{"===r)i=i||l,o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0<o.length&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){for(var e;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)"space"===(o=(i=r[e])[0])&&e===l-1&&!n||"comment"===o&&(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",xs[a]||xs[s]||","===c.slice(-1))?u=!1:c+=i[1];var d;u||(d=r.reduce((e,t)=>e+t[1],""),e.raws[t]={raw:d,value:c}),e[t]=c}rule(e){e.pop();var t=new Es;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;e<t.length;e++)n+=t[e][1];return t.splice(r,t.length-r),n}unclosedBlock(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},As=uo;function Ms(e,t){var r=new As(e,t),r=new Rs(r);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}ds=Ms;Ms.default=Ms,Ts.registerParse(Ms);let{isClean:Os,my:Ns}=i,Ps=Co,Ls=u,Fs=w,Bs=d,Ds=Bo,Us=Wo,zs=ds,Ws=b,Gs={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Hs={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},js={Once:!0,postcssPlugin:!0,prepare:!0};function Zs(e){return"object"==typeof e&&"function"==typeof e.then}function Vs(e){let t=!1,r=Gs[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Ys(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Vs(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function Xs(e){return e[Os]=!1,e.nodes&&e.nodes.forEach(e=>Xs(e)),e}let Ks={},Js=class T{constructor(e,t,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof T||t instanceof Us)n=Xs(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=zs;r.syntax&&(e=r.syntax.parse),(e=r.parser?r.parser:e).parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[Ns]&&Fs.rebuild(n)}else n=Xs(t);this.result=new Us(e,n,r),this.helpers={...Ks,postcss:Ks,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r,n,i,o,s,a=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?a.postcssVersion&&"production"!==process.env.NODE_ENV&&(r=a.postcssPlugin,n=a.postcssVersion,i=this.result.processor.version,o=n.split("."),s=i.split("."),o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below."):(e.plugin=a.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!Hs[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!js[r])if("object"==typeof e[r])for(var n in e[r])t(e,"*"===n?r:r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0<Object.keys(this.listeners).length}async runAsync(){for(let e=this.plugin=0;e<this.plugins.length;e++){var t=this.plugins[e],t=this.runOnRoot(t);if(Zs(t))try{await t}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){for(var r,n=this.result.root;!n[Os];){n[Os]=!0;for(var i=[Ys(n)];0<i.length;){var o=this.visitTick(i);if(Zs(o))try{await o}catch(e){o=i[i.length-1].node;throw this.handleError(e,o)}}}if(this.listeners.OnceExit)for(let[e,t]of this.listeners.OnceExit){this.result.lastPlugin=e;try{"document"===n.type?(r=n.nodes.map(e=>t(e,this.helpers)),await Promise.all(r)):await t(n,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;return"object"==typeof t&&t.Once?"document"===this.result.root.type?Zs((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(!this.stringified){this.stringified=!0,this.sync();let e=this.result.opts,t=Ls;e.syntax&&(t=e.syntax.stringify),(t=e.stringifier?e.stringifier:t).stringify&&(t=t.stringify);var r=new Ps(t,this.result.root,this.result.opts).generate();this.result.css=r[0],this.result.map=r[1]}return this.result}sync(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(Zs(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){for(var t=this.result.root;!t[Os];)t[Os]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(var r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||Ds("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}toString(){return this.css}visitSync(t,r){for(var[n,i]of t){let e;this.result.lastPlugin=n;try{e=i(r,this.helpers)}catch(t){throw this.handleError(t,r.proxyOf)}if("root"!==r.type&&"document"!==r.type&&!r.parent)return!0;if(Zs(e))throw this.getAsyncError()}}visitTick(e){var t=e[e.length-1],{node:r,visitors:n}=t;if("root"===r.type||"document"===r.type||r.parent){if(0<n.length&&t.visitorIndex<n.length){var[i,o]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return o(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){for(var s,a=t.iterator;s=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!s[Os])return s[Os]=!0,void e.push(Ys(s));t.iterator=0,delete r.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var c=l[t.eventIndex];if(t.eventIndex+=1,0===c)return void(r.nodes&&r.nodes.length&&(r[Os]=!0,t.iterator=r.getIterator()));if(this.listeners[c])return void(t.visitors=this.listeners[c])}}e.pop()}walkSync(e){var t;e[Os]=!0;for(t of Vs(e))if(0===t)e.nodes&&e.each(e=>{e[Os]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Js.registerPostcss=e=>{Ks=e};i=Js;Js.default=Js,Ws.registerLazyResult(Js),Bs.registerLazyResult(Js);let qs=Co,$s=u,Qs=Bo,ea=ds,ta=Wo;var ra=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;e=$s;this.result=new ta(this._processor,void 0,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});r=new qs(e,void 0,this._opts,t);r.isMap()?([e,t]=r.generate(),e&&(this.result.css=e),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Qs("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=ea;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}get[Symbol.toStringTag](){return"NoWorkResult"}},na=ra;ra.default=ra;let ia=na,oa=i,sa=d,aa=b,la=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?oa:ia)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},ca=la,ua=(la.default=la,aa.registerProcessor(la),sa.registerProcessor(la),y),da=Ki,ha=s,pa=C,fa=uo,ma=b,ga=Ss;function va(e,r){if(Array.isArray(e))return e.map(e=>va(e));let{inputs:t,...n}=e;if(t){r=[];for(var i of t){i={...i,__proto__:fa.prototype};i.map&&(i.map={...i.map,__proto__:da.prototype}),r.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>va(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new ma(n);if("decl"===n.type)return new ua(n);if("rule"===n.type)return new ga(n);if("comment"===n.type)return new ha(n);if("atrule"===n.type)return new pa(n);throw new Error("Unknown node type: "+e.type)}ra=va;va.default=va;let ya=Pi,wa=y,ba=i,Sa=w,Ca=ca,ka=u,_a=ra,Ia=d,Ea=S,xa=s,Ta=C,Ra=Wo,Aa=uo,Ma=ds,Oa=vs,Na=Ss,Pa=b,La=h;function k(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Ca(e)}k.plugin=function(t,r){let e,n=!1;function i(...e){console&&console.warn&&!n&&(n=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");e=r(...e);return e.postcssPlugin=t,e.postcssVersion=(new Ca).version,e}return Object.defineProperty(i,"postcss",{get:()=>e=e||i()}),i.process=function(e,t,r){return k([i(r)]).process(e,t)},i},k.stringify=ka,k.parse=Ma,k.fromJSON=_a,k.list=Oa,k.comment=e=>new xa(e),k.atRule=e=>new Ta(e),k.decl=e=>new wa(e),k.rule=e=>new Na(e),k.root=e=>new Pa(e),k.document=e=>new Ia(e),k.CssSyntaxError=ya,k.Declaration=wa,k.Container=Sa,k.Processor=Ca,k.Document=Ia,k.Comment=xa,k.Warning=Ea,k.AtRule=Ta,k.Result=Ra,k.Input=Aa,k.Rule=Na,k.Root=Pa,k.Node=La,ba.registerPostcss(k);na=k,k.default=k,y=(Ki=na)&&Ki.__esModule&&Object.prototype.hasOwnProperty.call(Ki,"default")?Ki.default:Ki;y.stringify,Object.defineProperty;function Fa(){return{isColorSupported:!1,reset:_,bold:_,dim:_,italic:_,underline:_,inverse:_,hidden:_,strikethrough:_,black:_,red:_,green:_,yellow:_,blue:_,magenta:_,cyan:_,white:_,gray:_,bgBlack:_,bgRed:_,bgGreen:_,bgYellow:_,bgBlue:_,bgMagenta:_,bgCyan:_,bgWhite:_}}var Ba,Da,Ua,i={exports:{}},_=String,w=(i.exports=Fa(),i.exports.createColors=Fa,i.exports),u=(Ba=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?Ba:("function"==typeof(Da=Ba.default)?(Ua=function e(){return this instanceof e?Reflect.construct(Da,arguments,this.constructor):Da.apply(this,arguments)}).prototype=Da.prototype:Ua={},Object.defineProperty(Ua,"__esModule",{value:!0}),Object.keys(Ba).forEach(function(e){var t=Object.getOwnPropertyDescriptor(Ba,e);Object.defineProperty(Ua,e,t.get?t:{enumerable:!0,get:function(){return Ba[e]}})}),Ua);let za=w,Wa=u,Ga=class T extends Error{constructor(e,t,r,n,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,T)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=za.isColorSupported),Wa&&e&&(t=Wa(t));let i,o,r=t.split(/\r?\n/),n=Math.max(this.line-3,0),s=Math.min(this.line+2,r.length),a=String(s).length;if(e){let{bold:t,gray:r,red:n}=za.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t,r=" "+(" "+t).slice(-a)+" | ";return t===this.line?(t=o(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),i(">")+o(r)+e+"\n "+t+i("^")):" "+o(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}},Ha=Ga;Ga.default=Ga;ra={};ra.isClean=Symbol("isClean"),ra.my=Symbol("my");let ja={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};d=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(let e=0;e<i;e++)r+=o}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(r=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(r),this.builder("}",e,"end")}body(t){let r=t.nodes.length-1;for(;0<r&&"comment"===t.nodes[r].type;)--r;var n=this.raw(t,"semicolon");for(let e=0;e<t.nodes.length;e++){var i=t.nodes[e],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,r!==e||n)}}comment(e){var t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r=r||t,!t||void 0===(n=e.raws[t])){var i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return ja[r];i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);var o="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[o]?n=this[o](i,e):i.walk(e=>{if(void 0!==(n=e.raws[t]))return!1}),void 0===n&&(n=ja[r]),i.rawCache[r]=n}return n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,"")}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,"")}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,"")}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=(n=t[t.length-1]).replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},S=d;d.default=d;let Za=S;function Va(e,t){new Za(t).stringify(e)}s=Va;Va.default=Va;let{isClean:Ya,my:Xa}=ra,Ka=Ha,Ja=S,qa=s;C=class{constructor(e={}){for(var t in this.raws={},this[Ya]=!1,this[Xa]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){var t,r=function r(n,i){let o=new n.constructor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&"proxyCache"!==s){let e=n[s],t=typeof e;"parent"===s&&"object"==t?i&&(o[s]=i):"source"===s?o[s]=e:Array.isArray(e)?o[s]=e.map(e=>r(e,o)):("object"==t&&null!==e&&(e=r(e)),o[s]=e)}return o}(this);for(t in e)r[t]=e[t];return r}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ka(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]!==r&&(e[t]=r,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markDirty(){if(this[Ya]){this[Ya]=!1;let e=this;for(;e=e.parent;)e[Ya]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){let r=e||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let e=0;e<t;e++)"\n"===r[e]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};var n,i;return e.word?-1!==(i=(n=this.toString()).indexOf(e.word))&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n)):(e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1))),{end:r=r.line<t.line||r.line===t.line&&r.column<=t.column?{column:t.column+1,line:t.line}:r,start:t}}raw(e,t){return(new Ja).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...r){if(this.parent){let e=this,t=!1;for(var n of r)n===this?t=!0:t?(this.parent.insertAfter(e,n),e=n):this.parent.insertBefore(e,n);t||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){var r,n={},i=null==t;t=t||new Map;let o=0;for(r in this)if(Object.prototype.hasOwnProperty.call(this,r)&&"parent"!==r&&"proxyCache"!==r){var s=this[r];if(Array.isArray(s))n[r]=s.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)n[r]=s.toJSON(null,t);else if("source"===r){let e=t.get(s.input);null==e&&(e=o,t.set(s.input,o),o++),n[r]={end:s.end,inputId:e,start:s.start}}else n[r]=s}return i&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=qa){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){var n,i={node:this};for(n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}},ds=C,C.default=C,b=ds,h=class extends b{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},na=h,h.default=h,Ki={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,i=21)=>(e=i)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:$a,SourceMapGenerator:Qa}=u,{existsSync:el,readFileSync:tl}=u,{dirname:rl,join:nl}=u;y=class{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=rl(this.mapFile)),e)&&(this.text=e)}consumer(){return this.consumerCache||(this.consumerCache=new $a(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){var t,r=e.match(/\/\*\s*# sourceMappingURL=/gm);r&&(r=e.lastIndexOf(r.pop()),t=e.indexOf("*/",r),-1<r)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(r,t)))}loadFile(e){if(this.root=rl(e),el(e))return this.mapFile=e,tl(e,"utf-8").toString().trim()}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof $a)return Qa.fromSourceMap(e).toString();if(e instanceof Qa)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}e=e(t);if(e){var r=this.loadFile(e);if(r)return r;throw new Error("Unable to load previous source map: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=nl(rl(t),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}},i=y;y.default=y;let{SourceMapConsumer:il,SourceMapGenerator:ol}=u,{fileURLToPath:sl,pathToFileURL:al}=u,{isAbsolute:ll,resolve:cl}=u,ul=Ki.nanoid,dl=u,hl=Ha,pl=i,fl=Symbol("fromOffsetCache"),ml=Boolean(il&&ol),gl=Boolean(cl&&ll),vl=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!gl||/^\w+:\/\//.test(t.from)||ll(t.from)?this.file=t.from:this.file=cl(t.from)),gl&&ml&&(e=new pl(this.css,t)).text&&(t=(this.map=e).consumer().file,!this.file)&&t&&(this.file=this.mapResolve(t)),this.file||(this.id="<input css "+ul(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),s="number"==typeof a.offset?(c=this.fromOffset(a.offset),o=c.line,c.col):(o=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,o,s);return(i=c?new hl(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new hl(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin)).input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(al&&(i.input.url=al(this.file).toString()),i.input.file=this.file),i}fromOffset(r){let n;if(this[fl])n=this[fl];else{var i=this.css.split("\n");n=new Array(i.length);let r=0;for(let e=0,t=i.length;e<t;e++)n[e]=r,r+=i[e].length+1;this[fl]=n}let o=0;if(n[n.length-1]<=r)o=n.length-1;else{let e,t=n.length-2;for(;o<t;)if(e=o+(t-o>>1),r<n[e])t=e-1;else{if(!(r>=n[e+1])){o=e;break}o=e+1}}return{col:r-n[o]+1,line:o+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:cl(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=ll(a.source)?al(a.source):new URL(a.source,this.map.consumer().sourceRoot||al(this.map.mapFile));t={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!sl)throw new Error("file: protocol is not available in this PostCSS build");t.file=sl(o)}e=s.sourceContentFor(a.source);return e&&(t.source=e),t}toJSON(){var e,t={};for(e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache)&&(t.map.consumerCache=void 0),t}get from(){return this.file||this.id}},yl=vl,{SourceMapConsumer:wl,SourceMapGenerator:bl}=(vl.default=vl,dl&&dl.registerInput&&dl.registerInput(vl),u),{dirname:Sl,relative:Cl,resolve:kl,sep:_l}=u,Il=u.pathToFileURL,El=yl,xl=Boolean(wl&&bl),Tl=Boolean(Sl&&kl&&Cl&&_l),Rl=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var n of this.previous()){let e,t=this.toUrl(this.path(n.file)),r=n.root||Sl(n.file);!1===this.mapOpts.sourcesContent?(e=new wl(n.text)).sourcesContent&&(e.sourcesContent=null):e=n.consumer(),this.map.applySourceMap(e,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){var t;for(let e=this.root.nodes.length-1;0<=e;e--)"comment"===(t=this.root.nodes[e]).type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Tl&&xl&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=bl.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new bl({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new bl({file:this.outputFile(),ignoreInvalidMapping:!0});let n,i,o=1,s=1,a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(a.generated.line=o,a.generated.column=s-1,t.source&&t.source.start?(a.source=this.sourcePath(t),a.original.line=t.source.start.line,a.original.column=t.source.start.column-1):(a.source="<no source>",a.original.line=1,a.original.column=0),this.map.addMapping(a)),(n=e.match(/\n/g))?(o+=n.length,i=e.lastIndexOf("\n"),s=e.length-i):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(a.source=this.sourcePath(t),a.original.line=t.source.end.line,a.original.column=t.source.end.column-1,a.generated.line=o,a.generated.column=s-2):(a.source="<no source>",a.original.line=1,a.original.column=0,a.generated.line=o,a.generated.column=s-1),this.map.addMapping(a))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Sl(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Sl(kl(r,this.mapOpts.annotation)));t=Cl(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new El(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(Il)return t=Il(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===_l&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};w=ds,d=class extends w{constructor(e){super(e),this.type="comment"}},S=d;d.default=d;let Al,Ml,Ol,Nl,{isClean:Pl,my:Ll}=ra,Fl=na,Bl=S,Dl=ds,Ul=class T extends Dl{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(n){if(this.proxyOf.nodes){let e,t,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(e=this.indexes[r],!1!==(t=n(this.proxyOf.nodes[e],e)));)this.indexes[r]+=1;return delete this.indexes[r],t}}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(t,n)=>"proxyOf"===n?t:t[n]&&("each"===n||"string"==typeof n&&n.startsWith("walk")?(...e)=>t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n]),set:(e,t,r)=>(e[t]!==r&&(e[t]=r,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e);for(n of s)this.proxyOf.nodes.splice(o+1,0,n);for(i in this.indexes)r=this.indexes[i],o<r&&(this.indexes[i]=r+s.length);return this.markDirty(),this}insertBefore(e,t){var r,n,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e);for(n of s)this.proxyOf.nodes.splice(o,0,n);for(i in this.indexes)r=this.indexes[i],o<=r&&(this.indexes[i]=r+s.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(Al(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Fl(e)]}else if(e.selector)e=[new Ml(e)];else if(e.name)e=[new Ol(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Bl(e)]}return e.map(e=>(e[Ll]||T.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Pl]&&function e(t){if(t[Pl]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,i=this.normalize(t,this.first,"prepend").reverse();for(r of i)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+i.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)t=this.indexes[r],e<=t&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return r=!1!==r&&t.walk?t.walk(n):r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ul.registerParse=e=>{Al=e},Ul.registerRule=e=>{Ml=e},Ul.registerAtRule=e=>{Ol=e},Ul.registerRoot=e=>{Nl=e};C=Ul;(Ul.default=Ul).rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ol.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ml.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fl.prototype):"comment"===e.type?Object.setPrototypeOf(e,Bl.prototype):"root"===e.type&&Object.setPrototypeOf(e,Nl.prototype),e[Ll]=!0,e.nodes&&e.nodes.forEach(e=>{Ul.rebuild(e)})};let zl,Wl,Gl=C,Hl=class extends Gl{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zl(new Wl,this,e).stringify()}};Hl.registerLazyResult=e=>{zl=e},Hl.registerProcessor=e=>{Wl=e};b=Hl;Hl.default=Hl;function jl(e){Zl[e]||(Zl[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}let Zl={};h=class{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},y=h;h.default=h;let Vl=y,Yl=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Vl(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},Xl=Yl,Kl=(Yl.default=Yl,"'".charCodeAt(0)),Jl='"'.charCodeAt(0),ql="\\".charCodeAt(0),$l="/".charCodeAt(0),Ql="\n".charCodeAt(0),ec=" ".charCodeAt(0),tc="\f".charCodeAt(0),rc="\t".charCodeAt(0),nc="\r".charCodeAt(0),ic="[".charCodeAt(0),oc="]".charCodeAt(0),sc="(".charCodeAt(0),ac=")".charCodeAt(0),lc="{".charCodeAt(0),cc="}".charCodeAt(0),uc=";".charCodeAt(0),dc="*".charCodeAt(0),hc=":".charCodeAt(0),pc="@".charCodeAt(0),fc=/[\t\n\f\r "#'()/;[\\\]{}]/g,mc=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,gc=/.[\r\n"'(/\\]/,vc=/[\da-f]/i;Ki=C,u=class extends Ki{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},w=u;Ki.registerAtRule(u.default=u);let yc,wc,bc=C,Sc=class extends bc{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(var n of e)n.raws.before=t.raws.before;return e}removeChild(e,t){var r=this.index(e);return!t&&0===r&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new yc(new wc,this,e).stringify()}};Sc.registerLazyResult=e=>{yc=e},Sc.registerProcessor=e=>{wc=e};d=Sc;Sc.default=Sc,bc.registerRoot(Sc);let Cc={comma:e=>Cc.split(e,[","],!0),space:e=>Cc.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(var u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?s+=1:")"===u?0<s&&--s:0===s&&t.includes(u)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=u;return!r&&""===i||n.push(i.trim()),n}},kc=Cc,_c=(Cc.default=Cc,C),Ic=kc,Ec=class extends _c{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ic.comma(this.selector)}set selectors(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}},xc=Ec,Tc=(Ec.default=Ec,_c.registerRule(Ec),na),Rc=S,Ac=w,Mc=d,Oc=xc,Nc={empty:!0,space:!0},Pc=C,Lc=class{constructor(e){this.input=e,this.root=new Mc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new Ac,o=(i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]),!1),s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(0<a.length){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}}if(a.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(n){var i=this.colon(n);if(!1!==i){let t,r=0;for(let e=i-1;0<=e&&("space"===(t=n[e])[0]||2!==(r+=1));e--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}}colon(e){let t,r,n,i=0;for(var[o,s]of e.entries()){if("("===(r=(t=s)[0])&&(i+=1),")"===r&&--i,0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){var t=new Rc,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}createTokenizer(){this.tokenizer=((t,e={})=>{let n,i,o,s,a,l,c,u,d,h,p=t.css.valueOf(),f=e.ignoreErrors,m=p.length,g=0,v=[],y=[];function w(e){throw t.error("Unclosed "+e,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=m},nextToken:function(e){if(y.length)return y.pop();if(!(g>=m)){var t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(g)){case Ql:case ec:case rc:case nc:case tc:for(i=g;i+=1,(n=p.charCodeAt(i))===ec||n===Ql||n===rc||n===nc||n===tc;);h=["space",p.slice(g,i)],g=i-1;break;case ic:case oc:case lc:case cc:case hc:case uc:case ac:var r=String.fromCharCode(n);h=[r,r,g];break;case sc:if(u=v.length?v.pop()[1]:"",d=p.charCodeAt(g+1),"url"===u&&d!==Kl&&d!==Jl&&d!==ec&&d!==Ql&&d!==rc&&d!==tc&&d!==nc){i=g;do{if(l=!1,-1===(i=p.indexOf(")",i+1))){if(f||t){i=g;break}w("bracket")}for(c=i;p.charCodeAt(c-1)===ql;)--c,l=!l}while(l);h=["brackets",p.slice(g,i+1),g,i],g=i}else i=p.indexOf(")",g+1),s=p.slice(g,i+1),-1===i||gc.test(s)?h=["(","(",g]:(h=["brackets",s,g,i],g=i);break;case Kl:case Jl:o=n===Kl?"'":'"',i=g;do{if(l=!1,-1===(i=p.indexOf(o,i+1))){if(f||t){i=g+1;break}w("string")}for(c=i;p.charCodeAt(c-1)===ql;)--c,l=!l}while(l);h=["string",p.slice(g,i+1),g,i],g=i;break;case pc:fc.lastIndex=g+1,fc.test(p),i=0===fc.lastIndex?p.length-1:fc.lastIndex-2,h=["at-word",p.slice(g,i+1),g,i],g=i;break;case ql:for(i=g,a=!0;p.charCodeAt(i+1)===ql;)i+=1,a=!a;if(n=p.charCodeAt(i+1),a&&n!==$l&&n!==ec&&n!==Ql&&n!==rc&&n!==nc&&n!==tc&&(i+=1,vc.test(p.charAt(i)))){for(;vc.test(p.charAt(i+1));)i+=1;p.charCodeAt(i+1)===ec&&(i+=1)}h=["word",p.slice(g,i+1),g,i],g=i;break;default:g=(n===$l&&p.charCodeAt(g+1)===dc?(0===(i=p.indexOf("*/",g+2)+1)&&(f||t?i=p.length:w("comment")),h=["comment",p.slice(g,i+1),g,i]):(mc.lastIndex=g+1,mc.test(p),i=0===mc.lastIndex?p.length-1:mc.lastIndex-2,h=["word",p.slice(g,i+1),g,i],v.push(h)),i)}return g++,h}},position:function(){return g}}})(this.input)}decl(e,t){var i=new Tc;this.init(i,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(n[3]||n[2]||(t=>{for(let e=t.length-1;0<=e;e--){var r=t[e],r=r[3]||r[2];if(r)return r}})(e)),i.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;i.prop+=e.shift()[1]}for(i.raws.between="";e.length;){if(":"===(r=e.shift())[0]){i.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),i.raws.between+=r[1]}"_"!==i.prop[0]&&"*"!==i.prop[0]||(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let s,a=[];for(;e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let n=e.length-1;0<=n;n--){if("!important"===(r=e[n])[1].toLowerCase()){i.important=!0;var l=this.stringFrom(e,n);" !important"!==(l=this.spacesFromEnd(e)+l)&&(i.raws.important=l);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=n;0<e;e--){var c=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==c)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(i.important=!0,i.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(i.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(i,"value",a.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){var t=new Oc;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i=i||l,o.push("("===r?")":"]");else if(s&&n&&"{"===r)i=i||l,o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0<o.length&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){for(var e;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)"space"===(o=(i=r[e])[0])&&e===l-1&&!n||"comment"===o&&(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",Nc[a]||Nc[s]||","===c.slice(-1))?u=!1:c+=i[1];var d;u||(d=r.reduce((e,t)=>e+t[1],""),e.raws[t]={raw:d,value:c}),e[t]=c}rule(e){e.pop();var t=new Oc;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;e<t.length;e++)n+=t[e][1];return t.splice(r,t.length-r),n}unclosedBlock(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Fc=yl;function Bc(e,t){var r=new Fc(e,t),r=new Lc(r);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}h=Bc;Bc.default=Bc,Pc.registerParse(Bc);let{isClean:Dc,my:Uc}=ra,zc=Rl,Wc=s,Gc=C,Hc=b,jc=jl,Zc=Xl,Vc=h,Yc=d,Xc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Kc={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Jc={Once:!0,postcssPlugin:!0,prepare:!0};function qc(e){return"object"==typeof e&&"function"==typeof e.then}function $c(e){let t=!1,r=Xc[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Qc(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:$c(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function eu(e){return e[Dc]=!1,e.nodes&&e.nodes.forEach(e=>eu(e)),e}let tu={},ru=class T{constructor(e,t,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof T||t instanceof Zc)n=eu(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=Vc;r.syntax&&(e=r.syntax.parse),(e=r.parser?r.parser:e).parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[Uc]&&Gc.rebuild(n)}else n=eu(t);this.result=new Zc(e,n,r),this.helpers={...tu,postcss:tu,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r,n,i,o,s,a=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?a.postcssVersion&&"production"!==process.env.NODE_ENV&&(r=a.postcssPlugin,n=a.postcssVersion,i=this.result.processor.version,o=n.split("."),s=i.split("."),o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below."):(e.plugin=a.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!Kc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Jc[r])if("object"==typeof e[r])for(var n in e[r])t(e,"*"===n?r:r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0<Object.keys(this.listeners).length}async runAsync(){for(let e=this.plugin=0;e<this.plugins.length;e++){var t=this.plugins[e],t=this.runOnRoot(t);if(qc(t))try{await t}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){for(var r,n=this.result.root;!n[Dc];){n[Dc]=!0;for(var i=[Qc(n)];0<i.length;){var o=this.visitTick(i);if(qc(o))try{await o}catch(e){o=i[i.length-1].node;throw this.handleError(e,o)}}}if(this.listeners.OnceExit)for(let[e,t]of this.listeners.OnceExit){this.result.lastPlugin=e;try{"document"===n.type?(r=n.nodes.map(e=>t(e,this.helpers)),await Promise.all(r)):await t(n,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;return"object"==typeof t&&t.Once?"document"===this.result.root.type?qc((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(!this.stringified){this.stringified=!0,this.sync();let e=this.result.opts,t=Wc;e.syntax&&(t=e.syntax.stringify),(t=e.stringifier?e.stringifier:t).stringify&&(t=t.stringify);var r=new zc(t,this.result.root,this.result.opts).generate();this.result.css=r[0],this.result.map=r[1]}return this.result}sync(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(qc(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){for(var t=this.result.root;!t[Dc];)t[Dc]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(var r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||jc("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}toString(){return this.css}visitSync(t,r){for(var[n,i]of t){let e;this.result.lastPlugin=n;try{e=i(r,this.helpers)}catch(t){throw this.handleError(t,r.proxyOf)}if("root"!==r.type&&"document"!==r.type&&!r.parent)return!0;if(qc(e))throw this.getAsyncError()}}visitTick(e){var t=e[e.length-1],{node:r,visitors:n}=t;if("root"===r.type||"document"===r.type||r.parent){if(0<n.length&&t.visitorIndex<n.length){var[i,o]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return o(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){for(var s,a=t.iterator;s=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!s[Dc])return s[Dc]=!0,void e.push(Qc(s));t.iterator=0,delete r.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var c=l[t.eventIndex];if(t.eventIndex+=1,0===c)return void(r.nodes&&r.nodes.length&&(r[Dc]=!0,t.iterator=r.getIterator()));if(this.listeners[c])return void(t.visitors=this.listeners[c])}}e.pop()}walkSync(e){var t;e[Dc]=!0;for(t of $c(e))if(0===t)e.nodes&&e.each(e=>{e[Dc]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ru.registerPostcss=e=>{tu=e};Ki=ru;ru.default=ru,Yc.registerLazyResult(ru),Hc.registerLazyResult(ru);let nu=Rl,iu=s,ou=jl,su=h,au=Xl;u=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;e=iu;this.result=new au(this._processor,void 0,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});r=new nu(e,void 0,this._opts,t);r.isMap()?([e,t]=r.generate(),e&&(this.result.css=e),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||ou("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=su;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}get[Symbol.toStringTag](){return"NoWorkResult"}},ra=u;u.default=u;let lu=ra,cu=Ki,uu=b,du=d,hu=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?cu:lu)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},pu=hu,fu=(hu.default=hu,du.registerProcessor(hu),uu.registerProcessor(hu),na),mu=i,gu=S,vu=w,yu=yl,wu=d,bu=xc;function Su(e,r){if(Array.isArray(e))return e.map(e=>Su(e));let{inputs:t,...n}=e;if(t){r=[];for(var i of t){i={...i,__proto__:yu.prototype};i.map&&(i.map={...i.map,__proto__:mu.prototype}),r.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Su(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new wu(n);if("decl"===n.type)return new fu(n);if("rule"===n.type)return new bu(n);if("comment"===n.type)return new gu(n);if("atrule"===n.type)return new vu(n);throw new Error("Unknown node type: "+e.type)}u=Su;Su.default=Su;let Cu=Ha,ku=na,_u=Ki,Iu=C,Eu=pu,xu=s,Tu=u,Ru=b,Au=y,Mu=S,Ou=w,Nu=Xl,Pu=yl,Lu=h,Fu=kc,Bu=xc,Du=d,Uu=ds;function I(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Eu(e)}I.plugin=function(t,r){let e,n=!1;function i(...e){console&&console.warn&&!n&&(n=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");e=r(...e);return e.postcssPlugin=t,e.postcssVersion=(new Eu).version,e}return Object.defineProperty(i,"postcss",{get:()=>e=e||i()}),i.process=function(e,t,r){return I([i(r)]).process(e,t)},i},I.stringify=xu,I.parse=Lu,I.fromJSON=Tu,I.list=Fu,I.comment=e=>new Mu(e),I.atRule=e=>new Ou(e),I.decl=e=>new ku(e),I.rule=e=>new Bu(e),I.root=e=>new Du(e),I.document=e=>new Ru(e),I.CssSyntaxError=Cu,I.Declaration=ku,I.Container=Iu,I.Processor=Eu,I.Document=Ru,I.Comment=Mu,I.Warning=Au,I.AtRule=Ou,I.Result=Nu,I.Input=Pu,I.Rule=Bu,I.Root=Du,I.Node=Uu,_u.registerPostcss(I);ra=I,I.default=I,na=(i=ra)&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;na.stringify;let zu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Wu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Gu={};function Hu(n){if(Gu[n])return Gu[n];let i=globalThis[n],o=i.prototype,e=n in zu?zu[n]:void 0,t=Boolean(e&&e.every(e=>Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(o,e))?void 0:e.get)?void 0:e.toString().includes("[native code]")))),r=n in Wu?Wu[n]:void 0,s=Boolean(r&&r.every(e=>"function"==typeof o[e]&&(null==(e=o[e])?void 0:e.toString().includes("[native code]"))));if(t&&s&&!globalThis.Zone)return Gu[n]=i.prototype,i.prototype;try{let e=document.createElement("iframe"),t=(document.body.appendChild(e),e.contentWindow);if(!t)return i.prototype;let r=t[n].prototype;return document.body.removeChild(e),r?Gu[n]=r:o}catch{return o}}let ju={};function Zu(e,t,r){var n=e+"."+String(r);return ju[n]?ju[n].call(t):(e=Hu(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,r))?void 0:e.get)?(ju[n]=e).call(t):t[r])}let Vu={};function Yu(e,t,r){var n=e+"."+String(r);return Vu[n]?Vu[n].bind(t):"function"!=typeof(e=Hu(e)[r])?t[r]:(Vu[n]=e).bind(t)}function Xu(){return Hu("MutationObserver").constructor}function Ku(r,n,i){try{if(!(n in r))return()=>{};let e=r[n],t=i(e);return"function"==typeof t&&(t.prototype=t.prototype||{},Object.defineProperties(t,{__rrweb_original__:{enumerable:!1,value:e}})),r[n]=t,()=>{r[n]=e}}catch{return()=>{}}}let Y={ownerDocument:function(e){return Zu("Node",e,"ownerDocument")},childNodes:function(e){return Zu("Node",e,"childNodes")},parentNode:function(e){return Zu("Node",e,"parentNode")},parentElement:function(e){return Zu("Node",e,"parentElement")},textContent:function(e){return Zu("Node",e,"textContent")},contains:function(e,t){return Yu("Node",e,"contains")(t)},getRootNode:function(e){return Yu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Zu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Zu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Zu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Zu("Element",e,"querySelectorAll")(t)},mutationObserver:Xu,patch:Ku};function Ju(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}let qu="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.";Ki={map:{},getId:()=>(console.error(qu),-1),getNode:()=>(console.error(qu),null),removeNodeFromMap(){console.error(qu)},has:()=>(console.error(qu),!1),reset(){console.error(qu)}};function $u(i,o,s={}){let a=null,l=0;return function(...e){var t=Date.now();l||!1!==s.leading||(l=t);let r=o-(t-l),n=this;r<=0||o<r?(a&&(clearTimeout(a),a=null),l=t,i.apply(n,e)):a||!1===s.trailing||(a=setTimeout(()=>{l=!1===s.leading?0:Date.now(),a=null,i.apply(n,e)},r))}}function Qu(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Qu(e,t,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(Ki,{get:(e,t,r)=>("map"===t&&console.error(qu),Reflect.get(e,t,r))});let ed=Date.now;function td(e){var t,r=e.document;return{left:r.scrollingElement?r.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:r.documentElement.scrollLeft||(null==r?void 0:r.body)&&(null==(t=Y.parentElement(r.body))?void 0:t.scrollLeft)||(null==(t=null==r?void 0:r.body)?void 0:t.scrollLeft)||0,top:r.scrollingElement?r.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==r?void 0:r.documentElement.scrollTop)||(null==r?void 0:r.body)&&(null==(t=Y.parentElement(r.body))?void 0:t.scrollTop)||(null==(e=null==r?void 0:r.body)?void 0:e.scrollTop)||0}}function rd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function id(e){return e?e.nodeType===e.ELEMENT_NODE?e:Y.parentElement(e):null}function od(e,t,r,n){if(e){var i=id(e);if(i){try{if("string"==typeof t){if(i.classList.contains(t))return 1;if(n&&null!==i.closest("."+t))return 1}else if(Ci(i,t,n))return 1}catch(e){}if(r){if(i.matches(r))return 1;if(n&&null!==i.closest(r))return 1}}}}function sd(e,t,r){return"TITLE"===e.tagName&&r.headTitleMutations||-2===t.getId(e)}function ad(e){return Boolean(e.changedTouches)}function ld(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function cd(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ud(e){return e&&(!1&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Y.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ed=()=>(new Date).getTime());class dd{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(t=void 0===t?this.id++:t,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t)}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function hd(e){let t,r=null;return r="getRootNode"in e&&(null==(t=Y.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Y.host(Y.getRootNode(e))?Y.host(Y.getRootNode(e)):r}function pd(r){var e,t=Y.ownerDocument(r);return!!t&&(e=(()=>{let e,t=r;for(;e=hd(t);)t=e;return t})(),Y.contains(t,e))}function fd(e){var t=Y.ownerDocument(e);return t&&(Y.contains(t,e)||pd(e))}(C={})[C.DomContentLoaded=0]="DomContentLoaded",C[C.Load=1]="Load",C[C.FullSnapshot=2]="FullSnapshot",C[C.IncrementalSnapshot=3]="IncrementalSnapshot",C[C.Meta=4]="Meta",C[C.Custom=5]="Custom",C[C.Plugin=6]="Plugin";var X=C,K=((s=K||{})[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s),md=((u=md||{})[u.MouseUp=0]="MouseUp",u[u.MouseDown=1]="MouseDown",u[u.Click=2]="Click",u[u.ContextMenu=3]="ContextMenu",u[u.DblClick=4]="DblClick",u[u.Focus=5]="Focus",u[u.Blur=6]="Blur",u[u.TouchStart=7]="TouchStart",u[u.TouchMove_Departed=8]="TouchMove_Departed",u[u.TouchEnd=9]="TouchEnd",u[u.TouchCancel=10]="TouchCancel",u),gd=((b=gd||{})[b.Mouse=0]="Mouse",b[b.Pen=1]="Pen",b[b.Touch=2]="Touch",b),vd=((y={})[y["2D"]=0]="2D",y[y.WebGL=1]="WebGL",y[y.WebGL2=2]="WebGL2",y),yd=((S=yd||{})[S.Play=0]="Play",S[S.Pause=1]="Pause",S[S.Seeked=2]="Seeked",S[S.VolumeChange=3]="VolumeChange",S[S.RateChange=4]="RateChange",S),wd=((w={})[w.Document=0]="Document",w[w.DocumentType=1]="DocumentType",w[w.Element=2]="Element",w[w.Text=3]="Text",w[w.CDATA=4]="CDATA",w[w.Comment=5]="Comment",w);function bd(e){return"__ln"in e}class Sd{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let e=0;e<t;e++)r=(null==r?void 0:r.next)||null;return r}addNode(e){var t,r={value:e,previous:null,next:null};e.__ln=r,e.previousSibling&&bd(e.previousSibling)?(t=e.previousSibling.__ln.next,r.next=t,r.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=r,t&&(t.previous=r)):e.nextSibling&&bd(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,r.previous=t,r.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=r,t&&(t.next=r)):(this.head&&(this.head.previous=r),r.next=this.head,this.head=r),null===r.next&&(this.tail=r),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}class Cd{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),a(this,"emit",()=>{if(!this.frozen&&!this.locked){let o=[],s=new Set,a=new Sd,l=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},t=r=>{var n=Y.parentNode(r);if(n&&fd(r)){let t=!1;if(r.nodeType===Node.TEXT_NODE){let e=n.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(n)&&(t=!0)}var n=Xn(n)?this.mirror.getId(hd(r)):this.mirror.getId(n),e=l(r);if(-1===n||-1===e)return a.addNode(r);var i=Ei(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=>{ld(e,this.mirror)&&this.iframeManager.addIframe(e),cd(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ud(r)&&this.shadowDomManager.addShadowRoot(Y.shadowRoot(r),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:t});i&&(o.push({parentId:n,nextId:e,node:i}),s.add(i.id))}};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)_d(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Y.parentNode(e))||t(e);for(let e of this.addedSet)!Id(this.droppedSet,e)&&!_d(this.removesSubTreeCache,e,this.mirror)||Id(this.movedSet,e)?t(e):this.droppedSet.add(e);let r=null;for(;a.length;){let n=null;if(r){let e=this.mirror.getId(Y.parentNode(r.value)),t=l(r.value);-1!==e&&-1!==t&&(n=r)}if(!n){let e=a.tail;for(;e;){let r=e;if(e=e.previous,r){let e=this.mirror.getId(Y.parentNode(r.value));if(-1!==l(r.value)){if(-1!==e){n=r;break}{let e=r.value,t=Y.parentNode(e);if(t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=Y.host(t);if(-1!==this.mirror.getId(e)){n=r;break}}}}}}}if(!n){for(;a.head;)a.removeNode(a.head.value);break}r=n.previous,a.removeNode(n.value),t(n.value)}var e={texts:this.texts.map(e=>{var t=e.node,r=Y.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!s.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{var t,r,n=e.attributes;return"string"==typeof n.style&&(t=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles),t.length<n.style.length)&&(t+r).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff),{id:this.mirror.getId(e.node),attributes:n}}).filter(e=>!s.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:o};(e.texts.length||e.attributes.length||e.removes.length||e.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(e))}}),a(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));var r=Array.from(Y.childNodes(e),e=>Y.textContent(e)||"").join("");t.attributes.value=Qn({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ti(e),value:r,maskInputFn:this.maskInputFn})}),a(this,"processMutation",o=>{if(!sd(o.target,this.mirror,this.slimDOMOptions))switch(o.type){case"characterData":var e=Y.textContent(o.target);od(o.target,this.blockClass,this.blockSelector,!1)||e===o.oldValue||this.texts.push({value:ki(o.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,id(o.target)):e.replace(/[\S]/g,"*"):e,node:o.target});break;case"attributes":{var n=o.target;let e=o.attributeName,t=o.target.getAttribute(e);if("value"===e){let e=ti(n);t=Qn({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:t,maskInputFn:this.maskInputFn})}if(od(o.target,this.blockClass,this.blockSelector,!1)||t===o.oldValue)return;let r=this.attributeMap.get(o.target);if("IFRAME"===n.tagName&&"src"===e&&!this.keepIframeSrcFn(t)){if(n.contentDocument)return;e="rr_src"}if(r||(r={node:o.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(o.target,r)),"type"===e&&"INPUT"===n.tagName&&"password"===(o.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Si(n.tagName,e))if(r.attributes[e]=bi(this.doc,ei(n.tagName),ei(e),t),"style"===e){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(o){this.unattachedDoc=this.doc}var i=this.unattachedDoc.createElement("span");o.oldValue&&i.setAttribute("style",o.oldValue);for(let e of Array.from(n.style)){var s=n.style.getPropertyValue(e),a=n.style.getPropertyPriority(e);s!==i.style.getPropertyValue(e)||a!==i.style.getPropertyPriority(e)?r.styleDiff[e]=""===a?s:[s,a]:r._unchangedStyles[e]=[s,a]}for(let e of Array.from(i.style))""===n.style.getPropertyValue(e)&&(r.styleDiff[e]=!1)}else"open"===e&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?r.attributes.rr_open_mode="modal":r.attributes.rr_open_mode="non-modal");break}case"childList":return od(o.target,this.blockClass,this.blockSelector,!0)?void 0:"TEXTAREA"===o.target.tagName?void this.genTextAreaValueMutation(o.target):(o.addedNodes.forEach(e=>this.genAdds(e,o.target)),void o.removedNodes.forEach(e=>{var t=this.mirror.getId(e),r=Xn(o.target)?this.mirror.getId(Y.host(o.target)):this.mirror.getId(o.target);if(!od(o.target,this.blockClass,this.blockSelector,!1)&&!sd(e,this.mirror,this.slimDOMOptions)&&-1!==this.mirror.getId(e)){if(this.addedSet.has(e))kd(this.addedSet,e),this.droppedSet.add(e);else if(!(this.addedSet.has(o.target)&&-1===t||function e(t,r){var n;return!Xn(t)&&(n=r.getId(t),!r.has(n)||(!(n=Y.parentNode(t))||n.nodeType!==t.DOCUMENT_NODE)&&(!n||e(n,r)))}(o.target,this.mirror)))if(this.movedSet.has(e)&&this.movedMap[t+"@"+r])kd(this.movedSet,e);else{this.removes.push({parentId:r,id:t,isShadow:!(!Xn(o.target)||!Kn(o.target))||void 0});{var n=e,i=this.removesSubTreeCache;let t=[n];for(;t.length;){let e=t.pop();i.has(e)||(i.add(e),Y.childNodes(e).forEach(e=>t.push(e)))}}}this.mapRemoves.push(e)}}))}}),a(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(sd(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let e=null;(e=r&&this.mirror.hasNode(r)?this.mirror.getId(r):e)&&-1!==e&&(this.movedMap[this.mirror.getId(t)+"@"+e]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);od(t,this.blockClass,this.blockSelector,!1)||(Y.childNodes(t).forEach(e=>this.genAdds(e)),ud(t)&&Y.childNodes(Y.shadowRoot(t)).forEach(e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]})}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 kd(t,e){t.delete(e),Y.childNodes(e).forEach(e=>kd(t,e))}function _d(e,t){return 0!==e.size&&((e,t)=>(t=Y.parentNode(t))&&e.has(t))(e,t)}function Id(e,t){return 0!==e.size&&function e(t,r){r=Y.parentNode(r);return!!r&&(!!t.has(r)||e(t,r))}(e,t)}let Ed,J=t=>Ed?(...e)=>{try{return t(...e)}catch(e){if(!Ed||!0!==Ed(e))throw e}}:t,xd=[];function Td(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Rd(e,t){var r=new Cd,e=(xd.push(r),r.init(e),new(Xu())(J(r.processMutations.bind(r))));return e.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),e}function Ad({mouseInteractionCb:s,doc:n,mirror:a,blockClass:l,blockSelector:c,sampling:e}){if(!1===e.mouseInteraction)return()=>{};let t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,i=[],u=null;return Object.keys(md).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]).forEach(e=>{let t=ei(e);o=e;var o,r=r=>{var n=Td(r);if(!od(n,l,c,!0)){let e=null,t=o;if("pointerType"in r){switch(r.pointerType){case"mouse":e=gd.Mouse;break;case"touch":e=gd.Touch;break;case"pen":e=gd.Pen}e===gd.Touch?md[o]===md.MouseDown?t="TouchStart":md[o]===md.MouseUp&&(t="TouchEnd"):gd.Pen}else ad(r)&&(e=gd.Touch);null!==e?(u=e,(t.startsWith("Touch")&&e===gd.Touch||t.startsWith("Mouse")&&e===gd.Mouse)&&(e=null)):md[o]===md.Click&&(e=u,u=null);var i,r=ad(r)?r.changedTouches[0]:r;r&&(n=a.getId(n),{clientX:r,clientY:i}=r,J(s)({type:md[t],id:n,x:r,y:i,...null!==e&&{pointerType:e}}))}};if(window.PointerEvent)switch(md[e]){case md.MouseDown:case md.MouseUp:t=t.replace("mouse","pointer");break;case md.TouchStart:case md.TouchEnd:return}i.push(Ju(t,r,n))}),J(()=>{i.forEach(e=>e())})}function Md({scrollCb:r,doc:n,mirror:i,blockClass:o,blockSelector:s,sampling:e}){return Ju("scroll",J($u(J(e=>{e=Td(e);if(e&&!od(e,o,s,!0)){var t=i.getId(e);if(e===n&&n.defaultView){let e=td(n.defaultView);r({id:t,x:e.left,y:e.top})}else r({id:t,x:e.scrollLeft,y:e.scrollTop})}}),e.scroll||100)),n)}let Od=["INPUT","TEXTAREA","SELECT"],Nd=new WeakMap;function Pd(e){return e=e,t=[],Dd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Dd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Dd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Dd("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule?(r=Array.from(e.parentRule.cssRules).indexOf(e),t.unshift(r)):e.parentStyleSheet&&(r=Array.from(e.parentStyleSheet.cssRules).indexOf(e),t.unshift(r)),t;var t,r}function Ld(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function Fd({mirror:e,stylesheetManager:r},t){let n,i,o,s,a=(s="#document"===t.nodeName?e.getId(t):e.getId(Y.host(t)),"#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(o=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot),l=null!=a&&a.prototype?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t=null==(t=l.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{r.adoptStyleSheets(e,s)}catch(e){}return t}}),J(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Bd(f,e={}){var t=f.doc.defaultView;if(!t)return()=>{};let r;{var m=f,g=e;let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:n,scrollCb:i,viewportResizeCb:o,inputCb:s,mediaInteractionCb:a,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:u,fontCb:d,selectionCb:h,customElementCb:p}=m;m.mutationCb=(...e)=>{g.mutation&&g.mutation(...e),t(...e)},m.mousemoveCb=(...e)=>{g.mousemove&&g.mousemove(...e),r(...e)},m.mouseInteractionCb=(...e)=>{g.mouseInteraction&&g.mouseInteraction(...e),n(...e)},m.scrollCb=(...e)=>{g.scroll&&g.scroll(...e),i(...e)},m.viewportResizeCb=(...e)=>{g.viewportResize&&g.viewportResize(...e),o(...e)},m.inputCb=(...e)=>{g.input&&g.input(...e),s(...e)},m.mediaInteractionCb=(...e)=>{g.mediaInteaction&&g.mediaInteaction(...e),a(...e)},m.styleSheetRuleCb=(...e)=>{g.styleSheetRule&&g.styleSheetRule(...e),l(...e)},m.styleDeclarationCb=(...e)=>{g.styleDeclaration&&g.styleDeclaration(...e),c(...e)},m.canvasMutationCb=(...e)=>{g.canvasMutation&&g.canvasMutation(...e),u(...e)},m.fontCb=(...e)=>{g.font&&g.font(...e),d(...e)},m.selectionCb=(...e)=>{g.selection&&g.selection(...e),h(...e)},m.customElementCb=(...e)=>{g.customElement&&g.customElement(...e),p(...e)}}f.recordDOM&&(r=Rd(f,f.doc));let n=(({mousemoveCb:r,sampling:e,doc:t,mirror:i})=>{if(!1===e.mousemove)return()=>{};var n="number"==typeof e.mousemove?e.mousemove:50,e="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,s=[],a=$u(J(e=>{let t=Date.now()-o;r(s.map(e=>(e.timeOffset-=t,e)),e),s=[],o=null}),e),l=J($u(J(e=>{var t=Td(e),{clientX:r,clientY:n}=ad(e)?e.changedTouches[0]:e;o=o||ed(),s.push({x:r,y:n,id:i.getId(t),timeOffset:ed()-o}),a("undefined"!=typeof DragEvent&&e instanceof DragEvent?K.Drag:e instanceof MouseEvent?K.MouseMove:K.TouchMove)}),n,{trailing:!1})),c=[Ju("mousemove",l,t),Ju("touchmove",l,t),Ju("drag",l,t)];return J(()=>{c.forEach(e=>e())})})(f),i=Ad(f),o=Md(f),s=(({viewportResizeCb:r},{win:e})=>{let n=-1,i=-1;return Ju("resize",J($u(J(()=>{var e=rd(),t=nd();n===e&&i===t||(r({width:Number(t),height:Number(e)}),n=e,i=t)}),200)),e)})(f,{win:t}),a=(({inputCb:n,doc:s,mirror:i,blockClass:e,blockSelector:r,ignoreClass:a,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:t,userTriggeredOnInput:d})=>{function o(t){let n=Td(t);var t=t.isTrusted,i=n&&n.tagName;if((n=n&&"OPTION"===i?Y.parentElement(n):n)&&i&&!(Od.indexOf(i)<0)&&!od(n,e,r,!0)&&!(n.classList.contains(a)||l&&n.matches(l))){let e=n.value,r=!1;var o=ti(n)||"",i=("radio"===o||"checkbox"===o?r=n.checked:(c[i.toLowerCase()]||c[o])&&(e=Qn({element:n,maskInputOptions:c,tagName:i,type:o,value:e,maskInputFn:u})),h(n,d?{text:e,isChecked:r,userTriggered:t}:{text:e,isChecked:r}),n.name);"radio"===o&&i&&r&&s.querySelectorAll(`input[type="radio"][name="${i}"]`).forEach(e=>{var t;e!==n&&(t=e.value,h(e,d?{text:t,isChecked:!r,userTriggered:!1}:{text:t,isChecked:!r}))})}}function h(t,r){let e=Nd.get(t);if(!e||e.text!==r.text||e.isChecked!==r.isChecked){Nd.set(t,r);let e=i.getId(t);J(n)({...r,id:e})}}let p=("last"===t.input?["change"]:["input","change"]).map(e=>Ju(e,J(o),s)),f=s.defaultView;var m;return f?(t=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]],t&&t.set&&p.push(...m.map(e=>Qu(e[0],e[1],{set(){J(o)({target:this,isTrusted:!1})}},!1,f))),J(()=>{p.forEach(e=>e())})):()=>{p.forEach(e=>e())}})(f),l=(({mediaInteractionCb:a,blockClass:l,blockSelector:c,mirror:u,sampling:e,doc:t})=>{let r=J(s=>$u(J(e=>{var t,r,n,i,o,e=Td(e);e&&!od(e,l,c,!0)&&({currentTime:t,volume:r,muted:n,playbackRate:i,loop:o}=e,a({type:s,id:u.getId(e),currentTime:t,volume:r,muted:n,playbackRate:i,loop:o}))}),e.media||500)),n=[Ju("play",r(yd.Play),t),Ju("pause",r(yd.Pause),t),Ju("seeked",r(yd.Seeked),t),Ju("volumechange",r(yd.VolumeChange),t),Ju("ratechange",r(yd.RateChange),t)];return J(()=>{n.forEach(e=>e())})})(f),c=()=>{},u=()=>{},d=()=>{},h=()=>{},p=(f.recordDOM&&(c=(({styleSheetRuleCb:a,mirror:l,stylesheetManager:c},{win:n})=>{if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let e=n.CSSStyleSheet.prototype.insertRule,t=(n.CSSStyleSheet.prototype.insertRule=new Proxy(e,{apply:J((e,t,r)=>{var[n,i]=r,{id:o,styleId:s}=Ld(t,l,c.styleMirror);return(o&&-1!==o||s&&-1!==s)&&a({id:o,styleId:s,adds:[{rule:n,index:i}]}),e.apply(t,r)})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){return n.CSSStyleSheet.prototype.insertRule.apply(this,[e+` { ${t} }`,r])},n.CSSStyleSheet.prototype.deleteRule),r,i,o=(n.CSSStyleSheet.prototype.deleteRule=new Proxy(t,{apply:J((e,t,r)=>{var[n]=r,{id:i,styleId:o}=Ld(t,l,c.styleMirror);return(i&&-1!==i||o&&-1!==o)&&a({id:i,styleId:o,removes:[{index:n}]}),e.apply(t,r)})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(r=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(r,{apply:J((e,t,r)=>{var[n]=r,{id:i,styleId:o}=Ld(t,l,c.styleMirror);return(i&&-1!==i||o&&-1!==o)&&a({id:i,styleId:o,replace:n}),e.apply(t,r)})})),n.CSSStyleSheet.prototype.replaceSync&&(i=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(i,{apply:J((e,t,r)=>{var[n]=r,{id:i,styleId:o}=Ld(t,l,c.styleMirror);return(i&&-1!==i||o&&-1!==o)&&a({id:i,styleId:o,replaceSync:n}),e.apply(t,r)})})),{}),s=(Ud("CSSGroupingRule")?o.CSSGroupingRule=n.CSSGroupingRule:(Ud("CSSMediaRule")&&(o.CSSMediaRule=n.CSSMediaRule),Ud("CSSConditionRule")&&(o.CSSConditionRule=n.CSSConditionRule),Ud("CSSSupportsRule")&&(o.CSSSupportsRule=n.CSSSupportsRule)),{});return Object.entries(o).forEach(([e,t])=>{s[e]={insertRule:t.prototype.insertRule,deleteRule:t.prototype.deleteRule},t.prototype.insertRule=new Proxy(s[e].insertRule,{apply:J((e,t,r)=>{var[n,i]=r,{id:o,styleId:s}=Ld(t.parentStyleSheet,l,c.styleMirror);return(o&&-1!==o||s&&-1!==s)&&a({id:o,styleId:s,adds:[{rule:n,index:[...Pd(t),i||0]}]}),e.apply(t,r)})}),t.prototype.deleteRule=new Proxy(s[e].deleteRule,{apply:J((e,t,r)=>{var[n]=r,{id:i,styleId:o}=Ld(t.parentStyleSheet,l,c.styleMirror);return(i&&-1!==i||o&&-1!==o)&&a({id:i,styleId:o,removes:[{index:[...Pd(t),n]}]}),e.apply(t,r)})})}),J(()=>{n.CSSStyleSheet.prototype.insertRule=e,n.CSSStyleSheet.prototype.deleteRule=t,r&&(n.CSSStyleSheet.prototype.replace=r),i&&(n.CSSStyleSheet.prototype.replaceSync=i),Object.entries(o).forEach(([e,t])=>{t.prototype.insertRule=s[e].insertRule,t.prototype.deleteRule=s[e].deleteRule})})})(f,{win:t}),u=Fd(f,f.doc),d=(({styleDeclarationCb:l,mirror:c,ignoreCSSAttributes:u,stylesheetManager:d},{win:e})=>{let h=e.CSSStyleDeclaration.prototype.setProperty,s=(e.CSSStyleDeclaration.prototype.setProperty=new Proxy(h,{apply:J((e,t,r)=>{var n,i,[o,s,a]=r;return u.has(o)?h.apply(t,[o,s,a]):({id:n,styleId:i}=Ld(null==(n=t.parentRule)?void 0:n.parentStyleSheet,c,d.styleMirror),(n&&-1!==n||i&&-1!==i)&&l({id:n,styleId:i,set:{property:o,value:s,priority:a},index:Pd(t.parentRule)}),e.apply(t,r))})}),e.CSSStyleDeclaration.prototype.removeProperty);return e.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:J((e,t,r)=>{var n,i,[o]=r;return u.has(o)?s.apply(t,[o]):({id:n,styleId:i}=Ld(null==(n=t.parentRule)?void 0:n.parentStyleSheet,c,d.styleMirror),(n&&-1!==n||i&&-1!==i)&&l({id:n,styleId:i,remove:{property:o},index:Pd(t.parentRule)}),e.apply(t,r))})}),J(()=>{e.CSSStyleDeclaration.prototype.setProperty=h,e.CSSStyleDeclaration.prototype.removeProperty=s})})(f,{win:t}),f.collectFonts)&&(h=(({fontCb:r,doc:e})=>{let t=e.defaultView;if(!t)return()=>{};let n=[],i=new WeakMap,o=t.FontFace;return t.FontFace=function(e,t,r){var n=new o(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n},e=Ku(e.fonts,"add",function(e){return function(t){return setTimeout(J(()=>{var e=i.get(t);e&&(r(e),i.delete(t))}),0),e.apply(this,[t])}}),n.push(()=>{t.FontFace=o}),n.push(e),J(()=>{n.forEach(e=>e())})})(f)),(()=>{let{doc:e,mirror:l,blockClass:c,blockSelector:u,selectionCb:t}=f,r=!0;var n=J(()=>{var a=e.getSelection();if(!(!a||r&&null!=a&&a.isCollapsed)){r=a.isCollapsed||!1;let s=[],e=a.rangeCount||0;for(let o=0;o<e;o++){let e=a.getRangeAt(o),{startContainer:t,startOffset:r,endContainer:n,endOffset:i}=e;od(t,c,u,!0)||od(n,c,u,!0)||s.push({start:l.getId(t),startOffset:r,end:l.getId(n),endOffset:i})}t({ranges:s})}});return n(),Ju("selectionchange",n)})()),v=(({doc:e,customElementCb:i})=>(e=e.defaultView)&&e.customElements?Ku(e.customElements,"define",function(n){return function(t,e,r){try{i({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return n.apply(this,[t,e,r])}}):()=>{})(f),y=[];for(let e of f.plugins)y.push(e.observer(e.callback,t,e.options));return J(()=>{xd.forEach(e=>e.reset()),null!=r&&r.disconnect(),n(),i(),o(),s(),a(),l(),c(),u(),d(),h(),p(),v(),y.forEach(e=>e())})}function Dd(e){return void 0!==window[e]}function Ud(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class zd{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){r=r||this.getIdToRemoteIdMap(e),n=n||this.getRemoteIdToIdMap(e);let i=r.get(t);return i||(i=this.generateIdFn(),r.set(t,i),n.set(i,t)),i}getIds(t,e){let r=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return e.map(e=>this.getId(t,e,r,n))}getRemoteId(e,t,r){r=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:r.get(t)||-1}getRemoteIds(t,e){let r=this.getRemoteIdToIdMap(t);return e.map(e=>this.getRemoteId(t,e,r))}reset(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}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 Wd{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new zd(hi)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new zd(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){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=(e=this.crossOriginIframeMap.get(e.source))&&this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}transformCrossOriginEvent(r,t){var e;switch(t.type){case X.FullSnapshot:{this.crossOriginIframeMirror.reset(r),this.crossOriginIframeStyleMirror.reset(r),this.replaceIdOnNode(t.data.node,r);let e=t.data.node.id;return this.crossOriginIframeRootIdMap.set(r,e),this.patchRootIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:X.IncrementalSnapshot,data:{source:K.Mutation,adds:[{parentId:this.mirror.getId(r),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case X.Meta:case X.Load:case X.DomContentLoaded:return!1;case X.Plugin:return t;case X.Custom:return this.replaceIds(t.data.payload,r,["id","parentId","previousId","nextId"]),t;case X.IncrementalSnapshot:switch(t.data.source){case K.Mutation:return t.data.adds.forEach(e=>{this.replaceIds(e,r,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,r);var t=this.crossOriginIframeRootIdMap.get(r);t&&this.patchRootIdOnNode(e.node,t)}),t.data.removes.forEach(e=>{this.replaceIds(e,r,["parentId","id"])}),t.data.attributes.forEach(e=>{this.replaceIds(e,r,["id"])}),t.data.texts.forEach(e=>{this.replaceIds(e,r,["id"])}),t;case K.Drag:case K.TouchMove:case K.MouseMove:return t.data.positions.forEach(e=>{this.replaceIds(e,r,["id"])}),t;case K.ViewportResize:return!1;case K.MediaInteraction:case K.MouseInteraction:case K.Scroll:case K.CanvasMutation:case K.Input:return this.replaceIds(t.data,r,["id"]),t;case K.StyleSheetRule:case K.StyleDeclaration:return this.replaceIds(t.data,r,["id"]),this.replaceStyleIds(t.data,r,["styleId"]),t;case K.Font:return t;case K.Selection:return t.data.ranges.forEach(e=>{this.replaceIds(e,r,["start","end"])}),t;case K.AdoptedStyleSheet:return this.replaceIds(t.data,r,["id"]),this.replaceStyleIds(t.data,r,["styleIds"]),null!=(e=t.data.styles)&&e.forEach(e=>{this.replaceStyleIds(e,r,["styleId"])}),t}}return!1}replace(e,t,r,n){for(var i of n)!Array.isArray(t[i])&&"number"!=typeof t[i]||(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===wd.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Gd{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(Kn(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);let e=Rd({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>e.disconnect()),this.restoreHandlers.push(Md({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&0<t.adoptedStyleSheets.length&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(Y.host(t))),this.restoreHandlers.push(Fd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){let i=this;this.restoreHandlers.push(Ku(e.prototype,"attachShadow",function(r){return function(e){var e=r.call(this,e),t=Y.shadowRoot(this);return t&&fd(this)&&i.addShadowRoot(t,n),e}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Hd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zd=0;Zd<Hd.length;Zd++)jd[Hd.charCodeAt(Zd)]=Zd;let Vd=new Map,Yd=(t,r,n)=>{if(t&&(Jd(t,r)||"object"==typeof t)){r=((e,t)=>{let r=Vd.get(e);return r||(r=new Map,Vd.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)})(n,t.constructor.name);let e=r.indexOf(t);return-1===e&&(e=r.length,r.push(t)),e}};function Xd(i,t,r){if(i instanceof Array)return i.map(e=>Xd(e,t,r));if(null===i)return i;if(i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray)return{rr_type:i.constructor.name,args:[Object.values(i)]};if(i instanceof ArrayBuffer)return{rr_type:i.constructor.name,base64:(()=>{for(var e=new Uint8Array(i),t=e.length,r="",n=0;n<t;n+=3)r=(r=(r=(r+=Hd[e[n]>>2])+Hd[(3&e[n])<<4|e[n+1]>>4])+Hd[(15&e[n+1])<<2|e[n+2]>>6])+Hd[63&e[n+2]];return t%3==2?r=r.substring(0,r.length-1)+"=":t%3==1&&(r=r.substring(0,r.length-2)+"=="),r})()};if(i instanceof DataView)return{rr_type:i.constructor.name,args:[Xd(i.buffer,t,r),i.byteOffset,i.byteLength]};if(i instanceof HTMLImageElement){let e=i.constructor.name,t=i.src;return{rr_type:e,src:t}}return i instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:i.toDataURL()}:i instanceof ImageData?{rr_type:i.constructor.name,args:[Xd(i.data,t,r),i.width,i.height]}:Jd(i,t)||"object"==typeof i?{rr_type:i.constructor.name,index:Yd(i,t,r)}:i}let Kd=(e,t,r)=>e.map(e=>Xd(e,t,r)),Jd=(t,r)=>{var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof r[e]);return Boolean(e.find(e=>t instanceof r[e]))};function qd(e,n,i,o){let t=[];try{var r=Ku(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(t,...r){if(!od(this,n,i,!0)){let e="experimental-webgl"===t?"webgl":t;if("__context"in this||(this.__context=e),o&&["webgl","webgl2"].includes(e))if(r[0]&&"object"==typeof r[0]){let e=r[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else r.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[t,...r])}});t.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{t.forEach(e=>e())}}function $d(t,i,o,s,a,l){let r=[],e=Object.getOwnPropertyNames(t);for(let n of e)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(n))try{if("function"!=typeof t[n])continue;let e=Ku(t,n,function(t){return function(...r){var e=t.apply(this,r);if(Yd(e,l,this),"tagName"in this.canvas&&!od(this.canvas,s,a,!0)){let e=Kd(r,l,this),t={type:i,property:n,args:e};o(this.canvas,t)}return e}});r.push(e)}catch{let e=Qu(t,n,{set(e){o(this.canvas,{type:i,property:n,args:[e],setter:!0})}});r.push(e)}return r}let Qd="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",eh="undefined"!=typeof window&&window.Blob&&new Blob([(Qd,Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});function th(e){let t;try{var r;if(t=eh&&(window.URL||window.webkitURL).createObjectURL(eh))return(r=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r;throw""}catch(t){return new Worker("data:text/javascript;base64,"+Qd,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class rh{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(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)});var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}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,r,n,i,o){let t=qd(r,n,i,!0),s=new Map,a=new th,l=(a.onmessage=e=>{var t,r,n,i=e.data.id;s.set(i,!1),"base64"in e.data&&({base64:e,type:t,width:r,height:n}=e.data,this.mutationCb({id:i,type:vd["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:e}],type:t}]},0,0]}]}))},1e3/e),c,u=0,d=e=>{u&&e-u<l||(u=e,(()=>{let t=[];return r.document.querySelectorAll("canvas").forEach(e=>{od(e,n,i,!0)||t.push(e)}),t})().forEach(async t=>{let r,e=this.mirror.getId(t);if(!s.get(e)&&0!==t.width&&0!==t.height){if(s.set(e,!0),["webgl","webgl2"].includes(t.__context)){let e=t.getContext(t.__context);!1===(null==(r=null==e?void 0:e.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&e.clear(e.COLOR_BUFFER_BIT)}var n=await createImageBitmap(t);a.postMessage({id:e,bitmap:n,width:t.width,height:t.height,dataURLOptions:o.dataURLOptions},[n])}})),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{t(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=qd(e,t,r,!1),i=((n,i,o,s)=>{let t=[],e=Object.getOwnPropertyNames(i.CanvasRenderingContext2D.prototype);for(let r of e)try{if("function"!=typeof i.CanvasRenderingContext2D.prototype[r])continue;let e=Ku(i.CanvasRenderingContext2D.prototype,r,function(e){return function(...t){return od(this.canvas,o,s,!0)||setTimeout(()=>{var e=Kd(t,i,this);n(this.canvas,{type:vd["2D"],property:r,args:e})},0),e.apply(this,t)}});t.push(e)}catch{let e=Qu(i.CanvasRenderingContext2D.prototype,r,{set(e){n(this.canvas,{type:vd["2D"],property:r,args:[e],setter:!0})}});t.push(e)}return()=>{t.forEach(e=>e())}})(this.processMutation.bind(this),e,t,r),o=((e,t,r,n)=>{let i=[];return i.push(...$d(t.WebGLRenderingContext.prototype,vd.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...$d(t.WebGL2RenderingContext.prototype,vd.WebGL2,e,r,n,t)),()=>{i.forEach(e=>e())}})(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){var r,n;this.frozen||this.locked||(n=this.pendingCanvasMutations.get(e))&&-1!==t&&(r=n.map(e=>{let{type:t,...r}=e;return r}),n=n[0].type,this.mutationCb({id:t,type:n,commands:r}),this.pendingCanvasMutations.delete(e))}}class nh{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new dd),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){var n={id:t,styleIds:[]},i=[];for(let r of e){let e;this.styleMirror.has(r)?e=this.styleMirror.getId(r):(e=this.styleMirror.add(r),i.push({styleId:e,rules:Array.from(r.rules||CSSRule,(e,t)=>({rule:qn(e,r.href),index:t}))})),n.styleIds.push(e)}0<i.length&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ih{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let q,oh,sh,ah=!1;try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(On=e.contentWindow)?void 0:On.Array.from)||Array.from,document.body.removeChild(e)}}catch(Ep){console.debug("Unable to override Array.from",Ep)}let lh=new $n;function ch(e={}){let{emit:n,checkoutEveryNms:i,checkoutEveryNth:o,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:F="rr-ignore",ignoreSelector:B=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:D,maskInputOptions:t,slimDOMOptions:U,maskInputFn:d,maskTextFn:h,hooks:z,packFn:r,sampling:p={},dataURLOptions:f={},mousemoveWait:m,recordDOM:g=!0,recordCanvas:v=!1,recordCrossOriginIframes:y=!1,recordAfter:w="DOMContentLoaded"===e.recordAfter?e.recordAfter:"load",userTriggeredOnInput:W=!1,collectFonts:G=!1,inlineImages:b=!1,plugins:S,keepIframeSrcFn:C=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:j}=e,k=(Ed=j,!y||window.parent===window),_=!1;if(!k)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(k&&!n)throw new Error("emit function is required");if(!k&&!_)return()=>{};void 0!==m&&void 0===p.mousemove&&(p.mousemove=m),lh.reset();let I=!0===D?{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!==t?t:{password:!0},E=Ii(U),x;var T;"NodeList"in(T=window)&&!T.NodeList.prototype.forEach&&(T.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in T&&!T.DOMTokenList.prototype.forEach&&(T.DOMTokenList.prototype.forEach=Array.prototype.forEach);let R=0,A=e=>{for(var t of S||[])t.eventProcessor&&(e=t.eventProcessor(e));return e=r&&!_?r(e):e},M=(q=(e,t)=>{var r=e;if(r.timestamp=ed(),null==(e=xd[0])||!e.isFrozen()||r.type===X.FullSnapshot||r.type===X.IncrementalSnapshot&&r.data.source===K.Mutation||xd.forEach(e=>e.unfreeze()),k)null!=n&&n(A(r),t);else if(_){let e={type:"rrweb",event:A(r),origin:window.location.origin,isCheckout:t};window.parent.postMessage(e,"*")}if(r.type===X.FullSnapshot)x=r,R=0;else if(r.type===X.IncrementalSnapshot&&(r.data.source!==K.Mutation||!r.data.isAttachIframe)){R++;let e=o&&R>=o,t=i&&r.timestamp-x.timestamp>i;(e||t)&&oh(!0)}},e=>{q({type:X.IncrementalSnapshot,data:{source:K.Mutation,...e}})}),Z=e=>q({type:X.IncrementalSnapshot,data:{source:K.Scroll,...e}}),V=e=>q({type:X.IncrementalSnapshot,data:{source:K.CanvasMutation,...e}}),O=new nh({mutationCb:M,adoptedStyleSheetCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.AdoptedStyleSheet,...e}})}),N=new Wd({mirror:lh,mutationCb:M,stylesheetManager:O,recordCrossOriginIframes:y,wrappedEmit:q});for(let e of S||[])e.getMirror&&e.getMirror({nodeMirror:lh,crossOriginIframeMirror:N.crossOriginIframeMirror,crossOriginIframeStyleMirror:N.crossOriginIframeStyleMirror});let P=new ih,L=(sh=new rh({recordCanvas:v,mutationCb:V,win:window,blockClass:s,blockSelector:a,mirror:lh,sampling:p.canvas,dataURLOptions:f}),new Gd({mutationCb:M,scrollCb:Z,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:I,dataURLOptions:f,maskTextFn:h,maskInputFn:d,recordCanvas:v,inlineImages:b,sampling:p,slimDOMOptions:E,iframeManager:N,stylesheetManager:O,canvasManager:sh,keepIframeSrcFn:C,processedNodeManager:P},mirror:lh}));oh=(e=!1)=>{if(g){q({type:X.Meta,data:{href:window.location.href,width:nd(),height:rd()}},e),O.reset(),L.init(),xd.forEach(e=>e.lock());var t=((e,t)=>{var{mirror:t=new $n,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:a=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:u,maskInputFn:d,slimDOM:h=!1,dataURLOptions:p,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:b=()=>!1}=t;return Ei(e,{doc:e,mirror:t,blockClass:r,blockSelector:n,maskTextClass:i,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:u,maskInputFn:d,slimDOMOptions:Ii(h),dataURLOptions:p,inlineImages:a,recordCanvas:l,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:b,newlyAddedElement:!1})})(document,{mirror:lh,blockClass:s,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:I,maskTextFn:h,maskInputFn:d,slimDOM:E,dataURLOptions:f,recordCanvas:v,inlineImages:b,onSerialize:e=>{ld(e,lh)&&N.addIframe(e),cd(e,lh)&&O.trackLinkElement(e),ud(e)&&L.addShadowRoot(Y.shadowRoot(e),document)},onIframeLoad:(e,t)=>{N.attachIframe(e,t),L.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{O.attachLinkElement(e,t)},keepIframeSrcFn:C});if(!t)return console.warn("Failed to snapshot the document");q({type:X.FullSnapshot,data:{node:t,initialOffset:td(window)}},e),xd.forEach(e=>e.unlock()),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&O.adoptStyleSheets(document.adoptedStyleSheets,lh.getId(document))}};try{let t=[],r=e=>J(Bd)({mutationCb:M,mousemoveCb:(e,t)=>q({type:X.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.MouseInteraction,...e}}),scrollCb:Z,viewportResizeCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.ViewportResize,...e}}),inputCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.Input,...e}}),mediaInteractionCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.MediaInteraction,...e}}),styleSheetRuleCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.StyleSheetRule,...e}}),styleDeclarationCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>q({type:X.IncrementalSnapshot,data:{source:K.Font,...e}}),selectionCb:e=>{q({type:X.IncrementalSnapshot,data:{source:K.Selection,...e}})},customElementCb:e=>{q({type:X.IncrementalSnapshot,data:{source:K.CustomElement,...e}})},blockClass:s,ignoreClass:F,ignoreSelector:B,maskTextClass:l,maskTextSelector:c,maskInputOptions:I,inlineStylesheet:u,sampling:p,recordDOM:g,recordCanvas:v,inlineImages:b,userTriggeredOnInput:W,collectFonts:G,doc:e,maskInputFn:d,maskTextFn:h,keepIframeSrcFn:C,blockSelector:a,slimDOMOptions:E,dataURLOptions:f,mirror:lh,iframeManager:N,stylesheetManager:O,shadowDomManager:L,processedNodeManager:P,canvasManager:sh,ignoreCSSAttributes:H,plugins:(null==(e=null==S?void 0:S.filter(e=>e.observer))?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>q({type:X.Plugin,data:{plugin:t.name,payload:e}})})))||[]},z),e=(N.addLoadListener(e=>{try{t.push(r(e.contentDocument))}catch(e){console.warn(e)}}),()=>{oh(),t.push(r(document)),ah=!0});return["interactive","complete"].includes(document.readyState)?e():(t.push(Ju("DOMContentLoaded",()=>{q({type:X.DomContentLoaded,data:{}}),"DOMContentLoaded"===w&&e()})),t.push(Ju("load",()=>{q({type:X.Load,data:{}}),"load"===w&&e()},window))),()=>{t.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),P.destroy(),ah=!1,Ed=void 0}}catch(e){console.warn(e)}}ch.addCustomEvent=(e,t)=>{if(!ah)throw new Error("please add custom event after start recording");q({type:X.Custom,data:{tag:e,payload:t}})},ch.freezePage=()=>{xd.forEach(e=>e.freeze())},ch.takeFullSnapshot=e=>{if(!ah)throw new Error("please take full snapshot after start recording");oh(e)},ch.mirror=lh;var uh='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',dh={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,autoDetectSensitiveData:!0,mask:[".tdem-mask","[data-tdem-mask]","[data-sensitive]",".sensitive",".private"],block:[".tdem-block","[data-tdem-block]",".secret","[data-secret]","iframe[srcdoc]:not([src])",".replayer-wrapper"],ignore:[".tdem-ignore","[data-tdem-ignore]",'input[type="file"]','input[type="password"]'],maskInputOptions:{password:!0,email:!0,tel:!0,text:!1}},hh=(ph.maskPhone=function(e){return e.replace(this.phoneRegex,function(e){var t=e.replace(/[^\d]/g,"");return 11===t.length?e.substring(0,3)+"****"+e.substring(7):13===t.length?e.substring(0,6)+"****"+e.substring(10):e.substring(0,3)+"****"+e.substring(e.length-4)})},ph.maskIdCard=function(e){return e.replace(this.idCardRegex,function(e){return 18===e.length?e.substring(0,6)+"********"+e.substring(14):15===e.length?e.substring(0,6)+"******"+e.substring(12):e})},ph.maskEmail=function(e){return e.replace(this.emailRegex,function(e){var t,r=e.indexOf("@");return r<=1?"*"+e.substring(1):(t=e.substring(0,r),e=e.substring(r),t.charAt(0)+"***"+t.charAt(t.length-1)+e)})},ph.maskBankCard=function(e){return e.replace(this.bankCardRegex,function(e){var t=e.replace(/[^\d]/g,"");return t.length<13?e:t.substring(0,4)+" **** **** "+t.substring(t.length-4)})},ph.maskIP=function(e){return e.replace(this.ipv4Regex,function(e){e=e.split(".");return e[0]+".*.*."+e[3]})},ph.autoMask=function(e){var t;return e&&"string"==typeof e?(t=this.maskPhone(t=e),t=this.maskIdCard(t),t=this.maskEmail(t),this.maskBankCard(t)):e},ph.hasSensitiveData=function(e){return!(!e||"string"!=typeof e)&&(this.phoneRegex.test(e)||this.idCardRegex.test(e)||this.emailRegex.test(e)||this.bankCardRegex.test(e))},ph.phoneRegex=/1[3-9]\d{9}|(?:\+?86)?1[3-9]\d{9}/g,ph.idCardRegex=/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]|[1-9]\d{7}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}/g,ph.emailRegex=/[\w.-]+@[\w.-]+\.\w{2,}/g,ph.bankCardRegex=/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{1,7}\b/g,ph.ipv4Regex=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,ph);function ph(){}function fh(e,t){return void 0===e&&(e={}),f(f(f({},t=void 0===t?dh:t),e),{mask:mh(t.mask,e.mask),block:mh(t.block,e.block),ignore:mh(t.ignore,e.ignore),maskInputOptions:f(f({},t.maskInputOptions),e.maskInputOptions)})}function mh(e,t){e=new Set(B(e||[],t||[]));return Array.from(e)}bh.prototype.push=function(e,t){if(this.emitFn=t,3===e.type&&this.isMutationEvent(e)){var r=e.data;if(this.buffer){if(this.enableRepeatDetection&&this.isRepeatPattern(r)){if(this.repeatCount++,3<this.repeatCount)return this.buffer=this.cloneEvent(e),void this.droppedByRepeat++}else this.repeatCount=0;this.mergeInto(r,e.timestamp),this.mergedCount++,(null!=(r=null==(r=this.buffer.data.adds)?void 0:r.length)?r:0)>=this.maxAddsPerMerge&&this.flush()}else this.buffer=this.cloneEvent(e),this.scheduleFlush()}else this.flush(),t(e)},bh.prototype.flush=function(){this.clearTimer(),this.buffer&&this.emitFn&&(this.emitFn(this.buffer),this.buffer=null,this.repeatCount=0)},bh.prototype.destroy=function(){this.flush(),this.clearTimer(),this.emitFn=null},bh.prototype.getStats=function(){return{mergedCount:this.mergedCount,droppedByRepeat:this.droppedByRepeat,cancelledByOffset:this.cancelledByOffset}},bh.prototype.isMutationEvent=function(e){return 0===(null==(e=e.data)?void 0:e.source)},bh.prototype.isRepeatPattern=function(e){var t;return!!this.buffer&&(t=null!=(t=this.buffer.data.adds)?t:[],e=null!=(e=e.adds)?e:[],0!==t.length)&&0!==e.length&&t.length===e.length&&(null==(t=t[0])?void 0:t.parentId)===(null==(t=e[0])?void 0:t.parentId)},bh.prototype.mergeInto=function(e,t){var r,n,i,o;if(this.buffer){var s=this.buffer.data;this.buffer.timestamp=Math.max(this.buffer.timestamp,t);for(var a=this,l=0,c=null!=(t=e.removes)?t:[];l<c.length;l++)(t=>{var e=(null!=(r=s.adds)?r:[]).findIndex(function(e){return(null==(e=e.node)?void 0:e.id)===t.id});0<=e?(s.adds.splice(e,1),a.cancelledByOffset++):(s.removes=null!=(r=s.removes)?r:[],s.removes.push(t))})(c[l]);for(var u=0,d=null!=(t=e.adds)?t:[];u<d.length;u++){var h=d[u];s.adds=null!=(n=s.adds)?n:[],s.adds.push(h)}for(var p=0,f=null!=(t=e.attributes)?t:[];p<f.length;p++)(t=>{s.attributes=null!=(i=s.attributes)?i:[];var e=s.attributes.findIndex(function(e){return e.id===t.id});0<=e?s.attributes[e]=t:s.attributes.push(t)})(f[p]);for(var m=0,g=null!=(t=e.texts)?t:[];m<g.length;m++)(t=>{s.texts=null!=(o=s.texts)?o:[];var e=s.texts.findIndex(function(e){return e.id===t.id});0<=e?s.texts[e]=t:s.texts.push(t)})(g[m])}},bh.prototype.cloneEvent=function(e){var t=e.data;return{type:e.type,timestamp:e.timestamp,data:{source:0,adds:B(null!=(e=t.adds)?e:[]),removes:B(null!=(e=t.removes)?e:[]),attributes:B(null!=(e=t.attributes)?e:[]),texts:B(null!=(e=t.texts)?e:[])}}},bh.prototype.scheduleFlush=function(){var e=this;this.clearTimer(),this.flushTimer=setTimeout(function(){e.flushTimer=null,e.flush()},this.windowMs)},bh.prototype.clearTimer=function(){null!==this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null)};var gh=bh,vh=(E.prototype.startRecording=function(e){var n,i,r=this;if(void 0===e&&(e={}),"recording"!==this.state){this.mutationLimitReached=!1,this.throttleCount=0,this.throttleWindowStart=Date.now(),this.throttleNotified=!1,this.mutationAddsInWindow=0;var t="buffer"===this.options.mode?12e4:3e5,t="number"==typeof e.checkoutEveryNms&&0<e.checkoutEveryNms?e.checkoutEveryNms:t,o="number"==typeof e.checkoutEveryNth&&0<e.checkoutEveryNth?e.checkoutEveryNth:void 0,s=fh(e.privacy||{},dh),a=f(f(f(f({emit:function(e,t){r.handleEvent(e,t)},checkoutEveryNms:t},o?{checkoutEveryNth:o}:{}),{sampling:{scroll:150,mousemove:!l.ios()&&50,mouseInteraction:!0,input:"last"},slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:!0}}),(t={},void 0!==(o=s).maskAllInputs&&(t.maskAllInputs=o.maskAllInputs),o.maskInputOptions&&(t.maskInputOptions=o.maskInputOptions),null!=(a=o.mask)&&a.length&&(t.maskTextSelector=o.mask.join(",")),null!=(a=o.block)&&a.length&&(t.blockSelector=o.block.join(",")),o.blockAllMedia&&(t.blockSelector=t.blockSelector?t.blockSelector+","+uh:uh,t.ignoreCSSAttributes=new Set(["background-image"])),null!=(a=o.ignore)&&a.length&&(t.ignoreSelector=o.ignore.join(",")),!o.maskTextFn&&!1===o.autoDetectSensitiveData||(t.maskTextFn=(n=o.maskTextFn,i=!1!==o.autoDetectSensitiveData,function(e,t){var r;return e&&(r=e,i&&(r=hh.autoMask(r)),n?n(r,t):r)})),t)),e.rrwebConfig);try{this.hookMutationObserver(),this.stopRecordingFn=ch(a),this.state="recording",this.lastCheckoutTime=Date.now(),this.startCheckpointTimer(),v("RecorderManager","Recording started with config:",{maskAllText:s.maskAllText,maskAllInputs:s.maskAllInputs,autoDetectSensitiveData:s.autoDetectSensitiveData,mutationLimit:this.mutationLimit,checkpointIntervalMs:12e4})}catch(e){En("RecorderManager","Failed to start recording:",e),this.state="stopped"}}else In("RecorderManager","Already recording")},E.prototype.stopRecording=function(){var e;this.stopCheckpointTimer(),null!=(e=this.mutationMerger)&&e.destroy(),this.unhookMutationObserver(),this.stopRecordingFn&&(this.stopRecordingFn(),this.stopRecordingFn=void 0),this.state="stopped",v("RecorderManager","Recording stopped")},E.prototype.pauseRecording=function(){"recording"===this.state&&(this.stopRecording(),this.state="paused",v("RecorderManager","Recording paused"))},E.prototype.resumeRecording=function(e){void 0===e&&(e={}),"paused"===this.state&&(this.startRecording(e),v("RecorderManager","Recording resumed"))},E.prototype.hookMutationObserver=function(){try{var n,e,t=window.MutationObserver;t&&(n=this,(e=function(r){return new t(function(e,t){n.unhookMutationObserver(),n.onMutationHandler(e)&&r(e,t)})}).prototype=t.prototype,window.MutationObserver=e,this.restoreMutationObserver=function(){window.MutationObserver=t},_n("RecorderManager","MutationObserver hooked"))}catch(t){In("RecorderManager","Failed to hook MutationObserver:",t)}},E.prototype.unhookMutationObserver=function(){this.restoreMutationObserver&&(this.restoreMutationObserver(),this.restoreMutationObserver=null,_n("RecorderManager","MutationObserver restored"))},E.prototype.onMutationHandler=function(e){var t,r=this;return!this.mutationLimitReached&&(t=(e=e.length)>this.mutationLimit,(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(this.mutationLimitReached=!0,En("RecorderManager","Mutation limit reached: "+e+" > "+this.mutationLimit+". Stopping."),setTimeout(function(){var e,t;null!=(t=(e=r.options).onMutationLimitReached)&&t.call(e),r.stopRecording()},0),!1))},E.prototype.checkMutationLimit=function(e){var r=this;if(this.mutationLimitReached)return!1;if(3!==e.type)return!0;e=e.data;if(0!==(null==e?void 0:e.source))return!0;e=Array.isArray(e.adds)?e.adds.length:0;if(0===e)return!0;this.mutationAddsInWindow+=e;var t=e>this.mutationLimit||this.mutationAddsInWindow>2*this.mutationLimit;return(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(En("RecorderManager","Mutation limit: "+e+" adds (window: "+this.mutationAddsInWindow+"). Stopping."),this.mutationLimitReached=!0,setTimeout(function(){var e,t;null!=(t=(e=r.options).onMutationLimitReached)&&t.call(e),r.stopRecording()},0),!1)},E.prototype.emitMutationBreadcrumb=function(e,t){var r;try{null!=(r=ch.addCustomEvent)&&r.call(ch,"replay.mutations",{count:e,limit:t,timestamp:Date.now()})}catch(e){}},E.prototype.handleEvent=function(e,t){var r=this,n=(t&&(null!=(i=(n=this.options).onCheckout)&&i.call(n),this.lastCheckoutTime=Date.now(),null!=(i=this.mutationMerger))&&i.flush(),e.type);if(t||2===n||4===n||n<=1||this.checkEventThrottle()){if(3===n&&!this.mutationLimitReached){var i=Date.now();if(12e4<=i-this.lastCheckoutTime){this.lastCheckoutTime=i;try{var o=ch.takeFullSnapshot;"function"==typeof o&&(o(!0),_n("RecorderManager","Inline checkpoint: forced FullSnapshot"))}catch(e){In("RecorderManager","Inline checkpoint failed:",e)}}}this.checkMutationLimit(e)&&(this.mutationMerger?this.mutationMerger.push(e,function(e){r.options.onRecordingEvent(e)}):this.options.onRecordingEvent(e))}},E.prototype.checkEventThrottle=function(){var e,t=Date.now();if(5e3<t-this.throttleWindowStart&&(this.throttleCount=0,this.throttleWindowStart=t,this.throttleNotified=!1,this.mutationAddsInWindow=0),this.throttleCount++,300<this.throttleCount){if(!this.throttleNotified){this.throttleNotified=!0,In("RecorderManager","Event throttled: "+this.throttleCount+" events in 5000ms window");try{null!=(e=ch.addCustomEvent)&&e.call(ch,"replay.throttled",{count:this.throttleCount,window:5e3})}catch(e){}}return!1}return!0},E.prototype.startCheckpointTimer=function(){var t=this;this.stopCheckpointTimer(),this.checkpointTimer=setInterval(function(){if("recording"===t.state&&!t.mutationLimitReached)try{var e=ch.takeFullSnapshot;"function"==typeof e&&(e(!0),t.lastCheckoutTime=Date.now(),_n("RecorderManager","Checkpoint: forced FullSnapshot"))}catch(e){In("RecorderManager","Checkpoint FullSnapshot failed:",e)}},12e4)},E.prototype.stopCheckpointTimer=function(){null!==this.checkpointTimer&&(clearInterval(this.checkpointTimer),this.checkpointTimer=null)},E.prototype.getState=function(){return this.state},E.prototype.isRecording=function(){return"recording"===this.state},E.prototype.getLastCheckoutTime=function(){return this.lastCheckoutTime},E.prototype.takeFullSnapshot=function(){var e,t;"recording"===this.state&&this.stopRecordingFn&&(null!=(t=null==(e=this.stopRecordingFn)?void 0:e.takeFullSnapshot)&&t.call(e),this.lastCheckoutTime=Date.now())},E.prototype.isMutationLimitReached=function(){return this.mutationLimitReached},E),yh=(wh.prototype.initializeSampling=function(){return null!==this.samplingDecision?{mode:this.currentMode,shouldRecord:!1!==this.currentMode}:Math.random()<this.config.sessionSampleRate?(this.currentMode="session",this.samplingDecision=!0,v("SamplerManager","Sampled: session mode"),{mode:"session",shouldRecord:!0}):0<this.config.errorSampleRate?(this.currentMode="buffer",this.samplingDecision=!0,v("SamplerManager","Sampled: buffer mode"),{mode:"buffer",shouldRecord:!0}):(this.currentMode=!1,this.samplingDecision=!1,v("SamplerManager","Not sampled"),{mode:!1,shouldRecord:!1})},wh.prototype.decideSamplingMode=function(){return this.initializeSampling().mode},wh.prototype.onErrorOccurred=function(e){return"buffer"===this.currentMode&&!this.hasUpgraded&&!!(Math.random()<this.config.errorSampleRate)&&(this.switchMode("session"),this.hasUpgraded=!0)},wh.prototype.switchMode=function(e){var t=this.currentMode;this.currentMode=e,this.samplingDecision=!1!==e,v("SamplerManager","Mode switched: "+t+" -> "+e)},wh.prototype.getCurrentMode=function(){return this.currentMode},wh.prototype.isSampled=function(){return!0===this.samplingDecision},wh.prototype.isSessionMode=function(){return"session"===this.currentMode},wh.prototype.isBufferMode=function(){return"buffer"===this.currentMode},wh.prototype.upgradeToSessionMode=function(){return"buffer"===this.currentMode&&Math.random()<this.config.errorSampleRate&&(this.currentMode="session",v("SamplerManager","Upgraded to session mode due to error"),!0)},wh.prototype.forceMode=function(e){this.currentMode=e,this.samplingDecision=!1!==e},wh.prototype.reset=function(){this.currentMode=!1,this.samplingDecision=null},wh.prototype.getConfig=function(){return f({},this.config)},wh);function wh(e){var t;void 0===e&&(e={}),this.currentMode=!1,this.samplingDecision=null,this.hasUpgraded=!1,this.config={sessionSampleRate:null!=(t=e.sessionSampleRate)?t:.1,errorSampleRate:null!=(t=e.errorSampleRate)?t:1}}function E(e,t){this.state="stopped",this.lastCheckoutTime=0,this.checkpointTimer=null,this.mutationLimitReached=!1,this.mutationMerger=null,this.mutationBreadcrumbLimit=750,this.mutationLimit=1e4,this.restoreMutationObserver=null,this.throttleCount=0,this.throttleWindowStart=0,this.throttleNotified=!1,this.mutationAddsInWindow=0,this.options=e,this.mutationBreadcrumbLimit=null!=(e=null==t?void 0:t.mutationBreadcrumbLimit)?e:750,this.mutationLimit=null!=(e=null==t?void 0:t.mutationLimit)?e:1e4,null!=t&&t.enableMutationMerge&&(this.mutationMerger=new gh({windowMs:null!=(e=null==t?void 0:t.mutationMergeWindowMs)?e:200,maxAddsPerMerge:500,enableRepeatDetection:!0}))}function bh(e){var t;this.buffer=null,this.flushTimer=null,this.repeatCount=0,this.emitFn=null,this.mergedCount=0,this.droppedByRepeat=0,this.cancelledByOffset=0,this.windowMs=null!=(t=null==e?void 0:e.windowMs)?t:200,this.maxAddsPerMerge=null!=(t=null==e?void 0:e.maxAddsPerMerge)?t:500,this.enableRepeatDetection=null==(t=null==e?void 0:e.enableRepeatDetection)||t}function Sh(e){let t=e.length;for(;0<=--t;)e[t]=0}let Ch=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),kh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),_h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ih=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Eh=new Array(576),xh=(Sh(Eh),new Array(60)),Th=(Sh(xh),new Array(512)),Rh=(Sh(Th),new Array(256)),Ah=(Sh(Rh),new Array(29)),Mh=(Sh(Ah),new Array(30));function Oh(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let Nh,Ph,Lh;function Fh(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Sh(Mh);let Bh=e=>e<256?Th[e]:Th[256+(e>>>7)],Dh=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Uh=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,Dh(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},zh=(e,t,r)=>{Uh(e,r[2*t],r[2*t+1])},Wh=(e,t)=>{let r=0;for(;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1},Gh=(e,t,r)=>{var n=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=t;o++){var a=e[2*o+1];0!==a&&(e[2*o]=Wh(n[a]++,a))}},Hh=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},jh=e=>{8<e.bi_valid?Dh(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Zh=(e,t,r,n)=>{var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},Vh=(e,t,r)=>{var n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Zh(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Zh(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},Yh=(e,t,r)=>{let n,i,o,s,a=0;if(0!==e.sym_next)for(;n=255&e.pending_buf[e.sym_buf+a++],n+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0==n?zh(e,i,t):(o=Rh[i],zh(e,o+256+1,t),0!==(s=Ch[o])&&(i-=Ah[o],Uh(e,i,s)),n--,o=Bh(n),zh(e,o,r),0!==(s=kh[o])&&(n-=Mh[o],Uh(e,n,s))),a<e.sym_next;);zh(e,256,t)},Xh=(a,l)=>{var e=l.dyn_tree,t=l.stat_desc.static_tree,r=l.stat_desc.has_stree,n=l.stat_desc.elems;let i,o,s,c=-1;for(a.heap_len=0,a.heap_max=573,i=0;i<n;i++)0!==e[2*i]?(a.heap[++a.heap_len]=c=i,a.depth[i]=0):e[2*i+1]=0;for(;a.heap_len<2;)e[2*(s=a.heap[++a.heap_len]=c<2?++c:0)]=1,a.depth[s]=0,a.opt_len--,r&&(a.static_len-=t[2*s+1]);for(l.max_code=c,i=a.heap_len>>1;1<=i;i--)Vh(a,e,i);for(s=n;i=a.heap[1],a.heap[1]=a.heap[a.heap_len--],Vh(a,e,1),o=a.heap[1],a.heap[--a.heap_max]=i,a.heap[--a.heap_max]=o,e[2*s]=e[2*i]+e[2*o],a.depth[s]=(a.depth[i]>=a.depth[o]?a.depth[i]:a.depth[o])+1,e[2*i+1]=e[2*o+1]=s,a.heap[1]=s++,Vh(a,e,1),2<=a.heap_len;);a.heap[--a.heap_max]=a.heap[1];{var u=a,d=l.dyn_tree,h=l.max_code,p=l.stat_desc.static_tree,f=l.stat_desc.has_stree,m=l.stat_desc.extra_bits,g=l.stat_desc.extra_base,v=l.stat_desc.max_length;let e,t,r,n,i,o,s=0;for(n=0;n<=15;n++)u.bl_count[n]=0;for(d[2*u.heap[u.heap_max]+1]=0,e=u.heap_max+1;e<573;e++)t=u.heap[e],(n=d[2*d[2*t+1]+1]+1)>v&&(n=v,s++),d[2*t+1]=n,t>h||(u.bl_count[n]++,i=0,t>=g&&(i=m[t-g]),o=d[2*t],u.opt_len+=o*(n+i),f&&(u.static_len+=o*(p[2*t+1]+i)));if(0!==s){do{for(n=v-1;0===u.bl_count[n];)n--}while(u.bl_count[n]--,u.bl_count[n+1]+=2,u.bl_count[v]--,0<(s-=2));for(n=v;0!==n;n--)for(t=u.bl_count[n];0!==t;)h<(r=u.heap[--e])||(d[2*r+1]!==n&&(u.opt_len+=(n-d[2*r+1])*d[2*r],d[2*r+1]=n),t--)}}Gh(e,c,a.bl_count)},Kh=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,l=7,c=4;for(0===s&&(l=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<l&&i===s||(a<c?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,c=0===s?(l=138,3):i===s?(l=6,3):(l=7,4))},Jh=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,l=7,c=4;for(0===s&&(l=138,c=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<l&&i===s)){if(a<c)for(;zh(e,i,e.bl_tree),0!=--a;);else 0!==i?(i!==o&&(zh(e,i,e.bl_tree),a--),zh(e,16,e.bl_tree),Uh(e,a-3,2)):a<=10?(zh(e,17,e.bl_tree),Uh(e,a-3,3)):(zh(e,18,e.bl_tree),Uh(e,a-11,7));a=0,o=i,c=0===s?(l=138,3):i===s?(l=6,3):(l=7,4)}},qh=!1,$h=(e,t,r,n)=>{Uh(e,0+(n?1:0),3),jh(e),Dh(e,r),Dh(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},Qh={_tr_init:e=>{if(!qh){{let e,t,r,n,i;var o=new Array(16);for(r=0,n=0;n<28;n++)for(Ah[n]=r,e=0;e<1<<Ch[n];e++)Rh[r++]=n;for(Rh[r-1]=n,i=0,n=0;n<16;n++)for(Mh[n]=i,e=0;e<1<<kh[n];e++)Th[i++]=n;for(i>>=7;n<30;n++)for(Mh[n]=i<<7,e=0;e<1<<kh[n]-7;e++)Th[256+i++]=n;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)Eh[2*e+1]=8,e++,o[8]++;for(;e<=255;)Eh[2*e+1]=9,e++,o[9]++;for(;e<=279;)Eh[2*e+1]=7,e++,o[7]++;for(;e<=287;)Eh[2*e+1]=8,e++,o[8]++;for(Gh(Eh,287,o),e=0;e<30;e++)xh[2*e+1]=5,xh[2*e]=Wh(e,5);Nh=new Oh(Eh,Ch,257,286,15),Ph=new Oh(xh,kh,0,30,15),Lh=new Oh(new Array(0),_h,0,19,7)}qh=!0}e.l_desc=new Fh(e.dyn_ltree,Nh),e.d_desc=new Fh(e.dyn_dtree,Ph),e.bl_desc=new Fh(e.bl_tree,Lh),e.bi_buf=0,e.bi_valid=0,Hh(e)},_tr_stored_block:$h,_tr_flush_block:(t,r,n,e)=>{let i,o,s=0;if(0<t.level?(2===t.strm.data_type&&(t.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(t)),Xh(t,t.l_desc),Xh(t,t.d_desc),s=(e=>{let t;for(Kh(e,e.dyn_ltree,e.l_desc.max_code),Kh(e,e.dyn_dtree,e.d_desc.max_code),Xh(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*Ih[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==r)$h(t,r,n,e);else if(4===t.strategy||o===i)Uh(t,2+(e?1:0),3),Yh(t,Eh,xh);else{Uh(t,4+(e?1:0),3);{var a=t,l=(r=t.l_desc.max_code+1,n=t.d_desc.max_code+1,s+1);let e;for(Uh(a,r-257,5),Uh(a,n-1,5),Uh(a,l-4,4),e=0;e<l;e++)Uh(a,a.bl_tree[2*Ih[e]+1],3);Jh(a,a.dyn_ltree,r-1),Jh(a,a.dyn_dtree,n-1)}Yh(t,t.dyn_ltree,t.dyn_dtree)}Hh(t),e&&jh(t)},_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Rh[r]+256+1)]++,e.dyn_dtree[2*Bh(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Uh(e,2,3),zh(e,256,Eh),16===(e=e).bi_valid?(Dh(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}};var ep=(e,t,r,n)=>{let i=65535&e|0,o=e>>>16&65535|0,s=0;for(;0!==r;){for(r-=s=2e3<r?2e3:r;i=i+t[n++]|0,o=o+i|0,--s;);i%=65521,o%=65521}return i|o<<16|0};let tp=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var rp=(t,r,e,n)=>{var i=tp,o=n+e;t^=-1;for(let e=n;e<o;e++)t=t>>>8^i[255&(t^r[e])];return-1^t},np={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},h={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};let{_tr_init:ip,_tr_stored_block:op,_tr_flush_block:sp,_tr_tally:ap,_tr_align:lp}=Qh,{Z_NO_FLUSH:cp,Z_PARTIAL_FLUSH:up,Z_FULL_FLUSH:dp,Z_FINISH:hp,Z_BLOCK:pp,Z_OK:fp,Z_STREAM_END:mp,Z_STREAM_ERROR:gp,Z_DATA_ERROR:vp,Z_BUF_ERROR:yp,Z_DEFAULT_COMPRESSION:wp,Z_FILTERED:bp,Z_HUFFMAN_ONLY:Sp,Z_RLE:Cp,Z_FIXED:kp,Z_UNKNOWN:_p,Z_DEFLATED:Ip}=h,Ep=(e,t)=>(e.msg=np[t],t),xp=e=>2*e-(4<e?9:0),Tp=e=>{let t=e.length;for(;0<=--t;)e[t]=0},Rp=e=>{let t,r,n,i=e.w_size;for(t=e.hash_size,n=t;r=e.head[--n],e.head[n]=r>=i?r-i:0,--t;);for(t=i,n=t;r=e.prev[--n],e.prev[n]=r>=i?r-i:0,--t;);},Ap=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,Mp=e=>{var t=e.state;let r=t.pending;0!==(r=r>e.avail_out?e.avail_out:r)&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending)&&(t.pending_out=0)},Op=(e,t)=>{sp(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Mp(e.strm)},x=(e,t)=>{e.pending_buf[e.pending++]=t},Np=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Pp=(e,t,r,n)=>{let i=e.avail_in;return 0===(i=i>n?n:i)?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=ep(e.adler,t,i,r):2===e.state.wrap&&(e.adler=rp(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},Lp=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;var l=e.w_size-262<e.strstart?e.strstart-(e.w_size-262):0,c=e.window,u=e.w_mask,d=e.prev,h=e.strstart+258;let p=c[o+s-1],f=c[o+s];e.good_match<=e.prev_length&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+s]===f&&c[r+s-1]===p&&c[r]===c[o]&&c[++r]===c[o+1]){for(o+=2,r++;c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h;);if(n=258-(h-o),o=h-258,n>s){if(e.match_start=t,(s=n)>=a)break;p=c[o+s-1],f=c[o+s]}}}while((t=d[t&u])>l&&0!=--i);return s<=e.lookahead?s:e.lookahead},Fp=e=>{var t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,t+(t-262)<=e.strstart&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.strstart<e.insert&&(e.insert=e.strstart),Rp(e),n+=t),0===e.strm.avail_in)break;if(r=Pp(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,3<=e.lookahead+e.insert)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Ap(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Ap(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},Bp=(e,t)=>{let r,n,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;for(;r=65535,i=e.bi_valid+42>>3,!(e.strm.avail_out<i||(i=e.strm.avail_out-i,n=e.strstart-e.block_start,(r=(r=r>n+e.strm.avail_in?n+e.strm.avail_in:r)>i?i:r)<o&&(0===r&&t!==hp||t===cp||r!==n+e.strm.avail_in))||(s=t===hp&&r===n+e.strm.avail_in?1:0,op(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Mp(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(Pp(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r),0!==s)););return(a-=e.strm.avail_in)&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.strstart<e.insert)&&(e.insert=e.strstart),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=e.w_size-e.insert<a?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==cp&&t!==hp&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.strstart<e.insert)&&(e.insert=e.strstart),(i=i>e.strm.avail_in?e.strm.avail_in:i)&&(Pp(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=65535<e.pending_buf_size-i?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,((n=e.strstart-e.block_start)>=o||(n||t===hp)&&t!==cp&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=t===hp&&0===e.strm.avail_in&&r===n?1:0,op(e,e.block_start,r,s),e.block_start+=r,Mp(e.strm)),s?3:1)},Dp=(e,t)=>{let r,n;for(;;){if(e.lookahead<262){if(Fp(e),e.lookahead<262&&t===cp)return 1;if(0===e.lookahead)break}if(r=0,3<=e.lookahead&&(e.ins_h=Ap(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=Lp(e,r)),3<=e.match_length)if(n=ap(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,e.ins_h=Ap(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Ap(e,e.ins_h,e.window[e.strstart+1]);else n=ap(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Op(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===hp?(Op(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Op(e,!1),0===e.strm.avail_out)?1:2},Up=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<262){if(Fp(e),e.lookahead<262&&t===cp)return 1;if(0===e.lookahead)break}if(r=0,3<=e.lookahead&&(e.ins_h=Ap(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=Lp(e,r),e.match_length<=5)&&(e.strategy===bp||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2),3<=e.prev_length&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,n=ap(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=Ap(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Op(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=ap(e,0,e.window[e.strstart-1]))&&Op(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=ap(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===hp?(Op(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Op(e,!1),0===e.strm.avail_out)?1:2};function zp(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}let Wp=[new zp(0,0,0,0,Bp),new zp(4,4,8,4,Dp),new zp(4,5,16,8,Dp),new zp(4,6,32,32,Dp),new zp(4,4,16,16,Up),new zp(8,16,32,32,Up),new zp(8,16,128,128,Up),new zp(8,32,128,256,Up),new zp(32,128,258,1024,Up),new zp(32,258,258,4096,Up)];function Gp(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ip,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Tp(this.dyn_ltree),Tp(this.dyn_dtree),Tp(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Tp(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Tp(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}let Hp=e=>{var t;return!e||!(t=e.state)||t.strm!==e||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0},jp=e=>{if(Hp(e))return Ep(e,gp);e.total_in=e.total_out=0,e.data_type=_p;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=-2,ip(t),fp},Zp=e=>{var t=jp(e);return t===fp&&((e=e.state).window_size=2*e.w_size,Tp(e.head),e.max_lazy_match=Wp[e.level].max_lazy,e.good_match=Wp[e.level].good_length,e.nice_match=Wp[e.level].nice_length,e.max_chain_length=Wp[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t},Vp=(e,t,r,n,i,o)=>{if(!e)return gp;let s=1;if(t===wp&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),i<1||9<i||r!==Ip||n<8||15<n||t<0||9<t||o<0||o>kp||8===n&&1!==s)return Ep(e,gp);8===n&&(n=9);var a=new Gp;return(e.state=a).strm=e,a.status=42,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=r,Zp(e)};var Yp=Vp,Xp=(Zp,jp,(e,t)=>Hp(e)||2!==e.state.wrap?gp:(e.state.gzhead=t,fp)),Kp=(r,e)=>{if(Hp(r)||e>pp||e<0)return r?Ep(r,gp):gp;var n=r.state;if(!r.output||0!==r.avail_in&&!r.input||666===n.status&&e!==hp)return Ep(r,0===r.avail_out?yp:gp);var i=n.last_flush;if(n.last_flush=e,0!==n.pending){if(Mp(r),0===r.avail_out)return n.last_flush=-1,fp}else if(0===r.avail_in&&xp(e)<=xp(i)&&e!==hp)return Ep(r,yp);if(666===n.status&&0!==r.avail_in)return Ep(r,yp);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){let e=Ip+(n.w_bits-8<<4)<<8,t;if(t=n.strategy>=Sp||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=t<<6,0!==n.strstart&&(e|=32),e+=31-e%31,Np(n,e),0!==n.strstart&&(Np(n,r.adler>>>16),Np(n,65535&r.adler)),r.adler=1,n.status=113,Mp(r),0!==n.pending)return n.last_flush=-1,fp}if(57===n.status)if(r.adler=0,x(n,31),x(n,139),x(n,8),n.gzhead)x(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),x(n,255&n.gzhead.time),x(n,n.gzhead.time>>8&255),x(n,n.gzhead.time>>16&255),x(n,n.gzhead.time>>24&255),x(n,9===n.level?2:n.strategy>=Sp||n.level<2?4:0),x(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(x(n,255&n.gzhead.extra.length),x(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=rp(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(x(n,0),x(n,0),x(n,0),x(n,0),x(n,0),x(n,9===n.level?2:n.strategy>=Sp||n.level<2?4:0),x(n,3),n.status=113,Mp(r),0!==n.pending)return n.last_flush=-1,fp;if(69===n.status){if(n.gzhead.extra){let e=n.pending,t=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+t>n.pending_buf_size;){var o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(r.adler=rp(r.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=o,Mp(r),0!==n.pending)return n.last_flush=-1,fp;e=0,t-=o}i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+t),n.pending),n.pending+=t,n.gzhead.hcrc&&n.pending>e&&(r.adler=rp(r.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let e,t=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(r.adler=rp(r.adler,n.pending_buf,n.pending-t,t)),Mp(r),0!==n.pending)return n.last_flush=-1,fp;t=0}}while(e=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,x(n,e),0!=e);n.gzhead.hcrc&&n.pending>t&&(r.adler=rp(r.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let e,t=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(r.adler=rp(r.adler,n.pending_buf,n.pending-t,t)),Mp(r),0!==n.pending)return n.last_flush=-1,fp;t=0}}while(e=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,x(n,e),0!=e);n.gzhead.hcrc&&n.pending>t&&(r.adler=rp(r.adler,n.pending_buf,n.pending-t,t))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Mp(r),0!==n.pending))return n.last_flush=-1,fp;x(n,255&r.adler),x(n,r.adler>>8&255),r.adler=0}if(n.status=113,Mp(r),0!==n.pending)return n.last_flush=-1,fp}if(0!==r.avail_in||0!==n.lookahead||e!==cp&&666!==n.status){i=0===n.level?Bp(n,e):n.strategy===Sp?((e,t)=>{for(var r;;){if(0===e.lookahead&&(Fp(e),0===e.lookahead)){if(t===cp)return 1;break}if(e.match_length=0,r=ap(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Op(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===hp?(Op(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Op(e,!1),0===e.strm.avail_out)?1:2})(n,e):n.strategy===Cp?((e,t)=>{let r,n,i,o;for(var s=e.window;;){if(e.lookahead<=258){if(Fp(e),e.lookahead<=258&&t===cp)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(i=e.strstart-1,(n=s[i])===s[++i])&&n===s[++i]&&n===s[++i]){for(o=e.strstart+258;n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o;);e.match_length=258-(o-i),e.lookahead<e.match_length&&(e.match_length=e.lookahead)}if(3<=e.match_length?(r=ap(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ap(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Op(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===hp?(Op(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Op(e,!1),0===e.strm.avail_out)?1:2})(n,e):Wp[n.level].func(n,e);if(3!==i&&4!==i||(n.status=666),1===i||3===i)return 0===r.avail_out&&(n.last_flush=-1),fp;if(2===i&&(e===up?lp(n):e!==pp&&(op(n,0,0,!1),e===dp)&&(Tp(n.head),0===n.lookahead)&&(n.strstart=0,n.block_start=0,n.insert=0),Mp(r),0===r.avail_out))return n.last_flush=-1,fp}return e!==hp||!(n.wrap<=0)&&(2===n.wrap?(x(n,255&r.adler),x(n,r.adler>>8&255),x(n,r.adler>>16&255),x(n,r.adler>>24&255),x(n,255&r.total_in),x(n,r.total_in>>8&255),x(n,r.total_in>>16&255),x(n,r.total_in>>24&255)):(Np(n,r.adler>>>16),Np(n,65535&r.adler)),Mp(r),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending)?fp:mp},Jp=e=>{var t;return Hp(e)?gp:(t=e.state.status,e.state=null,113===t?Ep(e,vp):fp)},qp=(e,t)=>{let r=t.length;if(Hp(e))return gp;var n=e.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return gp;1===i&&(e.adler=ep(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(0===i&&(Tp(n.head),n.strstart=0,n.block_start=0,n.insert=0),(o=new Uint8Array(n.w_size)).set(t.subarray(r-n.w_size,r),0),t=o,r=n.w_size);var o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Fp(n);3<=n.lookahead;){let e=n.strstart,t=n.lookahead-2;for(;n.ins_h=Ap(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++,--t;);n.strstart=e,n.lookahead=2,Fp(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,n.wrap=i,fp};let $p=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Qp(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(let e in r)$p(r,e)&&(t[e]=r[e])}}return t}var ef=n=>{let r=0;for(let e=0,t=n.length;e<t;e++)r+=n[e].length;var i=new Uint8Array(r);for(let e=0,t=0,r=n.length;e<r;e++){var o=n[e];i.set(o,t),t+=o.length}return i};let tf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(T){tf=!1}let rf=new Uint8Array(256);for(let e=0;e<256;e++)rf[e]=252<=e?6:248<=e?5:240<=e?4:224<=e?3:192<=e?2:1;rf[254]=rf[254]=1;function nf(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var of=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[o++]=r:(r<2048?t[o++]=192|r>>>6:(r<65536?t[o++]=224|r>>>12:(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63),t[o++]=128|r>>>6&63),t[o++]=128|63&r);return t};let sf=Object.prototype.toString,{Z_NO_FLUSH:af,Z_SYNC_FLUSH:lf,Z_FULL_FLUSH:cf,Z_FINISH:uf,Z_OK:df,Z_STREAM_END:hf,Z_DEFAULT_COMPRESSION:pf,Z_DEFAULT_STRATEGY:ff,Z_DEFLATED:mf}=h;function gf(e){this.options=Qp({level:pf,method:mf,chunkSize:16384,windowBits:15,memLevel:8,strategy:ff},e||{});e=this.options;if(e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nf,this.strm.avail_out=0,(t=Yp(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy))!==df)throw new Error(np[t]);if(e.header&&Xp(this.strm,e.header),e.dictionary){var t,e="string"==typeof e.dictionary?of(e.dictionary):"[object ArrayBuffer]"===sf.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((t=qp(this.strm,e))!==df)throw new Error(np[t]);this._dict_set=!0}}function vf(e,t){t=new gf(t);if(t.push(e,!0),t.err)throw t.msg||np[t.err];return t.result}gf.prototype.push=function(e,t){var r,n,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;for(n=t===~~t?t:!0===t?uf:af,"string"==typeof e?i.input=of(e):"[object ArrayBuffer]"===sf.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(n===lf||n===cf)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(Kp(i,n)===hf)return 0<i.next_out&&this.onData(i.output.subarray(0,i.next_out)),r=Jp(this.strm),this.onEnd(r),this.ended=!0,r===df;if(0!==i.avail_out){if(0<n&&0<i.next_out)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},gf.prototype.onData=function(e){this.chunks.push(e)},gf.prototype.onEnd=function(e){e===df&&(this.result=ef(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};d={Deflate:gf,deflate:vf,deflateRaw:function(e,t){return(t=t||{}).raw=!0,vf(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,vf(e,t)},constants:h};let yf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),wf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),bf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Sf=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Cf=(e,t,r,n,i,o,s,a)=>{var l=a.bits;let c,u,d,h,p,f,m=0,g=0,v=0,y=0,w=0,b=0,S=0,C=0,k=0,_=0,I=null;var E=new Uint16Array(16),x=new Uint16Array(16);let T,R,A,M=null;for(m=0;m<=15;m++)E[m]=0;for(g=0;g<n;g++)E[t[r+g]]++;for(w=l,y=15;1<=y&&0===E[y];y--);if(w>y&&(w=y),0===y)i[o++]=20971520,i[o++]=20971520,a.bits=1;else{for(v=1;v<y&&0===E[v];v++);for(w<v&&(w=v),C=1,m=1;m<=15;m++)if((C=(C<<=1)-E[m])<0)return-1;if(0<C&&(0===e||1!==y))return-1;for(x[1]=0,m=1;m<15;m++)x[m+1]=x[m]+E[m];for(g=0;g<n;g++)0!==t[r+g]&&(s[x[t[r+g]]++]=g);if(f=0===e?(I=M=s,20):1===e?(I=yf,M=wf,257):(I=bf,M=Sf,0),_=0,g=0,m=v,p=o,b=w,S=0,d=-1,h=(k=1<<w)-1,1===e&&852<k||2===e&&592<k)return 1;for(;;){for(T=m-S,A=s[g]+1<f?(R=0,s[g]):s[g]>=f?(R=M[s[g]-f],I[s[g]-f]):(R=96,0),c=1<<m-S,u=1<<b,v=u;u-=c,i[p+(_>>S)+u]=T<<24|R<<16|A|0,0!==u;);for(c=1<<m-1;_&c;)c>>=1;if(0!==c?_=(_&=c-1)+c:_=0,g++,0==--E[m]){if(m===y)break;m=t[r+s[g]]}if(m>w&&(_&h)!==d){for(0===S&&(S=w),p+=v,b=m-S,C=1<<b;b+S<y&&!((C-=E[b+S])<=0);)b++,C<<=1;if(k+=1<<b,1===e&&852<k||2===e&&592<k)return 1;i[d=_&h]=w<<24|b<<16|p-o|0}}0!==_&&(i[p+_]=m-S<<24|64<<16|0),a.bits=w}return 0};let{Z_FINISH:kf,Z_BLOCK:_f,Z_TREES:If,Z_OK:Ef,Z_STREAM_END:xf,Z_NEED_DICT:Tf,Z_STREAM_ERROR:Rf,Z_DATA_ERROR:Af,Z_MEM_ERROR:Mf,Z_BUF_ERROR:Of,Z_DEFLATED:Nf}=h,N=16209,Pf=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Lf(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}let Ff=e=>{var t;return!e||!(t=e.state)||t.strm!==e||t.mode<16180||16211<t.mode?1:0},Bf=e=>{var t;return Ff(e)?Rf:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=16180,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Ef)},Df=e=>{var t;return Ff(e)?Rf:((t=e.state).wsize=0,t.whave=0,t.wnext=0,Bf(e))},Uf=(e,t)=>{let r;var n;return Ff(e)||(n=e.state,t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t))?Rf:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Df(e))},zf=(e,t)=>{var r;return e?(r=new Lf,(e.state=r).strm=e,r.window=null,r.mode=16180,(r=Uf(e,t))!==Ef&&(e.state=null),r):Rf},Wf,Gf,Hf=!0,jf=(e,t,r,n)=>{let i;e=e.state;return null===e.window&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new Uint8Array(e.wsize)),e.wsize<=n?(e.window.set(t.subarray(r-e.wsize,r),0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>n&&(i=n),e.window.set(t.subarray(r-n,r-n+i),e.wnext),(n-=i)?(e.window.set(t.subarray(r-n,r),0),e.wnext=n,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0};function Zf(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Vf=Df,Yf=(Uf,Bf,zf),Xf=(_,e)=>{let t,r,n,i,o,s,a,l,c,u,I,d,h,p,f,m,g,v,y,w,b,S,C=0;var k=new Uint8Array(4);let E,x;var T=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ff(_)||!_.output||!_.input&&0!==_.avail_in)return Rf;16191===(t=_.state).mode&&(t.mode=16192),o=_.next_out,n=_.output,a=_.avail_out,i=_.next_in,r=_.input,s=_.avail_in,l=t.hold,c=t.bits,u=s,I=a,S=Ef;e:for(;;)switch(t.mode){case 16180:if(0===t.wrap)t.mode=16192;else{for(;c<16;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}2&t.wrap&&35615===l?(0===t.wbits&&(t.wbits=15),k[t.check=0]=255&l,k[1]=l>>>8&255,t.check=rp(t.check,k,2,0),l=0,c=0,t.mode=16181):(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&l)<<8)+(l>>8))%31?(_.msg="incorrect header check",t.mode=N):(15&l)!==Nf?(_.msg="unknown compression method",t.mode=N):(l>>>=4,c-=4,b=8+(15&l),0===t.wbits&&(t.wbits=b),15<b||b>t.wbits?(_.msg="invalid window size",t.mode=N):(t.dmax=1<<t.wbits,t.flags=0,_.adler=t.check=1,t.mode=512&l?16189:16191,l=0,c=0)))}break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(t.flags=l,(255&t.flags)!==Nf){_.msg="unknown compression method",t.mode=N;break}if(57344&t.flags){_.msg="unknown header flags set",t.mode=N;break}t.head&&(t.head.text=l>>8&1),512&t.flags&&4&t.wrap&&(k[0]=255&l,k[1]=l>>>8&255,t.check=rp(t.check,k,2,0)),l=0,c=0,t.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}t.head&&(t.head.time=l),512&t.flags&&4&t.wrap&&(k[0]=255&l,k[1]=l>>>8&255,k[2]=l>>>16&255,k[3]=l>>>24&255,t.check=rp(t.check,k,4,0)),l=0,c=0,t.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}t.head&&(t.head.xflags=255&l,t.head.os=l>>8),512&t.flags&&4&t.wrap&&(k[0]=255&l,k[1]=l>>>8&255,t.check=rp(t.check,k,2,0)),l=0,c=0,t.mode=16184;case 16184:if(1024&t.flags){for(;c<16;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}t.length=l,t.head&&(t.head.extra_len=l),512&t.flags&&4&t.wrap&&(k[0]=255&l,k[1]=l>>>8&255,t.check=rp(t.check,k,2,0)),l=0,c=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&((d=(d=t.length)>s?s:d)&&(t.head&&(b=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(i,i+d),b)),512&t.flags&&4&t.wrap&&(t.check=rp(t.check,r,d,i)),s-=d,i+=d,t.length-=d),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(0===s)break e;for(d=0;b=r[i+d++],t.head&&b&&t.length<65536&&(t.head.name+=String.fromCharCode(b)),b&&d<s;);if(512&t.flags&&4&t.wrap&&(t.check=rp(t.check,r,d,i)),s-=d,i+=d,b)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(0===s)break e;for(d=0;b=r[i+d++],t.head&&b&&t.length<65536&&(t.head.comment+=String.fromCharCode(b)),b&&d<s;);if(512&t.flags&&4&t.wrap&&(t.check=rp(t.check,r,d,i)),s-=d,i+=d,b)break e}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;c<16;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(4&t.wrap&&l!==(65535&t.check)){_.msg="header crc mismatch",t.mode=N;break}l=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),_.adler=t.check=0,t.mode=16191;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}_.adler=t.check=Pf(l),l=0,c=0,t.mode=16190;case 16190:if(0===t.havedict)return _.next_out=o,_.avail_out=a,_.next_in=i,_.avail_in=s,t.hold=l,t.bits=c,Tf;_.adler=t.check=1,t.mode=16191;case 16191:if(e===_f||e===If)break e;case 16192:if(t.last)l>>>=7&c,c-=7&c,t.mode=16206;else{for(;c<3;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}switch(t.last=1&l,l>>>=1,--c,3&l){case 0:t.mode=16193;break;case 1:if((t=>{if(Hf){Wf=new Int32Array(512),Gf=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Cf(1,t.lens,0,288,Wf,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Cf(2,t.lens,0,32,Gf,0,t.work,{bits:5}),Hf=!1}t.lencode=Wf,t.lenbits=9,t.distcode=Gf,t.distbits=5})(t),t.mode=16199,e!==If)break;l>>>=2,c-=2;break e;case 2:t.mode=16196;break;case 3:_.msg="invalid block type",t.mode=N}l>>>=2,c-=2}break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){_.msg="invalid stored block lengths",t.mode=N;break}if(t.length=65535&l,l=0,c=0,t.mode=16194,e===If)break e;case 16194:t.mode=16195;case 16195:if(d=t.length){if(0===(d=(d=d>s?s:d)>a?a:d))break e;n.set(r.subarray(i,i+d),o),s-=d,i+=d,a-=d,o+=d,t.length-=d}else t.mode=16191;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(t.nlen=257+(31&l),l>>>=5,c-=5,t.ndist=1+(31&l),l>>>=5,c-=5,t.ncode=4+(15&l),l>>>=4,c-=4,286<t.nlen||30<t.ndist){_.msg="too many length or distance symbols",t.mode=N;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;c<3;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}t.lens[T[t.have++]]=7&l,l>>>=3,c-=3}for(;t.have<19;)t.lens[T[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,E={bits:t.lenbits},S=Cf(0,t.lens,0,19,t.lencode,0,t.work,E),t.lenbits=E.bits,S){_.msg="invalid code lengths set",t.mode=N;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;C=t.lencode[l&(1<<t.lenbits)-1],f=C>>>24,m=C>>>16&255,g=65535&C,!(f<=c);){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(g<16)l>>>=f,c-=f,t.lens[t.have++]=g;else{if(16===g){for(x=f+2;c<x;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(l>>>=f,c-=f,0===t.have){_.msg="invalid bit length repeat",t.mode=N;break}b=t.lens[t.have-1],d=3+(3&l),l>>>=2,c-=2}else if(17===g){for(x=f+3;c<x;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}l>>>=f,c-=f,b=0,d=3+(7&l),l>>>=3,c-=3}else{for(x=f+7;c<x;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}l>>>=f,c-=f,b=0,d=11+(127&l),l>>>=7,c-=7}if(t.have+d>t.nlen+t.ndist){_.msg="invalid bit length repeat",t.mode=N;break}for(;d--;)t.lens[t.have++]=b}}if(t.mode===N)break;if(0===t.lens[256]){_.msg="invalid code -- missing end-of-block",t.mode=N;break}if(t.lenbits=9,E={bits:t.lenbits},S=Cf(1,t.lens,0,t.nlen,t.lencode,0,t.work,E),t.lenbits=E.bits,S){_.msg="invalid literal/lengths set",t.mode=N;break}if(t.distbits=6,t.distcode=t.distdyn,E={bits:t.distbits},S=Cf(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,E),t.distbits=E.bits,S){_.msg="invalid distances set",t.mode=N;break}if(t.mode=16199,e===If)break e;case 16199:t.mode=16200;case 16200:if(6<=s&&258<=a){_.next_out=o,_.avail_out=a,_.next_in=i,_.avail_in=s,t.hold=l,t.bits=c;{R=void 0;A=void 0;M=void 0;var R=_;var A=I;let e,t,r,n,i,o,s,a,l,c,u,d,h,p,f,m,g,v,y,w,b,S,C,k;var M=R.state;e=R.next_in,C=R.input,t=e+(R.avail_in-5),r=R.next_out,k=R.output,n=r-(A-R.avail_out),i=r+(R.avail_out-257),o=M.dmax,s=M.wsize,a=M.whave,l=M.wnext,c=M.window,u=M.hold,d=M.bits,h=M.lencode,p=M.distcode,f=(1<<M.lenbits)-1,m=(1<<M.distbits)-1;t:do{for(d<15&&(u+=C[e++]<<d,d+=8,u+=C[e++]<<d,d+=8),g=h[u&f];;){if(v=g>>>24,u>>>=v,d-=v,0===(v=g>>>16&255))k[r++]=65535&g;else{if(!(16&v)){if(0==(64&v)){g=h[(65535&g)+(u&(1<<v)-1)];continue}if(32&v){M.mode=16191;break t}R.msg="invalid literal/length code",M.mode=16209;break t}for(y=65535&g,(v&=15)&&(d<v&&(u+=C[e++]<<d,d+=8),y+=u&(1<<v)-1,u>>>=v,d-=v),d<15&&(u+=C[e++]<<d,d+=8,u+=C[e++]<<d,d+=8),g=p[u&m];;){if(v=g>>>24,u>>>=v,d-=v,!(16&(v=g>>>16&255))){if(0==(64&v)){g=p[(65535&g)+(u&(1<<v)-1)];continue}R.msg="invalid distance code",M.mode=16209;break t}if(w=65535&g,v&=15,d<v&&(u+=C[e++]<<d,(d+=8)<v)&&(u+=C[e++]<<d,d+=8),o<(w+=u&(1<<v)-1)){R.msg="invalid distance too far back",M.mode=16209;break t}if(u>>>=v,d-=v,w>(v=r-n)){if((v=w-v)>a&&M.sane){R.msg="invalid distance too far back",M.mode=16209;break t}if(b=0,S=c,0===l){if(b+=s-v,v<y){for(y-=v;k[r++]=c[b++],--v;);b=r-w,S=k}}else if(l<v){if(b+=s+l-v,(v-=l)<y){for(y-=v;k[r++]=c[b++],--v;);if(b=0,l<y){for(v=l,y-=v;k[r++]=c[b++],--v;);b=r-w,S=k}}}else if(b+=l-v,v<y){for(y-=v;k[r++]=c[b++],--v;);b=r-w,S=k}for(;2<y;)k[r++]=S[b++],k[r++]=S[b++],k[r++]=S[b++],y-=3;y&&(k[r++]=S[b++],1<y)&&(k[r++]=S[b++])}else{for(b=r-w;k[r++]=k[b++],k[r++]=k[b++],k[r++]=k[b++],2<(y-=3););y&&(k[r++]=k[b++],1<y)&&(k[r++]=k[b++])}break}}break}}while(e<t&&r<i);y=d>>3,e-=y,d-=y<<3,u&=(1<<d)-1,R.next_in=e,R.next_out=r,R.avail_in=e<t?t-e+5:5-(e-t),R.avail_out=r<i?i-r+257:257-(r-i),M.hold=u,M.bits=d}o=_.next_out,n=_.output,a=_.avail_out,i=_.next_in,r=_.input,s=_.avail_in,l=t.hold,c=t.bits,16191===t.mode&&(t.back=-1);break}for(t.back=0;C=t.lencode[l&(1<<t.lenbits)-1],f=C>>>24,m=C>>>16&255,g=65535&C,!(f<=c);){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(m&&0==(240&m)){for(v=f,y=m,w=g;C=t.lencode[w+((l&(1<<v+y)-1)>>v)],f=C>>>24,m=C>>>16&255,g=65535&C,!(v+f<=c);){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}l>>>=v,c-=v,t.back+=v}if(l>>>=f,c-=f,t.back+=f,t.length=g,0===m){t.mode=16205;break}if(32&m){t.back=-1,t.mode=16191;break}if(64&m){_.msg="invalid literal/length code",t.mode=N;break}t.extra=15&m,t.mode=16201;case 16201:if(t.extra){for(x=t.extra;c<x;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}t.length+=l&(1<<t.extra)-1,l>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;C=t.distcode[l&(1<<t.distbits)-1],f=C>>>24,m=C>>>16&255,g=65535&C,!(f<=c);){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(0==(240&m)){for(v=f,y=m,w=g;C=t.distcode[w+((l&(1<<v+y)-1)>>v)],f=C>>>24,m=C>>>16&255,g=65535&C,!(v+f<=c);){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}l>>>=v,c-=v,t.back+=v}if(l>>>=f,c-=f,t.back+=f,64&m){_.msg="invalid distance code",t.mode=N;break}t.offset=g,t.extra=15&m,t.mode=16203;case 16203:if(t.extra){for(x=t.extra;c<x;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}t.offset+=l&(1<<t.extra)-1,l>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){_.msg="invalid distance too far back",t.mode=N;break}t.mode=16204;case 16204:if(0===a)break e;if(d=I-a,t.offset>d){if((d=t.offset-d)>t.whave&&t.sane){_.msg="invalid distance too far back",t.mode=N;break}h=d>t.wnext?(d-=t.wnext,t.wsize-d):t.wnext-d,d>t.length&&(d=t.length),p=t.window}else p=n,h=o-t.offset,d=t.length;for(d>a&&(d=a),a-=d,t.length-=d;n[o++]=p[h++],--d;);0===t.length&&(t.mode=16200);break;case 16205:if(0===a)break e;n[o++]=t.length,a--,t.mode=16200;break;case 16206:if(t.wrap){for(;c<32;){if(0===s)break e;s--,l|=r[i++]<<c,c+=8}if(I-=a,_.total_out+=I,t.total+=I,4&t.wrap&&I&&(_.adler=t.check=(t.flags?rp:ep)(t.check,n,I,o-I)),I=a,4&t.wrap&&(t.flags?l:Pf(l))!==t.check){_.msg="incorrect data check",t.mode=N;break}l=0,c=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;c<32;){if(0===s)break e;s--,l+=r[i++]<<c,c+=8}if(4&t.wrap&&l!==(4294967295&t.total)){_.msg="incorrect length check",t.mode=N;break}l=0,c=0}t.mode=16208;case 16208:S=xf;break e;case N:S=Af;break e;case 16210:return Mf;default:return Rf}return _.next_out=o,_.avail_out=a,_.next_in=i,_.avail_in=s,t.hold=l,t.bits=c,(t.wsize||I!==_.avail_out&&t.mode<N&&(t.mode<16206||e!==kf))&&jf(_,_.output,_.next_out,I-_.avail_out),u-=_.avail_in,I-=_.avail_out,_.total_in+=u,_.total_out+=I,t.total+=I,4&t.wrap&&I&&(_.adler=t.check=(t.flags?rp:ep)(t.check,n,I,_.next_out-I)),_.data_type=t.bits+(t.last?64:0)+(16191===t.mode?128:0)+(16199===t.mode||16194===t.mode?256:0),S=(0==u&&0===I||e===kf)&&S===Ef?Of:S},Kf=e=>{var t;return Ff(e)?Rf:((t=e.state).window&&(t.window=null),e.state=null,Ef)},Jf=(e,t)=>Ff(e)||0==(2&(e=e.state).wrap)?Rf:((e.head=t).done=!1,Ef),qf=(e,t)=>{var r,n=t.length;return Ff(e)||0!==(r=e.state).wrap&&16190!==r.mode?Rf:16190===r.mode&&ep(1,t,n,0)!==r.check?Af:jf(e,t,n,n)?(r.mode=16210,Mf):(r.havedict=1,Ef)};let $f=Object.prototype.toString,{Z_NO_FLUSH:Qf,Z_FINISH:em,Z_OK:tm,Z_STREAM_END:rm,Z_NEED_DICT:nm,Z_STREAM_ERROR:im,Z_DATA_ERROR:om,Z_MEM_ERROR:sm}=h;function am(e){this.options=Qp({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits)&&(t.windowBits=-15),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nf,this.strm.avail_out=0;let r=Yf(this.strm,t.windowBits);if(r!==tm)throw new Error(np[r]);if(this.header=new Zf,Jf(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=of(t.dictionary):"[object ArrayBuffer]"===$f.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(r=qf(this.strm,t.dictionary))!==tm)throw new Error(np[r])}function lm(e,t){t=new am(t);if(t.push(e),t.err)throw t.msg||np[t.err];return t.result}am.prototype.push=function(e,t){var r,n,i,o=this.strm,s=this.options.chunkSize,a=this.options.dictionary;let l,c,u;if(this.ended)return!1;for(c=t===~~t?t:!0===t?em:Qf,"[object ArrayBuffer]"===$f.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;;){for(0===o.avail_out&&(o.output=new Uint8Array(s),o.next_out=0,o.avail_out=s),(l=Xf(o,c))===nm&&a&&((l=qf(o,a))===tm?l=Xf(o,c):l===om&&(l=nm));0<o.avail_in&&l===rm&&0<o.state.wrap&&0!==e[o.next_in];)Vf(o),l=Xf(o,c);switch(l){case im:case om:case nm:case sm:return this.onEnd(l),!(this.ended=!0)}if(u=o.avail_out,!o.next_out||0!==o.avail_out&&l!==rm||("string"===this.options.to?(r=((e,t)=>{let r=(t=(t=t||e.length)>e.length?e.length:t)-1;for(;0<=r&&128==(192&e[r]);)r--;return!(r<0||0===r)&&r+rf[e[r]]>t?r:t})(o.output,o.next_out),n=o.next_out-r,i=((r,e)=>{var n=e||r.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(r.subarray(0,e));let i,o;var s=new Array(2*n);for(o=0,i=0;i<n;){let t=r[i++];if(t<128)s[o++]=t;else{let e=rf[t];if(4<e)s[o++]=65533,i+=e-1;else{for(t&=2===e?31:3===e?15:7;1<e&&i<n;)t=t<<6|63&r[i++],e--;1<e?s[o++]=65533:t<65536?s[o++]=t:(t-=65536,s[o++]=55296|t>>10&1023,s[o++]=56320|1023&t)}}}{var a=s,l=o;if(l<65534&&a.subarray&&tf)return String.fromCharCode.apply(null,a.length===l?a:a.subarray(0,l));let t="";for(let e=0;e<l;e++)t+=String.fromCharCode(a[e]);return t}})(o.output,r),o.next_out=n,o.avail_out=s-n,n&&o.output.set(o.output.subarray(r,r+n),0),this.onData(i)):this.onData(o.output.length===o.next_out?o.output:o.output.subarray(0,o.next_out))),l!==tm||0!==u){if(l===rm)return l=Kf(this.strm),this.onEnd(l),this.ended=!0;if(0===o.avail_in)break}}return!0},am.prototype.onData=function(e){this.chunks.push(e)},am.prototype.onEnd=function(e){e===tm&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ef(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var{Deflate:ds,deflate:ra,deflateRaw:i,gzip:na}=d,{Inflate:Ki,inflate:C,inflateRaw:s,ungzip:u}={Inflate:am,inflate:lm,inflateRaw:function(e,t){return(t=t||{}).raw=!0,lm(e,t)},ungzip:lm},cm={Deflate:ds,deflate:ra,deflateRaw:i,gzip:na,Inflate:Ki,inflate:C,inflateRaw:s,ungzip:u,constants:h},um=(fm.prototype.uploadReplay=function(r){return L(this,void 0,void 0,function(){var t;return F(this,function(e){switch(e.label){case 0:if(this.isUploading)return In("Uploader","Upload in progress, skipping"),[2,!1];this.isUploading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),(t=this.config.beforeSend(r))?[4,this.doUploadWithRetry(t,0)]:(v("Uploader","Upload cancelled by beforeSend"),[2,!1]);case 2:return e.sent(),v("Uploader","Upload success:",{replay_id:r.replay_id,segment_id:r.segment_id}),[2,!0];case 3:return En("Uploader","Upload failed:",t=e.sent()),this.config.onError(t),[2,!1];case 4:return this.isUploading=!1,[7];case 5:return[2]}})})},fm.prototype.doUploadWithRetry=function(n,i){return L(this,void 0,void 0,function(){var t,r;return F(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,5]),[4,this.doUpload(n)];case 1:return e.sent(),[3,5];case 2:return t=e.sent(),i<this.config.maxRetries?(v("Uploader","Retrying in "+(r=1e3*Math.pow(2,i))+"ms (attempt "+(i+1)+"/"+this.config.maxRetries+")"),[4,this.sleep(r)]):[3,4];case 3:return e.sent(),[2,this.doUploadWithRetry(n,i+1)];case 4:throw t;case 5:return[2]}})})},fm.prototype.compressData=function(e){var e=JSON.stringify(e),t=e.length,e=cm.gzip(e),r=e.length;return v("Uploader","Compressed: "+Math.round(t/1024)+"KB -> "+Math.round(r/1024)+"KB ("+Math.round(100*(1-r/t))+"% reduction)"),{compressed:e,originalSize:t,compressedSize:r}},fm.prototype.doUpload=function(o){return L(this,void 0,void 0,function(){var t,r,n,i;return F(this,function(e){switch(e.label){case 0:return i={"Content-Type":"application/json","X-App-ID":this.config.appId},this.useCompression?(t=this.compressData(o).compressed,t=t,i["Content-Encoding"]="gzip"):(t=JSON.stringify(o),v("Uploader","Sending uncompressed: "+Math.round(t.length/1024)+"KB")),n="string"==typeof t?t.length:t.byteLength,(r=n<65536)||v("Uploader","Data size "+Math.round(n/1024)+"KB exceeds keepalive limit, using normal fetch"),[4,fetch(this.config.uploadUrl,{method:"POST",headers:i,body:t,keepalive:r})];case 1:if((n=e.sent()).ok)return[4,n.json()];throw new Error("HTTP "+n.status+": "+n.statusText);case 2:if(0!==(i=e.sent()).code)throw new Error("Server error (code "+i.code+"): "+i.message);return[2]}})})},fm.prototype.sendBeacon=function(e){try{var t,r;return this.useCompression?(t=this.compressData(e).compressed,r=new Blob([t],{type:"application/octet-stream"}),navigator.sendBeacon(this.config.uploadUrl+"?encoding=gzip",r)):(r=new Blob([JSON.stringify(e)],{type:"application/json"}),navigator.sendBeacon(this.config.uploadUrl,r))}catch(e){return En("Uploader","sendBeacon failed:",e),!1}},fm.prototype.isUploadInProgress=function(){return this.isUploading},fm.prototype.sleep=function(t){return new Promise(function(e){return setTimeout(e,t)})},fm),dm=["a","button",'input[type="button"]','input[type="submit"]','[role="button"]',"[onclick]","[ng-click]","[v-on\\:click]"].join(","),hm=(pm.prototype.start=function(){this.isRunning||(document.addEventListener("pointerdown",this.handlePointerDown,!0),document.addEventListener("click",this.handleClick,!0),this.isRunning=!0,v("ClickDetector","Started"))},pm.prototype.stop=function(){this.isRunning&&(document.removeEventListener("pointerdown",this.handlePointerDown,!0),document.removeEventListener("click",this.handleClick,!0),this.cleanupSlowClick(),this.isRunning=!1,v("ClickDetector","Stopped"))},pm.prototype.handlePointerDown=function(e){var t=this,e=e.target;this.isClickableElement(e)&&(this.cleanupSlowClick(),this.clickStartTime=Date.now(),this.clickNode=e,this.slowClickTimeoutId=setTimeout(function(){t.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver())},pm.prototype.handleClick=function(e){var t=this,r=e.target,n=Date.now();this.rageActiveTarget&&n-this.rageLastClickTime>=this.options.rageClickWindow&&(this.rageActiveTarget=null,this.rageLastClickTime=0),this.rageActiveTarget&&this.isSameTarget(this.rageActiveTarget,r)?this.rageLastClickTime=n:(this.clickHistory.push({time:n,target:r}),this.clickHistory=this.clickHistory.filter(function(e){return n-e.time<t.options.rageClickWindow}),(e=this.clickHistory.filter(function(e){return t.isSameTarget(e.target,r)})).length>=this.options.rageClickCount&&(this.options.onRageClick({node:this.getNodeInfo(r),clickCount:e.length,timeWindowMs:this.options.rageClickWindow,timestamp:n}),this.rageActiveTarget=r,this.rageLastClickTime=n))},pm.prototype.startMutationObserver=function(){var t=this;this.clickNode&&(this.mutationObserver=new MutationObserver(function(e){t.hasSignificantMutation(e)&&t.handleSlowClick("mutation")}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","disabled"]}))},pm.prototype.hasSignificantMutation=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];if("childList"===n.type&&(0<n.addedNodes.length||0<n.removedNodes.length)&&Array.from(n.addedNodes).some(function(e){return e.nodeType===Node.ELEMENT_NODE&&!["SCRIPT","STYLE","LINK"].includes(e.tagName)}))return!0;if("attributes"===n.type){n=n.attributeName;if("class"===n||"style"===n)return!0}}return!1},pm.prototype.handleSlowClick=function(e){var t;this.clickNode&&this.clickStartTime&&((t=Date.now()-this.clickStartTime)>=this.options.slowClickThreshold&&this.options.onSlowClick({node:this.getNodeInfo(this.clickNode),timeAfterClickMs:t,endReason:e,timestamp:this.clickStartTime}),this.cleanupSlowClick())},pm.prototype.cleanupSlowClick=function(){this.slowClickTimeoutId&&(clearTimeout(this.slowClickTimeoutId),this.slowClickTimeoutId=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.clickStartTime=0,this.clickNode=null},pm.prototype.isSameTarget=function(e,t){return e===t||e.contains(t)||t.contains(e)},pm.prototype.isClickableElement=function(e){return e.matches(dm)||null!==e.closest(dm)},pm.prototype.getNodeInfo=function(e){var t;return{id:(null==(t=e.__sn)?void 0:t.id)||0,tagName:e.tagName.toLowerCase(),textContent:(e.textContent||"").trim().substring(0,100),selector:this.getSelector(e)}},pm.prototype.getSelector=function(e){for(var t=[],r=e;r&&r!==document.body&&t.length<5;){var n,i=r.tagName.toLowerCase();if(r.id){i+="#"+r.id,t.unshift(i);break}r.className&&"string"==typeof r.className&&0<(n=r.className.trim().split(/\s+/).slice(0,2)).length&&(i+="."+n.join(".")),t.unshift(i),r=r.parentElement}return t.join(" > ")},pm.prototype.isActive=function(){return this.isRunning},pm);function pm(e){var t;void 0===e&&(e={}),this.isRunning=!1,this.clickStartTime=0,this.clickNode=null,this.slowClickTimeoutId=null,this.mutationObserver=null,this.clickHistory=[],this.rageActiveTarget=null,this.rageLastClickTime=0,this.options={slowClickTimeout:null!=(t=e.slowClickTimeout)?t:7e3,slowClickThreshold:null!=(t=e.slowClickThreshold)?t:3e3,rageClickCount:null!=(t=e.rageClickCount)?t:5,rageClickWindow:null!=(t=e.rageClickWindow)?t:1e3,onSlowClick:e.onSlowClick||function(){},onRageClick:e.onRageClick||function(){},onDeadClick:e.onDeadClick||function(){}},this.handleClick=this.handleClick.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this)}function fm(e){var t;this.isUploading=!1,this.useCompression=!1,this.config={uploadUrl:e.uploadUrl||"/api/v1/collect/replay",appId:e.appId,maxRetries:null!=(t=e.maxRetries)?t:3,beforeSend:e.beforeSend||function(e){return e},onError:e.onError||function(){}}}function mm(e){var t=null==(t=e)?void 0:t._tdemSampleGate;return!t||!t.isDecided||t.isSampled&&!1!==e._replaySampled}new e({name:"sessionReplay"});var b=new e({name:"sessionReplay",sessionManager:null,eventBuffer:null,recorderManager:null,samplerManager:null,uploader:null,clickDetector:null,flushTimer:null,replayConfig:null,isInitialized:!1,_tdemRef:null,_isCheckoutFlushing:!1,init:function(e){},onNewTdem:function(e,t){var t=this.parseConfig(t),r=null!=(r=t.debug)&&r;Cn=r,t.enabled?(this.replayConfig=t,this._tdemRef=e,this.initializeModules(e,t),(r=this.samplerManager.initializeSampling()).shouldRecord?(this.startReplay(e,t,r.mode),this.registerReplaySamplingCheck(e,t),this.listenForErrors(e,t),this.listenForPerformance(e),this.listenForUnload(e),this.isInitialized=!0):v("Plugin","Not sampled by local sampler, skipping")):v("Plugin","disabled")},registerReplaySamplingCheck:function(t,e){var r=this,n=setInterval(function(){var e=null==(e=t)?void 0:e._tdemSampleGate;e&&e.isDecided&&(e.isSampled?void 0!==(e=t._replaySampled)&&(clearInterval(n),!1===e?(v("Plugin","Replay not sampled, stopping replay and clearing buffer"),r.stopReplay(),r.eventBuffer&&r.eventBuffer.clear()):v("Plugin","Both session and replay sampled, replay continues")):(clearInterval(n),v("Plugin","Session not sampled, stopping replay and clearing buffer"),r.stopReplay(),r.eventBuffer&&r.eventBuffer.clear()))},50);setTimeout(function(){clearInterval(n)},5e3)},parseConfig:function(e){return!0===e?{enabled:!0}:"object"==typeof e?f(f({},e),{enabled:!1!==e.enabled}):{enabled:!1}},initializeModules:function(t,e){var r=this,n=(this.sessionManager=new xn({stickySession:null==(n=e.stickySession)||n}),this.sessionManager.setTdemInstance(t),t.sessionManager=this.sessionManager,this.eventBuffer=new Nn({},null!=(n=e.useCompression)&&n),this.samplerManager=new yh({sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate}),this.recorderManager=new vh({onRecordingEvent:function(e){r.handleRecordingEvent(e,t)},onCheckout:function(){if(!r._isCheckoutFlushing){r._isCheckoutFlushing=!0;try{var e=r._tdemRef,t=r.replayConfig;e&&t&&r.eventBuffer&&!r.eventBuffer.isEmpty()&&(v("SessionReplay","Checkout triggered, flushing current buffer"),r.flushReplayData(e,t,!0))}finally{r._isCheckoutFlushing=!1}}},mode:"session"},e),t.config.hostUrl||"");this.uploader=new um({uploadUrl:e.uploadUrl||n+"/api/v1/collect/replay",appId:String(t.config.id||""),beforeSend:e.beforeSend,onError:e.onError}),this.clickDetector=new hm({slowClickTimeout:e.slowClickTimeout,slowClickThreshold:e.slowClickThreshold,rageClickCount:e.rageClickCount,rageClickWindow:e.rageClickWindow,onSlowClick:function(e){r.handleSlowClick(e,t)},onRageClick:function(e){r.handleRageClick(e,t)}}),v("Plugin","Modules initialized")},startReplay:function(e,t,r){var n;this.sessionManager&&this.recorderManager&&this.eventBuffer?(v("Plugin","Session started:",(this.sessionManager.restoreSession()||this.sessionManager.createSession(r)).id,"mode:",r),this.recorderManager.options.mode=r,n=fh(f({maskAllText:!1!==t.maskAllInputs,maskAllInputs:t.maskAllInputs,maskTextSelector:t.maskTextSelector,blockSelector:t.blockSelector,ignoreSelector:t.ignoreSelector},t.privacy)),this.recorderManager.startRecording({privacy:n}),this.clickDetector&&this.clickDetector.start(),"session"===r?this.startFlushTimer(e,t):v("Plugin","Buffer mode - flush on error only")):En("Plugin","Modules not initialized")},handleRecordingEvent:function(e,t){this.eventBuffer&&this.sessionManager&&(this.sanitizeDataURLs(e),this.eventBuffer.addEvent(e),this.sessionManager.updateActivity())},sanitizeDataURLs:function(e){var t=e.type;if(2===t){var r=null==(r=e.data)?void 0:r.node;r&&this.sanitizeNodeTree(r,1024)}else if(3===t){r=e.data;if(0===(null==r?void 0:r.source)&&Array.isArray(r.adds)){for(var n=0,i=r.adds;n<i.length;n++){var o=i[n];null!=o&&o.node&&this.sanitizeNodeTree(o.node,1024)}if(Array.isArray(r.attributes))for(var s=0,a=r.attributes;s<a.length;s++){var l=a[s];if(null!=l&&l.attributes)for(var c=0,u=Object.entries(l.attributes);c<u.length;c++){var d=u[c],h=d[0],d=d[1];"string"==typeof d&&1024<d.length&&d.startsWith("data:")&&(l.attributes[h]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}}}}},sanitizeNodeTree:function(e,t){if(e){if(e.attributes)for(var r=e.attributes,n=0,i=Object.keys(r);n<i.length;n++){var o=i[n],s=r[o];"string"==typeof s&&s.length>t&&s.startsWith("data:")&&(r[o]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}if(Array.isArray(e.childNodes))for(var a=0,l=e.childNodes;a<l.length;a++){var c=l[a];this.sanitizeNodeTree(c,t)}}},handleSlowClick:function(e,t){v("ClickDetector","Slow click detected:",e.timeAfterClickMs,"ms"),this.addCustomEvent({category:"ui.slowClickDetected",message:"Slow click: "+e.timeAfterClickMs+"ms on "+e.node.tagName,data:{node:e.node,timeAfterClickMs:e.timeAfterClickMs,endReason:e.endReason}},t)},handleRageClick:function(e,t){v("ClickDetector","Rage click detected:",e.clickCount,"clicks"),this.addCustomEvent({category:"ui.multiClick",message:"Rage click: "+e.clickCount+" clicks on "+e.node.tagName,data:{node:e.node,clickCount:e.clickCount,timeWindowMs:e.timeWindowMs}},t)},addCustomEvent:function(e,t){this.eventBuffer&&(e={type:5,data:{tag:e.category,payload:f({message:e.message},e.data)},timestamp:Date.now()},this.eventBuffer.addEvent(e))},startFlushTimer:function(e,t){var r=this;this.flushTimer&&clearInterval(this.flushTimer),this.flushTimer=setInterval(function(){r.flushReplayData(e,t)},2e4)},flushReplayData:function(u,d,h){return void 0===h&&(h=!1),L(this,void 0,void 0,function(){var t,r,n,i,o,s,a,l,c;return F(this,function(e){switch(e.label){case 0:return this.sessionManager&&this.eventBuffer&&this.uploader&&mm(u)&&(t=this.sessionManager.getSession())?this.sessionManager.shouldRefreshSession()?(v("Plugin","Session expired, refreshing"),this.stopReplay(),i=this.sessionManager.refreshSession(),u.lifeCycle.emit("sessionRefreshed"),r=u._replaySampled,i.sampled&&!1!==r&&this.startReplay(u,d,i.sampled),[2]):this.eventBuffer.isEmpty()?[2]:(r=this.eventBuffer.getEventCount(),!h&&r<10?(v("Flush","Skipping flush, only "+r+" events (min: 10)"),[2]):(0!==t.segmentId||this.eventBuffer.hasCheckout()||(In("Flush","First segment missing FullSnapshot, triggering manual checkout"),this.recorderManager&&this.recorderManager.takeFullSnapshot()),[4,this.eventBuffer.finishAsync()])):[2];case 1:if(0===(n=e.sent()).eventCount)return[2];if(0===(i=n.events).length&&n.eventsJson)try{i=JSON.parse(n.eventsJson)}catch(e){return En("Flush","Failed to parse eventsJson from worker:",e),[2]}a=this.splitEventsIntoChunks(i),v("Flush","Flushing "+n.eventCount+" events in "+a.length+" chunk(s), total size: "+Math.round(n.uncompressedSize/1024)+"KB"),o=!0,s=0,a=a,e.label=2;case 2:return s<a.length?(l=a[s],l=JSON.stringify(l),l={project_key:String(u.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,events:l},[4,this.uploader.uploadReplay(l)]):[3,5];case 3:if(!e.sent())return o=!1,[3,5];e.label=4;case 4:return s++,[3,2];case 5:return l=this.eventBuffer.isUsingWorker(),c=l?"(worker)":"(sync)",v("Flush","Flushing "+n.eventCount+" events, size: "+Math.round(n.uncompressedSize/1024)+"KB "+c),o&&(this.eventBuffer.clear(),this.sessionManager.saveSession()),[2]}})})},splitEventsIntoChunks:function(e){if(0===e.length)return[];var t=JSON.stringify(e);if(t.length<=3145728)return[e];In("Split","Events size "+Math.round(t.length/1024)+"KB exceeds limit "+Math.round(3072)+"KB, splitting");for(var r=[],n=[],i=2,o=0,s=e;o<s.length;o++){var a=s[o],l=JSON.stringify(a).length+1;0<n.length&&3145728<i+l&&(r.push(n),n=[],i=2),5242880<l?In("Split","Single event too large ("+Math.round(l/1024)+"KB), type="+a.type+", skipping"):(n.push(a),i+=l)}return 0<n.length&&r.push(n),r},stopReplay:function(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),v("Plugin","Recording stopped")},listenForErrors:function(t,r){var n=this;t.lifeCycle.on("errorOccurred",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){e&&n.handleError(e,t,r)})}),t.lifeCycle.on("tdemEventCreated",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){n.isErrorTDEMEvent(e)&&n.handleError(e,t,r)})})},isErrorTDEMEvent:function(e){return!!e&&("error"===String(e.event_category||"").toLowerCase()||(e=String(e.event_type||"").toLowerCase(),["js_error","promise_error","resource_error","api_error"].includes(e)))},handleError:function(e,t,r){this.samplerManager&&(this.samplerManager.isBufferMode()&&this.samplerManager.onErrorOccurred(e)&&(v("Plugin","Converting to session mode due to error"),this.flushReplayData(t,r,!0),this.startFlushTimer(t,r)),this.addCustomEvent({category:"error",message:(null==e?void 0:e.msg)||(null==e?void 0:e.message)||"Unknown error",data:{type:(null==e?void 0:e.type)||"error",stack:null==e?void 0:e.stack}},t))},listenForPerformance:function(r){var n=this;if(r.lifeCycle.on("afterReportWebVitals",function(e){n.handlePerformanceEvent("webVitals",e,r)}),r.lifeCycle.on("afterReportPagePerformance",function(e){n.handlePerformanceEvent("pageLoad",e,r)}),"undefined"!=typeof PerformanceObserver)try{var e=new PerformanceObserver(function(e){var t,e=e.getEntries(),e=e[e.length-1];e&&n.addCustomEvent({category:"performance.lcp",message:"LCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime,element:(null==(t=e.element)?void 0:t.tagName)||"unknown",size:e.size}},r)}),t=(e.observe({type:"largest-contentful-paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){"first-contentful-paint"===e.name&&n.addCustomEvent({category:"performance.fcp",message:"FCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime}},r)})})),i=(t.observe({type:"paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){100<e.duration&&n.addCustomEvent({category:"performance.longTask",message:"Long Task: "+Math.round(e.duration)+"ms",data:{duration:e.duration,startTime:e.startTime}},r)})}));i.observe({type:"longtask",buffered:!0}),r.lifeCycle.on("destroy",function(){e.disconnect(),t.disconnect(),i.disconnect()})}catch(r){}},handlePerformanceEvent:function(e,r,n){var i=this;r&&("webVitals"===e?["LCP","FCP","FID","CLS","TTFB","TTI","INP"].forEach(function(e){var t=r[e];void 0!==t&&-1!==t&&0<t&&i.addCustomEvent({category:"performance."+e.toLowerCase(),message:e+": "+("number"==typeof t?Math.round(t):t)+("CLS"===e?"":"ms"),data:{metric:e,value:t}},n)}):"pageLoad"===e&&this.addCustomEvent({category:"performance.pageLoad",message:"Page Load: "+(r.firstScreenTiming?Math.round(r.firstScreenTiming):"N/A")+"ms",data:{dnsLookup:r.dnsLookup,tcp:r.tcp,ssl:r.ssl,ttfb:r.ttfb,contentDownload:r.contentDownload,domParse:r.domParse,resourceDownload:r.resourceDownload,firstScreenTiming:r.firstScreenTiming}},n))},listenForUnload:function(e){function t(){r.flushOnUnload(e)}var r=this;window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),e.lifeCycle.on("destroy",function(){window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t)})},flushOnUnload:function(e){if(this.sessionManager&&this.eventBuffer&&this.uploader&&mm(e)){var t=this.sessionManager.getSession();if(t&&(this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),!this.eventBuffer.isEmpty())){var r=this.eventBuffer.finish();if(0!==r.eventCount){for(var r=this.splitEventsIntoChunks(r.events),n=0,i=r;n<i.length;n++){var o=i[n],o={project_key:String(e.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,events:JSON.stringify(o)};this.uploader.sendBeacon(o)}v("SessionReplay"," Data sent via sendBeacon on unload ("+r.length+" chunk(s))")}}}},destroy:function(){this.stopReplay(),this.sessionManager&&this.sessionManager.saveSession(),this.sessionManager=null,this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,this.recorderManager=null,this.samplerManager=null,this.uploader=null,this.clickDetector=null,this.replayConfig=null,this._tdemRef=null,this._isCheckoutFlushing=!1,this.isInitialized=!1,v("Plugin","destroyed")}}),gm={enabled:!0,ruleVersion:"1.0.0",payloadAllowlist:[],click:{deadClickWindowMs:3e3,rageClickWindowMs:1e3,rageClickCount:5,errorClickWindowMs:3e3},performance:{enabled:!0,slowPageLcpThreshold:4e3,slowPageInpThreshold:500},form:{enabled:!0,fieldIdAttr:"data-field-id",formIdAttr:"data-form-id",longFocusThresholdMs:2e4,incompleteMinFieldRatio:.3,zigzagMinCount:2},navigation:{enabled:!0,backForwardAsStruggle:!0},custom:{enabled:!0,detector:void 0}},vm=new Set([p.JS_ERROR,p.PROMISE_ERROR,p.RESOURCE_ERROR,p.API_ERROR]),y=(new e({name:"struggleMonitor"}),new e({name:"struggleMonitor",instanceStates:new Map,onNewTdem:function(t){var r,n=this,e=!0===(e=this.$getConfig(t))?f({},gm):e&&"object"==typeof e?f(f(f({},gm),e),{click:f(f({},gm.click),e.click||{}),performance:f(f({},gm.performance),e.performance||{}),form:f(f({},gm.form),e.form||{}),navigation:f(f({},gm.navigation),e.navigation||{}),custom:f(f({},gm.custom),e.custom||{}),payloadAllowlist:(Array.isArray(e.payloadAllowlist)?e:gm).payloadAllowlist,enabled:!1!==e.enabled}):f(f({},gm),{enabled:!1});e.enabled&&(r={config:e,clickDetector:null,recentClicks:[],focusStartMap:new Map,formStateMap:new Map,removeDomListeners:[],onEventCreated:null,onDestroy:null},this.instanceStates.set(t,r),this.initClickDetector(t,r),this.initFormListeners(t,r),r.onEventCreated=function(e){n.handleEventCreated(t,r,e||[])},t.lifeCycle.on("tdemEventCreated",r.onEventCreated),r.onDestroy=function(){return n.cleanupInstance(t)},t.lifeCycle.on("destroy",r.onDestroy))},initClickDetector:function(t,r){var e,n=this;"undefined"!=typeof window&&"undefined"!=typeof document&&(r.clickDetector=new hm({slowClickTimeout:null!=(e=null==(e=r.config.click)?void 0:e.deadClickWindowMs)?e:3e3,slowClickThreshold:null!=(e=null==(e=r.config.click)?void 0:e.deadClickWindowMs)?e:3e3,rageClickCount:null!=(e=null==(e=r.config.click)?void 0:e.rageClickCount)?e:5,rageClickWindow:null!=(e=null==(e=r.config.click)?void 0:e.rageClickWindowMs)?e:1e3,onRageClick:function(e){n.onRageClick(t,r,e)},onSlowClick:function(e){n.onSlowClick(t,r,e)}}),r.clickDetector.start())},initFormListeners:function(n,i){var e,t,o=this;null!=(t=i.config.form)&&t.enabled&&"undefined"!=typeof document&&((t=function(e,t,r){void 0===r&&(r=!0),document.addEventListener(e,t,r),i.removeDomListeners.push(function(){document.removeEventListener(e,t,r)})})("focusin",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(n,i,p.FORM_FOCUS,e,e.form||void 0)}),t("focusout",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(n,i,p.FORM_BLUR,e,e.form||void 0)}),t("change",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(n,i,p.FORM_CHANGE,e,e.form||void 0)}),t("submit",function(e){e=e.target;e instanceof HTMLFormElement&&o.reportFormEvent(n,i,p.FORM_SUBMIT,null,e)}),t("invalid",function(e){var t,r,e=o.getTrackableField(e.target);e&&(r=e.form||void 0,r=o.buildFormBaseData(n,i,e,r),r={event_id:g(),event_type:p.FORM_SUBMIT_RESULT,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:"undefined"!=typeof window?window.location.href:(null==(t=n.getOriginFrom)?void 0:t.call(n))||"",data:f(f({},r),{event_name:"form_submit_fail",is_effective_action:!0,validation_message:e.validationMessage||void 0,event_properties:f(f({},r.event_properties||{}),{status:"fail",validation_code:!1===(null==(t=e.validity)?void 0:t.valid)?"invalid":"validation_error"})})},null!=(e=n.reportTDEMEvent))&&e.call(n,r)}),e=function(){o.reportPendingUncompletedForms(n,i,"pagehide")},"undefined"!=typeof window)&&(window.addEventListener("pagehide",e),i.removeDomListeners.push(function(){window.removeEventListener("pagehide",e)}))},getTrackableField:function(e){return!(e&&e instanceof Element)||!(e=e.closest("input, textarea, select"))||e instanceof HTMLInputElement&&["button","submit","reset","image","hidden"].includes(e.type)?null:e},buildFormBaseData:function(e,t,r,n){var r=r||null,n=n||(null==r?void 0:r.form)||void 0,i=(null==(i=t.config.form)?void 0:i.fieldIdAttr)||"data-field-id",t=(null==(t=t.config.form)?void 0:t.formIdAttr)||"data-form-id",i=r?r.getAttribute(i)||r.id||r.name||r.tagName.toLowerCase()+"_"+(r.type||"field"):void 0,t=n&&(n.getAttribute(t)||n.id||n.getAttribute("name")||n.getAttribute("action"))||void 0,o="string"==typeof(null==(o=r)?void 0:o.value)?r.value.length:0,o=0===o?"0":o<=10?"1_10":o<=50?"11_50":"51_plus";return{replay_id:et(e),is_effective_action:!0,form_id:t,field_id:i,tags:{},event_properties:{field_name:(null==r?void 0:r.name)||"",field_type:(null==r?void 0:r.type)||(null==(e=null==r?void 0:r.tagName)?void 0:e.toLowerCase())||"",form_name:(null==n?void 0:n.getAttribute("name"))||"",is_required:String(!(null==r||!r.required)),value_length_bucket:String(o)}}},reportFormEvent:function(e,t,r,n,i){var t=this.buildFormBaseData(e,t,n,i),i="undefined"!=typeof window?window.location.href:(null==(n=e.getOriginFrom)?void 0:n.call(e))||"",n={event_id:g(),timestamp:Date.now(),page_url:i};r!==p.FORM_FOCUS?r!==p.FORM_BLUR?r!==p.FORM_CHANGE?(i=f(f({},n),{event_type:p.FORM_SUBMIT,event_category:m.BEHAVIOR,data:f(f({},t),{submit_method:"native_submit"})}),null!=(r=e.reportTDEMEvent)&&r.call(e,i)):(r=f(f({},n),{event_type:p.FORM_CHANGE,event_category:m.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,r)):(i=f(f({},n),{event_type:p.FORM_BLUR,event_category:m.BEHAVIOR,data:t}),null!=(r=e.reportTDEMEvent)&&r.call(e,i)):(r=f(f({},n),{event_type:p.FORM_FOCUS,event_category:m.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,r))},onRageClick:function(e,t,r){var n=r.node.selector||r.node.tagName||"unknown",i=null!=(o=null==(o=t.config.click)?void 0:o.rageClickWindowMs)?o:1e3,o=t.recentClicks.filter(function(e){return r.timestamp-e.timestamp<=i}).map(function(e){return e.eventId}).filter(Boolean).slice(-10),n={type:"rage_click",ownerType:"element",ownerKey:n,pageUrl:window.location.href,triggerEventId:o[0],relatedEventIds:o.length?o:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{clickCount:r.clickCount,timeWindowMs:r.timeWindowMs,selector:r.node.selector||""}};null!=(o=e.reportStruggle)&&o.call(e,n)},onSlowClick:function(e,t,r){"timeout"===r.endReason&&(t={type:"dead_click",ownerType:"element",ownerKey:r.node.selector||r.node.tagName||"unknown",pageUrl:window.location.href,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{timeAfterClickMs:r.timeAfterClickMs,selector:r.node.selector||""}},null!=(r=e.reportStruggle))&&r.call(e,t)},handleEventCreated:function(r,n,e){var t,i=this,o=Date.now(),s=n.config.click||gm.click,a=Math.max(null!=(t=s.errorClickWindowMs)?t:3e3,null!=(t=s.rageClickWindowMs)?t:1e3,null!=(t=s.deadClickWindowMs)?t:3e3);n.recentClicks=n.recentClicks.filter(function(e){return o-e.timestamp<=a}),e.forEach(function(e){var t;e&&e.event_type!==p.STRUGGLE&&(e.event_type===p.CLICK?(t=(null==(t=e.data)?void 0:t.target_element)||(null==(t=e.data)?void 0:t.target_id)||(null==(t=e.data)?void 0:t.target_class)||"unknown",n.recentClicks.push({eventId:e.event_id,timestamp:e.timestamp||o,pageUrl:e.page_url||"",ownerKey:t})):vm.has(e.event_type)?i.tryReportErrorClick(r,n,e):e.event_type===p.PAGE_LOAD||e.event_type===p.true?i.tryReportSlowPage(r,n,e):e.event_type===p.FORM_FOCUS?(i.trackFormFocus(n,e),i.trackFormChangeAndZigzag(r,n,e)):e.event_type===p.FORM_CHANGE?i.trackFormChangeAndZigzag(r,n,e):e.event_type===p.FORM_BLUR?i.tryReportLongFocusTime(r,n,e):e.event_type===p.FORM_SUBMIT?i.trackFormSubmitResult(n,e):e.event_type===p.FORM_SUBMIT_RESULT?(i.trackFormSubmitResult(n,e),i.tryReportFormValidationError(r,n,e)):e.event_type===p.PAGE_VIEW&&null!=(t=null==(t=e.data)?void 0:t.event_properties)&&t.navigation_type&&i.tryReportBackForward(r,n,e),i.tryReportCustomStruggle(r,n,e))})},getFormStateKey:function(e,t){return e||t||"unknown_form"},ensureFormState:function(e,t,r){var n=this.getFormStateKey(t,r);return e.formStateMap.has(n)||e.formStateMap.set(n,{formId:t||n,pageUrl:r||"",touchedFieldIds:new Set,requiredFieldIds:new Set,changedFieldIds:new Set,focusPath:[],zigzagHits:0,hasSuccessSubmit:!1,reportedZigzag:!1,reportedUncompleted:!1}),e.formStateMap.get(n)},recordFormTouch:function(e,t){var r,e=this.ensureFormState(e,null==(e=null==t?void 0:t.data)?void 0:e.form_id,null==t?void 0:t.page_url),n=String((null==(n=null==t?void 0:t.data)?void 0:n.field_id)||"");return n&&(e.touchedFieldIds.add(n),!0===(null==(r=t.data)?void 0:r.is_required)&&e.requiredFieldIds.add(n),t.event_type===p.FORM_CHANGE)&&e.changedFieldIds.add(n),null!=t&&t.page_url&&(e.pageUrl=t.page_url),e},trackFormFocus:function(e,t){var r,n=t,i=String((null==(i=null==n?void 0:n.data)?void 0:i.field_id)||"");i&&((r=this.recordFormTouch(e,n)).focusPath.push(i),12<r.focusPath.length&&r.focusPath.shift(),e.focusStartMap.set(i,{timestamp:t.timestamp||Date.now(),eventId:t.event_id,formId:null==(r=null==n?void 0:n.data)?void 0:r.form_id,pageUrl:null==n?void 0:n.page_url}))},trackFormChangeAndZigzag:function(e,t,r){var n,i,o,s,a;r.event_type!==p.FORM_CHANGE?r.event_type!==p.FORM_FOCUS||(a=(i=this.recordFormTouch(t,n=r)).focusPath).length<4||i.reportedZigzag||(o=(a=a.slice(-4))[0],s=a[1],!o)||!s||o===s||o!==a[2]||s!==a[3]||i.changedFieldIds.size<2||(i.zigzagHits+=1,a=null!=(s=null==(o=t.config.form)?void 0:o.zigzagMinCount)?s:2,i.zigzagHits<a)||(i.reportedZigzag=!0,null==(o=e.reportStruggle))||o.call(e,{type:"form_zigzag",ownerType:"form",ownerKey:i.formId,pageUrl:i.pageUrl,formId:i.formId,fieldId:String((null==(s=null==n?void 0:n.data)?void 0:s.field_id)||""),triggerEventId:n.event_id,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{zigzag_hits:i.zigzagHits,changed_field_count:i.changedFieldIds.size}}):this.recordFormTouch(t,r)},trackFormSubmitResult:function(e,t){t.event_type!==p.FORM_SUBMIT&&t.event_type!==p.FORM_SUBMIT_RESULT||((e=this.recordFormTouch(e,t)).lastSubmitEventId=t.event_id,t.event_type!==p.FORM_SUBMIT_RESULT)||"success"===(null==(t=null==(t=t.data)?void 0:t.event_properties)?void 0:t.status)&&(e.hasSuccessSubmit=!0)},reportPendingUncompletedForms:function(t,r,n){var i=this;r.formStateMap.forEach(function(e){i.tryReportUncompletedForm(t,r,e,n)})},tryReportUncompletedForm:function(e,t,r,n){var i,o,s,a;r.reportedUncompleted||r.hasSuccessSubmit||0===r.touchedFieldIds.size||(s=0<(o=r.requiredFieldIds.size)?o:r.touchedFieldIds.size)<=0||(s=r.changedFieldIds.size/s)<(a=null!=(a=null==(a=t.config.form)?void 0:a.incompleteMinFieldRatio)?a:.3)||(r.reportedUncompleted=!0,null==(i=e.reportStruggle))||i.call(e,{type:"uncompleted_form",ownerType:"form",ownerKey:r.formId,pageUrl:r.pageUrl,formId:r.formId,triggerEventId:r.lastSubmitEventId,relatedEventIds:r.lastSubmitEventId?[r.lastSubmitEventId]:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{touched_field_count:r.touchedFieldIds.size,changed_field_count:r.changedFieldIds.size,required_field_count:o,changed_ratio:Number(s.toFixed(4)),threshold_ratio:a}})},tryReportLongFocusTime:function(e,t,r){var n,i,o,s,a=String((null==(a=null==r?void 0:r.data)?void 0:a.field_id)||"");a&&(i=t.focusStartMap.get(a))&&(t.focusStartMap.delete(a),o=null!=(o=null==(o=t.config.form)?void 0:o.longFocusThresholdMs)?o:2e4,(s=Math.max((r.timestamp||Date.now())-i.timestamp,0))<o||null==(n=e.reportStruggle)||n.call(e,{type:"long_focus_time",ownerType:"field",ownerKey:a,pageUrl:(null==r?void 0:r.page_url)||i.pageUrl,formId:(null==(n=null==r?void 0:r.data)?void 0:n.form_id)||i.formId,fieldId:a,triggerEventId:r.event_id,relatedEventIds:[i.eventId||"",r.event_id].filter(Boolean),detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{focus_duration_ms:s,threshold_ms:o}}))},tryReportErrorClick:function(e,t,r){var n,i,o;t.recentClicks.length&&(i=null!=(o=(t.config.click||gm.click).errorClickWindowMs)?o:3e3,o=B(t.recentClicks).reverse().find(function(e){return 0<=r.timestamp-e.timestamp&&r.timestamp-e.timestamp<=i}))&&null!=(n=e.reportStruggle)&&n.call(e,{type:"error_click",ownerType:"element",ownerKey:o.ownerKey,pageUrl:o.pageUrl||r.page_url,triggerEventId:o.eventId,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{errorEventType:r.event_type}})},tryReportSlowPage:function(e,t,r){var n,i,o,s=t.config.performance||gm.performance;s.enabled&&(i=(null==(i=r.data)?void 0:i.measurements)||{},n=Number(i.lcp||0),i=Number(i.inp||0),o=null!=(o=s.slowPageLcpThreshold)?o:4e3,s=null!=(s=s.slowPageInpThreshold)?s:500,o<=n||s<=i)&&null!=(o=e.reportStruggle)&&o.call(e,{type:"slow_page",ownerType:"page",ownerKey:r.page_url||("undefined"!=typeof window?window.location.href:""),pageUrl:r.page_url,triggerEventId:r.event_id,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{lcp:n,inp:i,sourceEventType:r.event_type}})},tryReportFormValidationError:function(e,t,r){var n,i,o,s=null==(s=null==r?void 0:r.data)?void 0:s.event_properties;"fail"===String((null==s?void 0:s.status)||"")&&(i=null!=s&&s.field_id?"field":"form",o=String((null==s?void 0:s.field_id)||"")||String((null==s?void 0:s.form_id)||"")||(null==r?void 0:r.page_url)||"unknown",null!=(n=e.reportStruggle))&&n.call(e,{type:"form_validation_error",ownerType:i,ownerKey:o,pageUrl:null==r?void 0:r.page_url,formId:String((null==s?void 0:s.form_id)||""),fieldId:String((null==s?void 0:s.field_id)||""),triggerEventId:r.event_id,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{validation_code:null==s?void 0:s.validation_code,validation_message:null==(n=null==r?void 0:r.data)?void 0:n.validation_message,sourceEventType:r.event_type}})},tryReportBackForward:function(e,t,r){var n,i,o=t.config.navigation||gm.navigation;o.enabled&&o.backForwardAsStruggle&&(r=null==(r=null==(o=r)?void 0:o.data)?void 0:r.event_properties,"back"!==(i=String((null==r?void 0:r.navigation_type)||""))&&"forward"!==i||null==(n=e.reportStruggle)||n.call(e,{type:"back_forward",ownerType:"page",ownerKey:String((null==r?void 0:r.to_page)||"")||(null==o?void 0:o.page_url)||"unknown",pageUrl:null==o?void 0:o.page_url,triggerEventId:o.event_id,relatedEventIds:[o.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{navigation_type:i,from_page:null==r?void 0:r.from_page,to_page:null==r?void 0:r.to_page}}))},tryReportCustomStruggle:function(r,n,i){var e=n.config.custom||gm.custom;e.enabled&&"function"==typeof e.detector&&(e=e.detector({event:i,tdem:r}),(Array.isArray(e)?e:e?[e]:[]).forEach(function(e){var t,e=f(f({},e),{type:(null==e?void 0:e.type)||"custom_struggle",ownerType:(null==e?void 0:e.ownerType)||"app",ownerKey:(null==e?void 0:e.ownerKey)||i.page_url||"custom",ruleVersion:(null==e?void 0:e.ruleVersion)||n.config.ruleVersion,payloadAllowlist:(null==e?void 0:e.payloadAllowlist)||n.config.payloadAllowlist,detectionSource:(null==e?void 0:e.detectionSource)||"custom"});null!=(t=r.reportStruggle)&&t.call(r,e)}))},cleanupInstance:function(e){var t=this.instanceStates.get(e);t&&(t.onEventCreated&&e.lifeCycle.remove("tdemEventCreated",t.onEventCreated),t.onDestroy&&e.lifeCycle.remove("destroy",t.onDestroy),t.clickDetector&&t.clickDetector.stop(),this.reportPendingUncompletedForms(e,t,"destroy"),t.focusStartMap.clear(),t.formStateMap.clear(),t.removeDomListeners.forEach(function(e){return e()}),t.removeDomListeners=[],this.instanceStates.delete(e))},destroy:function(){var r=this;this.instanceStates.forEach(function(e,t){r.cleanupInstance(t)}),this.instanceStates.clear()}}));function ym(e){return e._tdemSampleGate||null}function wm(e,t,r){e=ym(e);e?!r||t<=0?e.decide(!1):100<=t?e.decide(!0):(r=100*Math.random()<t,e.decide(r)):console.warn("[TDEM] Sample gate not found")}function bm(e,t){var r=ym(e);!(r&&r.isDecided&&r.isSampled)||t<=0?e._replaySampled=!1:100<=t?e._replaySampled=!0:(r=100*Math.random(),e._replaySampled=r<t)}function Sm(d,h){var p;L(this,void 0,void 0,function(){var o,s,a,l,c,u;return F(this,function(e){switch(e.label){case 0:if(!(o=d.config.id))return Cm(d,o,h),[2];if(r=d.config.apiUrl||d.config.url,!(s=r?r.replace(/\/+$/,"")+"/api/v1/config":""))return Cm(d,o,h),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:o})})];case 2:if((a=e.sent()).ok)return[4,a.json()];throw new Error("HTTP "+a.status);case 3:if(0===(a=e.sent()).code&&a.data){u=a.data.tdem_sample_rate,l=null!=(p=a.data.replay_sample_rate)?p:1,c=a.data.enabled;var t=o,r=u,n=l;try{var i={projectKey:t,sampleRate:r,replaySampleRate:n,timestamp:Date.now()};localStorage.setItem("TDEM_SAMPLE_CONFIG",JSON.stringify(i))}catch(t){}return h._cachedSampleRate=u,h._cachedReplaySampleRate=l,wm(d,u,c),bm(d,l),[3,5]}throw new Error("API error: code="+a.code);case 4:return u=e.sent(),console.warn("[TDEM] Failed to fetch remote config:",u),Cm(d,o,h),[3,5];case 5:return[2]}var r})})}function Cm(e,t,r){var n=ym(e);n&&((t=t?(e=>{try{var t,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?(t=JSON.parse(r)).projectKey===e&&Date.now()-t.timestamp<6048e5?t:null:null}catch(e){return null}})(t):null)?(console.info("[TDEM] Using cached config, sampleRate:",t.sampleRate,"replaySampleRate:",t.replaySampleRate),r._cachedSampleRate=t.sampleRate,r._cachedReplaySampleRate=t.replaySampleRate,wm(e,t.sampleRate,0<t.sampleRate),bm(e,t.replaySampleRate)):(console.warn("[TDEM] No cached config, default to not report"),n.decide(!1),e._replaySampled=!1))}S=new e({name:"tdemConfig",_cachedSampleRate:null,_cachedReplaySampleRate:null,onNewTdem:function(e){var t=this;Sm(e,this),e.lifeCycle.on("sessionRefreshed",function(){t.onSessionRefreshed(e)})},onSessionRefreshed:function(e){var t,r=ym(e);r&&r.isDecided&&null!=(t=this._cachedSampleRate)&&((r=r.reDecide(t))?bm(e,null!=(t=this._cachedReplaySampleRate)?t:1):e._replaySampled=!1,console.info("[TDEM] Session refreshed, session="+r+", replay="+e._replaySampled))}});return n.use(Zt),n.use(Bt),n.use(rt),n.use(tn),n.use($r),n.use(wn),n.use(r),n.use(nn),n.use(vn),n.use(Jt),n.use($t),n.use(b),n.use(y),n.use(Ut),n.use(S),n});
10
+ ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TDEM=t()})(this,function(){var T,R;function x(e){this.name="__st"+(1e9*Math.random()>>>0)+T+"__",null!=e&&e.forEach(this.add,this),T+=1}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{configurable:!0,writable:!0,value:function(e){if(null===this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i+=1}}}),window.WeakSet||(T=Date.now()%1e9,x.prototype.add=function(e){var t=this.name;return e[t]||Object.defineProperty(e,t,{value:!0,writable:!0}),this},x.prototype.delete=function(e){return!!e[this.name]&&!(e[this.name]=void 0)},x.prototype.has=function(e){return!!e[this.name]},R=x,Object.defineProperty(window,"WeakSet",{value:function(e){return new R(e)}})),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++)if(null!=(r=arguments[n]))for(var r=Object(r),i=Object.keys(Object(r)),o=0,a=i.length;o<a;o++){var s=i[o],l=Object.getOwnPropertyDescriptor(r,s);null!=l&&l.enumerable&&(t[s]=r[s])}return t}});var O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},f=function(){return(f=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 M(e,a,s,l){return new(s=s||Promise)(function(n,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}o((l=l.apply(e,a||[])).next())})}function I(r,i){var o,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!((s=0<(s=l.trys).length&&s[s.length-1])||6!==t[0]&&2!==t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=i.call(r,l)}catch(e){t=[6,e],a=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function A(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function P(e,t){return void 0===t&&(t="https://dem.rumt-zh.com"),t=(e.url||"").replace(/\/+$/,"")||("string"==typeof t?t:"https://dem.rumt-zh.com"),e.url=t,e.hostUrl=t,e.offlineUrl=t+"/offline",e.whiteListUrl=t+"/collect/whitelist",e.pvUrl=t+"/collect/pv",e.eventUrl=t+"/collect/events",e.speedUrl=t+"/speed",e.customTimeUrl=t+"/speed/custom",e.performanceUrl=t+"/speed/performance",e.performanceUrlForHippy=t+"/speed/hippyPerformance",e.webVitalsUrl=t+"/speed/webvitals",e.setDataReportUrl=t+"/speed/miniProgramData",e}function L(e){try{return localStorage.getItem(e)}catch(e){return null}}function D(e,t){try{localStorage.setItem(e,t)}catch(e){}}function F(e,t){try{return e?JSON.parse(e):t}catch(e){return t}}var U,B=/_?t(\d)?(imestamp)?=\d+&?/g,z=["aegis.qq.com","tamaegis.com","/aegis-sdk","rumt-","/flog.core.min.js","pingfore.qq.com","pingfore.tencent.com","zhiyan.tencent-cloud.net","h.trace.qq.com","btrace.qq.com","beacon.qq.com","dmplog.qq.com","qq.com/report","svibeacon.onezapp.com","cube.weixinbridge.com","doubleclick.net","pcmgrmonitor.3g.qq.com","tdm.qq.com","report.qqweb.qq.com","tpstelemetry.tencent.com","galileotelemetry.tencent.com","insight.cloud.tencent.com","facebook.com","facebook.net","google","yahoo.com","twitter.com","ga-audiences","report.idqqimg.com","arms-retcode.aliyuncs.com","px.effirst.com","sentry","baidu.com","hot-update.json","u.c.b.r.o.w.s.e.r","report.url.cn","sockjs-node","m3u8","flv"],j=["ResizeObserver loop limit exceeded","ResizeObserver loop completed","Failed to execute 'transaction'","window.indexedDB.deleteDatabase is not a function"],H=["ext1","ext2","ext3","ext4","ext5","ext6","ext7","ext8","ext9","ext10","level","trace","tag","seq","code"],W=["static","fetch"],G="unknown",q=(V.prototype.indexOf=function(e,t){for(var n=0;n<e.length;n++)if(e[n].callback===t)return n;return-1},V.prototype.on=function(e,t,n){var r;if(void 0===n&&(n=0),this)return(r=this.eventsList[e])||(this.eventsList[e]=[],r=this.eventsList[e]),-1===this.indexOf(r,t)&&r.push({name:e,type:n||0,callback:t}),this},V.prototype.one=function(e,t){this.on(e,t,1)},V.prototype.remove=function(e,t){if(this){var n=this.eventsList[e];if(n){if(t)return n.length&&(t=this.indexOf(n,t),n.splice(t,1)),this;try{delete this.eventsList[e]}catch(e){}}return null}},V.prototype.clear=function(){this.eventsList={}},V);function V(){var a=this;this.emit=function(e,t){if(a){var n;if(null!=(r=a.eventsList[e])&&r.length)for(var r=r.slice(),i=0;i<r.length;i++){n=r[i];try{var o=n.callback.apply(a,[t]);if(1===n.type&&a.remove(e,n.callback),!1===o)break}catch(e){throw e}}return a}},this.eventsList={}}(e=U=U||{})[e.number=-1]="number",e.string="";function Z(e,t){return"number"==typeof e||"string"==typeof e?e:t?U.string:U.number}function K(e,t){return"string"==typeof e?e.split("?")[t?1:0]||"":e}function J(e,t){return void 0===t&&(t=2048),String(e).replace(B,"").slice(0,t)}function X(e){return"string"==typeof e&&/^\//.test(e)?"https:"===(null==location?void 0:location.protocol):/^https/.test(e)}function $(e,t,n){var r,i,o;try{if("function"==typeof(null==t?void 0:t.retCodeHandler))return{code:void 0===(o=(i=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code)?G:o,isErr:i.isErr};if(!(e="string"==typeof e?JSON.parse(e):e))return{code:G,isErr:!1};"function"==typeof(null==(r=null==t?void 0:t.ret)?void 0:r.join)&&(le=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var a=Object.getOwnPropertyNames(e).filter(function(e){return-1!==le.indexOf(e.toLowerCase())});return a.length?{code:""+(o="未知"!==(o=e[a[0]])&&""!==o?o:G),isErr:0!==o&&"0"!==o&&o!==G}:{code:G,isErr:!1}}catch(e){return{code:G,isErr:!1}}}function ee(e,t,n){try{var r="function"==typeof t?t(e,null==n?void 0:n.url,null==n?void 0:n.ctx)||"":e;return de(r).slice(0,10240)}catch(e){return""}}function te(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,ue(),2)||"undefined").replace(/"/gim,""):JSON.stringify(e,ue(),2)||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}}function ne(e,t){var n,r={fetch:[],static:[],bridge:[]},i=new FormData;return Array.isArray(e)?e.forEach(function(e){var t=pe(e);r[e.type].push(t)}):(n=pe(e),r[e.type].push(n)),i.append("payload",ce(f({duration:r},t))),i}function re(t,e){return"string"!=typeof t||!t||e&&-1<t.indexOf(e)||me.test(t)||z.some(function(e){return-1<t.indexOf(e)})}var oe,ae=["application/xhtml+xml","application/xml","application/pdf","application/pkcs12","application/javascript","application/x-javascript","application/ecmascript","application/vnd.mspowerpoint","application/vnd.apple.mpegurl","application/ogg","text/css","text/javascript","image","audio","video","video/mp2t"],se=/\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/i,le=["ret","retcode","code","errcode"],ue=function(){var n=new WeakSet;return function(e,t){if(t instanceof Error)return"Error.message: "+t.message+" \n Error.stack: "+t.stack;if("object"==typeof t&&null!==t){if(n.has(t))return"[Circular "+(e||"root")+"]";n.add(t)}return t}},ce=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e,ue())||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}},de=function(n,r){void 0===r&&(r=3);var i,o,a,s="";return Array.isArray(n)?(s+="[",i=n.length,n.forEach(function(e,t){s=(s+="object"==typeof e&&1<r?de(e,r-1):fe(e))+(t===i-1?"":",")}),s+="]"):n instanceof Object||"object"==typeof n?(s="{",o=Object.keys(n),a=o.length,o.forEach(function(e,t){"object"==typeof n[e]&&1<r?s+='"'+e+'":'+de(n[e],r-1):s+=he(e,n[e]),s+=t===a-1||t<a-1&&void 0===n[o[t+1]]?"":","}),s+="}"):s+=n,s},he=function(e,t){var n=typeof t,r="";return"string"==n||"object"==n?r+='"'+e+'":"'+t+'"':"function"==typeof t?r+='"'+e+'":"function '+t.name+'"':"symbol"==typeof t?r+='"'+e+'":"symbol"':"number"!=typeof t&&"boolean"!=n||(r+='"'+e+'": '+t),r},fe=function(e){var t=typeof e;return""+("undefined"==t||"symbol"==t||"function"==t?"null":"string"==t||"object"==t?'"'+e+'"':e)},pe=function(t){var n;return t.payload?(n={},Object.keys(t).forEach(function(e){"payload"!==e&&(n[e]=t[e])}),n):t},me=/data:(image|text|application|font)\/.*;base64/;(e=oe=oe||{}).LOG="log",e.SPEED="speed",e.PERFORMANCE="performance",e.OFFLINE="offline",e.WHITE_LIST="whiteList",e.VITALS="vitals",e.PV="pv",e.CUSTOM_PV="customPV",e.EVENT="event",e.CUSTOM="custom",e.SDK_ERROR="sdkError",e.SET_DATA="setData",e.LOAD_PACKAGE="loadPackage",e.MEMORY="memory";var ge,p,m,ve={maxAttempts:3,delays:[0,1e3,3e3]};function g(){return"evt_"+Date.now()+"_"+Math.random().toString(36).substring(2,8)}function ye(e){var t=[];if(e.stack)for(var n=0,r=0,i=e.stack.split("\n");r<i.length;r++){var o,a,s,l,u,c=i[r],d=c.match(/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/);d?(o=d[1],a=d[2],s=d[3],l=d[4],u=a.split("/").pop()||a,t.push({abs_path:a,colno:parseInt(l,10),filename:u,function:o||"(anonymous)",lineno:parseInt(s,10),in_app:a.includes("node_modules")||a.includes("cdn")?0:1,stack_level:n++})):(d=c.match(/at\s+(.+?):(\d+):(\d+)/))&&(a=d[1],s=d[2],l=d[3],u=a.split("/").pop()||a,t.push({abs_path:a,colno:parseInt(l,10),filename:u,function:"(anonymous)",lineno:parseInt(s,10),in_app:a.includes("node_modules")||a.includes("cdn")?0:1,stack_level:n++}))}return t}(e=ge=ge||{}).production="production",e.development="development",e.gray="gray",e.pre="pre",e.daily="daily",e.local="local",e.test="test",e.others="others",(e=p=p||{}).JS_ERROR="js_error",e.PROMISE_ERROR="promise_error",e.RESOURCE_ERROR="resource_error",e.API_ERROR="api_error",e.PAGE_LOAD="page_load",e.RESOURCE_LOAD="resource_load",e.API_CALL="api_call",e.true="web_vitals",e.CLICK="click",e.PAGE_VIEW="page_view",e.TAB_HIDDEN="tab_hidden",e.TAB_VISIBLE="tab_visible",e.WINDOW_BLUR="window_blur",e.WINDOW_FOCUS="window_focus",e.FORM_FOCUS="form_focus",e.FORM_BLUR="form_blur",e.FORM_CHANGE="form_change",e.FORM_SUBMIT="form_submit",e.FORM_SUBMIT_RESULT="form_submit_result",e.STRUGGLE="struggle",e.CUSTOM="custom",e.LOG="log",(e=m=m||{}).ERROR="error",e.PERFORMANCE="performance",e.BEHAVIOR="behavior",e.NETWORK="network",e.LOG="log",e.CUSTOM="custom";function we(u,c){return function(i,o){var s,a,l,e,t,n;null!=i&&i.log&&null!=i&&i.type?(s=function(e,t){var n,r,t=f(f({},u.bean),{from:t}),i=f({},u.bean);return(()=>{try{return"undefined"!=typeof FormData&&"function"==typeof FormData.prototype.append}catch(e){}})()?ne(e,t):(t=e,e=i,r={fetch:[],static:[],bridge:[]},i={},Array.isArray(t)?t.forEach(function(e){var t;null!=(t=r[e.type])&&t.push(e)}):null!=(n=r[t.type])&&n.push(t),i.payload=JSON.stringify(f({duration:r},e)),i)},a=function(e,t,n,r){switch(t){case oe.LOG:o=e;var i=(Array.isArray(o)?o:[o]).map(function(n){return Object.getOwnPropertyNames(n).reduce(function(e,t){return"ctx"!==t&&(e[t]=n[t]),e},{level:"2",msg:""})});if(!i||0===i.length)return"{}";i=Array.isArray(i)?i:[i];var o=Array.from(new Set(i.flatMap(function(e){return Object.keys(e)}))),a={};return o.forEach(function(t){a[t]=i.map(function(e){return e[t]||""})}),a.count=i.length,ce(a);case oe.SPEED:return s(e,n);case oe.EVENT:return r;default:return r||{}}var o},1!==(e=Array.isArray(i.log)?i.log:[i.log]).length?(l={},e.forEach(function(e){var t=e.from||"undefined";delete e.from,l[t]||(l[t]=[]),l[t].push(e)}),Object.keys(l).forEach(function(e){var t,n=l[e],r=null!=(r=i.url)&&r.includes("?")?"&":"?";"undefined"===e?(t=""+i.url,o(f(f({},i),{url:t,log:1===n.length?n[0]:n,data:a(n,c,e,i.data)}))):(t=i.url+r+"from="+e,o(f(f({},i),{url:t,log:1===n.length?n[0]:n,beanFilter:A(i.beanFilter||[],["from"]),data:a(n,c,e,i.data)})))})):(t=(e=e[0]).from,delete e.from,n=null!=(n=i.url)&&n.includes("?")?"&":"?",t?(n=i.url+n+"from="+t,o(f(f({},i),{url:n,log:e,beanFilter:A(i.beanFilter||[],["from"]),data:a(e,c,t,i.data)}))):(n=""+i.url,o(f(f({},i),{url:n,log:e,data:a(e,c,t,i.data)}))))):o(i)}}function be(l,u){return function(e,t){var n,r,i,o=Array.isArray(e),a=o?e:[e],s=(l.lifeCycle.emit("beforeRequest",e),l.config.beforeRequest);(a="function"==typeof s?a.map(function(t){try{var e=s({logs:t,logType:u});return(null==e?void 0:e.logType)===u&&null!=e&&e.logs?e.logs:!1!==e&&t}catch(e){return t}}).filter(function(e){return!1!==e}):a).length&&(n=a,e=H,!Array.isArray(n)||n.length<=1||(r=[],i=[],!(i="string"==typeof e?[e]:e))||i.length<=0||(i.forEach(function(t){n.forEach(function(e){null!=e&&e[t]&&r.push(t)})}),0<r.length&&(n=n.map(function(e){var t={};return r.forEach(function(e){t[e]=""}),f(f({},t),e)}))),a=n,t(o?a:a[0]))}}function ke(i){return function(e,t){i.lifeCycle.emit("modifyRequest",e);var n=i.config.modifyRequest;if("function"==typeof n)try{var r=n(e);"object"==typeof r&&"url"in r&&(e=r)}catch(e){console.error(e)}t(e)}}function Se(r){return function(e,t){null!=(n=r.lifeCycle)&&n.emit("afterRequest",e);var n=(r.config||{}).afterRequest;"function"==typeof n&&!1===n(e)||t(e)}}var _e=function(e){return e.filter(function(n,r){return"static"!==n.type||!e.find(function(e,t){return n.url===e.url&&200===n.status&&r<t})})},Ee={},Ce={},Te=function(e){return Ee[e]||(Ee[e]=setTimeout(function(){Ce[e]={},Ee[e]=null},6e4)),Ee[e]},Re={generateTraceId:Oe(16),generateSpanId:Oe(8)},xe=Array(32);function Oe(t){return function(){for(var e=0;e<2*t;e++)xe[e]=Math.floor(16*Math.random())+48,58<=xe[e]&&(xe[e]+=39);return String.fromCharCode.apply(null,xe.slice(0,2*t))}}function Me(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}function Fe(){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)})}function Ue(e){for(var t,n,r,i="",o=0,a=(e=String(e)).length%3;o<e.length;){if(255<(t=e.charCodeAt(o++))||255<(n=e.charCodeAt(o++))||255<(r=e.charCodeAt(o++)))throw new TypeError("Failed to execute 'btoa': The string to be encoded contains characters outside of the Latin1 range.");i+=je.charAt((t=t<<16|n<<8|r)>>18&63)+je.charAt(t>>12&63)+je.charAt(t>>6&63)+je.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function Be(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!He.test(e))throw new TypeError("Failed to execute 'atob': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,r,i="",o=0;o<e.length;)t=je.indexOf(e.charAt(o++))<<18|je.indexOf(e.charAt(o++))<<12|(n=je.indexOf(e.charAt(o++)))<<6|(r=je.indexOf(e.charAt(o++))),i+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}function ze(e){var t,n="";return n="object"==typeof e&&(t=(e=((e,t)=>{for(var n=0;n<t.length;n++){var r=t[n],i=e[r]||"function"==typeof e.get&&e.get(r);if(i)return[r,i]}return["",""]})(e,Object.keys(Ge)))[0])?Ge[t](e[1]):n}var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",He=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,We=(qe.prototype.generate=function(e,t,n){if(void 0===t&&(t={}),this.url=e,!this.isUrlIgnored()&&this.isUrlInTraceUrls()&&this.traceType){switch(this.traceType){case"traceparent":this.traceId=this.createTraceparent();break;case"b3":this.traceId=this.createB3();break;case"sw8":this.traceId=this.createSw8(n);break;case"sentry-trace":this.traceId=this.createSentryTrace();break;default:return console.warn("this trace key "+this.traceType+" is not supported"),void(this.traceId="")}return t[this.traceType]&&(this.traceId=t[this.traceType]),{name:this.traceType,value:this.traceId}}},qe.prototype.createTraceparent=function(){var e=Re.generateSpanId();return"00-"+Re.generateTraceId()+"-"+e+"-0"+this.traceFlag.toString(16)},qe.prototype.createB3=function(){var e=Re.generateSpanId();return Re.generateTraceId()+"-"+e+"-"+this.traceFlag},qe.prototype.createSw8=function(e){var t="function"==typeof btoa?btoa:Ue,e=e||{},n=e.host,n=void 0===n?"":n,e=e.pathname,e=void 0===e?"":e,r=Fe(),i=Fe();return"1-"+String(t(i))+"-"+String(t(r))+"-1-"+String(t("tdem"))+"-"+String(t("1.0.7"))+"-"+String(t(encodeURI(e)))+"-"+String(t(n))},qe.prototype.createSentryTrace=function(){var e=Me().substring(16);return Me()+"-"+e+"-"+this.traceFlag},qe.prototype.isUrlIgnored=function(){if(Array.isArray(this.ignoreUrls)&&0!==this.ignoreUrls.length)for(var e=0,t=this.ignoreUrls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}return!1},qe.prototype.isUrlInTraceUrls=function(){if(!this.urls)return!0;if(Array.isArray(this.urls)){if(0===this.urls.length)return!1;for(var e=0,t=this.urls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}}return!1},qe.prototype.urlMatches=function(e,t){return"string"==typeof t?e===t:!!e.match(t)},qe),Ge={sw8:function(e){var t="function"==typeof atob?atob:Be,e=e.split("-")[1];return e?t(e):""},traceparent:function(e){return e.split("-")[1]},b3:function(e){return e.split("-")[0]},"sentry-trace":function(e){return e.split("-")[0]}};function qe(e,t,n,r){void 0===n&&(n=null),this.traceType=e,this.ignoreUrls=t,this.urls=n,this.traceFlag=null==r?1:Number(!!r)}function Ve(l){return function(e){e&&0!==e.length&&l.sendPipeline([function(t,e){var n,r,i,o,a={protocol_version:2,project_key:String(l.config.id||""),sdk:{name:l.sdkName,version:l.sdkVersion},app:{version:String(l.config.version||"1.0.0")},context:(n=l,r=String((null==(a=null==(a=null==(r=n.sessionManager)?void 0:r.getSession)?void 0:a.call(r))?void 0:a.id)||n.bean.sessionId||""),a=String(n.config.userId||n.config.uin||""),r={session_id:r,platform:(r=String(n.runtimePlatform||n.config.platform||"web").trim().toLowerCase(),["web","miniprogram","android","ios","electron","unknown"].includes(r)?r:["wx","my","qq","tt"].includes(r)?"miniprogram":"undefined"!=typeof window?"web":"unknown")},a&&(r.user_id=a),a=n.bean.runtime?String(n.bean.runtime):"",s=n.bean.processType?String(n.bean.processType):"",i=void 0!==n.bean.windowId?String(n.bean.windowId):"",o=void 0!==n.bean.webContentsId?String(n.bean.webContentsId):"",n=n.bean.appVersion?String(n.bean.appVersion):"",a&&(r.runtime=a),s&&(r.process_type=s),i&&(r.window_id=i),o&&(r.web_contents_id=o),n&&(r.app_version=n),"undefined"!=typeof navigator&&(r.user_agent=navigator.userAgent,r.language=navigator.language),"undefined"!=typeof screen&&(r.screen_resolution=screen.width+"x"+screen.height),r),events:t},s=String(l.config.url||"").replace(/\/+$/,"");s&&e({url:s+"/api/v1/collect/events",data:JSON.stringify(a),method:"POST",contentType:"application/json",addBean:!1,type:oe.EVENT,log:t,success:function(){l.lifeCycle.emit("afterReport",{success:!0,events:t})},fail:function(e){l.lifeCycle.emit("afterReport",{success:!1,error:e,events:t})}})}],oe.EVENT)(e)}}function Ze(n){if(n&&n.reduce&&n.length)return 1===n.length?function(e,t){n[0](e,t||Je)}:n.reduce(function(n,r){return function(e,t){return void 0===t&&(t=Je),n(e,function(e){return null==r?void 0:r(e,t)})}});throw new TypeError("createPipeline need at least one function param")}function Ke(t,n){Object.getOwnPropertyNames(t).forEach(function(e){"function"==typeof t[e]&&"constructor"!==e&&(n?n[e]="sendPipeline"===e?function(){return function(){}}:function(){}:t[e]=function(){})})}var Je=function(){},Xe={rage_click:3,dead_click:4,error_click:4,form_validation_error:3,slow_page:3,back_forward:2,long_focus_time:2,form_zigzag:2,uncompleted_form:3,custom_struggle:3},$e={rage_click:4,dead_click:5,error_click:5,form_validation_error:4,slow_page:4,back_forward:3,long_focus_time:3,form_zigzag:3,uncompleted_form:3,custom_struggle:3},Ye=(u.use=function(e){-1===u.installedPlugins.indexOf(e)&&e.tdemPlugin&&u.installedPlugins.push(e)},u.unuse=function(e){e=u.installedPlugins.indexOf(e);-1!==e&&u.installedPlugins.splice(e,1)},u.prototype.getInternalTransport=function(){return this.internalTransport},u.prototype.setInternalTransport=function(e){this.internalTransport=e},u.prototype.getInternalRetrySchedule=function(){return this.internalRetrySchedule},u.prototype.transportRequest=function(t,n){return M(this,void 0,void 0,function(){return I(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,this.internalTransport.request(t,n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t}]}})})},u.prototype.transportHandoff=function(t,n){return M(this,void 0,void 0,function(){return I(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,(this.internalTransport.handoff||this.internalTransport.request).call(this.internalTransport,f(f({},t),{handoff:!0}),n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t,handoffAccepted:!0}]}})})},u.prototype.init=function(e){this.setConfig(e),this.config=P(this.config,e.hostUrl);for(var t=0;t<u.installedPlugins.length;t++)try{u.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited")},u.prototype.destroy=function(e){void 0===e&&(e=!1);var t,n,r=u.instances.indexOf(this);-1!==r&&u.instances.splice(r,1);for(var i=u.installedPlugins.length-1;0<=i;i--)try{u.installedPlugins[i].unpatch(this)}catch(e){this.sendSDKError(e)}if(this.lifeCycle.emit("destroy"),this.lifeCycle.clear(),e)t=this,n=Object.getOwnPropertyDescriptors(t),Object.keys(n).forEach(function(e){n[e].writable&&(t[e]=null)}),Object.setPrototypeOf(this,null);else{for(var o=this;o.constructor!==Object&&Ke(o,this),o=Object.getPrototypeOf(o););0===u.instances.length&&(r=Object.getPrototypeOf(this).constructor,Ke(r),Ke(u))}},u.prototype.setConfig=function(e){Object.assign(this.config,e);var e=this.config,t=e.id,n=e.uin,r=e.version,i=e.aid,o=e.env,a=void 0===o?"production":o,o=e.pageUrl,e=e.userId||(null!=n?String(n):""),n=this.bean.id!==t||this.bean.uin!==e||this.bean.aid!==i;return this.bean.id=t||"",this.bean.uin=e,this.bean.version=r||"1.0.7",this.bean.aid=i||"",this.bean.env=(()=>{switch(a){case ge.production:case ge.development:case ge.gray:case ge.pre:case ge.daily:case ge.local:case ge.test:case ge.others:return 1;default:return}})()?a:ge.others,o&&this.extendBean("from",encodeURIComponent(o.slice(0,2048))),n&&this.lifeCycle.emit("onConfigChange",this.config),this.config},u.prototype.extendBean=function(e,t){this.bean[e]=t},u.prototype.send=function(e,i,o){var t=this;return Ze([ke(this),we(this,null==e?void 0:e.type),function(n,r){t.request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!1,result:e,logType:n.type,logs:n.log}),null!=i&&i.apply(void 0,e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!0,result:e,logType:n.type,logs:n.log}),null!=o&&o.apply(void 0,e)})},Se(this)])(e)},u.prototype.sendSDKError=function(e){var n=this;this.sendPipeline([function(e,t){t({url:n.config.url+"?id=1085&msg[0]="+encodeURIComponent(te(e))+"&level[0]=2&from="+n.config.id+"&count=1&version="+n.config.id+"(1.0.7)",addBean:!1,method:"get",type:oe.SDK_ERROR,log:e})}],oe.SDK_ERROR)(e)},u.prototype.sendPipeline=function(e,t){var n,o=this;return Ze(A([function(e,t){if(e&&e.type===oe.EVENT)return t(e);if("number"!=typeof n.config.random&&(console.warn("random must in [0, 1], default is 1."),n.config.random=1),!n.isHidden||!n.isGetSample)if(n.isGetSample)n.isHidden||t(e);else{if(n.isGetSample=!0,Math.random()<n.config.random)return n.isHidden=!1,t(e);n.isHidden=!0}},be(n=this,t)],e,[we(this,t),ke(this),function(r,i){o.request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;-1<(""+e[o.failRequestCount=0]).indexOf("403 forbidden")&&(n=!0,o.destroy()),i({isErr:n,result:e,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(n=null==r?void 0:r.success)&&n.call.apply(n,A([r],e))},function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];60<=++o.failRequestCount&&o.destroy(),-1<(""+t[0]).indexOf("403 forbidden")&&o.destroy(),i({isErr:!0,result:t,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(e=null==r?void 0:r.fail)&&e.call.apply(e,A([r],t))})},Se(this)]))},u.prototype.track=function(e,t){void 0===t&&(t={}),e&&"string"==typeof e?(e={event_id:g(),event_type:p.CUSTOM,event_category:m.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{event_name:e,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),payload:this.sanitizeEventPayload(t.payload),event_properties:this.sanitizeEventProperties(t.properties)}},this.reportTDEMEvent(e)):console.warn("track: name must be a non-empty string")},u.prototype.reportTDEMEvent=function(e){var n=this,e=Array.isArray(e)?e:[e];e.length&&(e=e.map(function(e){var t;return f(f({},e),{page_url:e.page_url||n.getCurrentEventPageUrl(),data:f(f({},e.data),n.mergeEventTags(null==(t=e.data)?void 0:t.tags)?{tags:n.mergeEventTags(null==(t=e.data)?void 0:t.tags)}:{})})}),this.lifeCycle.emit("tdemEventCreated",e),this.tdemEventPipeline(e))},u.prototype.measure=function(e,t,n){void 0===n&&(n={}),e&&"string"==typeof e?"number"==typeof t?t<0||2147483646<t?console.warn("measure: duration must between 0 and 2147483646"):this.submitMeasure(e,t,n):console.warn("measure: duration must be a number"):console.warn("measure: name must be a non-empty string")},u.prototype.startMeasure=function(e){"string"==typeof e&&e?this.timeMap[e]?console.warn("Measure "+e+" already exists"):this.timeMap[e]=Date.now():console.warn("startMeasure: name must be a non-empty string")},u.prototype.endMeasure=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?void 0!==(n=this.getTimeEventDuration(e))?(this.submitMeasure(e,n,t),delete this.timeMap[e]):console.warn("Measure "+e+" does not exist"):console.warn("endMeasure: name must be a non-empty string")},u.prototype.captureMessage=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?(n="error"===t.level?"error":"warn"===t.level?"warn":"info",n={event_id:g(),event_type:p.LOG,event_category:m.LOG,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{log_level:n,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(f({message:e},t.properties||{}))}},this.reportTDEMEvent(n)):console.warn("captureMessage: message must be a non-empty string")},u.prototype.captureException=function(e,t){void 0===t&&(t={});var e="string"==typeof e?new Error(e):e;e instanceof Error?(e={event_id:g(),event_type:p.JS_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{exception_stacks:[{type:e.name||"Error",value:e.message,mechanism_type:"manual",mechanism_handled:1}],exception_frames:ye(e),replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(f(f({},t.properties||{}),t.level?{capture_level:t.level}:{}))}},this.reportTDEMEvent(e)):console.warn("captureException: error must be an Error or string")},u.prototype.setTags=function(e){e=this.sanitizeEventTags(e);this.setConfig({defaultTags:f(f({},this.config.defaultTags||{}),e||{})})},u.prototype.removeTags=function(e){var t,e=Array.isArray(e)?e:[e];e.length&&(t=f({},this.config.defaultTags||{}),e.forEach(function(e){delete t[e]}),this.setConfig({defaultTags:t}))},u.prototype.clearTags=function(){this.setConfig({defaultTags:{}})},u.prototype.setUser=function(e){"string"==typeof e&&e?this.setConfig({userId:e}):console.warn("setUser: userId must be a non-empty string")},u.prototype.clearUser=function(){this.setConfig({userId:"",uin:""})},u.prototype.reportStruggle=function(e){var t,n,r;e&&e.type&&e.ownerType&&e.ownerKey?(r=e.type,t="number"==typeof e.severity?e.severity:Xe[r],n="number"==typeof e.weight?e.weight:$e[r],r={event_id:g(),event_type:p.STRUGGLE,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:r,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:!1,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),struggle_weight:n,struggle_severity:t,struggle_value:"number"==typeof e.value?e.value:n*t,event_properties:{form_id:e.formId||"",field_id:e.fieldId||"",trigger_event_id:e.triggerEventId||"",struggle_status:e.status||"detected",struggle_owner_type:e.ownerType,struggle_owner_key:e.ownerKey,detection_source:e.detectionSource||"sdk_auto",rule_version:e.ruleVersion||this.getDefaultRuleVersion()}}},this.reportTDEMEvent(r)):console.warn("reportStruggle params error")},u.prototype.reportFormSubmitResult=function(e){e&&e.status?(e={event_id:g(),event_type:p.FORM_SUBMIT_RESULT,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:e.eventName||"form_submit_"+e.status,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:"boolean"!=typeof e.isEffectiveAction||e.isEffectiveAction,trigger_event_id:e.triggerEventId,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),validation_message:e.validationMessage?e.validationMessage.slice(0,256):void 0,event_properties:{status:e.status,validation_code:e.validationCode||"",form_id:e.formId||"",field_id:e.fieldId||""}}},this.reportTDEMEvent(e)):console.warn("reportFormSubmitResult params error")},u.prototype.reportPageView=function(e,t){void 0===t&&(t={});e=this.getCurrentEventPageUrl(e||t.pageUrl),e={event_id:g(),event_type:p.PAGE_VIEW,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:e,data:{page_title:t.pageTitle||"",referrer:t.referrer,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(f(f(f(f(f(f(f({},t.properties||{}),t.navigationType?{navigation_type:t.navigationType}:{}),t.fromPage?{from_page:t.fromPage}:{}),t.toPage?{to_page:t.toPage}:{}),"boolean"==typeof t.isFirstVisit?{is_first_visit:t.isFirstVisit?"1":"0"}:{}),"boolean"==typeof t.isFirstLoad?{is_first_load:t.isFirstLoad?"1":"0"}:{}),t.deviceType?{device_type:t.deviceType}:{}))}};this.reportTDEMEvent(e)},u.prototype.setPage=function(e,t){var n;e&&"string"==typeof e?(n=this._customPageUrl||this.getCurrentEventPageUrl(),this._customPageUrl=e,this.reportPageView(e,{pageTitle:null==t?void 0:t.pageTitle,navigationType:"push",fromPage:(n||"").slice(0,512),toPage:e.slice(0,512),isFirstVisit:!1,tags:f({source:"manual",environment:this.config.env||"production",version:String(this.config.version||"")},null!=t&&t.pageGroup?{page_group:t.pageGroup}:{})}),this.lifeCycle.emit("pageChanged",{pageUrl:e,previousUrl:n,source:"manual"})):console.warn("setPage: pageUrl must be a non-empty string")},u.prototype.leavePage=function(){var e;this._customPageUrl&&(e=this._customPageUrl,this._customPageUrl=null,this.lifeCycle.emit("pageChanged",{pageUrl:this.getCurrentEventPageUrl(),previousUrl:e,source:"auto"}))},u.prototype.getCurrentEventPageUrl=function(e){var t;if(e)return e;if(this._customPageUrl)return this._customPageUrl;try{return this.getOriginFrom()}catch(e){return this.config.pageUrl||"undefined"!=typeof window&&(null==(t=window.location)?void 0:t.href)||""}},u.prototype.getCurrentReplayId=function(){var e,t;return String((null==(t=null==(t=null==(e=this.sessionManager)?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"")},u.prototype.getDefaultRuleVersion=function(){var e;return(null==(e=null==(e=this.config)?void 0:e.struggleMonitor)?void 0:e.ruleVersion)||"1.0.0"},u.prototype.getEventReplayId=function(e){return e||this.getCurrentReplayId()||void 0},u.prototype.mergeEventTags=function(e){return this.sanitizeEventTags(f(f({},this.config.defaultTags||{}),e||{}))},u.prototype.sanitizeStringMap=function(n,r){var i;if(void 0===r&&(r=1024),n&&"object"==typeof n)return i={},Object.keys(n).forEach(function(e){var t=n[e];e&&null!=t&&(i[String(e)]=String(t).slice(0,r))}),Object.keys(i).length?i:void 0},u.prototype.sanitizeEventTags=function(e){return this.sanitizeStringMap(e,1024)},u.prototype.sanitizeEventProperties=function(e){return this.sanitizeStringMap(e,1024)},u.prototype.sanitizeEventPayload=function(n,e){var r;if(n&&"object"==typeof n)return e=(e=this.getPayloadAllowlist(e)).length?e:Object.keys(n),r={},e.forEach(function(e){var t;Object.prototype.hasOwnProperty.call(n,e)&&null!=(t=n[e])&&("string"==typeof t?r[e]=t.slice(0,256):"number"==typeof t||"boolean"==typeof t?r[e]=t:Array.isArray(t)?r[e]=t.slice(0,10).map(function(e){return"string"==typeof e?e.slice(0,256):"number"==typeof e||"boolean"==typeof e?e:String(e).slice(0,256)}):r[e]=String(t).slice(0,256))}),Object.keys(r).length?r:void 0},u.prototype.getPayloadAllowlist=function(e){var t=null==(t=null==(t=this.config)?void 0:t.struggleMonitor)?void 0:t.payloadAllowlist;return Array.from(new Set(A(Array.isArray(t)?t:[],Array.isArray(e)?e:[]).filter(function(e){return!!e})))},u.prototype.normalizeRelatedEventIds=function(e){return Array.isArray(e)&&e.length&&(e=Array.from(new Set(e.filter(function(e){return"string"==typeof e&&e})))).length?e:void 0},u.prototype.ready=function(e,t,n){throw new Error('You need to override "ready" method')},u.prototype.request=function(e,t,n){throw new Error('You need to override "request" method')},u.prototype.speedLogPipeline=function(e){throw new Error('You need to override "speedLogPipeline" method')},u.prototype.getOriginFrom=function(){throw new Error('You need to override "getOriginFrom" method')},Object.defineProperty(u.prototype,"__version__",{get:function(){return"1.0.7"},enumerable:!1,configurable:!0}),u.prototype.submitMeasure=function(e,t,n){void 0===n&&(n={});e={event_id:g(),event_type:p.CUSTOM,event_category:m.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(n.pageUrl),data:{event_name:e,measurements:{duration:t},replay_id:this.getEventReplayId(n.replayId),tags:this.sanitizeEventTags(n.tags),payload:this.sanitizeEventPayload(n.payload),event_properties:this.sanitizeEventProperties(n.properties)}};this.reportTDEMEvent(e)},u.prototype.getTimeEventDuration=function(e){if(void 0!==e&&this.timeMap[e])return Date.now()-this.timeMap[e]},u.version="1.0.7",u.instances=[],u.environment=ge,u.installedPlugins=[],u),e=(Qe.prototype.patch=function(e){this.canUse(e)&&this.exist(e)&&(this.instances.push(e),this.triggerInit(e),this.triggerOnNewTdem(e))},Qe.prototype.unpatch=function(e){var t=this.instances.indexOf(e);-1!==t&&(this.instances.splice(t,1),0===this.instances.length)&&this.uninstall(e)},Qe.prototype.countInstance=function(){return this.instances.length},Qe.prototype.uninstall=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.destroy)&&t.apply(this,[e])},Qe.prototype.walk=function(n){var r=this;this.instances.forEach(function(e){var t=r.canUse(e);t&&n(e,t)})},Qe.prototype.canUse=function(e){e=this.getConfig(e);return!(!e||"object"!=typeof e)||!!e},Qe.prototype.getConfig=function(e){return null==(e=e.config)?void 0:e[this.name]},Qe.prototype.exist=function(e){return-1===this.instances.indexOf(e)},Qe.prototype.triggerInit=function(e){var t;this.inited||(this.inited=!0,null==(t=null==(t=this.option)?void 0:t.init))||t.call(this.option,this.getConfig(e))},Qe.prototype.triggerOnNewTdem=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.onNewTdem)&&t.call(this.option,e,this.getConfig(e))},Qe);function Qe(e){this.tdemPlugin=!0,this.name="",this.instances=[],this.inited=!1,e.$walk=this.walk.bind(this),e.$getConfig=this.getConfig.bind(this),this.option=e,this.name=e.name}function u(e,t){var r,i,o,n,a,s,l;void 0===t&&(t={}),this.sdkName="tdem-web-sdk",this.sdkVersion=u.version,this.isGetSample=!1,this.isHidden=!1,this.config={version:0,delay:1e3,onError:!0,repeat:60,random:1,aid:!0,device:!0,pagePerformance:!0,webVitals:!0,speedSample:!0,onClose:!0,reportLoadPackageSpeed:!0,env:"production",url:"",reportImmediately:!0,tdemConfig:!0,hostUrl:"https://dem.rumt-zh.com",offlineUrl:"",whiteListUrl:"",pvUrl:"",speedUrl:"",customTimeUrl:"",performanceUrl:"",performanceUrlForHippy:"",webVitalsUrl:"",eventUrl:"",setDataReportUrl:""},this.isWhiteList=!1,this.lifeCycle=new q,this.bean={},this.internalRetrySchedule=ve,this._customPageUrl=null,this.tdemEventPipeline=Ze([(a=n=!1,s=[],this._tdemSampleGate={decide:function(e){n=!0,(a=e)&&s.forEach(function(e){var t=e.event;return(0,e.resolve)(t)}),s=[]},reDecide:function(e){return a=!(e<=0)&&(100<=e||100*Math.random()<e)},get isDecided(){return n},get isSampled(){return a}},function(e,t){n?a&&t(e):s.length<1e3&&s.push({event:e,resolve:t})}),(i=Math.max(Number(100)||1,1),o=[],function(e,t){function n(){for(;0<o.length;)t(o.splice(0,i))}e=Array.isArray(e)?e:[e];o.push.apply(o,e);clearTimeout(r),i<=o.length?n():r=setTimeout(function(){0<o.length&&n()},5e3)}),function(t,n){try{var e,r=JSON.parse(JSON.stringify(t)),i=(l.lifeCycle.emit("beforeReport",r),l.config.beforeReport);"function"==typeof i?0<(e=t.filter(function(e){return!1!==i(e)})).length&&n(e):n(t)}catch(e){n(t)}},Ve(l=this)]),this.timeMap={},this.failRequestCount=0,this.internalTransport=t.transport,this.internalRetrySchedule=t.retrySchedule||ve,u.instances.push(this)}new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e||window.localStorage.getItem("TDEM_ID");t||(t=Fe(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}});function et(){return void 0!==window.performance&&"function"==typeof performance.getEntriesByType&&"function"==typeof performance.now}function tt(e){var t;return-1<(null==(t=null==(t=window.PerformanceObserver)?void 0:t.supportedEntryTypes)?void 0:t.indexOf(e))}function nt(e){return e=e.sessionManager,[(null==(t=null==(t=null==e?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"",null==t||t.id,!t||t.sampled,null==t||t.sampled][0];var t}function rt(e){return-1!==at.indexOf(e)}var it=new e({name:"assets"}),ot=it=new e({name:"assets",collectCur:0,collectEntryType:"resource",ASSETS_INITIATOR_TYPE:["img","css","script","link","audio","video"],getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},onNewTdem:function(e){var t=this;et()&&(setTimeout(function(){t.collectSuccessLog(e),t.collectFailLog(e)},5e3),performance.onresourcetimingbufferfull=function(){"function"==typeof performance.clearResourceTimings&&(t.collectCur=0,performance.clearResourceTimings())})},processLog:function(e,t){var n=t.duration||0,r=t.transferSize||0,n={event_id:g(),event_type:p.RESOURCE_LOAD,event_category:m.NETWORK,timestamp:Date.now(),page_url:t.from||window.location.href,data:{url:t.url,resource_type:t.type||"static",measurements:{duration:n,dns_time:t.domainLookup,tcp_time:t.connectTime,transfer_size:0<r?r:void 0},replay_id:nt(e),tags:{environment:e.config.env||"production",is_https:t.isHttps?"true":"false"},event_properties:{is_cached:String(0===r),protocol:t.nextHopProtocol||"",http_status:String(t.status||0)}}};null!=(r=e.reportTDEMEvent)&&r.call(e,n)},publish:function(t,n){var r=this;this.$walk(function(e){e===n&&(Array.isArray(t)?t.forEach(r.processLog):r.processLog(n,t))})},publishMany:function(e,t){for(var n=t.config,r=this.getFromParam(t),i=0,o=e.length;i<o;i++){var a=e[i];-1===this.ASSETS_INITIATOR_TYPE.indexOf(a.initiatorType)||re(a.name,n.hostUrl)||this.publish(this.generateLog(a,n,r),t)}},collectSuccessLog:function(n){var e,t,r=this;"function"==typeof window.PerformanceObserver?(this.publishMany(performance.getEntriesByType(this.collectEntryType),n),(e=new window.PerformanceObserver(function(e){r.publishMany(e.getEntries(),n)})).observe({entryTypes:[this.collectEntryType]}),n.lifeCycle.on("destroy",function(){0===it.countInstance()&&e.disconnect()})):(t=setInterval(function(){var e=performance.getEntriesByType(r.collectEntryType),t=e.slice(r.collectCur);r.collectCur=e.length,r.publishMany(t,n)},3e3),n.lifeCycle.on("destroy",function(){0===it.countInstance()&&clearInterval(t)}))},collectFailLog:function(i){function e(e){var t,n,r;e&&(e=e.target||e.srcElement,!(t=(null==e?void 0:e.src)||(null==e?void 0:e.href))||"string"!=typeof t||-1<window.location.href.indexOf(t)||(e="function"==typeof(null==(e=a.api)?void 0:e.resourceTypeHandler)?null==e?void 0:e.resourceTypeHandler(t):"",r=performance.getEntriesByType(o.collectEntryType).find(function(e){return e.name===t}),re(t,a.hostUrl))||(n=o.getFromParam(i),r={url:J(t),status:400,duration:Number(((null==r?void 0:r.duration)||0).toFixed(2)),method:"get",type:e||"static",isHttps:X(t),urlQuery:K(t,!0),nextHopProtocol:"",domainLookup:0,connectTime:0,from:n},o.publish(r,i)))}var o=this,a=i.config;window.document.addEventListener("error",e,!0),i.lifeCycle.on("destroy",function(){0===it.countInstance()&&window.document.removeEventListener("error",e,!0)})},generateLog:function(e,t,n){var t="function"==typeof(null==(r=t.api)?void 0:r.resourceTypeHandler)?null==(r=t.api)?void 0:r.resourceTypeHandler(e.name):"",r=e.transferSize;return{url:J(e.name),method:"get",duration:Number(e.duration.toFixed(2)),status:200,type:t||"static",isHttps:X(e.name),nextHopProtocol:e.nextHopProtocol||"",urlQuery:K(e.name,!0),domainLookup:Z(e.domainLookupEnd-e.domainLookupStart),connectTime:Z(e.connectEnd-e.connectStart),transferSize:0<r?r:-1,from:n}},collectNotReportedLog:function(e){var t,n;et()&&(t=(n=performance.getEntriesByType(this.collectEntryType)).length,"function"!=typeof window.PerformanceObserver)&&this.collectCur!==t&&(n=n.slice(this.collectCur),this.collectCur=t,this.publishMany(n,e))},destroy:function(){this.option.publish=function(){}}}),at=window.navigator.userAgent.toLowerCase(),l={};l.macos=function(){return rt("mac")},l.ios=function(){return l.iphone()||l.ipod()||l.ipad()},l.iphone=function(){return!l.windows()&&rt("iphone")},l.ipod=function(){return rt("ipod")},l.ipad=function(){var e="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return rt("ipad")||e},l.android=function(){return!l.windows()&&rt("android")},l.androidPhone=function(){return l.android()&&rt("mobile")},l.androidTablet=function(){return l.android()&&!rt("mobile")},l.blackberry=function(){return rt("blackberry")||rt("bb10")},l.blackberryPhone=function(){return l.blackberry()&&!rt("tablet")},l.blackberryTablet=function(){return l.blackberry()&&rt("tablet")},l.windows=function(){return rt("windows")},l.windowsPhone=function(){return l.windows()&&rt("phone")},l.windowsTablet=function(){return l.windows()&&rt("touch")&&!l.windowsPhone()},l.fxos=function(){return(rt("(mobile")||rt("(tablet"))&&rt(" rv:")},l.fxosPhone=function(){return l.fxos()&&rt("mobile")},l.fxosTablet=function(){return l.fxos()&&rt("tablet")},l.meego=function(){return rt("meego")},l.cordova=function(){return window.cordova&&"file:"===location.protocol},l.nodeWebkit=function(){return"object"==typeof window.process},l.mobile=function(){return l.androidPhone()||l.iphone()||l.ipod()||l.windowsPhone()||l.blackberryPhone()||l.fxosPhone()||l.meego()},l.tablet=function(){return l.ipad()||l.androidTablet()||l.blackberryTablet()||l.windowsTablet()||l.fxosTablet()},l.desktop=function(){return!l.tablet()&&!l.mobile()};function st(){return{host:new URL(location.href).host,pathname:location.pathname}}function lt(r,e,i){return null!=e&&e.length&&"object"==typeof r?e.reduce(function(e,t){var n=window.Headers&&r instanceof Headers?r.get(t):r[t];return n?e+(""===e?"":"\n\n")+i+" header "+t+": "+n:e},""):""}function ut(e,t){return e&&-1===["null","undefined"].indexOf(e)?t+": "+e:""}function ct(e,t,n){void 0===t&&(t="");var r,i,e="function"==typeof(null==(i=e.api)?void 0:i.resourceTypeHandler)?null==(i=e.api)?void 0:i.resourceTypeHandler(n):"";return-1===W.indexOf(e)&&(r=void 0===t?"":t,i=(void 0===n?"":n).split("?")[0],e=se.test(i)||ae.some(function(e){return-1!==String(r).indexOf(e)})?"static":"fetch"),e}function dt(e,t){return e?xt.AJAX_ERROR:t?xt.RET_ERROR:xt.API_RESPONSE}function ht(e,t,n){if(!e)return!1;if(null!=(t=null==t?void 0:t.api)&&t.isSlowApi&&"function"==typeof(null==t?void 0:t.isSlowApi))try{return t.isSlowApi(n||{duration:e})}catch(e){return console.warn("[TDEM] isSlowApi function happen error:",e,", this data will not be reported."),!1}return(n=null!=(n=null==t?void 0:t.slowThreshold)?n:null==t?void 0:t.apiSlowThreshold)&&"number"==typeof n?n<e:1e3<e}function ft(e,t){if(null!=(e=e.api)&&e.usePerformanceTiming&&"string"==typeof t.url){e=null==(e=performance.getEntriesByName(t.url))?void 0:e.pop();if(e)return{url:t.url,isHttps:X(t.url),method:t.method,type:t.type,status:t.status,duration:Number(e.duration.toFixed(2)),nextHopProtocol:e.nextHopProtocol||"",domainLookup:Z(e.domainLookupEnd-e.domainLookupStart),connectTime:Z(e.connectEnd-e.connectStart)}}return{url:t.url,isHttps:X(t.url),method:t.method,type:t.type,status:t.status,duration:Number(t.duration.toFixed(2)),nextHopProtocol:"",domainLookup:U.number,connectTime:U.number}}function pt(e){return(e=(e=>{var t="",n=e.nodeType;if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(var r=e.firstChild;r;r=r.nextSibling)t+=jt(e)}else if(3===n||4===n)return e.nodeValue;return t})(e))?e.replace(/^\s+|\s+$/g,""):""}var mt,gt,vt,yt,wt,bt,kt,St=!(l.isIE=function(){return"ActiveXObject"in window}),_t=[],Et=/^\/[^/]/,Ct=!1,Tt=[],Rt={maxRetryCount:10,retryInterval:function(e){return 1e3*(2<<e)},whenRetryEndStillFail:"discard"},xt={API_RESPONSE:"api_response",AJAX_ERROR:"ajax_error",RET_ERROR:"ret_error",SLOW_NET_REQUEST:"slow_net_request"},Ot=(new e({name:"api"}),new e({name:"api",override:!1,onNewTdem:function(e){var t,n;this.override||(this.override=!0,null!=(n=e.config.api)&&n.injectTraceHeader&&(this.traceRequestHeader=new We(n.injectTraceHeader,null!=(t=null==n?void 0:n.injectTraceIgnoreUrls)?t:[],null==n?void 0:n.injectTraceUrls,null==n?void 0:n.traceFlag)),this.overrideFetch(e.config,e),this.overrideXhr(e.config,e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},overrideFetch:function(b,k){var S=this,e=b.api,e={name:this.name,traceRequestHeader:null!=e&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return S.getFromParam(k)},then:function(h,f,p,m,g,v,y){var e,w;re(p,b.hostUrl)||(e=h.headers?h.headers.get("content-type"):"","fetch"===(w=ct(b,e||"",p))?h.clone().text().then(function(r){var e,i=h.status<=0||400<=h.status,t=(null==(t=b.api)?void 0:t.reqHeaders)||[],o=lt(null==m?void 0:m.headers,t,"req"),t=(null==(t=b.api)?void 0:t.resHeaders)||[],a=lt(h.headers,t,"res"),s=ze(null==m?void 0:m.headers),t=$(r,b.api,{url:p,ctx:h,payload:null==m?void 0:m.body}),l=t.code,u=t.isErr,t=null==(t=b.api)?void 0:t.apiDetail,c=t?ee(null==m?void 0:m.body,null==(e=b.api)?void 0:e.reqParamHandler,{url:p}):"",d=t?ee(r,null==(e=b.api)?void 0:e.resBodyHandler,{url:p,ctx:h}):"";setTimeout(function(){var e=ft(b,{url:p,duration:f,type:w,status:h.status||0,method:(null==m?void 0:m.method)||"get"}),t=[i?"FETCH_ERROR: "+r:"","fetch req url: "+p,"res status: "+(e.status||0),"res duration: "+e.duration+"ms","res startTime: "+g,o,a,"req method: "+(e.method||"GET"),"res retcode: "+l,ut(c,"req param"),ut(d,"res data")].filter(function(e){return e}).join("\n\n"),t=(e.payload=null==m?void 0:m.body,e.ret=l,e.isErr=+u,e.from=v||S.getFromParam(k),{msg:t,code:l,trace:s,errorMsg:"",from:v||S.getFromParam(k),originFrom:y,level:xt.API_RESPONSE}),n=ht(null==e?void 0:e.duration,b,e);t.level=n?xt.SLOW_NET_REQUEST:dt(i,u),(n||t.level!==xt.API_RESPONSE||k.isWhiteList||null!=(n=null==(n=k.config)?void 0:n.api)&&n.reportRequest)&&S.publishNormalLog(t,k),S.publishSpeed(e,k)},0)}).catch(function(e){console.info("ignore something error when process resp "+e)}):setTimeout(function(){var e=ft(b,{url:p,duration:f,type:w,status:h.status||0,method:(null==m?void 0:m.method)||"get"});e.type="static",e.urlQuery=K(p,!0),e.from=v||S.getFromParam(k),S.publishSpeed(e,k)},0))},catch:function(t,n,r,i,o,a,s){var l,e,u,c,d;throw re(r,b.hostUrl)||(l=ct(b,"",r),e=(null==(e=b.api)?void 0:e.reqHeaders)||[],u=lt(null==i?void 0:i.headers,e,"req"),c=ze(null==i?void 0:i.headers),d=null!=(e=b.api)&&e.apiDetail?ee(null==i?void 0:i.body,null==(e=b.api)?void 0:e.reqParamHandler,{url:r}):"",setTimeout(function(){var e=ft(b,{url:r,duration:n,type:l,status:0,method:(null==i?void 0:i.method)||"get"}),e=(e.from=a||S.getFromParam(k),S.publishSpeed(e,k),"AJAX_ERROR: "+t+"\n \nreq url: "+r+"\n \nres status: 0\n \nres duration: "+e.duration+"ms\n \nreq method: "+((null==i?void 0:i.method)||"get")+"\n \nreq param: "+d+"\n \nres startTime: "+o+"\n \n"+u);S.publishNormalLog({msg:e,level:xt.AJAX_ERROR,code:-400,trace:c,errorMsg:"",from:a||S.getFromParam(k),originFrom:s},k)},0)),t}},h=(this.hackFetchOptions=e,this.hackFetchOptions),f=null==(e=b.api)?void 0:e.ignoreHackReg;if(void 0===f&&(f=/\.flv(\?|$)/i),Tt.find(function(e){return e.name===h.name}))throw new Error("name '"+h.name+"' is already in hackFetch option list");Tt.push(h),!Ct&&window.fetch&&(Ct=!0,yt=window.fetch,window.fetch=function(e,i){void 0===i&&(i={});var o="string"==typeof e?e:null==e?void 0:e.url;if(null!=(a=null==f?void 0:f.test)&&a.call(f,o))return yt(o,i);Et.test(o)&&(o=""+location.origin+o);var t,n,r,a=(h||{}).traceRequestHeader;a&&(t=void 0===(t=(i||{}).headers)?{}:t,n=(r=st()).host,n=(a=a.generate(o,t,{host:n,pathname:r.pathname})||{}).name,r=a.value)&&n&&(i.headers=Object.assign(t,((a={})[n]=r,a)));for(var s=new Map,l=window.location.href,u=0;u<Tt.length;u++){var c=Tt[u];try{"function"==typeof c.beforeFetch&&c.beforeFetch(o,i),"function"==typeof c.getCurrentFrom&&s.set(c.name,c.getCurrentFrom())}catch(e){}}var d=Date.now();return yt(e,i).then(function(e){for(var t=e.clone(),n=0;n<Tt.length;n++){var r=Tt[n];try{"function"==typeof r.then&&r.then(t,Date.now()-d,o,i,d,s.get(r.name),l)}catch(e){}}return e}).catch(function(e){for(var t=0;t<Tt.length;t++){var n=Tt[t];try{"function"==typeof n.catch&&n.catch(e,Date.now()-d,o,i,d,s.get(n.name),l)}catch(e){}}throw e})})},overrideXhr:function(b,k){var i,S=this,e={name:this.name,ignoreHackReg:null==(e=b.api)?void 0:e.ignoreHackReg,traceRequestHeader:null!=(e=b.api)&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return S.getFromParam(k)},send:function(h,f,p,m){var e,t,g=Date.now(),v=(((null==b?void 0:b.api)||{}).injectTraceHeader&&(t=(e=st()).host,e=(t=S.traceRequestHeader.generate(h.tdemUrl,{},{host:t,pathname:e.pathname})||{}).name,t=t.value,e)&&t&&h.setRequestHeader(e,t),h.addEventListener("loadend",function(){var u,n,e,c,d=h.tdemUrl||"";re(d,b.hostUrl)||"abort"===h.failType||(u="",(h.failType||!h.status||400<=h.status)&&(u=h.failType||"failed"),n=Date.now()-g,e=h.getResponseHeader("content-type")||"",c=ct(b,e,d),setTimeout(function(){var r=ft(b,{url:d,duration:n,type:c,status:h.status,method:h.tdemMethod||"get"});if(r.from=p||S.getFromParam(k),"fetch"===c){var e=(null==(e=b.api)?void 0:e.reqHeaders)||[],i=lt(h.tdemXhrReqHeader,e,"req"),e=(null==(e=b.api)?void 0:e.resHeaders)||[],t=h.getAllResponseHeaders().split("\r\n").reduce(function(e,t){t=t.split(": ");return t[0]&&t[1]&&(e[t[0]]=t[1]),e},{}),o=lt(t,e,"res"),a=ze(h.tdemXhrReqHeader),e=null==(t=b.api)?void 0:t.apiDetail,s=e?ee(f,null==(t=b.api)?void 0:t.reqParamHandler,{url:d}):"",l=e?ee(h.response,null==(t=b.api)?void 0:t.resBodyHandler,{url:d}):"";try{((e,t,n,r)=>{var i,o,a;try{if("function"==typeof(null==t?void 0:t.retCodeHandlerAsync))return t.retCodeHandlerAsync(e,null==n?void 0:n.url,null==n?void 0:n.ctx,function(e){var t=e.code;null!=r&&r({code:void 0===t?G:t,isErr:e.isErr})});if("function"==typeof(null==t?void 0:t.retCodeHandler))return a=(o=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code,null!=r&&r({code:void 0===a?G:a,isErr:o.isErr});if(!(e="string"==typeof e?JSON.parse(e):e))return null!=r&&r({code:G,isErr:!1});"function"==typeof(null==(i=null==t?void 0:t.ret)?void 0:i.join)&&(le=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var s=Object.getOwnPropertyNames(e).filter(function(e){return-1!==le.indexOf(e.toLowerCase())});if(s.length)return"未知"!==(a=e[s[0]])&&""!==a||(a=G),null!=r&&r({code:""+a,isErr:0!==a&&"0"!==a&&a!==G});null!=r&&r({code:G,isErr:!1})}catch(e){null!=r&&r({code:G,isErr:!1})}})(h.response,b.api,{url:d,ctx:h,payload:f},function(e){var t=e.code,e=e.isErr,n=[u?"AJAX_ERROR: request "+u:"","fetch req url: "+d,"res status: "+(r.status||0),"res duration: "+r.duration+"ms","res startTime: "+g,i,o,"req method: "+(r.method||"GET"),"res retcode: "+t,ut(s,"req param"),ut(l,"res data")].filter(function(e){return e}).join("\n\n");r.ret=t,r.isErr=+e,r.payload=f,ht(null==r?void 0:r.duration,b,r)?S.publishNormalLog({msg:n,level:xt.SLOW_NET_REQUEST,code:t,trace:a,errorMsg:"",from:p||S.getFromParam(k),originFrom:m},k):S.publishNormalLog({msg:n,level:dt(!!u,e),code:t,trace:a,errorMsg:"",from:p||S.getFromParam(k),originFrom:m},k),S.publishSpeed(r,k)})}catch(e){r.ret=G,S.publishSpeed(r,k)}}else r.type="static",r.urlQuery=K(d,!0),S.publishSpeed(r,k);h.removeEventListener("abort",v),h.removeEventListener("error",y),h.removeEventListener("timeout",w)},0))}),function(){h.failType="abort"}),y=function(){h.failType="error"},w=function(){h.failType="timeout"};h.addEventListener("abort",v),h.addEventListener("error",y),h.addEventListener("timeout",w)}};this.hackXHROptions=e,i=this.hackXHROptions,_t.find(function(e){return e.name===i.name})||(_t.push(i),!St&&window.XMLHttpRequest&&(mt=window.XMLHttpRequest.prototype.send,gt=window.XMLHttpRequest.prototype.open,vt=window.XMLHttpRequest.prototype.setRequestHeader,St=!0,window.XMLHttpRequest.prototype.open=function(){this.tdemMethod=arguments[0];var e,t=arguments[1];if(Et.test(t)&&(t=""+location.origin+t),this.tdemUrl=t,null==(t=null==(e=i.ignoreHackReg)?void 0:e.test)||!t.call(e,this.tdemUrl))if(this.tdemXhrStartTime=Date.now(),this.sendByTdem)l.isIE()||(this.timeout=5e3);else for(var n=0;n<_t.length;n++){var r=_t[n];try{"function"==typeof r.open&&r.open(this)}catch(e){}}return gt.apply(this,arguments)},window.XMLHttpRequest.prototype.setRequestHeader=function(){var e,t,n;return null!=(t=null==(n=i.ignoreHackReg)?void 0:n.test)&&t.call(n,this.tdemUrl)?vt.apply(this,arguments):(t=arguments[0],n=arguments[1],this.tdemXhrReqHeader=null!=(e=this.tdemXhrReqHeader)?e:{},null!=i&&i.traceRequestHeader&&-1<["traceparent","b3","sw8","sentry-trace"].indexOf(t)&&(this.tdemXhrReqHeader[t]||(arguments[1]=n),this.tdemXhrReqHeader[t])?void 0:(this.tdemXhrReqHeader[t]=arguments[1],vt.apply(this,arguments)))},window.XMLHttpRequest.prototype.send=function(){var e,t;if(!(null!=(t=null==(e=i.ignoreHackReg)?void 0:e.test)&&t.call(e,this.tdemUrl)||this.sendByTdem))for(var n=0;n<_t.length;n++){var r=_t[n];try{"function"==typeof r.send&&r.send(this,arguments[0],"function"==typeof r.getCurrentFrom?r.getCurrentFrom():void 0,window.location.href)}catch(e){}}return mt.apply(this,arguments)}))},publishSpeed:function(e){},publishNormalLog:function(e,t){var n,r,i,o,a,s,l;[xt.API_RESPONSE,xt.AJAX_ERROR,xt.RET_ERROR,xt.SLOW_NET_REQUEST].includes(e.level)&&(n=(n=null==(n=e.msg)?void 0:n.match(/(?:fetch req url|req url):\s*(.+?)(?:\n|$)/))?n[1].trim():"",r=(r=null==(r=e.msg)?void 0:r.match(/req method:\s*(.+?)(?:\n|$)/i))?r[1].trim().toUpperCase():"GET",i=(i=null==(i=e.msg)?void 0:i.match(/res status:\s*(\d+)/))?parseInt(i[1],10):0,o=(o=null==(o=e.msg)?void 0:o.match(/res duration:\s*([\d.]+)ms/))?parseFloat(o[1]):0,a=(a=null==(a=e.msg)?void 0:a.match(/=+\s*res data\s*=+\s*\n([\s\S]*?)(?:\n=+|$)/))?a[1].trim().slice(0,1e3):void 0,s={},e.trace&&(s.trace_id=e.trace),[xt.AJAX_ERROR,xt.RET_ERROR].includes(e.level)||400<=i||0===i?(l={event_id:g(),event_type:p.API_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:e.from||(null==(l=t.getOriginFrom)?void 0:l.call(t))||window.location.href,data:{url:n,measurements:{duration:o},response_body:a,replay_id:nt(t),tags:0<Object.keys(s).length?s:void 0,event_properties:{http_method:r,http_status:String(i)}}},null!=(a=t.reportTDEMEvent)&&a.call(t,l)):(l={event_id:g(),event_type:p.API_CALL,event_category:m.NETWORK,timestamp:Date.now(),page_url:e.from||(null==(a=t.getOriginFrom)?void 0:a.call(t))||window.location.href,data:{url:n,measurements:{duration:o},business_code:String(e.code||""),replay_id:nt(t),tags:0<Object.keys(s).length?s:void 0,event_properties:{http_method:r,http_status:String(i)}}},null!=(a=t.reportTDEMEvent)&&a.call(t,l)))},destroy:function(){var t,n,e;this.option.publishSpeed=function(){},this.option.publishNormalLog=function(){},this.option.hackXHROptions&&(n=this.option.hackXHROptions,-1!==(e=_t.findIndex(function(e){return e.name===n.name})))&&_t.splice(e,1),this.option.hackFetchOptions&&(t=this.option.hackFetchOptions,-1!==(e=Tt.findIndex(function(e){return e.name===t.name})))&&Tt.splice(e,1),this.option.override=!1}})),Mt={},It=new e({name:"bridge",override:!1,onNewTdem:function(e){this.override||(this.override=!0,this.overrideBridge(e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},publishSpeed:function(t,n){this.$walk(function(e){e===n&&e.speedLogPipeline(t)})},overrideBridge:function(u){var c=this,d=u.config,e="object"==typeof d.bridge?d.bridge:void 0,t=null==e?void 0:e.target,e=null==e?void 0:e.methods;t&&null!=e&&e.length&&e.forEach(function(e){var l=t[e];Mt[e]=l,t[e]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],i=e[1],n=e[2],o=e[3],a=Date.now(),s=c.getFromParam(u);l(r,i,n,function(e){var t=$(e,d.api),n=t.code,t=t.isErr,n={url:r+"-"+i,name:r+"-"+i,duration:Date.now()-a,type:"bridge",ret:n,isErr:+t,from:s};c.publishSpeed(n,u),o(e)})}})},unHackBridge:function(e){var e="object"==typeof e.config.bridge?e.config.bridge:void 0,t=null==e?void 0:e.target;Mt=(t&&Object.keys(Mt).forEach(function(e){Mt[e]&&(t[e]=Mt[e])}),{})},destroy:function(e){this.option.publishSpeed=function(){},this.option.unHackBridge(e),this.option.override=!1}}),t=((t=wt=wt||{})[t.unknown=100]="unknown",t[t.wifi=1]="wifi",t[t.net2g=2]="net2g",t[t.net3g=3]="net3g",t[t.net4g=4]="net4g",t[t.net5g=5]="net5g",t[t.net6g=6]="net6g",(t=bt=bt||{})[t.android=1]="android",t[t.ios=2]="ios",t[t.windows=3]="windows",t[t.macos=4]="macos",t[t.linux=5]="linux",t[t.other=100]="other",(t=kt=kt||{})[t.unknown=100]="unknown",t[t.normal=0]="normal",t[t.weak=1]="weak",t[t.disconnected=2]="disconnected",new e({name:"device",onNewTdem:function(e){e.extendBean("platform",this.getPlatform()),e.extendBean("netType",wt.unknown),this.getDpi(e),this.refreshNetworkTypeToBean(e),this.refreshNetworkStatusToBean(e)},getDpi:function(e){e.extendBean("vp",Math.round(window.innerWidth)+" * "+Math.round(window.innerHeight)),window.screen&&e.extendBean("sr",Math.round(window.screen.width)+" * "+Math.round(window.screen.height))},getPlatform:function(){var t={android:/\bAndroid\s*([^;]+)/,ios:/\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/,windows:/\b(Windows NT)/,macos:/\b(Mac OS)/,linux:/\b(Linux)/i},e=Object.keys(t).find(function(e){return t[e].test(navigator.userAgent)});return e?bt[e]:bt.other},refreshNetworkTypeToBean:function(t){var n=this,e=t.config;e&&("function"==typeof e.getNetworkType?e.getNetworkType:At)(function(e){wt[e]||(e=wt.unknown),t.extendBean("netType",e),n.NetworkRefreshTimer=setTimeout(function(){n.refreshNetworkTypeToBean(t),clearTimeout(n.NetworkRefreshTimer)},1e4)})},refreshNetworkStatusToBean:function(t){var e,n=this,r=t.config;r&&null!=(e="function"==typeof r.getNetworkStatus?r.getNetworkStatus:e)&&e(function(e){void 0===kt[e]&&(e=kt.unknown),t.extendBean("netStatus",e),n.NetworkStatusRefreshTimer=setTimeout(function(){n.refreshNetworkStatusToBean(t),clearTimeout(n.NetworkStatusRefreshTimer)},1e4)})}})),At=function(e){var t="",n=navigator.userAgent.match(/NetType\/(\w+)/);n?t=n[1]:navigator.connection&&(t=navigator.connection.effectiveType||navigator.connection.type),e((n=t=t||G,0<=(n=String(n).toLowerCase()).indexOf("4g")?wt.net4g:0<=n.indexOf("wifi")?wt.wifi:0<=n.indexOf("5g")?wt.net5g:0<=n.indexOf("6g")?wt.net6g:0<=n.indexOf("3g")?wt.net3g:0<=n.indexOf("2g")?wt.net2g:wt.unknown))},Pt=window.WebSocket,Lt=[],Dt={construct:function(e,t){var r=new e(t[0],t[1]);return r.originSend=r.send,r.addEventListener("error",function(e){var e=(null==e?void 0:e.currentTarget)||{},t=e.url,n=e.readyState;null!=Lt&&Lt.forEach(function(e){e=e.onErr;null!=e&&e({msg:"无法获知具体错误信息,需在浏览器控制台查看!",readyState:n,connectUrl:t})})}),Object.defineProperty(r,"send",{get:function(){return function(e){null!=(t=r.originSend)&&t.call(r,e);var t=r.readyState;if(t!==WebSocket.OPEN){var n={readyState:t,connectUrl:r.url};switch(t){case WebSocket.CLOSED:Lt.forEach(function(e){e=e.sendErr;null!=e&&e(f({msg:"消息发送失败,连接已关闭!"},n))});break;case WebSocket.CONNECTING:Lt.forEach(function(e){(0,e.sendErr)(f({msg:"消息发送失败,正在连接中!"},n))});break;case WebSocket.CLOSING:Lt.forEach(function(e){(0,e.sendErr)(f({msg:"消息发送失败,连接正在关闭!"},n))})}}}}}),r}},Nt=new e({name:"onError"}),Ft=Nt=new e({name:"onError",onNewTdem:function(e){this.startListen(e)},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},startListen:function(l){function e(e){var t,n=e&&te(e.reason);n&&(t=[{type:(null==(t=e.reason)?void 0:t.name)||"PromiseRejection",value:(null==(t=e.reason)?void 0:t.message)||String(n),mechanism_type:"unhandledrejection",mechanism_handled:0}],n=e.reason instanceof Error?ye(e.reason):[],e={event_id:g(),event_type:p.PROMISE_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:t,exception_frames:n,replay_id:nt(l),tags:{environment:l.config.env||"production"}}},null!=(t=l.reportTDEMEvent))&&t.call(l,e)}function t(e){if(e=(null==e?void 0:e.target)||(null==e?void 0:e.srcElement)){var t=e.src||e.href||"",n=e.tagName,n=(void 0===n?"script":n).toLowerCase(),r=["audio","video"].includes(n);if(!r||null!=e&&e.error){if(!(re(i=t,l.config.hostUrl)||-1<window.location.href.indexOf(i))){var i="other";if(/\.js$/.test(t)||"script"===n)i="script";else if(/\.css$/.test(t)||"link"===n)i="stylesheet";else if("img"===n)i="image";else{if(!r)return;i="media"}t={event_id:g(),event_type:p.RESOURCE_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{url:t,resource_type:i,replay_id:nt(l),tags:f({environment:l.config.env||"production"},r&&null!=e&&e.error?{error_code:String(e.error.code),error_message:e.error.message||""}:{}),event_properties:{element_tag:n}}};null!=(i=l.reportTDEMEvent)&&i.call(l,t)}}else console.log("may be media load success because error is undefine")}}var n,r,i,u=this,c=window.onerror,o=(window.onerror=function(e,t,n,r,i){var o,a,s=te(e);"string"!=typeof(o=s)||!o||j.some(function(e){return-1<o.indexOf(e)})||z.some(function(e){return-1<o.indexOf(e)})||(s=[{type:(null==i?void 0:i.name)||"Error",value:String(e),mechanism_type:"onerror",mechanism_handled:0}],a=i?ye(i):[{abs_path:t||"",colno:r||0,filename:(null==t?void 0:t.split("/").pop())||"",function:"(anonymous)",lineno:n||0,in_app:1,stack_level:0}],s={event_id:g(),event_type:p.JS_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:s,exception_frames:a,replay_id:nt(l),tags:{environment:l.config.env||"production",version:String(l.config.version||"")}}},null!=(a=l.reportTDEMEvent)&&a.call(l,s)),null!=c&&c.call(window,e,t,n,r,i)},window.addEventListener("unhandledrejection",e),window.document.addEventListener("error",t,!0),l.lifeCycle.on("destroy",function(){0===Nt.countInstance()&&(window.removeEventListener("unhandledrejection",e),window.document.removeEventListener("error",t,!0))}),l.config.websocket);(("object"==typeof o?!1!==o.enabled:o)||l.config.websocketHack)&&(o={key:l.config.id+"-"+this.name,onErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)},sendErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)}},this.hackWebsocketConfig=o,o=this.hackWebsocketConfig,window.Proxy)&&window.WebSocket&&(n=window.WebSocket,window&&!n.isHack&&(r=new Proxy(WebSocket,Dt),n.isHack=!0,window.WebSocket=r),i=o,Lt.find(function(e){return e.key===i.key})||i&&Lt.push(i))},publishWsErrorLog:function(e,n){var t=e.connectUrl,r=e.msg,e=e.readyState,i={event_id:g(),event_type:p.JS_ERROR,event_category:m.ERROR,timestamp:Date.now(),page_url:this.getFromParam(n),data:{exception_stacks:[{type:"WebSocketError",value:"WEBSOCKET_ERROR: connect: "+t+" readyState: "+e+" msg: "+r,mechanism_type:"websocket",mechanism_handled:0}],exception_frames:[],replay_id:nt(n),tags:{environment:n.config.env||"production",websocket_url:t||"",websocket_ready_state:String(null!=e?e:"")}}};this.$walk(function(e){var t;e===n&&null!=(t=e.reportTDEMEvent)&&t.call(e,i)})},destroy:function(){var t,e;this.option.hackWebsocketConfig&&(t=this.option.hackWebsocketConfig,window.WebSocket=Pt,-1!==(e=Lt.findIndex(function(e){return e.key===t.key})))&&Lt.splice(e,1)}}),Ut=(new e({name:"click"}),function(e){if(""!==e.id&&e.id)return'id("'+e.id+'")';if(e===document.body)return e.tagName;if(e instanceof Document)return"document";var t=0;if(e.parentNode)for(var n=e.parentNode.childNodes,r=0;r<n.length;r+=1){var i=n[r];if(i===e)return Ut(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&(t+=1)}return 0}),Bt=function(e){return e instanceof Array?new Map(e.map(function(e){return[e,!0]})):new Map},zt=function(e,t){return"string"==typeof e?e.split(t):[]},jt=function(e){if(3===e.nodeType||4===e.nodeType)return e.nodeValue||"";if(1!==e.nodeType)return"";if("string"==typeof e.textContent)return e.textContent;for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=jt(n);return t},Ht=new e({name:"click",listeners:[],onNewTdem:function(e){this.startListen(e)},startListen:function(a){for(var e=function(o){t.listeners.push(((e,t,n,r)=>{function i(e){var t=document.documentElement;t&&n.call(t,e,e.target)}return void 0===r&&(r=!0),e.addEventListener(t,i,r),{destroy:function(){e.removeEventListener(t,i,r)}}})(document,o,function(e,t){var n,r,i;t&&!((e,t)=>{e="object"==typeof e.click?e.click:void 0,n=Bt((null==e?void 0:e.ignoreClasses)||[])||new Map;for(var n,r=(e={ignoreIds:Bt((null==e?void 0:e.ignoreIds)||[])||new Map,ignoreClasses:n}).ignoreClasses,i=e.ignoreIds,o=!(0===i.size&&0===r.size),a=t,s=(zt(t.getAttribute("id")||""," "),zt(t.getAttribute("class")||"",""),0),l=!1;a&&o&&a.getAttribute;){if(l)return!0;if(10<=s)break;for(var u=zt(a.getAttribute("id")||""," "),c=zt(a.getAttribute("class")||"",""),d=0,h=u;d<h.length;d++){var f=h[d];if(i.has(f)){l=!0;break}}for(var p=0,m=c;p<m.length;p++){var g=m[p];if(r.has(g)){l=!0;break}}s+=1,a=a.parentNode||a.parentElement}return!1})(a.config,t)&&(i=Ut(t),n=pt(t),r=t.getBoundingClientRect&&t.getBoundingClientRect(),i={event_id:g(),event_type:p.CLICK,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:window.location.href,data:{target_element:String(i),target_text:n.slice(0,127),click_position:r?{x:parseInt(String(r.left+window.scrollX),10)||0,y:parseInt(String(r.top+window.scrollY),10)||0}:void 0,replay_id:nt(a),tags:{environment:a.config.env||"production",event_op:o,node_name:(null==t?void 0:t.nodeName)||""},event_properties:{target_id:t.id||"",target_class:"string"==typeof t.className?t.className.slice(0,128):""}}},null!=(n=a.reportTDEMEvent))&&n.call(a,i)},!0))},t=this,n=0,r=Object.entries({click:1,longpress:2});n<r.length;n++)e(r[n][0])},destroy:function(){this.listeners.forEach(function(e){return e.destroy()}),this.listeners=[]}}),Wt=(new e({name:"console"}),["log","error","warn","info","debug","trace"]),Gt={log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace};var qt,Vt,Zt,Kt,Jt,Xt,$t,Yt,Qt,en,tn,nn=new e({name:"console",onNewTdem:function(e){this.startListen(e)},startListen:function(e){var h,f;f="object"==typeof(h=e).config.console?h.config.console:void 0,Wt.forEach(function(c){var d=Gt[c];console[c]=function(){for(var e,t,n,r,i,o,a,s,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];try{d.apply(console,l),o=c,a=h.isWhiteList,("all"===(s=(null==(s=f)?void 0:s.level)||"error")||a||("error"===s?"error"===o:"warn"===s?"error"===o||"warn"===o:"info"===s?["error","warn","info"].includes(o):"log"===s?["error","warn","info","log"].includes(o):"error"===o))&&(r=l.map(function(e){if("object"==typeof e&&null!==e)try{return JSON.stringify(e)}catch(e){}return String(e)}).join(" "),i={event_id:g(),event_type:p.LOG,event_category:m.LOG,timestamp:Date.now(),page_url:(null==(e=h.getOriginFrom)?void 0:e.call(h))||("undefined"!=typeof window?null==(t=window.location)?void 0:t.href:""),data:{log_level:"error"===c?"error":"warn"===c?"warn":"info",replay_id:nt(h),tags:{console_method:c},event_properties:{message:("console."+c+": "+r).slice(0,2048)}}},null!=(n=h.reportTDEMEvent)&&n.call(h,i))}catch(e){Gt.error("Console hook error:",e)}}})},destroy:function(){Object.keys(Gt).forEach(function(e){console[e]=Gt[e]})}});function rn(){Kt=[],Vt=-1,qt=null,en(addEventListener)}Jt={passive:!0,capture:!0},Xt=new Date,$t=function(e,t){qt||(qt=t,Vt=e,Zt=new Date,en(removeEventListener),Yt())},Yt=function(){var t;0<=Vt&&Vt<Zt-Xt&&(t={entryType:"first-input",name:qt.type,target:qt.target,cancelable:qt.cancelable,startTime:qt.timeStamp,processingStart:qt.timeStamp+Vt},Kt.forEach(function(e){e(t)}),Kt=[])},Qt=function(e){var t,n,r,i,o,a;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){$t(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,Jt),removeEventListener("pointercancel",o,Jt)},addEventListener("pointerup",i,Jt),addEventListener("pointercancel",o,Jt)):$t(t,e))},en=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,Qt,Jt)})},tn="hidden"===document.visibilityState?0:1/0,addEventListener("visibilitychange",function e(t){"hidden"===document.visibilityState&&(tn=t.timeStamp,removeEventListener("visibilitychange",e,!0))},!0),rn(),self.webVitals={firstInputPolyfill:function(e){Kt.push(e),Yt()},resetFirstInputPolyfill:rn,get firstHiddenTime(){return tn}};function on(e,t){var n=On(),r="navigate";return 0<=Rn?r="back-forward-cache":n&&(document.prerendering||0<Mn()?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}}function an(e,t,n){try{var r;if(PerformanceObserver.supportedEntryTypes.includes(e))return(r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},n||{})),r}catch(e){}}function sn(t,n,r,i){var o,a;return function(e){0<=n.value&&(e||i)&&((a=n.value-(o||0))||void 0===o)&&(o=n.value,n.delta=a,n.rating=(e=n.value)>r[1]?"poor":e>r[0]?"needs-improvement":"good",t(n))}}function ln(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function un(t){function e(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)}addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)}function cn(t){var n=!1;return function(e){n||(t(e),n=!0)}}function dn(){return In<0&&(In=An(),Ln(),xn(function(){setTimeout(function(){In=An(),Ln()},0)})),{get firstHiddenTime(){return In}}}function hn(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function fn(o,a){a=a||{},hn(function(){var t,n=dn(),r=on("FCP"),i=an("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<n.firstHiddenTime)&&(r.value=Math.max(e.startTime-Mn(),0),r.entries.push(e),t(!0))})});i&&(t=sn(o,r,Nn,a.reportAllChanges),xn(function(e){r=on("FCP"),t=sn(o,r,Nn,a.reportAllChanges),ln(function(){r.value=performance.now()-e.timeStamp,t(!0)})}))})}function pn(e){var t,n,r,i,o,a;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){zn(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,Un),removeEventListener("pointercancel",o,Un)},addEventListener("pointerup",i,Un),addEventListener("pointercancel",o,Un)):zn(t,e))}function mn(e){e.forEach(function(e){e.interactionId&&(qn=Math.min(qn,e.interactionId),Vn=Math.max(Vn,e.interactionId),Gn=Vn?(Vn-qn)/7+1:0)})}function gn(){return Zn()-Jn}function vn(e){var t=Xn[Xn.length-1],n=$n[e.interactionId];(n||Xn.length<10||e.duration>t.latency)&&(n?(n.entries.push(e),n.latency=Math.max(n.latency,e.duration)):(t={id:e.interactionId,latency:e.duration,entries:[e]},$n[t.id]=t,Xn.push(t)),Xn.sort(function(e,t){return t.latency-e.latency}),Xn.splice(10).forEach(function(e){delete $n[e.id]}))}function yn(e,t){function n(t,n,r,i){function o(e){"visibilitychange"===t&&"hidden"!==document.visibilityState||(i?setTimeout(function(){return n(e)},i):n(e),r&&removeEventListener(t,o,!0))}addEventListener(t,o,!0)}var r;n("visibilitychange",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.visibilitychange),n("pagehide",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.pagehide),n("beforeunload",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.beforeunload)}function wn(e){var t=e.name;0<(e=e.value)&&(tr[t]=e)}function bn(e,t,n,r){return void 0===n&&(n=15e3),void 0===r&&(r=0),(t=void 0===t?0:t)<=e&&e<=n?e:r}var kn,Sn,_n,En,Cn,Tn,Rn=-1,xn=function(t){addEventListener("pageshow",function(e){e.persisted&&(Rn=e.timeStamp,t(e))},!0)},On=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Mn=function(){var e=On();return e&&e.activationStart||0},In=-1,An=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pn=function(e){"hidden"===document.visibilityState&&-1<In&&(In="visibilitychange"===e.type?e.timeStamp:0,Dn())},Ln=function(){addEventListener("visibilitychange",Pn,!0),addEventListener("prerenderingchange",Pn,!0)},Dn=function(){removeEventListener("visibilitychange",Pn,!0),removeEventListener("prerenderingchange",Pn,!0)},Nn=[1800,3e3],Fn=[.1,.25],Un={passive:!0,capture:!0},Bn=new Date,zn=function(e,t){kn||(kn=t,Sn=e,_n=new Date,Hn(removeEventListener),jn())},jn=function(){var t;0<=Sn&&Sn<_n-Bn&&(t={entryType:"first-input",name:kn.type,target:kn.target,cancelable:kn.cancelable,startTime:kn.timeStamp,processingStart:kn.timeStamp+Sn},En.forEach(function(e){e(t)}),En=[])},Hn=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,pn,Un)})},Wn=[100,300],Gn=0,qn=1/0,Vn=0,Zn=function(){return Cn?Gn:performance.interactionCount||0},Kn=[200,500],Jn=0,Xn=[],$n={},Yn=[2500,4e3],Qn={},er=(cr.prototype.start=function(){var t=this,n=new PerformanceObserver(function(e){e=e.getEntriesByName("first-contentful-paint");0<e.length&&(t.fcp=e[0].startTime,t.slientWindowStartTime=t.fcp,n.disconnect(),setTimeout(function(){t.checkTTI()},Math.max(t.slienceTimeInterval-(performance.now()-t.fcp)+20,1)))});n.observe({entryTypes:["paint"]}),this.longtaskObserver=new PerformanceObserver(function(e){e=e.getEntries();t.longTaskEntries=t.longTaskEntries.concat(e)}),this.longtaskObserver.observe({entryTypes:["longtask"]}),this.resourceObserver=new PerformanceObserver(function(e){e=e.getEntries();t.resourceEntries=t.resourceEntries.concat(e)}),this.resourceObserver.observe({entryTypes:["resource"]})},cr.prototype.checkTTI=function(){var e=this;this.hasSlientWindow()?(this.calculateTTI(),this.longtaskObserver.disconnect(),this.resourceObserver.disconnect()):setTimeout(function(){e.checkTTI()},this.checkInterval)},cr.prototype.hasSlientWindow=function(){var e,t=performance.now();return!(t-this.slientWindowStartTime<5e3||((e=this.getLastLongTaskEndTime())>this.slientWindowStartTime?(this.slientWindowStartTime=e,this.resourceEntries=[]):this.getRequestCount(this.slientWindowStartTime,t)<=2?(this.lastLongtaskEndTime=e,0):(t=this.resourceEntries.sort(function(e,t){return e.startTime-t.startTime}),this.slientWindowStartTime=t[this.resourceEntries.length-2].startTime,1)))},cr.prototype.getLastLongTaskEndTime=function(){var t;return 0===this.longTaskEntries.length?-1:(t=0,this.longTaskEntries.forEach(function(e){e.startTime+e.duration>t&&(t=e.startTime+e.duration)}),t)},cr.prototype.getRequestCount=function(t,n){var r=0;return this.resourceEntries.forEach(function(e){e.startTime>=t&&e.startTime+e.duration<=n&&(r+=1)}),r},cr.prototype.calculateTTI=function(){var e=-1===this.lastLongtaskEndTime?this.slientWindowStartTime:this.lastLongtaskEndTime,t=performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,e=Math.max(t,e);this.onTTICallback(e)},cr),tr=(new e({name:"webVitals"}),{FCP:-1,LCP:-1,FID:-1,CLS:-1,INP:-1,TTI:-1,from:void 0}),nr=new Map,rr=new e({name:"webVitals",onNewTdem:function(e){var t,n,r,o,a,s,l,u,c,d,h,i=this;if(et()&&"function"==typeof window.PerformanceObserver&&"function"==typeof performance.getEntriesByName)try{nr.set(e,{isWebVitalsReported:!1,hasFirstEntry:!1,custom:null}),fn(wn),d=wn,h={},hn(function(){function e(e){(e=e[e.length-1])&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Mn(),0),i.entries=[e],t())}var t,n,r=dn(),i=on("LCP"),o=an("largest-contentful-paint",e);o&&(t=sn(d,i,Yn,h.reportAllChanges),n=cn(function(){Qn[i.id]||(e(o.takeRecords()),o.disconnect(),Qn[i.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(n,0)},!0)}),un(n),xn(function(e){i=on("LCP"),t=sn(d,i,Yn,h.reportAllChanges),ln(function(){i.value=performance.now()-e.timeStamp,Qn[i.id]=!0,t(!0)})}))}),u=wn,c={},hn(function(){function t(e){e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),o(!0))}function e(e){e.forEach(t)}var n=dn(),r=on("FID"),i=an("first-input",e),o=sn(u,r,Wn,c.reportAllChanges);i&&un(cn(function(){e(i.takeRecords()),i.disconnect()})),i&&xn(function(){r=on("FID"),o=sn(u,r,Wn,c.reportAllChanges),En=[],Sn=-1,kn=null,Hn(addEventListener),En.push(t),jn()})}),s=wn,l={},fn(cn(function(){function e(e){e.forEach(function(e){var t,n;e.hadRecentInput||(t=i[0],n=i[i.length-1],r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]))}),r>n.value&&(n.value=r,n.entries=i,t())}var t,n=on("CLS",0),r=0,i=[],o=an("layout-shift",e);o&&(t=sn(s,n,Fn,l.reportAllChanges),un(function(){e(o.takeRecords()),t(!0)}),xn(function(){n=on("CLS",r=0),t=sn(s,n,Fn,l.reportAllChanges),ln(function(){return t()})}),setTimeout(t,0))})),o=wn,a={},hn(function(){var e;"interactionCount"in performance||(Cn=Cn||an("event",mn,{type:"event",buffered:!0,durationThreshold:0}));function t(e){e.forEach(function(t){t.interactionId&&vn(t),"first-input"!==t.entryType||Xn.some(function(e){return e.entries.some(function(e){return t.duration===e.duration&&t.startTime===e.startTime})})||vn(t)}),e=Math.min(Xn.length-1,Math.floor(gn()/50)),(e=Xn[e])&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}var n=on("INP"),r=an("event",t,{durationThreshold:null!=(e=a.durationThreshold)?e:40}),i=sn(o,n,Kn,a.reportAllChanges);r&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&r.observe({type:"first-input",buffered:!0}),un(function(){t(r.takeRecords()),n.value<0&&0<gn()&&(n.value=0,n.entries=[]),i(!0)}),xn(function(){Xn=[],Jn=Zn(),n=on("INP"),i=sn(o,n,Kn,a.reportAllChanges)}))}),r=function(e){wn({name:"TTI",value:e})},et()&&new er(r).start(),yn(function(){i.tryReport(e,null,"onHidden")},{once:!0,delay:{visibilitychange:10}}),tr.from=(null==(n=null==(t=e)?void 0:t.getOriginFrom)?void 0:n.call(t))||window.location.href}catch(e){}},tryReport:function(t,n,r){var i=this;void 0===r&&(r="manual"),this.$walk(function(e){e===t&&("object"==typeof(e=i.$getConfig(t))&&!0===e.manualReport||"onHidden"!==r?(e=nr.get(t))&&!e.hasFirstEntry?(e.hasFirstEntry=!0,"manual"===r&&n&&(e.custom=n)):i.doReport(t,(null==e?void 0:e.custom)||n):i.doReport(t,null))})},doReport:function(o,a){var e=nr.get(o);if(e){if(null!=e&&e.isWebVitalsReported)return;e.isWebVitalsReported=!0}this.$walk(function(e){var t,n,r,i;e===o&&(t=f({},tr),a&&Object.keys(a).forEach(function(e){null!=a[e]&&(t[e]=a[e])}),n={environment:e.config.env||"production",version:String(e.config.version||"")},r={},0<t.LCP&&(r.lcp=t.LCP),0<t.FCP&&(r.fcp=t.FCP),0<t.FID&&(r.fid=t.FID),0<=t.CLS&&(r.cls=t.CLS),0<t.TTFB&&(r.ttfb=t.TTFB),0<t.TTI&&(r.tti=t.TTI),0<t.INP&&(r.inp=t.INP),i={event_id:g(),event_type:p.true,event_category:m.PERFORMANCE,timestamp:Date.now(),page_url:t.from||(null==(i=e.getOriginFrom)?void 0:i.call(e))||window.location.href,data:{measurements:r,replay_id:nt(e),tags:n}},null!=(r=e.reportTDEMEvent))&&r.call(e,i)})},publish:function(e,t){this.tryReport(e,t,"manual")},destroy:function(){this.option.publish=function(){}}}),ir=(new e({name:"pagePerformance"}),3),or=new Map,ar=new e({name:"pagePerformance",performanceMap:{},onNewTdem:function(t){var e;et()&&(or.set(t,{isPagePerformanceReported:!1}),Tn?this.publish(Tn,t):this.startCalcPerformance(t),e=this.publishWhenObHidden.bind(this,t),yn(e,{once:!0}),t.lifeCycle.on("destroy",function(){var e=or.get(t);e&&(e.isPagePerformanceReported=!1)}))},publishWhenObHidden:function(e){var t,n=or.get(e);if(null==n||!n.isPagePerformanceReported){n=0;if(null!=(t=e.firstScreenInfo)&&t.timing)n=e.firstScreenInfo.timing;else if(tt("paint"))try{var r,i=performance.getEntriesByName("first-contentful-paint");i&&0<i.length&&(r=i[0])&&0<r.startTime&&(n=r.startTime)}catch(e){}(Tn=this.buildPerformanceLog(e,n,this.getPageUrl(e),window.location.href))&&this.publish(Tn,e,!0)}},buildPerformanceLog:function(e,t,n,r){var i=performance.timing;if(i)return n={from:n,originFrom:r,dnsLookup:bn(i.domainLookupEnd-i.domainLookupStart),tcp:bn(i.connectEnd-i.connectStart),ssl:bn(0===i.secureConnectionStart?0:i.requestStart-i.secureConnectionStart),ttfb:bn(i.responseStart-i.requestStart),contentDownload:bn(i.responseEnd-i.responseStart),domParse:bn(i.domInteractive-i.domLoading,0,15e3,1070),resourceDownload:bn(i.loadEventStart-i.domInteractive,0,15e3,1070),firstScreenTiming:bn(Math.floor(t),0,15e3,15e3)},(r=e.config).extraPerformanceData&&"{}"!==JSON.stringify(r.extraPerformanceData)&&(t=(i=r.extraPerformanceData).engineInit,e=i.bundleLoad,n=f(f({},n),{engineInit:bn(t,0,1e4),bundleLoad:bn(e,0,1e4)})),n},publish:function(r,i){var o=this;this.$walk(function(e){var t,n;e===i&&(n=(t=performance.timing).navigationStart,t={event_id:g(),event_type:p.PAGE_LOAD,event_category:m.PERFORMANCE,timestamp:Date.now(),page_url:r.originFrom||window.location.href,data:{measurements:{lcp:tr.lcp,fcp:tr.fcp,fid:tr.fid,cls:tr.cls,ttfb:tr.ttfb||r.ttfb,dns_time:r.dnsLookup,tcp_time:r.tcp,ssl_time:r.ssl,request_time:r.ttfb,response_time:r.contentDownload,dom_parse_time:r.domParse,dom_ready:t.domContentLoadedEventEnd-n,load_complete:t.loadEventEnd-n,first_screen_time:r.firstScreenTiming},replay_id:nt(e),device_type:o.getDeviceType(),tags:{environment:e.config.env||"production",version:String(e.config.version||"")}}},null!=(n=e.reportTDEMEvent)&&n.call(e,t),n=or.get(e))&&(n.isPagePerformanceReported=!0)})},getPageUrl:function(e){var t=this.$getConfig(e);if(null!=t&&t.urlHandler&&"function"==typeof(null==t?void 0:t.urlHandler)){t=null==t?void 0:t.urlHandler();if(t)return encodeURIComponent(t)}return e.getCurrentPageUrl()},getDeviceType:function(){var e=navigator.userAgent;return/mobile/i.test(e)?"Mobile":/tablet|ipad/i.test(e)?"Tablet":"Desktop"},startCalcPerformance:function(t){var n=this;try{var r=this.getPageUrl(t),i=t.getOriginFrom();this.getFirstScreenTiming(t,function(e){Tn=n.buildPerformanceLog(t,e,r,i);e=or.get(t);!Tn||null!=e&&e.isPagePerformanceReported||n.publish(Tn,t)})}catch(t){}},getFirstScreenTiming:function(s,l){var u=this;s.lifeCycle.on("destroy",function(){g&&clearTimeout(g)});var c,d=this,n=["script","style","link","br"],h=[],f={},p=(tt("paint")&&(c=new PerformanceObserver(function(e){e.getEntries().forEach(function(e){var t;"paint"===e.entryType&&"first-contentful-paint"===e.name&&0<(t=document.querySelectorAll("[TDEM-FIRST-SCREEN-TIMING],[AEGIS-FIRST-SCREEN-TIMING]")).length&&s.config.id&&!u.performanceMap[s.config.id]&&(u.setFirstScreenInfo(s,e.startTime,t[0],t),null!=l&&l(e.startTime),p.disconnect(),c.disconnect(),g)&&clearTimeout(g)})})).observe({entryTypes:["paint"]}),new MutationObserver(function(e){var t={roots:[],ignores:[],rootsDomNum:[],time:performance.now()};e.forEach(function(e){e&&e.addedNodes&&Array.prototype.slice.call(e.addedNodes).forEach(function(e){d.isEleInArray(e,t.ignores)?t.ignores.push(e):1===e.nodeType&&(e.hasAttribute("TDEM-FIRST-SCREEN-TIMING")||e.hasAttribute("AEGIS-FIRST-SCREEN-TIMING"))?(Object.prototype.hasOwnProperty.apply(f,[t.time])||(f[t.time]=[]),f[t.time].push(e)):1===e.nodeType&&(d.hasAncestorOrSelfWithAttribute(e,"TDEM-IGNORE-FIRST-SCREEN-TIMING")?t.ignores.push(e):-1!==n.indexOf(e.nodeName.toLocaleLowerCase())||d.isEleInArray(e,t.roots)||(t.roots.push(e),t.rootsDomNum.push(d.walkAndCount(e)||0)))})}),t.roots.length&&h.push(t)})),m=(p.observe(document,{childList:!0,subtree:!0}),function(n){(n=void 0===n?0:n)||(r=0,(e=Object.keys(f)).length?(n=Math.max.apply(null,e),u.setFirstScreenInfo(s,n,null==(e=f[n])?void 0:e[0],f)):h.forEach(function(e){for(var t=0;t<e.roots.length;t++)e.rootsDomNum[t]>r&&d.isInFirstScreen(e.roots[t])&&(r=e.rootsDomNum[t],n=e.time,u.setFirstScreenInfo(s,n,e.roots[t]))}),h.length=0,Object.keys(f).forEach(function(e){f[e]=f[e].map(function(e){var t={tagName:e.tagName},n=e.attributes;if(!n)return e;for(var r=0;r<n.length;r++){var i=n[r];i.name&&(t[i.name]=e.getAttribute(i.name))}return t})}));var r,e=performance.timing,t=e.domInteractive-e.domLoading,i=n;g=null;for(var o=0,a=[t,e.loadEventStart-e.domInteractive,i];o<a.length;o++)if(a[o]<=0&&0<ir){g=setTimeout(function(){return m(i)},3e3);break}g?--ir:(p.disconnect(),null!=c&&c.disconnect(),null!=l&&l(n))}),g=setTimeout(function(){return m()},3e3)},setFirstScreenInfo:function(e,t,n,r){var i;e.config.id&&this.performanceMap[e.config.id]||(e.config.id&&(this.performanceMap[e.config.id]=!0),("object"!=typeof(null==(i=e.config)?void 0:i.pagePerformance)||null!=(i=e.config.pagePerformance)&&i.firstScreenInfo)&&(e.firstScreenInfo={element:n,timing:t,markDoms:r}))},isEleInArray:function(e,t){return!(!e||e===document.documentElement)&&(-1!==t.indexOf(e)||this.isEleInArray(e.parentElement,t))},isInFirstScreen:function(e){var t;return!(!e||"function"!=typeof e.getBoundingClientRect)&&(e=e.getBoundingClientRect(),t=window.innerHeight,0<=e.left)&&e.left<window.innerWidth&&0<=e.top&&e.top<t&&0<e.width&&0<e.height},walkAndCount:function(e){var t=0;if(e&&1===e.nodeType){t+=1;var n=e.children;if(null!=n&&n.length)for(var r=0;r<n.length;r++)1===n[r].nodeType&&(n[r].hasAttribute("TDEM-IGNORE-FIRST-SCREEN-TIMING")||n[r].hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING"))||(t+=this.walkAndCount(n[r]))}return t},hasAncestorOrSelfWithAttribute:function(e,t){for(var n=t.replace(/^TDEM-/,"AEGIS-"),r=e;r&&r!==document.body;){if(r.hasAttribute(t)||n!==t&&r.hasAttribute(n))return!0;r=r.parentElement}return!1}}),sr=(new e({name:"spa"}),["replaceState","pushState","popstate","hashchange"]),lr=new e({name:"spa",originFireUrl:"",lastPageUrl:"",navigationStack:[],navigationIndex:-1,onNewTdem:function(n){var r=this,e=(history.pushState=this.wr("pushState")||history.pushState,history.replaceState=this.wr("replaceState")||history.replaceState,this.sendPv=this.sendPv.bind(this),location.href);this.navigationStack.length||(this.navigationStack=[e],this.navigationIndex=0),n.config.spa&&this.sendPv(n,"reload"),sr.forEach(function(e){var t=e;window.addEventListener(e,function(){return r.sendPv.call(r,n,t)})})},wr:function(n){var r=history[n],e="__"+n+"__hasWrittenByTamSpa";return"function"==typeof r&&!history[e]&&(Object.defineProperty(history,e,{value:!0,enumerable:!1}),function(){var e=r.apply(this,arguments),t=null;return"function"==typeof Event?t=new Event(n):(t=document.createEvent("HTMLEvents")).initEvent(n,!1,!0),window.dispatchEvent(t),e})},resolveNavigationType:function(e,t){var n;return"pushState"===e?(this.navigationIndex<this.navigationStack.length-1&&(this.navigationStack=this.navigationStack.slice(0,this.navigationIndex+1)),this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"push"):"replaceState"===e?(this.navigationIndex<0?(this.navigationStack=[t],this.navigationIndex=0):this.navigationStack[this.navigationIndex]=t,"replace"):"hashchange"===e?"hashchange":"popstate"===e?0<=(e=this.navigationStack.lastIndexOf(t))?(n=e<this.navigationIndex?"back":"forward",this.navigationIndex=e,n):(this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"forward"):"reload"},sendPv:function(s,e){var l=this;void 0===e&&(e="reload"),setTimeout(function(){s._customPageUrl=null;var r=location.pathname+location.hash+s.config.id,i=s.getOriginFrom(),o=l.lastPageUrl||void 0,a=l.resolveNavigationType(e,location.href);l.$walk(function(e){var t,n;e===s&&r&&r!==l.originFireUrl&&(n={event_id:g(),event_type:p.PAGE_VIEW,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:i,data:{page_title:document.title||"",referrer:document.referrer||void 0,is_effective_action:!0,replay_id:nt(e),tags:{environment:e.config.env||"production",version:String(e.config.version||""),is_spa:"true"},event_properties:{navigation_type:a,from_page:(o||"").slice(0,512),to_page:(i||"").slice(0,512)}}},null!=(t=e.reportTDEMEvent)&&t.call(e,n),l.originFireUrl=r,l.lastPageUrl=i)})},0)},destroy:function(){this.option.sendPv=function(){}}}),ur="__MONITOR_SESSION_V1__";function cr(e){this.slienceTimeInterval=5e3,this.checkInterval=100,this.fcp=0,this.longTaskEntries=[],this.resourceEntries=[],this.slientWindowStartTime=performance.now(),this.onTTICallback=e}function dr(e,t){"undefined"!=typeof document&&(e=[e+"="+encodeURIComponent(t),"path=/","SameSite=Lax"],"undefined"!=typeof location&&"https:"===location.protocol&&e.push("Secure"),document.cookie=e.join("; "))}function hr(e,t,n){void 0===n&&(n=1);var r=Date.now();return{sessionId:e,createdAt:r,lastActivity:r,source:t,version:n}}function fr(e){try{sessionStorage.setItem("__MONITOR_SESSION_V1__",JSON.stringify(e))}catch(e){}}function pr(e,t){var n,r,i;return"undefined"==typeof window?hr(t(),e):(r="undefined"!=typeof document&&(r="_tdem_s".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)")))?decodeURIComponent(r[1]):null,n=window[ur],r?(null==n?void 0:n.sessionId)===r?(n.lastActivity=Date.now(),fr(n),n):(i=hr(r,(null==n?void 0:n.source)||e,(null==n?void 0:n.version)||1),fr(window[ur]=i),i):null!=n&&n.sessionId?(n.lastActivity=Date.now(),dr("_tdem_s",n.sessionId),fr(n),n):(i=hr(t(),e),dr("_tdem_s",(window[ur]=i).sessionId),fr(i),i))}kr.prototype.request=function(o,a){var s=this;return void 0===a&&(a={}),o.sendBeacon||o.handoff?this.handoff(o,a):new Promise(function(n){var e,r,t,i=new XMLHttpRequest;i.sendByTdem=!0,i.addEventListener("readystatechange",function(){var e,t;4===i.readyState&&((e={ok:0<i.status&&i.status<400,status:i.status,statusText:i.statusText,body:i.response,request:o}).ok?(null!=(t=a.success)&&t.call(a,i.response),null!=(t=a.final)&&t.call(a,e),n(e)):(t=f(f({},e),{error:i.response}),null!=(e=a.fail)&&e.call(a,i.response),null!=(e=a.final)&&e.call(a,t),n(t)))}),"get"===(o.method||"GET").toLowerCase()?(i.open("get",(e=o.url,r=o.data,"string"!=typeof e?"":"object"==typeof r&&r?(t=Object.getOwnPropertyNames(r).map(function(e){var t=r[e];return e+"="+("string"==typeof t?encodeURIComponent(t):encodeURIComponent(JSON.stringify(t)))}).join("&").replace(/eval/gi,"evaI"),e+(-1===e.indexOf("?")?"?":"&")+t):e)),s.applyHeaders(i,o.headers),i.send()):(i.open("post",o.url),s.applyHeaders(i,o.headers),o.contentType&&i.setRequestHeader("Content-Type",o.contentType),"string"==typeof(t=void 0!==o.body?o.body:o.data)&&(t=t.replace(/eval/gi,"evaI")),i.send(t))})},kr.prototype.handoff=function(e,t){void 0===t&&(t={});var n,r="undefined"!=typeof navigator?navigator:void 0;return r&&"function"==typeof r.sendBeacon?(n=void 0!==e.body?e.body:e.data,n={ok:r=r.sendBeacon(e.url,n),request:e,handoffAccepted:r,error:r?void 0:new Error("navigator.sendBeacon rejected the payload")},r?null!=(r=t.success)&&r.call(t,{accepted:!0}):null!=(r=t.fail)&&r.call(t,n.error),null!=(r=t.final)&&r.call(t,n),Promise.resolve(n)):(r={ok:!1,request:e,error:new Error("navigator.sendBeacon is unavailable")},null!=(n=t.fail)&&n.call(t,r.error),null!=(e=t.final)&&e.call(t,r),Promise.resolve(r))},kr.prototype.applyHeaders=function(t,n){n&&Object.keys(n).forEach(function(e){t.setRequestHeader(e,n[e])})};var mr,gr,vr=kr,yr=new Map,wr=(O(gr=r,wr=mr=Ye),gr.prototype=null===wr?Object.create(wr):(br.prototype=wr.prototype,new br),r.prototype._bootstrapInit=function(e){this.setConfig(e),this.config=P(this.config,e.hostUrl),this._prefetchConfigAndInit(e)},r.prototype._initImmediately=function(e){this.init(e),this._afterInit(e)},r.prototype._prefetchConfigAndInit=function(a){return M(this,void 0,void 0,function(){var t,n,r,i,o;return I(this,function(e){switch(e.label){case 0:if(t=this.config.id,n=this._buildPrefetchConfigUrl(),r=!1,i=null,!t||!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transportRequest({kind:"config",url:n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:t})})];case 2:return(o=e.sent()).ok&&0===(o="string"==typeof o.body?JSON.parse(o.body):o.body).code&&o.data&&(r=!!o.data.enabled,i=o.data),[3,4];case 3:return e.sent(),r=this._loadEnabledFromCache(t),[3,4];case 4:if(r){i&&(this._prefetchedConfigData=i);try{this._initAfterPreparedConfig(a)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),this.sendSDKError(e)}}else console.info("[TDEM] SDK disabled by remote config, skip initialization");return[2]}})})},r.prototype._buildPrefetchConfigUrl=function(){var e=(this.config.url||"").replace(/\/+$/,"");return e?e+"/api/v1/config":""},r.prototype._loadEnabledFromCache=function(e){try{var t,n=localStorage.getItem("TDEM_SAMPLE_CONFIG");return n?(t=JSON.parse(n)).projectKey===e&&Date.now()-t.timestamp<6048e5&&0<t.sampleRate:!1}catch(e){return!1}},r.prototype._initAfterPreparedConfig=function(e){for(var t=0;t<Ye.installedPlugins.length;t++)try{Ye.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited"),this._afterInit(e)},r.prototype._afterInit=function(e){var t,o,n=this;this._sdkInitialized=!0,this.extendBean("sessionId",r.sessionID),this.extendBean("from",this.getCurrentPageUrl()),"undefined"!=typeof document&&this.extendBean("referer",encodeURIComponent(document.referrer||"")),t=F(L("tdem-web-retry-report-requests"),[]),(o=function(){var i;t.length&&(i=t.splice(0,1)[0],D("tdem-web-retry-report-requests",JSON.stringify(t)),n.$request(i,function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=yr.get(null==(e=i.extraRetryOptions)?void 0:e.success))?void 0:t.apply(i,n)}finally{o()}},function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=yr.get(null==(e=i.extraRetryOptions)?void 0:e.fail))?void 0:t.apply(i,n)}finally{o()}}))})()},r.prototype.getBean=function(t){var n=this;return void 0===t&&(t=[]),""+Object.getOwnPropertyNames(this.bean).filter(function(e){return-1===t.indexOf(e)}).map(function(e){return"from"===e?"from="+n.getCurrentPageUrl():e+"="+n.bean[e]}).join("&")},r.prototype.getCurrentPageUrl=function(){var e;return this._customPageUrl?encodeURIComponent(this._customPageUrl.slice(0,2048)):(e=this.config.pageUrl||location.href,e=(e="function"==typeof this.config.urlHandler?this.config.urlHandler()||location.href:e).slice(0,2048),encodeURIComponent(e))},r.prototype.getOriginFrom=function(){if(this._customPageUrl)return this._customPageUrl.slice(0,2048);try{return("undefined"!=typeof window&&window.location?window.location.href:"").slice(0,2048)}catch(e){return""}},r.prototype.ready=function(){function o(){var e,n,r,i;t.reportRequestQueue.length&&(e=t.reportRequestQueue.splice(0,1)[0],n=e.options,r=e.success,i=e.fail,t.$request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==r?void 0:r.apply(n,e)}finally{o()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==i?void 0:i.apply(n,e)}finally{o()}}))}var t=this;o(),this.isReportReady=!0},r.prototype.request=function(l,n,u){var c,d,h=this;this.config.reportImmediately||this.isReportReady?this.$request(l,c=function(e){var t=F(L("tdem-web-retry-report-requests"),[]);null!=t&&t.length&&l.extraRetryOptions&&(t.splice(t.findIndex(function(e){return e.extraRetryOptions.requestId===l.extraRetryOptions.requestId}),1),D("tdem-web-retry-report-requests",JSON.stringify(t)),yr.delete(l.extraRetryOptions.success),yr.delete(l.extraRetryOptions.fail)),null!=n&&n(e)},d=function(e){if(!h.config.reportRetry)return null==u?void 0:u(e);var t,n="boolean"==typeof h.config.reportRetry?Rt:f(f({},Rt),h.config.reportRetry),r=n.maxRetryCount,i=void 0===r?Rt.maxRetryCount:r,r=n.retryInterval,r=void 0===r?Rt.retryInterval:r,n=n.whenRetryEndStillFail,o=void 0===n?Rt.whenRetryEndStillFail:n,a=(l.extraRetryOptions||(l.extraRetryOptions={requestId:"",retriedCount:0,success:"",fail:""}),l.extraRetryOptions),s=(a.requestId=a.requestId||l.url+"-"+Date.now()+"-"+Math.random(),a.requestId),n=(a.retriedCount=a.retriedCount||0,a.success=a.success||s+"_successCallback",a.fail=a.fail||s+"_failCallback",F(L("tdem-web-retry-report-requests"),[]));n.find(function(e){return e.extraRetryOptions.requestId===s})?(t=n.findIndex(function(e){return e.extraRetryOptions.requestId===s}),n[t]=l):n.push(l),D("tdem-web-retry-report-requests",JSON.stringify(n)),setTimeout(function(){if(a.retriedCount<i)l.extraRetryOptions.retriedCount+=1,h.$request(l,c,d);else{if("discard"===o){var e=F(L("tdem-web-retry-report-requests"),[]).filter(function(e){return(null==(e=e.extraRetryOptions)?void 0:e.requestId)!==s});if(e.length)D("tdem-web-retry-report-requests",JSON.stringify(e));else try{localStorage.removeItem("tdem-web-retry-report-requests")}catch(e){}}yr.delete(a.success),yr.delete(a.fail)}},"function"==typeof r?r(l.extraRetryOptions.retriedCount):r),null!=u&&u(e),yr.has(a.success)||yr.set(a.success,c),yr.has(a.fail)||yr.set(a.fail,d)}):this.reportRequestQueue.push({options:l,success:n,fail:u})},r.prototype.$request=function(s,e,t){var n,r;if(s&&"string"==typeof s.url&&""!==s.url&&this.bean.id)return n=s.url,!1!==s.addBean&&(n=((e,t)=>{var n,r,i,o=e,a=s.beanFilter||[];for(n in t)-1===a.indexOf(n)&&((i=(r=new RegExp("([?&])"+n+"(=([^&]*))?(?=&|$)")).exec(o))?i[2]&&""!==i[3]&&"undefined"!==i[3]||(o=o.replace(r,"$1"+n+"="+t[n])):(i=-1<o.indexOf("?")?"&":"?",o+=i+n+"="+t[n]));return o})(n,f(f({},this.bean),{from:this.getCurrentPageUrl()}))),s.url=n,n=s.method||"get",r=this.config.onBeforeRequest,(s=r?r(s,this):s)?s.url?(r={success:e,fail:t},void((e={kind:s.type===oe.WHITE_LIST?"config":"events",url:s.url,method:n.toUpperCase(),contentType:s.contentType,data:s.data,body:s.data,sendBeacon:!!(null!=s&&s.sendBeacon||this.sendNow),source:s}).sendBeacon?this.transportHandoff(e,r):this.transportRequest(e,r))):console.warn("Please handle the parameters reasonably, options.url is necessary"):console.warn("Sending request blocked")},r.prototype.publishPluginsLogs=function(){var e=r.installedPlugins.find(function(e){return"assets"===e.name});null!=e&&e.option.collectNotReportedLog(this)},r.prototype.uploadLogs=function(e,t){var n;void 0===e&&(e={}),void 0===t&&(t={}),null!=(n=this.lifeCycle)&&n.emit("uploadLogs",e,t)},r.prototype.reportWebVitals=function(e){try{var t=r.installedPlugins.find(function(e){return"webVitals"===e.name});t&&this.config.webVitals&&this.config.webVitals.manualReport&&t.option.publish(this,e)}catch(e){}},r.sessionID=pr("tdem",Me).sessionId,r);function r(e,t){var n,r,i,a,o,s,l,u,c,d,h=mr.call(this,e,t=void 0===t?{}:t)||this;h.sendNow=!1,h.isReportReady=!1,h.reportRequestQueue=[],h._sdkInitialized=!1,h.speedLogPipeline=Ze([(u=[],c=(o=h).config,o.lifeCycle.on("destroy",function(){u.length=0}),function(e,t){Array.isArray(e)?u=u.concat(e):u.push(e),s&&u.length>=s||o.sendNow&&0<u.length?(u=_e(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length)),l&&clearTimeout(l)):(l&&clearTimeout(l),l=setTimeout(function(){l=null,u=_e(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length))},c.delay))}),(a=h.config,function(e,t){var n,r,i,o="number"==typeof a.repeat?a.repeat:60;!a.speedSample||o<=0?t(e):(n=(null==a?void 0:a.id)||"0",r=Ce[n]||{},Array.isArray(e)?(i=e.filter(function(e){var t=!r[e.url]||r[e.url]<o;return t?(r[e.url]=1+~~r[e.url],Ce[n]=r):Ee[n]||Te(n),t})).length&&t(i):!r[e.url]||r[e.url]<o?(r[e.url]=1+~~r[e.url],Ce[n]=r,t(e)):Ee[n]||Te(n))}),(i=h,function(t,n){At(function(e){i.extendBean("netType",e),n(t)})}),function(e,t){null!=(n=h.lifeCycle)&&n.emit("beforeReportSpeed",e);var n,r=h.config.beforeReportSpeed;if((e="function"==typeof r?e.filter(function(e){return!1!==r(e)}):e).length)return t(e)},function(e,t){t(e.map(function(e){return void 0!==e.payload&&delete e.payload,e}))},function(e){return h.sendPipeline([function(e,t){t({type:oe.SPEED,url:""+h.config.speedUrl,method:"post",data:ne(e,f(f({},h.bean),{from:h.getCurrentPageUrl()})),log:e})}],oe.SPEED)(e)}]),h.getInternalTransport()||h.setInternalTransport(new vr),e.asyncPlugin=!0;try{"undefined"!=typeof document&&(d=String(e.userId||e.uin||(null!=(n=document.cookie.match(/\buin=\D+(\d*)/))?n:[])[1]||(null!=(r=document.cookie.match(/\bilive_uin=\D*(\d+)/))?r:[])[1]||""),e.userId=d,e.uin=e.uin||d),h._bootstrapInit(e)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),h.sendSDKError(e)}return h}function br(){this.constructor=gr}function kr(){}new e({name:"ie"}),new e({name:"onClose"});function Sr(){var e,l,i,t=document.createElement("canvas");return((e=t.getContext("2d"))?(e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText("tdem,sdk <canvas> 1.0",2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText("tdem,sdk <canvas> 1.0",4,17),t.toDataURL("image/jpeg")):"")+(l=["monospace","sans-serif","serif"],i=["default","sans-serif","serif","monospace","Apple LiSung","Apple SD Gothic Neo","Apple Symbols","Baoli SC, Baoli TC","Baskerville","Beirut","GungSeo","Gurmukhi MN","Gurmukhi MT","Hannotate SC, Hannotate TC","HanziPen SC, HanziPen TC","HeadlineA","Hei","LiSong Pro","Libian SC, Libian TC","LingWai SC, LingWai TC","Lucida Grande","Luminari","Nanum Brush Script","Nanum Gothic, NanumGothic","Nanum Myeongjo, NanumMyeongjo","Nanum Pen Script","NanumGothic ExtraBold, NanumGothicExtraBold","New Peninim MT","Noto Serif Kannada","Noto Serif Myanmar","Optima","PilGi","Plantagenet Cherokee","Raanana","STFangSong, STFangsong","STHeiti","STIXGeneral, STIXGeneral-Regular","Tsukushi B Round Gothic, Tsukushi B Round Gothic Regular","Tsukushi B Round Gothic Bold","Verdana","Waseem","Xingkai SC, Xingkai TC","YuGothic, YuGothic Medium","YuGothic Bold","Yuanti SC, Yuanti TC","Yuppy SC, Yuppy TC","Zapf Dingbats","Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"],(()=>{for(var e=(()=>{var e,i=document.getElementsByTagName("head")[0],o=document.createElement("span"),a=(o.style.fontSize="72px",o.innerHTML="mmmmmmmmmmlli",{}),s={};for(e in l)o.style.fontFamily=l[e],i.appendChild(o),a[l[e]]=o.offsetWidth,s[l[e]]=o.offsetHeight,i.removeChild(o);return{detect:function(e){var t,n=!1;for(t in l){o.style.fontFamily=e+","+l[t],i.appendChild(o);var r=o.offsetWidth!==a[l[t]]||o.offsetHeight!==s[l[t]];i.removeChild(o),n=n||r}return n}}})(),t=i,n="",r=0;r<t.length;r++)n+=e.detect(t[r])?"1":"0";return n})())+(()=>{var e=document.createElement("canvas"),s=(e.width=256,e.height=128,e.getContext("webgl2")||e.getContext("experimental-webgl2")||e.getContext("webgl")||e.getContext("experimental-webgl")||e.getContext("moz-webgl")),t=(()=>{var e="";try{var t=s.createBuffer(),n=(s.bindBuffer(s.ARRAY_BUFFER,t),new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0])),r=(s.bufferData(s.ARRAY_BUFFER,n,s.STATIC_DRAW),t.itemSize=3,t.numItems=3,s.createProgram()),i=s.createShader(s.VERTEX_SHADER),o=(s.shaderSource(i,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),s.compileShader(i),s.createShader(s.FRAGMENT_SHADER)),a=(s.shaderSource(o,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),s.compileShader(o),s.attachShader(r,i),s.attachShader(r,o),s.linkProgram(r),s.useProgram(r),r.vertexPosAttrib=s.getAttribLocation(r,"attrVertex"),r.offsetUniform=s.getUniformLocation(r,"uniformOffset"),s.enableVertexAttribArray(r.vertexPosArray),s.vertexAttribPointer(r.vertexPosAttrib,t.itemSize,s.FLOAT,!1,0,0),s.uniform2f(r.offsetUniform,1,1),s.drawArrays(s.TRIANGLE_STRIP,0,t.numItems),new Uint8Array(131072));s.readPixels(0,0,256,128,s.RGBA,s.UNSIGNED_BYTE,a),e=JSON.stringify(a).replace(/,?"[0-9]+":/g,"")}catch(e){console.warn("fAid error: getwebGlHash-getWebglImageHash",e)}return e})(),n=(()=>{var e="";try{var t=null==s?void 0:s.getExtension("WEBGL_debug_renderer_info"),e=(null==s?void 0:s.getParameter(t.UNMASKED_VENDOR_WEBGL))+(null==s?void 0:s.getParameter(t.UNMASKED_RENDERER_WEBGL))}catch(e){console.warn("fAid error: getwebGlHash-getWebglReportHash-vendor&renderer info",e)}var n,r,t="";try{var i=function(e){return s.clearColor(0,0,0,1),s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),"["+e[0]+", "+e[1]+"]"},o=[];o.push("extensions:"+(s.getSupportedExtensions()||[]).join(";")),o.push("webgl aliased line width range:"+i(s.getParameter(s.ALIASED_LINE_WIDTH_RANGE))),o.push("webgl aliased point size range:"+i(s.getParameter(s.ALIASED_POINT_SIZE_RANGE))),o.push("webgl alpha bits:"+s.getParameter(s.ALPHA_BITS)),o.push("webgl antialiasing:"+(s.getContextAttributes().antialias?"yes":"no")),o.push("webgl blue bits:"+s.getParameter(s.BLUE_BITS)),o.push("webgl depth bits:"+s.getParameter(s.DEPTH_BITS)),o.push("webgl green bits:"+s.getParameter(s.GREEN_BITS)),o.push("webgl max anisotropy:"+((r=(n=s).getExtension("EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic"))?0===(n=n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT))?2:n:null)),o.push("webgl max combined texture image units:"+s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),o.push("webgl max cube map texture size:"+s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE)),o.push("webgl max fragment uniform vectors:"+s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS)),o.push("webgl max render buffer size:"+s.getParameter(s.MAX_RENDERBUFFER_SIZE)),o.push("webgl max texture image units:"+s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS)),o.push("webgl max texture size:"+s.getParameter(s.MAX_TEXTURE_SIZE)),o.push("webgl max varying vectors:"+s.getParameter(s.MAX_VARYING_VECTORS)),o.push("webgl max vertex attribs:"+s.getParameter(s.MAX_VERTEX_ATTRIBS)),o.push("webgl max vertex texture image units:"+s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),o.push("webgl max vertex uniform vectors:"+s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS)),o.push("webgl max viewport dims:"+i(s.getParameter(s.MAX_VIEWPORT_DIMS))),o.push("webgl red bits:"+s.getParameter(s.RED_BITS)),o.push("webgl renderer:"+s.getParameter(s.RENDERER)),o.push("webgl shading language version:"+s.getParameter(s.SHADING_LANGUAGE_VERSION)),o.push("webgl stencil bits:"+s.getParameter(s.STENCIL_BITS)),o.push("webgl vendor:"+s.getParameter(s.VENDOR)),t=o.join("*")||""}catch(e){console.warn("fAid error: getwebGlHash-getWebglReportHash-vendor&renderer info",e)}return e+t})(),r="";try{r=Cr(t+n)}catch(e){console.warn("fAid error: getwebGlHash-hashTo32",e)}return r})()}function _r(){try{var e=(o=window.navigator).userAgent+"*"+o.platform+(i=window.screen).width+"*"+i.height+window.screen.colorDepth+((r=null==(r=window.Intl)?void 0:r.DateTimeFormat)?null==(r=null==(r=new r)?void 0:r.resolvedOptions())?void 0:r.timeZone:"")+" + "+(new Date).getTimezoneOffset()+(()=>{function e(){return 0}var t=Math;try{var n=t.acos||e,r=t.acosh||e,i=t.asin||e,o=t.asinh||e,a=t.atanh||e,s=t.atan||e,l=t.sin||e,u=t.sinh||e,c=t.cos||e,d=t.cosh||e,h=t.tan||e,f=t.tanh||e,p=t.exp||e,m=t.expm1||e,g=t.log1p||e,v={acos:n(.12312423423423424),acosh:r(1e308),acoshPf:t.log(1e154+t.sqrt(1e308)),asin:i(.12312423423423424),asinh:o(1),asinhPf:t.log(1+t.sqrt(2)),atanh:a(.5),atanhPf:t.log(3)/2,atan:s(.5),sin:l(-1e300),sinh:u(1),sinhPf:t.exp(1)-1/t.exp(1)/2,cos:c(10.000000000123),cosh:d(1),coshPf:(t.exp(1)+1/t.exp(1))/2,tan:h(-1e300),tanh:f(1),tanhPf:(t.exp(2)-1)/(t.exp(2)+1),exp:p(1),expm1:m(1),expm1Pf:t.exp(1)-1,log1p:g(10),log1pPf:t.log(11),powPI:t.pow(t.PI,-100)};return Object.values(v).join("*")}catch(e){return""}})()+Sr();return t=Cr(e),n=0,"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".split("").map(function(e){return"x"===e?t[n++]:e}).join("")}catch(e){console.warn(e)}var t,n,r,i,o;return""}var Er=new e({name:"onClose",onNewTdem:function(n){var r,i=this;l.desktop()?(r=window.onunload,window.onunload=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.publishNotReportedLog(n),null!=r&&r.call.apply(r,A([window],e))}):yn(this.publishNotReportedLog.bind(this,n),{once:!0})},publishNotReportedLog:function(t){var n=this;this.$walk(function(e){e===t&&(e.sendNow=!0,e.publishPluginsLogs(),n.publishThrottlePipeLogs(e))})},publishThrottlePipeLogs:function(e){null!=e&&e.speedLogPipeline([]),null!=e&&e.tdemEventPipeline([])}}),Cr=function(e){for(var t=3&e.length,n=e.length-t,r=1,i=3432918353,o=461845907,a=0;a<n;)var s=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24,s=(++a,5*(65535&(r=(r^=(65535&(s=(s=(65535&s)*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295),r=27492+(65535&s)+((58964+(s>>>16)&65535)<<16);var l=0;switch(t){case 3:l^=(255&e.charCodeAt(a+2))<<16;case 2:l^=(255&e.charCodeAt(a+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(a)))*i+(((l>>>16)*i&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}r=2246822507*(65535&(r=(r^=e.length)^r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295;for(var u=(r^=r>>>16)>>>0,c=(u%2).toString();1<u;)c=(u=parseInt((u/2).toString(),10))%2+c;for(;c.length<32;)c="0"+c;return c},Tr=(new e({name:"aid"}),new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e;t||(t=_r()||Fe(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){console.warn(e)}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}}));function Rr(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}Ir.generate=function(){return"rep_"+this.uuid32()},Ir.uuid32=function(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)})};var xr=Ir,Or="[SessionReplay]",Mr=!1;function Ir(){}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mr&&console.log.apply(console,A([Or+"["+e+"]"],t))}function Ar(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mr&&console.debug.apply(console,A([Or+"["+e+"]"],t))}function Pr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mr&&console.log.apply(console,A([Or+"["+e+"] WARN:"],t))}function Lr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mr&&console.log.apply(console,A([Or+"["+e+"] ERROR:"],t))}Br.prototype.setTdemInstance=function(e){this.tdemInstance=e},Br.prototype.createSession=function(e){void 0===e&&(e="session");var t=null==(t=this.session)?void 0:t.replayId,n=pr("tdem",Rr),n=f({id:n.sessionId,replayId:xr.generate(),started:Date.now(),lastActivity:Date.now(),segmentId:0,sampled:e},t?{previousReplayId:t}:{});return this.session=n,this.syncSharedSession(n.id),v("SessionManager","Document replay session created:",n.id,n.replayId),n},Br.prototype.restoreSession=function(){return this.session},Br.prototype.saveSession=function(){},Br.prototype.refreshSession=function(){var e=null!=(e=null==(e=this.session)?void 0:e.sampled)?e:"session";return this.createSession(e)},Br.prototype.updateActivity=function(){this.session&&(this.session.lastActivity=Date.now())},Br.prototype.incrementSegmentId=function(){var e;return this.session?(e=this.session.segmentId,this.session.segmentId+=1,e):0},Br.prototype.shouldRefreshSession=function(){return!1},Br.prototype.getSession=function(){return this.session},Br.prototype.getSessionId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.id)?e:""},Br.prototype.getReplayId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.replayId)?e:""},Br.prototype.clearSession=function(){var e;this.session=null;try{null!=(e=window.sessionStorage)&&e.removeItem("tdem_session")}catch(e){}},Br.prototype.syncSharedSession=function(e){var t,n,r,i;this.tdemInstance&&this.tdemInstance.extendBean("sessionId",e),e=e,t="tdem","undefined"!=typeof window&&(n=Date.now(),(r=window[ur])?(i=r.sessionId!==e,r.sessionId=e,r.version=i?r.version+1:r.version,r.source=t,i&&(r.createdAt=n),r.lastActivity=n):window[ur]=hr(e,t),dr("_tdem_s",e),fr(window[ur]),window.dispatchEvent(new CustomEvent("monitor-session-update",{detail:{sessionId:e,source:t}})))};var Dr=Br,Nr=((n={})[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n[n.Asset=7]="Asset",n),Fr=(Ur.prototype.ensureReady=function(){return M(this,void 0,void 0,function(){return I(this,function(e){return[2,this.ready]})})},Ur.prototype.postMessage=function(n,r){var i=this,o=this.nextId++;return new Promise(function(e,t){i.pendingRequests.set(o,{resolve:e,reject:t}),i.worker.postMessage({id:o,method:n,arg:r})})},Ur.prototype.destroy=function(){this.pendingRequests.forEach(function(e){return(0,e.reject)(new Error("Worker destroyed"))}),this.pendingRequests.clear(),this.worker.terminate()},Ur);function Ur(e){var o=this;this.nextId=0,this.pendingRequests=new Map,this.worker=e,this.worker.addEventListener("message",function(e){var e=e.data,t=e.id,n=e.success,r=e.response;"init"!==e.method&&(e=o.pendingRequests.get(t))&&(o.pendingRequests.delete(t),n?e.resolve(r):e.reject(new Error(r||"Worker request failed")))}),this.ready=new Promise(function(t,n){var r=function(e){e=e.data;"init"===e.method&&e.success&&(o.worker.removeEventListener("message",r),clearTimeout(i),t())},i=(o.worker.addEventListener("message",r),o.worker.addEventListener("error",function(e){o.worker.removeEventListener("message",r),clearTimeout(i),n(new Error("Worker error: "+(e.message||"unknown")))}),setTimeout(function(){o.worker.removeEventListener("message",r),n(new Error("Worker init timeout (5s)"))},5e3))})}function Br(e){this.session=null,this.tdemInstance=null}jr.prototype.initWorker=function(){var t=this,e=(()=>{try{var e,t,n;return"undefined"==typeof Worker||"undefined"==typeof Blob||"undefined"==typeof URL?null:(e=new Blob(["\n(function() {\n var events = [];\n var totalSize = 0;\n\n function handleMessage(data) {\n var method = data.method;\n var id = data.id;\n\n switch (method) {\n case 'addEvent':\n events.push(data.arg);\n totalSize += data.arg.length;\n return { id: id, method: method, success: true, response: totalSize };\n\n case 'finish':\n var json = '[' + events.join(',') + ']';\n events = [];\n totalSize = 0;\n // 返回原始 JSON 字符串,压缩在主线程做(pako 不好内联到 worker)\n return { id: id, method: method, success: true, response: json };\n\n case 'clear':\n events = [];\n totalSize = 0;\n return { id: id, method: method, success: true, response: void 0 };\n\n default:\n return { id: id, method: method, success: false, response: 'Unknown method' };\n }\n }\n\n self.addEventListener('message', function(e) {\n try {\n var result = handleMessage(e.data);\n self.postMessage(result);\n } catch (err) {\n self.postMessage({\n id: e.data.id,\n method: e.data.method,\n success: false,\n response: err.message || 'Worker error'\n });\n }\n });\n\n // 就绪信号\n self.postMessage({ method: 'init', success: true });\n})();\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new Worker(t,{name:"tdem-replay-compressor"}),URL.revokeObjectURL(t),v("CompressionWorker","Worker created successfully"),new Fr(n))}catch(e){return Pr("CompressionWorker","Failed to create worker, will fallback to sync buffer:",e),null}})();e?(this.workerHandler=e,this.useWorker=!0,e.ensureReady().then(function(){t.workerReady=!0,v("EventBuffer","Worker ready, migrating buffered events"),t.migrateEventsToWorker()}).catch(function(e){Pr("EventBuffer","Worker init failed, falling back to sync buffer:",e),t.useWorker=!1,t.workerHandler=null})):v("EventBuffer","Worker not available, using sync buffer")},jr.prototype.migrateEventsToWorker=function(){if(this.workerHandler&&this.workerReady){var e=this.events;this.events=[];for(var t=0,n=e;t<n.length;t++){var r=n[t];this.addEventToWorker(r)}this.currentSize=0}},jr.prototype.addEventToWorker=function(e){if(this.workerHandler)try{var t=JSON.stringify(e);this.workerHandler.postMessage("addEvent",t),this.workerEventCount++,this.workerSize+=t.length}catch(e){Pr("EventBuffer","Failed to send event to worker:",e)}},jr.prototype.addEvent=function(e){var t;this.useWorker&&this.workerReady&&this.workerHandler?(t=this.estimateEventSize(e),this.workerSize+t>this.config.maxSize&&(Pr("EventBuffer","Worker buffer size limit exceeded, dropping old events"),this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),this.addEventToWorker(e)):(t=this.estimateEventSize(e),this.currentSize+t>this.config.maxSize&&(Pr("EventBuffer","Size limit exceeded, removing old events"),this.trimOldEvents(t)),this.events.push(e),this.currentSize+=t)},jr.prototype.getEvents=function(){return A(this.events)},jr.prototype.getEventCount=function(){return this.useWorker&&this.workerReady?this.workerEventCount+this.events.length:this.events.length},jr.prototype.getSize=function(){return this.useWorker&&this.workerReady?this.workerSize+this.currentSize:this.currentSize},jr.prototype.isEmpty=function(){return!(this.useWorker&&this.workerReady&&0!==this.workerEventCount||0!==this.events.length)},jr.prototype.finishAsync=function(){return M(this,void 0,void 0,function(){var t,n,r;return I(this,function(e){switch(e.label){case 0:if(!(this.useWorker&&this.workerReady&&this.workerHandler&&0<this.workerEventCount))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.workerHandler.postMessage("finish")];case 2:return t=e.sent(),r=this.workerEventCount,n=this.workerSize,this.workerEventCount=0,this.workerSize=0,[2,{events:[],eventCount:r,uncompressedSize:n,eventsJson:t}];case 3:return Pr("EventBuffer","Worker finish failed, falling back to sync:",e.sent()),[3,4];case 4:return[2,{events:r=this.getEvents(),eventCount:r.length,uncompressedSize:this.currentSize}]}})})},jr.prototype.finish=function(){var e=this.getEvents();return{events:e,eventCount:e.length,uncompressedSize:this.currentSize}},jr.prototype.clear=function(){this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0)},jr.prototype.destroy=function(){this.clear(),this.workerHandler&&(this.workerHandler.destroy(),this.workerHandler=null),this.useWorker=!1,this.workerReady=!1},jr.prototype.estimateEventSize=function(e){try{return JSON.stringify(e).length}catch(e){return 1024}},jr.prototype.trimOldEvents=function(e){for(var t=-1,n=this.events.length-1;0<=n;n--)if(this.events[n].type===Nr.FullSnapshot){t=n;break}var r=t;if(0<r)for(n=r-1;0<=n;n--)if(this.events[n].type===Nr.Meta){r=n;break}for(var i,o=0,a=Math.max(e,.2*this.config.maxSize),s=0;s<r&&o<a;)s++,(i=this.events.shift())&&(o+=this.estimateEventSize(i));if(r<0)for(;0<this.events.length&&o<a;)(i=this.events.shift())&&(o+=this.estimateEventSize(i));this.currentSize=Math.max(0,this.currentSize-o)},jr.prototype.hasCheckout=function(){return this.events.some(function(e){return e.type===Nr.Meta||e.type===Nr.FullSnapshot})},jr.prototype.getLastCheckoutTime=function(){for(var e=this.events.length-1;0<=e;e--){var t=this.events[e];if(t.type===Nr.FullSnapshot)return t.timestamp}return null},jr.prototype.isUsingWorker=function(){return this.useWorker&&this.workerReady};var zr=jr;function jr(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this.events=[],this.currentSize=0,this.workerHandler=null,this.useWorker=!1,this.workerReady=!1,this.workerEventCount=0,this.workerSize=0,this.config={maxSize:null!=(e=e.maxSize)?e:5242880},t&&this.initWorker()}function Hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wr(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Gr(s){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=s.apply(e,a);function i(e){Wr(r,t,n,i,o,"next",e)}function o(e){Wr(r,t,n,i,o,"throw",e)}i(void 0)})}}function qr(e,t,n){t=Kr(t);var r=e,t=Xr()?Reflect.construct(t,n||[],Kr(e).constructor):t.apply(e,n);if(!t||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=r))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oi(r.key),r)}}function k(e,t,n){return t&&Vr(e.prototype,t),n&&Vr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e,t){var n,r,i,o,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(r=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return r=e.done,e},e:function(e){i=!0,n=e},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(a=ai(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Zr(){return(Zr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=((e,t)=>{for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Kr(e)););return e})(e,t);if(r)return(r=Object.getOwnPropertyDescriptor(r,t)).get?r.get.call(arguments.length<3?e:n):r.value}).apply(null,arguments)}function Kr(e){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ni(e,t)}function Xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Xr=function(){return!!e})()}function $r(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Ae(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?$r(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],(e=oi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):$r(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function Yr(e,t){if(null==e)return{};var n,r=((e,t)=>{if(null==e)return{};var n,r={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r})(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function Qr(){var p,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var i,o,a,s,l,u,c,d,h,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype);return ei(t,"_invoke",(i=e,o=n,c=r||[],d=!1,h={p:u=0,n:0,v:p,a:f,f:f.bind(p,4),d:function(e,t){return a=e,s=0,l=p,h.n=t,m}},function(e,t,n){if(1<u)throw TypeError("Generator is already running");for(d&&1===t&&f(t,n),s=t,l=n;(v=s<2?p:l)||!d;){a||(s?s<3?(1<s&&(h.n=-1),f(s,l)):h.n=l:h.v=l);try{if(u=2,a){if(v=a[e=s?e:"next"]){if(!(v=v.call(a,l)))throw TypeError("iterator result is not an object");if(!v.done)return v;l=v.value,s<2&&(s=0)}else 1===s&&(v=a.return)&&v.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),s=1);a=p}else if((v=(d=h.n<0)?l:i.call(o,h))!==m)break}catch(e){a=p,s=1,l=e}finally{u=1}}return{value:v,done:d}}),!0),t;function f(e,t){for(s=e,l=t,v=0;!d&&u&&!n&&v<c.length;v++){var n,r=c[v],i=h.p,o=r[2];3<e?(n=o===t)&&(l=r[(s=r[4])?5:s=3],r[4]=r[5]=p):r[0]<=i&&((n=e<2&&i<r[1])?(s=0,h.v=t,h.n=r[1]):i<o&&(n=e<3||r[0]>t||o<t)&&(r[4]=e,r[5]=t,h.n=o,s=0))}if(n||1<e)return m;throw d=!0,t}}var m={};function g(){}function i(){}function o(){}var v=Object.getPrototypeOf,e=[][t]?v(v([][t]())):(ei(v={},t,function(){return this}),v),a=o.prototype=g.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,ei(e,n,"GeneratorFunction")),e.prototype=Object.create(a),e}return ei(a,"constructor",i.prototype=o),ei(o,"constructor",i),ei(o,n,i.displayName="GeneratorFunction"),ei(a),ei(a,n,"Generator"),ei(a,t,function(){return this}),ei(a,"toString",function(){return"[object Generator]"}),(Qr=function(){return{w:r,m:s}})()}function ei(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(ei=function(e,t,n,r){function i(t,n){ei(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))})(e,t,n,r)}function ti(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function ni(e,t){return(ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e,t){return(e=>{if(Array.isArray(e))return e})(e)||((e,t)=>{var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}})(e,t)||ai(e,t)||(()=>{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function ri(e,t,n,r){var i=Zr(Kr(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function ii(e){return(e=>{if(Array.isArray(e))return Hr(e)})(e)||(()=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})()||ai(e)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function oi(e){e=(e=>{if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);if("object"!=typeof(t=t.call(e,"string")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e);return"symbol"==typeof e?e:e+""}function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ai(e,t){var n;if(e)return"string"==typeof e?Hr(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hr(e,t):void 0}function si(e){var n="function"==typeof Map?new Map:void 0;return(si=function(e){if(null===e||!(t=>{try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}})(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return function(e,t,n){var r;return Xr()?Reflect.construct.apply(null,arguments):((r=[null]).push.apply(r,t),t=new(e.bind.apply(e,r)),n&&ni(t,n.prototype),t)}(e,arguments,Kr(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),ni(t,e)})(e)}function c(e,t,n){e=e,t="symbol"!==S(t)?t+"":t,n=n,t in e?pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}function li(e,t,n){e=e,t="symbol"!==S(t)?t+"":t,n=n,t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var ui=["inputs"],ci=["inputId"],di=["inputs"],hi=["inputId"],fi=["type"],pi=Object.defineProperty,mi=Object.defineProperty,gi=((n=gi||{})[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n),vi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wi={},bi={};function ki(e){if(wi[e])return wi[e];var t=globalThis[e],n=t.prototype,r=e in vi?vi[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in yi?yi[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return wi[e]=t.prototype,t.prototype;try{var o,a,s=document.createElement("iframe"),l=(s.style.display="none",document.body.appendChild(s),s.contentWindow);return l?(o=l[e].prototype)?((a=navigator.userAgent).includes("Safari")&&!a.includes("Chrome")?(s.classList.add("rr-block"),s.setAttribute("__rrwebUntaintedMutationObserver",""),bi[e]=function(){return s.remove()}):s.remove(),wi[e]=o):(s.remove(),n):t.prototype}catch(e){return n}}var Si={};function _i(e,t,n){var r="".concat(e,".").concat(String(n));return Si[r]?Si[r].call(t):(e=ki(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(Si[r]=e).call(t):t[n])}var Ei={};function Ci(e,t,n){var r="".concat(e,".").concat(String(n));return Ei[r]?Ei[r].bind(t):"function"!=typeof(e=ki(e)[n])?t[n]:(Ei[r]=e).bind(t)}var n=Date.now,Ti={ownerDocument:function(e){return _i("Node",e,"ownerDocument")},childNodes:function(e){return _i("Node",e,"childNodes")},parentNode:function(e){return _i("Node",e,"parentNode")},parentElement:function(e){return _i("Node",e,"parentElement")},textContent:function(e){return _i("Node",e,"textContent")},contains:function(e,t){return Ci("Node",e,"contains")(t)},getRootNode:function(e){return Ci("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_i("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_i("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _i("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _i("Element",e,"querySelectorAll")(t)},nowTimestamp:n=/[1-9][0-9]{12}/.test(Date.now().toString())?n:function(){return(new Date).getTime()},mutationObserverCtor:function(){var e;return[ki("MutationObserver").constructor,null!=(e=bi.MutationObserver)?e:function(){}]},patch:function(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}};function Ri(e){return e.nodeType===e.ELEMENT_NODE}function xi(e){var t=e&&"host"in e&&"mode"in e&&Ti.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Ti.shadowRoot(t)===e)}function Oi(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Mi(e){try{var t,n=e.rules||e.cssRules;return n?(!(t=e.href)&&e.ownerNode&&(t=e.ownerNode.baseURI),r=(r=Array.from(n,function(e){return Ii(e,t)}).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")?r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):r):null}catch(e){return null}var r}function Ii(e,t){if("styleSheet"in e){var n;try{n=Mi(e.styleSheet)||((r=(i=e).cssText).split('"').length<3?r:(r=["@import","url(".concat(JSON.stringify(i.href),")")],""===i.layerName?r.push("layer"):i.layerName&&r.push("layer(".concat(i.layerName,")")),i.supportsText&&r.push("supports(".concat(i.supportsText,")")),i.media.length&&r.push(i.media.mediaText),r.join(" ")+";"))}catch(t){n=e.cssText}return e.styleSheet.href?ji(n,e.styleSheet.href):n}var r,i=e.cssText;return"selectorText"in e&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?ji(i,t):i}var Ai=k(function e(){b(this,e),li(this,"idNodeMap",new Map),li(this,"nodeMetaMap",new WeakMap)},[{key:"getId",value:function(e){return e&&null!=(e=null==(e=this.getMeta(e))?void 0:e.id)?e:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);n&&(n=this.nodeMetaMap.get(n))&&this.nodeMetaMap.set(t,n),this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]);function Pi(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.maskInputFn,e=e.value||"",i=i&&Li(i);return e=n[r.toLowerCase()]||i&&n[i]?o?o(e,t):"*".repeat(e.length):e}function Li(e){return e.toLowerCase()}function Di(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Li(t):null}function Ni(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}t=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(n=null==t?void 0:t[1])?n:null}var Fi=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ui=/^(?:[a-z+]+:)?\/\//i,Bi=/^www\..*/i,zi=/^(data:)([^,]*),(.*)/i;function ji(e,c){return(e||"").replace(Fi,function(e,t,n,r,i,o){n=n||i||o,i=t||r||"";if(!n)return e;if(Ui.test(n)||Bi.test(n))return"url(".concat(i).concat(n).concat(i,")");if(zi.test(n))return"url(".concat(i).concat(n).concat(i,")");if("/"===n[0])return"url(".concat(i).concat((-1<(o=c).indexOf("//")?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+n).concat(i,")");var t=n.split("#")[0],r=n.substring(t.length),a=c.split("#")[0].split("/"),o=t.split("/");a.pop();var s,l=Ie(o);try{for(l.s();!(s=l.n()).done;){var u=s.value;"."!==u&&(".."===u?a.pop():a.push(u))}}catch(e){l.e(e)}finally{l.f()}return"url(".concat(i).concat(a.join("/")).concat(r).concat(i,")")})}function Hi(e,t){return 1<arguments.length&&void 0!==t&&t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}var Wi,Gi,qi=1,Vi=new RegExp("[^a-z0-9-_:]");function Zi(){return qi++}var Ki=/^[^ \t\n\r\u000c]+/,Ji=/^[, \t\n\r\u000c]+/,Xi=new WeakMap;function $i(e,t){return t&&""!==t.trim()?Yi(e,t):t}function Yi(e,t){var n=Xi.get(e);if(n||(n=e.createElement("a"),Xi.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Qi(e,t,n,r){return r&&("src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?$i(e,r):"srcset"===n?((e,t)=>{if(""===t.trim())return t;var n=0;function r(e){var e=e.exec(t.substring(n));return e?(e=e[0],n+=e.length,e):""}for(var i=[];r(Ji),!(n>=t.length);)if(","===(a=r(Ki)).slice(-1))a=$i(e,a.substring(0,a.length-1)),i.push(a);else for(var o="",a=$i(e,a),s=!1;;){var l=t.charAt(n);if(""===l){i.push((a+o).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){n+=1,i.push((a+o).trim());break}"("===l&&(s=!0)}o+=l,n+=1}return i.join(", ")})(e,r):"style"===n?ji(r,Yi(e)):"object"===t&&"data"===n?$i(e,r):r)}function eo(e,t){return["video","audio"].includes(e)&&"autoplay"===t}function to(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE)for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&to(Ti.parentNode(e),t,n)}function no(e,t,n,r){var i;if(Ri(e)){if(!Ti.childNodes(i=e).length)return!1}else{if(null===Ti.parentElement(e))return!1;i=Ti.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(to(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function ro(e,t){var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.needsMask,a=t.inlineStylesheet,s=t.maskInputOptions,l=void 0===s?{}:s,u=t.maskTextFn,c=t.maskInputFn,s=t.dataURLOptions,d=void 0===s?{}:s,h=t.inlineImages,f=t.recordCanvas,N=t.keepIframeSrcFn,s=t.newlyAddedElement,F=void 0!==s&&s,s=t.cssCaptured,U=void 0!==s&&s,p=(s=n,!(t=t.mirror).hasNode(s)||1===(t=t.getId(s))?void 0:t);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:gi.Document,childNodes:[],compatMode:e.compatMode}:{type:gi.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:gi.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:p};case e.ELEMENT_NODE:for(var m,g,v,y,w,b,k=e,S=(I={doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:N,newlyAddedElement:F,rootId:p}).doc,_=I.inlineStylesheet,E=void 0===(E=I.maskInputOptions)?{}:E,C=I.maskInputFn,T=void 0===(R=I.dataURLOptions)?{}:R,R=I.inlineImages,x=I.recordCanvas,O=I.keepIframeSrcFn,M=void 0!==(M=I.newlyAddedElement)&&M,B=I.rootId,I=((e,t,n)=>{try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1})(k,I.blockClass,I.blockSelector),A=(g=k)instanceof HTMLFormElement?"form":(g=Li(g.tagName),Vi.test(g)?"div":g),P={},z=k.attributes.length,L=0;L<z;L++){var D=k.attributes[L];eo(A,D.name)||(P[D.name]=Qi(S,A,Li(D.name),D.value))}"link"===A&&_&&(g=null,g=(_=Array.from(S.styleSheets).find(function(e){return e.href===k.href}))?Mi(_):g)&&(delete P.rel,delete P.href,P._cssText=g),"style"===A&&k.sheet&&(_=Mi(k.sheet))&&(1<k.childNodes.length&&(_=function(e,t,n){var r=2<arguments.length&&void 0!==n&&n,i=Array.from(t.childNodes),o=[],a=0;if(1<i.length&&e&&"string"==typeof e)for(var s=Hi(e,r),l=s.length/e.length,u=1;u<i.length;u++)if(i[u].textContent&&"string"==typeof i[u].textContent){for(var c=Hi(i[u].textContent,r),d=3;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){var h,f=c.substring(0,d),p=s.split(f),m=-1;if(2===p.length)m=p[0].length;else if(2<p.length&&""===p[0]&&""!==i[u-1].textContent)m=s.indexOf(f,1);else if(1===p.length){if(f=f.substring(0,f.length-1),(p=s.split(f)).length<=1)return o.push(e),o;d=101}else d===c.length-1&&(m=s.indexOf(f));if(-1!==(m=2<=p.length&&100<d&&((h=i[u-1].textContent)&&"string"==typeof h&&(h=Hi(h).length,m=s.indexOf(f,h)),-1===m)?p[0].length:m)){for(var g=Math.floor(m/l);0<g&&g<e.length;){if((a+=1)>50*i.length)return o.push(e),o;var v=Hi(e.substring(0,g),r);if(v.length===m){o.push(e.substring(0,g)),e=e.substring(g),s=s.substring(m);break}v.length<m?g+=Math.max(1,Math.floor((m-v.length)/l)):g-=Math.max(1,Math.floor((v.length-m)*l))}break}}}return o.push(e),o}(_,k).join("/* rr_split */")),P._cssText=_),["input","textarea","select"].includes(A)&&(g=k.value,_=k.checked,"radio"!==P.type&&"checkbox"!==P.type&&"submit"!==P.type&&"button"!==P.type&&g?P.value=Pi({element:k,type:Di(k),tagName:A,value:g,maskInputOptions:E,maskInputFn:C}):_&&(P.checked=_)),"option"===A&&(k.selected&&!E.select?P.selected=!0:delete P.selected),"dialog"===A&&k.open&&(P.rr_open_mode=k.matches("dialog:modal")?"modal":"non-modal"),"canvas"===A&&x&&("2d"===k.__context?(e=>{var t=e.getContext("2d");if(t)for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,i="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(i.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}return 1})(k)||(P.rr_dataURL=k.toDataURL(T.type,T.quality)):"__context"in k||(g=k.toDataURL(T.type,T.quality),(C=S.createElement("canvas")).width=k.width,C.height=k.height,g!==C.toDataURL(T.type,T.quality)&&(P.rr_dataURL=g))),"img"===A&&R&&(Wi||(Wi=S.createElement("canvas"),Gi=Wi.getContext("2d")),y=(v=k).currentSrc||v.getAttribute("src")||"<unknown-src>",w=v.crossOrigin,b=function(){v.removeEventListener("load",b);try{Wi.width=v.naturalWidth,Wi.height=v.naturalHeight,Gi.drawImage(v,0,0),P.rr_dataURL=Wi.toDataURL(T.type,T.quality)}catch(e){if("anonymous"!==v.crossOrigin)return v.crossOrigin="anonymous",void(v.complete&&0!==v.naturalWidth?b():v.addEventListener("load",b));console.warn("Cannot inline img src=".concat(y,"! Error: ").concat(e))}"anonymous"===v.crossOrigin&&(w?P.crossOrigin=w:v.removeAttribute("crossorigin"))},v.complete&&0!==v.naturalWidth?b():v.addEventListener("load",b)),["audio","video"].includes(A)&&((_=P).rr_mediaState=k.paused?"paused":"played",_.rr_mediaCurrentTime=k.currentTime,_.rr_mediaPlaybackRate=k.playbackRate,_.rr_mediaMuted=k.muted,_.rr_mediaLoop=k.loop,_.rr_mediaVolume=k.volume),M||(k.scrollLeft&&(P.rr_scrollLeft=k.scrollLeft),k.scrollTop&&(P.rr_scrollTop=k.scrollTop)),I&&(x=(E=k.getBoundingClientRect()).width,C=E.height,P={class:P.class,rr_width:"".concat(x,"px"),rr_height:"".concat(C,"px")}),"iframe"!==A||O(P.src)||(k.contentDocument||(P.rr_src=P.src),delete P.src);try{customElements.get(A)&&(m=!0)}catch(k){}return{type:gi.Element,tagName:A,attributes:P,childNodes:[],isSVG:Boolean("svg"===k.tagName||k.ownerSVGElement)||void 0,needBlock:I,rootId:B,isCustom:m};case e.TEXT_NODE:return g=e,_=(R={doc:n,needsMask:o,maskTextFn:u,rootId:p,cssCaptured:U}).needsMask,M=R.maskTextFn,E=R.rootId,x=R.cssCaptured,C=(C=Ti.parentNode(g))&&C.tagName,O="",I="STYLE"===C||void 0,(C="SCRIPT"===C||void 0)?O="SCRIPT_PLACEHOLDER":x||(O=Ti.textContent(g),I&&(O=O&&ji(O,Yi(R.doc)))),!I&&!C&&O&&_&&(O=M?M(O,Ti.parentElement(g)):O.replace(/[\S]/g,"*")),{type:gi.Text,textContent:O||"",rootId:E};case e.CDATA_SECTION_NODE:return{type:gi.CDATA,textContent:"",rootId:p};case e.COMMENT_NODE:return{type:gi.Comment,textContent:Ti.textContent(e)||"",rootId:p};default:return!1}}function N(e){return null==e?"":e.toLowerCase()}function io(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function oo(t,e){var n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.maskTextClass,s=e.maskTextSelector,l=e.skipChild,l=void 0!==l&&l,u=e.inlineStylesheet,c=void 0===u||u,u=e.maskInputOptions,d=void 0===u?{}:u,h=e.maskTextFn,f=e.maskInputFn,p=e.slimDOMOptions,u=e.dataURLOptions,m=void 0===u?{}:u,u=e.inlineImages,g=void 0!==u&&u,u=e.recordCanvas,v=void 0!==u&&u,y=e.onSerialize,w=e.onIframeLoad,u=e.iframeLoadTimeout,b=void 0===u?5e3:u,k=e.onStylesheetLoad,u=e.stylesheetLoadTimeout,S=void 0===u?5e3:u,u=e.keepIframeSrcFn,_=void 0===u?function(){return!1}:u,u=e.newlyAddedElement,u=void 0!==u&&u,E=e.cssCaptured,E=void 0!==E&&E,C=e.needsMask,e=e.preserveWhiteSpace,T=void 0===e||e,C=C||no(t,a,s,void 0===C),e=ro(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,dataURLOptions:m,inlineImages:g,recordCanvas:v,keepIframeSrcFn:_,newlyAddedElement:u,cssCaptured:E});if(!e)return console.warn(t,"not serialized"),null;var u=r.hasNode(t)?r.getId(t):((e,t)=>{if(t.comment&&e.type===gi.Comment)return 1;if(e.type===gi.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Ni(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return 1}}})(e,p)||!T&&e.type===gi.Text&&!e.textContent.replace(/^\s+|\s+$/gm,"").length?-2:qi++,R=Object.assign(e,{id:u});if(r.add(t,R),-2===u)return null;y&&y(t);E=!l;if(R.type===gi.Element&&(E=E&&!R.needBlock,delete R.needBlock,e=Ti.shadowRoot(t))&&Oi(e)&&(R.isShadowHost=!0),(R.type===gi.Document||R.type===gi.Element)&&E){p.headWhitespace&&R.type===gi.Element&&"head"===R.tagName&&(T=!1);var x={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:v,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:_,cssCaptured:!1};if(R.type!==gi.Element||"textarea"!==R.tagName||void 0===R.attributes.value){R.type===gi.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(x.cssCaptured=!0);for(var O=0,M=Array.from(Ti.childNodes(t));O<M.length;O++){var I=oo(M[O],x);I&&R.childNodes.push(I)}}var A=null;if(Ri(t)&&(A=Ti.shadowRoot(t)))for(var P=0,L=Array.from(Ti.childNodes(A));P<L.length;P++){var D=oo(L[P],x);D&&(Oi(A)&&(D.isShadow=!0),R.childNodes.push(D))}}u=Ti.parentNode(t);return u&&xi(u)&&Oi(u)&&(R.isShadow=!0),R.type===gi.Element&&"iframe"===R.tagName&&((e,t,n)=>{var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}})(t,function(){var e=t.contentDocument;e&&w&&(e=oo(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:v,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:_}))&&w(t,e)},b),R.type===gi.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===Ni(R.attributes.href))&&((e,t,n)=>{var r,i,o=!1;try{r=e.sheet}catch(e){return}r||(i=setTimeout(function(){o||(t(),o=!0)},n),e.addEventListener("load",function(){clearTimeout(i),o=!0,t()}))})(t,function(){var e;k&&(e=oo(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:v,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:_}))&&k(t,e)},S),R}var ao,so={exports:{}};var lo,uo,co,ho,fo,y=(co=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?co:("function"==typeof(ho=co.default)?(fo=function e(){return this instanceof e?Reflect.construct(ho,arguments,this.constructor):ho.apply(this,arguments)}).prototype=ho.prototype:fo={},Object.defineProperty(fo,"__esModule",{value:!0}),Object.keys(co).forEach(function(e){var t=Object.getOwnPropertyDescriptor(co,e);Object.defineProperty(fo,e,t.get?t:{enumerable:!0,get:function(){return co[e]}})}),fo);function po(){var d,h,e,t;return uo||(uo=1,ao||(ao=1,e=String,so.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),so.exports.createColors=t),d=so.exports,h=y,Jr(s,si(Error)),t=k(s,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,a,s,t=(t=h&&e?h(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,a=function(e){return n(o(e))},s=function(e){return i(e)}):a=s=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=s(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),a(">")+s(n)+e+"\n "+t+a("^")):" "+s(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(lo=t).default=t),lo;function s(e,t,n,r,i,o){var a;return b(this,s),(a=qr(this,s,[e])).name="CssSyntaxError",a.reason=e,i&&(a.file=i),r&&(a.source=r),o&&(a.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(a.line=t,a.column=n):(a.line=t.line,a.column=t.column,a.endLine=n.line,a.endColumn=n.column)),a.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(a,s),a}}var mo,go,vo,yo,wo,bo,ko,So,_o,Eo,Co,To,Ro,xo,Oo,Mo,Io,Ao,Po,Lo,Do,No,Fo,Uo,Bo,zo,jo,Ho,Wo,Go,qo,Vo,Zo,Ko,Jo,Xo,$o,Yo,Qo,ea,ta,na,ra,ia,oa,aa,sa,la,ua={};function ca(){return mo||(mo=1,ua.isClean=Symbol("isClean"),ua.my=Symbol("my")),ua}function da(){var a,e;return vo||(a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(vo=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=a[n]),o.rawCache[n]=r)):a[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}]),(go=e).default=e),go}function ha(){var n;return wo||(wo=1,n=da(),(yo=e).default=e),yo;function e(e,t){new n(t).stringify(e)}}function fa(){var a,s,i,n,r,e;return ko||(ko=1,e=ca(),a=e.isClean,s=e.my,i=po(),n=da(),r=ha(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[a]=!1,this[s]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,a=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=S(i=e[r]),"parent"===r&&"object"===o?n&&(a[r]=n):"source"===r?a[r]=i:Array.isArray(i)?a[r]=i.map(function(e){return t(e,a)}):("object"===o&&null!==i&&(i=t(i)),a[r]=i));return a}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[a]){this[a]=!1;for(var e=this;e=e.parent;)e[a]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},a=null==t,s=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===S(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===S(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=s,t.set(r.input,s),s++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return a&&(o.inputs=ii(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(bo=e).default=e),bo}function pa(){var e;return _o||(_o=1,Jr(t,fa()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(So=e).default=e),So;function t(e){return b(this,t),(e=qr(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function ma(){var r,i,t,n,o,a,e;return Ro||(Ro=1,r=y.SourceMapConsumer,i=y.SourceMapGenerator,t=y.existsSync,n=y.readFileSync,o=y.dirname,a=y.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===S(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=a(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(To=e).default=e),To}function ga(){var e,a,l,s,r,i,t,u,o,c,d,h,n;return Oo||(Oo=1,n=y.SourceMapConsumer,e=y.SourceMapGenerator,a=y.fileURLToPath,l=y.pathToFileURL,s=y.isAbsolute,r=y.resolve,i=(Co?Eo:(Co=1,Eo={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=y,u=po(),o=ma(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),h=Boolean(r&&s),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===S(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!h||/^\w+:\/\//.test(n.from)||s(n.from)?this.file=n.from:this.file=r(n.from)),h&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},s=(t&&"object"===S(t)?(s=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof s.offset?(r=(o=this.fromOffset(s.offset)).line,o.col):(r=s.line,s.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=s?new u(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,a.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,a.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var a=0;if(e>=n[n.length-1])a=n.length-1;else for(var s,l=n.length-2;a<l;)if(e<n[s=a+(l-a>>1)])l=s-1;else{if(!(e>=n[s+1])){a=s;break}a=s+1}return{col:e-n[a]+1,line:a+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=s(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");r.file=a(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(xo=n).default=n,t&&t.registerInput&&t.registerInput(n)),xo}function va(){if(Io)return Mo;Io=1;var a=y.SourceMapConsumer,t=y.SourceMapGenerator,s=y.dirname,n=y.relative,r=y.resolve,i=y.sep,o=y.pathToFileURL,l=ga(),e=Boolean(a&&t),u=Boolean(s&&r&&n&&i);return Mo=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||s(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new a(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,a=1,s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(s.generated.line=o,s.generated.column=a-1,t.source&&t.source.start?(s.source=r.sourcePath(t),s.original.line=t.source.start.line,s.original.column=t.source.start.column-1):(s.source="<no source>",s.original.line=1,s.original.column=0),r.map.addMapping(s)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),a=e.length-i):a+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(s.source=r.sourcePath(t),s.original.line=t.source.end.line,s.original.column=t.source.end.column-1,s.generated.line=o,s.generated.column=a-2):(s.source="<no source>",s.original.line=1,s.original.column=0,s.generated.line=o,s.generated.column=a-1),r.map.addMapping(s))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?s(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=s(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function ya(){var e;return Po||(Po=1,Jr(t,fa()),e=k(t),(Ao=e).default=e),Ao;function t(e){return b(this,t),(e=qr(this,t,[e])).type="comment",e}}function wa(){var u,c,d,t,e,h,f,p,m,n;return Do||(Do=1,e=ca(),h=e.isClean,f=e.my,p=pa(),m=ya(),Jr(g,fa()),(n=k(g,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,a=i[r],s=Ie(this.normalize(a,this.last));try{for(s.s();!(o=s.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){s.e(e)}finally{s.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(ri(g,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,ii(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var a,s=Ie(e=e.nodes.slice(0));try{for(s.s();!(a=s.n()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){s.e(e)}finally{s.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[f]||g.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[h]&&function e(t){if(t[h]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,a,s=r.value,l=this.normalize(s,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(a in this.indexes)this.indexes[a]=this.indexes[a]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Lo=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[f]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Lo;function g(){return b(this,g),qr(this,g,arguments)}}function ba(){var t,n,e;return Fo||(Fo=1,Jr(r,wa()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(No=e).default=e),No;function r(e){return b(this,r),(e=qr(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function ka(){if(Bo)return Uo;Bo=1;var t={};return Uo=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Sa(){var e;return jo||(jo=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),(zo=e).default=e),zo}function _a(){var n,e;return Wo||(Wo=1,n=Sa(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(Ho=e).default=e),Ho}function Ea(){var e,t;return Zo||(Zo=1,Jr(r,e=wa()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ri(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ri(r,"prepend",this,3)(t)}}]),(Vo=t).default=t,e.registerAtRule(t)),Vo;function r(e){return b(this,r),(e=qr(this,r,[e])).type="atrule",e}}function Ca(){var t,n,e,r;return Jo||(Jo=1,Jr(a,e=wa()),(r=k(a,[{key:"normalize",value:function(e,t,n){var r=ri(a,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),ri(a,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},Ko=r,e.registerRoot(r.default=r)),Ko;function a(e){return b(this,a),(e=qr(this,a,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Ta(){var t;return $o||($o=1,(Xo=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",a=!1,s=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var h=r.value;c?c=!1:"\\"===h?c=!0:l?h===u&&(l=!1):'"'===h||"'"===h?(l=!0,u=h):"("===h?s+=1:")"===h?0<s&&--s:0===s&&t.includes(h)&&(a=!0),a?(""!==o&&i.push(o.trim()),o="",a=!1):o+=h}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Xo}function Ra(){var e,t,n;return Qo||(Qo=1,e=wa(),t=Ta(),Jr(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Yo=n).default=n,e.registerRule(n)),Yo;function r(e){return b(this,r),(e=qr(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function xa(){if(ta)return ea;ta=1;var p=pa(),e=(()=>{if(qo)return Go;qo=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),S="/".charCodeAt(0),_="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),T="\t".charCodeAt(0),R="\r".charCodeAt(0),x="[".charCodeAt(0),O="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),L=";".charCodeAt(0),D="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,B=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,z=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return Go=function(t){var r,i,o,a,s,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},h=t.css.valueOf(),f=e.ignoreErrors,p=h.length,m=0,g=[],v=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&p<=m},nextToken:function(e){if(v.length)return v.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=h.charCodeAt(m)){case _:case E:case T:case R:case C:for(i=m;i+=1,(r=h.charCodeAt(i))===E||r===_||r===T||r===R||r===C;);d=["space",h.slice(m,i)],m=i-1;break;case x:case O:case A:case P:case N:case L:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=g.length?g.pop()[1]:"",c=h.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==_&&c!==T&&c!==C&&c!==R){i=m;do{if(s=!1,-1===(i=h.indexOf(")",i+1))){if(f||t){i=m;break}y("bracket")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),u=h.slice(m,i+1),-1===i||z.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(s=!1,-1===(i=h.indexOf(o,i+1))){if(f||t){i=m+1;break}y("string")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["string",h.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(h),i=0===U.lastIndex?h.length-1:U.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case k:for(i=m,a=!0;h.charCodeAt(i+1)===k;)i+=1,a=!a;if(r=h.charCodeAt(i+1),a&&r!==S&&r!==E&&r!==_&&r!==T&&r!==R&&r!==C&&(i+=1,j.test(h.charAt(i)))){for(;j.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===E&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:m=(r===S&&h.charCodeAt(m+1)===D?(0===(i=h.indexOf("*/",m+2)+1)&&(f||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i]):(B.lastIndex=m+1,B.test(h),i=0===B.lastIndex?h.length-1:B.lastIndex-2,d=["word",h.slice(m,i+1),m,i],g.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=ya(),u=Ea(),r=Ca(),i=Ra(),h={empty:!0,space:!0};return ea=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(0<s.length){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(s.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),o&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,a=Ie(e.entries());try{for(a.s();!(i=a.n()).done;){var s=Pe(i.value,2),l=s[0];if("("===(n=(t=s[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){a.e(e)}finally{a.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",h=l;0<h;h--){var f=c[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(t=l[0],s.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(a&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(s,a);break}if("{"===t)return void this.rule(s);if("}"===t){this.tokenizer.back(s.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,a,s,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(a=(i=n[d])[0])&&d===l-1&&!r||"comment"===a&&(a=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",h[a]||h[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(s=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:s,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])}function Oa(){var e,r,i;return ra||(ra=1,e=wa(),r=xa(),i=ga(),na=t,e.registerParse(t.default=t)),na;function t(e,t){var n=new i(e,t),n=new r(n);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}}function Ma(){var d,s,n,r,l,e,i,u,c,t,o,h,f,p,a,m;return oa||(oa=1,e=ca(),d=e.isClean,s=e.my,n=va(),r=ha(),l=wa(),e=ba(),i=ka(),u=_a(),c=Oa(),t=Ca(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},p={},(a=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==S(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=c;r.syntax&&(a=r.syntax.parse),(a=r.parser?r.parser:a).parse&&(a=a.parse);try{i=a(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[s]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===S(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,a,s=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?s.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=s.postcssPlugin,r=s.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split("."),o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===S(i))for(var o in i){if(!h[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!f[o])if("object"===S(i[o]))for(var a in i[o])e(i,"*"===a?o:o+"-"+a.toLowerCase(),i[o][a]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=Gr(Qr().m(function e(){var t,i,n,r,o,a,s,l,u,c=this;return Qr().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(s=this.plugins[t],g(s=this.runOnRoot(s)))return e.p=2,e.n=3,s;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,s=e.v,this.handleError(s);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(g(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,a=Qr().m(function e(){var t,n,r;return Qr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(ti(a()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===S(t)&&t.Once?"document"===this.result.root.type?g((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(g(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.visitSync(this.listeners.OnceExit,a)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],a=i[1],s=(this.result.lastPlugin=o,void 0);try{s=a(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(g(s))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var a,s=t.iterator;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[d])return a[d]=!0,void e.push(y(a));t.iterator=0,delete n.indexes[s]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(v(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},ia=a,t.registerLazyResult(a.default=a),e.registerLazyResult(a)),ia;function g(e){return"object"===S(e)&&"function"==typeof e.then}function v(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:v(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}_||(_=1,n=po(),Ia=pa(),_=Ma(),Il=wa(),E||(E=1,s||(s=1,$a=va(),Ya=ha(),Qa=ka(),es=Oa(),ts=_a(),ns=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Ya,i=(this.result=new ts(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new $a(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Qa("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=es;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(aa=ns).default=ns),Za=aa,Ka=Ma(),ns=ba(),Ja=Ca(),Xa=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===S(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===S(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==S(i)||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ka:Za)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(sa=Xa).default=Xa,Ja.registerProcessor(Xa),ns.registerProcessor(Xa)),Aa=sa,Ja=ha(),h||(h=1,za=pa(),ja=ma(),Ha=ya(),Wa=Ea(),Ga=ga(),qa=Ca(),Va=Ra(),(la=rs).default=rs),Xa=la,Pa=ba(),E=Sa(),La=ya(),Da=Ea(),s=_a(),h=ga(),Na=Oa(),Fa=Ta(),Ua=Ra(),Ba=Ca(),Fl=fa(),o.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new Aa).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return o([i(n)]).process(e,t)},i},o.stringify=Ja,o.parse=Na,o.fromJSON=Xa,o.list=Fa,o.comment=function(e){return new La(e)},o.atRule=function(e){return new Da(e)},o.decl=function(e){return new Ia(e)},o.rule=function(e){return new Ua(e)},o.root=function(e){return new Ba(e)},o.document=function(e){return new Pa(e)},o.CssSyntaxError=n,o.Declaration=Ia,o.Container=Il,o.Processor=Aa,o.Document=Pa,o.Comment=La,o.Warning=E,o.AtRule=Da,o.Result=s,o.Input=h,o.Rule=Ua,o.Root=Ba,o.Node=Fl,_.registerPostcss(o),(Na=o).default=o);var Ia,Aa,Pa,La,Da,Na,Fa,Ua,Ba,za,ja,Ha,Wa,Ga,qa,Va,Za,Ka,Ja,Xa,$a,Ya,Qa,es,ts,ns,n=(Fa=Na)&&Fa.__esModule&&Object.prototype.hasOwnProperty.call(Fa,"default")?Fa.default:Fa;function rs(e,t){if(Array.isArray(e))return e.map(function(e){return rs(e)});var n,r=e.inputs,i=Yr(e,ui);if(r){t=[];var o,a=Ie(r);try{for(a.s();!(o=a.n()).done;){var s=Ae(Ae({},o.value),{},{__proto__:Ga.prototype});s.map&&(s.map=Ae(Ae({},s.map),{},{__proto__:ja.prototype})),t.push(s)}}catch(e){a.e(e)}finally{a.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return rs(e,t)})),i.source&&(n=(r=i.source).inputId,r=Yr(r,ci),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new qa(i);if("decl"===i.type)return new za(i);if("rule"===i.type)return new Va(i);if("comment"===i.type)return new Ha(i);if("atrule"===i.type)return new Wa(i);throw new Error("Unknown node type: "+e.type)}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Aa(t)}n.stringify;function is(e,t,n){e=e,t="symbol"!==S(t)?t+"":t,n=n,t in e?os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var os=Object.defineProperty;Date.now().toString();var as,ss={exports:{}};var ls,us,cs,ds,hs,w=(cs=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?cs:("function"==typeof(ds=cs.default)?(hs=function e(){return this instanceof e?Reflect.construct(ds,arguments,this.constructor):ds.apply(this,arguments)}).prototype=ds.prototype:hs={},Object.defineProperty(hs,"__esModule",{value:!0}),Object.keys(cs).forEach(function(e){var t=Object.getOwnPropertyDescriptor(cs,e);Object.defineProperty(hs,e,t.get?t:{enumerable:!0,get:function(){return cs[e]}})}),hs);function fs(){var d,h,e,t;return us||(us=1,as||(as=1,e=String,ss.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),ss.exports.createColors=t),d=ss.exports,h=w,Jr(s,si(Error)),t=k(s,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,a,s,t=(t=h&&e?h(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,a=function(e){return n(o(e))},s=function(e){return i(e)}):a=s=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=s(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),a(">")+s(n)+e+"\n "+t+a("^")):" "+s(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(ls=t).default=t),ls;function s(e,t,n,r,i,o){var a;return b(this,s),(a=qr(this,s,[e])).name="CssSyntaxError",a.reason=e,i&&(a.file=i),r&&(a.source=r),o&&(a.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(a.line=t,a.column=n):(a.line=t.line,a.column=t.column,a.endLine=n.line,a.endColumn=n.column)),a.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(a,s),a}}var ps,ms,gs,vs,ys,ws,bs,ks,Ss,_s,Es,Cs,Ts,Rs,xs,Os,Ms,Is,As,Ps,Ls,Ds,Ns,Fs,Us,Bs,zs,js,Hs,Ws,Gs,qs,Vs,Zs,Ks,Js,Xs,$s,Ys,Qs,el,tl,nl,rl,il,ol,al,sl,ll,ul={};function cl(){return ps||(ps=1,ul.isClean=Symbol("isClean"),ul.my=Symbol("my")),ul}function dl(){var a,e;return gs||(a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(gs=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=a[n]),o.rawCache[n]=r)):a[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}]),(ms=e).default=e),ms}function hl(){var n;return ys||(ys=1,n=dl(),(vs=e).default=e),vs;function e(e,t){new n(t).stringify(e)}}function fl(){var a,s,i,n,r,e;return bs||(bs=1,e=cl(),a=e.isClean,s=e.my,i=fs(),n=dl(),r=hl(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[a]=!1,this[s]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,a=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=S(i=e[r]),"parent"===r&&"object"===o?n&&(a[r]=n):"source"===r?a[r]=i:Array.isArray(i)?a[r]=i.map(function(e){return t(e,a)}):("object"===o&&null!==i&&(i=t(i)),a[r]=i));return a}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[a]){this[a]=!1;for(var e=this;e=e.parent;)e[a]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},a=null==t,s=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===S(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===S(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=s,t.set(r.input,s),s++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return a&&(o.inputs=ii(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(ws=e).default=e),ws}function pl(){var e;return Ss||(Ss=1,Jr(t,fl()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(ks=e).default=e),ks;function t(e){return b(this,t),(e=qr(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function ml(){var r,i,t,n,o,a,e;return Ts||(Ts=1,r=w.SourceMapConsumer,i=w.SourceMapGenerator,t=w.existsSync,n=w.readFileSync,o=w.dirname,a=w.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===S(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=a(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(Cs=e).default=e),Cs}function gl(){var e,a,l,s,r,i,t,u,o,c,d,h,n;return xs||(xs=1,n=w.SourceMapConsumer,e=w.SourceMapGenerator,a=w.fileURLToPath,l=w.pathToFileURL,s=w.isAbsolute,r=w.resolve,i=(Es?_s:(Es=1,_s={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=w,u=fs(),o=ml(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),h=Boolean(r&&s),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===S(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!h||/^\w+:\/\//.test(n.from)||s(n.from)?this.file=n.from:this.file=r(n.from)),h&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},s=(t&&"object"===S(t)?(s=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof s.offset?(r=(o=this.fromOffset(s.offset)).line,o.col):(r=s.line,s.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=s?new u(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,a.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,a.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var a=0;if(e>=n[n.length-1])a=n.length-1;else for(var s,l=n.length-2;a<l;)if(e<n[s=a+(l-a>>1)])l=s-1;else{if(!(e>=n[s+1])){a=s;break}a=s+1}return{col:e-n[a]+1,line:a+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=s(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");r.file=a(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(Rs=n).default=n,t&&t.registerInput&&t.registerInput(n)),Rs}function vl(){if(Ms)return Os;Ms=1;var a=w.SourceMapConsumer,t=w.SourceMapGenerator,s=w.dirname,n=w.relative,r=w.resolve,i=w.sep,o=w.pathToFileURL,l=gl(),e=Boolean(a&&t),u=Boolean(s&&r&&n&&i);return Os=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||s(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new a(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,a=1,s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(s.generated.line=o,s.generated.column=a-1,t.source&&t.source.start?(s.source=r.sourcePath(t),s.original.line=t.source.start.line,s.original.column=t.source.start.column-1):(s.source="<no source>",s.original.line=1,s.original.column=0),r.map.addMapping(s)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),a=e.length-i):a+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(s.source=r.sourcePath(t),s.original.line=t.source.end.line,s.original.column=t.source.end.column-1,s.generated.line=o,s.generated.column=a-2):(s.source="<no source>",s.original.line=1,s.original.column=0,s.generated.line=o,s.generated.column=a-1),r.map.addMapping(s))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?s(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=s(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function yl(){var e;return As||(As=1,Jr(t,fl()),e=k(t),(Is=e).default=e),Is;function t(e){return b(this,t),(e=qr(this,t,[e])).type="comment",e}}function wl(){var u,c,d,t,e,h,f,p,m,n;return Ls||(Ls=1,e=cl(),h=e.isClean,f=e.my,p=pl(),m=yl(),Jr(g,fl()),(n=k(g,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,a=i[r],s=Ie(this.normalize(a,this.last));try{for(s.s();!(o=s.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){s.e(e)}finally{s.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(ri(g,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,ii(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var a,s=Ie(e=e.nodes.slice(0));try{for(s.s();!(a=s.n()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){s.e(e)}finally{s.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[f]||g.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[h]&&function e(t){if(t[h]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,a,s=r.value,l=this.normalize(s,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(a in this.indexes)this.indexes[a]=this.indexes[a]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Ps=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[f]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Ps;function g(){return b(this,g),qr(this,g,arguments)}}function bl(){var t,n,e;return Ns||(Ns=1,Jr(r,wl()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(Ds=e).default=e),Ds;function r(e){return b(this,r),(e=qr(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function kl(){if(Us)return Fs;Us=1;var t={};return Fs=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Sl(){var e;return zs||(zs=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),(Bs=e).default=e),Bs}function _l(){var n,e;return Hs||(Hs=1,n=Sl(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(js=e).default=e),js}function El(){var e,t;return Vs||(Vs=1,Jr(r,e=wl()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ri(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ri(r,"prepend",this,3)(t)}}]),(qs=t).default=t,e.registerAtRule(t)),qs;function r(e){return b(this,r),(e=qr(this,r,[e])).type="atrule",e}}function Cl(){var t,n,e,r;return Ks||(Ks=1,Jr(a,e=wl()),(r=k(a,[{key:"normalize",value:function(e,t,n){var r=ri(a,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),ri(a,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},Zs=r,e.registerRoot(r.default=r)),Zs;function a(e){return b(this,a),(e=qr(this,a,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Tl(){var t;return Xs||(Xs=1,(Js=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",a=!1,s=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var h=r.value;c?c=!1:"\\"===h?c=!0:l?h===u&&(l=!1):'"'===h||"'"===h?(l=!0,u=h):"("===h?s+=1:")"===h?0<s&&--s:0===s&&t.includes(h)&&(a=!0),a?(""!==o&&i.push(o.trim()),o="",a=!1):o+=h}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Js}function Rl(){var e,t,n;return Ys||(Ys=1,e=wl(),t=Tl(),Jr(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),($s=n).default=n,e.registerRule(n)),$s;function r(e){return b(this,r),(e=qr(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function xl(){if(el)return Qs;el=1;var p=pl(),e=(()=>{if(Gs)return Ws;Gs=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),S="/".charCodeAt(0),_="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),T="\t".charCodeAt(0),R="\r".charCodeAt(0),x="[".charCodeAt(0),O="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),L=";".charCodeAt(0),D="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,B=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,z=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return Ws=function(t){var r,i,o,a,s,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},h=t.css.valueOf(),f=e.ignoreErrors,p=h.length,m=0,g=[],v=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&p<=m},nextToken:function(e){if(v.length)return v.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=h.charCodeAt(m)){case _:case E:case T:case R:case C:for(i=m;i+=1,(r=h.charCodeAt(i))===E||r===_||r===T||r===R||r===C;);d=["space",h.slice(m,i)],m=i-1;break;case x:case O:case A:case P:case N:case L:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=g.length?g.pop()[1]:"",c=h.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==_&&c!==T&&c!==C&&c!==R){i=m;do{if(s=!1,-1===(i=h.indexOf(")",i+1))){if(f||t){i=m;break}y("bracket")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),u=h.slice(m,i+1),-1===i||z.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(s=!1,-1===(i=h.indexOf(o,i+1))){if(f||t){i=m+1;break}y("string")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["string",h.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(h),i=0===U.lastIndex?h.length-1:U.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case k:for(i=m,a=!0;h.charCodeAt(i+1)===k;)i+=1,a=!a;if(r=h.charCodeAt(i+1),a&&r!==S&&r!==E&&r!==_&&r!==T&&r!==R&&r!==C&&(i+=1,j.test(h.charAt(i)))){for(;j.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===E&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:m=(r===S&&h.charCodeAt(m+1)===D?(0===(i=h.indexOf("*/",m+2)+1)&&(f||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i]):(B.lastIndex=m+1,B.test(h),i=0===B.lastIndex?h.length-1:B.lastIndex-2,d=["word",h.slice(m,i+1),m,i],g.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=yl(),u=El(),r=Cl(),i=Rl(),h={empty:!0,space:!0};return Qs=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(0<s.length){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(s.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),o&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,a=Ie(e.entries());try{for(a.s();!(i=a.n()).done;){var s=Pe(i.value,2),l=s[0];if("("===(n=(t=s[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){a.e(e)}finally{a.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",h=l;0<h;h--){var f=c[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(t=l[0],s.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(a&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(s,a);break}if("{"===t)return void this.rule(s);if("}"===t){this.tokenizer.back(s.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,a,s,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(a=(i=n[d])[0])&&d===l-1&&!r||"comment"===a&&(a=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",h[a]||h[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(s=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:s,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])}function Ol(){var e,r,i;return nl||(nl=1,e=wl(),r=xl(),i=gl(),tl=t,e.registerParse(t.default=t)),tl;function t(e,t){var n=new i(e,t),n=new r(n);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}}function Ml(){var d,s,n,r,l,e,i,u,c,t,o,h,f,p,a,m;return il||(il=1,e=cl(),d=e.isClean,s=e.my,n=vl(),r=hl(),l=wl(),e=bl(),i=kl(),u=_l(),c=Ol(),t=Cl(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},p={},(a=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==S(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=c;r.syntax&&(a=r.syntax.parse),(a=r.parser?r.parser:a).parse&&(a=a.parse);try{i=a(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[s]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===S(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,a,s=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?s.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=s.postcssPlugin,r=s.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split("."),o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===S(i))for(var o in i){if(!h[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!f[o])if("object"===S(i[o]))for(var a in i[o])e(i,"*"===a?o:o+"-"+a.toLowerCase(),i[o][a]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=Gr(Qr().m(function e(){var t,i,n,r,o,a,s,l,u,c=this;return Qr().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(s=this.plugins[t],g(s=this.runOnRoot(s)))return e.p=2,e.n=3,s;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,s=e.v,this.handleError(s);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(g(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,a=Qr().m(function e(){var t,n,r;return Qr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(ti(a()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===S(t)&&t.Once?"document"===this.result.root.type?g((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(g(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.visitSync(this.listeners.OnceExit,a)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],a=i[1],s=(this.result.lastPlugin=o,void 0);try{s=a(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(g(s))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var a,s=t.iterator;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[d])return a[d]=!0,void e.push(y(a));t.iterator=0,delete n.indexes[s]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(v(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},rl=a,t.registerLazyResult(a.default=a),e.registerLazyResult(a)),rl;function g(e){return"object"===S(e)&&"function"==typeof e.then}function v(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:v(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}i||(i=1,Il=fs(),Al=pl(),E=Ml(),s=wl(),Hh||(Hh=1,C||(C=1,$l=vl(),Yl=hl(),Ql=kl(),eu=Ol(),tu=_l(),nu=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Yl,i=(this.result=new tu(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new $l(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Ql("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=eu;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(ol=nu).default=nu),Zl=ol,Kl=Ml(),nu=bl(),Jl=Cl(),Xl=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===S(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===S(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==S(i)||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Kl:Zl)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(al=Xl).default=Xl,Jl.registerProcessor(Xl),nu.registerProcessor(Xl)),Pl=al,Jl=hl(),ru||(ru=1,zl=pl(),jl=ml(),Hl=yl(),Wl=El(),Gl=gl(),ql=Cl(),Vl=Rl(),(sl=iu).default=iu),Xl=sl,Ll=bl(),h=Sl(),Dl=yl(),Nl=El(),Fl=_l(),_=gl(),n=Ol(),i=Tl(),Ul=Rl(),Bl=Cl(),Hh=fl(),a.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new Pl).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return a([i(n)]).process(e,t)},i},a.stringify=Jl,a.parse=n,a.fromJSON=Xl,a.list=i,a.comment=function(e){return new Dl(e)},a.atRule=function(e){return new Nl(e)},a.decl=function(e){return new Al(e)},a.rule=function(e){return new Ul(e)},a.root=function(e){return new Bl(e)},a.document=function(e){return new Ll(e)},a.CssSyntaxError=Il,a.Declaration=Al,a.Container=s,a.Processor=Pl,a.Document=Ll,a.Comment=Dl,a.Warning=h,a.AtRule=Nl,a.Result=Fl,a.Input=_,a.Rule=Ul,a.Root=Bl,a.Node=Hh,E.registerPostcss(a),(ll=a).default=a);var Il,Al,Pl,Ll,Dl,Nl,Fl,Ul,Bl,zl,jl,Hl,Wl,Gl,ql,Vl,Zl,Kl,Jl,Xl,$l,Yl,Ql,eu,tu,nu,ru=(C=ll)&&C.__esModule&&Object.prototype.hasOwnProperty.call(C,"default")?C.default:C;function iu(e,t){if(Array.isArray(e))return e.map(function(e){return iu(e)});var n,r=e.inputs,i=Yr(e,di);if(r){t=[];var o,a=Ie(r);try{for(a.s();!(o=a.n()).done;){var s=Ae(Ae({},o.value),{},{__proto__:Gl.prototype});s.map&&(s.map=Ae(Ae({},s.map),{},{__proto__:jl.prototype})),t.push(s)}}catch(e){a.e(e)}finally{a.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return iu(e,t)})),i.source&&(n=(r=i.source).inputId,r=Yr(r,hi),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new ql(i);if("decl"===i.type)return new zl(i);if("rule"===i.type)return new Vl(i);if("comment"===i.type)return new Hl(i);if("atrule"===i.type)return new Wl(i);throw new Error("Unknown node type: "+e.type)}function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Pl(t)}ru.stringify;var ou=k(cu,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}},{key:"contains",value:function(e){if(e instanceof cu&&e.ownerDocument===this.ownerDocument){if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}}return!1}},{key:"appendChild",value:function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"insertBefore",value:function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}},{key:"removeChild",value:function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"toString",value:function(){return"RRNode"}}]),au={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},su={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},lu={},uu={};function cu(){b(this,cu),is(this,"parentElement",null),is(this,"parentNode",null),is(this,"ownerDocument"),is(this,"firstChild",null),is(this,"lastChild",null),is(this,"previousSibling",null),is(this,"nextSibling",null),is(this,"ELEMENT_NODE",1),is(this,"TEXT_NODE",3),is(this,"nodeType"),is(this,"nodeName"),is(this,"RRNodeType")}function du(e){if(lu[e])return lu[e];var t=globalThis[e],n=t.prototype,r=e in au?au[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in su?su[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return lu[e]=t.prototype,t.prototype;try{var o,a,s=document.createElement("iframe"),l=(s.style.display="none",document.body.appendChild(s),s.contentWindow);return l?(o=l[e].prototype)?((a=navigator.userAgent).includes("Safari")&&!a.includes("Chrome")?(s.classList.add("rr-block"),s.setAttribute("__rrwebUntaintedMutationObserver",""),uu[e]=function(){return s.remove()}):s.remove(),lu[e]=o):(s.remove(),n):t.prototype}catch(e){return n}}var hu={};function fu(e,t,n){var r="".concat(e,".").concat(String(n));return hu[r]?hu[r].call(t):(e=du(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(hu[r]=e).call(t):t[n])}var pu={};function mu(e,t,n){var r="".concat(e,".").concat(String(n));return pu[r]?pu[r].bind(t):"function"!=typeof(e=du(e)[n])?t[n]:(pu[r]=e).bind(t)}function gu(){var e;return[du("MutationObserver").constructor,null!=(e=uu.MutationObserver)?e:function(){}]}var vu=Date.now;function yu(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}var Le={ownerDocument:function(e){return fu("Node",e,"ownerDocument")},childNodes:function(e){return fu("Node",e,"childNodes")},parentNode:function(e){return fu("Node",e,"parentNode")},parentElement:function(e){return fu("Node",e,"parentElement")},textContent:function(e){return fu("Node",e,"textContent")},contains:function(e,t){return mu("Node",e,"contains")(t)},getRootNode:function(e){return mu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?fu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?fu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return fu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return fu("Element",e,"querySelectorAll")(t)},nowTimestamp:vu=/[1-9][0-9]{12}/.test(Date.now().toString())?vu:function(){return(new Date).getTime()},mutationObserverCtor:gu,patch:yu};function wu(e,t,n){var r=2<arguments.length&&void 0!==n?n:document,i={capture:!0,passive:!0};return r.addEventListener(e,t,i),function(){return r.removeEventListener(e,t,i)}}var bu="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.",n={map:{},getId:function(){return console.error(bu),-1},getNode:function(){return console.error(bu),null},removeNodeFromMap:function(){console.error(bu)},has:function(){return console.error(bu),!1},reset:function(){console.error(bu)}};function ku(a,s,e){var l=2<arguments.length&&void 0!==e?e:{},u=null,c=0;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Date.now(),i=(c||!1!==l.leading||(c=r),s-(r-c)),o=this;i<=0||s<i?(u&&(clearTimeout(u),u=null),c=r,a.apply(o,t)):u||!1===l.trailing||(u=setTimeout(function(){c=!1===l.leading?0:Date.now(),u=null,a.apply(o,t)},i))}}function Su(e,t,n,r,i){var i=4<arguments.length&&void 0!==i?i:window,o=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),o&&o.set&&o.set.call(this,e)}}),function(){return Su(e,t,o||{},!0)}}function _u(e){var t,n=e.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(t=Le.parentElement(n.body))?void 0:t.scrollLeft)||(null==(t=null==n?void 0:n.body)?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(t=Le.parentElement(n.body))?void 0:t.scrollTop)||(null==(e=null==n?void 0:n.body)?void 0:e.scrollTop)||0}}function Eu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Cu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Tu(e){return e?e.nodeType===e.ELEMENT_NODE?e:Le.parentElement(e):null}function Ru(e,t,n,r){if(e){var i=Tu(e);if(i){try{if("string"==typeof t){if(i.classList.contains(t))return 1;if(r&&null!==i.closest("."+t))return 1}else if(to(i,t,r))return 1}catch(e){}if(n){if(i.matches(n))return 1;if(r&&null!==i.closest(n))return 1}}}}function xu(e,t,n){return"TITLE"===e.tagName&&n.headTitleMutations||-2===t.getId(e)}function Ou(e){return Boolean(e.changedTouches)}function Mu(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Iu(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Au(e){return e&&(e instanceof ou&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Le.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(n,{get:function(e,t,n){return"map"===t&&console.error(bu),Reflect.get(e,t,n)}});var Pu=k(function e(){b(this,e),c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)},[{key:"getId",value:function(e){return null!=(e=this.styleIDMap.get(e))?e:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(t=void 0===t?this.id++:t,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t)}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]);function Lu(e){var t,n=null;return n="getRootNode"in e&&(null==(t=Le.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Le.host(Le.getRootNode(e))?Le.host(Le.getRootNode(e)):n}function Du(n){var e,t=Le.ownerDocument(n);return!!t&&(e=(()=>{for(var e,t=n;e=Lu(t);)t=e;return t})(),Le.contains(t,e))}function Nu(e){var t=Le.ownerDocument(e);return t&&(Le.contains(t,e)||Du(e))}(i={})[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i[i.Asset=7]="Asset";var Y=i,De=((s=De||{})[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s),Fu=((h=Fu||{})[h.MouseUp=0]="MouseUp",h[h.MouseDown=1]="MouseDown",h[h.Click=2]="Click",h[h.ContextMenu=3]="ContextMenu",h[h.DblClick=4]="DblClick",h[h.Focus=5]="Focus",h[h.Blur=6]="Blur",h[h.TouchStart=7]="TouchStart",h[h.TouchMove_Departed=8]="TouchMove_Departed",h[h.TouchEnd=9]="TouchEnd",h[h.TouchCancel=10]="TouchCancel",h),Uu=((_=Uu||{})[_.Mouse=0]="Mouse",_[_.Pen=1]="Pen",_[_.Touch=2]="Touch",_),Bu=((Hh={})[Hh["2D"]=0]="2D",Hh[Hh.WebGL=1]="WebGL",Hh[Hh.WebGL2=2]="WebGL2",Hh),zu=((E=zu||{})[E.Play=0]="Play",E[E.Pause=1]="Pause",E[E.Seeked=2]="Seeked",E[E.VolumeChange=3]="VolumeChange",E[E.RateChange=4]="RateChange",E),ju=((C={})[C.Document=0]="Document",C[C.DocumentType=1]="DocumentType",C[C.Element=2]="Element",C[C.Text=3]="Text",C[C.CDATA=4]="CDATA",C[C.Comment=5]="Comment",C);function Hu(e){return"__ln"in e}function Wu(e,t){return"".concat(e,"@").concat(t)}var Gu,qu=k(function e(){b(this,e),c(this,"length",0),c(this,"head",null),c(this,"tail",null)},[{key:"get",value: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}},{key:"addNode",value:function(e){var t,n={value:e,previous:null,next:null};e.__ln=n,e.previousSibling&&Hu(e.previousSibling)?(t=e.previousSibling.__ln.next,n.next=t,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,t&&(t.previous=n)):e.nextSibling&&Hu(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,n.previous=t,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,t&&(t.next=n)):(this.head&&(this.head.previous=n),n.next=this.head,this.head=n),null===n.next&&(this.tail=n),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),Vu=k(function e(){var w=this;b(this,e),c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"removesSubTreeCache",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",function(e){e.forEach(w.processMutation),w.emit()}),c(this,"emit",function(){if(!w.frozen&&!w.locked){for(var i=[],o=new Set,a=new qu,s=function(e){for(var t=e,n=-2;-2===n;)n=(t=t&&t.nextSibling)&&w.mirror.getId(t);return n},e=function(t){var e=Le.parentNode(t);if(e&&Nu(t)){var n=!1;if(t.nodeType===Node.TEXT_NODE){var r=e.tagName;if("TEXTAREA"===r)return;"STYLE"===r&&w.addedSet.has(e)&&(n=!0)}r=xi(e)?w.mirror.getId(Lu(t)):w.mirror.getId(e),e=s(t);if(-1===r||-1===e)return a.addNode(t);n=oo(t,{doc:w.doc,mirror:w.mirror,blockClass:w.blockClass,blockSelector:w.blockSelector,maskTextClass:w.maskTextClass,maskTextSelector:w.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:w.inlineStylesheet,maskInputOptions:w.maskInputOptions,maskTextFn:w.maskTextFn,maskInputFn:w.maskInputFn,slimDOMOptions:w.slimDOMOptions,dataURLOptions:w.dataURLOptions,recordCanvas:w.recordCanvas,inlineImages:w.inlineImages,onSerialize:function(e){Mu(e,w.mirror)&&w.iframeManager.addIframe(e),Iu(e,w.mirror)&&w.stylesheetManager.trackLinkElement(e),Au(t)&&w.shadowDomManager.addShadowRoot(Le.shadowRoot(t),w.doc)},onIframeLoad:function(e,t){w.iframeManager.attachIframe(e,t),w.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,t){w.stylesheetManager.attachLinkElement(e,t)},cssCaptured:n});n&&(i.push({parentId:r,nextId:e,node:n}),o.add(n.id))}};w.mapRemoves.length;)w.mirror.removeNodeFromMap(w.mapRemoves.shift());var t,n=Ie(w.movedSet);try{for(n.s();!(t=n.n()).done;){var r=t.value;Ku(w.removesSubTreeCache,r,w.mirror)&&!w.movedSet.has(Le.parentNode(r))||e(r)}}catch(i){n.e(i)}finally{n.f()}var l,u=Ie(w.addedSet);try{for(u.s();!(l=u.n()).done;){var c=l.value;!Ju(w.droppedSet,c)&&!Ku(w.removesSubTreeCache,c,w.mirror)||Ju(w.movedSet,c)?e(c):w.droppedSet.add(c)}}catch(i){u.e(i)}finally{u.f()}for(var d=null;a.length;){var h,f,p=null;if(!(p=d&&(h=w.mirror.getId(Le.parentNode(d.value)),f=s(d.value),-1!==h)&&-1!==f?d:p))for(var m=a.tail;m;){var g=m,m=m.previous;if(g){var v=w.mirror.getId(Le.parentNode(g.value));if(-1!==s(g.value)){if(-1!==v){p=g;break}v=g.value,v=Le.parentNode(v);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){v=Le.host(v);if(-1!==w.mirror.getId(v)){p=g;break}}}}}if(!p){for(;a.head;)a.removeNode(a.head.value);break}d=p.previous,a.removeNode(p.value),e(p.value)}var y={texts:w.texts.map(function(e){var t=e.node,n=Le.parentNode(t);return n&&"TEXTAREA"===n.tagName&&w.genTextAreaValueMutation(n),{id:w.mirror.getId(t),value:e.value}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),attributes:w.attributes.map(function(e){var t,n,r=e.attributes;return"string"==typeof r.style&&(t=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles),t.length<r.style.length)&&(t+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff),{id:w.mirror.getId(e.node),attributes:r}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),removes:w.removes,adds:i};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&(w.texts=[],w.attributes=[],w.attributeMap=new WeakMap,w.removes=[],w.addedSet=new Set,w.movedSet=new Set,w.droppedSet=new Set,w.removesSubTreeCache=new Set,w.movedMap={},w.mutationCb(y))}}),c(this,"genTextAreaValueMutation",function(e){var t=w.attributeMap.get(e),n=(t||(w.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),w.attributeMap.set(e,t)),Array.from(Le.childNodes(e),function(e){return Le.textContent(e)||""}).join(""));t.attributes.value=Pi({element:e,maskInputOptions:w.maskInputOptions,tagName:e.tagName,type:Di(e),value:n,maskInputFn:w.maskInputFn})}),c(this,"processMutation",function(a){if(!xu(a.target,w.mirror,w.slimDOMOptions))switch(a.type){case"characterData":var e=Le.textContent(a.target);Ru(a.target,w.blockClass,w.blockSelector,!1)||e===a.oldValue||w.texts.push({value:no(a.target,w.maskTextClass,w.maskTextSelector,!0)&&e?w.maskTextFn?w.maskTextFn(e,Tu(a.target)):e.replace(/[\S]/g,"*"):e,node:a.target});break;case"attributes":var t,n=a.target,e=a.attributeName,r=a.target.getAttribute(e);if("value"===e&&(t=Di(n),r=Pi({element:n,maskInputOptions:w.maskInputOptions,tagName:n.tagName,type:t,value:r,maskInputFn:w.maskInputFn})),!Ru(a.target,w.blockClass,w.blockSelector,!1)&&r!==a.oldValue){var i=w.attributeMap.get(a.target);if("IFRAME"===n.tagName&&"src"===e&&!w.keepIframeSrcFn(r)){if(n.contentDocument)return;e="rr_src"}if(i||(i={node:a.target,attributes:{},styleDiff:{},_unchangedStyles:{}},w.attributes.push(i),w.attributeMap.set(a.target,i)),"type"===e&&"INPUT"===n.tagName&&"password"===(a.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!eo(n.tagName,e))if(i.attributes[e]=Qi(w.doc,Li(n.tagName),Li(e),r),"style"===e){if(!w.unattachedDoc)try{w.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){w.unattachedDoc=w.doc}var o=w.unattachedDoc.createElement("span");a.oldValue&&o.setAttribute("style",a.oldValue);for(var s=0,l=Array.from(n.style);s<l.length;s++){var u=l[s],c=n.style.getPropertyValue(u),d=n.style.getPropertyPriority(u);c!==o.style.getPropertyValue(u)||d!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===d?c:[c,d]:i._unchangedStyles[u]=[c,d]}for(var h=0,f=Array.from(o.style);h<f.length;h++){var p=f[h];""===n.style.getPropertyValue(p)&&(i.styleDiff[p]=!1)}}else"open"===e&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break;case"childList":return Ru(a.target,w.blockClass,w.blockSelector,!0)?void 0:"TEXTAREA"===a.target.tagName?void w.genTextAreaValueMutation(a.target):(a.addedNodes.forEach(function(e){return w.genAdds(e,a.target)}),void a.removedNodes.forEach(function(e){var t=w.mirror.getId(e),n=xi(a.target)?w.mirror.getId(Le.host(a.target)):w.mirror.getId(a.target);if(!Ru(a.target,w.blockClass,w.blockSelector,!1)&&!xu(e,w.mirror,w.slimDOMOptions)&&-1!==w.mirror.getId(e)){if(w.addedSet.has(e))Zu(w.addedSet,e),w.droppedSet.add(e);else if(!(w.addedSet.has(a.target)&&-1===t||function e(t,n){var r;return!xi(t)&&(r=n.getId(t),!n.has(r)||(!(r=Le.parentNode(t))||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n)))}(a.target,w.mirror)))if(w.movedSet.has(e)&&w.movedMap[Wu(t,n)])Zu(w.movedSet,e);else{w.removes.push({parentId:n,id:t,isShadow:!(!xi(a.target)||!Oi(a.target))||void 0});for(var r=w.removesSubTreeCache,i=[e];i.length;){var o=i.pop();r.has(o)||(r.add(o),Le.childNodes(o).forEach(function(e){return i.push(e)}))}}w.mapRemoves.push(e)}}))}}),c(this,"genAdds",function(t,e){if(!w.processedNodeManager.inOtherBuffer(t,w)&&!w.addedSet.has(t)&&!w.movedSet.has(t)){if(w.mirror.hasNode(t)){if(xu(t,w.mirror,w.slimDOMOptions))return;w.movedSet.add(t);var n=null;(n=e&&w.mirror.hasNode(e)?w.mirror.getId(e):n)&&-1!==n&&(w.movedMap[Wu(w.mirror.getId(t),n)]=!0)}else w.addedSet.add(t),w.droppedSet.delete(t);Ru(t,w.blockClass,w.blockSelector,!1)||(Le.childNodes(t).forEach(function(e){return w.genAdds(e)}),Au(t)&&Le.childNodes(Le.shadowRoot(t)).forEach(function(e){w.processedNodeManager.add(e,w),w.genAdds(e,t)}))}})},[{key:"init",value:function(t){var n=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(e){n[e]=t[e]})}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]);function Zu(t,e){t.delete(e),Le.childNodes(e).forEach(function(e){return Zu(t,e)})}function Ku(e,t){return 0!==e.size&&(e=e,t=Le.parentNode(t))&&e.has(t)}function Ju(e,t){return 0!==e.size&&function e(t,n){n=Le.parentNode(n);return!!n&&(!!t.has(n)||e(t,n))}(e,t)}var Ne=function(e){return Gu?function(){try{return e.apply(void 0,arguments)}catch(e){if(!Gu||!0!==Gu(e))throw e}}:e},Xu=[];function $u(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Yu(e,t){var n=new Vu,e=(Xu.push(n),n.init(e),Pe(gu(),2)),r=e[0],e=e[1],r=new r(Ne(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[r,e]}function Qu(e){var t,r,a,s=e.mouseInteractionCb,i=e.doc,l=e.mirror,u=e.blockClass,c=e.blockSelector,e=e.sampling;return!1===e.mouseInteraction?function(){}:(t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,r=[],a=null,Object.keys(Fu).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]}).forEach(function(e){function t(e){var t=$u(e);if(!Ru(t,u,c,!0)){var n=null,r=o;if("pointerType"in e){switch(e.pointerType){case"mouse":n=Uu.Mouse;break;case"touch":n=Uu.Touch;break;case"pen":n=Uu.Pen}n===Uu.Touch?Fu[o]===Fu.MouseDown?r="TouchStart":Fu[o]===Fu.MouseUp&&(r="TouchEnd"):Uu.Pen}else Ou(e)&&(n=Uu.Touch);null!==n?(a=n,(r.startsWith("Touch")&&n===Uu.Touch||r.startsWith("Mouse")&&n===Uu.Mouse)&&(n=null)):Fu[o]===Fu.Click&&(n=a,a=null);var i,e=Ou(e)?e.changedTouches[0]:e;e&&(t=l.getId(t),i=e.clientX,e=e.clientY,Ne(s)(Ae({type:Fu[r],id:t,x:i,y:e},null!==n&&{pointerType:n})))}}var o,n=Li(e);o=e;if(window.PointerEvent)switch(Fu[e]){case Fu.MouseDown:case Fu.MouseUp:n=n.replace("mouse","pointer");break;case Fu.TouchStart:case Fu.TouchEnd:return}r.push(wu(n,t,i))}),Ne(function(){r.forEach(function(e){return e()})}))}function ec(e){var r=e.scrollCb,i=e.doc,o=e.mirror,a=e.blockClass,s=e.blockSelector,e=e.sampling;return wu("scroll",Ne(ku(Ne(function(e){var t,n,e=$u(e);e&&!Ru(e,a,s,!0)&&(t=o.getId(e),e===i&&i.defaultView?(n=_u(i.defaultView),r({id:t,x:n.left,y:n.top})):r({id:t,x:e.scrollLeft,y:e.scrollTop}))}),e.scroll||100)),i)}var tc=["INPUT","TEXTAREA","SELECT"],nc=new WeakMap;function rc(e){return function e(t,n){var r;return sc("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||sc("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||sc("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||sc("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(r=Array.from(t.parentRule.cssRules).indexOf(t),n.unshift(r),e(t.parentRule,n)):(t.parentStyleSheet&&(r=Array.from(t.parentStyleSheet.cssRules).indexOf(t),n.unshift(r)),n)}(e,[])}function ic(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function oc(e,t){var n=e.mirror,r=e.stylesheetManager,i="#document"===t.nodeName?n.getId(t):n.getId(Le.host(t)),n="#document"===t.nodeName?null==(e=t.defaultView)?void 0:e.Document:null==(e=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:e.ShadowRoot,o=null!=n&&n.prototype?Object.getOwnPropertyDescriptor(null==n?void 0:n.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&n&&o?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:function(){var e;return null==(e=o.get)?void 0:e.call(this)},set:function(e){var t=null==(t=o.set)?void 0:t.call(this,e);if(null!==i&&-1!==i)try{r.adoptStyleSheets(e,i)}catch(e){}return t}}),Ne(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):function(){}}function ac(e){var t,n,D,N,F,U,B,z,j,H,W,G,q,V,r=e.doc.defaultView;if(!r)return function(){};t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(T=e).mutationCb,D=T.mousemoveCb,N=T.mouseInteractionCb,F=T.scrollCb,U=T.viewportResizeCb,B=T.inputCb,z=T.mediaInteractionCb,j=T.styleSheetRuleCb,H=T.styleDeclarationCb,W=T.canvasMutationCb,G=T.fontCb,q=T.selectionCb,V=T.customElementCb,T.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},T.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),D.apply(void 0,arguments)},T.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),N.apply(void 0,arguments)},T.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),F.apply(void 0,arguments)},T.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),U.apply(void 0,arguments)},T.inputCb=function(){t.input&&t.input.apply(t,arguments),B.apply(void 0,arguments)},T.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),z.apply(void 0,arguments)},T.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),j.apply(void 0,arguments)},T.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),H.apply(void 0,arguments)},T.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),W.apply(void 0,arguments)},T.fontCb=function(){t.font&&t.font.apply(t,arguments),G.apply(void 0,arguments)},T.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),q.apply(void 0,arguments)},T.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),V.apply(void 0,arguments)};var i,Z,K,J,X,$,Y,Q,a,ee,te,ne,re,s,l,ie,u,o,c,oe,d,h,f,p,ae,se,le,ue,m,g,v,ce,y,w,b,k,S,_,E,C,de=function(){},he=(e.recordDOM&&(T=Pe(Yu(e,e.doc),2),i=T[0],de=T[1]),le=(T=e).mousemoveCb,x=T.doc,ue=T.mirror,!1===(R=T.sampling).mousemove?function(){}:(T="number"==typeof R.mousemove?R.mousemove:50,R="number"==typeof R.mousemoveCallback?R.mousemoveCallback:500,p=[],ae=ku(Ne(function(e){var t=Date.now()-f;le(p.map(function(e){return e.timeOffset-=t,e}),e),p=[],f=null}),R),R=Ne(ku(Ne(function(e){var t=$u(e),n=Ou(e)?e.changedTouches[0]:e,r=n.clientX,n=n.clientY;f=f||vu(),p.push({x:r,y:n,id:ue.getId(t),timeOffset:vu()-f}),ae("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)}),T,{trailing:!1})),se=[wu("mousemove",R,x),wu("touchmove",R,x),wu("drag",R,x)],Ne(function(){se.forEach(function(e){return e()})}))),fe=Qu(e),pe=ec(e),me=(T={win:r},oe=(R=e).viewportResizeCb,R=T.win,h=d=-1,wu("resize",Ne(ku(Ne(function(){var e=Eu(),t=Cu();d===e&&h===t||(oe({width:Number(t),height:Number(e)}),d=e,h=t)}),200)),R)),ge=(Q=(x=e).inputCb,a=x.doc,ee=x.mirror,te=x.blockClass,ne=x.blockSelector,re=x.ignoreClass,s=x.ignoreSelector,l=x.maskInputOptions,ie=x.maskInputFn,u=x.userTriggeredOnInput,o=("last"===x.sampling.input?["change"]:["input","change"]).map(function(e){return wu(e,Ne(Se),a)}),(c=a.defaultView)?(x=c.Object.getOwnPropertyDescriptor(c.HTMLInputElement.prototype,"value"),T=[[c.HTMLInputElement.prototype,"value"],[c.HTMLInputElement.prototype,"checked"],[c.HTMLSelectElement.prototype,"value"],[c.HTMLTextAreaElement.prototype,"value"],[c.HTMLSelectElement.prototype,"selectedIndex"],[c.HTMLOptionElement.prototype,"selected"]],x&&x.set&&o.push.apply(o,ii(T.map(function(e){return Su(e[0],e[1],{set:function(){Ne(Se)({target:this,isTrusted:!1})}},!1,c)}))),Ne(function(){o.forEach(function(e){return e()})})):function(){o.forEach(function(e){return e()})}),ve=(Z=(R=e).mediaInteractionCb,K=R.blockClass,J=R.blockSelector,X=R.mirror,$=R.sampling,R=R.doc,x=Ne(function(a){return ku(Ne(function(e){var t,n,r,i,o,e=$u(e);e&&!Ru(e,K,J,!0)&&(t=e.currentTime,n=e.volume,r=e.muted,i=e.playbackRate,o=e.loop,Z({type:a,id:X.getId(e),currentTime:t,volume:n,muted:r,playbackRate:i,loop:o}))}),$.media||500)}),Y=[wu("play",x(zu.Play),R),wu("pause",x(zu.Pause),R),wu("seeked",x(zu.Seeked),R),wu("volumechange",x(zu.VolumeChange),R),wu("ratechange",x(zu.RateChange),R)],Ne(function(){Y.forEach(function(e){return e()})})),ye=function(){},we=function(){},be=function(){},ke=function(){};function Se(e){var t,n,r,i=$u(e),e=e.isTrusted,o=i&&i.tagName;!(i=i&&"OPTION"===o?Le.parentElement(i):i)||!o||tc.indexOf(o)<0||Ru(i,te,ne,!0)||i.classList.contains(re)||s&&i.matches(s)||(t=i.value,n=!1,"radio"===(r=Di(i)||"")||"checkbox"===r?n=i.checked:(l[o.toLowerCase()]||l[r])&&(t=Pi({element:i,maskInputOptions:l,tagName:o,type:r,value:t,maskInputFn:ie})),_e(i,u?{text:t,isChecked:n,userTriggered:e}:{text:t,isChecked:n}),o=i.name,"radio"===r&&o&&n&&a.querySelectorAll('input[type="radio"][name="'.concat(o,'"]')).forEach(function(e){var t;e!==i&&(t=e.value,_e(e,u?{text:t,isChecked:!n,userTriggered:!1}:{text:t,isChecked:!n}))}))}function _e(e,t){var n=nc.get(e);n&&n.text===t.text&&n.isChecked===t.isChecked||(nc.set(e,t),n=ee.getId(e),Ne(Q)(Ae(Ae({},t),{},{id:n})))}e.recordDOM&&(ye=((e,t)=>{var s=e.styleSheetRuleCb,l=e.mirror,u=e.stylesheetManager,r=t.win;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return function(){};var n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ne(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=ic(t,l,u.styleMirror),a=o.id,o=o.styleId;return(a&&-1!==a||o&&-1!==o)&&s({id:a,styleId:o,adds:[{rule:i,index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.addRule=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,e="".concat(e," { ").concat(t," }");return r.CSSStyleSheet.prototype.insertRule.apply(this,[e,n])};var i,o,a=r.CSSStyleSheet.prototype.deleteRule,c=(r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=ic(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,removes:[{index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=ic(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,replace:r}),e.apply(t,n)})})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=ic(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,replaceSync:r}),e.apply(t,n)})})),{}),d=(lc("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(lc("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),lc("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),lc("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule)),{});return Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];d[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ne(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=ic(t.parentStyleSheet,l,u.styleMirror),a=o.id,o=o.styleId;return(a&&-1!==a||o&&-1!==o)&&s({id:a,styleId:o,adds:[{rule:i,index:[].concat(ii(rc(t)),[r||0])}]}),e.apply(t,n)})}),e.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=ic(t.parentStyleSheet,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,removes:[{index:[].concat(ii(rc(t)),[r])}]}),e.apply(t,n)})})}),Ne(function(){r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=a,i&&(r.CSSStyleSheet.prototype.replace=i),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];e.prototype.insertRule=d[t].insertRule,e.prototype.deleteRule=d[t].deleteRule})})})(e,{win:r}),we=oc(e,e.doc),T={win:r},w=(x=e).styleDeclarationCb,b=x.mirror,k=x.ignoreCSSAttributes,S=x.stylesheetManager,_=T.win,E=_.CSSStyleDeclaration.prototype.setProperty,_.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:Ne(function(e,t,n){var r,i,o=Pe(n,3),a=o[0],s=o[1],o=o[2];return k.has(a)?E.apply(t,[a,s,o]):(r=(i=ic(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,S.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,set:{property:a,value:s,priority:o},index:rc(t.parentRule)}),e.apply(t,n))})}),C=_.CSSStyleDeclaration.prototype.removeProperty,_.CSSStyleDeclaration.prototype.removeProperty=new Proxy(C,{apply:Ne(function(e,t,n){var r,i,o=Pe(n,1)[0];return k.has(o)?C.apply(t,[o]):(r=(i=ic(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,S.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,remove:{property:o},index:rc(t.parentRule)}),e.apply(t,n))})}),be=Ne(function(){_.CSSStyleDeclaration.prototype.setProperty=E,_.CSSStyleDeclaration.prototype.removeProperty=C}),e.collectFonts)&&(ce=(R=e).fontCb,y=(R=R.doc).defaultView,ke=y?(m=[],g=new WeakMap,v=y.FontFace,y.FontFace=function(e,t,n){var r=new v(e,t,n);return g.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r},R=yu(R.fonts,"add",function(e){return function(t){return setTimeout(Ne(function(){var e=g.get(t);e&&(ce(e),g.delete(t))}),0),e.apply(this,[t])}}),m.push(function(){y.FontFace=v}),m.push(R),Ne(function(){m.forEach(function(e){return e()})})):function(){});Te=(x=e).doc,O=x.mirror,M=x.blockClass,I=x.blockSelector,Re=x.selectionCb,A=!0,(x=Ne(function(){var e=Te.getSelection();if(!(!e||A&&null!=e&&e.isCollapsed)){A=e.isCollapsed||!1;for(var t=[],n=e.rangeCount||0,r=0;r<n;r++){var i=e.getRangeAt(r),o=i.startContainer,a=i.startOffset,s=i.endContainer,i=i.endOffset;Ru(o,M,I,!0)||Ru(s,M,I,!0)||t.push({start:O.getId(o),startOffset:a,end:O.getId(s),endOffset:i})}Re({ranges:t})}}))();var Ee,T,R,Ce,x,Te,O,M,I,Re,A,xe=wu("selectionchange",x),Oe=(R=(T=e).doc,Ce=T.customElementCb,(T=R.defaultView)&&T.customElements?yu(T.customElements,"define",function(r){return function(t,e,n){try{Ce({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return r.apply(this,[t,e,n])}}):function(){}),Me=[],P=Ie(e.plugins);try{for(P.s();!(Ee=P.n()).done;){var L=Ee.value;Me.push(L.observer(L.callback,r,L.options))}}catch(e){P.e(e)}finally{P.f()}return Ne(function(){Xu.forEach(function(e){return e.reset()}),null!=i&&i.disconnect(),de(),he(),fe(),pe(),me(),ge(),ve(),ye(),we(),be(),ke(),xe(),Oe(),Me.forEach(function(e){return e()})})}function sc(e){return void 0!==window[e]}function lc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var uc=k(function e(t){b(this,e),c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t},[{key:"getId",value:function(e,t,n,r){n=n||this.getIdToRemoteIdMap(e),r=r||this.getRemoteIdToIdMap(e),e=n.get(t);return e||(e=this.generateIdFn(),n.set(t,e),r.set(e,t)),e}},{key:"getIds",value:function(t,e){var n=this,r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getId(t,e,r,i)})}},{key:"getRemoteId",value:function(e,t,n){n=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}},{key:"getRemoteIds",value:function(t,e){var n=this,r=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getRemoteId(t,e,r)})}},{key:"reset",value:function(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),cc=k(function e(t){b(this,e),c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new uc(Zi)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new uc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))},[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=this.crossOriginIframeMap.get(e.source))&&(e=this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}},{key:"transformCrossOriginEvent",value:function(n,e){var t,r=this;switch(e.type){case Y.FullSnapshot:this.crossOriginIframeMirror.reset(n),this.crossOriginIframeStyleMirror.reset(n),this.replaceIdOnNode(e.data.node,n);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(n,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Y.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(n),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return e;case Y.Custom:return this.replaceIds(e.data.payload,n,["id","parentId","previousId","nextId"]),e;case Y.IncrementalSnapshot:switch(e.data.source){case De.Mutation:return e.data.adds.forEach(function(e){r.replaceIds(e,n,["parentId","nextId","previousId"]),r.replaceIdOnNode(e.node,n);var t=r.crossOriginIframeRootIdMap.get(n);t&&r.patchRootIdOnNode(e.node,t)}),e.data.removes.forEach(function(e){r.replaceIds(e,n,["parentId","id"])}),e.data.attributes.forEach(function(e){r.replaceIds(e,n,["id"])}),e.data.texts.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case De.Drag:case De.TouchMove:case De.MouseMove:return e.data.positions.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(e.data,n,["id"]),e;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleId"]),e;case De.Font:return e;case De.Selection:return e.data.ranges.forEach(function(e){r.replaceIds(e,n,["start","end"])}),e;case De.AdoptedStyleSheet:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleIds"]),null!=(t=e.data.styles)&&t.forEach(function(e){r.replaceStyleIds(e,n,["styleId"])}),e}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;!Array.isArray(t[a])&&"number"!=typeof t[a]||(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===ju.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})}}]),dc=k(function e(t){b(this,e),c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()},[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n,r=this;Oi(e)&&!this.shadowDoms.has(e)&&(this.shadowDoms.add(e),n=Pe(Yu(Ae(Ae({},this.bypassOptions),{},{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),1)[0],this.restoreHandlers.push(function(){return n.disconnect()}),this.restoreHandlers.push(ec(Ae(Ae({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&0<e.adoptedStyleSheets.length&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(Le.host(e))),r.restoreHandlers.push(oc({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e))},0))}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,r){var i=this;this.restoreHandlers.push(yu(e.prototype,"attachShadow",function(n){return function(e){var e=n.call(this,e),t=Le.shadowRoot(this);return t&&Nu(this)&&i.addShadowRoot(t,r),e}}))}},{key:"reset",value:function(){this.restoreHandlers.forEach(function(e){try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pc=0;pc<hc.length;pc++)fc[hc.charCodeAt(pc)]=pc;var mc=new Map,gc=function(e,t,n){var r;if(e&&(wc(e,t)||"object"===S(e)))return t=n,n=e.constructor.name,(r=mc.get(t))||(r=new Map,mc.set(t,r)),r.has(n)||r.set(n,[]),-1===(r=(t=r.get(n)).indexOf(e))&&(r=t.length,t.push(e)),r};function vc(i,t,n){return i instanceof Array?i.map(function(e){return vc(e,t,n)}):null===i?i:i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray?{rr_type:i.constructor.name,args:[Object.values(i)]}:i instanceof ArrayBuffer?{rr_type:i.constructor.name,base64:(()=>{for(var e=new Uint8Array(i),t=e.length,n="",r=0;r<t;r+=3)n=(n=(n=(n+=hc[e[r]>>2])+hc[(3&e[r])<<4|e[r+1]>>4])+hc[(15&e[r+1])<<2|e[r+2]>>6])+hc[63&e[r+2]];return t%3==2?n=n.substring(0,n.length-1)+"=":t%3==1&&(n=n.substring(0,n.length-2)+"=="),n})()}:i instanceof DataView?{rr_type:i.constructor.name,args:[vc(i.buffer,t,n),i.byteOffset,i.byteLength]}:i instanceof HTMLImageElement?{rr_type:i.constructor.name,src:i.src}:i instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:i.toDataURL()}:i instanceof ImageData?{rr_type:i.constructor.name,args:[vc(i.data,t,n),i.width,i.height]}:wc(i,t)||"object"===S(i)?{rr_type:i.constructor.name,index:gc(i,t,n)}:i}function yc(e,t,n){return e.map(function(e){return vc(e,t,n)})}var wc=function(t,n){var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof n[e]});return Boolean(e.find(function(e){return t instanceof n[e]}))};function bc(e,a,s,l){var t=[];try{var n=yu(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ru(this,a,s,!0)||(t="experimental-webgl"===(t=e)?"webgl":t,"__context"in this||(this.__context=t),l&&["webgl","webgl2"].includes(t)&&(r[0]&&"object"===S(r[0])?(t=r[0]).preserveDrawingBuffer||(t.preserveDrawingBuffer=!0):r.splice(0,1,{preserveDrawingBuffer:!0}))),o.apply(this,[e].concat(r))}});t.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){t.forEach(function(e){return e()})}}function kc(n,s,l,u,c,d){var e,r=[],t=Ie(Object.getOwnPropertyNames(n));try{for(t.s();!(e=t.n()).done;)(()=>{var a=e.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return;try{if("function"!=typeof n[a])return;var t=yu(n,a,function(o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=o.apply(this,t);return gc(i,d,this),"tagName"in this.canvas&&!Ru(this.canvas,u,c,!0)&&(r=yc(t,d,this),l(this.canvas,{type:s,property:a,args:r})),i}});r.push(t)}catch(e){t=Su(n,a,{set:function(e){l(this.canvas,{type:s,property:a,args:[e],setter:!0})}});r.push(t)}})()}catch(n){t.e(n)}finally{t.f()}return r}var Sc='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',_c="undefined"!=typeof self&&self.Blob&&new Blob([Sc],{type:"text/javascript;charset=utf-8"});function Ec(e){var t,n;try{if(t=_c&&(self.URL||self.webkitURL).createObjectURL(_c))return(n=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",function(){(self.URL||self.webkitURL).revokeObjectURL(t)}),n;throw""}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Sc),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Q,Cc,Tc,Rc=k(function e(t){var n=this,r=(b(this,e),c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",function(e,t){(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId||!n.rafStamps.invokeId)&&(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)}),t.sampling),r=void 0===r?"all":r,i=t.win,o=t.blockClass,a=t.blockSelector,s=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===r&&this.initCanvasMutationObserver(i,o,a),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,a,{dataURLOptions:l})},[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,i,o,a){var s=this,t=bc(r,i,o,!0),l=new Map,u=new Ec;u.onmessage=function(e){var t,n=e.data.id;l.set(n,!1),"base64"in e.data&&(t=(e=e.data).base64,s.mutationCb({id:n,type:Bu["2D"],commands:[{property:"clearRect",args:[0,0,e.width,e.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e.type}]},0,0]}]}))};var c=1e3/e,d=0,h=function(e){var t,n;f=(d&&e-d<c||(d=e,t=[],r.document.querySelectorAll("canvas").forEach(function(e){Ru(e,i,o,!0)||t.push(e)}),t.forEach((n=Gr(Qr().m(function e(t){var n,r,i;return Qr().w(function(e){for(;;)switch(e.n){case 0:if(n=s.mirror.getId(t),l.get(n))return e.a(2);e.n=1;break;case 1:if(0===t.width||0===t.height)return e.a(2);e.n=2;break;case 2:return l.set(n,!0),["webgl","webgl2"].includes(t.__context)&&(r=t.getContext(t.__context),!1===(null==(i=null==r?void 0:r.getContextAttributes())?void 0:i.preserveDrawingBuffer))&&r.clear(r.COLOR_BUFFER_BIT),e.n=3,createImageBitmap(t);case 3:i=e.v,u.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:a.dataURLOptions},[i]);case 4:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}))),requestAnimationFrame(h))},f=requestAnimationFrame(h);this.resetObservers=function(){t(),cancelAnimationFrame(f)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r,i,o=bc(e,t,n,!1),a=((a,s,l,u)=>{var e,n=[],t=Ie(Object.getOwnPropertyNames(s.CanvasRenderingContext2D.prototype));try{for(t.s();!(e=t.n()).done;)(()=>{var o=e.value;try{if("function"!=typeof s.CanvasRenderingContext2D.prototype[o])return;var t=yu(s.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ru(this.canvas,l,u,!0)||setTimeout(function(){var e=yc(n,s,t);a(t.canvas,{type:Bu["2D"],property:o,args:e})},0),i.apply(this,n)}});n.push(t)}catch(e){t=Su(s.CanvasRenderingContext2D.prototype,o,{set:function(e){a(this.canvas,{type:Bu["2D"],property:o,args:[e],setter:!0})}});n.push(t)}})()}catch(a){t.e(a)}finally{t.f()}return function(){n.forEach(function(e){return e()})}})(this.processMutation.bind(this),e,t,n),s=(r=this.processMutation.bind(this),t=t,n=n,i=[],void 0!==(e=e).WebGLRenderingContext&&i.push.apply(i,ii(kc(e.WebGLRenderingContext.prototype,Bu.WebGL,r,t,n,e))),void 0!==e.WebGL2RenderingContext&&i.push.apply(i,ii(kc(e.WebGL2RenderingContext.prototype,Bu.WebGL2,r,t,n,e))),function(){i.forEach(function(e){return e()})});this.resetObservers=function(){o(),a(),s()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})}},{key:"startRAFTimestamping",value:function(){function t(e){n.rafStamps.latestId=e,requestAnimationFrame(t)}var n=this;requestAnimationFrame(t)}},{key:"flushPendingCanvasMutations",value:function(){var r=this;this.pendingCanvasMutations.forEach(function(e,t){var n=r.mirror.getId(t);r.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})}},{key:"flushPendingCanvasMutationFor",value:function(e,t){var n,r;this.frozen||this.locked||(r=this.pendingCanvasMutations.get(e))&&-1!==t&&(n=r.map(function(e){return e.type,Yr(e,fi)}),r=r[0].type,this.mutationCb({id:t,type:r,commands:n}),this.pendingCanvasMutations.delete(e))}}]),xc=k(function e(t){b(this,e),c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Pu),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb},[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){var r=this;if(0!==e.length){var i,o={id:t,styleIds:[]},a=[],n=Ie(e);try{for(n.s();!(i=n.n()).done;)(()=>{var e,n=i.value;r.styleMirror.has(n)?e=r.styleMirror.getId(n):(e=r.styleMirror.add(n),a.push({styleId:e,rules:Array.from(n.rules||CSSRule,function(e,t){return{rule:Ii(e,n.href),index:t}})})),o.styleIds.push(e)})()}catch(e){n.e(e)}finally{n.f()}0<a.length&&(o.styles=a),this.adoptedStyleSheetCb(o)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),Oc=k(function e(){b(this,e),c(this,"nodeMap",new WeakMap),c(this,"active",!1)},[{key:"inOtherBuffer",value:function(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(function(e){return e!==t})}},{key:"add",value:function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"destroy",value:function(){}}]),Mc=!1;try{2!==Array.from([1],function(e){return 2*e})[0]&&(Yf=document.createElement("iframe"),document.body.appendChild(Yf),Array.from=(null==(qf=Yf.contentWindow)?void 0:qf.Array.from)||Array.from,document.body.removeChild(Yf))}catch(wd){console.debug("Unable to override Array.from",wd)}var Ic=new Ai;function Ac(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.emit,i=e.checkoutEveryNms,o=e.checkoutEveryNth,t=e.blockClass,l=void 0===t?"rr-block":t,t=e.blockSelector,u=void 0===t?null:t,t=e.ignoreClass,D=void 0===t?"rr-ignore":t,t=e.ignoreSelector,N=void 0===t?null:t,t=e.maskTextClass,c=void 0===t?"rr-mask":t,t=e.maskTextSelector,d=void 0===t?null:t,t=e.inlineStylesheet,h=void 0===t||t,t=e.maskAllInputs,n=e.maskInputOptions,F=e.slimDOMOptions,f=e.maskInputFn,p=e.maskTextFn,U=e.hooks,B=e.packFn,a=e.sampling,s=void 0===a?{}:a,a=e.dataURLOptions,m=void 0===a?{}:a,a=e.mousemoveWait,g=e.recordDOM,z=void 0===g||g,g=e.recordCanvas,v=void 0!==g&&g,g=e.recordCrossOriginIframes,g=void 0!==g&&g,y=e.recordAfter,j=void 0===y?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":y,y=e.userTriggeredOnInput,H=void 0!==y&&y,y=e.collectFonts,W=void 0!==y&&y,y=e.inlineImages,w=void 0!==y&&y,b=e.plugins,y=e.keepIframeSrcFn,k=void 0===y?function(){return!1}:y,y=e.ignoreCSSAttributes,G=void 0===y?new Set([]):y,S=(Gu=e.errorHandler,!g||window.parent===window),_=!1;if(!S)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(S&&!r)throw new Error("emit function is required");if(!S&&!_)return function(){};void 0!==a&&void 0===s.mousemove&&(s.mousemove=a),Ic.reset();var q,E=!0===t?{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!==n?n:{password:!0},C=io(F),T=(!function(e){"NodeList"in(e=0<arguments.length&&void 0!==e?e:window)&&!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)}(),0),V=function(e){var t,n=Ie(b||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return e=B&&!_?B(e):e};Q=function(e,t){var n;e.timestamp=vu(),null==(n=Xu[0])||!n.isFrozen()||e.type===Y.FullSnapshot||e.type===Y.IncrementalSnapshot&&e.data.source===De.Mutation||Xu.forEach(function(e){return e.unfreeze()}),S?null!=r&&r(V(e),t):_&&(n={type:"rrweb",event:V(e),origin:window.location.origin,isCheckout:t},window.parent.postMessage(n,"*")),e.type===Y.FullSnapshot?(q=e,T=0):e.type!==Y.IncrementalSnapshot||e.data.source===De.Mutation&&e.data.isAttachIframe||(T++,t=o&&o<=T,n=i&&e.timestamp-q.timestamp>i,(t||n)&&Cc(!0))};function R(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Mutation},e)})}function Z(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Scroll},e)})}function K(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.CanvasMutation},e)})}var J,x=new xc({mutationCb:R,adoptedStyleSheetCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.AdoptedStyleSheet},e)})}}),O=new cc({mirror:Ic,mutationCb:R,stylesheetManager:x,recordCrossOriginIframes:g,wrappedEmit:Q}),M=Ie(b||[]);try{for(M.s();!(J=M.n()).done;){var X=J.value;X.getMirror&&X.getMirror({nodeMirror:Ic,crossOriginIframeMirror:O.crossOriginIframeMirror,crossOriginIframeStyleMirror:O.crossOriginIframeStyleMirror})}}catch(e){M.e(e)}finally{M.f()}var I=new Oc,A=(Tc=new Rc({recordCanvas:v,mutationCb:K,win:window,blockClass:l,blockSelector:u,mirror:Ic,sampling:s.canvas,dataURLOptions:m}),new dc({mutationCb:R,scrollCb:Z,bypassOptions:{blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:E,dataURLOptions:m,maskTextFn:p,maskInputFn:f,recordCanvas:v,inlineImages:w,sampling:s,slimDOMOptions:C,iframeManager:O,stylesheetManager:x,canvasManager:Tc,keepIframeSrcFn:k,processedNodeManager:I},mirror:Ic}));Cc=function(){var e,t,n,r,i,o,a=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(z){Q({type:Y.Meta,data:{href:window.location.href,width:Cu(),height:Eu()}},a),x.reset(),A.init(),Xu.forEach(function(e){return e.lock()});s=document,r=void 0===(r=(e={mirror:Ic,blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskAllInputs:E,maskTextFn:p,maskInputFn:f,slimDOM:C,dataURLOptions:m,recordCanvas:v,inlineImages:w,onSerialize:function(e){Mu(e,Ic)&&O.addIframe(e),Iu(e,Ic)&&x.trackLinkElement(e),Au(e)&&A.addShadowRoot(Le.shadowRoot(e),document)},onIframeLoad:function(e,t){O.attachIframe(e,t),A.observeAttachShadow(e)},onStylesheetLoad:function(e,t){x.attachLinkElement(e,t)},keepIframeSrcFn:k}).mirror)?new Ai:r,t=e.inlineImages,n=e.recordCanvas,i=e.slimDOM,o=e.keepIframeSrcFn;var s=oo(s,{doc:s,mirror:r,blockClass:void 0===(s=e.blockClass)?"rr-block":s,blockSelector:void 0===(r=e.blockSelector)?null:r,maskTextClass:void 0===(s=e.maskTextClass)?"rr-mask":s,maskTextSelector:void 0===(r=e.maskTextSelector)?null:r,skipChild:!1,inlineStylesheet:void 0===(s=e.inlineStylesheet)||s,maskInputOptions:!0===(r=void 0!==(r=e.maskAllInputs)&&r)?{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===r?{password:!0}:r,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:io(void 0!==i&&i),dataURLOptions:e.dataURLOptions,inlineImages:void 0!==t&&t,recordCanvas:void 0!==n&&n,preserveWhiteSpace:e.preserveWhiteSpace,onSerialize:e.onSerialize,onIframeLoad:e.onIframeLoad,iframeLoadTimeout:e.iframeLoadTimeout,onStylesheetLoad:e.onStylesheetLoad,stylesheetLoadTimeout:e.stylesheetLoadTimeout,keepIframeSrcFn:void 0===o?function(){return!1}:o,newlyAddedElement:!1});if(!s)return console.warn("Failed to snapshot the document");Q({type:Y.FullSnapshot,data:{node:s,initialOffset:_u(window)}},a),Xu.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&x.adoptStyleSheets(document.adoptedStyleSheets,Ic.getId(document))}};try{var P=[],$=function(e){return Ne(ac)({mutationCb:R,mousemoveCb:function(e,t){return Q({type:Y.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.MouseInteraction},e)})},scrollCb:Z,viewportResizeCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.ViewportResize},e)})},inputCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Input},e)})},mediaInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.MediaInteraction},e)})},styleSheetRuleCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.StyleSheetRule},e)})},styleDeclarationCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.StyleDeclaration},e)})},canvasMutationCb:K,fontCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Font},e)})},selectionCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Selection},e)})},customElementCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.CustomElement},e)})},blockClass:l,ignoreClass:D,ignoreSelector:N,maskTextClass:c,maskTextSelector:d,maskInputOptions:E,inlineStylesheet:h,sampling:s,recordDOM:z,recordCanvas:v,inlineImages:w,userTriggeredOnInput:H,collectFonts:W,doc:e,maskInputFn:f,maskTextFn:p,keepIframeSrcFn:k,blockSelector:u,slimDOMOptions:C,dataURLOptions:m,mirror:Ic,iframeManager:O,stylesheetManager:x,shadowDomManager:A,processedNodeManager:I,canvasManager:Tc,ignoreCSSAttributes:G,plugins:(null==(e=null==b?void 0:b.filter(function(e){return e.observer}))?void 0:e.map(function(t){return{observer:t.observer,options:t.options,callback:function(e){return Q({type:Y.Plugin,data:{plugin:t.name,payload:e}})}}}))||[]},U)},L=(O.addLoadListener(function(e){try{P.push($(e.contentDocument))}catch(e){console.warn(e)}}),function(){Cc(),P.push($(document)),Mc=!0});return["interactive","complete"].includes(document.readyState)?L():(P.push(wu("DOMContentLoaded",function(){Q({type:Y.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&L()})),P.push(wu("load",function(){Q({type:Y.Load,data:{}}),"load"===j&&L()},window))),function(){P.forEach(function(e){try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),I.destroy(),Mc=!1,Gu=void 0}}catch(e){console.warn(e)}}Ac.addCustomEvent=function(e,t){if(!Mc)throw new Error("please add custom event after start recording");Q({type:Y.Custom,data:{tag:e,payload:t}})},Ac.freezePage=function(){Xu.forEach(function(e){return e.freeze()})},Ac.takeFullSnapshot=function(e){if(!Mc)throw new Error("please take full snapshot after start recording");Cc(e)},Ac.mirror=Ic;var Pc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Lc={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,autoDetectSensitiveData:!0,mask:[".tdem-mask","[data-tdem-mask]","[data-sensitive]",".sensitive",".private"],block:[".tdem-block","[data-tdem-block]",".secret","[data-secret]","iframe[srcdoc]:not([src])",".replayer-wrapper"],ignore:[".tdem-ignore","[data-tdem-ignore]",'input[type="file"]','input[type="password"]'],maskInputOptions:{password:!0,email:!0,tel:!0,text:!1}},Dc=(Nc.maskPhone=function(e){return e.replace(this.phoneRegex,function(e){var t=e.replace(/[^\d]/g,"");return 11===t.length?e.substring(0,3)+"****"+e.substring(7):13===t.length?e.substring(0,6)+"****"+e.substring(10):e.substring(0,3)+"****"+e.substring(e.length-4)})},Nc.maskIdCard=function(e){return e.replace(this.idCardRegex,function(e){return 18===e.length?e.substring(0,6)+"********"+e.substring(14):15===e.length?e.substring(0,6)+"******"+e.substring(12):e})},Nc.maskEmail=function(e){return e.replace(this.emailRegex,function(e){var t,n=e.indexOf("@");return n<=1?"*"+e.substring(1):(t=e.substring(0,n),e=e.substring(n),t.charAt(0)+"***"+t.charAt(t.length-1)+e)})},Nc.maskBankCard=function(e){return e.replace(this.bankCardRegex,function(e){var t=e.replace(/[^\d]/g,"");return t.length<13?e:t.substring(0,4)+" **** **** "+t.substring(t.length-4)})},Nc.maskIP=function(e){return e.replace(this.ipv4Regex,function(e){e=e.split(".");return e[0]+".*.*."+e[3]})},Nc.autoMask=function(e){var t;return e&&"string"==typeof e?(t=this.maskPhone(t=e),t=this.maskIdCard(t),t=this.maskEmail(t),this.maskBankCard(t)):e},Nc.hasSensitiveData=function(e){return!(!e||"string"!=typeof e)&&(this.phoneRegex.test(e)||this.idCardRegex.test(e)||this.emailRegex.test(e)||this.bankCardRegex.test(e))},Nc.phoneRegex=/1[3-9]\d{9}|(?:\+?86)?1[3-9]\d{9}/g,Nc.idCardRegex=/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]|[1-9]\d{7}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}/g,Nc.emailRegex=/[\w.-]+@[\w.-]+\.\w{2,}/g,Nc.bankCardRegex=/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{1,7}\b/g,Nc.ipv4Regex=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,Nc);function Nc(){}function Fc(e,t){return void 0===e&&(e={}),f(f(f({},t=void 0===t?Lc:t),e),{mask:Uc(t.mask,e.mask),block:Uc(t.block,e.block),ignore:Uc(t.ignore,e.ignore),maskInputOptions:f(f({},t.maskInputOptions),e.maskInputOptions)})}function Uc(e,t){e=new Set(A(e||[],t||[]));return Array.from(e)}Gc.prototype.push=function(e,t){if(this.emitFn=t,3===e.type&&this.isMutationEvent(e)){var n=e.data;if(this.buffer){if(this.enableRepeatDetection&&this.isRepeatPattern(n)){if(this.repeatCount++,3<this.repeatCount)return this.buffer=this.cloneEvent(e),void this.droppedByRepeat++}else this.repeatCount=0;this.mergeInto(n,e.timestamp),this.mergedCount++,(null!=(n=null==(n=this.buffer.data.adds)?void 0:n.length)?n:0)>=this.maxAddsPerMerge&&this.flush()}else this.buffer=this.cloneEvent(e),this.scheduleFlush()}else this.flush(),t(e)},Gc.prototype.flush=function(){this.clearTimer(),this.buffer&&this.emitFn&&(this.emitFn(this.buffer),this.buffer=null,this.repeatCount=0)},Gc.prototype.destroy=function(){this.flush(),this.clearTimer(),this.emitFn=null},Gc.prototype.getStats=function(){return{mergedCount:this.mergedCount,droppedByRepeat:this.droppedByRepeat,cancelledByOffset:this.cancelledByOffset}},Gc.prototype.isMutationEvent=function(e){return 0===(null==(e=e.data)?void 0:e.source)},Gc.prototype.isRepeatPattern=function(e){var t;return!!this.buffer&&(t=null!=(t=this.buffer.data.adds)?t:[],e=null!=(e=e.adds)?e:[],0!==t.length)&&0!==e.length&&t.length===e.length&&(null==(t=t[0])?void 0:t.parentId)===(null==(t=e[0])?void 0:t.parentId)},Gc.prototype.mergeInto=function(e,t){var n,r,i,o;if(this.buffer){var a=this.buffer.data;this.buffer.timestamp=Math.max(this.buffer.timestamp,t);for(var s=this,l=0,u=null!=(t=e.removes)?t:[];l<u.length;l++)(t=>{var e=(null!=(n=a.adds)?n:[]).findIndex(function(e){return(null==(e=e.node)?void 0:e.id)===t.id});0<=e?(a.adds.splice(e,1),s.cancelledByOffset++):(a.removes=null!=(n=a.removes)?n:[],a.removes.push(t))})(u[l]);for(var c=0,d=null!=(t=e.adds)?t:[];c<d.length;c++){var h=d[c];a.adds=null!=(r=a.adds)?r:[],a.adds.push(h)}for(var f=0,p=null!=(t=e.attributes)?t:[];f<p.length;f++)(t=>{a.attributes=null!=(i=a.attributes)?i:[];var e=a.attributes.findIndex(function(e){return e.id===t.id});0<=e?a.attributes[e]=t:a.attributes.push(t)})(p[f]);for(var m=0,g=null!=(t=e.texts)?t:[];m<g.length;m++)(t=>{a.texts=null!=(o=a.texts)?o:[];var e=a.texts.findIndex(function(e){return e.id===t.id});0<=e?a.texts[e]=t:a.texts.push(t)})(g[m])}},Gc.prototype.cloneEvent=function(e){var t=e.data;return{type:e.type,timestamp:e.timestamp,data:{source:0,adds:A(null!=(e=t.adds)?e:[]),removes:A(null!=(e=t.removes)?e:[]),attributes:A(null!=(e=t.attributes)?e:[]),texts:A(null!=(e=t.texts)?e:[])}}},Gc.prototype.scheduleFlush=function(){var e=this;this.clearTimer(),this.flushTimer=setTimeout(function(){e.flushTimer=null,e.flush()},this.windowMs)},Gc.prototype.clearTimer=function(){null!==this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null)};var Bc=Gc,zc=(Wc.prototype.startRecording=function(e){var r,i,n=this;if(void 0===e&&(e={}),"recording"!==this.state){this.mutationLimitReached=!1,this.throttleCount=0,this.throttleWindowStart=Date.now(),this.throttleNotified=!1,this.mutationAddsInWindow=0;var t="buffer"===this.options.mode?12e4:3e5,t="number"==typeof e.checkoutEveryNms&&0<e.checkoutEveryNms?e.checkoutEveryNms:t,o="number"==typeof e.checkoutEveryNth&&0<e.checkoutEveryNth?e.checkoutEveryNth:void 0,a=Fc(e.privacy||{},Lc),s=f(f(f(f({emit:function(e,t){n.handleEvent(e,t)},checkoutEveryNms:t},o?{checkoutEveryNth:o}:{}),{sampling:{scroll:150,mousemove:!l.ios()&&50,mouseInteraction:!0,input:"last"},slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:!0}}),(t={},void 0!==(o=a).maskAllInputs&&(t.maskAllInputs=o.maskAllInputs),o.maskInputOptions&&(t.maskInputOptions=o.maskInputOptions),null!=(s=o.mask)&&s.length&&(t.maskTextSelector=o.mask.join(",")),null!=(s=o.block)&&s.length&&(t.blockSelector=o.block.join(",")),o.blockAllMedia&&(t.blockSelector=t.blockSelector?t.blockSelector+","+Pc:Pc,t.ignoreCSSAttributes=new Set(["background-image"])),null!=(s=o.ignore)&&s.length&&(t.ignoreSelector=o.ignore.join(",")),!o.maskTextFn&&!1===o.autoDetectSensitiveData||(t.maskTextFn=(r=o.maskTextFn,i=!1!==o.autoDetectSensitiveData,function(e,t){var n;return e&&(n=e,i&&(n=Dc.autoMask(n)),r?r(n,t):n)})),t)),e.rrwebConfig);try{this.hookMutationObserver(),this.stopRecordingFn=Ac(s),this.state="recording",this.lastCheckoutTime=Date.now(),this.startCheckpointTimer(),v("RecorderManager","Recording started with config:",{maskAllText:a.maskAllText,maskAllInputs:a.maskAllInputs,autoDetectSensitiveData:a.autoDetectSensitiveData,mutationLimit:this.mutationLimit,checkpointIntervalMs:12e4})}catch(e){Lr("RecorderManager","Failed to start recording:",e),this.state="stopped"}}else Pr("RecorderManager","Already recording")},Wc.prototype.stopRecording=function(){var e;this.stopCheckpointTimer(),null!=(e=this.mutationMerger)&&e.destroy(),this.unhookMutationObserver(),this.stopRecordingFn&&(this.stopRecordingFn(),this.stopRecordingFn=void 0),this.state="stopped",v("RecorderManager","Recording stopped")},Wc.prototype.pauseRecording=function(){"recording"===this.state&&(this.stopRecording(),this.state="paused",v("RecorderManager","Recording paused"))},Wc.prototype.resumeRecording=function(e){void 0===e&&(e={}),"paused"===this.state&&(this.startRecording(e),v("RecorderManager","Recording resumed"))},Wc.prototype.hookMutationObserver=function(){try{var r,e,t=window.MutationObserver;t&&(r=this,(e=function(n){return new t(function(e,t){r.unhookMutationObserver(),r.onMutationHandler(e)&&n(e,t)})}).prototype=t.prototype,window.MutationObserver=e,this.restoreMutationObserver=function(){window.MutationObserver=t},Ar("RecorderManager","MutationObserver hooked"))}catch(t){Pr("RecorderManager","Failed to hook MutationObserver:",t)}},Wc.prototype.unhookMutationObserver=function(){this.restoreMutationObserver&&(this.restoreMutationObserver(),this.restoreMutationObserver=null,Ar("RecorderManager","MutationObserver restored"))},Wc.prototype.onMutationHandler=function(e){var t,n=this;return!this.mutationLimitReached&&(t=(e=e.length)>this.mutationLimit,(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(this.mutationLimitReached=!0,Lr("RecorderManager","Mutation limit reached: "+e+" > "+this.mutationLimit+". Stopping."),setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1))},Wc.prototype.checkMutationLimit=function(e){var n=this;if(this.mutationLimitReached)return!1;if(3!==e.type)return!0;e=e.data;if(0!==(null==e?void 0:e.source))return!0;e=Array.isArray(e.adds)?e.adds.length:0;if(0===e)return!0;this.mutationAddsInWindow+=e;var t=e>this.mutationLimit||this.mutationAddsInWindow>2*this.mutationLimit;return(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(Lr("RecorderManager","Mutation limit: "+e+" adds (window: "+this.mutationAddsInWindow+"). Stopping."),this.mutationLimitReached=!0,setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1)},Wc.prototype.emitMutationBreadcrumb=function(e,t){var n;try{null!=(n=Ac.addCustomEvent)&&n.call(Ac,"replay.mutations",{count:e,limit:t,timestamp:Date.now()})}catch(e){}},Wc.prototype.handleEvent=function(e,t){var n=this,r=(t&&(null!=(i=(r=this.options).onCheckout)&&i.call(r),this.lastCheckoutTime=Date.now(),null!=(i=this.mutationMerger))&&i.flush(),e.type);if(t||2===r||4===r||r<=1||this.checkEventThrottle()){if(3===r&&!this.mutationLimitReached){var i=Date.now();if(12e4<=i-this.lastCheckoutTime){this.lastCheckoutTime=i;try{var o=Ac.takeFullSnapshot;"function"==typeof o&&(o(!0),Ar("RecorderManager","Inline checkpoint: forced FullSnapshot"))}catch(e){Pr("RecorderManager","Inline checkpoint failed:",e)}}}this.checkMutationLimit(e)&&(this.mutationMerger?this.mutationMerger.push(e,function(e){n.options.onRecordingEvent(e)}):this.options.onRecordingEvent(e))}},Wc.prototype.checkEventThrottle=function(){var e,t=Date.now();if(5e3<t-this.throttleWindowStart&&(this.throttleCount=0,this.throttleWindowStart=t,this.throttleNotified=!1,this.mutationAddsInWindow=0),this.throttleCount++,300<this.throttleCount){if(!this.throttleNotified){this.throttleNotified=!0,Pr("RecorderManager","Event throttled: "+this.throttleCount+" events in 5000ms window");try{null!=(e=Ac.addCustomEvent)&&e.call(Ac,"replay.throttled",{count:this.throttleCount,window:5e3})}catch(e){}}return!1}return!0},Wc.prototype.startCheckpointTimer=function(){var t=this;this.stopCheckpointTimer(),this.checkpointTimer=setInterval(function(){if("recording"===t.state&&!t.mutationLimitReached)try{var e=Ac.takeFullSnapshot;"function"==typeof e&&(e(!0),t.lastCheckoutTime=Date.now(),Ar("RecorderManager","Checkpoint: forced FullSnapshot"))}catch(e){Pr("RecorderManager","Checkpoint FullSnapshot failed:",e)}},12e4)},Wc.prototype.stopCheckpointTimer=function(){null!==this.checkpointTimer&&(clearInterval(this.checkpointTimer),this.checkpointTimer=null)},Wc.prototype.getState=function(){return this.state},Wc.prototype.isRecording=function(){return"recording"===this.state},Wc.prototype.getLastCheckoutTime=function(){return this.lastCheckoutTime},Wc.prototype.takeFullSnapshot=function(){var e,t;"recording"===this.state&&this.stopRecordingFn&&(null!=(t=null==(e=this.stopRecordingFn)?void 0:e.takeFullSnapshot)&&t.call(e),this.lastCheckoutTime=Date.now())},Wc.prototype.isMutationLimitReached=function(){return this.mutationLimitReached},Wc),jc=(Hc.prototype.initializeSampling=function(){return null!==this.samplingDecision?{mode:this.currentMode,shouldRecord:!1!==this.currentMode}:Math.random()<this.config.sessionSampleRate?(this.currentMode="session",this.samplingDecision=!0,v("SamplerManager","Sampled: session mode"),{mode:"session",shouldRecord:!0}):0<this.config.errorSampleRate?(this.currentMode="buffer",this.samplingDecision=!0,v("SamplerManager","Sampled: buffer mode"),{mode:"buffer",shouldRecord:!0}):(this.currentMode=!1,this.samplingDecision=!1,v("SamplerManager","Not sampled"),{mode:!1,shouldRecord:!1})},Hc.prototype.decideSamplingMode=function(){return this.initializeSampling().mode},Hc.prototype.onErrorOccurred=function(e){return"buffer"===this.currentMode&&!this.hasUpgraded&&!!(Math.random()<this.config.errorSampleRate)&&(this.switchMode("session"),this.hasUpgraded=!0)},Hc.prototype.switchMode=function(e){var t=this.currentMode;this.currentMode=e,this.samplingDecision=!1!==e,v("SamplerManager","Mode switched: "+t+" -> "+e)},Hc.prototype.getCurrentMode=function(){return this.currentMode},Hc.prototype.isSampled=function(){return!0===this.samplingDecision},Hc.prototype.isSessionMode=function(){return"session"===this.currentMode},Hc.prototype.isBufferMode=function(){return"buffer"===this.currentMode},Hc.prototype.upgradeToSessionMode=function(){return"buffer"===this.currentMode&&Math.random()<this.config.errorSampleRate&&(this.currentMode="session",v("SamplerManager","Upgraded to session mode due to error"),!0)},Hc.prototype.forceMode=function(e){this.currentMode=e,this.samplingDecision=!1!==e},Hc.prototype.reset=function(){this.currentMode=!1,this.samplingDecision=null},Hc.prototype.getConfig=function(){return f({},this.config)},Hc);function Hc(e){var t;void 0===e&&(e={}),this.currentMode=!1,this.samplingDecision=null,this.hasUpgraded=!1,this.config={sessionSampleRate:null!=(t=e.sessionSampleRate)?t:.1,errorSampleRate:null!=(t=e.errorSampleRate)?t:1}}function Wc(e,t){this.state="stopped",this.lastCheckoutTime=0,this.checkpointTimer=null,this.mutationLimitReached=!1,this.mutationMerger=null,this.mutationBreadcrumbLimit=750,this.mutationLimit=1e4,this.restoreMutationObserver=null,this.throttleCount=0,this.throttleWindowStart=0,this.throttleNotified=!1,this.mutationAddsInWindow=0,this.options=e,this.mutationBreadcrumbLimit=null!=(e=null==t?void 0:t.mutationBreadcrumbLimit)?e:750,this.mutationLimit=null!=(e=null==t?void 0:t.mutationLimit)?e:1e4,null!=t&&t.enableMutationMerge&&(this.mutationMerger=new Bc({windowMs:null!=(e=null==t?void 0:t.mutationMergeWindowMs)?e:200,maxAddsPerMerge:500,enableRepeatDetection:!0}))}function Gc(e){var t;this.buffer=null,this.flushTimer=null,this.repeatCount=0,this.emitFn=null,this.mergedCount=0,this.droppedByRepeat=0,this.cancelledByOffset=0,this.windowMs=null!=(t=null==e?void 0:e.windowMs)?t:200,this.maxAddsPerMerge=null!=(t=null==e?void 0:e.maxAddsPerMerge)?t:500,this.enableRepeatDetection=null==(t=null==e?void 0:e.enableRepeatDetection)||t}function qc(e){for(var t=e.length;0<=--t;)e[t]=0}var Vc=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Zc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Kc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Jc=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xc=new Array(576),$c=(qc(Xc),new Array(60)),Yc=(qc($c),new Array(512)),Qc=(qc(Yc),new Array(256)),ed=(qc(Qc),new Array(29));qc(ed);var td,nd,rd,id=new Array(30);function od(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function ad(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}qc(id);function sd(e){return e<256?Yc[e]:Yc[256+(e>>>7)]}function ld(e,t,n){Od(e,n[2*t],n[2*t+1])}function ud(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function cd(e,t,n){for(var r,i=new Array(16),o=0,a=1;a<=15;a++)o=o+n[a-1]<<1,i[a]=o;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=ud(i[s]++,s))}}function dd(e){for(var t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0}function hd(e){8<e.bi_valid?xd(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function fd(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&Md(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Md(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function pd(e,t,n){var r,i,o,a,s=0;if(0!==e.sym_next)for(;r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0==r?ld(e,i,t):(o=Qc[i],ld(e,o+256+1,t),0!==(a=Vc[o])&&(i-=ed[o],Od(e,i,a)),o=sd(--r),ld(e,o,n),0!==(a=Zc[o])&&(r-=id[o],Od(e,r,a))),s<e.sym_next;);ld(e,256,t)}function md(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)fd(e,o,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fd(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,fd(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,d,h,f,p,m=e,g=t.dyn_tree,v=t.max_code,y=t.stat_desc.static_tree,w=t.stat_desc.has_stree,b=t.stat_desc.extra_bits,k=t.stat_desc.extra_base,S=t.stat_desc.max_length,_=0,E=0;E<=15;E++)m.bl_count[E]=0;for(g[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c<573;c++)(E=g[2*g[2*(d=m.heap[c])+1]+1]+1)>S&&(E=S,_++),g[2*d+1]=E,v<d||(m.bl_count[E]++,f=0,k<=d&&(f=b[d-k]),p=g[2*d],m.opt_len+=p*(E+f),w&&(m.static_len+=p*(y[2*d+1]+f)));if(0!==_){do{for(E=S-1;0===m.bl_count[E];)E--}while(m.bl_count[E]--,m.bl_count[E+1]+=2,m.bl_count[S]--,0<(_-=2));for(E=S;0!==E;E--)for(d=m.bl_count[E];0!==d;)(h=m.heap[--c])>v||(g[2*h+1]!==E&&(m.opt_len+=(E-g[2*h+1])*g[2*h],g[2*h+1]=E),d--)}cd(o,u,e.bl_count)}function gd(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<l&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4))}function vd(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<l&&i===a)){if(s<u)for(;ld(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(ld(e,i,e.bl_tree),s--),ld(e,16,e.bl_tree),Od(e,s-3,2)):s<=10?(ld(e,17,e.bl_tree),Od(e,s-3,3)):(ld(e,18,e.bl_tree),Od(e,s-11,7));o=i,u=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4)}}function yd(e,t,n,r){Od(e,0+(r?1:0),3),hd(e),xd(e,n),xd(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n}function wd(e,t){return e.msg=Dd[t],t}function bd(e){return 2*e-(4<e?9:0)}function kd(e,t){Ud(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,lh(e.strm)}function d(e,t){e.pending_buf[e.pending++]=t}function Sd(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _d(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.w_size-262<e.strstart?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,d=e.prev,h=e.strstart+258,f=u[o+a-1],p=u[o+a];e.good_match<=e.prev_length&&(i>>=2),e.lookahead<s&&(s=e.lookahead);do{if(u[(n=t)+a]===p&&u[n+a-1]===f&&u[n]===u[o]&&u[++n]===u[o+1]){for(o+=2,n++;u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<h;);if(r=258-(h-o),o=h-258,a<r){if(e.match_start=t,s<=(a=r))break;f=u[o+a-1],p=u[o+a]}}}while((t=d[t&c])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Ed(e){var t,n,r=e.w_size;do{if(t=e.window_size-e.lookahead-e.strstart,r+(r-262)<=e.strstart&&(e.window.set(e.window.subarray(r,r+r-t),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.strstart<e.insert&&(e.insert=e.strstart),oh(e),t+=r),0===e.strm.avail_in)break;if(t=uh(e.strm,e.window,e.strstart+e.lookahead,t),e.lookahead+=t,e.legacy_hash){if(3<=e.lookahead+e.insert)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=ah(e,e.ins_h,e.window[n+1]);e.insert&&(sh(e,n),n++,e.insert--,!(e.lookahead+e.insert<3)););}else if(3<e.lookahead+e.insert)for(n=e.strstart-e.insert;e.insert&&(sh(e,n),n++,e.insert--,!(e.lookahead+e.insert<=3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function Cd(e,t){for(var n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;n=65535,i=e.bi_valid+42>>3,!(e.strm.avail_out<i||(n=(i=e.strm.avail_out-i)<(n=n>(r=e.strstart-e.block_start)+e.strm.avail_in?r+e.strm.avail_in:n)?i:n)<o&&(0===n&&t!==Gd||t===jd||n!==r+e.strm.avail_in)||(a=t===Gd&&n===r+e.strm.avail_in?1:0,Fd(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,lh(e.strm),r&&(n<r&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(uh(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n),0!==a)););return(s-=e.strm.avail_in)&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.strstart<e.insert)&&(e.insert=e.strstart),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=e.w_size-e.insert<s?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==jd&&t!==Gd&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.strstart<e.insert)&&(e.insert=e.strstart),(i=i>e.strm.avail_in?e.strm.avail_in:i)&&(uh(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=e.w_size-e.insert<i?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),o=(i=65535<e.pending_buf_size-(i=e.bi_valid+42>>3)?65535:e.pending_buf_size-i)>e.w_size?e.w_size:i,((r=e.strstart-e.block_start)>=o||(r||t===Gd)&&t!==jd&&0===e.strm.avail_in&&r<=i)&&(n=i<r?i:r,a=t===Gd&&0===e.strm.avail_in&&n===r?1:0,Fd(e,e.block_start,n,a),e.block_start+=n,lh(e.strm)),a?3:1)}function Td(e,t){for(var n,r;;){if(e.lookahead<262){if(Ed(e),e.lookahead<262&&t===jd)return 1;if(0===e.lookahead)break}if((n=0)!==(n=3<=e.lookahead?sh(e,e.strstart):n)&&e.strstart-n<=e.w_size-262&&(e.match_length=_d(e,n)),3<=e.match_length)if(r=Bd(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,n=sh(e,e.strstart),0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=ah(e,e.ins_h,e.window[e.strstart+1]));else r=Bd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(kd(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Gd?(kd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kd(e,!1),0===e.strm.avail_out)?1:2}function Rd(e,t){for(var n,r,i;;){if(e.lookahead<262){if(Ed(e),e.lookahead<262&&t===jd)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(n=sh(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=_d(e,n),e.match_length<=5)&&(e.strategy===Yd||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2),3<=e.prev_length&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=Bd(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(n=sh(e,e.strstart)),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(kd(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=Bd(e,0,e.window[e.strstart-1]))&&kd(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Bd(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Gd?(kd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kd(e,!1),0===e.strm.avail_out)?1:2}var xd=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Od=function(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,xd(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Md=function(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},Id=!1,ru=function(e){if(!Id){for(var t,n,r,i=new Array(16),o=0,a=0;a<28;a++)for(ed[a]=o,t=0;t<1<<Vc[a];t++)Qc[o++]=a;for(Qc[o-1]=a,a=r=0;a<16;a++)for(id[a]=r,t=0;t<1<<Zc[a];t++)Yc[r++]=a;for(r>>=7;a<30;a++)for(id[a]=r<<7,t=0;t<1<<Zc[a]-7;t++)Yc[256+r++]=a;for(n=0;n<=15;n++)i[n]=0;for(t=0;t<=143;)Xc[2*t+1]=8,t++,i[8]++;for(;t<=255;)Xc[2*t+1]=9,t++,i[9]++;for(;t<=279;)Xc[2*t+1]=7,t++,i[7]++;for(;t<=287;)Xc[2*t+1]=8,t++,i[8]++;for(cd(Xc,287,i),t=0;t<30;t++)$c[2*t+1]=5,$c[2*t]=ud(t,5);td=new od(Xc,Vc,257,286,15),nd=new od($c,Zc,0,30,15),rd=new od(new Array(0),Kc,0,19,7),Id=!0}e.l_desc=new ad(e.dyn_ltree,td),e.d_desc=new ad(e.dyn_dtree,nd),e.bl_desc=new ad(e.bl_tree,rd),e.bi_buf=0,e.bi_valid=0,dd(e)},n=yd,i=function(e,t,n,r){var i,o,a,s=0;if(0<e.level?(2===e.strm.data_type&&(e.strm.data_type=(e=>{for(var t=4093624447,n=0;n<=31;n++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==e.dyn_ltree[2*n])return 1;return 0})(e)),md(e,e.l_desc),md(e,e.d_desc),s=(e=>{var t;for(gd(e,e.dyn_ltree,e.l_desc.max_code),gd(e,e.dyn_dtree,e.d_desc.max_code),md(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*Jc[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),(o=e.static_len+3+7>>>3)<=(i=e.opt_len+3+7>>>3)&&(i=o)):i=o=n+5,n+4<=i&&-1!==t)yd(e,t,n,r);else if(4===e.strategy||o===i)Od(e,2+(r?1:0),3),pd(e,Xc,$c);else{Od(e,4+(r?1:0),3);var l=e,u=(t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,s+1);for(Od(l,t-257,5),Od(l,n-1,5),Od(l,u-4,4),a=0;a<u;a++)Od(l,l.bl_tree[2*Jc[a]+1],3);vd(l,l.dyn_ltree,t-1),vd(l,l.dyn_dtree,n-1),pd(e,e.dyn_ltree,e.dyn_dtree)}dd(e),r&&hd(e)},s=function(e,t,n){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Qc[n]+256+1)]++,e.dyn_dtree[2*sd(t)]++),e.sym_next===e.sym_end},h=function(e){Od(e,2,3),ld(e,256,Xc),16===(e=e).bi_valid?(xd(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)},Ad=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0},Pd=new Uint32Array((()=>{for(var e=[],t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})()),Ld=function(e,t,n,r){var i=Pd,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},Dd={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},_={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Nd=ru,Fd=n,Ud=i,Bd=s,zd=h,jd=_.Z_NO_FLUSH,Hd=_.Z_PARTIAL_FLUSH,Wd=_.Z_FULL_FLUSH,Gd=_.Z_FINISH,qd=_.Z_BLOCK,Vd=_.Z_OK,Zd=_.Z_STREAM_END,Kd=_.Z_STREAM_ERROR,Jd=_.Z_DATA_ERROR,Xd=_.Z_BUF_ERROR,$d=_.Z_DEFAULT_COMPRESSION,Yd=_.Z_FILTERED,Qd=_.Z_HUFFMAN_ONLY,eh=_.Z_RLE,th=_.Z_FIXED,nh=_.Z_UNKNOWN,rh=_.Z_DEFLATED,ih=function(e){for(var t=e.length;0<=--t;)e[t]=0},oh=function(e){for(var t,n,r=e.w_size,i=t=e.hash_size;n=e.head[--i],e.head[i]=r<=n?n-r:0,--t;);for(i=t=r;n=e.prev[--i],e.prev[i]=r<=n?n-r:0,--t;);},ah=function(e,t,n){return(t<<e.hash_shift^n)&e.hash_mask},sh=function(e,t){n=e.legacy_hash?e.ins_h=ah(e,e.ins_h,e.window[t+3-1]):(n=(n=e.window)[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24,e.ins_h=Math.imul(n,66521)+66521>>>16&e.hash_mask);var n,r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},lh=function(e){var t=e.state,n=t.pending;0!==(n=e.avail_out<n?e.avail_out:n)&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending)&&(t.pending_out=0)},uh=function(e,t,n,r){var i=e.avail_in;return 0===(i=r<i?r:i)?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=Ad(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Ld(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)};function ch(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var dh=[new ch(0,0,0,0,Cd),new ch(4,4,8,4,Td),new ch(4,5,16,8,Td),new ch(4,6,32,32,Td),new ch(4,4,16,16,Rd),new ch(8,16,32,32,Rd),new ch(8,16,128,128,Rd),new ch(8,32,128,256,Rd),new ch(32,128,258,1024,Rd),new ch(32,258,258,4096,Rd)];function hh(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ih(this.dyn_ltree),ih(this.dyn_dtree),ih(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ih(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ih(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function fh(e){var t;return!e||!(t=e.state)||t.strm!==e||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0}function ph(e){var t=yh(e);return t===Vd&&((e=e.state).window_size=2*e.w_size,ih(e.head),e.max_lazy_match=dh[e.level].max_lazy,e.good_match=dh[e.level].good_length,e.nice_match=dh[e.level].nice_length,e.max_chain_length=dh[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t}function mh(e,t,n,r,i,o,a){if(!e)return Kd;var s=1;if(t===$d&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),i<1||9<i||n!==rh||r<8||15<r||t<0||9<t||o<0||th<o||8===r&&1!==s)return wd(e,Kd);8===r&&(r=9);var l=new hh;return(e.state=l).strm=e,l.status=42,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.legacy_hash=a?1:0,l.hash_bits=i+7,!l.legacy_hash&&l.hash_bits<15&&(l.hash_bits=15),l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new Uint8Array(2*l.w_size),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=3*(l.lit_bufsize-1),l.level=t,l.strategy=o,l.method=n,ph(e)}function gh(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==S(n))throw new TypeError(n+"must be non-object");for(var r in n)Eh(n,r)&&(e[r]=n[r])}}return e}function vh(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),o=0,a=0,s=e.length;o<s;o++){var l=e[o];i.set(l,a),a+=l.length}return i}var yh=function(e){if(fh(e))return wd(e,Kd);e.total_in=e.total_out=0,e.data_type=nh;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=-2,Nd(t),Vd},wh=mh,bh=function(e,t){return fh(e)||2!==e.state.wrap?Kd:(e.state.gzhead=t,Vd)},kh=function(e,t){if(fh(e)||qd<t||t<0)return e?wd(e,Kd):Kd;var n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==Gd)return wd(e,0===e.avail_out?Xd:Kd);var r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(lh(e),0===e.avail_out)return n.last_flush=-1,Vd}else if(0===e.avail_in&&bd(t)<=bd(r)&&t!==Gd)return wd(e,Xd);if(666===n.status&&0!==e.avail_in)return wd(e,Xd);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){r=rh+(n.w_bits-8<<4)<<8;if(r|=(n.strategy>=Qd||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(r|=32),Sd(n,r+=31-r%31),0!==n.strstart&&(Sd(n,e.adler>>>16),Sd(n,65535&e.adler)),e.adler=1,n.status=113,lh(e),0!==n.pending)return n.last_flush=-1,Vd}if(57===n.status)if(e.adler=0,d(n,31),d(n,139),d(n,8),n.gzhead)d(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),d(n,255&n.gzhead.time),d(n,n.gzhead.time>>8&255),d(n,n.gzhead.time>>16&255),d(n,n.gzhead.time>>24&255),d(n,9===n.level?2:n.strategy>=Qd||n.level<2?4:0),d(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(d(n,255&n.gzhead.extra.length),d(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ld(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(d(n,0),d(n,0),d(n,0),d(n,0),d(n,0),d(n,9===n.level?2:n.strategy>=Qd||n.level<2?4:0),d(n,3),n.status=113,lh(e),0!==n.pending)return n.last_flush=-1,Vd;if(69===n.status){if(n.gzhead.extra){for(var i=n.pending,o=(65535&n.gzhead.extra.length)-n.gzindex;n.pending+o>n.pending_buf_size;){var a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Ld(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,lh(e),0!==n.pending)return n.last_flush=-1,Vd;i=0,o-=a}r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=Ld(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){var s,l=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>l&&(e.adler=Ld(e.adler,n.pending_buf,n.pending-l,l)),lh(e),0!==n.pending)return n.last_flush=-1,Vd;l=0}}while(s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,d(n,s),0!=s);n.gzhead.hcrc&&n.pending>l&&(e.adler=Ld(e.adler,n.pending_buf,n.pending-l,l)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){var u,c=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>c&&(e.adler=Ld(e.adler,n.pending_buf,n.pending-c,c)),lh(e),0!==n.pending)return n.last_flush=-1,Vd;c=0}}while(u=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,d(n,u),0!=u);n.gzhead.hcrc&&n.pending>c&&(e.adler=Ld(e.adler,n.pending_buf,n.pending-c,c))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(lh(e),0!==n.pending))return n.last_flush=-1,Vd;d(n,255&e.adler),d(n,e.adler>>8&255),e.adler=0}if(n.status=113,lh(e),0!==n.pending)return n.last_flush=-1,Vd}if(0!==e.avail_in||0!==n.lookahead||t!==jd&&666!==n.status){r=0===n.level?Cd(n,t):n.strategy===Qd?((e,t)=>{for(var n;;){if(0===e.lookahead&&(Ed(e),0===e.lookahead)){if(t===jd)return 1;break}if(e.match_length=0,n=Bd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(kd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Gd?(kd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kd(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===eh?((e,t)=>{for(var n,r,i,o,a=e.window;;){if(e.lookahead<=258){if(Ed(e),e.lookahead<=258&&t===jd)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){for(o=e.strstart+258;r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o;);e.match_length=258-(o-i),e.lookahead<e.match_length&&(e.match_length=e.lookahead)}if(3<=e.match_length?(n=Bd(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Bd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(kd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Gd?(kd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kd(e,!1),0===e.strm.avail_out)?1:2})(n,t):dh[n.level].func(n,t);if(3!==r&&4!==r||(n.status=666),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),Vd;if(2===r&&(t===Hd?zd(n):t!==qd&&(Fd(n,0,0,!1),t===Wd)&&(ih(n.head),0===n.lookahead)&&(n.strstart=0,n.block_start=0,n.insert=0),lh(e),0===e.avail_out))return n.last_flush=-1,Vd}return t!==Gd||!(n.wrap<=0)&&(2===n.wrap?(d(n,255&e.adler),d(n,e.adler>>8&255),d(n,e.adler>>16&255),d(n,e.adler>>24&255),d(n,255&e.total_in),d(n,e.total_in>>8&255),d(n,e.total_in>>16&255),d(n,e.total_in>>24&255)):(Sd(n,e.adler>>>16),Sd(n,65535&e.adler)),lh(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending)?Vd:Zd},Sh=function(e){var t;return fh(e)?Kd:(t=e.state.status,e.state=null,113===t?wd(e,Jd):Vd)},_h=function(e,t){var n=t.length;if(fh(e))return Kd;var r=e.state,i=r.wrap;if(2===i||1===i&&42!==r.status||r.lookahead)return Kd;1===i&&(e.adler=Ad(e.adler,t,n,0)),r.wrap=0,r.w_size<=n&&(0===i&&(ih(r.head),r.strstart=0,r.block_start=0,r.insert=0),(o=new Uint8Array(r.w_size)).set(t.subarray(n-r.w_size,n),0),t=o,n=r.w_size);var o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Ed(r);3<=r.lookahead;){for(var l=r.strstart,u=r.lookahead-2;sh(r,l),l++,--u;);r.strstart=l,r.lookahead=2,Ed(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,Vd},Eh=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Ch=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(T){Ch=!1}for(var Th=new Uint8Array(256),Rh=0;Rh<256;Rh++)Th[Rh]=252<=Rh?6:248<=Rh?5:240<=Rh?4:224<=Rh?3:192<=Rh?2:1;Th[254]=Th[255]=1;function xh(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);for(var t,n,r,i,o=e.length,a=0,s=0;s<o;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),s=i=0;i<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}function Oh(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Mh=Object.prototype.toString,Ih=_.Z_NO_FLUSH,Ah=_.Z_SYNC_FLUSH,Ph=_.Z_FULL_FLUSH,Lh=_.Z_FINISH,Dh=_.Z_OK,Nh=_.Z_STREAM_END,Fh={level:_.Z_DEFAULT_COMPRESSION,method:_.Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:_.Z_DEFAULT_STRATEGY,legacyHash:!0};function Uh(e){this.options=gh({},Fh,e||{});var e=this.options,t=(e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Oh,this.strm.avail_out=0,wh(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash));if(t!==Dh)throw new Error(Dd[t]);if(e.header&&bh(this.strm,e.header),e.dictionary){e="string"==typeof e.dictionary?xh(e.dictionary):"[object ArrayBuffer]"===Mh.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((t=_h(this.strm,e))!==Dh)throw new Error(Dd[t]);this._dict_set=!0}}function Bh(e,t){t=new Uh(t);if(t.push(e,!0),t.err)throw t.msg||Dd[t.err];return t.result}Uh.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;for(r=t===~~t?t:!0===t?Lh:Ih,"string"==typeof e?i.input=xh(e):"[object ArrayBuffer]"===Mh.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(r===Ah||r===Ph)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(kh(i,r)===Nh)return 0<i.next_out&&this.onData(i.output.subarray(0,i.next_out)),n=Sh(this.strm),this.onEnd(n),this.ended=!0,n===Dh;if(0!==i.avail_out){if(0<r&&0<i.next_out)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},Uh.prototype.onData=function(e){this.chunks.push(e)},Uh.prototype.onEnd=function(e){e===Dh&&(this.result=vh(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function zh(e,t,n,r,i,o,a,s){for(var l,u,c,d,h,f,p,m,g,v=s.bits,y=0,w=0,b=0,k=0,S=0,_=0,E=0,C=0,T=0,R=0,x=null,O=new Uint16Array(16),M=new Uint16Array(16),I=null,y=0;y<=15;y++)O[y]=0;for(w=0;w<r;w++)O[t[n+w]]++;for(S=v,k=15;1<=k&&0===O[k];k--);if(k<S&&(S=k),0===k)i[o++]=20971520,i[o++]=20971520,s.bits=1;else{for(b=1;b<k&&0===O[b];b++);for(S<b&&(S=b),y=C=1;y<=15;y++)if((C=(C<<1)-O[y])<0)return-1;if(0<C&&(0===e||1!==k))return-1;for(M[1]=0,y=1;y<15;y++)M[y+1]=M[y]+O[y];for(w=0;w<r;w++)0!==t[n+w]&&(a[M[t[n+w]]++]=w);if(f=0===e?(x=I=a,20):1===e?(x=Wh,I=Gh,257):(x=qh,I=Vh,0),y=b,h=o,E=w=R=0,c=-1,d=(T=1<<(_=S))-1,1===e&&852<T||2===e&&592<T)return 1;for(;;){for(g=a[w]+1<f?(m=0,a[w]):a[w]>=f?(m=I[a[w]-f],x[a[w]-f]):(m=96,0),l=1<<(p=y-E),b=u=1<<_;i[h+(R>>E)+(u-=l)]=p<<24|m<<16|g|0,0!==u;);for(l=1<<y-1;R&l;)l>>=1;if(0!==l?R=(R&l-1)+l:R=0,w++,0==--O[y]){if(y===k)break;y=t[n+a[w]]}if(S<y&&(R&d)!==c){for(h+=b,C=1<<(_=y-(E=0===E?S:E));_+E<k&&!((C-=O[_+E])<=0);)_++,C<<=1;if(T+=1<<_,1===e&&852<T||2===e&&592<T)return 1;i[c=R&d]=S<<24|_<<16|h-o|0}}0!==R&&(i[h+R]=y-E<<24|64<<16|0),s.bits=S}return 0}function jh(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}var Hh={Deflate:Uh,deflate:Bh,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Bh(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Bh(e,t)},constants:_},Wh=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Gh=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),qh=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Vh=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Zh=_.Z_FINISH,Kh=_.Z_BLOCK,Jh=_.Z_TREES,Xh=_.Z_OK,$h=_.Z_STREAM_END,Yh=_.Z_NEED_DICT,Qh=_.Z_STREAM_ERROR,ef=_.Z_DATA_ERROR,tf=_.Z_MEM_ERROR,nf=_.Z_BUF_ERROR,rf=_.Z_DEFLATED,ie=16209;function of(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function af(e){var t;return pf(e)?Qh:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=16180,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Xh)}function sf(e){var t;return pf(e)?Qh:((t=e.state).wsize=0,t.whave=0,t.wnext=0,af(e))}function lf(e,t){var n,r;return pf(e)||(r=e.state,t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t))?Qh:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,sf(e))}function uf(e,t){var n;return e?(n=new of,(e.state=n).strm=e,n.window=null,n.mode=16180,(n=lf(e,t))!==Xh&&(e.state=null),n):Qh}function cf(e,t,n,r){var i;return null===(e=e.state).window&&(e.window=new Uint8Array(1<<e.wbits)),0===e.wsize&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0),e.wsize<=r?(e.window.set(t.subarray(n-e.wsize,n),0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>r&&(i=r),e.window.set(t.subarray(n-r,n-r+i),e.wnext),(r-=i)?(e.window.set(t.subarray(n-r,n),0),e.wnext=r,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0}function df(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var hf,ff,pf=function(e){var t;return!e||!(t=e.state)||t.strm!==e||t.mode<16180||16211<t.mode?1:0},mf=!0,gf=sf,vf=uf,yf=function(e,N){var t,n,F,r,i,o,a,s,l,U,u,c,B,z,d,h,f,p,j,H,m,g,v,y,w=0,b=new Uint8Array(4),W=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pf(e)||!e.output||!e.input&&0!==e.avail_in)return Qh;16191===(t=e.state).mode&&(t.mode=16192),i=e.next_out,F=e.output,r=e.next_in,n=e.input,s=t.hold,l=t.bits,U=o=e.avail_in,u=a=e.avail_out,g=Xh;e:for(;;)switch(t.mode){case 16180:if(0===t.wrap)t.mode=16192;else{for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}2&t.wrap&&35615===s?(0===t.wbits&&(t.wbits=15),b[t.check=0]=255&s,b[1]=s>>>8&255,t.check=Ld(t.check,b,2,0),l=s=0,t.mode=16181):(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&s)<<8)+(s>>8))%31?(e.msg="incorrect header check",t.mode=ie):(15&s)!==rf?(e.msg="unknown compression method",t.mode=ie):(l-=4,m=8+(15&(s>>>=4)),0===t.wbits&&(t.wbits=m),15<m||m>t.wbits?(e.msg="invalid window size",t.mode=ie):(t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&s?16189:16191,l=s=0)))}break;case 16181:for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(t.flags=s,(255&t.flags)!==rf){e.msg="unknown compression method",t.mode=ie;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=ie;break}t.head&&(t.head.text=s>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Ld(t.check,b,2,0)),l=s=0,t.mode=16182;case 16182:for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.head&&(t.head.time=s),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,b[2]=s>>>16&255,b[3]=s>>>24&255,t.check=Ld(t.check,b,4,0)),l=s=0,t.mode=16183;case 16183:for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.head&&(t.head.xflags=255&s,t.head.os=s>>8),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Ld(t.check,b,2,0)),l=s=0,t.mode=16184;case 16184:if(1024&t.flags){for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.length=s,t.head&&(t.head.extra_len=s),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Ld(t.check,b,2,0)),l=s=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&((c=(c=t.length)>o?o:c)&&(t.head&&(m=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+c),m)),512&t.flags&&4&t.wrap&&(t.check=Ld(t.check,n,c,r)),o-=c,r+=c,t.length-=c),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.name+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Ld(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.comment+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Ld(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(4&t.wrap&&s!==(65535&t.check)){e.msg="header crc mismatch",t.mode=ie;break}l=s=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=16191;break;case 16189:for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}e.adler=t.check=jh(s),l=s=0,t.mode=16190;case 16190:if(0===t.havedict)return e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,Yh;e.adler=t.check=1,t.mode=16191;case 16191:if(N===Kh||N===Jh)break e;case 16192:if(t.last)s>>>=7&l,l-=7&l,t.mode=16206;else{for(;l<3;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}switch(t.last=1&s,--l,3&(s>>>=1)){case 0:t.mode=16193;break;case 1:S=k=void 0;var k=t;if(mf){hf=new Int32Array(512),ff=new Int32Array(32);for(var S=0;S<144;)k.lens[S++]=8;for(;S<256;)k.lens[S++]=9;for(;S<280;)k.lens[S++]=7;for(;S<288;)k.lens[S++]=8;for(zh(1,k.lens,0,288,hf,0,k.work,{bits:9}),S=0;S<32;)k.lens[S++]=5;zh(2,k.lens,0,32,ff,0,k.work,{bits:5}),mf=!1}if(k.lencode=hf,k.lenbits=9,k.distcode=ff,k.distbits=5,t.mode=16199,N!==Jh)break;s>>>=2,l-=2;break e;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=ie}s>>>=2,l-=2}break;case 16193:for(s>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if((65535&s)!=(s>>>16^65535)){e.msg="invalid stored block lengths",t.mode=ie;break}if(t.length=65535&s,l=s=0,t.mode=16194,N===Jh)break e;case 16194:t.mode=16195;case 16195:if(c=t.length){if(0===(c=a<(c=o<c?o:c)?a:c))break e;F.set(n.subarray(r,r+c),i),o-=c,r+=c,a-=c,i+=c,t.length-=c}else t.mode=16191;break;case 16196:for(;l<14;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(t.nlen=257+(31&s),s>>>=5,l-=5,t.ndist=1+(31&s),s>>>=5,l-=5,t.ncode=4+(15&s),s>>>=4,l-=4,286<t.nlen||30<t.ndist){e.msg="too many length or distance symbols",t.mode=ie;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;l<3;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.lens[W[t.have++]]=7&s,s>>>=3,l-=3}for(;t.have<19;)t.lens[W[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,v={bits:t.lenbits},g=zh(0,t.lens,0,19,t.lencode,0,t.work,v),t.lenbits=v.bits,g){e.msg="invalid code lengths set",t.mode=ie;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;h=(w=t.lencode[s&(1<<t.lenbits)-1])>>>16&255,f=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(f<16)s>>>=d,l-=d,t.lens[t.have++]=f;else{if(16===f){for(y=d+2;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(s>>>=d,l-=d,0===t.have){e.msg="invalid bit length repeat",t.mode=ie;break}m=t.lens[t.have-1],c=3+(3&s),s>>>=2,l-=2}else if(17===f){for(y=d+3;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}m=0,c=3+(7&(s>>>=d)),s>>>=3,l=l-d-3}else{for(y=d+7;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}m=0,c=11+(127&(s>>>=d)),s>>>=7,l=l-d-7}if(t.have+c>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ie;break}for(;c--;)t.lens[t.have++]=m}}if(t.mode===ie)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=ie;break}if(t.lenbits=9,v={bits:t.lenbits},g=zh(1,t.lens,0,t.nlen,t.lencode,0,t.work,v),t.lenbits=v.bits,g){e.msg="invalid literal/lengths set",t.mode=ie;break}if(t.distbits=6,t.distcode=t.distdyn,v={bits:t.distbits},g=zh(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,v),t.distbits=v.bits,g){e.msg="invalid distances set",t.mode=ie;break}if(t.mode=16199,N===Jh)break e;case 16199:t.mode=16200;case 16200:if(6<=o&&258<=a){e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,M=P=q=x=R=T=C=E=_=re=ne=te=ee=D=L=Q=Y=$=X=J=K=Z=A=V=I=G=O=void 0;var _,E,C,T,R,x,O=e,G=u,M=O.state,I=O.next_in,q=O.input,V=I+(O.avail_in-5),A=O.next_out,P=O.output,Z=A-(G-O.avail_out),K=A+(O.avail_out-257),J=M.dmax,X=M.wsize,$=M.whave,Y=M.wnext,Q=M.window,L=M.hold,D=M.bits,ee=M.lencode,te=M.distcode,ne=(1<<M.lenbits)-1,re=(1<<M.distbits)-1;t:do{for(D<15&&(L+=q[I++]<<D,D+=8,L+=q[I++]<<D,D+=8),_=ee[L&ne];;){if(L>>>=E=_>>>24,D-=E,0==(E=_>>>16&255))P[A++]=65535&_;else{if(!(16&E)){if(0==(64&E)){_=ee[(65535&_)+(L&(1<<E)-1)];continue}if(32&E){M.mode=16191;break t}O.msg="invalid literal/length code",M.mode=16209;break t}for(C=65535&_,(E&=15)&&(D<E&&(L+=q[I++]<<D,D+=8),C+=L&(1<<E)-1,L>>>=E,D-=E),D<15&&(L+=q[I++]<<D,D+=8,L+=q[I++]<<D,D+=8),_=te[L&re];;){if(L>>>=E=_>>>24,D-=E,!(16&(E=_>>>16&255))){if(0==(64&E)){_=te[(65535&_)+(L&(1<<E)-1)];continue}O.msg="invalid distance code",M.mode=16209;break t}if(T=65535&_,D<(E&=15)&&(L+=q[I++]<<D,(D+=8)<E)&&(L+=q[I++]<<D,D+=8),(T+=L&(1<<E)-1)>J){O.msg="invalid distance too far back",M.mode=16209;break t}if(L>>>=E,D-=E,T>(E=A-Z)){if((E=T-E)>$&&M.sane){O.msg="invalid distance too far back",M.mode=16209;break t}if(x=Q,(R=0)===Y){if(R+=X-E,E<C){for(C-=E;P[A++]=Q[R++],--E;);R=A-T,x=P}}else if(Y<E){if(R+=X+Y-E,(E-=Y)<C){for(C-=E;P[A++]=Q[R++],--E;);if(R=0,Y<C){for(C-=E=Y;P[A++]=Q[R++],--E;);R=A-T,x=P}}}else if(R+=Y-E,E<C){for(C-=E;P[A++]=Q[R++],--E;);R=A-T,x=P}for(;2<C;)P[A++]=x[R++],P[A++]=x[R++],P[A++]=x[R++],C-=3;C&&(P[A++]=x[R++],1<C)&&(P[A++]=x[R++])}else{for(R=A-T;P[A++]=P[R++],P[A++]=P[R++],P[A++]=P[R++],2<(C-=3););C&&(P[A++]=P[R++],1<C)&&(P[A++]=P[R++])}break}}break}}while(I<V&&A<K);I-=C=D>>3,L&=(1<<(D-=C<<3))-1,O.next_in=I,O.next_out=A,O.avail_in=I<V?V-I+5:5-(I-V),O.avail_out=A<K?K-A+257:257-(A-K),M.hold=L,M.bits=D,i=e.next_out,F=e.output,a=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,s=t.hold,l=t.bits,16191===t.mode&&(t.back=-1);break}for(t.back=0;h=(w=t.lencode[s&(1<<t.lenbits)-1])>>>16&255,f=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(h&&0==(240&h)){for(p=d,j=h,H=f;h=(w=t.lencode[H+((s&(1<<p+j)-1)>>p)])>>>16&255,f=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}s>>>=p,l-=p,t.back+=p}if(s>>>=d,l-=d,t.back+=d,t.length=f,0===h){t.mode=16205;break}if(32&h){t.back=-1,t.mode=16191;break}if(64&h){e.msg="invalid literal/length code",t.mode=ie;break}t.extra=15&h,t.mode=16201;case 16201:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.length+=s&(1<<t.extra)-1,s>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;h=(w=t.distcode[s&(1<<t.distbits)-1])>>>16&255,f=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(0==(240&h)){for(p=d,j=h,H=f;h=(w=t.distcode[H+((s&(1<<p+j)-1)>>p)])>>>16&255,f=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}s>>>=p,l-=p,t.back+=p}if(s>>>=d,l-=d,t.back+=d,64&h){e.msg="invalid distance code",t.mode=ie;break}t.offset=f,t.extra=15&h,t.mode=16203;case 16203:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.offset+=s&(1<<t.extra)-1,s>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ie;break}t.mode=16204;case 16204:if(0===a)break e;if(t.offset>(c=u-a)){if((c=t.offset-c)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ie;break}B=c>t.wnext?(c-=t.wnext,t.wsize-c):t.wnext-c,c>t.length&&(c=t.length),z=t.window}else z=F,B=i-t.offset,c=t.length;for(a-=c=a<c?a:c,t.length-=c;F[i++]=z[B++],--c;);0===t.length&&(t.mode=16200);break;case 16205:if(0===a)break e;F[i++]=t.length,a--,t.mode=16200;break;case 16206:if(t.wrap){for(;l<32;){if(0===o)break e;o--,s|=n[r++]<<l,l+=8}if(u-=a,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Ld:Ad)(t.check,F,u,i-u)),u=a,4&t.wrap&&(t.flags?s:jh(s))!==t.check){e.msg="incorrect data check",t.mode=ie;break}l=s=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(4&t.wrap&&s!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=ie;break}l=s=0}t.mode=16208;case 16208:g=$h;break e;case ie:g=ef;break e;case 16210:return tf;default:return Qh}return e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,(t.wsize||u!==e.avail_out&&t.mode<ie&&(t.mode<16206||N!==Zh))&&cf(e,e.output,e.next_out,u-e.avail_out),u-=e.avail_out,e.total_in+=U-=e.avail_in,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Ld:Ad)(t.check,F,u,e.next_out-u)),e.data_type=t.bits+(t.last?64:0)+(16191===t.mode?128:0)+(16199===t.mode||16194===t.mode?256:0),g=(0==U&&0===u||N===Zh)&&g===Xh?nf:g},wf=function(e){var t;return pf(e)?Qh:((t=e.state).window&&(t.window=null),e.state=null,Xh)},bf=function(e,t){return pf(e)||0==(2&(e=e.state).wrap)?Qh:((e.head=t).done=!1,Xh)},kf=function(e,t){var n,r=t.length;return pf(e)||0!==(n=e.state).wrap&&16190!==n.mode?Qh:16190===n.mode&&Ad(1,t,r,0)!==n.check?ef:cf(e,t,r,r)?(n.mode=16210,tf):(n.havedict=1,Xh)},Sf=Object.prototype.toString,_f=_.Z_NO_FLUSH,Ef=_.Z_FINISH,Cf=_.Z_OK,Tf=_.Z_STREAM_END,Rf=_.Z_NEED_DICT,xf=_.Z_STREAM_ERROR,Of=_.Z_DATA_ERROR,Mf=_.Z_MEM_ERROR,If=_.Z_BUF_ERROR,Af={chunkSize:65536,windowBits:15,to:""};function Pf(e){this.options=gh({},Af,e||{});var t=this.options,e=(t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits)&&(t.windowBits=-15),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Oh,this.strm.avail_out=0,vf(this.strm,t.windowBits));if(e!==Cf)throw new Error(Dd[e]);if(this.header=new df,bf(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=xh(t.dictionary):"[object ArrayBuffer]"===Sf.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(e=kf(this.strm,t.dictionary))!==Cf)throw new Error(Dd[e])}function Lf(e,t){t=new Pf(t);if(t.push(e,!0),t.err)throw t.msg||Dd[t.err];return t.result}Pf.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize,a=this.options.dictionary;if(this.ended)return!1;for(r=t===~~t?t:!0===t?Ef:_f,"[object ArrayBuffer]"===Sf.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(n=yf(i,r))===Rf&&a&&((n=kf(i,a))===Cf?n=yf(i,r):n===Of&&(n=Rf));0<i.avail_in&&n===Tf&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)gf(i),n=yf(i,r);switch(n){case xf:case Of:case Rf:case Mf:return this.onEnd(n),!(this.ended=!0)}var s,l,u,c=i.avail_out;if(i.next_out&&(0===i.avail_out||n===Tf||0<r)&&("string"===this.options.to?(s=((e,t)=>{for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+Th[e[n]]>t?n:t})(i.output,i.next_out),l=i.next_out-s,u=((e,t)=>{var n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));for(var r=new Array(2*n),i=0,o=0;o<n;){var a=e[o++];if(a<128)r[i++]=a;else{var s=Th[a];if(4<s)r[i++]=65533,o+=s-1;else{for(a&=2===s?31:3===s?15:7;1<s&&o<n;)a=a<<6|63&e[o++],s--;1<s?r[i++]=65533:a<65536?r[i++]=a:(a-=65536,r[i++]=55296|a>>10&1023,r[i++]=56320|1023&a)}}}var l=r,u=i;if(u<65534&&l.subarray&&Ch)return String.fromCharCode.apply(null,l.length===u?l:l.subarray(0,u));for(var c="",d=0;d<u;d++)c+=String.fromCharCode(l[d]);return c})(i.output,s),i.next_out=l,i.avail_out=o-l,l&&i.output.set(i.output.subarray(s,s+l),0),this.onData(u)):(this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0)),n!==Cf&&n!==If||0!==c){if(n===Tf)return n=wf(this.strm),this.onEnd(n),this.ended=!0;if(0===i.avail_in){if(r===Ef)return n=wf(this.strm),this.onEnd(n===Cf?If:n),!(this.ended=!0);break}}}return!0},Pf.prototype.onData=function(e){this.chunks.push(e)},Pf.prototype.onEnd=function(e){e===Cf&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=vh(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var E={Inflate:Pf,inflate:Lf,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Lf(e,t)},ungzip:Lf,constants:_},Df={Deflate:Hh.Deflate,deflate:Hh.deflate,deflateRaw:Hh.deflateRaw,gzip:Hh.gzip,Inflate:E.Inflate,inflate:E.inflate,inflateRaw:E.inflateRaw,ungzip:E.ungzip,constants:_},Nf=(zf.prototype.uploadReplay=function(n){return M(this,void 0,void 0,function(){var t;return I(this,function(e){switch(e.label){case 0:if(this.isUploading)return Pr("Uploader","Upload in progress, skipping"),[2,!1];this.isUploading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),(t=this.config.beforeSend(n))?[4,this.doUploadWithRetry(t,0)]:(v("Uploader","Upload cancelled by beforeSend"),[2,!1]);case 2:return e.sent(),v("Uploader","Upload success:",{replay_id:n.replay_id,segment_id:n.segment_id}),[2,!0];case 3:return Lr("Uploader","Upload failed:",t=e.sent()),this.config.onError(t),[2,!1];case 4:return this.isUploading=!1,[7];case 5:return[2]}})})},zf.prototype.doUploadWithRetry=function(r,i){return M(this,void 0,void 0,function(){var t,n;return I(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,5]),[4,this.doUpload(r)];case 1:return e.sent(),[3,5];case 2:return t=e.sent(),i<this.config.maxRetries?(v("Uploader","Retrying in "+(n=1e3*Math.pow(2,i))+"ms (attempt "+(i+1)+"/"+this.config.maxRetries+")"),[4,this.sleep(n)]):[3,4];case 3:return e.sent(),[2,this.doUploadWithRetry(r,i+1)];case 4:throw t;case 5:return[2]}})})},zf.prototype.prepareUploadPayload=function(e){var t=e.replay_format||"rrweb",n=e.events_encoding||"plain_json";if("rrweb"!==t)return e;if(!this.config.eventsCompression||"gzip_base64"===n)return f(f({},e),{replay_format:t,platform:e.platform||"web",events_encoding:n});try{var r=Df.gzip(e.events),i=this.uint8ArrayToBase64(r),o=e.events.length,a=r.length,s=i.length;return v("Uploader","Events compressed: "+Math.round(o/1024)+"KB -> gzip "+Math.round(a/1024)+"KB -> base64 "+Math.round(s/1024)+"KB"),f(f({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"gzip_base64",events:i})}catch(n){return Pr("Uploader","Events compression failed, fallback to plain_json:",n),f(f({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"plain_json"})}},zf.prototype.uint8ArrayToBase64=function(e){for(var t="",n=0;n<e.length;n+=32768){for(var r=e.subarray(n,n+32768),i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);t+=i}if("function"==typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("base64 encode is not supported")},zf.prototype.doUpload=function(i){return M(this,void 0,void 0,function(){var t,n,r;return I(this,function(e){switch(e.label){case 0:if(t=this.prepareUploadPayload(i),r=JSON.stringify(t),n={"Content-Type":"application/json","X-App-ID":this.config.appId},v("Uploader","Sending replay payload: "+Math.round(r.length/1024)+"KB, events_encoding="+(t.events_encoding||"plain_json")),r.length<65536||v("Uploader","Data size "+Math.round(r.length/1024)+"KB exceeds keepalive limit, using normal fetch"),this.config.transport)return[4,this.config.transport.request({kind:"replay",url:this.config.uploadUrl,method:"POST",headers:n,body:r})];throw new Error("Replay Transport is not configured");case 1:if(t=e.sent(),!(n=t||{ok:!1,status:0,statusText:"Transport failed"}).ok)throw new Error("HTTP "+(n.status||0)+": "+(n.statusText||"Transport failed"));if(0!==(r="string"==typeof n.body?JSON.parse(n.body):n.body).code)throw new Error("Server error (code "+r.code+"): "+r.message);return[2]}})})},zf.prototype.sendBeacon=function(e){var t;try{var n=this.prepareUploadPayload(e),r=JSON.stringify(n);return!(null==(t=this.config.transport)||!t.handoff||(this.config.transport.handoff({kind:"replay",url:this.config.uploadUrl,method:"POST",contentType:"application/json",body:r,sendBeacon:!0}),0))}catch(e){return Lr("Uploader","sendBeacon failed:",e),!1}},zf.prototype.isUploadInProgress=function(){return this.isUploading},zf.prototype.sleep=function(t){return new Promise(function(e){return setTimeout(e,t)})},zf),Ff=["a","button",'input[type="button"]','input[type="submit"]','[role="button"]',"[onclick]","[ng-click]","[v-on\\:click]"].join(","),Uf=(Bf.prototype.start=function(){this.isRunning||(document.addEventListener("pointerdown",this.handlePointerDown,!0),document.addEventListener("click",this.handleClick,!0),this.isRunning=!0,v("ClickDetector","Started"))},Bf.prototype.stop=function(){this.isRunning&&(document.removeEventListener("pointerdown",this.handlePointerDown,!0),document.removeEventListener("click",this.handleClick,!0),this.cleanupSlowClick(),this.isRunning=!1,v("ClickDetector","Stopped"))},Bf.prototype.handlePointerDown=function(e){var t,n,r=this,i=e.target;i&&i instanceof Element&&(i=this.getClickableElement(i))&&(this.cleanupSlowClick(),this.clickStartTime=Date.now(),this.clickNode=i,t=this.getNodeInfo(i),n=this.getExternalNavigationReason(e,i),this.options.onClickStart({node:t,timestamp:this.clickStartTime,target:i,event:e,effectiveActionReason:n||void 0}),n?this.markEffectiveAction(n):(this.slowClickTimeoutId=setTimeout(function(){r.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver()))},Bf.prototype.handleClick=function(e){var t=this,n=e.target,r=Date.now();this.rageActiveTarget&&r-this.rageLastClickTime>=this.options.rageClickWindow&&(this.rageActiveTarget=null,this.rageLastClickTime=0),this.rageActiveTarget&&this.isSameTarget(this.rageActiveTarget,n)?this.rageLastClickTime=r:(this.clickHistory.push({time:r,target:n}),this.clickHistory=this.clickHistory.filter(function(e){return r-e.time<t.options.rageClickWindow}),(e=this.clickHistory.filter(function(e){return t.isSameTarget(e.target,n)})).length>=this.options.rageClickCount&&(this.options.onRageClick({node:this.getNodeInfo(n),clickCount:e.length,timeWindowMs:this.options.rageClickWindow,timestamp:r}),this.rageActiveTarget=n,this.rageLastClickTime=r))},Bf.prototype.startMutationObserver=function(){var t=this;this.clickNode&&document.body&&"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){t.hasSignificantMutation(e)&&(t.emitEffectiveAction("dom_mutation"),t.handleSlowClick("mutation"))}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"],characterData:!0}))},Bf.prototype.hasSignificantMutation=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];if("characterData"===r.type)return!0;if("childList"===r.type&&(0<r.addedNodes.length||0<r.removedNodes.length)&&Array.from(r.addedNodes).concat(Array.from(r.removedNodes)).some(function(e){return e.nodeType===Node.ELEMENT_NODE&&!["SCRIPT","STYLE","LINK"].includes(e.tagName)}))return!0;if("attributes"===r.type){r=r.attributeName;if(["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"].includes(r||""))return!0}}return!1},Bf.prototype.handleSlowClick=function(e){var t;this.clickNode&&this.clickStartTime&&((t=Date.now()-this.clickStartTime)>=this.options.slowClickThreshold&&this.options.onSlowClick({node:this.getNodeInfo(this.clickNode),timeAfterClickMs:t,endReason:e,timestamp:this.clickStartTime}),this.cleanupSlowClick())},Bf.prototype.cleanupSlowClick=function(){this.slowClickTimeoutId&&(clearTimeout(this.slowClickTimeoutId),this.slowClickTimeoutId=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.clickStartTime=0,this.clickNode=null},Bf.prototype.isSameTarget=function(e,t){return e===t||e.contains(t)||t.contains(e)},Bf.prototype.markEffectiveAction=function(e){this.clickNode&&this.clickStartTime&&(this.emitEffectiveAction(e),this.cleanupSlowClick())},Bf.prototype.emitEffectiveAction=function(e){this.clickNode&&this.options.onEffectiveAction({reason:e,timestamp:Date.now(),node:this.getNodeInfo(this.clickNode)})},Bf.prototype.getClickableElement=function(e){return e.matches(Ff)?e:e.closest(Ff)},Bf.prototype.getExternalNavigationReason=function(e,t){var n=t.closest("a");if(n){if(n.download)return"download";var r=(n.getAttribute("target")||"").toLowerCase();if(r&&"_self"!==r)return"external_navigation";if(n.href&&(1===e.button||e.metaKey||e.ctrlKey||e.shiftKey))return"external_navigation"}r=t.closest("form"),n=((null==r?void 0:r.getAttribute("target"))||"").toLowerCase();return n&&"_self"!==n?"external_navigation":t.hasAttribute("data-tdem-ignore-dead-click")||t.closest("[data-tdem-ignore-dead-click]")||t.hasAttribute("data-tdem-effective-action")||t.closest("[data-tdem-effective-action]")?"custom":null},Bf.prototype.getNodeInfo=function(e){var t;return{id:(null==(t=e.__sn)?void 0:t.id)||0,tagName:e.tagName.toLowerCase(),textContent:(e.textContent||"").trim().substring(0,100),selector:this.getSelector(e)}},Bf.prototype.getSelector=function(e){for(var t=[],n=e;n&&n!==document.body&&t.length<5;){var r,i=n.tagName.toLowerCase();if(n.id){i+="#"+n.id,t.unshift(i);break}n.className&&"string"==typeof n.className&&0<(r=n.className.trim().split(/\s+/).slice(0,2)).length&&(i+="."+r.join(".")),t.unshift(i),n=n.parentElement}return t.join(" > ")},Bf.prototype.isActive=function(){return this.isRunning},Bf);function Bf(e){var t;void 0===e&&(e={}),this.isRunning=!1,this.clickStartTime=0,this.clickNode=null,this.slowClickTimeoutId=null,this.mutationObserver=null,this.clickHistory=[],this.rageActiveTarget=null,this.rageLastClickTime=0,this.options={slowClickTimeout:null!=(t=e.slowClickTimeout)?t:7e3,slowClickThreshold:null!=(t=e.slowClickThreshold)?t:3e3,rageClickCount:null!=(t=e.rageClickCount)?t:5,rageClickWindow:null!=(t=e.rageClickWindow)?t:1e3,onSlowClick:e.onSlowClick||function(){},onRageClick:e.onRageClick||function(){},onClickStart:e.onClickStart||function(){},onEffectiveAction:e.onEffectiveAction||function(){},onDeadClick:e.onDeadClick||function(){}},this.handleClick=this.handleClick.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this)}function zf(e){var t;this.isUploading=!1,this.useCompression=!1,this.config={uploadUrl:e.uploadUrl||"/api/v1/collect/replay",appId:e.appId,maxRetries:null!=(t=e.maxRetries)?t:3,beforeSend:e.beforeSend||function(e){return e},onError:e.onError||function(){},eventsCompression:null==(t=e.eventsCompression)||t,transport:e.transport}}function jf(e){var t=null==(t=e)?void 0:t._tdemSampleGate;return!t||!t.isDecided||t.isSampled&&!1!==e._replaySampled}new e({name:"sessionReplay"});var C=new e({name:"sessionReplay",sessionManager:null,eventBuffer:null,recorderManager:null,samplerManager:null,uploader:null,clickDetector:null,flushTimer:null,replayConfig:null,isInitialized:!1,errorOnlyUpload:!0,_errorOnlyUploadLocallyConfigured:!1,_tdemRef:null,_isCheckoutFlushing:!1,_lastLifecycleSnapshotAt:0,_errorFlushInFlight:!1,init:function(e){},onNewTdem:function(e,t){var t=this.parseConfig(t),n=null!=(n=t.debug)&&n;Mr=n,t.enabled?(this.replayConfig=t,this.errorOnlyUpload=!1!==t.errorOnlyUpload,this._errorOnlyUploadLocallyConfigured=void 0!==t.errorOnlyUpload,this._tdemRef=e,this.initializeModules(e,t),(n=this.samplerManager.initializeSampling()).shouldRecord?(this.startReplay(e,t,n.mode),this.registerReplaySamplingCheck(e,t),this.listenForErrors(e,t),this.listenForPerformance(e),this.listenForLifecycle(e,t),this.listenForUnload(e),this.isInitialized=!0):v("Plugin","Not sampled by local sampler, skipping")):v("Plugin","disabled")},setErrorOnlyUpload:function(e){this._errorOnlyUploadLocallyConfigured?v("Plugin","errorOnlyUpload has local config ("+this.errorOnlyUpload+"), ignoring remote override ("+e+")"):this.errorOnlyUpload!==e&&(v("Plugin","errorOnlyUpload switched: "+this.errorOnlyUpload+" -> "+e),this.errorOnlyUpload=e)},shouldSkipBufferFlush:function(){var e;return!0===(null==(e=this.samplerManager)?void 0:e.isBufferMode())&&this.errorOnlyUpload},hasPendingErrorFlush:function(){return!0===this._errorFlushInFlight},registerReplaySamplingCheck:function(t,e){var n=this,r=setInterval(function(){var e=null==(e=t)?void 0:e._tdemSampleGate;e&&e.isDecided&&(e.isSampled?void 0!==(e=t._replaySampled)&&(clearInterval(r),!1===e?(v("Plugin","Replay not sampled, stopping replay and clearing buffer"),n.stopReplay(),n.eventBuffer&&n.eventBuffer.clear()):v("Plugin","Both session and replay sampled, replay continues")):(clearInterval(r),v("Plugin","Session not sampled, stopping replay and clearing buffer"),n.stopReplay(),n.eventBuffer&&n.eventBuffer.clear()))},50);setTimeout(function(){clearInterval(r)},5e3)},parseConfig:function(e){return!0===e?{enabled:!0}:"object"==typeof e?f(f({},e),{enabled:!1!==e.enabled}):{enabled:!1}},initializeModules:function(t,e){var n=this,r=(this.sessionManager=new Dr({stickySession:null==(r=e.stickySession)||r}),this.sessionManager.setTdemInstance(t),t.sessionManager=this.sessionManager,this.eventBuffer=new zr({},null!=(r=e.useCompression)&&r),this.samplerManager=new jc({sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate}),this.recorderManager=new zc({onRecordingEvent:function(e){n.handleRecordingEvent(e,t)},onCheckout:function(){if(!n._isCheckoutFlushing){n._isCheckoutFlushing=!0;try{var e,t;n.shouldSkipBufferFlush()?v("SessionReplay","Checkout in buffer mode, skip flush"):n.hasPendingErrorFlush()?v("SessionReplay","Checkout skipped, error-triggered flush in flight"):(e=n._tdemRef,t=n.replayConfig,e&&t&&n.eventBuffer&&!n.eventBuffer.isEmpty()&&(v("SessionReplay","Checkout triggered, flushing current buffer"),n.flushReplayData(e,t,!0)))}finally{n._isCheckoutFlushing=!1}}},mode:"session"},e),(t.config.url||t.config.hostUrl||"").replace(/\/+$/,""));this.uploader=new Nf({uploadUrl:e.uploadUrl||r+"/api/v1/collect/replay",appId:String(t.config.id||""),beforeSend:e.beforeSend,onError:e.onError,eventsCompression:null==(r=e.eventsCompression)||r,transport:null==(r=t.getInternalTransport)?void 0:r.call(t)}),this.clickDetector=new Uf({slowClickTimeout:e.slowClickTimeout,slowClickThreshold:e.slowClickThreshold,rageClickCount:e.rageClickCount,rageClickWindow:e.rageClickWindow,onSlowClick:function(e){n.handleSlowClick(e,t)},onRageClick:function(e){n.handleRageClick(e,t)}}),v("Plugin","Modules initialized")},startReplay:function(e,t,n){var r;this.sessionManager&&this.recorderManager&&this.eventBuffer?(v("Plugin","Session started:",(this.sessionManager.restoreSession()||this.sessionManager.createSession(n)).id,"mode:",n),this.recorderManager.options.mode=n,r=Fc(f({maskAllText:!1!==t.maskAllInputs,maskAllInputs:t.maskAllInputs,maskTextSelector:t.maskTextSelector,blockSelector:t.blockSelector,ignoreSelector:t.ignoreSelector},t.privacy)),this.recorderManager.startRecording({privacy:r}),this.clickDetector&&this.clickDetector.start(),"session"===n?this.startFlushTimer(e,t):v("Plugin","Buffer mode - flush on error only")):Lr("Plugin","Modules not initialized")},handleRecordingEvent:function(e,t){this.eventBuffer&&this.sessionManager&&(this.sanitizeDataURLs(e),this.eventBuffer.addEvent(e),this.sessionManager.updateActivity())},sanitizeDataURLs:function(e){var t=e.type;if(2===t){var n=null==(n=e.data)?void 0:n.node;n&&this.sanitizeNodeTree(n,1024)}else if(3===t){n=e.data;if(0===(null==n?void 0:n.source)&&Array.isArray(n.adds)){for(var r=0,i=n.adds;r<i.length;r++){var o=i[r];null!=o&&o.node&&this.sanitizeNodeTree(o.node,1024)}if(Array.isArray(n.attributes))for(var a=0,s=n.attributes;a<s.length;a++){var l=s[a];if(null!=l&&l.attributes)for(var u=0,c=Object.entries(l.attributes);u<c.length;u++){var d=c[u],h=d[0],d=d[1];"string"==typeof d&&1024<d.length&&d.startsWith("data:")&&(l.attributes[h]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}}}}},sanitizeNodeTree:function(e,t){if(e){if(e.attributes)for(var n=e.attributes,r=0,i=Object.keys(n);r<i.length;r++){var o=i[r],a=n[o];"string"==typeof a&&a.length>t&&a.startsWith("data:")&&(n[o]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}if(Array.isArray(e.childNodes))for(var s=0,l=e.childNodes;s<l.length;s++){var u=l[s];this.sanitizeNodeTree(u,t)}}},handleSlowClick:function(e,t){v("ClickDetector","Slow click detected:",e.timeAfterClickMs,"ms"),this.addCustomEvent({category:"ui.slowClickDetected",message:"Slow click: "+e.timeAfterClickMs+"ms on "+e.node.tagName,data:{node:e.node,timeAfterClickMs:e.timeAfterClickMs,endReason:e.endReason}},t)},handleRageClick:function(e,t){v("ClickDetector","Rage click detected:",e.clickCount,"clicks"),this.addCustomEvent({category:"ui.multiClick",message:"Rage click: "+e.clickCount+" clicks on "+e.node.tagName,data:{node:e.node,clickCount:e.clickCount,timeWindowMs:e.timeWindowMs}},t)},addCustomEvent:function(e,t){this.eventBuffer&&(e={type:5,data:{tag:e.category,payload:f({message:e.message},e.data)},timestamp:Date.now()},this.eventBuffer.addEvent(e))},startFlushTimer:function(e,t){var n=this;this.flushTimer&&clearInterval(this.flushTimer),this.flushTimer=setInterval(function(){n.flushReplayData(e,t)},2e4)},flushReplayData:function(c,d,h){return void 0===h&&(h=!1),M(this,void 0,void 0,function(){var t,n,r,i,o,a,s,l,u;return I(this,function(e){switch(e.label){case 0:return this.sessionManager&&this.eventBuffer&&this.uploader&&jf(c)&&(t=this.sessionManager.getSession())?this.sessionManager.shouldRefreshSession()?(v("Plugin","Session expired, refreshing"),this.stopReplay(),i=this.sessionManager.refreshSession(),c.lifeCycle.emit("sessionRefreshed"),n=c._replaySampled,i.sampled&&!1!==n&&this.startReplay(c,d,i.sampled),[2]):this.eventBuffer.isEmpty()?[2]:(n=this.eventBuffer.getEventCount(),!h&&n<10?(v("Flush","Skipping flush, only "+n+" events (min: 10)"),[2]):(0!==t.segmentId||this.eventBuffer.hasCheckout()||(Pr("Flush","First segment missing FullSnapshot, triggering manual checkout"),this.recorderManager&&this.recorderManager.takeFullSnapshot()),[4,this.eventBuffer.finishAsync()])):[2];case 1:if(0===(r=e.sent()).eventCount)return[2];if(0===(i=r.events).length&&r.eventsJson)try{i=JSON.parse(r.eventsJson)}catch(e){return Lr("Flush","Failed to parse eventsJson from worker:",e),[2]}s=this.splitEventsIntoChunks(i),v("Flush","Flushing "+r.eventCount+" events in "+s.length+" chunk(s), total size: "+Math.round(r.uncompressedSize/1024)+"KB"),o=!0,a=0,s=s,e.label=2;case 2:return a<s.length?(l=s[a],l=JSON.stringify(l),l={project_key:String(c.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:l},[4,this.uploader.uploadReplay(l)]):[3,5];case 3:if(!e.sent())return o=!1,[3,5];e.label=4;case 4:return a++,[3,2];case 5:return l=this.eventBuffer.isUsingWorker(),u=l?"(worker)":"(sync)",v("Flush","Flushing "+r.eventCount+" events, size: "+Math.round(r.uncompressedSize/1024)+"KB "+u),o&&(this.eventBuffer.clear(),this.sessionManager.saveSession()),[2]}})})},splitEventsIntoChunks:function(e,t,n){if(void 0===t&&(t=3145728),void 0===n&&(n=5242880),0===e.length)return[];var r=JSON.stringify(e);if(r.length<=t)return[e];Pr("Split","Events size "+Math.round(r.length/1024)+"KB exceeds limit "+Math.round(t/1024)+"KB, splitting");for(var i=[],o=[],a=2,s=0,l=e;s<l.length;s++){var u,c,d=l[s],h=JSON.stringify(d).length+1;0<o.length&&t<a+h&&(i.push(o),o=[],a=2),n<h?((c=2===(u=d.type)||4===u)?Lr:Pr)("Split","Single event too large ("+Math.round(h/1024)+"KB), type="+u+(c?" (baseline snapshot, replay may become unplayable)":"")+", skipping"):(o.push(d),a+=h)}return 0<o.length&&i.push(o),i},stopReplay:function(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),v("Plugin","Recording stopped")},listenForErrors:function(t,n){var r=this;t.lifeCycle.on("errorOccurred",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){e&&r.handleError(e,t,n)})}),t.lifeCycle.on("tdemEventCreated",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){r.isErrorTDEMEvent(e)&&r.handleError(e,t,n)})})},isErrorTDEMEvent:function(e){return!!e&&("error"===String(e.event_category||"").toLowerCase()||(e=String(e.event_type||"").toLowerCase(),["js_error","promise_error","resource_error","api_error"].includes(e)))},handleError:function(e,t,n){var r=this;this.samplerManager&&(this.samplerManager.isBufferMode()&&this.samplerManager.onErrorOccurred(e)&&(v("Plugin","Converting to session mode due to error"),this._errorFlushInFlight=!0,this.flushReplayData(t,n,!0).finally(function(){r._errorFlushInFlight=!1}),this.startFlushTimer(t,n)),this.addCustomEvent({category:"error",message:(null==e?void 0:e.msg)||(null==e?void 0:e.message)||"Unknown error",data:{type:(null==e?void 0:e.type)||"error",stack:null==e?void 0:e.stack}},t))},listenForPerformance:function(n){var r=this;if(n.lifeCycle.on("afterReportWebVitals",function(e){r.handlePerformanceEvent("webVitals",e,n)}),n.lifeCycle.on("afterReportPagePerformance",function(e){r.handlePerformanceEvent("pageLoad",e,n)}),"undefined"!=typeof PerformanceObserver)try{var e=new PerformanceObserver(function(e){var t,e=e.getEntries(),e=e[e.length-1];e&&r.addCustomEvent({category:"performance.lcp",message:"LCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime,element:(null==(t=e.element)?void 0:t.tagName)||"unknown",size:e.size}},n)}),t=(e.observe({type:"largest-contentful-paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){"first-contentful-paint"===e.name&&r.addCustomEvent({category:"performance.fcp",message:"FCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime}},n)})})),i=(t.observe({type:"paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){100<e.duration&&r.addCustomEvent({category:"performance.longTask",message:"Long Task: "+Math.round(e.duration)+"ms",data:{duration:e.duration,startTime:e.startTime}},n)})}));i.observe({type:"longtask",buffered:!0}),n.lifeCycle.on("destroy",function(){e.disconnect(),t.disconnect(),i.disconnect()})}catch(n){}},handlePerformanceEvent:function(e,n,r){var i=this;n&&("webVitals"===e?["LCP","FCP","FID","CLS","TTFB","TTI","INP"].forEach(function(e){var t=n[e];void 0!==t&&-1!==t&&0<t&&i.addCustomEvent({category:"performance."+e.toLowerCase(),message:e+": "+("number"==typeof t?Math.round(t):t)+("CLS"===e?"":"ms"),data:{metric:e,value:t}},r)}):"pageLoad"===e&&this.addCustomEvent({category:"performance.pageLoad",message:"Page Load: "+(n.firstScreenTiming?Math.round(n.firstScreenTiming):"N/A")+"ms",data:{dnsLookup:n.dnsLookup,tcp:n.tcp,ssl:n.ssl,ttfb:n.ttfb,contentDownload:n.contentDownload,domParse:n.domParse,resourceDownload:n.resourceDownload,firstScreenTiming:n.firstScreenTiming}},r))},listenForLifecycle:function(o,t){var n,e,a=this;"undefined"!=typeof document&&(n=function(e){var t,n=null==(n=a.sessionManager)?void 0:n.getSession(),n=(null==n?void 0:n.replayId)||"",r=(null==(r=null==(i=o)?void 0:i.getOriginFrom)?void 0:r.call(i))||("undefined"!=typeof location?location.href:""),i="undefined"!=typeof document&&document.title||"";null!=(t=o.reportTDEMEvent)&&t.call(o,{event_id:g(),event_type:e,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:r,data:{page_title:i,replay_id:n,is_effective_action:!1,tags:{environment:o.config.env||"production",version:String(o.config.version||"")},event_properties:{visibility_state:"undefined"!=typeof document?document.visibilityState:"",lifecycle_type:e}}})},document.addEventListener("visibilitychange",e=function(){var e;if("undefined"!=typeof document){if("hidden"===document.visibilityState)return n(p.TAB_HIDDEN),a.shouldSkipBufferFlush()?void v("Lifecycle","Buffer mode (errorOnlyUpload), skip flush on hidden"):a.hasPendingErrorFlush()?void v("Lifecycle","Hidden flush skipped, error-triggered flush in flight"):void a.flushReplayData(o,t,!0);"visible"===document.visibilityState&&(n(p.TAB_VISIBLE),(e=Date.now())-a._lastLifecycleSnapshotAt<5e3||(a._lastLifecycleSnapshotAt=e,null!=(e=a.recorderManager)&&e.takeFullSnapshot(),a.shouldSkipBufferFlush()?v("Lifecycle","Buffer mode (errorOnlyUpload), skip flush on visible"):a.hasPendingErrorFlush()?v("Lifecycle","Visible flush skipped, error-triggered flush in flight"):a.flushReplayData(o,t,!0)))}}),o.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",e)}))},listenForUnload:function(e){function t(){n.shouldSkipBufferFlush()?v("Unload","Buffer mode (errorOnlyUpload), skip flush on unload"):n.hasPendingErrorFlush()?v("Unload","Unload flush skipped, error-triggered flush in flight"):n.flushOnUnload(e)}var n=this;window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),e.lifeCycle.on("destroy",function(){window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t)})},flushOnUnload:function(e){if(this.sessionManager&&this.eventBuffer&&this.uploader&&jf(e)){var t=this.sessionManager.getSession();if(t&&(this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),!this.eventBuffer.isEmpty())){var n=this.eventBuffer.finish();if(0!==n.eventCount){for(var n=this.splitEventsIntoChunks(n.events,51200,51200),r=0,i=0,o=0,a=n;o<a.length;o++){var s=a[o],s={project_key:String(e.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:JSON.stringify(s)};this.uploader.sendBeacon(s)?r++:(i++,Pr("Unload","sendBeacon rejected chunk (segment_id="+s.segment_id+"), likely exceeds 64KB browser limit or queue full"))}v("SessionReplay","sendBeacon on unload: "+r+"/"+n.length+" chunk(s) queued, "+i+" rejected")}}}},destroy:function(){this.stopReplay(),this.sessionManager&&this.sessionManager.saveSession(),this.sessionManager=null,this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,this.recorderManager=null,this.samplerManager=null,this.uploader=null,this.clickDetector=null,this.replayConfig=null,this._tdemRef=null,this._isCheckoutFlushing=!1,this._lastLifecycleSnapshotAt=0,this.isInitialized=!1,v("Plugin","destroyed")}}),Hf={enabled:!0,ruleVersion:"1.0.0",payloadAllowlist:[],click:{enabled:!0,deadClickWindowMs:3e3,rageClickWindowMs:1e3,rageClickCount:5,errorClickWindowMs:3e3,resolveOnDomMutation:!0,resolveOnSpaNavigation:!0,resolveOnExternalNavigation:!0,resolveOnWindowOpen:!0,resolveOnPageUnload:!0,resolveOnFormAction:!0,resolveOnApiSuccess:!0,ignoreDeadClickSelectors:[],effectiveActionSelectors:[]},performance:{enabled:!0,slowPageLcpThreshold:4e3,slowPageInpThreshold:500},form:{enabled:!0,fieldIdAttr:"data-field-id",formIdAttr:"data-form-id",longFocusThresholdMs:2e4,incompleteMinFieldRatio:.3,zigzagMinCount:2},navigation:{enabled:!0,backForwardAsStruggle:!0},custom:{enabled:!0,detector:void 0}},Wf=new Set([p.JS_ERROR,p.PROMISE_ERROR,p.RESOURCE_ERROR,p.API_ERROR]),Gf=new Set([p.FORM_CHANGE,p.FORM_SUBMIT,p.FORM_SUBMIT_RESULT]),qf=(new e({name:"struggleMonitor"}),new e({name:"struggleMonitor",instanceStates:new Map,originalWindowOpen:null,windowOpenHooked:!1,onNewTdem:function(t){var n,r=this,e=!0===(e=this.$getConfig(t))?f({},Hf):e&&"object"==typeof e?f(f(f({},Hf),e),{click:f(f({},Hf.click),e.click||{}),performance:f(f({},Hf.performance),e.performance||{}),form:f(f({},Hf.form),e.form||{}),navigation:f(f({},Hf.navigation),e.navigation||{}),custom:f(f({},Hf.custom),e.custom||{}),payloadAllowlist:(Array.isArray(e.payloadAllowlist)?e:Hf).payloadAllowlist,enabled:!1!==e.enabled}):f(f({},Hf),{enabled:!1});e.enabled&&(n={config:e,clickDetector:null,recentClicks:[],pendingDeadClicks:new Map,focusStartMap:new Map,formStateMap:new Map,removeDomListeners:[],onEventCreated:null,onDestroy:null},this.instanceStates.set(t,n),this.initClickDetector(t,n),this.initFormListeners(t,n),n.onEventCreated=function(e){r.handleEventCreated(t,n,e||[])},t.lifeCycle.on("tdemEventCreated",n.onEventCreated),n.onDestroy=function(){return r.cleanupInstance(t)},t.lifeCycle.on("destroy",n.onDestroy))},initClickDetector:function(t,n){var e,r=this;"undefined"!=typeof window&&"undefined"!=typeof document&&(n.clickDetector=new Uf({slowClickTimeout:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,slowClickThreshold:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,rageClickCount:null!=(e=null==(e=n.config.click)?void 0:e.rageClickCount)?e:5,rageClickWindow:null!=(e=null==(e=n.config.click)?void 0:e.rageClickWindowMs)?e:1e3,onRageClick:function(e){r.onRageClick(t,n,e)},onClickStart:function(e){r.onClickStart(t,n,e)},onEffectiveAction:function(e){r.onEffectiveAction(n,e)},onSlowClick:function(e){r.onSlowClick(t,n,e)}}),n.clickDetector.start(),this.initClickEffectiveActionListeners(n),this.initWindowOpenHook())},initClickEffectiveActionListeners:function(n){var e,t=this;"undefined"!=typeof window&&((e=function(e,t){window.addEventListener(e,t),n.removeDomListeners.push(function(){window.removeEventListener(e,t)})})("pagehide",function(){var e;!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(t.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),e("beforeunload",function(){var e;!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(t.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}))},initWindowOpenHook:function(){var r,i;"undefined"==typeof window||this.windowOpenHooked||(r=window.open,this.originalWindowOpen=r,this.windowOpenHooked=!0,i=this,window.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(window,e);return i.resolveWindowOpenActions(),n})},resolveWindowOpenActions:function(){var n=this,r=Date.now();this.instanceStates.forEach(function(e){var t;!1!==(null==(t=e.config.click)?void 0:t.resolveOnWindowOpen)&&(null!=(t=e.clickDetector)&&t.markEffectiveAction("window_open"),n.resolvePendingDeadClicks(e,"window_open",r,n.getCurrentPageUrl()))})},restoreWindowOpenHook:function(){"undefined"!=typeof window&&this.windowOpenHooked&&this.originalWindowOpen&&(window.open=this.originalWindowOpen,this.originalWindowOpen=null,this.windowOpenHooked=!1)},initFormListeners:function(r,i){var e,t,o=this;null!=(t=i.config.form)&&t.enabled&&"undefined"!=typeof document&&((t=function(e,t,n){void 0===n&&(n=!0),document.addEventListener(e,t,n),i.removeDomListeners.push(function(){document.removeEventListener(e,t,n)})})("focusin",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,p.FORM_FOCUS,e,e.form||void 0)}),t("focusout",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,p.FORM_BLUR,e,e.form||void 0)}),t("change",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,p.FORM_CHANGE,e,e.form||void 0)}),t("submit",function(e){e=e.target;e instanceof HTMLFormElement&&o.reportFormEvent(r,i,p.FORM_SUBMIT,null,e)}),t("invalid",function(e){var t,n,e=o.getTrackableField(e.target);e&&(n=e.form||void 0,n=o.buildFormBaseData(r,i,e,n),n={event_id:g(),event_type:p.FORM_SUBMIT_RESULT,event_category:m.BEHAVIOR,timestamp:Date.now(),page_url:"undefined"!=typeof window?window.location.href:(null==(t=r.getOriginFrom)?void 0:t.call(r))||"",data:f(f({},n),{event_name:"form_submit_fail",is_effective_action:!0,validation_message:e.validationMessage||void 0,event_properties:f(f({},n.event_properties||{}),{status:"fail",validation_code:!1===(null==(t=e.validity)?void 0:t.valid)?"invalid":"validation_error"})})},null!=(e=r.reportTDEMEvent))&&e.call(r,n)}),e=function(){o.reportPendingUncompletedForms(r,i,"pagehide")},"undefined"!=typeof window)&&(window.addEventListener("pagehide",e),i.removeDomListeners.push(function(){window.removeEventListener("pagehide",e)}))},getTrackableField:function(e){return!(e&&e instanceof Element)||!(e=e.closest("input, textarea, select"))||e instanceof HTMLInputElement&&["button","submit","reset","image","hidden"].includes(e.type)?null:e},buildFormBaseData:function(e,t,n,r){var n=n||null,r=r||(null==n?void 0:n.form)||void 0,i=(null==(i=t.config.form)?void 0:i.fieldIdAttr)||"data-field-id",t=(null==(t=t.config.form)?void 0:t.formIdAttr)||"data-form-id",i=n?n.getAttribute(i)||n.id||n.name||n.tagName.toLowerCase()+"_"+(n.type||"field"):void 0,t=r&&(r.getAttribute(t)||r.id||r.getAttribute("name")||r.getAttribute("action"))||void 0,o="string"==typeof(null==(o=n)?void 0:o.value)?n.value.length:0,o=0===o?"0":o<=10?"1_10":o<=50?"11_50":"51_plus";return{replay_id:nt(e),is_effective_action:!0,form_id:t,field_id:i,tags:{},event_properties:{field_name:(null==n?void 0:n.name)||"",field_type:(null==n?void 0:n.type)||(null==(e=null==n?void 0:n.tagName)?void 0:e.toLowerCase())||"",form_name:(null==r?void 0:r.getAttribute("name"))||"",is_required:String(!(null==n||!n.required)),value_length_bucket:String(o)}}},reportFormEvent:function(e,t,n,r,i){var t=this.buildFormBaseData(e,t,r,i),i="undefined"!=typeof window?window.location.href:(null==(r=e.getOriginFrom)?void 0:r.call(e))||"",r={event_id:g(),timestamp:Date.now(),page_url:i};n!==p.FORM_FOCUS?n!==p.FORM_BLUR?n!==p.FORM_CHANGE?(i=f(f({},r),{event_type:p.FORM_SUBMIT,event_category:m.BEHAVIOR,data:f(f({},t),{submit_method:"native_submit"})}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=f(f({},r),{event_type:p.FORM_CHANGE,event_category:m.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n)):(i=f(f({},r),{event_type:p.FORM_BLUR,event_category:m.BEHAVIOR,data:t}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=f(f({},r),{event_type:p.FORM_FOCUS,event_category:m.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n))},onClickStart:function(e,t,n){var r,i=t.config.click||Hf.click;!1!==i.enabled&&(r=n.node.selector||n.node.tagName||"unknown",this.shouldIgnoreDeadClick(n.target,i)?this.resolvePendingDeadClicks(t,"custom",n.timestamp,this.getCurrentPageUrl()):this.scheduleDeadClick(e,t,{pendingId:"pending_"+n.timestamp+"_"+Math.random().toString(16).slice(2),timestamp:n.timestamp,pageUrl:this.getCurrentPageUrl(),ownerKey:r,node:n.node}))},onEffectiveAction:function(e,t){this.shouldResolveByReason(e,t.reason)&&this.resolvePendingDeadClicks(e,t.reason,t.timestamp,this.getCurrentPageUrl())},scheduleDeadClick:function(t,n,r){var i=this,o=null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,e=setTimeout(function(){var e=n.pendingDeadClicks.get(r.pendingId);e&&(n.pendingDeadClicks.delete(r.pendingId),i.emitDeadClick(t,n,e,o))},o);n.pendingDeadClicks.set(r.pendingId,f(f({},r),{timeout:e}))},emitDeadClick:function(e,t,n,r){var i,o=n.clickEventId?[n.clickEventId]:void 0;null!=(i=e.reportStruggle)&&i.call(e,{type:"dead_click",ownerType:"element",ownerKey:n.ownerKey,pageUrl:n.pageUrl,triggerEventId:n.clickEventId,relatedEventIds:o,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{timeout_ms:r,selector:n.node.selector||""}})},resolvePendingDeadClicks:function(r,i,o,a){void 0===o&&(o=Date.now());var e,s=null!=(e=null==(e=r.config.click)?void 0:e.deadClickWindowMs)?e:3e3;r.pendingDeadClicks.forEach(function(e,t){var n=o-e.timestamp;n<0||s<n||"spa_navigation"!==i&&"page_unload"!==i&&a&&e.pageUrl&&a!==e.pageUrl||(clearTimeout(e.timeout),r.pendingDeadClicks.delete(t))})},linkPendingDeadClickToClickEvent:function(e,n,r){var i=n.timestamp||Date.now(),o=this.getEventPageUrl(n);e.pendingDeadClicks.forEach(function(e){var t;e.clickEventId||(t=i-e.timestamp)<0||1e3<t||o&&e.pageUrl&&o!==e.pageUrl||(e.clickEventId=n.event_id,r&&"unknown"!==r&&(e.ownerKey=r))})},shouldResolveByReason:function(e,t){e=e.config.click||Hf.click;return!1!==e.enabled&&("dom_mutation"===t?!1!==e.resolveOnDomMutation:"spa_navigation"===t?!1!==e.resolveOnSpaNavigation:"external_navigation"===t||"download"===t?!1!==e.resolveOnExternalNavigation:"window_open"===t?!1!==e.resolveOnWindowOpen:"page_unload"===t?!1!==e.resolveOnPageUnload:"form_change"===t||"form_submit"===t?!1!==e.resolveOnFormAction:"api_success"!==t||!1!==e.resolveOnApiSuccess)},shouldIgnoreDeadClick:function(t,e){return A(e.ignoreDeadClickSelectors||[],e.effectiveActionSelectors||[]).some(function(e){try{return!!e&&!!t.closest(e)}catch(e){return!1}})},getCurrentPageUrl:function(){return"undefined"==typeof window?"":window.location.href},getEventPageUrl:function(e){return(null==e?void 0:e.page_url)||(null==(e=null==e?void 0:e.data)?void 0:e.page_url)||""},onRageClick:function(e,t,n){var r=n.node.selector||n.node.tagName||"unknown",i=null!=(o=null==(o=t.config.click)?void 0:o.rageClickWindowMs)?o:1e3,o=t.recentClicks.filter(function(e){return n.timestamp-e.timestamp<=i}).map(function(e){return e.eventId}).filter(Boolean).slice(-10),r={type:"rage_click",ownerType:"element",ownerKey:r,pageUrl:window.location.href,triggerEventId:o[0],relatedEventIds:o.length?o:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{clickCount:n.clickCount,timeWindowMs:n.timeWindowMs,selector:n.node.selector||""}};null!=(o=e.reportStruggle)&&o.call(e,r)},onSlowClick:function(e,t,n){},handleEventCreated:function(i,o,e){var t,a=this,s=Date.now(),n=o.config.click||Hf.click,r=Math.max(null!=(t=n.errorClickWindowMs)?t:3e3,null!=(t=n.rageClickWindowMs)?t:1e3,null!=(t=n.deadClickWindowMs)?t:3e3);o.recentClicks=o.recentClicks.filter(function(e){return s-e.timestamp<=r}),e.forEach(function(e){var t,n,r;e&&e.event_type!==p.STRUGGLE&&(t=e.timestamp||s,n=a.getEventPageUrl(e),e.event_type===p.CLICK?(r=(null==(r=e.data)?void 0:r.target_element)||(null==(r=e.data)?void 0:r.target_id)||(null==(r=e.data)?void 0:r.target_class)||"unknown",o.recentClicks.push({eventId:e.event_id,timestamp:t,pageUrl:n,ownerKey:r}),a.linkPendingDeadClickToClickEvent(o,e,r)):(a.isEffectiveActionEvent(o,e)&&(a.resolvePendingDeadClicks(o,a.getEffectiveActionReason(e),t,n),null!=(r=o.clickDetector)&&r.markEffectiveAction(a.getEffectiveActionReason(e))),Wf.has(e.event_type)?a.tryReportErrorClick(i,o,e):e.event_type===p.PAGE_LOAD||e.event_type===p.true?a.tryReportSlowPage(i,o,e):e.event_type===p.FORM_FOCUS?(a.trackFormFocus(o,e),a.trackFormChangeAndZigzag(i,o,e)):e.event_type===p.FORM_CHANGE?a.trackFormChangeAndZigzag(i,o,e):e.event_type===p.FORM_BLUR?a.tryReportLongFocusTime(i,o,e):e.event_type===p.FORM_SUBMIT?a.trackFormSubmitResult(o,e):e.event_type===p.FORM_SUBMIT_RESULT?(a.trackFormSubmitResult(o,e),a.tryReportFormValidationError(i,o,e)):e.event_type===p.PAGE_VIEW&&null!=(n=null==(t=e.data)?void 0:t.event_properties)&&n.navigation_type&&a.tryReportBackForward(i,o,e)),a.tryReportCustomStruggle(i,o,e))})},isEffectiveActionEvent:function(e,t){var n;return!1!==(null==(n=e.config.click)?void 0:n.enabled)&&(t.event_type===p.API_CALL?!1!==(null==(n=e.config.click)?void 0:n.resolveOnApiSuccess):t.event_type===p.PAGE_VIEW&&null!=(n=null==(n=t.data)?void 0:n.event_properties)&&n.navigation_type?!1!==(null==(n=e.config.click)?void 0:n.resolveOnSpaNavigation):Gf.has(t.event_type)?!1!==(null==(n=e.config.click)?void 0:n.resolveOnFormAction):!0===(null==(e=t.data)?void 0:e.is_effective_action))},getEffectiveActionReason:function(e){return e.event_type===p.API_CALL?"api_success":e.event_type===p.PAGE_VIEW?"spa_navigation":e.event_type===p.FORM_CHANGE?"form_change":e.event_type===p.FORM_SUBMIT||e.event_type===p.FORM_SUBMIT_RESULT?"form_submit":"custom"},getFormStateKey:function(e,t){return e||t||"unknown_form"},ensureFormState:function(e,t,n){var r=this.getFormStateKey(t,n);return e.formStateMap.has(r)||e.formStateMap.set(r,{formId:t||r,pageUrl:n||"",touchedFieldIds:new Set,requiredFieldIds:new Set,changedFieldIds:new Set,focusPath:[],zigzagHits:0,hasSuccessSubmit:!1,reportedZigzag:!1,reportedUncompleted:!1}),e.formStateMap.get(r)},recordFormTouch:function(e,t){var n,e=this.ensureFormState(e,null==(e=null==t?void 0:t.data)?void 0:e.form_id,null==t?void 0:t.page_url),r=String((null==(r=null==t?void 0:t.data)?void 0:r.field_id)||"");return r&&(e.touchedFieldIds.add(r),!0===(null==(n=t.data)?void 0:n.is_required)&&e.requiredFieldIds.add(r),t.event_type===p.FORM_CHANGE)&&e.changedFieldIds.add(r),null!=t&&t.page_url&&(e.pageUrl=t.page_url),e},trackFormFocus:function(e,t){var n,r=t,i=String((null==(i=null==r?void 0:r.data)?void 0:i.field_id)||"");i&&((n=this.recordFormTouch(e,r)).focusPath.push(i),12<n.focusPath.length&&n.focusPath.shift(),e.focusStartMap.set(i,{timestamp:t.timestamp||Date.now(),eventId:t.event_id,formId:null==(n=null==r?void 0:r.data)?void 0:n.form_id,pageUrl:null==r?void 0:r.page_url}))},trackFormChangeAndZigzag:function(e,t,n){var r,i,o,a,s;n.event_type!==p.FORM_CHANGE?n.event_type!==p.FORM_FOCUS||(s=(i=this.recordFormTouch(t,r=n)).focusPath).length<4||i.reportedZigzag||(o=(s=s.slice(-4))[0],a=s[1],!o)||!a||o===a||o!==s[2]||a!==s[3]||i.changedFieldIds.size<2||(i.zigzagHits+=1,s=null!=(a=null==(o=t.config.form)?void 0:o.zigzagMinCount)?a:2,i.zigzagHits<s)||(i.reportedZigzag=!0,null==(o=e.reportStruggle))||o.call(e,{type:"form_zigzag",ownerType:"form",ownerKey:i.formId,pageUrl:i.pageUrl,formId:i.formId,fieldId:String((null==(a=null==r?void 0:r.data)?void 0:a.field_id)||""),triggerEventId:r.event_id,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{zigzag_hits:i.zigzagHits,changed_field_count:i.changedFieldIds.size}}):this.recordFormTouch(t,n)},trackFormSubmitResult:function(e,t){t.event_type!==p.FORM_SUBMIT&&t.event_type!==p.FORM_SUBMIT_RESULT||((e=this.recordFormTouch(e,t)).lastSubmitEventId=t.event_id,t.event_type!==p.FORM_SUBMIT_RESULT)||"success"===(null==(t=null==(t=t.data)?void 0:t.event_properties)?void 0:t.status)&&(e.hasSuccessSubmit=!0)},reportPendingUncompletedForms:function(t,n,r){var i=this;n.formStateMap.forEach(function(e){i.tryReportUncompletedForm(t,n,e,r)})},tryReportUncompletedForm:function(e,t,n,r){var i,o,a,s;n.reportedUncompleted||n.hasSuccessSubmit||0===n.touchedFieldIds.size||(a=0<(o=n.requiredFieldIds.size)?o:n.touchedFieldIds.size)<=0||(a=n.changedFieldIds.size/a)<(s=null!=(s=null==(s=t.config.form)?void 0:s.incompleteMinFieldRatio)?s:.3)||(n.reportedUncompleted=!0,null==(i=e.reportStruggle))||i.call(e,{type:"uncompleted_form",ownerType:"form",ownerKey:n.formId,pageUrl:n.pageUrl,formId:n.formId,triggerEventId:n.lastSubmitEventId,relatedEventIds:n.lastSubmitEventId?[n.lastSubmitEventId]:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{touched_field_count:n.touchedFieldIds.size,changed_field_count:n.changedFieldIds.size,required_field_count:o,changed_ratio:Number(a.toFixed(4)),threshold_ratio:s}})},tryReportLongFocusTime:function(e,t,n){var r,i,o,a,s=String((null==(s=null==n?void 0:n.data)?void 0:s.field_id)||"");s&&(i=t.focusStartMap.get(s))&&(t.focusStartMap.delete(s),o=null!=(o=null==(o=t.config.form)?void 0:o.longFocusThresholdMs)?o:2e4,(a=Math.max((n.timestamp||Date.now())-i.timestamp,0))<o||null==(r=e.reportStruggle)||r.call(e,{type:"long_focus_time",ownerType:"field",ownerKey:s,pageUrl:(null==n?void 0:n.page_url)||i.pageUrl,formId:(null==(r=null==n?void 0:n.data)?void 0:r.form_id)||i.formId,fieldId:s,triggerEventId:n.event_id,relatedEventIds:[i.eventId||"",n.event_id].filter(Boolean),detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{focus_duration_ms:a,threshold_ms:o}}))},tryReportErrorClick:function(e,t,n){var r,i,o;t.recentClicks.length&&(i=null!=(o=(t.config.click||Hf.click).errorClickWindowMs)?o:3e3,o=A(t.recentClicks).reverse().find(function(e){return 0<=n.timestamp-e.timestamp&&n.timestamp-e.timestamp<=i}))&&null!=(r=e.reportStruggle)&&r.call(e,{type:"error_click",ownerType:"element",ownerKey:o.ownerKey,pageUrl:o.pageUrl||n.page_url,triggerEventId:o.eventId,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{errorEventType:n.event_type}})},tryReportSlowPage:function(e,t,n){var r,i,o,a=t.config.performance||Hf.performance;a.enabled&&(i=(null==(i=n.data)?void 0:i.measurements)||{},r=Number(i.lcp||0),i=Number(i.inp||0),o=null!=(o=a.slowPageLcpThreshold)?o:4e3,a=null!=(a=a.slowPageInpThreshold)?a:500,o<=r||a<=i)&&null!=(o=e.reportStruggle)&&o.call(e,{type:"slow_page",ownerType:"page",ownerKey:n.page_url||("undefined"!=typeof window?window.location.href:""),pageUrl:n.page_url,triggerEventId:n.event_id,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{lcp:r,inp:i,sourceEventType:n.event_type}})},tryReportFormValidationError:function(e,t,n){var r,i,o,a,s=(null==(s=null==n?void 0:n.data)?void 0:s.event_properties)||{},l=(null==n?void 0:n.data)||{};"fail"===String((null==s?void 0:s.status)||(null===(i=l)?void 0:i.status)||"")&&(i=String((null==s?void 0:s.field_id)||(null===(i=l)?void 0:i.field_id)||""),o=String((null==s?void 0:s.form_id)||(null===(o=l)?void 0:o.form_id)||""),a=i||o||(null==n?void 0:n.page_url)||"unknown",null!=(r=e.reportStruggle))&&r.call(e,{type:"form_validation_error",ownerType:i?"field":"form",ownerKey:a,pageUrl:null==n?void 0:n.page_url,formId:o,fieldId:i,triggerEventId:n.event_id,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{validation_code:(null==s?void 0:s.validation_code)||(null===(r=l)?void 0:r.validation_code),validation_message:null==(e=null==n?void 0:n.data)?void 0:e.validation_message,sourceEventType:n.event_type}})},tryReportBackForward:function(e,t,n){var r,i,o=t.config.navigation||Hf.navigation;o.enabled&&o.backForwardAsStruggle&&(n=null==(n=null==(o=n)?void 0:o.data)?void 0:n.event_properties,"back"!==(i=String((null==n?void 0:n.navigation_type)||""))&&"forward"!==i||null==(r=e.reportStruggle)||r.call(e,{type:"back_forward",ownerType:"page",ownerKey:String((null==n?void 0:n.to_page)||"")||(null==o?void 0:o.page_url)||"unknown",pageUrl:null==o?void 0:o.page_url,triggerEventId:o.event_id,relatedEventIds:[o.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{navigation_type:i,from_page:null==n?void 0:n.from_page,to_page:null==n?void 0:n.to_page}}))},tryReportCustomStruggle:function(n,r,i){var e=r.config.custom||Hf.custom;e.enabled&&"function"==typeof e.detector&&(e=e.detector({event:i,tdem:n}),(Array.isArray(e)?e:e?[e]:[]).forEach(function(e){var t,e=f(f({},e),{type:(null==e?void 0:e.type)||"custom_struggle",ownerType:(null==e?void 0:e.ownerType)||"app",ownerKey:(null==e?void 0:e.ownerKey)||i.page_url||"custom",ruleVersion:(null==e?void 0:e.ruleVersion)||r.config.ruleVersion,payloadAllowlist:(null==e?void 0:e.payloadAllowlist)||r.config.payloadAllowlist,detectionSource:(null==e?void 0:e.detectionSource)||"custom"});null!=(t=n.reportStruggle)&&t.call(n,e)}))},cleanupInstance:function(e){var t=this.instanceStates.get(e);t&&(t.onEventCreated&&e.lifeCycle.remove("tdemEventCreated",t.onEventCreated),t.onDestroy&&e.lifeCycle.remove("destroy",t.onDestroy),t.clickDetector&&t.clickDetector.stop(),t.pendingDeadClicks.forEach(function(e){clearTimeout(e.timeout)}),t.pendingDeadClicks.clear(),this.reportPendingUncompletedForms(e,t,"destroy"),t.focusStartMap.clear(),t.formStateMap.clear(),t.removeDomListeners.forEach(function(e){return e()}),t.removeDomListeners=[],this.instanceStates.delete(e),0===this.instanceStates.size)&&this.restoreWindowOpenHook()},destroy:function(){var n=this;this.instanceStates.forEach(function(e,t){n.cleanupInstance(t)}),this.instanceStates.clear(),this.restoreWindowOpenHook()}}));function Vf(e,t,n){try{var r={projectKey:e,sampleRate:t,replaySampleRate:n,timestamp:Date.now()};localStorage.setItem("TDEM_SAMPLE_CONFIG",JSON.stringify(r))}catch(e){}}function Zf(e){return e._tdemSampleGate||null}function Kf(e,t,n){e=Zf(e);e?!n||t<=0?e.decide(!1):100<=t?e.decide(!0):(n=100*Math.random()<t,e.decide(n)):console.warn("[TDEM] Sample gate not found")}function Jf(e,t){var n=Zf(e);!(n&&n.isDecided&&n.isSampled)||t<=0?e._replaySampled=!1:100<=t?e._replaySampled=!0:(n=100*Math.random(),e._replaySampled=n<t)}function Xf(e,t){var n;null!=t&&"function"==typeof(e=null==(e=null==(n=null==(n=null==(e=e.constructor.installedPlugins)?void 0:e.find)?void 0:n.call(e,function(e){return e&&"sessionReplay"===e.name}))?void 0:n.option)?void 0:e.setErrorOnlyUpload)&&e.call(n.option,!!t)}function $f(e,t,n){var r=Zf(e);r&&((t=t?(e=>{try{var t,n=localStorage.getItem("TDEM_SAMPLE_CONFIG");return n?(t=JSON.parse(n)).projectKey===e&&Date.now()-t.timestamp<6048e5?t:null:null}catch(e){return null}})(t):null)?(console.info("[TDEM] Using cached config, sampleRate:",t.sampleRate,"replaySampleRate:",t.replaySampleRate),n._cachedSampleRate=t.sampleRate,n._cachedReplaySampleRate=t.replaySampleRate,Kf(e,t.sampleRate,0<t.sampleRate),Jf(e,t.replaySampleRate)):(console.warn("[TDEM] No cached config, default to not report"),r.decide(!1),e._replaySampled=!1))}var Yf=new e({name:"tdemConfig",_cachedSampleRate:null,_cachedReplaySampleRate:null,onNewTdem:function(e){var t=this;!function(u,c){var d;M(this,void 0,void 0,function(){var n,r,i,o,a,s,l;return I(this,function(e){switch(e.label){case 0:if(!(n=u.config.id))return $f(u,n,c),[2];if(r=u._prefetchedConfigData)return delete u._prefetchedConfigData,i=r.tdem_sample_rate,o=null!=(d=r.replay_sample_rate)?d:1,a=r.enabled,s=r.error_only_upload,Vf(n,i,o),c._cachedSampleRate=i,c._cachedReplaySampleRate=o,Kf(u,i,a),Jf(u,o),Xf(u,s),[2];if(t=(u.config.url||"").replace(/\/+$/,""),!(r=t?t+"/api/v1/config":""))return $f(u,n,c),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,u.transportRequest({kind:"config",url:r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:n})})];case 2:if(!(l=e.sent()).ok)throw new Error("HTTP "+l.status);if(0===(l="string"==typeof l.body?JSON.parse(l.body):l.body).code&&l.data)return i=l.data.tdem_sample_rate,o=null!=(d=l.data.replay_sample_rate)?d:1,a=l.data.enabled,s=l.data.error_only_upload,Vf(n,i,o),c._cachedSampleRate=i,c._cachedReplaySampleRate=o,Kf(u,i,a),Jf(u,o),Xf(u,s),[3,4];throw new Error("API error: code="+l.code);case 3:return l=e.sent(),console.warn("[TDEM] Failed to fetch remote config:",l),$f(u,n,c),[3,4];case 4:return[2]}var t})})}(e,this),e.lifeCycle.on("sessionRefreshed",function(){t.onSessionRefreshed(e)})},onSessionRefreshed:function(e){var t,n=Zf(e);n&&n.isDecided&&null!=(t=this._cachedSampleRate)&&((n=n.reDecide(t))?Jf(e,null!=(t=this._cachedReplaySampleRate)?t:1):e._replaySampled=!1,console.info("[TDEM] Session refreshed, session="+n+", replay="+e._replaySampled))}});return wr.use(Ft),wr.use(Ot),wr.use(ot),wr.use(ar),wr.use(rr),wr.use(Tr),wr.use(t),wr.use(lr),wr.use(Er),wr.use(Ht),wr.use(nn),wr.use(C),wr.use(qf),wr.use(It),wr.use(Yf),wr});