@amplitude/segment-session-replay-plugin 0.0.0-beta.9 → 0.0.0-fixsdk-init.0

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.
@@ -1,2 +1,2 @@
1
- var e=function(t,r){return e=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,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}l((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}function a(e,t,r){if(r||2===arguments.length)for(var n,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var l,c="".concat("AMP","_unsent"),u="https://api2.amplitude.com/2/httpapi";!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(l||(l={}));var h,d=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},p=function(e){return{promise:e||Promise.resolve()}};!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(h||(h={}));var f="Amplitude Logger ",m=function(){function e(){this.logLevel=h.None}return e.prototype.disable=function(){this.logLevel=h.None},e.prototype.enable=function(e){void 0===e&&(e=h.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Verbose||console.log("".concat(f,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Warn||console.warn("".concat(f,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Error||console.error("".concat(f,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Debug||console.log("".concat(f,"[Debug]: ").concat(e.join(" ")))},e}(),g=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:h.Warn,loggerProvider:new m,offline:!1,optOut:!1,serverUrl:u,serverZone:"US",useBatch:!1}},v=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=g();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var i=w(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=i.serverZone,this.serverUrl=i.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),y=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":u},w=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=g().serverZone),void 0===r&&(r=g().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:g().serverZone;return{serverZone:n,serverUrl:y(n,r)}},b=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:S(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),S=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},C=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},I.apply(this,arguments)};function k(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}"function"==typeof SuppressedError&&SuppressedError;var O=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var o=k(["string","number","boolean","undefined"]),i=o.next();!i.done;i=o.next()){if(i.value===s)return e===t}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!O(c,u))return!1;var h=!0;return Object.keys(e).forEach((function(r){O(e[r],t[r])||(h=!1)})),h}for(var d=0;d<e.length;d++)if(!O(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var E,M=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=I({},this.identity.userProperties),r=I(I({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,o,i,a,l=r.userProperties||{};try{for(var c=k(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=x(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,k(Object.entries(p))),m=f.next();!m.done;m=f.next()){var g=x(m.value,2),v=g[0],y=g[1];l[v]=y}}catch(e){s={error:e}}finally{try{m&&!m.done&&(o=f.return)&&o.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(i=void 0,k(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[v=b.value]}}catch(e){i={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return I({},this.identity)},e.prototype.setIdentity=function(e){var t=I({},this.identity);this.identity=I({},e),O(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,A=function(){function e(){this.identityStore=new M,this.eventBridge=new C,this.applicationContextProvider=new b}return e.getInstance=function(t){return R.analyticsConnectorInstances||(R.analyticsConnectorInstances={}),R.analyticsConnectorInstances[t]||(R.analyticsConnectorInstances[t]=new e),R.analyticsConnectorInstances[t]},e}(),T=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<h.Debug||!c||!l)return e.apply(s,o);var u,d={type:"invoke public method",name:t,args:o,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map((function(e){return e.trim()}))),time:{start:(new Date).toISOString()},states:{}};n&&d.states&&(d.states.before=n());var p=e.apply(s,o);return p&&p.promise?p.promise.then((function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),l.debug(JSON.stringify(d,null,2))})):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),l.debug(JSON.stringify(d,null,2))),p}},P=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,c,u,h,d,p,f,m,g,v,y,w,b,S,C,I;if("object"!=typeof e)return null;var k=e.code||0,x=this.buildStatus(k);switch(x){case l.Success:return{status:x,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case l.Invalid:return{status:x,statusCode:k,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(i=e.events_with_invalid_fields)&&void 0!==i?i:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(h=e.exceeded_daily_quota_devices)&&void 0!==h?h:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case l.PayloadTooLarge:return{status:x,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case l.RateLimit:return{status:x,statusCode:k,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(I=e.throttled_events)&&void 0!==I?I:[]}};case l.Timeout:default:return{status:x,statusCode:k}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?l.Success:429===e?l.RateLimit:413===e?l.PayloadTooLarge:408===e?l.Timeout:e>=400&&e<500?l.Invalid:e>=500?l.Failed:l.Unknown},e}(),N=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),r.prototype.send=function(e,t){return n(this,void 0,void 0,(function(){var r,n,o;return s(this,(function(s){switch(s.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=s.sent()).text()];case 2:o=s.sent();try{return[2,this.buildResponse(JSON.parse(o))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}}))}))},r}(P);!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(E||(E={}));var D,L="[Amplitude]",_="".concat(L," Session Replay ID"),F=E.US,B="".concat(L," Session Replay Debug"),U="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata"}(D||(D={}));var j=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),W="medium";var z,V=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!n&&(!!["password","hidden","email","tel"].includes(n)||!!r.autocomplete.startsWith("cc-"));case"medium":case"conservative":return!0;default:return V(e,W,r)}},G=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:W}),r){if(r.closest("."+U))return!0;var i=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some((function(e){return r.closest(e)}));if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some((function(e){return r.closest(e)}));if(a)return!1}return V(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:W,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},q=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},Z=function(e,t){return t||(e===E.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===E.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},Y=function(e,t){var r,n,s,i;try{for(var a=o(t),l=a.next();!l.done;l=a.next()){var c=l.value,u=(s=c.selector,i=void 0,i=s.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,"."),new RegExp("^".concat(i,"$")));if(u.test(e))return e.replace(u,c.replacement)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return e},K=function(){return n(void 0,void 0,void 0,(function(){var e,t,r,n,o,i,a;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),(e=d())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=s.sent(),r=t.usage,n=t.quota,o=t.usageDetails,i=r?Math.round(r/1024):0,a=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:i,percentOfQuota:a,usageDetails:JSON.stringify(o)}];case 2:return[3,4];case 3:return s.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}}))}))},J=function(e){var t=r({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},H=function(){return{flushMaxRetries:2,logLevel:h.Warn,loggerProvider:new m,transportProvider:new N}},X=function(e){function n(t,n){var s,o,i=this,a=H();return(i=e.call(this,r(r({transportProvider:a.transportProvider,loggerProvider:new j(n.loggerProvider||a.loggerProvider)},n),{apiKey:t}))||this).flushMaxRetries=void 0!==n.flushMaxRetries&&n.flushMaxRetries<=a.flushMaxRetries?n.flushMaxRetries:a.flushMaxRetries,i.apiKey=t,i.sampleRate=n.sampleRate||0,i.serverZone=n.serverZone||F,i.configServerUrl=n.configServerUrl,i.trackServerUrl=n.trackServerUrl,i.shouldInlineStylesheet=n.shouldInlineStylesheet,i.version=n.version,i.performanceConfig=n.performanceConfig,i.storeType=null!==(s=n.storeType)&&void 0!==s?s:"idb",i.applyBackgroundColorToBlockedElements=null!==(o=n.applyBackgroundColorToBlockedElements)&&void 0!==o&&o,n.privacyConfig&&(i.privacyConfig=n.privacyConfig),n.interactionConfig&&(i.interactionConfig=n.interactionConfig,i.interactionConfig.ugcFilterRules&&function(e){if(!e.every((function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement})))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every((function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t})))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(i.interactionConfig.ugcFilterRules)),n.debugMode&&(i.debugMode=n.debugMode),n.experimental&&(i.experimental=n.experimental),i}return t(n,e),n}(v),$=Object.defineProperty,Q=(e,t,r)=>((e,t,r)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ee=Object.defineProperty,te=(e,t,r)=>((e,t,r)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),re=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(re||{});const ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},oe={};function ie(e){if(oe[e])return oe[e];const t=globalThis[e],r=t.prototype,n=e in ne?ne[e]:void 0,s=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in se?se[e]:void 0,i=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(s&&i&&!globalThis.Zone)return oe[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?oe[e]=o:r}catch{return r}}const ae={};function le(e,t,r){var n;const s=`${e}.${String(r)}`;if(ae[s])return ae[s].call(t);const o=ie(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(ae[s]=i,i.call(t)):t[r]}const ce={};function ue(e,t,r){const n=`${e}.${String(r)}`;if(ce[n])return ce[n].bind(t);const s=ie(e)[r];return"function"!=typeof s?t[r]:(ce[n]=s,s.bind(t))}const he={childNodes:function(e){return le("Node",e,"childNodes")},parentNode:function(e){return le("Node",e,"parentNode")},parentElement:function(e){return le("Node",e,"parentElement")},textContent:function(e){return le("Node",e,"textContent")},contains:function(e,t){return ue("Node",e,"contains")(t)},getRootNode:function(e){return ue("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?le("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?le("Element",e,"shadowRoot"):null},querySelector:function(e,t){return le("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return le("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ie("MutationObserver").constructor}};function de(e){return e.nodeType===e.ELEMENT_NODE}function pe(e){const t=e&&"host"in e&&"mode"in e&&he.host(e)||null;return Boolean(t&&"shadowRoot"in t&&he.shadowRoot(t)===e)}function fe(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function me(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const s=Array.from(r,(e=>ge(e,n))).join("");return(t=s).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function ge(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=me(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?Ee(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?Ee(r,t):r}}class ve{constructor(){te(this,"idNodeMap",new Map),te(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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){const 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){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const 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 ye({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&we(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function we(e){return e.toLowerCase()}const be="__rrweb_original__";function Se(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?we(t):null}function Ce(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const Ie=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ke=/^(?:[a-z+]+:)?\/\//i,xe=/^www\..*/i,Oe=/^(data:)([^,]*),(.*)/i;function Ee(e,t){return(e||"").replace(Ie,((e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(ke.test(a)||xe.test(a))return`url(${l}${a}${l})`;if(Oe.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}function Me(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Re(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),s=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=Me(e,r);const i=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=Me(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=Me(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/i);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;const l=Me(e.substring(0,a),r);if(l.length===p){s.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/i)):a-=Math.max(1,Math.floor((l.length-p)*i))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const Ae="lightgrey";let Te=1;const Pe=new RegExp("[^a-z0-9-_:]");function Ne(){return Te++}let De,Le;const _e=/^[^ \t\n\r\u000c]+/,Fe=/^[, \t\n\r\u000c]+/;const Be=new WeakMap;function Ue(e,t){return t&&""!==t.trim()?We(e,t):t}function je(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function We(e,t){let r=Be.get(e);if(r||(r=e.createElement("a"),Be.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ze(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Ue(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(Fe),!(r>=t.length);){let o=n(_e);if(","===o.slice(-1))o=Ue(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=Ue(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((o+n).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,s.push((o+n).trim());break}"("===e&&(i=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?Ee(n,We(e)):"object"===t&&"data"===r?Ue(e,n):n:Ue(e,n):n}function Ve(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Ge(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ge(he.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Ge(he.parentNode(e),t,r)}function qe(e,t,r,n){let s;if(de(e)){if(s=e,!he.childNodes(s).length)return!1}else{if(null===he.parentElement(e))return!1;s=he.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(Ge(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(e){}return!1}function Ze(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1,applyBackgroundColorToBlockedElements:v=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:re.Document,childNodes:[],compatMode:e.compatMode}:{type:re.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:re.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=we(e.tagName);return Pe.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Ve(g,n.name,n.value)||(v[n.name]=ze(r,g,we(n.name),n.value))}if("link"===g&&o){const t=Array.from(r.styleSheets).find((t=>t.href===e.href));let n=null;t&&(n=me(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===g&&e.sheet){let t=me(e.sheet);t&&(e.childNodes.length>1&&(t=Re(t,e)),v._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,r=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&t?v.value=ye({element:e,type:Se(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:a}):r&&(v.checked=r)}"option"===g&&(e.selected&&!i.select?v.selected=!0:delete v.selected);"dialog"===g&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const s=t.getImageData,o=be in s?s[be]:s;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(v.rr_dataURL=t)}if("img"===g&&c){De||(De=r.createElement("canvas"),Le=De.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{De.width=t.naturalWidth,De.height=t.naturalHeight,Le.drawImage(t,0,0),v.rr_dataURL=De.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?v.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=v;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:r}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:Ae}:{}}}"iframe"!==g||h(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);let w;try{customElements.get(g)&&(w=!0)}catch(e){}return{type:re.Element,tagName:g,attributes:v,childNodes:[],isSVG:je(e)||void 0,needBlock:m,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=he.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":o||(l=he.textContent(e),c&&l&&(l=Ee(l,We(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,he.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:re.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:re.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:re.Comment,textContent:he.textContent(e)||"",rootId:y};default:return!1}}function Ye(e){return null==e?"":e.toLowerCase()}function Ke(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:k=!1,applyBackgroundColorToBlockedElements:x=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:E=!0}=t;if(!O){O=qe(e,i,a,void 0===O)}const M=Ze(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k,applyBackgroundColorToBlockedElements:x});if(!M)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===re.Comment)return!0;if(e.type===re.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Ce(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ye(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ye(e.attributes.name)||"icon"===Ye(e.attributes.rel)||"apple-touch-icon"===Ye(e.attributes.rel)||"shortcut icon"===Ye(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ye(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ye(e.attributes.property).match(/^(og|twitter|fb):/)||Ye(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ye(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ye(e.attributes.name)||"googlebot"===Ye(e.attributes.name)||"bingbot"===Ye(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ye(e.attributes.name)||"generator"===Ye(e.attributes.name)||"framework"===Ye(e.attributes.name)||"publisher"===Ye(e.attributes.name)||"progid"===Ye(e.attributes.name)||Ye(e.attributes.property).match(/^article:/)||Ye(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ye(e.attributes.name)||"yandex-verification"===Ye(e.attributes.name)||"csrf-token"===Ye(e.attributes.name)||"p:domain_verify"===Ye(e.attributes.name)||"verify-v1"===Ye(e.attributes.name)||"verification"===Ye(e.attributes.name)||"shopify-checkout-api-token"===Ye(e.attributes.name)))return!0}}return!1}(M,p)||!E&&M.type===re.Text&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ne();const A=Object.assign(M,{id:R});if(n.add(e,A),-2===R)return null;v&&v(e);let T=!l;if(A.type===re.Element){T=T&&!A.needBlock,delete A.needBlock;const t=he.shadowRoot(e);t&&fe(t)&&(A.isShadowHost=!0)}if((A.type===re.Document||A.type===re.Element)&&T){p.headWhitespace&&A.type===re.Element&&"head"===A.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:x};if(A.type===re.Element&&"textarea"===A.tagName&&void 0!==A.attributes.value);else{A.type===re.Element&&void 0!==A.attributes._cssText&&"string"==typeof A.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(he.childNodes(e))){const e=Ke(r,t);e&&A.childNodes.push(e)}}let I=null;if(de(e)&&(I=he.shadowRoot(e)))for(const e of Array.from(he.childNodes(I))){const r=Ke(e,t);r&&(fe(I)&&(r.isShadow=!0),A.childNodes.push(r))}}const P=he.parentNode(e);return P&&pe(P)&&fe(P)&&(A.isShadow=!0),A.type===re.Element&&"iframe"===A.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,o=!1;try{s=n.document.readyState}catch(e){return}if("complete"!==s){const n=setTimeout((()=>{o||(t(),o=!0)}),r);return void e.addEventListener("load",(()=>{clearTimeout(n),o=!0,t()}))}const i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const r=Ke(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&y(e,r)}}),w),A.type===re.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===Ce(A.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),s=!0,t()}))}(e,(()=>{if(b){const t=Ke(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}}),S),A}function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function He(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Xe={exports:{}},$e=String,Qe=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}};Xe.exports=Qe(),Xe.exports.createColors=Qe;var et=Xe.exports;const tt=He(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let rt=et,nt=tt,st=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?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=rt.isColorSupported),nt&&e&&(t=nt(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=rt.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map(((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ot=st;st.default=st;var it={};it.isClean=Symbol("isClean"),it.my=Symbol("my");const at={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let lt=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;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");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||r)}}comment(e){let 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&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return at[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var i;return void 0===n&&(n=at[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}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&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.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)}};var ct=lt;lt.default=lt;let ut=ct;function ht(e,t){new ut(t).stringify(e)}var dt=ht;ht.default=ht;let{isClean:pt,my:ft}=it,mt=ot,gt=ct,vt=dt;function yt(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map((e=>yt(e,r))):("object"===o&&null!==s&&(s=yt(s)),r[n]=s)}return r}let wt=class{constructor(e={}){this.raws={},this[pt]=!1,this[ft]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let 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={}){let t=yt(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new mt(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[pt]){this[pt]=!1;let e=this;for(;e=e.parent;)e[pt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return 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};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else 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));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new gt).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=vt){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var bt=wt;wt.default=wt;let St=bt,Ct=class extends St{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var It=Ct;Ct.default=Ct;var kt={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:xt,SourceMapGenerator:Ot}=tt,{existsSync:Et,readFileSync:Mt}=tt,{dirname:Rt,join:At}=tt;let Tt=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Rt(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new xt(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Rt(e),Et(e))return this.mapFile=e,Mt(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof xt)return Ot.fromSourceMap(t).toString();if(t instanceof Ot)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=At(Rt(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Pt=Tt;Tt.default=Tt;let{SourceMapConsumer:Nt,SourceMapGenerator:Dt}=tt,{fileURLToPath:Lt,pathToFileURL:_t}=tt,{isAbsolute:Ft,resolve:Bt}=tt,{nanoid:Ut}=kt,jt=tt,Wt=ot,zt=Pt,Vt=Symbol("fromOffsetCache"),Gt=Boolean(Nt&&Dt),qt=Boolean(Bt&&Ft),Zt=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(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&&(!qt||/^\w+:\/\//.test(t.from)||Ft(t.from)?this.file=t.from:this.file=Bt(t.from)),qt&&Gt){let e=new zt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Ut(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Wt(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Wt(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(_t&&(s.input.url=_t(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Vt])r=this[Vt];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Vt]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Bt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=Ft(a.source)?_t(a.source):new URL(a.source,this.map.consumer().sourceRoot||_t(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Lt)throw new Error("file: protocol is not available in this PostCSS build");l.file=Lt(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Yt=Zt;Zt.default=Zt,jt&&jt.registerInput&&jt.registerInput(Zt);let{SourceMapConsumer:Kt,SourceMapGenerator:Jt}=tt,{dirname:Ht,relative:Xt,resolve:$t,sep:Qt}=tt,{pathToFileURL:er}=tt,tr=Yt,rr=Boolean(Kt&&Jt),nr=Boolean(Ht&&$t&&Xt&&Qt);var sr=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(){let e;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(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Ht(e.file);!1===this.mapOpts.sourcesContent?(t=new Kt(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),nr&&rr&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Jt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Jt({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Jt({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}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;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Ht(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Ht($t(r,this.mapOpts.annotation)));let n=Xt(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new tr(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let 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){let t=this.memoizedFileURLs.get(e);if(t)return t;if(er){let t=er(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Qt&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let or=bt,ir=class extends or{constructor(e){super(e),this.type="comment"}};var ar=ir;ir.default=ir;let lr,cr,ur,hr,{isClean:dr,my:pr}=it,fr=It,mr=ar,gr=bt;function vr(e){return e.map((e=>(e.nodes&&(e.nodes=vr(e.nodes)),delete e.source,e)))}function yr(e){if(e[dr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)yr(t)}let wr=class e extends gr{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],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){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=vr(lr(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new fr(t)]}else if(t.selector)t=[new cr(t)];else if(t.name)t=[new ur(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new mr(t)]}return t.map((t=>(t[pr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[dr]&&yr(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}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]}};wr.registerParse=e=>{lr=e},wr.registerRule=e=>{cr=e},wr.registerAtRule=e=>{ur=e},wr.registerRoot=e=>{hr=e};var br=wr;wr.default=wr,wr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ur.prototype):"rule"===e.type?Object.setPrototypeOf(e,cr.prototype):"decl"===e.type?Object.setPrototypeOf(e,fr.prototype):"comment"===e.type?Object.setPrototypeOf(e,mr.prototype):"root"===e.type&&Object.setPrototypeOf(e,hr.prototype),e[pr]=!0,e.nodes&&e.nodes.forEach((e=>{wr.rebuild(e)}))};let Sr,Cr,Ir=br,kr=class extends Ir{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Sr(new Cr,this,e).stringify()}};kr.registerLazyResult=e=>{Sr=e},kr.registerProcessor=e=>{Cr=e};var xr=kr;kr.default=kr;let Or={};var Er=function(e){Or[e]||(Or[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Mr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let 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}for(let e in t)this[e]=t[e]}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}};var Rr=Mr;Mr.default=Mr;let Ar=Rr,Tr=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);let r=new Ar(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Pr=Tr;Tr.default=Tr;const Nr="'".charCodeAt(0),Dr='"'.charCodeAt(0),Lr="\\".charCodeAt(0),_r="/".charCodeAt(0),Fr="\n".charCodeAt(0),Br=" ".charCodeAt(0),Ur="\f".charCodeAt(0),jr="\t".charCodeAt(0),Wr="\r".charCodeAt(0),zr="[".charCodeAt(0),Vr="]".charCodeAt(0),Gr="(".charCodeAt(0),qr=")".charCodeAt(0),Zr="{".charCodeAt(0),Yr="}".charCodeAt(0),Kr=";".charCodeAt(0),Jr="*".charCodeAt(0),Hr=":".charCodeAt(0),Xr="@".charCodeAt(0),$r=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,en=/.[\r\n"'(/\\]/,tn=/[\da-f]/i;let rn=br,nn=class extends rn{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)}};var sn=nn;nn.default=nn,rn.registerAtRule(nn);let on,an,ln=br,cn=class extends ln{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new on(new an,this,e).stringify()}};cn.registerLazyResult=e=>{on=e},cn.registerProcessor=e=>{an=e};var un=cn;cn.default=cn,ln.registerRoot(cn);let hn={comma:e=>hn.split(e,[","],!0),space:e=>hn.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};var dn=hn;hn.default=hn;let pn=br,fn=dn,mn=class extends pn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return fn.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var gn=mn;mn.default=mn,pn.registerRule(mn);let vn=It,yn=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],v=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&m>=f},nextToken:function(e){if(v.length)return v.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Fr:case Br:case jr:case Wr:case Ur:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Br||r===Fr||r===jr||r===Wr||r===Ur);h=["space",d.slice(m,n)],m=n-1;break;case zr:case Vr:case Zr:case Yr:case Hr:case Kr:case qr:{let e=String.fromCharCode(r);h=[e,e,m];break}case Gr:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Nr&&u!==Dr&&u!==Br&&u!==Fr&&u!==jr&&u!==Ur&&u!==Wr){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===Lr;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||en.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Nr:case Dr:s=r===Nr?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===Lr;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Xr:$r.lastIndex=m+1,$r.test(d),n=0===$r.lastIndex?d.length-1:$r.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Lr:for(n=m,i=!0;d.charCodeAt(n+1)===Lr;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==_r&&r!==Br&&r!==Fr&&r!==jr&&r!==Wr&&r!==Ur&&(n+=1,tn.test(d.charAt(n)))){for(;tn.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Br&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===_r&&d.charCodeAt(m+1)===Jr?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Qr.lastIndex=m+1,Qr.test(d),n=0===Qr.lastIndex?d.length-1:Qr.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},wn=ar,bn=sn,Sn=un,Cn=gn;const In={empty:!0,space:!0};var kn=class{constructor(e){this.input=e,this.root=new Sn,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,s=new bn;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new wn;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=yn(this.input)}decl(e,t){let r=new vn;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=i.map((e=>e[1])).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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){let t=new Cn;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){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let 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=null,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);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&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!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 s,o,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",In[a]||In[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Cn;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&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let 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})}};let xn=br,On=kn,En=Yt;function Mn(e,t){let r=new En(e,t),n=new On(r);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}var Rn=Mn;Mn.default=Mn,xn.registerParse(Mn);let{isClean:An,my:Tn}=it,Pn=sr,Nn=dt,Dn=br,Ln=xr,_n=Er,Fn=Pr,Bn=Rn,Un=un;const jn={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Wn={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},zn={Once:!0,postcssPlugin:!0,prepare:!0};function Vn(e){return"object"==typeof e&&"function"==typeof e.then}function Gn(e){let t=!1,r=jn[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 qn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Gn(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Zn(e){return e[An]=!1,e.nodes&&e.nodes.forEach((e=>Zn(e))),e}let Yn={},Kn=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Fn)s=Zn(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Bn;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Tn]&&Dn.rebuild(s)}else s=Zn(r);this.result=new Fn(t,s,n),this.helpers={...Yn,postcss:Yn,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){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Wn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!zn[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Vn(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[An];){e[An]=!0;let t=[qn(e)];for(;t.length>0;){let e=this.visitTick(t);if(Vn(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return Vn(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Nn;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Pn(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(Vn(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[An];)e[An]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||_n("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(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Vn(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[An])return n[An]=!0,void e.push(qn(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[An]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[An]=!0;let t=Gn(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[An]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,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"}};Kn.registerPostcss=e=>{Yn=e};var Jn=Kn;Kn.default=Kn,Un.registerLazyResult(Kn),Ln.registerLazyResult(Kn);let Hn=sr,Xn=dt,$n=Er,Qn=Rn;const es=Pr;let ts=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Xn;this.result=new es(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Hn(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||$n("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=Qn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var rs=ts;ts.default=ts;let ns=rs,ss=Jn,os=xr,is=un,as=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let 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 this.plugins.length||t.parser||t.stringifier||t.syntax?new ss(this,e,t):new ns(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ls=as;as.default=as,is.registerProcessor(as),os.registerProcessor(as);let cs=It,us=Pt,hs=ar,ds=sn,ps=Yt,fs=un,ms=gn;function gs(e,t){if(Array.isArray(e))return e.map((e=>gs(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ps.prototype};r.map&&(r.map={...r.map,__proto__:us.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>gs(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new fs(n);if("decl"===n.type)return new cs(n);if("rule"===n.type)return new ms(n);if("comment"===n.type)return new hs(n);if("atrule"===n.type)return new ds(n);throw new Error("Unknown node type: "+e.type)}var vs=gs;gs.default=gs;let ys=ot,ws=It,bs=Jn,Ss=br,Cs=ls,Is=dt,ks=vs,xs=xr,Os=Rr,Es=ar,Ms=sn,Rs=Pr,As=Yt,Ts=Rn,Ps=dn,Ns=gn,Ds=un,Ls=bt;function _s(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Cs(e)}_s.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Cs).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return _s([s(r)]).process(e,t)},s},_s.stringify=Is,_s.parse=Ts,_s.fromJSON=ks,_s.list=Ps,_s.comment=e=>new Es(e),_s.atRule=e=>new Ms(e),_s.decl=e=>new ws(e),_s.rule=e=>new Ns(e),_s.root=e=>new Ds(e),_s.document=e=>new xs(e),_s.CssSyntaxError=ys,_s.Declaration=ws,_s.Container=Ss,_s.Processor=Cs,_s.Document=xs,_s.Comment=Es,_s.Warning=Os,_s.AtRule=Ms,_s.Result=Rs,_s.Input=As,_s.Rule=Ns,_s.Root=Ds,_s.Node=Ls,bs.registerPostcss(_s);var Fs=_s;_s.default=_s;const Bs=Je(Fs);Bs.stringify,Bs.fromJSON,Bs.plugin,Bs.parse,Bs.list,Bs.document,Bs.comment,Bs.atRule,Bs.rule,Bs.decl,Bs.root,Bs.CssSyntaxError,Bs.Declaration,Bs.Container,Bs.Processor,Bs.Document,Bs.Comment,Bs.Warning,Bs.AtRule,Bs.Result,Bs.Input,Bs.Rule,Bs.Root,Bs.Node;var Us=Object.defineProperty,js=(e,t,r)=>((e,t,r)=>t in e?Us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zs(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Vs={exports:{}},Gs=String,qs=function(){return{isColorSupported:!1,reset:Gs,bold:Gs,dim:Gs,italic:Gs,underline:Gs,inverse:Gs,hidden:Gs,strikethrough:Gs,black:Gs,red:Gs,green:Gs,yellow:Gs,blue:Gs,magenta:Gs,cyan:Gs,white:Gs,gray:Gs,bgBlack:Gs,bgRed:Gs,bgGreen:Gs,bgYellow:Gs,bgBlue:Gs,bgMagenta:Gs,bgCyan:Gs,bgWhite:Gs}};Vs.exports=qs(),Vs.exports.createColors=qs;var Zs=Vs.exports;const Ys=zs(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ks=Zs,Js=Ys,Hs=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?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=Ks.isColorSupported),Js&&e&&(t=Js(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Ks.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map(((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Xs=Hs;Hs.default=Hs;var $s={};$s.isClean=Symbol("isClean"),$s.my=Symbol("my");const Qs={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let eo=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;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");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||r)}}comment(e){let 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&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Qs[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var i;return void 0===n&&(n=Qs[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}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&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.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)}};var to=eo;eo.default=eo;let ro=to;function no(e,t){new ro(t).stringify(e)}var so=no;no.default=no;let{isClean:oo,my:io}=$s,ao=Xs,lo=to,co=so;function uo(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map((e=>uo(e,r))):("object"===o&&null!==s&&(s=uo(s)),r[n]=s)}return r}let ho=class{constructor(e={}){this.raws={},this[oo]=!1,this[io]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let 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={}){let t=uo(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new ao(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[oo]){this[oo]=!1;let e=this;for(;e=e.parent;)e[oo]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return 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};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else 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));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new lo).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=co){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var po=ho;ho.default=ho;let fo=po,mo=class extends fo{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var go=mo;mo.default=mo;var vo={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:yo,SourceMapGenerator:wo}=Ys,{existsSync:bo,readFileSync:So}=Ys,{dirname:Co,join:Io}=Ys;let ko=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Co(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new yo(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Co(e),bo(e))return this.mapFile=e,So(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof yo)return wo.fromSourceMap(t).toString();if(t instanceof wo)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Io(Co(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var xo=ko;ko.default=ko;let{SourceMapConsumer:Oo,SourceMapGenerator:Eo}=Ys,{fileURLToPath:Mo,pathToFileURL:Ro}=Ys,{isAbsolute:Ao,resolve:To}=Ys,{nanoid:Po}=vo,No=Ys,Do=Xs,Lo=xo,_o=Symbol("fromOffsetCache"),Fo=Boolean(Oo&&Eo),Bo=Boolean(To&&Ao),Uo=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(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&&(!Bo||/^\w+:\/\//.test(t.from)||Ao(t.from)?this.file=t.from:this.file=To(t.from)),Bo&&Fo){let e=new Lo(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Po(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Do(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Do(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Ro&&(s.input.url=Ro(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[_o])r=this[_o];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[_o]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+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 s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=Ao(a.source)?Ro(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ro(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Mo)throw new Error("file: protocol is not available in this PostCSS build");l.file=Mo(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var jo=Uo;Uo.default=Uo,No&&No.registerInput&&No.registerInput(Uo);let{SourceMapConsumer:Wo,SourceMapGenerator:zo}=Ys,{dirname:Vo,relative:Go,resolve:qo,sep:Zo}=Ys,{pathToFileURL:Yo}=Ys,Ko=jo,Jo=Boolean(Wo&&zo),Ho=Boolean(Vo&&qo&&Go&&Zo);var Xo=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(){let e;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(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Vo(e.file);!1===this.mapOpts.sourcesContent?(t=new Wo(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ho&&Jo&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=zo.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new zo({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new zo({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}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;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Vo(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Vo(qo(r,this.mapOpts.annotation)));let n=Go(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Ko(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let 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){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Yo){let t=Yo(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Zo&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let $o=po,Qo=class extends $o{constructor(e){super(e),this.type="comment"}};var ei=Qo;Qo.default=Qo;let ti,ri,ni,si,{isClean:oi,my:ii}=$s,ai=go,li=ei,ci=po;function ui(e){return e.map((e=>(e.nodes&&(e.nodes=ui(e.nodes)),delete e.source,e)))}function hi(e){if(e[oi]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)hi(t)}let di=class e extends ci{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],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){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=ui(ti(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new ai(t)]}else if(t.selector)t=[new ri(t)];else if(t.name)t=[new ni(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new li(t)]}return t.map((t=>(t[ii]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[oi]&&hi(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}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]}};di.registerParse=e=>{ti=e},di.registerRule=e=>{ri=e},di.registerAtRule=e=>{ni=e},di.registerRoot=e=>{si=e};var pi=di;di.default=di,di.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ni.prototype):"rule"===e.type?Object.setPrototypeOf(e,ri.prototype):"decl"===e.type?Object.setPrototypeOf(e,ai.prototype):"comment"===e.type?Object.setPrototypeOf(e,li.prototype):"root"===e.type&&Object.setPrototypeOf(e,si.prototype),e[ii]=!0,e.nodes&&e.nodes.forEach((e=>{di.rebuild(e)}))};let fi,mi,gi=pi,vi=class extends gi{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new fi(new mi,this,e).stringify()}};vi.registerLazyResult=e=>{fi=e},vi.registerProcessor=e=>{mi=e};var yi=vi;vi.default=vi;let wi={};var bi=function(e){wi[e]||(wi[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Si=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let 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}for(let e in t)this[e]=t[e]}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}};var Ci=Si;Si.default=Si;let Ii=Ci,ki=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);let r=new Ii(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var xi=ki;ki.default=ki;const Oi="'".charCodeAt(0),Ei='"'.charCodeAt(0),Mi="\\".charCodeAt(0),Ri="/".charCodeAt(0),Ai="\n".charCodeAt(0),Ti=" ".charCodeAt(0),Pi="\f".charCodeAt(0),Ni="\t".charCodeAt(0),Di="\r".charCodeAt(0),Li="[".charCodeAt(0),_i="]".charCodeAt(0),Fi="(".charCodeAt(0),Bi=")".charCodeAt(0),Ui="{".charCodeAt(0),ji="}".charCodeAt(0),Wi=";".charCodeAt(0),zi="*".charCodeAt(0),Vi=":".charCodeAt(0),Gi="@".charCodeAt(0),qi=/[\t\n\f\r "#'()/;[\\\]{}]/g,Zi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Yi=/.[\r\n"'(/\\]/,Ki=/[\da-f]/i;let Ji=pi,Hi=class extends Ji{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)}};var Xi=Hi;Hi.default=Hi,Ji.registerAtRule(Hi);let $i,Qi,ea=pi,ta=class extends ea{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new $i(new Qi,this,e).stringify()}};ta.registerLazyResult=e=>{$i=e},ta.registerProcessor=e=>{Qi=e};var ra=ta;ta.default=ta,ea.registerRoot(ta);let na={comma:e=>na.split(e,[","],!0),space:e=>na.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};var sa=na;na.default=na;let oa=pi,ia=sa,aa=class extends oa{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ia.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var la=aa;aa.default=aa,oa.registerRule(aa);let ca=go,ua=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],v=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&m>=f},nextToken:function(e){if(v.length)return v.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Ai:case Ti:case Ni:case Di:case Pi:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Ti||r===Ai||r===Ni||r===Di||r===Pi);h=["space",d.slice(m,n)],m=n-1;break;case Li:case _i:case Ui:case ji:case Vi:case Wi:case Bi:{let e=String.fromCharCode(r);h=[e,e,m];break}case Fi:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Oi&&u!==Ei&&u!==Ti&&u!==Ai&&u!==Ni&&u!==Pi&&u!==Di){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===Mi;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||Yi.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Oi:case Ei:s=r===Oi?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===Mi;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Gi:qi.lastIndex=m+1,qi.test(d),n=0===qi.lastIndex?d.length-1:qi.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Mi:for(n=m,i=!0;d.charCodeAt(n+1)===Mi;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Ri&&r!==Ti&&r!==Ai&&r!==Ni&&r!==Di&&r!==Pi&&(n+=1,Ki.test(d.charAt(n)))){for(;Ki.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Ti&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Ri&&d.charCodeAt(m+1)===zi?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Zi.lastIndex=m+1,Zi.test(d),n=0===Zi.lastIndex?d.length-1:Zi.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},ha=ei,da=Xi,pa=ra,fa=la;const ma={empty:!0,space:!0};var ga=class{constructor(e){this.input=e,this.root=new pa,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,s=new da;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new ha;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=ua(this.input)}decl(e,t){let r=new ca;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=i.map((e=>e[1])).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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){let t=new fa;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){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let 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=null,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);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&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!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 s,o,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",ma[a]||ma[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new fa;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&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let 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})}};let va=pi,ya=ga,wa=jo;function ba(e,t){let r=new wa(e,t),n=new ya(r);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}var Sa=ba;ba.default=ba,va.registerParse(ba);let{isClean:Ca,my:Ia}=$s,ka=Xo,xa=so,Oa=pi,Ea=yi,Ma=bi,Ra=xi,Aa=Sa,Ta=ra;const Pa={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Na={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},Da={Once:!0,postcssPlugin:!0,prepare:!0};function La(e){return"object"==typeof e&&"function"==typeof e.then}function _a(e){let t=!1,r=Pa[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 Fa(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:_a(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ba(e){return e[Ca]=!1,e.nodes&&e.nodes.forEach((e=>Ba(e))),e}let Ua={},ja=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Ra)s=Ba(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Aa;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Ia]&&Oa.rebuild(s)}else s=Ba(r);this.result=new Ra(t,s,n),this.helpers={...Ua,postcss:Ua,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){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Na[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Da[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(La(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ca];){e[Ca]=!0;let t=[Fa(e)];for(;t.length>0;){let e=this.visitTick(t);if(La(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return La(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=xa;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ka(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(La(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ca];)e[Ca]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Ma("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(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(La(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[Ca])return n[Ca]=!0,void e.push(Fa(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Ca]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ca]=!0;let t=_a(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[Ca]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,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"}};ja.registerPostcss=e=>{Ua=e};var Wa=ja;ja.default=ja,Ta.registerLazyResult(ja),Ea.registerLazyResult(ja);let za=Xo,Va=so,Ga=bi,qa=Sa;const Za=xi;let Ya=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Va;this.result=new Za(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new za(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||Ga("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=qa;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Ka=Ya;Ya.default=Ya;let Ja=Ka,Ha=Wa,Xa=yi,$a=ra,Qa=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let 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 this.plugins.length||t.parser||t.stringifier||t.syntax?new Ha(this,e,t):new Ja(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var el=Qa;Qa.default=Qa,$a.registerProcessor(Qa),Xa.registerProcessor(Qa);let tl=go,rl=xo,nl=ei,sl=Xi,ol=jo,il=ra,al=la;function ll(e,t){if(Array.isArray(e))return e.map((e=>ll(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ol.prototype};r.map&&(r.map={...r.map,__proto__:rl.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>ll(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new il(n);if("decl"===n.type)return new tl(n);if("rule"===n.type)return new al(n);if("comment"===n.type)return new nl(n);if("atrule"===n.type)return new sl(n);throw new Error("Unknown node type: "+e.type)}var cl=ll;ll.default=ll;let ul=Xs,hl=go,dl=Wa,pl=pi,fl=el,ml=so,gl=cl,vl=yi,yl=Ci,wl=ei,bl=Xi,Sl=xi,Cl=jo,Il=Sa,kl=sa,xl=la,Ol=ra,El=po;function Ml(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new fl(e)}Ml.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new fl).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Ml([s(r)]).process(e,t)},s},Ml.stringify=ml,Ml.parse=Il,Ml.fromJSON=gl,Ml.list=kl,Ml.comment=e=>new wl(e),Ml.atRule=e=>new bl(e),Ml.decl=e=>new hl(e),Ml.rule=e=>new xl(e),Ml.root=e=>new Ol(e),Ml.document=e=>new vl(e),Ml.CssSyntaxError=ul,Ml.Declaration=hl,Ml.Container=pl,Ml.Processor=fl,Ml.Document=vl,Ml.Comment=wl,Ml.Warning=yl,Ml.AtRule=bl,Ml.Result=Sl,Ml.Input=Cl,Ml.Rule=xl,Ml.Root=Ol,Ml.Node=El,dl.registerPostcss(Ml);var Rl=Ml;Ml.default=Ml;const Al=Ws(Rl);Al.stringify,Al.fromJSON,Al.plugin,Al.parse,Al.list,Al.document,Al.comment,Al.atRule,Al.rule,Al.decl,Al.root,Al.CssSyntaxError,Al.Declaration,Al.Container,Al.Processor,Al.Document,Al.Comment,Al.Warning,Al.AtRule,Al.Result,Al.Input,Al.Rule,Al.Root,Al.Node;class Tl{constructor(...e){js(this,"parentElement",null),js(this,"parentNode",null),js(this,"ownerDocument"),js(this,"firstChild",null),js(this,"lastChild",null),js(this,"previousSibling",null),js(this,"nextSibling",null),js(this,"ELEMENT_NODE",1),js(this,"TEXT_NODE",3),js(this,"nodeType"),js(this,"nodeName"),js(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Tl))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Pl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Nl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Dl={};function Ll(e){if(Dl[e])return Dl[e];const t=globalThis[e],r=t.prototype,n=e in Pl?Pl[e]:void 0,s=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Nl?Nl[e]:void 0,i=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(s&&i&&!globalThis.Zone)return Dl[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?Dl[e]=o:r}catch{return r}}const _l={};function Fl(e,t,r){var n;const s=`${e}.${String(r)}`;if(_l[s])return _l[s].call(t);const o=Ll(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(_l[s]=i,i.call(t)):t[r]}const Bl={};function Ul(e,t,r){const n=`${e}.${String(r)}`;if(Bl[n])return Bl[n].bind(t);const s=Ll(e)[r];return"function"!=typeof s?t[r]:(Bl[n]=s,s.bind(t))}function jl(){return Ll("MutationObserver").constructor}const Wl={childNodes:function(e){return Fl("Node",e,"childNodes")},parentNode:function(e){return Fl("Node",e,"parentNode")},parentElement:function(e){return Fl("Node",e,"parentElement")},textContent:function(e){return Fl("Node",e,"textContent")},contains:function(e,t){return Ul("Node",e,"contains")(t)},getRootNode:function(e){return Ul("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Fl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Fl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Fl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Fl("Element",e,"querySelectorAll")(t)},mutationObserver:jl};function zl(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Vl="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Gl={map:{},getId:()=>(console.error(Vl),-1),getNode:()=>(console.error(Vl),null),removeNodeFromMap(){console.error(Vl)},has:()=>(console.error(Vl),!1),reset(){console.error(Vl)}};function ql(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}}function Zl(e,t,r,n,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>Zl(e,t,o||{},!0)}function Yl(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Gl=new Proxy(Gl,{get:(e,t,r)=>("map"===t&&console.error(Vl),Reflect.get(e,t,r))}));let Kl=Date.now;function Jl(e){var t,r,n,s;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Wl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Wl.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function Hl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Xl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function $l(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Wl.parentElement(e)}function Ql(e,t,r,n){if(!e)return!1;const s=$l(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(Ge(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function ec(e,t){return-1!==t.getId(e)}function tc(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function rc(e,t){if(pe(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Wl.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||rc(n,t))}function nc(e){return Boolean(e.changedTouches)}function sc(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function oc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ic(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ac(e){return!!e&&(e instanceof Tl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Wl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Kl=()=>(new Date).getTime());class lc{constructor(){Q(this,"id",1),Q(this,"styleIDMap",new WeakMap),Q(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 cc(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Wl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wl.host(Wl.getRootNode(e))&&(r=Wl.host(Wl.getRootNode(e))),r}function uc(e){let t,r=e;for(;t=cc(r);)r=t;return r}function hc(e){const t=e.ownerDocument;if(!t)return!1;const r=uc(e);return Wl.contains(t,r)}function dc(e){const t=e.ownerDocument;return!!t&&(Wl.contains(t,e)||hc(e))}const pc=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:lc,get _mirror(){return Gl},closestElementOfNode:$l,getBaseDimension:function e(t,r){var n,s;const o=null==(s=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:s.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=e(o,r),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:uc,getShadowHost:cc,getWindowHeight:Hl,getWindowScroll:Jl,getWindowWidth:Xl,hasShadowRoot:ac,hookSetter:Zl,inDom:dc,isAncestorRemoved:rc,isBlocked:Ql,isIgnored:tc,isSerialized:ec,isSerializedIframe:oc,isSerializedStylesheet:ic,iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:nc,get nowTimestamp(){return Kl},on:zl,patch:Yl,polyfill:sc,queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const s of e){const{nextId:e,parentId:o}=s;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(s,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(s,null))}}else if(o in t){const e=t[o];e.children.push(r(s,e))}else n.push(r(s,null))}return n},shadowHostInDom:hc,throttle:ql,uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}},Symbol.toStringTag,{value:"Module"}));var fc=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(fc||{}),mc=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(mc||{}),gc=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(gc||{}),vc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(vc||{}),yc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(yc||{}),wc=(e=>(e[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))(wc||{}),bc=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(bc||{});function Sc(e){return"__ln"in e}class Cc{constructor(){Q(this,"length",0),Q(this,"head",null),Q(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Sc(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Sc(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Ic=(e,t)=>`${e}@${t}`;class kc{constructor(){Q(this,"frozen",!1),Q(this,"locked",!1),Q(this,"texts",[]),Q(this,"attributes",[]),Q(this,"attributeMap",new WeakMap),Q(this,"removes",[]),Q(this,"mapRemoves",[]),Q(this,"movedMap",{}),Q(this,"addedSet",new Set),Q(this,"movedSet",new Set),Q(this,"droppedSet",new Set),Q(this,"removesSubTreeCache",new Set),Q(this,"mutationCb"),Q(this,"blockClass"),Q(this,"blockSelector"),Q(this,"maskTextClass"),Q(this,"maskTextSelector"),Q(this,"inlineStylesheet"),Q(this,"maskInputOptions"),Q(this,"maskTextFn"),Q(this,"maskInputFn"),Q(this,"keepIframeSrcFn"),Q(this,"recordCanvas"),Q(this,"inlineImages"),Q(this,"slimDOMOptions"),Q(this,"dataURLOptions"),Q(this,"doc"),Q(this,"mirror"),Q(this,"iframeManager"),Q(this,"stylesheetManager"),Q(this,"shadowDomManager"),Q(this,"canvasManager"),Q(this,"processedNodeManager"),Q(this,"unattachedDoc"),Q(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),Q(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Cc,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const o=Wl.parentNode(s);if(!o||!dc(s))return;let i=!1;if(s.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=pe(o)?this.mirror.getId(cc(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Ke(s,{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=>{oc(e,this.mirror)&&this.iframeManager.addIframe(e),ic(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ac(s)&&this.shadowDomManager.addShadowRoot(Wl.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Oc(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Wl.parentNode(e))||s(e);for(const e of this.addedSet)Ec(this.droppedSet,e)||Oc(this.removesSubTreeCache,e,this.mirror)?Ec(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(Wl.parentNode(o.value)),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(Wl.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Wl.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Wl.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),s(e.value)}const i={texts:this.texts.map((e=>{const t=e.node,r=Wl.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.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(i))})),Q(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));const r=Array.from(Wl.childNodes(e),(e=>Wl.textContent(e)||"")).join("");t.attributes.value=ye({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Se(e),value:r,maskInputFn:this.maskInputFn})})),Q(this,"processMutation",(e=>{if(!tc(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Wl.textContent(e.target);Ql(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:qe(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,$l(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=Se(t);n=ye({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Ql(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Ve(t.tagName,r))if(s.attributes[r]=ze(this.doc,we(t.tagName),we(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===o?n:[n,o]:s._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":if(Ql(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=pe(e.target)?this.mirror.getId(Wl.host(e.target)):this.mirror.getId(e.target);Ql(e.target,this.blockClass,this.blockSelector,!1)||tc(t,this.mirror,this.slimDOMOptions)||!ec(t,this.mirror)||(this.addedSet.has(t)?(xc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||rc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ic(r,n)]?xc(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!pe(e.target)||!fe(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Wl.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),Q(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(tc(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ic(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ql(e,this.blockClass,this.blockSelector,!1)||(Wl.childNodes(e).forEach((e=>this.genAdds(e))),ac(e)&&Wl.childNodes(Wl.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function xc(e,t){e.delete(t),Wl.childNodes(t).forEach((t=>xc(e,t)))}function Oc(e,t,r){return 0!==e.size&&function(e,t){const r=Wl.parentNode(t);return!!r&&e.has(r)}(e,t)}function Ec(e,t){return 0!==e.size&&Mc(e,t)}function Mc(e,t){const r=Wl.parentNode(t);return!!r&&(!!e.has(r)||Mc(e,r))}let Rc;const Ac=e=>{if(!Rc)return e;return(...t)=>{try{return e(...t)}catch(e){if(Rc&&!0===Rc(e))return;throw e}}};function Tc(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Pc=[];function Nc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Dc(e,t){const r=new kc;Pc.push(r),r.init(e);const n=new(jl())(Ac(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Lc({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(gc).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((o=>{let i=we(o);const c=(t=>o=>{const i=Nc(o);if(Ql(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=vc.Mouse;break;case"touch":a=vc.Touch;break;case"pen":a=vc.Pen}a===vc.Touch?gc[t]===gc.MouseDown?c="TouchStart":gc[t]===gc.MouseUp&&(c="TouchEnd"):vc.Pen}else nc(o)&&(a=vc.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===vc.Touch||c.startsWith("Mouse")&&a===vc.Mouse)&&(a=null)):gc[t]===gc.Click&&(a=l,l=null);const u=nc(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;Ac(e)({type:gc[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(gc[o]){case gc.MouseDown:case gc.MouseUp:i=i.replace("mouse","pointer");break;case gc.TouchStart:case gc.TouchEnd:return}a.push(zl(i,c,t))})),Ac((()=>{a.forEach((e=>e()))}))}function _c({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=Ac(ql(Ac((o=>{const i=Nc(o);if(!i||Ql(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Jl(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})})),o.scroll||100));return zl("scroll",i,t)}const Fc=["INPUT","TEXTAREA","SELECT"],Bc=new WeakMap;function Uc(e){return function(e,t){if(Vc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Vc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Vc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Vc("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function jc(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Wc({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Wl.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(s=r.ownerDocument)?void 0:s.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const n=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return n}}),Ac((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function zc(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),s(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Dc(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=ql(Ac((t=>{const r=Date.now()-i;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],i=null})),o),c=Ac(ql(Ac((e=>{const t=Nc(e),{clientX:r,clientY:s}=nc(e)?e.changedTouches[0]:e;i||(i=Kl()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Kl()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?mc.Drag:e instanceof MouseEvent?mc.MouseMove:mc.TouchMove)})),s,{trailing:!1})),u=[zl("mousemove",c,r),zl("touchmove",c,r),zl("drag",c,r)];return Ac((()=>{u.forEach((e=>e()))}))}(e),o=Lc(e),i=_c(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return zl("resize",Ac(ql(Ac((()=>{const t=Hl(),s=Xl();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)})),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=Nc(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Wl.parentElement(r)),!r||!h||Fc.indexOf(h)<0||Ql(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=Se(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=ye({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach((e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function d(t,n){const s=Bc.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Bc.set(t,n);const s=r.getId(t);Ac(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map((e=>zl(e,Ac(h),t))),f=t.defaultView;if(!f)return()=>{p.forEach((e=>e()))};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map((e=>Zl(e[0],e[1],{set(){Ac(h)({target:this,isTrusted:!1})}},!1,f)))),Ac((()=>{p.forEach((e=>e()))}))}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=Ac((o=>ql(Ac((s=>{const i=Nc(s);if(!i||Ql(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=i;e({type:o,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})})),s.media||500))),a=[zl("play",i(wc.Play),o),zl("pause",i(wc.Pause),o),zl("seeked",i(wc.Seeked),o),zl("volumechange",i(wc.VolumeChange),o),zl("ratechange",i(wc.RateChange),o)];return Ac((()=>{a.forEach((e=>e()))}))}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ac(((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=jc(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),Tc((()=>n.apply(s,o)))()}))}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ac(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=jc(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),Tc((()=>n.apply(s,o)))()}))}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ac(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=jc(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),n.apply(s,o)}))})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ac(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=jc(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)}))}));const l={};Gc("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Gc("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Gc("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Gc("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach((([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:Ac(((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=jc(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Uc(s),a||0]}]}),n.apply(s,o)}))}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:Ac(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=jc(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Uc(s),i]}]}),n.apply(s,o)}))})})),Ac((()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}))}(e,{win:r}),h=Wc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ac(((s,i,a)=>{var l;const[c,u,h]=a;if(r.has(c))return o.apply(i,[c,u,h]);const{id:d,styleId:p}=jc(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:Uc(i.parentRule)}),s.apply(i,a)}))});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Ac(((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=jc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:Uc(o.parentRule)}),s.apply(o,a)}))}),Ac((()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i}))}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=Yl(t.fonts,"add",(function(t){return function(r){return setTimeout(Ac((()=>{const t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=o})),n.push(i),Ac((()=>{n.forEach((e=>e()))}))}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e;let i=!0;const a=Ac((()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=o;Ql(i,n,s,!0)||Ql(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})}));return a(),zl("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Yl(r.customElements,"define",(function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}})):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return Ac((()=>{Pc.forEach((e=>e.reset())),null==n||n.disconnect(),s(),o(),i(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach((e=>e()))}))}function Vc(e){return void 0!==window[e]}function Gc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class qc{constructor(e){Q(this,"iframeIdToRemoteIdMap",new WeakMap),Q(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=n.get(t);return s||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Zc{constructor(e){Q(this,"iframes",new WeakMap),Q(this,"crossOriginIframeMap",new WeakMap),Q(this,"crossOriginIframeMirror",new qc(Ne)),Q(this,"crossOriginIframeStyleMirror"),Q(this,"crossOriginIframeRootIdMap",new WeakMap),Q(this,"mirror"),Q(this,"mutationCb"),Q(this,"wrappedEmit"),Q(this,"loadListener"),Q(this,"stylesheetManager"),Q(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new qc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case fc.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:fc.IncrementalSnapshot,data:{source:mc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case fc.Meta:case fc.Load:case fc.DomContentLoaded:return!1;case fc.Plugin:return t;case fc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case fc.IncrementalSnapshot:switch(t.data.source){case mc.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case mc.Drag:case mc.TouchMove:case mc.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case mc.ViewportResize:return!1;case mc.MediaInteraction:case mc.MouseInteraction:case mc.Scroll:case mc.CanvasMutation:case mc.Input:return this.replaceIds(t.data,e,["id"]),t;case mc.StyleSheetRule:case mc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case mc.Font:return t;case mc.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case mc.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(const s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));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===bc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Yc{constructor(e){Q(this,"shadowDoms",new WeakSet),Q(this,"mutationCb"),Q(this,"scrollCb"),Q(this,"bypassOptions"),Q(this,"mirror"),Q(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(e,t){if(!fe(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Dc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(_c({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Wl.host(e))),this.restoreHandlers.push(Wc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Yl(e.prototype,"attachShadow",(function(e){return function(n){const s=e.call(this,n),o=Wl.shadowRoot(this);return o&&dc(this)&&r.addShadowRoot(o,t),s}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Kc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Hc=0;Hc<64;Hc++)Jc[Kc.charCodeAt(Hc)]=Hc;const Xc=new Map;const $c=(e,t,r)=>{if(!e||!tu(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=Xc.get(e);return r||(r=new Map,Xc.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Qc(e,t,r){if(e instanceof Array)return e.map((e=>Qc(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,s="";for(t=0;t<n;t+=3)s+=Kc[r[t]>>2],s+=Kc[(3&r[t])<<4|r[t+1]>>4],s+=Kc[(15&r[t+1])<<2|r[t+2]>>6],s+=Kc[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Qc(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Qc(e.data,t,r),e.width,e.height]}}if(tu(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:$c(e,t,r)}}return e}const eu=(e,t,r)=>e.map((e=>Qc(e,t,r))),tu=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function ru(e,t,r,n){const s=[];try{const o=Yl(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(s,...o){if(!Ql(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[s,...o])}}));s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((e=>e()))}}function nu(e,t,r,n,s,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Yl(e,l,(function(e){return function(...i){const a=e.apply(this,i);if($c(a,o,this),"tagName"in this.canvas&&!Ql(this.canvas,n,s,!0)){const e=eu(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));i.push(a)}catch{const n=Zl(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const su="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ou="undefined"!=typeof window&&window.Blob&&new Blob([(iu=su,Uint8Array.from(atob(iu),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var iu;function au(e){let t;try{if(t=ou&&(window.URL||window.webkitURL).createObjectURL(ou),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+su,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class lu{constructor(e){Q(this,"pendingCanvasMutations",new Map),Q(this,"rafStamps",{latestId:0,invokeId:null}),Q(this,"mirror"),Q(this,"mutationCb"),Q(this,"resetObservers"),Q(this,"frozen",!1),Q(this,"locked",!1),Q(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:r,blockClass:n,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,s){const o=ru(t,r,n,!0),i=new Map,a=new au;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:o}=e.data;this.mutationCb({id:t,type:yc["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{Ql(t,r,n,!0)||e.push(t)})),e})().forEach((async e=>{var t;const r=this.mirror.getId(e);if(i.get(r))return;if(0===e.width||0===e.height)return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[n])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=ru(e,t,r,!1),s=function(e,t,r,n){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=Yl(t.CanvasRenderingContext2D.prototype,i,(function(s){return function(...o){return Ql(this.canvas,r,n,!0)||setTimeout((()=>{const r=eu(o,t,this);e(this.canvas,{type:yc["2D"],property:i,args:r})}),0),s.apply(this,o)}}));s.push(o)}catch{const r=Zl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:yc["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const s=[];return s.push(...nu(t.WebGLRenderingContext.prototype,yc.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...nu(t.WebGL2RenderingContext.prototype,yc.WebGL2,e,r,n,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const{type:t,...r}=e;return r})),{type:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class cu{constructor(e){Q(this,"trackedLinkElements",new WeakSet),Q(this,"mutationCb"),Q(this,"adoptedStyleSheetCb"),Q(this,"styleMirror",new lc),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ge(e,t.href),index:r})))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class uu{constructor(){Q(this,"nodeMap",new WeakMap),Q(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).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 hu,du,pu,fu=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(z=e.contentWindow)?void 0:z.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const mu=new ve;function gu(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:v,sampling:y={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:T,applyBackgroundColorToBlockedElements:P=!1}=e;Rc=T;const N=!I||window.parent===window;let D=!1;if(!N)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!D)return()=>{};void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),mu.reset();const L=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},_=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;sc();let B=0;const U=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!D&&(e=v(e)),e};hu=(e,s)=>{var o;const i=e;if(i.timestamp=Kl(),!(null==(o=Pc[0])?void 0:o.isFrozen())||i.type===fc.FullSnapshot||i.type===fc.IncrementalSnapshot&&i.data.source===mc.Mutation||Pc.forEach((e=>e.unfreeze())),N)null==t||t(U(i),s);else if(D){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===fc.FullSnapshot)F=i,B=0;else if(i.type===fc.IncrementalSnapshot){if(i.data.source===mc.Mutation&&i.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&i.timestamp-F.timestamp>r;(e||t)&&du(!0)}};const j=e=>{hu({type:fc.IncrementalSnapshot,data:{source:mc.Mutation,...e}})},W=e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.Scroll,...e}}),z=e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.CanvasMutation,...e}}),V=new cu({mutationCb:j,adoptedStyleSheetCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.AdoptedStyleSheet,...e}})}),G=new Zc({mirror:mu,mutationCb:j,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:hu});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:mu,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const q=new uu;pu=new lu({recordCanvas:C,mutationCb:z,win:window,blockClass:s,blockSelector:o,mirror:mu,sampling:y.canvas,dataURLOptions:w});const Z=new Yc({mutationCb:j,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:y,slimDOMOptions:_,iframeManager:G,stylesheetManager:V,canvasManager:pu,keepIframeSrcFn:R,processedNodeManager:q},mirror:mu});du=(e=!1)=>{if(!S)return;hu({type:fc.Meta,data:{href:window.location.href,width:Xl(),height:Hl()}},e),V.reset(),Z.init(),Pc.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new ve,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return Ke(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:mu,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:m,maskInputFn:f,slimDOM:_,dataURLOptions:w,recordCanvas:C,inlineImages:E,applyBackgroundColorToBlockedElements:P,onSerialize:e=>{oc(e,mu)&&G.addIframe(e),ic(e,mu)&&V.trackLinkElement(e),ac(e)&&Z.addShadowRoot(Wl.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");hu({type:fc.FullSnapshot,data:{node:t,initialOffset:Jl(window)}},e),Pc.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,mu.getId(document))};try{const e=[],t=e=>{var t;return Ac(zc)({mutationCb:j,mousemoveCb:(e,t)=>hu({type:fc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.ViewportResize,...e}}),inputCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.Input,...e}}),mediaInteractionCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.MediaInteraction,...e}}),styleSheetRuleCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.StyleSheetRule,...e}}),styleDeclarationCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>hu({type:fc.IncrementalSnapshot,data:{source:mc.Font,...e}}),selectionCb:e=>{hu({type:fc.IncrementalSnapshot,data:{source:mc.Selection,...e}})},customElementCb:e=>{hu({type:fc.IncrementalSnapshot,data:{source:mc.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:x,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:_,dataURLOptions:w,mirror:mu,iframeManager:G,stylesheetManager:V,shadowDomManager:Z,processedNodeManager:q,canvasManager:pu,ignoreCSSAttributes:A,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>hu({type:fc.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},g)};G.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{du(),e.push(t(document)),fu=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(zl("DOMContentLoaded",(()=>{hu({type:fc.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()}))),e.push(zl("load",(()=>{hu({type:fc.Load,data:{}}),"load"===k&&r()}),window))),()=>{e.forEach((e=>e())),q.destroy(),fu=!1,Rc=void 0}}catch(e){console.warn(e)}}var vu,yu;gu.addCustomEvent=(e,t)=>{if(!fu)throw new Error("please add custom event after start recording");hu({type:fc.Custom,data:{tag:e,payload:t}})},gu.freezePage=()=>{Pc.forEach((e=>e.freeze()))},gu.takeFullSnapshot=e=>{if(!fu)throw new Error("please take full snapshot after start recording");du(e)},gu.mirror=mu,(yu=vu||(vu={}))[yu.NotStarted=0]="NotStarted",yu[yu.Running=1]="Running",yu[yu.Stopped=2]="Stopped";var wu,bu,Su=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Su||{}),Cu=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Cu||{});!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(wu||(wu={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(bu||(bu={}));var Iu=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,h,d,p,f,m,g,v,y,w,b,S,C;if("object"!=typeof e)return null;var I=e.code||0,k=this.buildStatus(I);switch(k){case bu.Success:return{status:k,statusCode:I,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case bu.Invalid:return{status:k,statusCode:I,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(i=e.events_with_invalid_fields)&&void 0!==i?i:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case bu.PayloadTooLarge:return{status:k,statusCode:I,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case bu.RateLimit:return{status:k,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(b=e.exceeded_daily_quota_devices)&&void 0!==b?b:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case bu.Timeout:default:return{status:k,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?bu.Success:429===e?bu.RateLimit:413===e?bu.PayloadTooLarge:408===e?bu.Timeout:e>=400&&e<500?bu.Invalid:e>=500?bu.Failed:bu.Unknown},e}(),ku="Remote config fetch rejected due to timeout after 5 seconds",xu="Unexpected error occurred",Ou=function(){function e(e){var t=e.localConfig,i=e.configKeys,a=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,r){return n(a,void 0,void 0,(function(){var n,o,i;return s(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(o=s.sent())&&(i=o.configs&&o.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,i[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return n(a,void 0,void 0,(function(){var t,r,n;return s(this,(function(s){switch(s.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=s.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return n(a,void 0,void 0,(function(){var n,i,a,l,c,u,h,d,p,f,m,g;return s(this,(function(s){switch(s.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:ku})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),s.label=1;case 1:s.trys.push([1,3,,4]),n=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(i=o(this.configKeys),a=i.next();!a.done;a=i.next())l=a.value,n.append("config_keys",l)}catch(e){f={error:e}}finally{try{a&&!a.done&&(m=i.return)&&m.call(i)}finally{if(f)throw f.error}}return t&&n.set("session_id",String(t)),c={headers:{Accept:"*/*"},method:"GET"},u="".concat(this.getServerUrl(),"?").concat(n.toString()),this.attempts+=1,[4,fetch(u,r(r({},c),{signal:e}))];case 2:if(null===(h=s.sent()))return[2,this.completeRequest({err:xu})];switch((new Iu).buildStatus(h.status)){case bu.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case bu.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=s.sent(),p=d,e.aborted?[2,this.completeRequest({err:ku})]:[2,this.completeRequest({err:null!==(g=p.message)&&void 0!==g?g:xu})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return n(a,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(e){return setTimeout(e,r.attempts*r.retryTimeout)}))];case 1:return n.sent(),[2,this.fetchRemoteConfig(e,t)]}}))}))},this.parseAndStoreConfig=function(e){return n(a,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return t=r.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}}))}))},this.localConfig=t,this.configKeys=i}return e.prototype.getServerUrl=function(){return this.localConfig.configServerUrl?this.localConfig.configServerUrl:this.localConfig.serverZone===wu.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===wu.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,r=e.success;if(t)throw new Error(t);r&&this.localConfig.loggerProvider.log(r)},e}(),Eu=function(e){var t=e.localConfig,r=e.configKeys;return n(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,new Ou({localConfig:t,configKeys:r})]}))}))},Mu=function(){function e(e,t){this.localConfig=t,this.remoteConfigFetch=e}return e.prototype.generateJoinedConfig=function(e){var t,a,l,c;return n(this,void 0,void 0,(function(){var n,u,h,d,p,f,m,g,v,y,w,b,S,C,I,k,x,O,E,M,R,A;return s(this,(function(s){switch(s.label){case 0:(n=r({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,s.label=1;case 1:return s.trys.push([1,6,,7]),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_sampling_config",e)];case 2:return h=s.sent(),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_privacy_config",e)];case 3:return d=s.sent(),p=null===(t=n.interactionConfig)||void 0===t?void 0:t.ugcFilterRules,f=n,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_interaction_config",e)];case 4:return f.interactionConfig=s.sent(),n.interactionConfig&&p&&(n.interactionConfig.ugcFilterRules=p),m=n,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_logging_config",e)];case 5:return m.loggingConfig=s.sent(),(h||d)&&(u={},h&&(u.sr_sampling_config=h),d&&(u.sr_privacy_config=d)),[3,7];case 6:return g=s.sent(),v=g,this.localConfig.loggerProvider.warn(v.message),n.captureEnabled=!1,[3,7];case 7:if(!u)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:u}];if(y=u.sr_sampling_config,w=u.sr_privacy_config,y&&Object.keys(y).length>0?(Object.prototype.hasOwnProperty.call(y,"capture_enabled")?n.captureEnabled=y.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(y,"sample_rate")&&(n.sampleRate=y.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),w){b=null!==(a=n.privacyConfig)&&void 0!==a?a:{},S={defaultMaskLevel:null!==(c=null!==(l=w.defaultMaskLevel)&&void 0!==l?l:b.defaultMaskLevel)&&void 0!==c?c:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},C=function(e){var t,r,n,s,i,a,l,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=o(null!==(l=e.blockSelector)&&void 0!==l?l:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=o(null!==(c=e.maskSelector)&&void 0!==c?c:[]),m=f.next();!m.done;m=f.next()){h[m.value]="mask"}}catch(e){n={error:e}}finally{try{m&&!m.done&&(s=f.return)&&s.call(f)}finally{if(n)throw n.error}}try{for(var g=o(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),v=g.next();!v.done;v=g.next()){h[v.value]="unmask"}}catch(e){i={error:e}}finally{try{v&&!v.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}return h},I=r(r({},C(b)),C(w));try{for(k=o(Object.entries(I)),x=k.next();!x.done;x=k.next())O=i(x.value,2),E=O[0],"mask"===(M=O[1])?S.maskSelector.push(E):"block"===M?S.blockSelector.push(E):"unmask"===M&&S.unmaskSelector.push(E)}catch(e){R={error:e}}finally{try{x&&!x.done&&(A=k.return)&&A.call(k)}finally{if(R)throw R.error}}n.privacyConfig=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter((function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e}(S,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:J(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:u}]}}))}))},e}(),Ru=function(e,t){return n(void 0,void 0,void 0,(function(){var r,n;return s(this,(function(s){switch(s.label){case 0:return r=new X(e,t),[4,Eu({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=s.sent(),[2,new Mu(n,r)]}}))}))},Au="Failed to store session replay events in IndexedDB",Tu="1.24.0",Pu=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(r(r({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter((function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)})).forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(0)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout((function(){t.flush(!0).then((function(){t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(s){switch(s.label){case 0:return t=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map((function(t){return n.send(t,e)})))];case 1:return s.sent(),[2]}}))}))},e.prototype.send=function(e,t){var r,o;return void 0===t&&(t=!0),n(this,void 0,void 0,(function(){var n,i,a,l,c,u,h,p,f,m,g,v,y;return s(this,(function(s){switch(s.label){case 0:if(!(n=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(i=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=d(),a=(null==w?void 0:w.location)?w.location.href:"",l=Tu,c=e.sampleRate,u=new URLSearchParams({device_id:i,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(o=e.version)||void 0===o?void 0:o.version)||l),0===(p=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];s.label=1;case 1:return s.trys.push([1,3,,4]),f={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(n),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":a.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(p),method:"POST"},m="".concat(Z(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(m,f)];case 2:if(null===(g=s.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(g.status,e);else{v="";try{v=JSON.stringify(g.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(g.status,": ").concat(v)})}return[3,4];case 3:return y=s.sent(),this.completeRequest({context:e,err:y}),[3,4];case 4:return[2]}var w}))}))},e.prototype.handleReponse=function(e,t){switch((new P).buildStatus(e)){case l.Success:this.handleSuccessResponse(t);break;case l.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue(r(r({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();const Nu=(e,t)=>t.some((t=>e instanceof t));let Du,Lu;const _u=new WeakMap,Fu=new WeakMap,Bu=new WeakMap;let Uu={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return _u.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Vu(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ju(e){Uu=e(Uu)}function Wu(e){return(Lu||(Lu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Gu(this),t),Vu(this.request)}:function(...t){return Vu(e.apply(Gu(this),t))}}function zu(e){return"function"==typeof e?Wu(e):(e instanceof IDBTransaction&&function(e){if(_u.has(e))return;const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)}));_u.set(e,t)}(e),Nu(e,Du||(Du=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Uu):e)}function Vu(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{t(Vu(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)}));return Bu.set(t,e),t}(e);if(Fu.has(e))return Fu.get(e);const t=zu(e);return t!==e&&(Fu.set(e,t),Bu.set(t,e)),t}const Gu=e=>Bu.get(e);function qu(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=Vu(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(Vu(i.result),e.oldVersion,e.newVersion,Vu(i.transaction),e)})),r&&i.addEventListener("blocked",(e=>r(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}const Zu=["get","getKey","getAll","getAllKeys","count"],Yu=["put","add","delete","clear"],Ku=new Map;function Ju(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Ku.get(t))return Ku.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=Yu.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Zu.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,s?"readwrite":"readonly");let i=o.store;return n&&(i=i.index(t.shift())),(await Promise.all([i[r](...t),s&&o.done]))[0]};return Ku.set(t,o),o}ju((e=>({...e,get:(t,r,n)=>Ju(t,r)||e.get(t,r,n),has:(t,r)=>!!Ju(t,r)||e.has(t,r)})));const Hu=["continue","continuePrimaryKey","advance"],Xu={},$u=new WeakMap,Qu=new WeakMap,eh={get(e,t){if(!Hu.includes(t))return e[t];let r=Xu[t];return r||(r=Xu[t]=function(...e){$u.set(this,Qu.get(this)[t](...e))}),r}};async function*th(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,eh);for(Qu.set(r,t),Bu.set(r,Gu(t));t;)yield r,t=await($u.get(r)||t.continue()),$u.delete(r)}function rh(e,t){return t===Symbol.asyncIterator&&Nu(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Nu(e,[IDBIndex,IDBObjectStore])}ju((e=>({...e,get:(t,r,n)=>rh(t,r)?th:e.get(t,r,n),has:(t,r)=>rh(t,r)||e.has(t,r)})));var nh,sh=function(){function e(e){var t,r,n,s=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=new Blob([t]).size;return new Blob(e).size+r>=s.maxPersistedEventsSize||!!(Date.now()-s.timeAtLastSplit>s.interval&&e.length)&&(s.interval=Math.min(s.maxInterval,s.interval+s.minInterval),s._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(nh||(nh={}));var oh,ih,ah,lh="sessionCurrentSequence",ch="sequencesToSend",uh=function(){var e=d();return new Promise((function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)}}catch(e){r(e)}}))},hh=function(e){return n(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}}))}))},dh=function(e){var t,r;return e.objectStoreNames.contains(lh)||(r=e.createObjectStore(lh,{keyPath:"sessionId"})),e.objectStoreNames.contains(ch)||(t=e.createObjectStore(ch,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},ph=function(e){return n(void 0,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,qu(e,1,{upgrade:dh})];case 1:return[2,t.sent()]}}))}))},fh=function(e){function i(t){var o=e.call(this,t)||this;return o.getSequencesToSend=function(){return n(o,void 0,void 0,(function(){var e,t,r,n,o,i;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:return t?(r=t.value,n=r.sessionId,o=r.events,e.push({events:o,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return i=s.sent(),this.loggerProvider.warn("".concat(Au,": ").concat(i)),[3,6];case 6:return[2,void 0]}}))}))},o.storeCurrentSequence=function(e){return n(o,void 0,void 0,(function(){var t,n,o;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(lh,e)];case 1:return(t=s.sent())?[4,this.db.put(ch,{sessionId:e,events:t.events})]:[2,void 0];case 2:return n=s.sent(),[4,this.db.put(lh,{sessionId:e,events:[]})];case 3:return s.sent(),[2,r(r({},t),{sessionId:e,sequenceId:n})];case 4:return o=s.sent(),this.loggerProvider.warn("".concat(Au,": ").concat(o)),[3,5];case 5:return[2,void 0]}}))}))},o.addEventToCurrentSequence=function(e,t){return n(o,void 0,void 0,(function(){var r,n,o,i,a,l;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,10,,11]),[4,(r=this.db.transaction(lh,"readwrite")).store.get(e)];case 1:return(n=s.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return s.sent(),[2];case 3:return o=void 0,this.shouldSplitEventsList(n.events,t)?(o=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return s.sent(),[3,7];case 5:return i=n.events.concat(t),[4,r.store.put({sessionId:e,events:i})];case 6:s.sent(),s.label=7;case 7:return[4,r.done];case 8:return s.sent(),o?[4,this.storeSendingEvents(e,o)]:[2,void 0];case 9:return(a=s.sent())?[2,{events:o,sessionId:e,sequenceId:a}]:[2,void 0];case 10:return l=s.sent(),this.loggerProvider.warn("".concat(Au,": ").concat(l)),[3,11];case 11:return[2,void 0]}}))}))},o.storeSendingEvents=function(e,t){return n(o,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(ch,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Au,": ").concat(r)),[3,3];case 3:return[2,void 0]}}))}))},o.cleanUpSessionEventsStore=function(e,t){return n(o,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(ch,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Au,": ").concat(e)),[3,4];case 4:return[2]}}))}))},o.transitionFromKeyValStore=function(e){return n(o,void 0,void 0,(function(){var t,r,o,i,a,l,u,h,p=this;return s(this,(function(f){switch(f.label){case 0:return f.trys.push([0,6,,7]),[4,uh()];case 1:if(!(t=f.sent()))return[2];r=function(e,t){return n(p,void 0,void 0,(function(){var r,o,i=this;return s(this,(function(a){switch(a.label){case 0:return r=t.sessionSequences,o=[],Object.keys(r).forEach((function(a){var l=parseInt(a,10),c=r[l];if(l===t.currentSequenceId){var u=c.events.map((function(t){return n(i,void 0,void 0,(function(){return s(this,(function(r){return[2,this.addEventToCurrentSequence(e,t)]}))}))}));o.concat(u)}else c.status!==nh.SENT&&o.push(i.storeSendingEvents(e,c.events))})),[4,hh(o)];case 1:return a.sent(),[2]}}))}))},o="".concat(c,"_").concat(this.apiKey.substring(0,10)),f.label=2;case 2:return f.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(o),a=new Promise((function(t){i.onsuccess=function(o){return n(p,void 0,void 0,(function(){var n,i,a,l=this;return s(this,(function(s){switch(s.label){case 0:return n=o&&o.target.result,(i=n&&n[0])?(a=[],Object.keys(i).forEach((function(t){var n=parseInt(t,10),s=i[n];if(e===n)a.push(r(n,s));else{var o=s.sessionSequences;Object.keys(o).forEach((function(e){var t=parseInt(e,10);o[t].status!==nh.SENT&&a.push(l.storeSendingEvents(n,o[t].events))}))}})),[4,hh(a)]):[3,2];case 1:s.sent(),s.label=2;case 2:return t(),[2]}}))}))}})),[4,a];case 3:return f.sent(),(l=d())&&l.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return u=f.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(u)),[3,5];case 5:return[3,7];case 6:return h=f.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(h,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}}))}))},o.apiKey=t.apiKey,o.db=t.db,o}return t(i,e),i.new=function(e,t,o){return n(this,void 0,void 0,(function(){var n,a,l,c,u;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),n="replay"===e?"":"_".concat(e),a="".concat(t.apiKey.substring(0,10),"_amp_session_replay_events").concat(n),[4,ph(a)];case 1:return l=s.sent(),[4,(c=new i(r(r({},t),{db:l}))).transitionFromKeyValStore(o)];case 2:return s.sent(),[2,c];case 3:return u=s.sent(),t.loggerProvider.warn("".concat(Au,": ").concat(u)),[3,4];case 4:return[2]}}))}))},i.prototype.getCurrentSequenceEvents=function(e){return n(this,void 0,void 0,(function(){var t,r,n,i,a,l,c;return s(this,(function(s){switch(s.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=s.sent())?[2,[i]]:[2,void 0];case 2:t=[],s.label=3;case 3:return s.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=o.apply(void 0,[s.sent()]),n=r.next(),s.label=5;case 5:if(n.done)return[3,7];i=n.value,t.push(i),s.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return a=s.sent(),l={error:a},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(l)throw l.error}return[7];case 10:return[2,t]}}))}))},i}(sh),mh=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return t(r,e),r.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},r.prototype.addSequence=function(e){var t=this.sequenceId++,r=a([],i(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},r.prototype.getSequencesToSend=function(){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Object.entries(this.finalizedSequences).map((function(e){var t=i(e,2),r=t[0],n=t[1],s=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:s,events:o}}))]}))}))},r.prototype.storeCurrentSequence=function(e){return n(this,void 0,void 0,(function(){return s(this,(function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]}))}))},r.prototype.addEventToCurrentSequence=function(e,t){return n(this,void 0,void 0,(function(){var r;return s(this,(function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]}))}))},r.prototype.storeSendingEvents=function(e,t){return n(this,void 0,void 0,(function(){return s(this,(function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]}))}))},r.prototype.cleanUpSessionEventsStore=function(e,t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]}))}))},r}(sh),gh=function(e){var t=e.config,o=e.sessionId,i=e.minInterval,a=e.maxInterval,l=e.type,c=e.payloadBatcher,u=e.storeType;return n(void 0,void 0,void 0,(function(){function e(e){return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){return s(this,(function(t){return[2,h.flush(e)]}))}))}var h,d,p,f,m,g,v,y,w;return s(this,(function(b){switch(b.label){case 0:return h=new Pu(r(r({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new mh({loggerProvider:t.loggerProvider,maxInterval:a,minInterval:i})},p=function(){return n(void 0,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,fh.new(l,{loggerProvider:t.loggerProvider,minInterval:i,maxInterval:a,apiKey:t.apiKey},o)];case 1:return e=r.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}}))}))},"idb"!==u?[3,2]:[4,p()];case 1:return m=b.sent(),[3,3];case 2:m=d(),b.label=3;case 3:return f=m,g=function(e){var r=e.events,o=e.sessionId,i=e.deviceId,a=e.sequenceId;t.debugMode&&K().then((function(e){var r=e.totalStorageSize,n=e.percentOfQuota,s=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(s))})).catch((function(){})),h.sendEventsList({events:r,sessionId:o,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:i,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:l,onComplete:function(){return n(void 0,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(o,a)];case 1:return e.sent(),[2]}}))}))}})},v=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then((function(e){e&&g({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})).catch((function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)}))},y=function(e){var t=e.deviceId;return n(void 0,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach((function(e){g({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})})),[2]}}))}))},w=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;f.addEventToCurrentSequence(n,r.data).then((function(e){return e&&g({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:s})})).catch((function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)}))},[2,{sendCurrentSequenceEvents:v,addEvent:w,sendStoredEvents:y,flush:e}]}}))}))},vh=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach((function(e){r.set(e.name,e.manager)})),this.managers=r}return e.prototype.sendStoredEvents=function(e){return n(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=[],this.managers.forEach((function(r){t.push(r.sendStoredEvents(e))})),[4,Promise.all(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,s=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:s})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach((function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})}))},e.prototype.flush=function(e){return n(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=[],this.managers.forEach((function(r){t.push(r.flush(e))})),[4,Promise.all(t)];case 1:return r.sent(),[2]}}))}))},e}();function yh(e,t){if(ah=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};oh=r(r({},n),t),ih=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(oh.root,n);var s=wh(e,"all",(function(){return wh(e,"two",(function(){return wh(e,"one",(function(){return wh(e,"none")}))}))}));if(s){var o=Rh(Ah(s,e));return o.length>0&&(s=o[0]),Sh(s)}throw new Error("Selector was not found.")}function wh(e,t,r){for(var n=null,s=[],l=e,c=0,u=function(){var e,u,h=(new Date).getTime()-ah.getTime();if(void 0!==oh.timeoutMs&&h>oh.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=Oh(function(e){var t=e.getAttribute("id");if(t&&oh.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(l))||Oh.apply(void 0,a([],i(function(e){var t=Array.from(e.attributes).filter((function(e){return oh.attr(e.name,e.value)}));return t.map((function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}}))}(l)),!1))||Oh.apply(void 0,a([],i(function(e){var t=Array.from(e.classList).filter(oh.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(l)),!1))||Oh(function(e){var t=e.tagName.toLowerCase();if(oh.tagName(t))return{name:t,penalty:2};return null}(l))||[{name:"*",penalty:3}],p=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;var n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(l);if("all"==t)p&&(d=d.concat(d.filter(xh).map((function(e){return kh(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(xh).map((function(e){return kh(e,p)}))));else if("one"==t){var f=i(d=d.slice(0,1),1)[0];p&&xh(f)&&(d=[kh(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[kh(d[0],p)]));try{for(var m=(e=void 0,o(d)),g=m.next();!g.done;g=m.next()){(f=g.value).level=c}}catch(t){e={error:t}}finally{try{g&&!g.done&&(u=m.return)&&u.call(m)}finally{if(e)throw e.error}}if(s.push(d),s.length>=oh.seedMinLength&&(n=bh(s,r)))return"break";l=l.parentElement,c++};l;){if("break"===u())break}return n||(n=bh(s,r)),!n&&r?r():n}function bh(e,t){var r,n,s=Rh(Mh(e));if(s.length>oh.threshold)return t?t():null;try{for(var i=o(s),a=i.next();!a.done;a=i.next()){var l=a.value;if(Ih(l))return l}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function Sh(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var s=e[n].level||0;r=t.level===s-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function Ch(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function Ih(e){var t=Sh(e);switch(ih.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function kh(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function xh(e){return"html"!==e.name&&!e.name.startsWith("#")}function Oh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Eh);return r.length>0?r:null}function Eh(e){return null!=e}function Mh(e,t){var r,n,i,a,l,c;return void 0===t&&(t=[]),s(this,(function(s){switch(s.label){case 0:if(!(e.length>0))return[3,9];s.label=1;case 1:s.trys.push([1,6,7,8]),r=o(e[0]),n=r.next(),s.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,o(Mh(e.slice(1,e.length),t.concat(i)))]);case 3:s.sent(),s.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return a=s.sent(),l={error:a},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:s.sent(),s.label=11;case 11:return[2]}}))}function Rh(e){return a([],i(e),!1).sort((function(e,t){return Ch(e)-Ch(t)}))}function Ah(e,t,r){var n,l,c;return void 0===r&&(r={counter:0,visited:new Map}),s(this,(function(s){switch(s.label){case 0:if(!(e.length>2&&e.length>oh.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>oh.maxNumberOfTries?[2]:(r.counter+=1,(l=a([],i(e),!1)).splice(n,1),c=Sh(l),r.visited.has(c)?[2]:Ih(l)&&function(e,t){return ih.querySelector(Sh(e))===t}(l,t)?[4,l]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(c,!0),[5,o(Ah(l,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var Th=function(e){var t=e.version,r=e.events,n=[];return r.forEach((function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)})),{version:t,events:n}},Ph=function(e){var t=e.version,n=e.events,s=[];n.forEach((function(e){var t=JSON.parse(e);"click"===t.type&&s.push(t)}));var o=s.reduce((function(e,t){var n=t.x,s=t.y,o=t.selector,i=t.timestamp,a=i-i%36e5,l="".concat(n,":").concat(s,":").concat(null!=o?o:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=r(r({},t),{timestamp:a,count:1}),e}),{});return{version:t,events:Object.values(o)}},Nh=function(e,t){var r=t.eventsManager,n=t.sessionId,s=t.deviceIdFn,o=t.ugcFilterRules;return function(t){if(t.type===Cu.Click){var i=d();if(i){var a=i.location,l=i.innerHeight,c=i.innerWidth;if(a){var u=t.x,h=t.y;if(void 0!==u&&void 0!==h){var p,f=gu.mirror.getNode(t.id);if(f)try{p=yh(f)}catch(t){e.debug("error resolving selector from finder")}var m=pc.getWindowScroll(i),g={x:u+m.left,y:h+m.top,selector:p,viewportHeight:l,viewportWidth:c,pageUrl:Y(a.href,o),timestamp:Date.now(),type:"click"},v=s();v&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(g)},deviceId:v})}}}}}},Dh=function(){function e(e,t){var r=d();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=Z(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,s=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),i="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(i,t)||this.sendXhr(i,t)},e}(),Lh=pc.getWindowHeight,_h=pc.getWindowWidth,Fh=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,s,o=e(),i=d();i&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Lh(),viewportWidth:_h(),pageUrl:Y(i.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=_h(),this._maxScrollHeight=Lh(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Dh(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var r=_h();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var s=Lh();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Bh=function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=function(e,t){return"".concat(t,"/").concat(e)}(t,r))},Uh=Uint8Array,jh=Uint16Array,Wh=Uint32Array,zh=new Uh([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vh=new Uh([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Gh=new Uh([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qh=function(e,t){for(var r=new jh(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new Wh(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)s[o]=o-r[n]<<5|n;return[r,s]},Zh=qh(zh,2),Yh=Zh[0],Kh=Zh[1];Yh[28]=258,Kh[258]=28;for(var Jh=qh(Vh,0)[1],Hh=new jh(32768),Xh=0;Xh<32768;++Xh){var $h=(43690&Xh)>>>1|(21845&Xh)<<1;$h=(61680&($h=(52428&$h)>>>2|(13107&$h)<<2))>>>4|(3855&$h)<<4,Hh[Xh]=((65280&$h)>>>8|(255&$h)<<8)>>>1}var Qh=function(e,t,r){for(var n=e.length,s=0,o=new jh(t);s<n;++s)++o[e[s]-1];var i,a=new jh(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new jh(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)i[Hh[h]>>>l]=c}else for(i=new jh(n),s=0;s<n;++s)i[s]=Hh[a[e[s]-1]++]>>>15-e[s];return i},ed=new Uh(288);for(Xh=0;Xh<144;++Xh)ed[Xh]=8;for(Xh=144;Xh<256;++Xh)ed[Xh]=9;for(Xh=256;Xh<280;++Xh)ed[Xh]=7;for(Xh=280;Xh<288;++Xh)ed[Xh]=8;var td=new Uh(32);for(Xh=0;Xh<32;++Xh)td[Xh]=5;var rd=Qh(ed,9,0),nd=Qh(td,5,0),sd=function(e){return(e/8|0)+(7&e&&1)},od=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof jh?jh:e instanceof Wh?Wh:Uh)(r-t);return n.set(e.subarray(t,r)),n},id=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},ad=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},ld=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,o=r.slice();if(!s)return[new Uh(0),0];if(1==s){var i=new Uh(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(n=1;n<s;++n)o[n].s>d&&(d=o[n].s);var p=new jh(d+1),f=cd(r[u-1],p,0);if(f>t){n=0;var m=0,g=f-t,v=1<<g;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<s;++n){var y=o[n].s;if(!(p[y]>t))break;m+=v-(1<<f-p[y]),p[y]=t}for(m>>>=g;m>0;){var w=o[n].s;p[w]<t?m-=1<<t-p[w]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;p[b]==t&&(--p[b],++m)}f=t}return[new Uh(p),f]},cd=function(e,t,r){return-1==e.s?Math.max(cd(e.l,t,r+1),cd(e.r,t,r+1)):t[e.s]=r},ud=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new jh(++t),n=0,s=e[0],o=1,i=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=e[a]}return[r.subarray(0,n),t]},hd=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},dd=function(e,t,r){var n=r.length,s=sd(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var o=0;o<n;++o)e[s+o+4]=r[o];return 8*(s+4+n)},pd=function(e,t,r,n,s,o,i,a,l,c,u){id(t,u++,r),++s[256];for(var h=ld(s,15),d=h[0],p=h[1],f=ld(o,15),m=f[0],g=f[1],v=ud(d),y=v[0],w=v[1],b=ud(m),S=b[0],C=b[1],I=new jh(19),k=0;k<y.length;++k)I[31&y[k]]++;for(k=0;k<S.length;++k)I[31&S[k]]++;for(var x=ld(I,7),O=x[0],E=x[1],M=19;M>4&&!O[Gh[M-1]];--M);var R,A,T,P,N=c+5<<3,D=hd(s,ed)+hd(o,td)+i,L=hd(s,d)+hd(o,m)+i+14+3*M+hd(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(N<=D&&N<=L)return dd(t,u,e.subarray(l,l+c));if(id(t,u,1+(L<D)),u+=2,L<D){R=Qh(d,p,0),A=d,T=Qh(m,g,0),P=m;var _=Qh(O,E,0);id(t,u,w-257),id(t,u+5,C-1),id(t,u+10,M-4),u+=14;for(k=0;k<M;++k)id(t,u+3*k,O[Gh[k]]);u+=3*M;for(var F=[y,S],B=0;B<2;++B){var U=F[B];for(k=0;k<U.length;++k){var j=31&U[k];id(t,u,_[j]),u+=O[j],j>15&&(id(t,u,U[k]>>>5&127),u+=U[k]>>>12)}}}else R=rd,A=ed,T=nd,P=td;for(k=0;k<a;++k)if(n[k]>255){j=n[k]>>>18&31;ad(t,u,R[j+257]),u+=A[j+257],j>7&&(id(t,u,n[k]>>>23&31),u+=zh[j]);var W=31&n[k];ad(t,u,T[W]),u+=P[W],W>3&&(ad(t,u,n[k]>>>5&8191),u+=Vh[W])}else ad(t,u,R[n[k]]),u+=A[n[k]];return ad(t,u,R[256]),u+A[256]},fd=new Wh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),md=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new Uh(n+i+5*(1+Math.floor(i/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||i<8)for(var u=0;u<=i;u+=65535){var h=u+65535;h<i?c=dd(l,c,e.subarray(u,h)):(l[u]=o,c=dd(l,c,e.subarray(u,i)))}else{for(var d=fd[t-1],p=d>>>13,f=8191&d,m=(1<<r)-1,g=new jh(32768),v=new jh(m+1),y=Math.ceil(r/3),w=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&m},S=new Wh(25e3),C=new jh(288),I=new jh(32),k=0,x=0,O=(u=0,0),E=0,M=0;u<i;++u){var R=b(u),A=32767&u,T=v[R];if(g[A]=T,v[R]=A,E<=u){var P=i-u;if((k>7e3||O>24576)&&P>423){c=pd(e,l,0,S,C,I,x,O,M,u-M,c),O=k=x=0,M=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)I[N]=0}var D=2,L=0,_=f,F=A-T&32767;if(P>2&&R==b(u-F))for(var B=Math.min(p,P)-1,U=Math.min(32767,u),j=Math.min(258,P);F<=U&&--_&&A!=T;){if(e[u+D]==e[u+D-F]){for(var W=0;W<j&&e[u+W]==e[u+W-F];++W);if(W>D){if(D=W,L=F,W>B)break;var z=Math.min(F,W-2),V=0;for(N=0;N<z;++N){var G=u-F+N+32768&32767,q=G-g[G]+32768&32767;q>V&&(V=q,T=G)}}}F+=(A=T)-(T=g[A])+32768&32767}if(L){S[O++]=268435456|Kh[D]<<18|Jh[L];var Z=31&Kh[D],Y=31&Jh[L];x+=zh[Z]+Vh[Y],++C[257+Z],++I[Y],E=u+D,++k}else S[O++]=e[u],++C[e[u]]}}c=pd(e,l,o,S,C,I,x,O,M,u-M,c)}return od(a,0,n+sd(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!s)};function gd(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,o=r.length,i=0;i!=o;){for(var a=Math.min(i+5552,o);i<a;++i)s+=n+=r[i];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,o,i=md(e,t,2,4);return n=i,s=t.level,o=0==s?0:s<6?1:9==s?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(i,i.length-4,r.d()),i}const vd=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(gd(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Uh(e.length+(e.length>>>1)),s=0,o=function(e){n[s++]=e},i=0;i<r;++i){if(s+5>n.length){var a=new Uh(s+8+(r-i<<1));a.set(n),n=a}var l=e.charCodeAt(i);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return od(n,0,s)}(JSON.stringify(t))),!0)};var yd=function(){function e(e,t,r,n){var s,o,i,a=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=vd(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){a.eventsManager&&a.deviceId&&a.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:a.deviceId})},this.addCompressedEvent=function(e,t){if(a.worker)a.worker.postMessage({event:e,sessionId:t});else{var r=a.compressEvent(e);a.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=a.worker)||void 0===e||e.terminate()};var l=d();this.canUseIdleCallback=l&&"requestIdleCallback"in l,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3;var c=null!==(o={}.COMPRESSION_WEBWORKER_BODY)&&void 0!==o?o:n;if((null===(i=this.config.experimental)||void 0===i?void 0:i.useWebWorker)&&l&&l.Worker&&c){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var u=new Worker(URL.createObjectURL(new Blob([c],{type:"application/javascript"})));u.onerror=function(e){t.loggerProvider.error(e)},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;a.addCompressedEventToManager(r,n)},this.worker=u}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback((function(t){e.processQueue(t)}),{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback((function(e){t.processQueue(e)}),{timeout:this.timeout}):this.isProcessing=!1},e}(),wd=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=d();if(t){var r=t.fetch;r&&(t.fetch=function(t,o){return n(e,void 0,void 0,(function(){var e,n,i,a,l,c,u;return s(this,(function(s){switch(s.label){case 0:e=Date.now(),n={timestamp:e,type:"fetch",method:(null==o?void 0:o.method)||"GET",url:t.toString(),requestHeaders:null==o?void 0:o.headers},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r(t,o)];case 2:return i=s.sent(),c=Date.now(),n.status=i.status,n.duration=c-e,a={},i.headers.forEach((function(e,t){a[t]=e})),n.responseHeaders=a,this.notifyEvent(n),[2,i];case 3:throw l=s.sent(),c=Date.now(),n.duration=c-e,u=l,n.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(n),l;case 4:return[2]}}))}))},this.fetchObserver=function(){t.fetch=r})}},e}(),bd=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.pageLeaveFns=[],this.teardownEventListeners=function(t){var r=d();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!t&&r.addEventListener("blur",e.blurListener),!t&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!t&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!t&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach((function(e){e(t)}))},this.addCustomRRWebEvent=function(t,o,i){return void 0===o&&(o={}),void 0===i&&(i=!0),n(e,void 0,void 0,(function(){var e,n,a,l;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),e=void 0,(n=this.config)&&t!==D.METADATA?(e={config:J(n),version:Tu},i?[4,K()]:[3,2]):[3,2];case 1:a=s.sent(),e=r(r({},a),e),s.label=2;case 2:return this.recordCancelCallback?gu.addCustomEvent(t,r(r({},o),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return l=s.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}}))}))},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new j(new m)}return e.prototype.init=function(e,t){return p(this._init(e,t))},e.prototype._init=function(e,t){var r,o,l,c,u,h,p,f;return n(this,void 0,void 0,(function(){var n,g,v,y,w,b,S,C,I,k,x,O,E,M;return s(this,(function(s){switch(s.label){case 0:return this.loggerProvider=new j(t.loggerProvider||new m),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new Bh({sessionId:t.sessionId,deviceId:t.deviceId}),n=this,[4,Ru(e,t)];case 1:return n.joinedConfigGenerator=s.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:g=s.sent(),v=g.joinedConfig,y=g.localConfig,w=g.remoteConfig,this.config=v,this.setMetadata(t.sessionId,v,y,w,null===(r=t.version)||void 0===r?void 0:r.version,Tu,null===(o=t.version)||void 0===o?void 0:o.type),t.sessionId&&(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled)&&(b=Fh.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[b.send(this.getDeviceId.bind(this)).bind(b)],this.scrollHook=b.hook.bind(b)),S=[],"idb"!==(C=this.config.storeType)||(null===(c=d())||void 0===c?void 0:c.indexedDB)||(C="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(C," for event storage.")),s.label=3;case 3:return s.trys.push([3,5,,6]),[4,gh({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:C})];case 4:return I=s.sent(),S.push({name:"replay",manager:I}),[3,6];case 5:return k=s.sent(),M=k,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(M.toString())),[3,6];case 6:if(!(null===(u=this.config.interactionConfig)||void 0===u?void 0:u.enabled))return[3,10];x=this.config.interactionConfig.batch?Ph:Th,s.label=7;case 7:return s.trys.push([7,9,,10]),[4,gh({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:3e4,maxInterval:6e4,payloadBatcher:x,storeType:C})];case 8:return O=s.sent(),S.push({name:"interaction",manager:O}),[3,10];case 9:return E=s.sent(),M=E,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(M.toString())),[3,10];case 10:return this.eventsManager=new(vh.bind.apply(vh,a([void 0],i(S),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new yd(this.eventsManager,this.config,this.getDeviceId()),(null===(f=null===(p=this.config.loggingConfig)||void 0===p?void 0:p.network)||void 0===f?void 0:f.enabled)&&(this.networkObservers=new wd),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}}))}))},e.prototype.setSessionId=function(e,t){return p(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t){return n(this,void 0,void 0,(function(){var r,n,o;return s(this,(function(s){switch(s.label){case 0:return(r=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(r),n=t||this.getDeviceId(),this.identifiers=new Bh({sessionId:e,deviceId:n}),this.joinedConfigGenerator&&r?[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]:[3,2];case 1:o=s.sent().joinedConfig,this.config=o,s.label=2;case 2:return this.recordEvents(),[2]}}))}))},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),s={};return n&&((e={})[_]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[B]=JSON.stringify({appHash:q(t.apiKey).toString()}))),this.addCustomRRWebEvent(D.GET_SR_PROPS,{shouldRecord:n,eventProperties:s},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,s},e.prototype.sendEvents=function(e){var t,r=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])}))}))},e.prototype.shouldOptOut=function(){var e,t,r,n;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=(n=this.config.instanceName,void 0===n&&(n="$default_instance"),A.getInstance(n)).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r,n=(e=this.identifiers.sessionId,t=this.config.sampleRate,r=q(e.toString()),31*Math.abs(r)%1e6/1e6<t);return n||this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate.")),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var s=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t;return n(this,void 0,void 0,(function(){var r,n,o;return s(this,(function(s){switch(s.label){case 0:if(r=[],!(null===(t=null==e?void 0:e.console)||void 0===t?void 0:t.enabled))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,import("./rrweb-plugin-console-record-min.js")];case 2:return n=s.sent().getRecordConsolePlugin,r.push(n({level:e.console.levels})),[3,4];case 3:return o=s.sent(),this.loggerProvider.warn("Failed to load console plugin:",o),[3,4];case 4:return[2,r.length>0?r:void 0]}}))}))},e.prototype.recordEvents=function(e){var t,r,o;return void 0===e&&(e=!0),n(this,void 0,void 0,(function(){var n,i,a,l,c,u,h,d,p,f,m,g,v=this;return s(this,(function(s){switch(s.label){case 0:if(n=this.config,i=this.getShouldRecord(),a=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,!i||!a||!n)return[2];this.stopRecordingEvents(),null===(r=this.networkObservers)||void 0===r||r.start((function(e){v.addCustomRRWebEvent(D.FETCH_REQUEST,e)})),l=n.privacyConfig,c=n.interactionConfig,u=n.loggingConfig,h=(null==c?void 0:c.enabled)?{mouseInteraction:this.eventsManager&&Nh(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:a,deviceIdFn:this.getDeviceId.bind(this),ugcFilterRules:null!==(o=c.ugcFilterRules)&&void 0!==o?o:[]}),scroll:this.scrollHook}:{},d=(null==c?void 0:c.enabled)&&c.ugcFilterRules?c.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(a,".")),s.label=1;case 1:return s.trys.push([1,3,,4]),p=this,f=gu,g={emit:function(e){if(v.shouldOptOut())return v.loggerProvider.log("Opting session ".concat(a," out of recording due to optOut config.")),v.stopRecordingEvents(),void v.sendEvents();e.type===Su.Meta&&(e.data.href=Y(e.data.href,d)),v.eventCompressor&&v.eventCompressor.enqueueEvent(e,a)},inlineStylesheet:n.shouldInlineStylesheet,hooks:h,maskAllInputs:!0,maskTextClass:U,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:n.applyBackgroundColorToBlockedElements,maskInputFn:G("input",l),maskTextFn:G("text",l),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return v.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(u)];case 2:return p.recordCancelCallback=f.apply(void 0,[(g.plugins=s.sent(),g)]),this.addCustomRRWebEvent(D.DEBUG_INFO),e&&this.addCustomRRWebEvent(D.METADATA,this.metadata),[3,4];case 3:return m=s.sent(),this.loggerProvider.warn("Failed to initialize session replay:",m),[3,4];case 4:return[2]}}))}))},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){return s(this,(function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]}))}))},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,s,o,i){var a=(null==e?void 0:e.toString())?q(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(i),replaySDKVersion:s,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e}(),Sd=function(e){return function(){var t=e.config||H();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Cd=function(){var e=new bd;return{init:T(e.init.bind(e),"init",Sd(e)),setSessionId:T(e.setSessionId.bind(e),"setSessionId",Sd(e)),getSessionId:T(e.getSessionId.bind(e),"getSessionId",Sd(e)),getSessionReplayProperties:T(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Sd(e)),flush:T(e.flush.bind(e),"flush",Sd(e)),shutdown:T(e.shutdown.bind(e),"shutdown",Sd(e))}}(),Id=Cd.init,kd=Cd.setSessionId,xd=Cd.getSessionId,Od=Cd.getSessionReplayProperties;Cd.flush,Cd.shutdown;const Ed="amp_session_id",Md="Amplitude Session Replay Segment Plugin [Debug]:";function Rd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var Ad=function e(t,r){function n(e,n,s){if("undefined"!=typeof document){"number"==typeof(s=Rd({},r,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in s)s[i]&&(o+="; "+i,!0!==s[i]&&(o+="="+s[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+o}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},s=0;s<r.length;s++){var o=r[s].split("="),i=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(n[a]=t.read(i,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",Rd({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Rd({},this.attributes,t))},withConverter:function(t){return e(Rd({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const Td=()=>{const e=xd()||Ad.get(Ed);if(e){const t=parseInt(e.toString(),10);if(isNaN(t))return;return t}},Pd=(e,t)=>(Ad.set(Ed,e.toString()),kd(e,t).promise),Nd=(e,t)=>n(void 0,void 0,void 0,(function*(){const r=Td()||0;let n;e.event.integrations&&e.event.integrations["Actions Amplitude"]&&(n=e.event.integrations["Actions Amplitude"].session_id),n&&r<n&&(yield Pd(n,t));const s=Od(),o=Object.assign(Object.assign({},s),e.event.properties);return e.updateEvent("properties",o),e})),Dd="0.0.0-beta.9",Ld=({amplitudeApiKey:e,sessionReplayOptions:t,segmentInstance:r,enableWrapperDebug:s=!1})=>n(void 0,void 0,void 0,(function*(){let o,i=!1,a=null==t?void 0:t.deviceId;const l={name:"Session Replay Events",type:"enrichment",version:Dd,isLoaded:()=>i,load:(r,l)=>n(void 0,void 0,void 0,(function*(){if(!a){const e=l.user();a=e.anonymousId()||void 0}const r=Td();s&&console.log(`${Md} initializing session replay with sessionId=${null!=r?r:"undefined"} and deviceId=${null!=a?a:"undefined"}`),o=Id(e,Object.assign(Object.assign({},t),{sessionId:r,deviceId:a||void 0,version:{type:"segment",version:Dd}})).promise,yield o,i=!0})),track:e=>n(void 0,void 0,void 0,(function*(){return yield o,yield Nd(e,a)})),page:e=>n(void 0,void 0,void 0,(function*(){return yield o,yield Nd(e,a)})),identify:e=>n(void 0,void 0,void 0,(function*(){yield o;const t=Td();return t&&(s&&console.log(`${Md} calling setSessionId() with sessionId=${t} and deviceId=${null!=a?a:"undefined"}`),yield Pd(t,a)),e}))};yield r.register(l)}));export{Ld as createSegmentActionsPlugin};
1
+ export{c as createSegmentActionsPlugin}from"./index-min.js";
2
2
  //# sourceMappingURL=segment-session-replay-wrapper-esm.js.map