@amplitude/plugin-session-replay-browser 1.28.1 → 1.29.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.
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/console-plugin-min.js.map +1 -1
- package/lib/scripts/index-min.js +1 -1
- package/lib/scripts/index-min.js.gz +0 -0
- package/lib/scripts/index-min.js.map +1 -1
- package/lib/scripts/index-min2.js +1 -1
- package/lib/scripts/index-min2.js.gz +0 -0
- package/lib/scripts/index-min2.js.map +1 -1
- package/lib/scripts/plugin-session-replay-browser-min.js +1 -1
- package/lib/scripts/plugin-session-replay-browser-min.js.gz +0 -0
- package/lib/scripts/plugin-session-replay-browser-min.js.map +1 -1
- package/lib/scripts/rrweb-record-min.js +1 -1
- package/lib/scripts/rrweb-record-min.js.gz +0 -0
- package/lib/scripts/rrweb-record-min.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var sessionReplay=function(e){"use strict";var t=function(e,r){return t=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])},t(e,r)};function r(e,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=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,s,o=function(){return o=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},o.apply(this,arguments)};function i(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 a(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 l(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 c(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 u(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,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var h,d="$default_instance",p="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"}(h||(h={}));var f,m=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},g=u([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),y=function(e){var t,r=m();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,y)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,u([],c(n.entries()),!1).map(function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(g[n]):g[n]}).join("")},v=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"}(f||(f={}));var w="Amplitude Logger ",b=function(){function e(){this.logLevel=f.None}return e.prototype.disable=function(){this.logLevel=f.None},e.prototype.enable=function(e){void 0===e&&(e=f.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Verbose||console.log("".concat(w,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Warn||console.warn("".concat(w,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Error||console.error("".concat(w,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Debug||console.log("".concat(w,"[Debug]: ").concat(e.join(" ")))},e}(),S=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:d,logLevel:f.Warn,loggerProvider:new b,offline:!1,optOut:!1,serverUrl:p,serverZone:"US",useBatch:!1}},C=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=S();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=x(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}(),k=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":p},x=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=S().serverZone),void 0===r&&(r=S().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:S().serverZone;return{serverZone:n,serverUrl:k(n,r)}};var O=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<f.Debug||!c||!l)return e.apply(s,o);var u,h={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&&h.states&&(h.states.before=n());var d=e.apply(s,o);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}},E=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:I(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),I=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},M=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}(),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 P(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 A(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 T=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var o=P(["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(!T(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){T(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!T(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 N,L=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=R({},this.identity.userProperties),r=R(R({},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=P(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=A(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,P(Object.entries(p))),m=f.next();!m.done;m=f.next()){var g=A(m.value,2),y=g[0],v=g[1];l[y]=v}}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,P(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[y=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 R({},this.identity)},e.prototype.setIdentity=function(e){var t=R({},this.identity);this.identity=R({},e),T(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}(),_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,D=function(){function e(){this.identityStore=new L,this.eventBridge=new M,this.applicationContextProvider=new E}return e.getInstance=function(t){return _.analyticsConnectorInstances||(_.analyticsConnectorInstances={}),_.analyticsConnectorInstances[t]||(_.analyticsConnectorInstances[t]=new e),_.analyticsConnectorInstances[t]},e}(),F=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},U=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,d,p,f,m,g,y,v,w,b,S,C,k;if("object"!=typeof e)return null;var x=e.code||0,O=this.buildStatus(x);switch(O){case h.Success:return{status:O,statusCode:x,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 h.Invalid:return{status:O,statusCode:x,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!==(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 h.PayloadTooLarge:return{status:O,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case h.RateLimit:return{status:O,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v: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!==(k=e.throttled_events)&&void 0!==k?k:[]}};case h.Timeout:default:return{status:O,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),j=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return r(t,e),t.prototype.send=function(e,t){return i(this,void 0,void 0,function(){var r,n,s;return a(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:o({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=i.sent()).text()];case 2:s=i.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(U),B=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),z=401,W=403,$=429,q=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new B(e,t)}return e.prototype.subscribe=function(e,t,r){var n=y(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return i(this,void 0,void 0,function(){var e,t=this;return a(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return i(this,void 0,void 0,function(){var t,r,n,s=this;return a(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return s.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=s.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),i(this,void 0,void 0,function(){var r,n,s,o,i,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,i,l,u,h,d;return a(this,function(a){switch(a.label){case 0:s=!0,i=new AbortController,l=setTimeout(function(){return i.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(u=a.sent()).ok?[3,4]:[4,u.text()];case 3:return h=a.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(h)),u.status===z||u.status===W?(o.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,s=!1):u.status>=400&&u.status<500&&u.status!==$&&(s=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=a.sent())instanceof Error&&"AbortError"===d.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(l),[7];case 9:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11]:[2,"break"];case 10:a.sent(),a.label=11;case 11:return[2]}})},o=this,i=0,u.label=1;case 1:return i<e?[5,s(i)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];if("break"===l)return[3,4];u.label=3;case 3:return i++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(N||(N={}));var V,G="https://app.amplitude.com",H={US:G,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var J="__AMPLITUDE_MESSENGER_INSTANCE__",K="__AMPLITUDE_MESSENGER__",Y=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?G:t;this[V]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,s;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(s=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===s||s.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var s="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:s,action:e,args:t};return new Promise(function(t,i){n.requestCallbacks[s]={resolve:t,reject:i},n.notify(o),r.timeout>0&&setTimeout(function(){i(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},r.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var r,n,s,o;this.actionHandlers.has(e)&&(null===(o=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===o||o.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var i=this.pendingMessages.get(e);if(i){this.pendingMessages.delete(e);try{for(var a=l(i),c=a.next();!c.done;c=a.next()){t(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return i(this,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,o=s.logger,i=s.endpoint;o&&(this.logger=o),i&&this.endpoint===G&&(this.endpoint=i),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,s,o,i;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(o=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===o||o.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(i=n.pendingMessages.get(l))&&void 0!==i?i:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=m();(null==e?void 0:e[K])===this&&delete e[K]},e}();function X(e){var t,r=m(),n=null==r?void 0:r[K];if("object"==typeof(t=n)&&null!==t&&J in t&&!0===t[J])return n;var s=new Y(e);return r&&(r[K]=s),s}V=J;var Z="__AMPLITUDE_BACKGROUND_CAPTURE__";var Q,ee="[Amplitude]",te="".concat(ee," Session Replay ID"),re=N.US,ne={enabled:!0},se=1e3,oe="".concat(ee," Session Replay Debug"),ie="amp-mask",ae="https://api-sr.amplitude.com/sessions/v2/track",le="https://api-sr.eu.amplitude.com/sessions/v2/track",ce="https://api-sr.stag2.amplitude.com/sessions/v2/track";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(Q||(Q={}));var ue=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}(),he="medium";function de(e,t){return t||("STAGING"===e?ce:"EU"===e?le:ae)}var pe=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 pe(e,he,r)}},fe=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var o=l(t.urlMaskLevels),i=o.next();!i.done;i=o.next()){var a=i.value;if(be(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:he},me=function(e,t,r,n){var s,o;if(void 0===t&&(t={defaultMaskLevel:he}),r){if(r.closest("."+ie))return!0;var i=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(o=t.unmaskSelector)&&void 0!==o?o:[]).some(function(e){return r.closest(e)});if(a)return!1}return pe(e,fe(n,t),r)},ge=function(e,t,r){return function(n,s){return me(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},ye=function(e,t){return function(r,n,s){var o;return"style"===r?n:(null!==(o=null==e?void 0:e.maskAttributes)&&void 0!==o?o:[]).includes(r)&&me("text",e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},ve=function(){var e=m();return(null==e?void 0:e.location)?e.location.href:""},we=new Map,be=function(e){var t=we.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",o="\0ST\0",i="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,o)).replace(/\?/g,i)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(o).join(".*")).split(i).join(".");var l=new RegExp("^".concat(a,"$"));return we.set(e,l),l},Se=function(e,t){var r,n;try{for(var s=l(t),o=s.next();!o.done;o=s.next()){var i=o.value,a=be(i.selector);if(a.test(e))return e.replace(a,i.replacement)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},Ce=function(){return i(void 0,void 0,void 0,function(){var e,t,r,n,s,o,i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=m())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,s=t.usageDetails,o=r?Math.round(r/1024):0,i=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:i,usageDetails:JSON.stringify(s)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},ke=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},xe=function(){return{flushMaxRetries:2,logLevel:f.Warn,loggerProvider:new b,transportProvider:new j}},Oe=function(e){function t(t,r){var n,s,i,a,l,c,u,h=this,d=xe();if((h=e.call(this,o(o({transportProvider:d.transportProvider,loggerProvider:new ue(r.loggerProvider||d.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=d.flushMaxRetries?r.flushMaxRetries:d.flushMaxRetries,h.apiKey=t,h.sampleRate=r.sampleRate||0,h.serverZone=r.serverZone||re,h.configServerUrl=r.configServerUrl,h.trackServerUrl=r.trackServerUrl,h.shouldInlineStylesheet=r.shouldInlineStylesheet,h.version=r.version,h.performanceConfig=r.performanceConfig||ne,h.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",h.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,h.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,h.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:se,h.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(h.privacyConfig=r.privacyConfig),r.interactionConfig&&(h.interactionConfig=r.interactionConfig,h.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")}(h.interactionConfig.ugcFilterRules)),r.debugMode&&(h.debugMode=r.debugMode),void 0!==r.useWebWorker)h.useWebWorker=r.useWebWorker;else{var p=r;void 0!==(null===(c=p.experimental)||void 0===c?void 0:c.useWebWorker)&&(h.useWebWorker=p.experimental.useWebWorker)}return r.omitElementTags&&(h.omitElementTags=r.omitElementTags),h.captureAdoptedStyleSheets=null===(u=r.captureAdoptedStyleSheets)||void 0===u||u,h}return r(t,e),t}(C),Ee=(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))(Ee||{}),Ie=(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))(Ie||{}),Me=(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))(Me||{}),Re=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r,n,s,h,d;return i(this,void 0,void 0,function(){var i,p,f,m,g,y,v,w,b,S,C,k,x,O,E,I,M,R=this;return a(this,function(a){switch(a.label){case 0:(i=o({},this.localConfig)).optOut=this.localConfig.optOut,i.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(e,t){R.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,n){var s;if(R.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var o=r,a=o.sr_sampling_config,l=o.sr_privacy_config,c=o.sr_targeting_config,u=null===(s=i.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;i.interactionConfig=o.sr_interaction_config,i.interactionConfig&&u&&(i.interactionConfig.ugcFilterRules=u),i.loggingConfig=o.sr_logging_config,(a||l||c)&&(p={},a&&(p.sr_sampling_config=a),l&&(p.sr_privacy_config=l),c&&(p.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return a.sent(),[3,4];case 3:return f=a.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",f),i.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:void 0}];case 4:if(!p)return[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:p}];if(m=p.sr_sampling_config,g=p.sr_privacy_config,y=p.sr_targeting_config,m&&Object.keys(m).length>0?(Object.prototype.hasOwnProperty.call(m,"capture_enabled")?i.captureEnabled=m.capture_enabled:i.captureEnabled=!1,Object.prototype.hasOwnProperty.call(m,"sample_rate")&&(i.sampleRate=m.sample_rate)):(i.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),g){v=null!==(e=i.privacyConfig)&&void 0!==e?e:{},w={defaultMaskLevel:null!==(r=null!==(t=g.defaultMaskLevel)&&void 0!==t?t:v.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:u([],c(new Set(u(u([],c(null!==(n=v.maskAttributes)&&void 0!==n?n:[]),!1),c(null!==(s=g.maskAttributes)&&void 0!==s?s:[]),!1))),!1),urlMaskLevels:u(u([],c(null!==(h=g.urlMaskLevels)&&void 0!==h?h:[]),!1),c(null!==(d=v.urlMaskLevels)&&void 0!==d?d:[]),!1)},b=function(e){var t,r,n,s,o,i,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=l(null!==(a=e.blockSelector)&&void 0!==a?a:[]),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=l(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=l(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),y=g.next();!y.done;y=g.next()){h[y.value]="unmask"}}catch(e){o={error:e}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return h},S=o(o({},b(v)),b(g));try{for(C=l(Object.entries(S)),k=C.next();!k.done;k=C.next())x=c(k.value,2),O=x[0],"mask"===(E=x[1])?w.maskSelector.push(O):"block"===E?w.blockSelector.push(O):"unmask"===E&&w.unmaskSelector.push(O)}catch(e){I={error:e}}finally{try{k&&!k.done&&(M=C.return)&&M.call(C)}finally{if(I)throw I.error}}i.privacyConfig=(P=w,A=this.localConfig.loggerProvider,T=document.createDocumentFragment(),N=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{T.querySelector(e)}catch(t){return A.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},P.blockSelector=N(P.blockSelector),P.maskSelector=N(P.maskSelector),P.unmaskSelector=N(P.unmaskSelector),P)}return y&&Object.keys(y).length>0&&(i.targetingConfig=y),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:ke(i)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:p}]}var P,A,T,N})})},e}(),Pe=function(e,t){return i(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new Oe(e,t),n=new q(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new Re(n,r)]})})};function Ae(e){if(e.type!==Ee.IncrementalSnapshot)return!1;var t=e.data;return t.source===Ie.Mutation&&!t.isAttachIframe}function Te(e){var t,r,n,s,i=e[0],a=new Map,u=new Map,h=new Map,d=new Map,p=new Map;e.forEach(function(e,t){var r,n,s,o,i=e.data;try{for(var c=l(i.adds),f=c.next();!f.done;f=c.next()){var m=f.value;a.has(m.node.id)||a.set(m.node.id,t),u.set(m.node.id,t),p.set(m.node.id,m.parentId)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}try{for(var g=l(i.removes),y=g.next();!y.done;y=g.next()){var v=y.value;h.has(v.id)||h.set(v.id,t),d.set(v.id,t)}}catch(e){s={error:e}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(s)throw s.error}}});var f=new Set,m=new Set;try{for(var g=l(a),y=g.next();!y.done;y=g.next()){var v=c(y.value,2),w=v[0],b=v[1],S=h.get(w);if(void 0!==S)u.get(w)>=d.get(w)||(b<S?f.add(w):S<b&&m.add(w))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}var C=new Set;if(f.size>0||m.size>0)for(var k=!0;k;){k=!1;try{for(var x=(n=void 0,l(p)),O=x.next();!O.done;O=x.next()){var E=c(O.value,2),I=E[0],M=E[1];if(!f.has(I)&&!m.has(I)&&!C.has(I)&&(f.has(M)||m.has(M)||C.has(M))){var R=h.get(I),P=a.get(I);void 0!==R&&void 0!==P&&R<P?m.add(I):void 0!==R&&void 0!==P&&R===P?C.add(I):f.add(I),k=!0}}}catch(e){n={error:e}}finally{try{O&&!O.done&&(s=x.return)&&s.call(x)}finally{if(n)throw n.error}}}var A=f.size>0||m.size>0||C.size>0,T=[];e.forEach(function(e,t){var r,n;try{for(var s=l(e.data.removes),o=s.next();!o.done;o=s.next()){var i=o.value;f.has(i.id)||(m.has(i.id)&&t>=a.get(i.id)||C.has(i.id)&&(f.has(i.parentId)||m.has(i.parentId)||C.has(i.parentId))||T.push(i))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}});var N=e.flatMap(function(e){return e.data.adds}),L=e.flatMap(function(e){return e.data.texts}),_=e.flatMap(function(e){return e.data.attributes}),D={source:Ie.Mutation,removes:T,adds:A?N.filter(function(e){return!f.has(e.node.id)&&!m.has(e.node.id)&&!C.has(e.node.id)}):N,texts:A?L.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):L,attributes:A?_.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):_};return o(o({},i),{data:D})}function Ne(e){if(e.length<=1)return e;for(var t=[],r=0;r<e.length;)if(Ae(e[r])){for(var n=r+1;n<e.length&&Ae(e[n]);)n++;t.push(n>r+1?Te(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}var Le=function(){function e(e,t,r,n,s){var o,i=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,s=t.delay,o=t.data;return null!=s?JSON.stringify({type:r,timestamp:n,delay:s,data:o}):JSON.stringify({type:r,timestamp:n,data:o})},this.addCompressedEventToManager=function(e,t){i.eventsManager&&i.deviceId&&i.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:i.deviceId})},this.addCompressedEvent=function(e,t){if(i.worker)try{i.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?i.worker.postMessage(JSON.stringify({event:e,sessionId:t})):i.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=i.compressEvent(e);i.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=i.worker)||void 0===e||e.terminate()};var a=m();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(o=t.performanceConfig)||void 0===o?void 0:o.timeout)||2e3,this.onFullSnapshotProcessed=s,n){t.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([n],{type:"application/javascript"}),c=URL.createObjectURL(l),u=new Worker(c);u.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),u.terminate(),i.worker=void 0},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;i.addCompressedEventToManager(r,n)},this.worker=u}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}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,n,s,o;if(e.type===Ee.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var i=u(u([],c(this.taskQueue.splice(0)),!1),c(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=l(i),h=a.next();!h.done;h=a.next()){var d=h.value,p=this.compressEvent(d.event);this.addCompressedEventToManager(p,d.sessionId)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}this.isProcessing=!1}var f=this.compressEvent(e);return this.addCompressedEventToManager(f,t),void(null===(s=this.onFullSnapshotProcessed)||void 0===s||s.call(this))}this.canUseIdleCallback&&(null===(o=this.config.performanceConfig)||void 0===o?void 0:o.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.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){var t,r=this;for(this.pendingQueue.length>0&&(t=this.taskQueue).push.apply(t,u([],c(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var s=n.event,o=n.sessionId;this.addCompressedEvent(s,o)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(e){r.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e.prototype.mergeMutationTasks=function(e){var t,r,n;if(!(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var s=[],o=0;o<e.length;){for(var i=e[o].sessionId,a=o+1;a<e.length&&e[a].sessionId===i;)a++;var c=Ne(e.slice(o,a).map(function(e){return e.event}));try{for(var u=(t=void 0,l(c)),h=u.next();!h.done;h=u.next()){var d=h.value;s.push({event:d,sessionId:i})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}o=a}return s},e}(),_e="Session replay event batch rejected due to exceeded retry count",De="Failed to store session replay events in IndexedDB",Fe="1.39.0";function Ue(e,t){return i(this,void 0,void 0,function(){var r,n,s,o,c,u,h,d,p,f,m,g,y,v,w=this;return a(this,function(b){switch(b.label){case 0:return b.trys.push([0,4,,5]),r=t.CompressionStream,n=new r("gzip"),s=n.writable.getWriter(),o=n.readable.getReader(),c=[],u=i(w,void 0,void 0,function(){var e,t,r;return a(this,function(n){switch(n.label){case 0:return[4,o.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];c.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,s.write((new TextEncoder).encode(e))];case 1:return b.sent(),[4,s.close()];case 2:return b.sent(),[4,u];case 3:b.sent(),h=c.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(h),p=0;try{for(f=l(c),m=f.next();!m.done;m=f.next())g=m.value,d.set(g,p),p+=g.length}catch(e){y={error:e}}finally{try{m&&!m.done&&(v=f.return)&&v.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return b.sent(),[2,null];case 5:return[2]}})})}var je=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher,s=e.workerScript,o=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t,s)try{var i=new Blob([s],{type:"application/javascript"}),a=URL.createObjectURL(i),u=new Worker(a);u.onerror=function(e){var t,n;e.preventDefault(),r.error("Track destination worker failed, falling back to main-thread sending: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),u.terminate(),o.worker=void 0;try{for(var s=l(o.pendingWorkerRequests),i=s.next();!i.done;i=s.next()){var a=c(i.value,2)[1];r.warn("Session replay event send failed due to worker crash: ".concat(e.message)),a.resolve()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}o.pendingWorkerRequests.clear()},u.onmessage=function(e){var t=e.data;if("log"===t.type)r.log(t.message);else if("warn"===t.type)r.warn(t.message);else if("complete"===t.type){var n=o.pendingWorkerRequests.get(t.id);n&&(o.completeRequest({context:n.context}),n.resolve(),o.pendingWorkerRequests.delete(t.id))}},this.worker=u}catch(e){r.error("Failed to create track destination worker, falling back to main-thread sending:",e)}}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.sendBeacon=function(e){var t,r,n=e.events,s=e.sessionId,o=e.deviceId,i=e.apiKey,a=e.serverZone,l=function(e){return new Blob([e]).size},c=n,u=JSON.stringify({version:2,events:c});if(l(u)>65536){for(var h=0,d=c.length;h<d;){var p=Math.floor((h+d+1)/2);l(JSON.stringify({version:2,events:c.slice(0,p)}))<=65536?h=p:d=p-1}c=c.slice(0,h),u=JSON.stringify({version:2,events:c}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(n.length," to ").concat(c.length," events"))}if(0!==c.length){var f=new URLSearchParams({device_id:o,session_id:String(s),type:"replay",api_key:i}),g="".concat(de(a,this.trackServerUrl),"?").concat(f.toString()),y=m();try{var v=new Blob([u],{type:"application/json"});!1===(null===(r=null===(t=null==y?void 0:y.navigator)||void 0===t?void 0:t.sendBeacon)||void 0===r?void 0:r.call(t,g,v))&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch(e){}}},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:_e}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),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),i(this,void 0,void 0,function(){var t,r,n,s,o,i,c;return a(this,function(a){switch(a.label){case 0:t=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(t),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,this.send(s,e)]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 8:return[2]}})})},e.prototype.send=function(e,t){return void 0===t&&(t=!0),i(this,void 0,void 0,function(){var r,n,s,o;return a(this,function(i){return(r=e.apiKey)?(n=e.deviceId)?0===(s=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(o=this.worker)?[2,this.sendViaWorker(o,e,s,t)]:[2,this.sendOnMainThread(r,n,e,s,t)]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})]})})},e.prototype.sendViaWorker=function(e,t,r,n){return i(this,void 0,void 0,function(){var s,o=this;return a(this,function(i){return s="".concat(++this.sendIdCounter),[2,new Promise(function(i){var a;o.pendingWorkerRequests.set(s,{context:t,resolve:i}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(a=t.flushMaxRetries)&&void 0!==a?a:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:o.trackServerUrl,version:t.version,currentUrl:ve(),sdkVersion:Fe}})})]})})},e.prototype.sendOnMainThread=function(e,t,r,n,s){var l,c,u,h;return i(this,void 0,void 0,function(){var i,d,p,f,g,y,v,w,b,S,C,k,x,O;return a(this,function(a){switch(a.label){case 0:i=ve(),d=Fe,p=r.sampleRate,f=new URLSearchParams({device_id:t,session_id:"".concat(r.sessionId),type:"".concat(r.type)}),g="".concat(null!==(c=null===(l=r.version)||void 0===l?void 0:l.type)&&void 0!==c?c:"standalone","/").concat(null!==(h=null===(u=r.version)||void 0===u?void 0:u.version)&&void 0!==h?h:d),a.label=1;case 1:return a.trys.push([1,9,,10]),y=JSON.stringify(n),(v=m())&&"CompressionStream"in v?[4,Ue(y,v)]:[3,3];case 2:return b=a.sent(),[3,4];case 3:b=null,a.label=4;case 4:return w=b,S={headers:o({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":d,"X-Client-Library":g,"X-Client-Url":i.substring(0,1e3),"X-Client-Sample-Rate":"".concat(p),"X-Sampling-Hash-Alg":"xxhash32"},w?{"Content-Encoding":"gzip"}:{}),body:null!=w?w:y,method:"POST"},C="".concat(de(r.serverZone,this.trackServerUrl),"?").concat(f.toString()),[4,fetch(C,S)];case 5:if(null===(k=a.sent()))return this.completeRequest({context:r,err:"Unexpected error occurred"}),[2];if(s)return[3,6];x="";try{x=JSON.stringify(k.body,null,2)}catch(e){}return this.completeRequest({context:r,success:"".concat(k.status,": ").concat(x)}),[3,8];case 6:return[4,this.handleReponse(k.status,r)];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:return O=a.sent(),this.completeRequest({context:r,err:O}),[3,10];case 10:return[2]}})})},e.prototype.handleReponse=function(e,t){return i(this,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:switch(r=(new U).buildStatus(e),r){case h.Success:return[3,1];case h.Failed:case h.Timeout:case h.RateLimit:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(t),[3,7];case 2:return[4,this.handleOtherResponse(t)];case 3:return n.sent(),[3,7];case 4:return 499!==e?[3,6]:[4,this.handleOtherResponse(t)];case 5:return n.sent(),[3,7];case 6:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),n.label=7;case 7:return[2]}})})},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){return i(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return t=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:_e}),[2]):[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},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 Be=(e,t)=>t.some(t=>e instanceof t);let ze,We;const $e=new WeakMap,qe=new WeakMap,Ve=new WeakMap;let Ge={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return $e.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ye(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function He(e){Ge=e(Ge)}function Je(e){return(We||(We=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Xe(this),t),Ye(this.request)}:function(...t){return Ye(e.apply(Xe(this),t))}}function Ke(e){return"function"==typeof e?Je(e):(e instanceof IDBTransaction&&function(e){if($e.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)});$e.set(e,t)}(e),Be(e,ze||(ze=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Ge):e)}function Ye(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(Ye(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return Ve.set(t,e),t}(e);if(qe.has(e))return qe.get(e);const t=Ke(e);return t!==e&&(qe.set(e,t),Ve.set(t,e)),t}const Xe=e=>Ve.get(e);function Ze(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=Ye(i);return n&&i.addEventListener("upgradeneeded",e=>{n(Ye(i.result),e.oldVersion,e.newVersion,Ye(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 Qe=["get","getKey","getAll","getAllKeys","count"],et=["put","add","delete","clear"],tt=new Map;function rt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(tt.get(t))return tt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=et.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Qe.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 tt.set(t,o),o}He(e=>({...e,get:(t,r,n)=>rt(t,r)||e.get(t,r,n),has:(t,r)=>!!rt(t,r)||e.has(t,r)}));const nt=["continue","continuePrimaryKey","advance"],st={},ot=new WeakMap,it=new WeakMap,at={get(e,t){if(!nt.includes(t))return e[t];let r=st[t];return r||(r=st[t]=function(...e){ot.set(this,it.get(this)[t](...e))}),r}};async function*lt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,at);for(it.set(r,t),Ve.set(r,Xe(t));t;)yield r,t=await(ot.get(r)||t.continue()),ot.delete(r)}function ct(e,t){return t===Symbol.asyncIterator&&Be(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Be(e,[IDBIndex,IDBObjectStore])}He(e=>({...e,get:(t,r,n)=>ct(t,r)?lt:e.get(t,r,n),has:(t,r)=>ct(t,r)||e.has(t,r)}));var ut,ht,dt,pt=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=s.getStringSize(t);return s.getEventsArraySize(e)+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.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=l(e),o=s.next();!o.done;o=s.next()){var i=o.value;n+=this.getStringSize(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}(),ft=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)},mt="sessionCurrentSequence",gt="sequencesToSend",yt=function(e){var t,r;return e.objectStoreNames.contains(mt)||(r=e.createObjectStore(mt,{keyPath:"sessionId"})),e.objectStoreNames.contains(gt)||(t=e.createObjectStore(gt,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},vt=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,Ze(e,1,{upgrade:yt})];case 1:return[2,t.sent()]}})})},wt=function(e){function t(t){var r,n=this;return(n=e.call(this,t)||this).consecutiveFailures=0,n.hasTriggeredFallback=!1,n.getSequencesToSend=function(){return i(n,void 0,void 0,function(){var e,t,r,n,s,o,i,l,c=this;return a(this,function(a){switch(a.label){case 0:e=!1,a.label=1;case 1:return a.trys.push([1,6,,7]),t=[],(r=this.db.transaction("sequencesToSend")).done.catch(function(t){e||ft(c.loggerProvider,"".concat(De,": ").concat(t),t)}),[4,r.store.openCursor()];case 2:n=a.sent(),a.label=3;case 3:return n?(s=n.value,o=s.sessionId,i=s.events,t.push({events:i,sequenceId:n.key,sessionId:o}),[4,n.continue()]):[3,5];case 4:return n=a.sent(),[3,3];case 5:return this.recordSuccess(),[2,t];case 6:return l=a.sent(),e=!0,ft(this.loggerProvider,"".concat(De,": ").concat(l),l),this.recordFailure(),[3,7];case 7:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return i(n,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(mt,e)];case 1:return(t=s.sent())?[4,this.db.put(gt,{sessionId:e,events:t.events})]:(this.recordSuccess(),[2,void 0]);case 2:return r=s.sent(),[4,this.db.put(mt,{sessionId:e,events:[]})];case 3:return s.sent(),this.recordSuccess(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),ft(this.loggerProvider,"".concat(De,": ").concat(n),n),this.recordFailure(),[3,5];case 5:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return i(n,void 0,void 0,function(){var r,n,s,o,i,l,c=this;return a(this,function(a){switch(a.label){case 0:r=!1,a.label=1;case 1:return a.trys.push([1,9,,10]),(n=this.db.transaction([mt,gt],"readwrite")).done.catch(function(e){r||ft(c.loggerProvider,"".concat(De,": ").concat(e),e)}),[4,n.objectStore(mt).get(e)];case 2:return(s=a.sent())?[3,4]:[4,n.objectStore(mt).put({sessionId:e,events:[t]})];case 3:return a.sent(),this.recordSuccess(),[2,void 0];case 4:return this.shouldSplitEventsList(s.events,t)?[3,6]:[4,n.objectStore(mt).put({sessionId:e,events:s.events.concat(t)})];case 5:return a.sent(),this.recordSuccess(),[2,void 0];case 6:return o=s.events,[4,n.objectStore(mt).put({sessionId:e,events:[t]})];case 7:return a.sent(),[4,n.objectStore(gt).put({sessionId:e,events:o})];case 8:return i=a.sent(),this.recordSuccess(),[2,{events:o,sessionId:e,sequenceId:i}];case 9:return l=a.sent(),r=!0,ft(this.loggerProvider,"".concat(De,": ").concat(l),l),this.recordFailure(),[3,10];case 10:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return i(n,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.db.put(gt,{sessionId:e,events:t})];case 1:return r=s.sent(),this.recordSuccess(),[2,r];case 2:return n=s.sent(),ft(this.loggerProvider,"".concat(De,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return i(n,void 0,void 0,function(){var e;return a(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(gt,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),ft(this.loggerProvider,"".concat(De,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},n.db=t.db,n.onPersistentFailure=t.onPersistentFailure,n.consecutiveFailureThreshold=null!==(r=t.consecutiveFailureThreshold)&&void 0!==r?r:3,n}return r(t,e),t.prototype.recordFailure=function(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))},t.prototype.recordSuccess=function(){this.consecutiveFailures=0},t.new=function(e,r){return i(this,void 0,void 0,function(){var n,s,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="replay"===e?"":"_".concat(e),s="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(n),[4,vt(s)];case 1:return i=a.sent(),[2,new t(o(o({},r),{db:i}))];case 2:return l=a.sent(),ft(r.loggerProvider,"".concat(De,": ").concat(l),l),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return i(this,void 0,void 0,function(){var t,r,n,s,o,i,c;return a(this,function(a){switch(a.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=a.sent())?[2,[s]]:[2,void 0];case 2:t=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=l.apply(void 0,[a.sent()]),n=r.next(),a.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),a.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=a.sent(),i={error:o},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 10:return[2,t]}})})},t}(pt),bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=u([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return i(this,void 0,void 0,function(){return a(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],s=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:s,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return i(this,void 0,void 0,function(){var r;return a(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]})})},t.prototype.storeSendingEvents=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(pt),St=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.type,l=e.payloadBatcher,h=e.storeType,d=e.trackDestinationWorkerScript;return i(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(t){return[2,p.flush(e)]})})}var p,f,m,g,y,v,w,b,S,C,k,x,O,E,I;return a(this,function(M){switch(M.label){case 0:return p=new je(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:l,workerScript:d})),f=function(){return new bt({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r})},g=!1,v=function(){return i(void 0,void 0,void 0,function(){var e,r,n;return a(this,function(s){switch(s.label){case 0:return g?(g=!1,t.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),m?[4,y.getSequencesToSend()]:[3,2]):[2];case 1:return r=s.sent(),[3,3];case 2:r=void 0,s.label=3;case 3:return e=r,y=f(),e&&m&&(n=m,e.forEach(function(e){x({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},w=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(o){switch(o.label){case 0:return[4,wt.new(s,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,apiKey:t.apiKey,onPersistentFailure:function(){v()}})];case 1:return(e=o.sent())?(g=!0,[2,e]):(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,f()])}})})},"idb"!==h?[3,2]:[4,w()];case 1:return b=M.sent(),[3,3];case 2:b=f(),M.label=3;case 3:return y=b,S=[],C=0,k=function(e){if(!(e<=C)){var t=Math.min(e-C,S.length);t>0&&(S.splice(0,t),C=e)}},x=function(e){var r=e.events,n=e.sessionId,o=e.deviceId,l=e.sequenceId;t.debugMode&&Ce().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(){}),p.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:o,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return i(void 0,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,y.cleanUpSessionEventsStore(n,l)];case 1:return e.sent(),[2]}})})}})},O=function(e){var r=e.sessionId,n=e.deviceId;m=n;var s=C+S.length;y.storeCurrentSequence(r).then(function(e){e&&(k(s),x({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)})},E=function(e){var t=e.deviceId;return i(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return m=t,[4,y.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){x({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},I=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;m=s;var o=C+S.length;S.push(r.data),y.addEventToCurrentSequence(n,r.data).then(function(e){e&&(k(o),x({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:O,addEvent:I,sendStoredEvents:E,flush:e,getBeaconEvents:function(){return u([],c(S),!1)},trackDestination:p}]}})})},Ct=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 i(this,void 0,void 0,function(){var t;return a(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 i(this,void 0,void 0,function(){var t;return a(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 kt(e,t){if(dt=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 r={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};ut=o(o({},r),t),ht=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(ut.root,r);var n=xt(e,"all",function(){return xt(e,"two",function(){return xt(e,"one",function(){return xt(e,"none")})})});if(n){var s=Lt(_t(n,e));return s.length>0&&(n=s[0]),Et(n)}throw new Error("Selector was not found.")}function xt(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,h=(new Date).getTime()-dt.getTime();if(void 0!==ut.timeoutMs&&h>ut.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=At(function(e){var t=e.getAttribute("id");if(t&&ut.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||At.apply(void 0,u([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return ut.attr(e.name,e.value)});return t.map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(o)),!1))||At.apply(void 0,u([],c(function(e){var t=Array.from(e.classList).filter(ut.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||At(function(e){var t=e.tagName.toLowerCase();if(ut.tagName(t))return{name:t,penalty:2};return null}(o))||[{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}(o);if("all"==t)p&&(d=d.concat(d.filter(Pt).map(function(e){return Rt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Pt).map(function(e){return Rt(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Pt(f)&&(d=[Rt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Rt(d[0],p)]));try{for(var m=(e=void 0,l(d)),g=m.next();!g.done;g=m.next()){(f=g.value).level=i}}catch(t){e={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(e)throw e.error}}if(s.push(d),s.length>=ut.seedMinLength&&(n=Ot(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=Ot(s,r)),!n&&r?r():n}function Ot(e,t){var r,n,s=Lt(Nt(e));if(s.length>ut.threshold)return t?t():null;try{for(var o=l(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(Mt(a))return a}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function Et(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 It(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Mt(e){var t=Et(e);switch(ht.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 Rt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Pt(e){return"html"!==e.name&&!e.name.startsWith("#")}function At(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Tt);return r.length>0?r:null}function Tt(e){return null!=e}function Nt(e,t){var r,n,s,o,i,c;return void 0===t&&(t=[]),a(this,function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(e[0]),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,l(Nt(e.slice(1,e.length),t.concat(s)))]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}})}function Lt(e){return u([],c(e),!1).sort(function(e,t){return It(e)-It(t)})}function _t(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),a(this,function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>ut.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>ut.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),o=Et(s),r.visited.has(o)?[2]:Mt(s)&&function(e,t){return ht.querySelector(Et(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,l(_t(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Dt=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}},Ft=function(e){var t=e.version,r=e.events,n=[];r.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)});var s=n.reduce(function(e,t){var r=t.x,n=t.y,s=t.selector,i=t.timestamp,a=i-i%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=o(o({},t),{timestamp:a,count:1}),e},{});return{version:t,events:Object.values(s)}},Ut=function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,s=e.deviceIdFn,o=e.mirror,i=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type===Me.Click){var l=m();if(l){var c=l.location,u=l.innerHeight,h=l.innerWidth;if(c){var d=e.x,p=e.y;if(void 0!==d&&void 0!==p){var f,g=o.getNode(e.id);if(g)try{f=kt(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var y=Se(c.href,i),v={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:u,viewportWidth:h,pageUrl:y,timestamp:Date.now(),type:"click"},w=s();w&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(v)},deviceId:w})}}}}}},this.logger=e,this.scrollWatcher=t};function jt(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Bt(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var zt=function(){function e(e,t){var r=m();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=de(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}(),Wt=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,i,a=e(),l=m();if(l&&a){var c=null!==(n=l.scrollX)&&void 0!==n?n:0,u=null!==(s=l.scrollY)&&void 0!==s?s:0;(c>0||u>0)&&r.update({id:1,x:c,y:u}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:jt(),viewportWidth:Bt(),pageUrl:Se(l.location.href,null!==(i=null===(o=r.config.interactionConfig)||void 0===o?void 0:o.ugcFilterRules)&&void 0!==i?i:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Bt(),this._maxScrollHeight=jt(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new zt(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}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=Bt();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=jt();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),$t=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))},qt=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,Ze(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return i(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId;return i(e,void 0,void 0,function(){var e,t,o,i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return i=a.sent(),ft(r,"Failed to get targeting match for session id ".concat(s,": ").concat(i),i),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId,o=t.targetingMatch;return i(e,void 0,void 0,function(){var e,t,i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return i=a.sent(),ft(r,"Failed to store targeting match for session id ".concat(s,": ").concat(i),i),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return i(e,void 0,void 0,function(){var e,t,o,i,l,c,u,h;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:i=a.sent(),l=0,a.label=3;case 3:return l<i.length?(c=i[l],u=Date.now()-c.lastUpdated,c.sessionId!==t&&u>1728e5?[4,o.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:return l++,[3,3];case 6:return[4,o.done];case 7:return a.sent(),[3,9];case 8:return h=a.sent(),ft(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},Vt=new qt,Gt=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,l=e.targetingParams,c=e.urlChange,u=void 0!==c&&c;return i(void 0,void 0,void 0,function(){var e,i,c,h,d,p;return a(this,function(a){switch(a.label){case 0:return[4,Vt.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,Vt.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===a.sent()&&!u)return[2,!0];e=!0,a.label=3;case 3:return a.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return cn})];case 4:return i=a.sent().evaluateTargeting,c=o(o({},l),{flag:r,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:s,loggerProvider:n}),[4,i(c)];case 5:return(h=a.sent())&&h.sr_targeting_config&&(e="on"===h.sr_targeting_config.key),Vt.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return d=a.sent(),p=d,n.warn(p.message),[3,7];case 7:return[2,e]}})})},Ht=2654435761,Jt=2246822519,Kt=3266489917,Yt=374761393;function Xt(e,t){return(e<<t|e>>>32-t)>>>0}function Zt(e,t){return e=Xt(e=e+Math.imul(t,Jt)>>>0,13),e=Math.imul(e,Ht)>>>0}function Qt(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function er(e,t){void 0===t&&(t=0);var r,n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){var s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(n=s-56320+(n-55296<<10)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),s=n.length,o=0;if(s>=16){for(var i=t+Ht+Jt>>>0,a=t+Jt>>>0,l=t>>>0,c=t-Ht>>>0;o<=s-16;)i=Zt(i,Qt(n,o)),a=Zt(a,Qt(n,o+=4)),l=Zt(l,Qt(n,o+=4)),c=Zt(c,Qt(n,o+=4)),o+=4;r=Xt(i,1)+Xt(a,7)+Xt(l,12)+Xt(c,18)>>>0}else r=t+Yt>>>0;for(r=r+s>>>0;o<=s-4;)r=r+Math.imul(Qt(n,o),Kt)>>>0,r=Math.imul(Xt(r,17),668265263)>>>0,o+=4;for(;o<s;)r=r+Math.imul(n[o],Yt)>>>0,r=Math.imul(Xt(r,11),Ht)>>>0,o++;return r^=r>>>15,r=Math.imul(r,Jt)>>>0,r^=r>>>13,r=Math.imul(r,Kt)>>>0,(r^=r>>>16)>>>0}var tr="__amplitude_url_tracking_patched__",rr=new WeakMap;function nr(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,s=void 0!==n&&n,o=r.pollingInterval,i=void 0===o?se:o;if(s){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),c=e.setInterval(function(){var e=a();e!==l&&(l=e,t(e))},i);return function(){null!=c&&e.clearInterval(c)}}var u=rr.get(e);if(!u){var h=void 0,d=new Set,p=function(){var t=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&t===h||(h=t,d.forEach(function(e){return e(t)}))},f=function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return p(),n};return t[tr]=!0,t},m=e.history;if(null==m?void 0:m.pushState){var g=Reflect.get(m,"pushState");g[tr]||(m.pushState=f(g))}if(null==m?void 0:m.replaceState){var y=Reflect.get(m,"replaceState");y[tr]||(m.replaceState=f(y))}u={callbacks:d,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},rr.set(e,u)}var v=u;return v.listenersAttached||(e.addEventListener("popstate",v.onPopStateOrHashChange),e.addEventListener("hashchange",v.onPopStateOrHashChange),v.listenersAttached=!0),v.callbacks.add(t),function(){v.callbacks.delete(t),0===v.callbacks.size&&v.listenersAttached&&(e.removeEventListener("popstate",v.onPopStateOrHashChange),e.removeEventListener("hashchange",v.onPopStateOrHashChange),v.listenersAttached=!1)}}function sr(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var s,i,a,l=o(o({},e),n),c=l.ugcFilterRules||[],u=null!==(s=l.enablePolling)&&void 0!==s&&s,h=null!==(i=l.pollingInterval)&&void 0!==i?i:se,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f=function(){return r.location&&r.location.href||""},m=function(){var e=f();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=f(),o="";return d&&(o=(null==n?void 0:n.title)||""),{href:c.length>0?Se(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=nr(r,function(){return m()},u?{enablePolling:!0,pollingInterval:h}:{});return m(),function(){return g()}},options:e}}sr();var or,ir,ar,lr=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.recordEventsInFlight=!1,this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var r=m();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(){if(e.recordCancelCallback&&e.recordFunction)try{e.recordFunction.takeFullSnapshot(!0)}catch(t){e.loggerProvider.warn("Failed to take full snapshot on focus:",t)}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,o){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),i(e,void 0,void 0,function(){var e,i,l,c,u,h,d,p,f,g,y,v;return a(this,function(a){switch(a.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,e=this.config.targetingConfig,e&&!this.sessionTargetingMatch?(i=o?this.latestUrlChangeTargetingEvaluationId:void 0,(l=t.event)&&Object.values(s).includes(l.event_type)&&(l=void 0),c=null!==(y=null!==(p=null===(d=t.page)||void 0===d?void 0:d.url)&&void 0!==p?p:null===(g=null===(f=m())||void 0===f?void 0:f.location)||void 0===g?void 0:g.href)&&void 0!==y?y:"",u=null!==(v=t.page)&&void 0!==v?v:""!==c?{url:c}:void 0,[4,Gt({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:l,page:u},urlChange:o})]):[3,2];case 1:if(h=a.sent(),o&&void 0!==i&&i!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(i,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||h,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:l,targetingParams:t},null,2)),a.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return!n&&this.recordCancelCallback?[3,5]:(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]);case 4:a.sent(),a.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),i(e,void 0,void 0,function(){var e,s,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==Q.METADATA?(e={config:ke(s),version:Fe},n?[4,Ce()]:[3,2]):[3,2];case 1:i=a.sent(),e=o(o({},i),e),a.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,o(o({},r),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=a.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 ue(new b)}return e.prototype.init=function(e,t){return v(this._init(e,t))},e.prototype.setupUrlChangeListener=function(){var e,t,r=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var n=m();if(null==n?void 0:n.location){var s=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),o=nr(n,function(e){if(r.currentPageUrl=e,s){var t=++r.latestUrlChangeTargetingEvaluationId;r.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),r.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(t," for ").concat(e,"."))}});this.urlChangeCleanup=function(){o(),r.urlChangeCleanup=null}}},e.prototype.getCurrentPageForTargeting=function(){var e,t,r=null===(t=null===(e=m())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0},e.prototype._init=function(e,t){var r,n,s,l,h,d,p,f,g,y,v;return i(this,void 0,void 0,function(){var i,w,S,C,k,x,O,E,I,M,R,P,A,T,N,L,_,D,F,U,j,B=this;return a(this,function(a){switch(a.label){case 0:return null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.loggerProvider=new ue(t.loggerProvider||new b),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=ve(),this.identifiers=new $t({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,Pe(e,t)];case 1:return i.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return w=a.sent(),S=w.joinedConfig,C=w.localConfig,k=w.remoteConfig,this.config=S,this.setMetadata(t.sessionId,S,C,k,null===(n=t.version)||void 0===n?void 0:n.version,Fe,null===(s=t.version)||void 0===s?void 0:s.type),this.pageLeaveFns=[],t.sessionId&&(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled)&&(x=Wt.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[x.send(this.getDeviceId.bind(this)).bind(x)],this.scrollHook=x.hook.bind(x),this.clickHandler=new Ut(this.loggerProvider,x)),O=[],"idb"!==(E=this.config.storeType)||(null===(h=m())||void 0===h?void 0:h.indexedDB)||(E="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(E," for event storage.")),R=m(),this.config.useWebWorker&&R&&R.Worker?[4,Promise.resolve().then(function(){return un})]:[3,4];case 3:P=a.sent(),A=P.compressionScript,T=P.trackDestinationScript,I=A,M=T,a.label=4;case 4:return a.trys.push([4,6,,7]),[4,St({config:this.config,type:"replay",storeType:E,trackDestinationWorkerScript:M})];case 5:return N=a.sent(),O.push({name:"replay",manager:N}),[3,7];case 6:return L=a.sent(),U=L,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(U.toString())),[3,7];case 7:if(!(null===(d=this.config.interactionConfig)||void 0===d?void 0:d.enabled))return[3,11];_=this.config.interactionConfig.batch?Ft:Dt,a.label=8;case 8:return a.trys.push([8,10,,11]),[4,St({config:this.config,type:"interaction",minInterval:null!==(p=this.config.interactionConfig.trackEveryNms)&&void 0!==p?p:3e4,maxInterval:6e4,payloadBatcher:_,storeType:E,trackDestinationWorkerScript:M})];case 9:return D=a.sent(),O.push({name:"interaction",manager:D}),[3,11];case 10:return F=a.sent(),U=F,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(U.toString())),[3,11];case 11:return this.eventsManager=new(Ct.bind.apply(Ct,u([void 0],c(O),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new Le(this.eventsManager,this.config,this.getDeviceId(),I,function(){return B.sendEvents()}),this.pageLeaveFns=u(u([],c(this.pageLeaveFns),!1),[function(){var e;if(B.config&&(null===(e=B.identifiers)||void 0===e?void 0:e.sessionId)&&N){var t=N.getBeaconEvents();if(t.length){var r=B.getDeviceId();r&&N.trackDestination.sendBeacon({events:t,sessionId:B.identifiers.sessionId,deviceId:r,apiKey:B.config.apiKey,serverZone:B.config.serverZone})}}}],!1),[4,this.initializeNetworkObservers()];case 12:return a.sent(),(null===(f=m())||void 0===f?void 0:f.opener)&&(function(e,t){var r,n=e;if(!0!==n[Z]){n[Z]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",o=null,i=function(t,r){var n,s;"background-capture-complete"===t&&(null===(s=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===s||s.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var n=new URL(s,e.endpoint).toString();e.loadScriptOnce(n).then(function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),o=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:i}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}(j=X()),j.setup(o({logger:this.loggerProvider},this.config.serverZone&&{endpoint:H[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return a.sent(),(this.config.targetingConfig||(null!==(v=null===(y=null===(g=this.config.privacyConfig)||void 0===g?void 0:g.urlMaskLevels)||void 0===y?void 0:y.length)&&void 0!==v?v:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return v(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return i(this,void 0,void 0,function(){var s,o,i;return a(this,function(a){switch(a.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),o=t||this.getDeviceId(),this.identifiers=new $t({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:i=a.sent().joinedConfig,this.config=i,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[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={})[te]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[oe]=JSON.stringify({appHash:F(t.apiKey).toString()}))),this.addCustomRRWebEvent(Q.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),i(this,void 0,void 0,function(){var r;return a(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=d),D.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=!1,n="",s=!1;this.config.targetingConfig?this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),r=!0,s=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,s=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,er(e.toString())%1e6/1e6<t)?(r=!0,s=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,s=!1);return this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Q.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:s,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},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=null===(e=this.config)||void 0===e?void 0:e.privacyConfig;if("conservative"===(r?fe(this.currentPageUrl,r):void 0))return"*";if(null===(t=null==r?void 0:r.urlMaskLevels)||void 0===t?void 0:t.some(function(e){return"conservative"===e.maskLevel}))return"*";var n=null==r?void 0:r.urlMaskLevels;if("conservative"===(null==r?void 0:r.defaultMaskLevel)&&n&&n.length>0)return"*";var s=null==r?void 0:r.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,o,l;return i(this,void 0,void 0,function(){var i,c,u,h;return a(this,function(a){switch(a.label){case 0:i=[];try{c=sr({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(o=this.config)||void 0===o?void 0:o.captureDocumentTitle}),i.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(l=null==e?void 0:e.console)||void 0===l?void 0:l.enabled))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Oa})];case 2:return u=a.sent().getRecordConsolePlugin,i.push(u({level:e.console.levels})),[3,4];case 3:return h=a.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,i.length>0?i:void 0]}})})},e.prototype.getRecordFunction=function(){return i(this,void 0,void 0,function(){var e,t;return a(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Sp})];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,r.label=1;case 1:return r.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:r.sent(),r.label=3;case 3:return null===this.recordEventsPendingShouldLogMetadata?[3,5]:(t=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(t)]);case 4:return r.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},e.prototype._recordEvents=function(e){var t,r,n,s,o,l,c,u;return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var i,h,d,p,f,m,g,y,v,w,b,S,C,k,x,O,E=this;return a(this,function(a){switch(a.label){case 0:return i=this.config,h=this.getShouldRecord(),d=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,h&&d&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(p=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),f=null===(r=i.loggingConfig)||void 0===r?void 0:r.network,m=de(i.serverZone,i.trackServerUrl),g=[ae,le,ce,m],null===(n=this.networkObservers)||void 0===n||n.start(function(e){g.some(function(t){return e.url.startsWith(t)})||E.addCustomRRWebEvent(Q.FETCH_REQUEST,e)},f),y=i.privacyConfig,v=i.interactionConfig,w=i.loggingConfig,b=(null==v?void 0:v.enabled)?{mouseInteraction:this.eventsManager&&(null===(s=this.clickHandler)||void 0===s?void 0:s.createHook({eventsManager:this.eventsManager,sessionId:d,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(o=v.ugcFilterRules)&&void 0!==o?o:[],performanceOptions:null===(l=i.performanceConfig)||void 0===l?void 0:l.interaction})),scroll:this.scrollHook}:{},S=(null==v?void 0:v.enabled)&&v.ugcFilterRules?v.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(d,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),C=this,k=p,O={emit:function(e){if(E.shouldOptOut())return E.loggerProvider.log("Opting session ".concat(d," out of recording due to optOut config.")),E.stopRecordingEvents(),void E.sendEvents();e.type===Ee.Meta&&(e.data.href=Se(e.data.href,S)),E.eventCompressor&&E.eventCompressor.enqueueEvent(e,d)},inlineStylesheet:i.shouldInlineStylesheet,hooks:b,maskAllInputs:!0,maskTextClass:ie,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:ge("input",y,function(){return E.currentPageUrl}),maskTextFn:ge("text",y,function(){return E.currentPageUrl}),maskAttributeFn:ye(y,function(){return E.currentPageUrl}),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,captureAdoptedStyleSheets:i.captureAdoptedStyleSheets,slimDOMOptions:{script:null===(c=i.omitElementTags)||void 0===c?void 0:c.script,comment:null===(u=i.omitElementTags)||void 0===u?void 0:u.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return E.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(w)];case 4:return C.recordCancelCallback=k.apply(void 0,[(O.plugins=a.sent(),O)]),this.addCustomRRWebEvent(Q.DEBUG_INFO),e&&this.addCustomRRWebEvent(Q.METADATA,this.metadata),[3,6];case 5:return x=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",x),[3,6];case 6: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),i(this,void 0,void 0,function(){return a(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),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())?F(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.prototype.initializeNetworkObservers=function(){var e,t,r;return i(this,void 0,void 0,function(){var n,s;return a(this,function(o){switch(o.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Op})];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return s=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),cr=function(e){return function(){var t=e.config||xe();return{logger:t.loggerProvider,logLevel:t.logLevel}}},ur=function(){var e=new lr;return{init:O(e.init.bind(e),"init",cr(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",cr(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",cr(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",cr(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",cr(e)),flush:O(e.flush.bind(e),"flush",cr(e)),shutdown:O(e.shutdown.bind(e),"shutdown",cr(e))}}(),hr=ur.init,dr=ur.setSessionId,pr=ur.getSessionId,fr=ur.getSessionReplayProperties,mr=ur.flush,gr=ur.shutdown,yr=ur.evaluateTargetingAndCapture;!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(or||(or={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(ir||(ir={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(ar||(ar={}));const vr=[or.SET,or.SET_ONCE,or.ADD,or.APPEND,or.PREPEND,or.POSTINSERT],wr="1.28.1";class br{constructor(e){this.name=br.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:mr,getSessionId:pr,getSessionReplayProperties:fr,init:hr,setSessionId:dr,shutdown:gr,evaluateTargetingAndCapture:yr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){return i(this,void 0,void 0,function*(){var t,r,n,s,o,i,a,l,c;try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${wr}.`),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=Object.assign(Object.assign({},e.defaultTracking),{sessions:!0}));const u=(c=this.config.instanceName,void 0===c&&(c="$default_instance"),D.getInstance(c)).identityStore.getIdentity().userProperties;this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(t=this.options.deviceId)&&void 0!==t?t:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null===(r=this.config.remoteConfig)||void 0===r?void 0:r.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.blockSelector,maskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.maskSelector,unmaskSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.unmaskSelector,defaultMaskLevel:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:wr},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(a=this.options.useWebWorker)&&void 0!==a?a:null===(l=this.options.experimental)||void 0===l?void 0:l.useWebWorker,userProperties:u,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets},yield this.sessionReplay.init(e.apiKey,this.srInitOptions).promise}catch(t){null==e||e.loggerProvider.error(`Session Replay: Failed to initialize due to ${t.message}`)}})}onSessionIdChanged(e){return i(this,void 0,void 0,function*(){var t;null===(t=this.config)||void 0===t||t.loggerProvider.debug(`Analytics session id is changed to ${e}, SR session id is ${String(this.sessionReplay.getSessionId())}.`),yield this.sessionReplay.setSessionId(e).promise})}onOptOutChanged(e){return i(this,void 0,void 0,function*(){var t;null===(t=this.config)||void 0===t||t.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():null!=this.config&&(yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise)})}execute(e){return i(this,void 0,void 0,function*(){var t,r,n;try{if(this.options.customSessionId){const t=this.options.customSessionId(e);if(t){t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise);const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}else{const n=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(n&&n!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(n).promise),n&&n===e.session_id){let t;e.event_type===s.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(vr.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e));const n=m();yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t,page:null!=(null===(r=null==n?void 0:n.location)||void 0===r?void 0:r.href)?{url:n.location.href}:void 0});const o=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),o)}}return e.event_type===s.IDENTIFY&&e.event_properties&&delete e.event_properties["[Amplitude] Session Replay ID"],Promise.resolve(e)}catch(t){return null===(n=this.config)||void 0===n||n.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){return i(this,void 0,void 0,function*(){var e;try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error(`Session Replay: teardown failed due to ${t.message}`)}})}getSessionReplayProperties(){return this.sessionReplay.getSessionReplayProperties()}}br.pluginName="@amplitude/plugin-session-replay-browser";const Sr=e=>new br(e);var Cr=function(e,t){return Cr=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])},Cr(e,t)};var kr=function(){return kr=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},kr.apply(this,arguments)};function xr(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"==typeof SuppressedError&&SuppressedError;var Or="is",Er="is not",Ir="contains",Mr="does not contain",Rr="less",Pr="less or equal",Ar="greater",Tr="greater or equal",Nr="version less",Lr="version less or equal",_r="version greater",Dr="version greater or equal",Fr="set is",Ur="set is not",jr="set contains",Br="set does not contain",zr="set contains any",Wr="set does not contain any",$r="regex match",qr="regex does not match",Vr=-862048943,Gr=461845907,Hr=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,o=t,i=0;i<s;i++){var a=Xr(r,i<<2);o=Jr(a,o)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Vr),c=Yr(c,15),o^=c=Math.imul(c,Gr);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Vr),c=Yr(c,15),o^=c=Math.imul(c,Gr);break;case 1:c^=r[l],c=Math.imul(c,Vr),c=Yr(c,15),o^=c=Math.imul(c,Gr)}return Kr(o^=n)>>>0},Jr=function(e,t){var r=e,n=t;return r=Math.imul(r,Vr),r=Yr(r,15),r=Math.imul(r,Gr),n=Yr(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Kr=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},Yr=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Xr=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Zr(r)},Zr=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Qr=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(!i||!e||"object"!=typeof e)return;e=e[i]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e||void 0}},en="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),tn=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(en).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),rn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=xr(t),a=i.next();!a.done;a=i.next()){var l=a.value,c=this.evaluateFlag(o,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var o=xr(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=kr(kr(kr({},t.metadata),a.metadata),s.metadata);s=kr(kr({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,o,i;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=xr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(o=void 0,xr(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Qr(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return Hr(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(Qr(e,t.bucket.selector));if(!i||0===i.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(i),l=this.getHash(a),c=l%100,u=Math.floor(l/100);try{for(var h=xr(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],m=p.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,xr(p.distributions)),y=g.next();!y.done;y=g.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case Or:case Ir:case Rr:case Pr:case Ar:case Tr:case Nr:case Lr:case _r:case Dr:case Fr:case jr:case zr:return r;case Er:case Mr:case Br:case Wr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Fr:return this.setEquals(e,r);case Ur:return!this.setEquals(e,r);case jr:return this.matchesSetContainsAll(e,r);case Br:return!this.matchesSetContainsAll(e,r);case zr:return this.matchesSetContainsAny(e,r);case Wr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Or:return this.matchesIs(e,r);case Er:return!this.matchesIs(e,r);case Ir:return this.matchesContains(e,r);case Mr:return!this.matchesContains(e,r);case Rr:case Pr:case Ar:case Tr:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Nr:case Lr:case _r:case Dr:return this.matchesComparable(e,t,r,function(e){return tn.parse(e)},this.versionComparator);case $r:return this.matchesRegex(e,r);case qr:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(e.toLowerCase().includes(i.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var o=this,i=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===i||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return s(i,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case Rr:case Nr:return e<r;case Pr:case Lr:return e<=r;case Ar:case _r:return e>r;case Tr:case Dr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Rr:case Nr:return n<0;case Pr:case Lr:return n<=0;case Ar:case _r:return n>0;case Tr:case Dr:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case Fr:case Ur:case jr:case Br:case zr:case Wr:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(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(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}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(!this.matchesIs(i,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(this.matchesIs(i,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;(e=>{let t={};e.forEach((e,r)=>t[e]=r)})(Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){function t(r,n){var s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Cr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var nn,sn=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,Ze(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return i(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,l=t.loggerProvider,c=t.tx;return i(e,void 0,void 0,function(){var e,t,i,u,h,d,p,f,m;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),i=t?t.eventTypes:{},u=i[n]||{},h=o(o({},i),((f={})[n]=o(o({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return a.sent(),[2,h];case 3:return p=a.sent(),l.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return i(e,void 0,void 0,function(){var e,t,o,i,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),o=0,a.label=2;case 2:return o<t.length?(i=t[o],l=Date.now()-i.lastUpdated,i.sessionId!==e&&l>1728e5?[4,s.store.delete(i.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return c=a.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,o=t.eventTime,l=t.apiKey;return i(e,void 0,void 0,function(){var e,t,i,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:o})]:[2];case 2:return i=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,i];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},on=new sn,an=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,l=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return i(e,void 0,void 0,function(){var e,t,i,p;return a(this,function(a){switch(a.label){case 0:return s&&s.time?[4,on.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:l,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return i=(e=t)&&new Set(Object.keys(e)),p={session_id:l,event:s,event_types:i&&Array.from(i),user:o(o({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new rn},ln=function(){var e=new an;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,cn=Object.freeze({__proto__:null,evaluateTargeting:ln}),un=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n',trackDestinationScript:'var WebWorker=function(e){"use strict";var t,n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},n.apply(this,arguments)};function r(e,t,n,r){return new(n||(n=Promise))(function(s,o){function a(e){try{i(r.next(e))}catch(e){o(e)}}function c(e){try{i(r.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}i((r=r.apply(e,t||[])).next())})}function s(e,t){var n,r,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(i){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(s=2&c[0]?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:case 1:s=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!s||c[1]>s[0]&&c[1]<s[3])){o.label=c[1];break}if(6===c[0]&&o.label<s[1]){o.label=s[1],s=c;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(c);break}s[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],r=0}finally{n=s=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o;!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(o||(o={}));function a(e,t){return r(this,void 0,void 0,function(){var n,o,a,c,i,u,l,d,f,p,h,v,y,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),n=t.CompressionStream,o=new n("gzip"),a=o.writable.getWriter(),c=o.readable.getReader(),i=[],u=r(g,void 0,void 0,function(){var e,t,n;return s(this,function(r){switch(r.label){case 0:return[4,c.read()];case 1:if(e=r.sent(),t=e.done,n=e.value,t)return[3,3];i.push(n),r.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,u];case 3:m.sent(),l=i.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),f=0;try{for(p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(i),h=p.next();!h.done;h=p.next())v=h.value,d.set(v,f),f+=v.length}catch(e){y={error:e}}finally{try{h&&!h.done&&(b=p.return)&&b.call(p)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function c(e,t){return r(this,void 0,void 0,function(){var r,o,c,i,u,l,d,f,p,h,v,y,b;return s(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),"CompressionStream"in self?[4,a(e,self)]:[3,2];case 1:return o=s.sent(),[3,3];case 2:o=null,s.label=3;case 3:return r=o,c="".concat(null!==(v=null===(h=t.version)||void 0===h?void 0:h.type)&&void 0!==v?v:"standalone","/").concat(null!==(b=null===(y=t.version)||void 0===y?void 0:y.version)&&void 0!==b?b:t.sdkVersion),i=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),u="".concat((g=t.serverZone,m=t.trackServerUrl,m||("STAGING"===g?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===g?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(i.toString()),l=n({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":c,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},r?{"Content-Encoding":"gzip"}:{}),[4,fetch(u,{method:"POST",headers:l,body:null!=r?r:e})];case 4:return null===(d=s.sent())?[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}]:d.status>=200&&d.status<300?(f=Math.round(new Blob(t.events).size/1024),[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(f," KB")}]):d.status>=500||408===d.status||429===d.status||499===d.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(d.status)}]:[2,{shouldRetry:!1,success:!1,message:"Network error occurred, event batch rejected"}];case 5:return p=s.sent(),[2,{shouldRetry:!1,success:!1,message:String(p)}];case 6:return[2]}var g,m})})}function i(e,t,n,o){return r(this,void 0,void 0,function(){var r,a,i;return s(this,function(s){switch(s.label){case 0:r=1,s.label=1;case 1:return[4,c(t,n)];case 2:return(a=s.sent()).success?(postMessage({type:"log",id:e,message:a.message}),postMessage({type:"complete",id:e}),[2]):o&&a.shouldRetry&&r<n.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*r*1e3)})]:[3,4];case 3:return s.sent(),r++,[3,5];case 4:return i=r>=n.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":a.message,postMessage({type:"warn",id:e,message:i}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return r(void 0,void 0,void 0,function(){var t,n,r,o,a,c,u;return s(this,function(s){switch(s.label){case 0:return t=e.data,n=t.type,r=t.id,o=t.payload,a=t.context,c=t.useRetry,"send"!==n?[3,2]:(u=JSON.stringify(o),[4,i(r,u,a,c)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var u=onmessage;return e.trackDestinationOnMessage=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),hn=Object.defineProperty,dn=(e,t,r)=>((e,t,r)=>t in e?hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),pn=Object.defineProperty,fn=(e,t,r)=>((e,t,r)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),mn=Object.defineProperty,gn=(e,t,r)=>((e,t,r)=>t in e?mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const yn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},vn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wn={};function bn(e){if(wn[e])return wn[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in yn?yn[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 vn?vn[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)return wn[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?wn[e]=o:r}catch{return r}}const Sn={};function Cn(e,t,r){var n;const s=`${e}.${String(r)}`;if(Sn[s])return Sn[s].call(t);const o=bn(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Sn[s]=i,i.call(t)):t[r]}const kn={};function xn(e,t,r){const n=`${e}.${String(r)}`;if(kn[n])return kn[n].bind(t);const s=bn(e)[r];return"function"!=typeof s?t[r]:(kn[n]=s,s.bind(t))}const On={childNodes:function(e){return Cn("Node",e,"childNodes")},parentNode:function(e){return Cn("Node",e,"parentNode")},parentElement:function(e){return Cn("Node",e,"parentElement")},textContent:function(e){return Cn("Node",e,"textContent")},contains:function(e,t){return xn("Node",e,"contains")(t)},getRootNode:function(e){return xn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Cn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Cn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Cn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Cn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return bn("MutationObserver").constructor}};class En{constructor(){gn(this,"idNodeMap",new Map),gn(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 In(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&In(On.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&In(On.parentNode(e),t,r)}function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Rn(e){if(Object.prototype.hasOwnProperty.call(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 Pn,An={exports:{}};function Tn(){if(Pn)return An.exports;Pn=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return An.exports=t(),An.exports.createColors=t,An.exports}const Nn=Rn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ln,_n;function Dn(){if(_n)return Ln;_n=1;let e=Tn(),t=Nn;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Ln=r,r.default=r,Ln}var Fn,Un,jn,Bn,zn,Wn,$n,qn,Vn,Gn,Hn,Jn,Kn,Yn,Xn,Zn,Qn,es,ts,rs,ns,ss,os,is,as,ls,cs,us,hs,ds,ps,fs,ms,gs,ys,vs,ws,bs,Ss,Cs,ks,xs,Os,Es,Is,Ms,Rs,Ps,As,Ts,Ns,Ls,_s,Ds={};function Fs(){return Fn||(Fn=1,Ds.isClean=Symbol("isClean"),Ds.my=Symbol("my")),Ds}function Us(){if(jn)return Un;jn=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return Un=t,t.default=t,Un}function js(){if(zn)return Bn;zn=1;let e=Us();function t(t,r){new e(r).stringify(t)}return Bn=t,t.default=t,Bn}function Bs(){if($n)return Wn;$n=1;let{isClean:e,my:t}=Fs(),r=Dn(),n=Us(),s=js();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return Wn=i,i.default=i,Wn}function zs(){if(Vn)return qn;Vn=1;let e=Bs();class t extends e{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]}}return qn=t,t.default=t,qn}function Ws(){if(Hn)return Gn;Hn=1;return Gn={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}},Gn}function $s(){if(Kn)return Jn;Kn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Nn,{existsSync:r,readFileSync:n}=Nn,{dirname:s,join:o}=Nn;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Jn=i,i.default=i,Jn}function qs(){if(Xn)return Yn;Xn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Nn,{fileURLToPath:r,pathToFileURL:n}=Nn,{isAbsolute:s,resolve:o}=Nn,{nanoid:i}=Ws(),a=Nn,l=Dn(),c=$s(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Yn=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Yn}function Vs(){if(Qn)return Zn;Qn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Nn,{dirname:r,relative:n,resolve:s,sep:o}=Nn,{pathToFileURL:i}=Nn,a=qs(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Zn=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Gs(){if(ts)return es;ts=1;let e=Bs();class t extends e{constructor(e){super(e),this.type="comment"}}return es=t,t.default=t,es}function Hs(){if(ns)return rs;ns=1;let e,t,r,n,{isClean:s,my:o}=Fs(),i=zs(),a=Gs(),l=Bs();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},rs=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},rs}function Js(){if(os)return ss;os=1;let e,t,r=Hs();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ss=n,n.default=n,ss}function Ks(){if(as)return is;as=1;let e={};return is=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ys(){if(cs)return ls;cs=1;class e{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}}return ls=e,e.default=e,ls}function Xs(){if(hs)return us;hs=1;let e=Ys();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return us=t,t.default=t,us}function Zs(){if(ms)return fs;ms=1;let e=Hs();class t extends e{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)}}return fs=t,t.default=t,e.registerAtRule(t),fs}function Qs(){if(ys)return gs;ys=1;let e,t,r=Hs();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},gs=n,n.default=n,r.registerRoot(n),gs}function eo(){if(ws)return vs;ws=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return vs=e,e.default=e,vs}function to(){if(Ss)return bs;Ss=1;let e=Hs(),t=eo();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return bs=r,r.default=r,e.registerRule(r),bs}function ro(){if(ks)return Cs;ks=1;let e=zs(),t=function(){if(ps)return ds;ps=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return ds=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=Gs(),n=Zs(),s=Qs(),o=to();const i={empty:!0,space:!0};return Cs=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},Cs}function no(){if(Os)return xs;Os=1;let e=Hs(),t=ro(),r=qs();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return xs=n,n.default=n,e.registerParse(n),xs}function so(){if(Is)return Es;Is=1;let{isClean:e,my:t}=Fs(),r=Vs(),n=js(),s=Hs(),o=Js(),i=Ks(),a=Xs(),l=no(),c=Qs();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},Es=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Es}function oo(){if(As)return Ps;As=1;let e=function(){if(Rs)return Ms;Rs=1;let e=Vs(),t=js(),r=Ks(),n=no();const s=Xs();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return Ms=o,o.default=o,Ms}(),t=so(),r=Js(),n=Qs();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ps=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Ps}const io=Mn(function(){if(_s)return Ls;_s=1;let e=Dn(),t=zs(),r=so(),n=Hs(),s=oo(),o=js(),i=function(){if(Ns)return Ts;Ns=1;let e=zs(),t=$s(),r=Gs(),n=Zs(),s=qs(),o=Qs(),i=to();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Ts=a,a.default=a,Ts}(),a=Js(),l=Ys(),c=Gs(),u=Zs(),h=Xs(),d=qs(),p=no(),f=eo(),m=to(),g=Qs(),y=Bs();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Ls=v,v.default=v,Ls}());io.stringify,io.fromJSON,io.plugin,io.parse,io.list,io.document,io.comment,io.atRule,io.rule,io.decl,io.root,io.CssSyntaxError,io.Declaration,io.Container,io.Processor,io.Document,io.Comment,io.Warning,io.AtRule,io.Result,io.Input,io.Rule,io.Root,io.Node;var ao=Object.defineProperty,lo=(e,t,r)=>((e,t,r)=>t in e?ao(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function co(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function uo(e){if(Object.prototype.hasOwnProperty.call(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 ho,po={exports:{}};function fo(){if(ho)return po.exports;ho=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return po.exports=t(),po.exports.createColors=t,po.exports}const mo=uo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var go,yo;function vo(){if(yo)return go;yo=1;let e=fo(),t=mo;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return go=r,r.default=r,go}var wo,bo,So,Co,ko,xo,Oo,Eo,Io,Mo,Ro,Po,Ao,To,No,Lo,_o,Do,Fo,Uo,jo,Bo,zo,Wo,$o,qo,Vo,Go,Ho,Jo,Ko,Yo,Xo,Zo,Qo,ei,ti,ri,ni,si,oi,ii,ai,li,ci,ui,hi,di,pi,fi,mi,gi,yi,vi={};function wi(){return wo||(wo=1,vi.isClean=Symbol("isClean"),vi.my=Symbol("my")),vi}function bi(){if(So)return bo;So=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return bo=t,t.default=t,bo}function Si(){if(ko)return Co;ko=1;let e=bi();function t(t,r){new e(r).stringify(t)}return Co=t,t.default=t,Co}function Ci(){if(Oo)return xo;Oo=1;let{isClean:e,my:t}=wi(),r=vo(),n=bi(),s=Si();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return xo=i,i.default=i,xo}function ki(){if(Io)return Eo;Io=1;let e=Ci();class t extends e{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]}}return Eo=t,t.default=t,Eo}function xi(){if(Ro)return Mo;Ro=1;return Mo={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}},Mo}function Oi(){if(Ao)return Po;Ao=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mo,{existsSync:r,readFileSync:n}=mo,{dirname:s,join:o}=mo;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Po=i,i.default=i,Po}function Ei(){if(No)return To;No=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mo,{fileURLToPath:r,pathToFileURL:n}=mo,{isAbsolute:s,resolve:o}=mo,{nanoid:i}=xi(),a=mo,l=vo(),c=Oi(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return To=p,p.default=p,a&&a.registerInput&&a.registerInput(p),To}function Ii(){if(_o)return Lo;_o=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mo,{dirname:r,relative:n,resolve:s,sep:o}=mo,{pathToFileURL:i}=mo,a=Ei(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Lo=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Mi(){if(Fo)return Do;Fo=1;let e=Ci();class t extends e{constructor(e){super(e),this.type="comment"}}return Do=t,t.default=t,Do}function Ri(){if(jo)return Uo;jo=1;let e,t,r,n,{isClean:s,my:o}=wi(),i=ki(),a=Mi(),l=Ci();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Uo=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Uo}function Pi(){if(zo)return Bo;zo=1;let e,t,r=Ri();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Bo=n,n.default=n,Bo}function Ai(){if($o)return Wo;$o=1;let e={};return Wo=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ti(){if(Vo)return qo;Vo=1;class e{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}}return qo=e,e.default=e,qo}function Ni(){if(Ho)return Go;Ho=1;let e=Ti();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Go=t,t.default=t,Go}function Li(){if(Xo)return Yo;Xo=1;let e=Ri();class t extends e{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)}}return Yo=t,t.default=t,e.registerAtRule(t),Yo}function _i(){if(Qo)return Zo;Qo=1;let e,t,r=Ri();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Zo=n,n.default=n,r.registerRoot(n),Zo}function Di(){if(ti)return ei;ti=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return ei=e,e.default=e,ei}function Fi(){if(ni)return ri;ni=1;let e=Ri(),t=Di();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return ri=r,r.default=r,e.registerRule(r),ri}function Ui(){if(oi)return si;oi=1;let e=ki(),t=function(){if(Ko)return Jo;Ko=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Jo=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=Mi(),n=Li(),s=_i(),o=Fi();const i={empty:!0,space:!0};return si=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},si}function ji(){if(ai)return ii;ai=1;let e=Ri(),t=Ui(),r=Ei();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return ii=n,n.default=n,e.registerParse(n),ii}function Bi(){if(ci)return li;ci=1;let{isClean:e,my:t}=wi(),r=Ii(),n=Si(),s=Ri(),o=Pi(),i=Ai(),a=Ni(),l=ji(),c=_i();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},li=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),li}function zi(){if(pi)return di;pi=1;let e=function(){if(hi)return ui;hi=1;let e=Ii(),t=Si(),r=Ai(),n=ji();const s=Ni();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return ui=o,o.default=o,ui}(),t=Bi(),r=Pi(),n=_i();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return di=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),di}const Wi=co(function(){if(yi)return gi;yi=1;let e=vo(),t=ki(),r=Bi(),n=Ri(),s=zi(),o=Si(),i=function(){if(mi)return fi;mi=1;let e=ki(),t=Oi(),r=Mi(),n=Li(),s=Ei(),o=_i(),i=Fi();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return fi=a,a.default=a,fi}(),a=Pi(),l=Ti(),c=Mi(),u=Li(),h=Ni(),d=Ei(),p=ji(),f=Di(),m=Fi(),g=_i(),y=Ci();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),gi=v,v.default=v,gi}());Wi.stringify,Wi.fromJSON,Wi.plugin,Wi.parse,Wi.list,Wi.document,Wi.comment,Wi.atRule,Wi.rule,Wi.decl,Wi.root,Wi.CssSyntaxError,Wi.Declaration,Wi.Container,Wi.Processor,Wi.Document,Wi.Comment,Wi.Warning,Wi.AtRule,Wi.Result,Wi.Input,Wi.Rule,Wi.Root,Wi.Node;class $i{constructor(...e){lo(this,"parentElement",null),lo(this,"parentNode",null),lo(this,"ownerDocument"),lo(this,"firstChild",null),lo(this,"lastChild",null),lo(this,"previousSibling",null),lo(this,"nextSibling",null),lo(this,"ELEMENT_NODE",1),lo(this,"TEXT_NODE",3),lo(this,"nodeType"),lo(this,"nodeName"),lo(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 $i))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 qi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Vi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Gi={};function Hi(e){if(Gi[e])return Gi[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in qi?qi[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 Vi?Vi[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)return Gi[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?Gi[e]=o:r}catch{return r}}const Ji={};function Ki(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ji[s])return Ji[s].call(t);const o=Hi(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ji[s]=i,i.call(t)):t[r]}const Yi={};function Xi(e,t,r){const n=`${e}.${String(r)}`;if(Yi[n])return Yi[n].bind(t);const s=Hi(e)[r];return"function"!=typeof s?t[r]:(Yi[n]=s,s.bind(t))}const Zi={childNodes:function(e){return Ki("Node",e,"childNodes")},parentNode:function(e){return Ki("Node",e,"parentNode")},parentElement:function(e){return Ki("Node",e,"parentElement")},textContent:function(e){return Ki("Node",e,"textContent")},contains:function(e,t){return Xi("Node",e,"contains")(t)},getRootNode:function(e){return Xi("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ki("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ki("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ki("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ki("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Hi("MutationObserver").constructor}};const Qi="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 ea={map:{},getId:()=>(console.error(Qi),-1),getNode:()=>(console.error(Qi),null),removeNodeFromMap(){console.error(Qi)},has:()=>(console.error(Qi),!1),reset(){console.error(Qi)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ea=new Proxy(ea,{get:(e,t,r)=>("map"===t&&console.error(Qi),Reflect.get(e,t,r))}));let ta=Date.now;function ra(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Zi.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ta=()=>(new Date).getTime());function na(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Zi.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Zi.host(Zi.getRootNode(e))&&(r=Zi.host(Zi.getRootNode(e))),r}function sa(e){let t,r=e;for(;t=na(r);)r=t;return r}function oa(e){const t=e.ownerDocument;if(!t)return!1;const r=sa(e);return Zi.contains(t,r)}const ia=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){fn(this,"id",1),fn(this,"styleIDMap",new WeakMap),fn(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++}},get _mirror(){return ea},closestElementOfNode:ra,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:sa,getShadowHost:na,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(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=Zi.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=Zi.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof $i&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Zi.shadowRoot(e)))},hookSetter:function e(t,r,n,s,o=window){const i=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,r,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(Zi.contains(t,e)||oa(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&On.host(e)||null;return Boolean(t&&"shadowRoot"in t&&On.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Zi.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=ra(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(In(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},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},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:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return ta},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(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()=>{}}},polyfill:function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},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))}continue}if(o in t){const e=t[o];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:oa,throttle:function(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))}},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"}));for(var aa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",la="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ca=0;ca<64;ca++)la[aa.charCodeAt(ca)]=ca;"undefined"!=typeof self&&self.Blob&&new Blob(['(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(nn=e.contentWindow)?void 0:nn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ua,ha;new En,(ha=ua||(ua={}))[ha.NotStarted=0]="NotStarted",ha[ha.Running=1]="Running",ha[ha.Stopped=2]="Stopped";class da{constructor(e){dn(this,"fileName"),dn(this,"functionName"),dn(this,"lineNumber"),dn(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const pa=/(^|@)\S+:\d+/,fa=/^\s*at .*(\S+:\d+|\(native\))/m,ma=/^(eval@)?(\[native code])?$/,ga={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(fa)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(fa)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),s=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new da({functionName:o,fileName:i,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(ma)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new da({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new da({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new da({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new da({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(pa)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new da({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function ya(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,s=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function va(e){return"[object Object]"===Object.prototype.toString.call(e)}function wa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(va(e[n])&&wa(e[n],t-1))return!0;return!1}function ba(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];return JSON.stringify(e,function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(va(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(va(e)&&wa(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=ya(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const Sa={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Ca(e,t,r){const n=r?Object.assign({},Sa,r):Sa,s=n.logger;if(!s)return()=>{};let o;o="string"==typeof s?t[s]:s;let i=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,o=ga.parse(s).map(e=>e.toString()),i=[ba(r,n.stringifyOptions)];e({level:"error",trace:o,payload:i})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[ba(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[ba("Uncaught (in promise)",n.stringifyOptions),ba(t.reason,n.stringifyOptions)]);const o=ga.parse(r).map(e=>e.toString());e({level:"error",trace:o,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(o,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?ia.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=ga.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>ba(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[ba("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const ka="rrweb/console@1";var xa,Oa=Object.freeze({__proto__:null,PLUGIN_NAME:ka,getRecordConsolePlugin:e=>({name:ka,observer:Ca,options:e})}),Ea=Object.defineProperty,Ia=(e,t,r)=>((e,t,r)=>t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ma=Object.defineProperty,Ra=(e,t,r)=>((e,t,r)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Pa=(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))(Pa||{});const Aa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ta={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Na={};function La(e){if(Na[e])return Na[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Aa?Aa[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 Ta?Ta[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)return Na[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?Na[e]=o:r}catch{return r}}const _a={};function Da(e,t,r){var n;const s=`${e}.${String(r)}`;if(_a[s])return _a[s].call(t);const o=La(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(_a[s]=i,i.call(t)):t[r]}const Fa={};function Ua(e,t,r){const n=`${e}.${String(r)}`;if(Fa[n])return Fa[n].bind(t);const s=La(e)[r];return"function"!=typeof s?t[r]:(Fa[n]=s,s.bind(t))}const ja={childNodes:function(e){return Da("Node",e,"childNodes")},parentNode:function(e){return Da("Node",e,"parentNode")},parentElement:function(e){return Da("Node",e,"parentElement")},textContent:function(e){return Da("Node",e,"textContent")},contains:function(e,t){return Ua("Node",e,"contains")(t)},getRootNode:function(e){return Ua("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Da("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Da("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Da("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Da("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return La("MutationObserver").constructor}};function Ba(e){return e.nodeType===e.ELEMENT_NODE}function za(e){const t=e&&"host"in e&&"mode"in e&&ja.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ja.shadowRoot(t)===e)}function Wa(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function $a(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=>qa(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 qa(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=$a(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?tl(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?tl(r,t):r}}class Va{constructor(){Ra(this,"idNodeMap",new Map),Ra(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 Ga({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&Ha(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function Ha(e){return e.toLowerCase()}const Ja="__rrweb_original__";function Ka(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ha(t):null}function Ya(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 Xa=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Za=/^(?:[a-z+]+:)?\/\//i,Qa=/^www\..*/i,el=/^(data:)([^,]*),(.*)/i;function tl(e,t){return(e||"").replace(Xa,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(Za.test(a)||Qa.test(a))return`url(${l}${a}${l})`;if(el.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 rl(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function nl(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=rl(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=rl(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=rl(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=rl(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 sl="lightgrey";let ol=1;const il=new RegExp("[^a-z0-9-_:]");function al(){return ol++}let ll,cl;const ul=/^[^ \t\n\r\u000c]+/,hl=/^[, \t\n\r\u000c]+/;const dl=new WeakMap;function pl(e,t){return t&&""!==t.trim()?ml(e,t):t}function fl(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ml(e,t){let r=dl.get(e);if(r||(r=e.createElement("a"),dl.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function gl(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?pl(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(hl),!(r>=t.length);){let o=n(ul);if(","===o.slice(-1))o=pl(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=pl(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?tl(n,ml(e)):"object"===t&&"data"===r?pl(e,n):n:pl(e,n):n}function yl(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function vl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vl(ja.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&vl(ja.parentNode(e),t,r)}function wl(e,t,r,n){let s;if(Ba(e)){if(s=e,!ja.childNodes(s).length)return!1}else{if(null===ja.parentElement(e))return!1;s=ja.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(vl(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 bl(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g=!1,cssCaptured:y=!1,applyBackgroundColorToBlockedElements:v=!1}=t,w=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:Pa.Document,childNodes:[],compatMode:e.compatMode}:{type:Pa.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pa.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:m=!1}=t,g=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),y=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ha(e.tagName);return il.test(t)?"div":t}(e);let v={};const w=e.attributes.length;for(let t=0;t<w;t++){const n=e.attributes[t];if(!yl(y,n.name,n.value)){const t=gl(r,y,Ha(n.name),n.value);if(l&&null!==t){const r=l(n.name,t,e);null!==r&&(v[n.name]=r)}else v[n.name]=t}}if("link"===y&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=$a(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===y&&e.sheet){let t=$a(e.sheet);t&&(e.childNodes.length>1&&(t=nl(t,e)),v._cssText=t)}if("input"===y||"textarea"===y||"select"===y){const t=e.value,r=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&t?v.value=Ga({element:e,type:Ka(e),tagName:y,value:t,maskInputOptions:i,maskInputFn:a}):r&&(v.checked=r)}"option"===y&&(e.selected&&!i.select?v.selected=!0:delete v.selected);"dialog"===y&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===y&&h)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=Ja in s?s[Ja]: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(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(v.rr_dataURL=t)}if("img"===y&&u){ll||(ll=r.createElement("canvas"),cl=ll.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ll.width=t.naturalWidth,ll.height=t.naturalHeight,cl.drawImage(t,0,0),v.rr_dataURL=ll.toDataURL(c.type,c.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"===y||"video"===y){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}p||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(g){const{width:t,height:r}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${r}px`,...m?{rr_background_color:sl}:{}}}"iframe"!==y||d(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(y)&&(b=!0)}catch(e){}return{type:Pa.Element,tagName:y,attributes:v,childNodes:[],isSVG:fl(e)||void 0,needBlock:g,rootId:f,isCustom:b}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g,rootId:w,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=ja.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=ja.textContent(e),c&&l&&(l=tl(l,ml(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,ja.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Pa.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:w,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Pa.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Pa.Comment,textContent:ja.textContent(e)||"",rootId:w};default:return!1}}function Sl(e){return null==e?"":e.toLowerCase()}function Cl(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,maskAttributeFn:p,slimDOMOptions:f,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:x=!1,cssCaptured:O=!1,applyBackgroundColorToBlockedElements:E=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:M=!0}=t;if(!I){I=wl(e,i,a,void 0===I)}const R=bl(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:I,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,keepIframeSrcFn:k,newlyAddedElement:x,cssCaptured:O,applyBackgroundColorToBlockedElements:E});if(!R)return console.warn(e,"not serialized"),null;let P;P=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Pa.Comment)return!0;if(e.type===Pa.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"===Ya(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Sl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Sl(e.attributes.name)||"icon"===Sl(e.attributes.rel)||"apple-touch-icon"===Sl(e.attributes.rel)||"shortcut icon"===Sl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Sl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Sl(e.attributes.property).match(/^(og|twitter|fb):/)||Sl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Sl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Sl(e.attributes.name)||"googlebot"===Sl(e.attributes.name)||"bingbot"===Sl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Sl(e.attributes.name)||"generator"===Sl(e.attributes.name)||"framework"===Sl(e.attributes.name)||"publisher"===Sl(e.attributes.name)||"progid"===Sl(e.attributes.name)||Sl(e.attributes.property).match(/^article:/)||Sl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Sl(e.attributes.name)||"yandex-verification"===Sl(e.attributes.name)||"csrf-token"===Sl(e.attributes.name)||"p:domain_verify"===Sl(e.attributes.name)||"verify-v1"===Sl(e.attributes.name)||"verification"===Sl(e.attributes.name)||"shopify-checkout-api-token"===Sl(e.attributes.name)))return!0}}return!1}(R,f)||!M&&R.type===Pa.Text&&!R.textContent.replace(/^\s+|\s+$/gm,"").length?-2:al();const A=Object.assign(R,{id:P});if(n.add(e,A),-2===P)return null;v&&v(e);let T=!l;if(A.type===Pa.Element){T=T&&!A.needBlock,delete A.needBlock;const t=ja.shadowRoot(e);t&&Wa(t)&&(A.isShadowHost=!0)}if((A.type===Pa.Document||A.type===Pa.Element)&&T){f.headWhitespace&&A.type===Pa.Element&&"head"===A.tagName&&(M=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:I,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,preserveWhiteSpace:M,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k,cssCaptured:!1,applyBackgroundColorToBlockedElements:E};if(A.type===Pa.Element&&"textarea"===A.tagName&&void 0!==A.attributes.value);else{A.type===Pa.Element&&void 0!==A.attributes._cssText&&"string"==typeof A.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(ja.childNodes(e))){const e=Cl(r,t);e&&A.childNodes.push(e)}}let x=null;if(Ba(e)&&(x=ja.shadowRoot(e)))for(const e of Array.from(ja.childNodes(x))){const r=Cl(e,t);r&&(Wa(x)&&(r.isShadow=!0),A.childNodes.push(r))}}const N=ja.parentNode(e);return N&&za(N)&&Wa(N)&&(A.isShadow=!0),A.type===Pa.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&&w){const r=Cl(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:I,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,preserveWhiteSpace:M,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k});r&&w(e,r)}},b),A.type===Pa.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===Ya(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(S){const t=Cl(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:I,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,preserveWhiteSpace:M,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k});t&&S(e,t)}},C),A}function kl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xl(e){if(Object.prototype.hasOwnProperty.call(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 Ol,El={exports:{}};function Il(){if(Ol)return El.exports;Ol=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return El.exports=t(),El.exports.createColors=t,El.exports}const Ml=xl(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Rl,Pl;function Al(){if(Pl)return Rl;Pl=1;let e=Il(),t=Ml;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Rl=r,r.default=r,Rl}var Tl,Nl,Ll,_l,Dl,Fl,Ul,jl,Bl,zl,Wl,$l,ql,Vl,Gl,Hl,Jl,Kl,Yl,Xl,Zl,Ql,ec,tc,rc,nc,sc,oc,ic,ac,lc,cc,uc,hc,dc,pc,fc,mc,gc,yc,vc,wc,bc,Sc,Cc,kc,xc,Oc,Ec,Ic,Mc,Rc,Pc,Ac={};function Tc(){return Tl||(Tl=1,Ac.isClean=Symbol("isClean"),Ac.my=Symbol("my")),Ac}function Nc(){if(Ll)return Nl;Ll=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return Nl=t,t.default=t,Nl}function Lc(){if(Dl)return _l;Dl=1;let e=Nc();function t(t,r){new e(r).stringify(t)}return _l=t,t.default=t,_l}function _c(){if(Ul)return Fl;Ul=1;let{isClean:e,my:t}=Tc(),r=Al(),n=Nc(),s=Lc();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return Fl=i,i.default=i,Fl}function Dc(){if(Bl)return jl;Bl=1;let e=_c();class t extends e{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]}}return jl=t,t.default=t,jl}function Fc(){if(Wl)return zl;Wl=1;return zl={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}},zl}function Uc(){if(ql)return $l;ql=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ml,{existsSync:r,readFileSync:n}=Ml,{dirname:s,join:o}=Ml;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return $l=i,i.default=i,$l}function jc(){if(Gl)return Vl;Gl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ml,{fileURLToPath:r,pathToFileURL:n}=Ml,{isAbsolute:s,resolve:o}=Ml,{nanoid:i}=Fc(),a=Ml,l=Al(),c=Uc(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Vl=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Vl}function Bc(){if(Jl)return Hl;Jl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ml,{dirname:r,relative:n,resolve:s,sep:o}=Ml,{pathToFileURL:i}=Ml,a=jc(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Hl=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Hl}function zc(){if(Yl)return Kl;Yl=1;let e=_c();class t extends e{constructor(e){super(e),this.type="comment"}}return Kl=t,t.default=t,Kl}function Wc(){if(Zl)return Xl;Zl=1;let e,t,r,n,{isClean:s,my:o}=Tc(),i=Dc(),a=zc(),l=_c();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Xl=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Xl}function $c(){if(ec)return Ql;ec=1;let e,t,r=Wc();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Ql=n,n.default=n,Ql}function qc(){if(rc)return tc;rc=1;let e={};return tc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Vc(){if(sc)return nc;sc=1;class e{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}}return nc=e,e.default=e,nc}function Gc(){if(ic)return oc;ic=1;let e=Vc();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return oc=t,t.default=t,oc}function Hc(){if(uc)return cc;uc=1;let e=Wc();class t extends e{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)}}return cc=t,t.default=t,e.registerAtRule(t),cc}function Jc(){if(dc)return hc;dc=1;let e,t,r=Wc();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},hc=n,n.default=n,r.registerRoot(n),hc}function Kc(){if(fc)return pc;fc=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return pc=e,e.default=e,pc}function Yc(){if(gc)return mc;gc=1;let e=Wc(),t=Kc();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return mc=r,r.default=r,e.registerRule(r),mc}function Xc(){if(vc)return yc;vc=1;let e=Dc(),t=function(){if(lc)return ac;lc=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return ac=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=zc(),n=Hc(),s=Jc(),o=Yc();const i={empty:!0,space:!0};return yc=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},yc}function Zc(){if(bc)return wc;bc=1;let e=Wc(),t=Xc(),r=jc();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return wc=n,n.default=n,e.registerParse(n),wc}function Qc(){if(Cc)return Sc;Cc=1;let{isClean:e,my:t}=Tc(),r=Bc(),n=Lc(),s=Wc(),o=$c(),i=qc(),a=Gc(),l=Zc(),c=Jc();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},Sc=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Sc}function eu(){if(Ec)return Oc;Ec=1;let e=function(){if(xc)return kc;xc=1;let e=Bc(),t=Lc(),r=qc(),n=Zc();const s=Gc();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return kc=o,o.default=o,kc}(),t=Qc(),r=$c(),n=Jc();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Oc=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Oc}var tu=function(){if(Pc)return Rc;Pc=1;let e=Al(),t=Dc(),r=Qc(),n=Wc(),s=eu(),o=Lc(),i=function(){if(Mc)return Ic;Mc=1;let e=Dc(),t=Uc(),r=zc(),n=Hc(),s=jc(),o=Jc(),i=Yc();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Ic=a,a.default=a,Ic}(),a=$c(),l=Vc(),c=zc(),u=Hc(),h=Gc(),d=jc(),p=Zc(),f=Kc(),m=Yc(),g=Jc(),y=_c();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Rc=v,v.default=v,Rc}();const ru=kl(tu);ru.stringify,ru.fromJSON,ru.plugin,ru.parse,ru.list,ru.document,ru.comment,ru.atRule,ru.rule,ru.decl,ru.root,ru.CssSyntaxError,ru.Declaration,ru.Container,ru.Processor,ru.Document,ru.Comment,ru.Warning,ru.AtRule,ru.Result,ru.Input,ru.Rule,ru.Root,ru.Node;var nu=Object.defineProperty,su=(e,t,r)=>((e,t,r)=>t in e?nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function ou(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function iu(e){if(Object.prototype.hasOwnProperty.call(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 au,lu={exports:{}};function cu(){if(au)return lu.exports;au=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return lu.exports=t(),lu.exports.createColors=t,lu.exports}const uu=iu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var hu,du;function pu(){if(du)return hu;du=1;let e=cu(),t=uu;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return hu=r,r.default=r,hu}var fu,mu,gu,yu,vu,wu,bu,Su,Cu,ku,xu,Ou,Eu,Iu,Mu,Ru,Pu,Au,Tu,Nu,Lu,_u,Du,Fu,Uu,ju,Bu,zu,Wu,$u,qu,Vu,Gu,Hu,Ju,Ku,Yu,Xu,Zu,Qu,eh,th,rh,nh,sh,oh,ih,ah,lh,ch,uh,hh,dh,ph={};function fh(){return fu||(fu=1,ph.isClean=Symbol("isClean"),ph.my=Symbol("my")),ph}function mh(){if(gu)return mu;gu=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return mu=t,t.default=t,mu}function gh(){if(vu)return yu;vu=1;let e=mh();function t(t,r){new e(r).stringify(t)}return yu=t,t.default=t,yu}function yh(){if(bu)return wu;bu=1;let{isClean:e,my:t}=fh(),r=pu(),n=mh(),s=gh();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return wu=i,i.default=i,wu}function vh(){if(Cu)return Su;Cu=1;let e=yh();class t extends e{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]}}return Su=t,t.default=t,Su}function wh(){if(xu)return ku;xu=1;return ku={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}},ku}function bh(){if(Eu)return Ou;Eu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=uu,{existsSync:r,readFileSync:n}=uu,{dirname:s,join:o}=uu;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ou=i,i.default=i,Ou}function Sh(){if(Mu)return Iu;Mu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=uu,{fileURLToPath:r,pathToFileURL:n}=uu,{isAbsolute:s,resolve:o}=uu,{nanoid:i}=wh(),a=uu,l=pu(),c=bh(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Iu=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Iu}function Ch(){if(Pu)return Ru;Pu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=uu,{dirname:r,relative:n,resolve:s,sep:o}=uu,{pathToFileURL:i}=uu,a=Sh(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Ru=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ru}function kh(){if(Tu)return Au;Tu=1;let e=yh();class t extends e{constructor(e){super(e),this.type="comment"}}return Au=t,t.default=t,Au}function xh(){if(Lu)return Nu;Lu=1;let e,t,r,n,{isClean:s,my:o}=fh(),i=vh(),a=kh(),l=yh();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Nu=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Nu}function Oh(){if(Du)return _u;Du=1;let e,t,r=xh();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},_u=n,n.default=n,_u}function Eh(){if(Uu)return Fu;Uu=1;let e={};return Fu=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ih(){if(Bu)return ju;Bu=1;class e{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}}return ju=e,e.default=e,ju}function Mh(){if(Wu)return zu;Wu=1;let e=Ih();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return zu=t,t.default=t,zu}function Rh(){if(Gu)return Vu;Gu=1;let e=xh();class t extends e{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)}}return Vu=t,t.default=t,e.registerAtRule(t),Vu}function Ph(){if(Ju)return Hu;Ju=1;let e,t,r=xh();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Hu=n,n.default=n,r.registerRoot(n),Hu}function Ah(){if(Yu)return Ku;Yu=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return Ku=e,e.default=e,Ku}function Th(){if(Zu)return Xu;Zu=1;let e=xh(),t=Ah();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Xu=r,r.default=r,e.registerRule(r),Xu}function Nh(){if(eh)return Qu;eh=1;let e=vh(),t=function(){if(qu)return $u;qu=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return $u=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=kh(),n=Rh(),s=Ph(),o=Th();const i={empty:!0,space:!0};return Qu=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},Qu}function Lh(){if(rh)return th;rh=1;let e=xh(),t=Nh(),r=Sh();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return th=n,n.default=n,e.registerParse(n),th}function _h(){if(sh)return nh;sh=1;let{isClean:e,my:t}=fh(),r=Ch(),n=gh(),s=xh(),o=Oh(),i=Eh(),a=Mh(),l=Lh(),c=Ph();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},nh=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),nh}function Dh(){if(lh)return ah;lh=1;let e=function(){if(ih)return oh;ih=1;let e=Ch(),t=gh(),r=Eh(),n=Lh();const s=Mh();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return oh=o,o.default=o,oh}(),t=_h(),r=Oh(),n=Ph();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return ah=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),ah}var Fh=function(){if(dh)return hh;dh=1;let e=pu(),t=vh(),r=_h(),n=xh(),s=Dh(),o=gh(),i=function(){if(uh)return ch;uh=1;let e=vh(),t=bh(),r=kh(),n=Rh(),s=Sh(),o=Ph(),i=Th();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return ch=a,a.default=a,ch}(),a=Oh(),l=Ih(),c=kh(),u=Rh(),h=Mh(),d=Sh(),p=Lh(),f=Ah(),m=Th(),g=Ph(),y=yh();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),hh=v,v.default=v,hh}();const Uh=ou(Fh);Uh.stringify,Uh.fromJSON,Uh.plugin,Uh.parse,Uh.list,Uh.document,Uh.comment,Uh.atRule,Uh.rule,Uh.decl,Uh.root,Uh.CssSyntaxError,Uh.Declaration,Uh.Container,Uh.Processor,Uh.Document,Uh.Comment,Uh.Warning,Uh.AtRule,Uh.Result,Uh.Input,Uh.Rule,Uh.Root,Uh.Node;class jh{constructor(...e){su(this,"parentElement",null),su(this,"parentNode",null),su(this,"ownerDocument"),su(this,"firstChild",null),su(this,"lastChild",null),su(this,"previousSibling",null),su(this,"nextSibling",null),su(this,"ELEMENT_NODE",1),su(this,"TEXT_NODE",3),su(this,"nodeType"),su(this,"nodeName"),su(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 jh))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 Bh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wh={};function $h(e){if(Wh[e])return Wh[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Bh?Bh[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 zh?zh[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)return Wh[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?Wh[e]=o:r}catch{return r}}const qh={};function Vh(e,t,r){var n;const s=`${e}.${String(r)}`;if(qh[s])return qh[s].call(t);const o=$h(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(qh[s]=i,i.call(t)):t[r]}const Gh={};function Hh(e,t,r){const n=`${e}.${String(r)}`;if(Gh[n])return Gh[n].bind(t);const s=$h(e)[r];return"function"!=typeof s?t[r]:(Gh[n]=s,s.bind(t))}function Jh(){return $h("MutationObserver").constructor}const Kh={childNodes:function(e){return Vh("Node",e,"childNodes")},parentNode:function(e){return Vh("Node",e,"parentNode")},parentElement:function(e){return Vh("Node",e,"parentElement")},textContent:function(e){return Vh("Node",e,"textContent")},contains:function(e,t){return Hh("Node",e,"contains")(t)},getRootNode:function(e){return Hh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Vh("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Vh("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Vh("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Vh("Element",e,"querySelectorAll")(t)},mutationObserver:Jh};function Yh(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Xh="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 Zh={map:{},getId:()=>(console.error(Xh),-1),getNode:()=>(console.error(Xh),null),removeNodeFromMap(){console.error(Xh)},has:()=>(console.error(Xh),!1),reset(){console.error(Xh)}};function Qh(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 ed(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)}}),()=>ed(e,t,o||{},!0)}function td(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&&(Zh=new Proxy(Zh,{get:(e,t,r)=>("map"===t&&console.error(Xh),Reflect.get(e,t,r))}));let rd=Date.now;function nd(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=Kh.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=Kh.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function sd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function od(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function id(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Kh.parentElement(e)}function ad(e,t,r,n){if(!e)return!1;const s=id(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(vl(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 ld(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function cd(e,t){if(za(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Kh.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||cd(n,t))}function ud(e){return Boolean(e.changedTouches)}function hd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function dd(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function pd(e){return!!e&&(e instanceof jh&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Kh.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(rd=()=>(new Date).getTime());class fd{constructor(){Ia(this,"id",1),Ia(this,"styleIDMap",new WeakMap),Ia(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 md(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Kh.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Kh.host(Kh.getRootNode(e))&&(r=Kh.host(Kh.getRootNode(e))),r}function gd(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=md(r);)r=t;return r}(e);return Kh.contains(t,r)}function yd(e){const t=e.ownerDocument;return!!t&&(Kh.contains(t,e)||gd(e))}var vd=(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))(vd||{}),wd=(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))(wd||{}),bd=(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))(bd||{}),Sd=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Sd||{}),Cd=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Cd||{}),kd=(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))(kd||{}),xd=(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))(xd||{});function Od(e){return"__ln"in e}class Ed{constructor(){Ia(this,"length",0),Ia(this,"head",null),Ia(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&&Od(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&&Od(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 Id=(e,t)=>`${e}@${t}`;class Md{constructor(){Ia(this,"frozen",!1),Ia(this,"locked",!1),Ia(this,"texts",[]),Ia(this,"attributes",[]),Ia(this,"attributeMap",new WeakMap),Ia(this,"removes",[]),Ia(this,"mapRemoves",[]),Ia(this,"movedMap",{}),Ia(this,"addedSet",new Set),Ia(this,"movedSet",new Set),Ia(this,"droppedSet",new Set),Ia(this,"removesSubTreeCache",new Set),Ia(this,"mutationCb"),Ia(this,"blockClass"),Ia(this,"blockSelector"),Ia(this,"maskTextClass"),Ia(this,"maskTextSelector"),Ia(this,"inlineStylesheet"),Ia(this,"maskInputOptions"),Ia(this,"maskTextFn"),Ia(this,"maskInputFn"),Ia(this,"maskAttributeFn"),Ia(this,"keepIframeSrcFn"),Ia(this,"recordCanvas"),Ia(this,"inlineImages"),Ia(this,"slimDOMOptions"),Ia(this,"dataURLOptions"),Ia(this,"doc"),Ia(this,"mirror"),Ia(this,"iframeManager"),Ia(this,"stylesheetManager"),Ia(this,"shadowDomManager"),Ia(this,"canvasManager"),Ia(this,"processedNodeManager"),Ia(this,"unattachedDoc"),Ia(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Ia(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Ed,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=Kh.parentNode(s);if(!o||!yd(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=za(o)?this.mirror.getId(md(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Cl(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=>{hd(e,this.mirror)&&this.iframeManager.addIframe(e),dd(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),pd(s)&&this.shadowDomManager.addShadowRoot(Kh.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)Pd(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Kh.parentNode(e))||s(e);for(const e of this.addedSet)Ad(this.droppedSet,e)||Pd(this.removesSubTreeCache,e,this.mirror)?Ad(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(Kh.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(Kh.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Kh.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Kh.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=Kh.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))}),Ia(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(Kh.childNodes(e),e=>Kh.textContent(e)||"").join("");t.attributes.value=Ga({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Ka(e),value:r,maskInputFn:this.maskInputFn})}),Ia(this,"processMutation",e=>{if(!ld(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Kh.textContent(e.target);ad(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:wl(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,id(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=Ka(t);n=Ga({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(ad(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"),!yl(t.tagName,r)){if(s.attributes[r]=gl(this.doc,Ha(t.tagName),Ha(r),n),this.maskAttributeFn&&"string"==typeof s.attributes[r]){const e=this.maskAttributeFn(r,s.attributes[r],t);null!==e?s.attributes[r]=e:delete s.attributes[r]}if("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(ad(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=za(e.target)?this.mirror.getId(Kh.host(e.target)):this.mirror.getId(e.target);ad(e.target,this.blockClass,this.blockSelector,!1)||ld(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Rd(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||cd(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Id(r,n)]?Rd(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!za(e.target)||!Wa(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Kh.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Ia(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ld(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[Id(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ad(e,this.blockClass,this.blockSelector,!1)||(Kh.childNodes(e).forEach(e=>this.genAdds(e)),pd(e)&&Kh.childNodes(Kh.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAttributeFn","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 Rd(e,t){e.delete(t),Kh.childNodes(t).forEach(t=>Rd(e,t))}function Pd(e,t,r){return 0!==e.size&&function(e,t){const r=Kh.parentNode(t);return!!r&&e.has(r)}(e,t)}function Ad(e,t){return 0!==e.size&&Td(e,t)}function Td(e,t){const r=Kh.parentNode(t);return!!r&&(!!e.has(r)||Td(e,r))}let Nd;const Ld=e=>{if(!Nd)return e;return(...t)=>{try{return e(...t)}catch(e){if(Nd&&!0===Nd(e))return;throw e}}};function _d(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Dd=[];function Fd(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 Ud(e,t){const r=new Md;Dd.push(r),r.init(e);const n=new(Jh())(Ld(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function jd({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(bd).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=Ha(o);const c=(t=>o=>{const i=Fd(o);if(ad(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Sd.Mouse;break;case"touch":a=Sd.Touch;break;case"pen":a=Sd.Pen}a===Sd.Touch?bd[t]===bd.MouseDown?c="TouchStart":bd[t]===bd.MouseUp&&(c="TouchEnd"):Sd.Pen}else ud(o)&&(a=Sd.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Sd.Touch||c.startsWith("Mouse")&&a===Sd.Mouse)&&(a=null)):bd[t]===bd.Click&&(a=l,l=null);const u=ud(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;Ld(e)({type:bd[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(bd[o]){case bd.MouseDown:case bd.MouseUp:i=i.replace("mouse","pointer");break;case bd.TouchStart:case bd.TouchEnd:return}a.push(Yh(i,c,t))}),Ld(()=>{a.forEach(e=>e())})}function Bd({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=Ld(Qh(Ld(o=>{const i=Fd(o);if(!i||ad(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=nd(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 Yh("scroll",i,t)}const zd=["INPUT","TEXTAREA","SELECT"],Wd=new WeakMap;function $d(e){return function(e,t){if(Hd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Hd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Hd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Hd("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 qd(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Vd({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Kh.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}}),Ld(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Gd(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=Ud(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=Qh(Ld(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=Ld(Qh(Ld(e=>{const t=Fd(e),{clientX:r,clientY:s}=ud(e)?e.changedTouches[0]:e;i||(i=rd()),a.push({x:r,y:s,id:n.getId(t),timeOffset:rd()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?wd.Drag:e instanceof MouseEvent?wd.MouseMove:wd.TouchMove)}),s,{trailing:!1})),u=[Yh("mousemove",c,r),Yh("touchmove",c,r),Yh("drag",c,r)];return Ld(()=>{u.forEach(e=>e())})}(e),o=jd(e),i=Bd(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Yh("resize",Ld(Qh(Ld(()=>{const t=sd(),s=od();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=Fd(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Kh.parentElement(r)),!r||!h||zd.indexOf(h)<0||ad(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=Ka(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Ga({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=Wd.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Wd.set(t,n);const s=r.getId(t);Ld(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Yh(e,Ld(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=>ed(e[0],e[1],{set(){Ld(h)({target:this,isTrusted:!1})}},!1,f))),Ld(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=Ld(o=>Qh(Ld(s=>{const i=Fd(s);if(!i||ad(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=[Yh("play",i(kd.Play),o),Yh("pause",i(kd.Pause),o),Yh("seeked",i(kd.Seeked),o),Yh("volumechange",i(kd.VolumeChange),o),Yh("ratechange",i(kd.RateChange),o)];return Ld(()=>{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:Ld((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=qd(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),_d(()=>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:Ld((n,s,o)=>{const[i]=o,{id:a,styleId:l}=qd(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),_d(()=>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:Ld((n,s,o)=>{const[i]=o,{id:a,styleId:l}=qd(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:Ld((n,s,o)=>{const[i]=o,{id:a,styleId:l}=qd(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};Jd("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Jd("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Jd("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Jd("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:Ld((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=qd(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...$d(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:Ld((n,s,o)=>{const[i]=o,{id:a,styleId:l}=qd(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...$d(s),i]}]}),n.apply(s,o)})})}),Ld(()=>{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=Vd(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:Ld((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}=qd(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:$d(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Ld((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=qd(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:$d(o.parentRule)}),s.apply(o,a)})}),Ld(()=>{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=td(t.fonts,"add",function(t){return function(r){return setTimeout(Ld(()=>{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),Ld(()=>{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=Ld(()=>{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;ad(i,n,s,!0)||ad(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Yh("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?td(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 Ld(()=>{Dd.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 Hd(e){return void 0!==window[e]}function Jd(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Kd{constructor(e){Ia(this,"iframeIdToRemoteIdMap",new WeakMap),Ia(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 Yd{constructor(e){Ia(this,"iframes",new WeakMap),Ia(this,"crossOriginIframeMap",new WeakMap),Ia(this,"crossOriginIframeMirror",new Kd(al)),Ia(this,"crossOriginIframeStyleMirror"),Ia(this,"crossOriginIframeRootIdMap",new WeakMap),Ia(this,"mirror"),Ia(this,"mutationCb"),Ia(this,"wrappedEmit"),Ia(this,"loadListener"),Ia(this,"stylesheetManager"),Ia(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Kd(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 vd.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:vd.IncrementalSnapshot,data:{source:wd.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case vd.Meta:case vd.Load:case vd.DomContentLoaded:return!1;case vd.Plugin:return t;case vd.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case vd.IncrementalSnapshot:switch(t.data.source){case wd.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 wd.Drag:case wd.TouchMove:case wd.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case wd.ViewportResize:return!1;case wd.MediaInteraction:case wd.MouseInteraction:case wd.Scroll:case wd.CanvasMutation:case wd.Input:return this.replaceIds(t.data,e,["id"]),t;case wd.StyleSheetRule:case wd.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case wd.Font:return t;case wd.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case wd.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===xd.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Xd{constructor(e){Ia(this,"shadowDoms",new WeakSet),Ia(this,"mutationCb"),Ia(this,"scrollCb"),Ia(this,"bypassOptions"),Ia(this,"mirror"),Ia(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(!Wa(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Ud({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Bd({...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(Kh.host(e))),this.restoreHandlers.push(Vd({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(td(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=Kh.shadowRoot(this);return o&&yd(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Zd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ep=0;ep<64;ep++)Qd[Zd.charCodeAt(ep)]=ep;const tp=new Map;const rp=(e,t,r)=>{if(!e||!op(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=tp.get(e);return r||(r=new Map,tp.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 np(e,t,r){if(e instanceof Array)return e.map(e=>np(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+=Zd[r[t]>>2],s+=Zd[(3&r[t])<<4|r[t+1]>>4],s+=Zd[(15&r[t+1])<<2|r[t+2]>>6],s+=Zd[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:[np(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:[np(e.data,t,r),e.width,e.height]}}if(op(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:rp(e,t,r)}}return e}const sp=(e,t,r)=>e.map(e=>np(e,t,r)),op=(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 ip(e,t,r,n){const s=[];try{const o=td(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!ad(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 ap(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=td(e,l,function(e){return function(...i){const a=e.apply(this,i);if(rp(a,o,this),"tagName"in this.canvas&&!ad(this.canvas,n,s,!0)){const e=sp(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=ed(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const lp='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',cp="undefined"!=typeof self&&self.Blob&&new Blob([lp],{type:"text/javascript;charset=utf-8"});function up(e){let t;try{if(t=cp&&(self.URL||self.webkitURL).createObjectURL(cp),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(lp),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class hp{constructor(e){Ia(this,"pendingCanvasMutations",new Map),Ia(this,"rafStamps",{latestId:0,invokeId:null}),Ia(this,"mirror"),Ia(this,"mutationCb"),Ia(this,"resetObservers"),Ia(this,"frozen",!1),Ia(this,"locked",!1),Ia(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=ip(t,r,n,!0),i=new Map,a=new up;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:Cd["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=>{ad(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=ip(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=td(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return ad(this.canvas,r,n,!0)||setTimeout(()=>{const r=sp(o,t,this);e(this.canvas,{type:Cd["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=ed(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Cd["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(...ap(t.WebGLRenderingContext.prototype,Cd.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...ap(t.WebGL2RenderingContext.prototype,Cd.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 dp{constructor(e){Ia(this,"trackedLinkElements",new WeakSet),Ia(this,"mutationCb"),Ia(this,"adoptedStyleSheetCb"),Ia(this,"styleMirror",new fd),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:qa(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 pp{constructor(){Ia(this,"nodeMap",new WeakMap),Ia(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 fp,mp,gp,yp=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(xa=e.contentWindow)?void 0:xa.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const vp=new Va;function wp(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,maskAttributeFn:g,hooks:y,packFn:v,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:k=!1,recordCrossOriginIframes:x=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:I=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:T,applyBackgroundColorToBlockedElements:N=!1}=e;Nd=T;const L=!x||window.parent===window;let _=!1;if(!L)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(L&&!t)throw new Error("emit function is required");if(!L&&!_)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),vp.reset();const D=!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},F=!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 U;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let j=0;const B=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!_&&(e=v(e)),e};fp=(e,s)=>{var o;const i=e;if(i.timestamp=rd(),!(null==(o=Dd[0])?void 0:o.isFrozen())||i.type===vd.FullSnapshot||i.type===vd.IncrementalSnapshot&&i.data.source===wd.Mutation||Dd.forEach(e=>e.unfreeze()),L)null==t||t(B(i),s);else if(_){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===vd.FullSnapshot)U=i,j=0;else if(i.type===vd.IncrementalSnapshot){if(i.data.source===wd.Mutation&&i.data.isAttachIframe)return;j++;const e=n&&j>=n,t=r&&i.timestamp-U.timestamp>r;(e||t)&&mp(!0)}};const z=e=>{fp({type:vd.IncrementalSnapshot,data:{source:wd.Mutation,...e}})},W=e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.Scroll,...e}}),$=e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.CanvasMutation,...e}}),q=new dp({mutationCb:z,adoptedStyleSheetCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.AdoptedStyleSheet,...e}})}),V=new Yd({mirror:vp,mutationCb:z,stylesheetManager:q,recordCrossOriginIframes:x,wrappedEmit:fp});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:vp,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new pp;gp=new hp({recordCanvas:k,mutationCb:$,win:window,blockClass:s,blockSelector:o,mirror:vp,sampling:w.canvas,dataURLOptions:b});const H=new Xd({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:k,inlineImages:M,sampling:w,slimDOMOptions:F,iframeManager:V,stylesheetManager:q,canvasManager:gp,keepIframeSrcFn:P,processedNodeManager:G},mirror:vp});mp=(e=!1)=>{if(!C)return;fp({type:vd.Meta,data:{href:window.location.href,width:od(),height:sd()}},e),q.reset(),H.init(),Dd.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Va,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,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C=()=>!1,applyBackgroundColorToBlockedElements:k=!1}=t||{};return Cl(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,maskAttributeFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:k})}(document,{mirror:vp,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:F,dataURLOptions:b,recordCanvas:k,inlineImages:M,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{hd(e,vp)&&V.addIframe(e),dd(e,vp)&&q.trackLinkElement(e),pd(e)&&H.addShadowRoot(Kh.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");fp({type:vd.FullSnapshot,data:{node:t,initialOffset:nd(window)}},e),Dd.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,vp.getId(document))};try{const e=[],t=e=>{var t;return Ld(Gd)({mutationCb:z,mousemoveCb:(e,t)=>fp({type:vd.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.ViewportResize,...e}}),inputCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.Input,...e}}),mediaInteractionCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.MediaInteraction,...e}}),styleSheetRuleCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.StyleSheetRule,...e}}),styleDeclarationCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.StyleDeclaration,...e}}),canvasMutationCb:$,fontCb:e=>fp({type:vd.IncrementalSnapshot,data:{source:wd.Font,...e}}),selectionCb:e=>{fp({type:vd.IncrementalSnapshot,data:{source:wd.Selection,...e}})},customElementCb:e=>{fp({type:vd.IncrementalSnapshot,data:{source:wd.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:C,recordCanvas:k,inlineImages:M,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:F,dataURLOptions:b,mirror:vp,iframeManager:V,stylesheetManager:q,shadowDomManager:H,processedNodeManager:G,canvasManager:gp,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>fp({type:vd.Plugin,data:{plugin:e.name,payload:t}})})))||[]},y)};V.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{mp(),e.push(t(document)),yp=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Yh("DOMContentLoaded",()=>{fp({type:vd.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&r()})),e.push(Yh("load",()=>{fp({type:vd.Load,data:{}}),"load"===O&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),yp=!1,Nd=void 0}}catch(e){console.warn(e)}}var bp;wp.addCustomEvent=(e,t)=>{if(!yp)throw new Error("please add custom event after start recording");fp({type:vd.Custom,data:{tag:e,payload:t}})},wp.freezePage=()=>{Dd.forEach(e=>e.freeze())},wp.takeFullSnapshot=e=>{if(!yp)throw new Error("please take full snapshot after start recording");mp(e)},wp.mirror=vp,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(bp||(bp={}));var Sp=Object.freeze({__proto__:null,record:wp}),Cp=["image/","audio/","video/","application/octet-stream","font/"];function kp(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var r=0,n=Math.min(e.length,t);r<n;){var s=Math.ceil((r+n)/2);new Blob([e.slice(0,s)]).size<=t?r=s:n=s-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}var xp=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e,t){this.eventCallback=e,this.networkConfig=t,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,this.networkConfig=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=m();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return i(e,void 0,void 0,function(){var e,s,o,i,l,c,u,h,d,p,f,m,g=this;return a(this,function(a){switch(a.label){case 0:e=Date.now(),s={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(null==(o=null===(f=this.networkConfig)||void 0===f?void 0:f.body)?void 0:o.request)&&void 0!==(i=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(e,r){t.push("".concat(r,"=").concat("string"==typeof e?e:"[File]"))}),t.join("&")}}}(null==n?void 0:n.body))&&(l=null!==(m=o.maxBodySizeBytes)&&void 0!==m?m:10240,s.requestBody=kp(i,l).value),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return c=a.sent(),d=Date.now(),s.status=c.status,s.duration=d-e,u={},c.headers.forEach(function(e,t){u[t]=e}),s.responseHeaders=u,(null==o?void 0:o.response)?!function(e){return!!e&&Cp.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?c.clone().text().then(function(e){var t,r=kp(e,null!==(t=o.maxBodySizeBytes)&&void 0!==t?t:10240),n=r.value,i=r.truncated;s.responseBody=n,s.responseBodyStatus=i?"truncated":"captured",g.notifyEvent(s)},function(){s.responseBodyStatus="error",g.notifyEvent(s)}):(s.responseBodyStatus="skipped_binary",this.notifyEvent(s)):this.notifyEvent(s),[2,c];case 3:throw h=a.sent(),d=Date.now(),s.duration=d-e,p=h,s.error={name:p.name||"UnknownError",message:p.message||"An unknown error occurred"},this.notifyEvent(s),h;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),Op=Object.freeze({__proto__:null,NetworkObservers:xp});return e.SessionReplayPlugin=br,e.plugin=Sr,e.sessionReplayPlugin=Sr,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
1
|
+
var sessionReplay=function(e){"use strict";var t=function(e,r){return t=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])},t(e,r)};function r(e,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=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,s,o=function(){return o=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},o.apply(this,arguments)};function i(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 a(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 l(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 c(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 u(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,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var h,d="$default_instance",p="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"}(h||(h={}));var f,m=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},g=u([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),y=function(e){var t,r=m();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,y)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,u([],c(n.entries()),!1).map(function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(g[n]):g[n]}).join("")},v=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"}(f||(f={}));var w="Amplitude Logger ",b=function(){function e(){this.logLevel=f.None}return e.prototype.disable=function(){this.logLevel=f.None},e.prototype.enable=function(e){void 0===e&&(e=f.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Verbose||console.log("".concat(w,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Warn||console.warn("".concat(w,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Error||console.error("".concat(w,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Debug||console.log("".concat(w,"[Debug]: ").concat(e.join(" ")))},e}(),S=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:d,logLevel:f.Warn,loggerProvider:new b,offline:!1,optOut:!1,serverUrl:p,serverZone:"US",useBatch:!1}},C=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=S();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=x(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}(),k=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":p},x=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=S().serverZone),void 0===r&&(r=S().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:S().serverZone;return{serverZone:n,serverUrl:k(n,r)}};var O=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<f.Debug||!c||!l)return e.apply(s,o);var u,h={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&&h.states&&(h.states.before=n());var d=e.apply(s,o);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}},E=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:I(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),I=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},M=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}(),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 P(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 A(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 T=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var o=P(["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(!T(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){T(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!T(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 N,L=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=R({},this.identity.userProperties),r=R(R({},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=P(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=A(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,P(Object.entries(p))),m=f.next();!m.done;m=f.next()){var g=A(m.value,2),y=g[0],v=g[1];l[y]=v}}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,P(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[y=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 R({},this.identity)},e.prototype.setIdentity=function(e){var t=R({},this.identity);this.identity=R({},e),T(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}(),_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,D=function(){function e(){this.identityStore=new L,this.eventBridge=new M,this.applicationContextProvider=new E}return e.getInstance=function(t){return _.analyticsConnectorInstances||(_.analyticsConnectorInstances={}),_.analyticsConnectorInstances[t]||(_.analyticsConnectorInstances[t]=new e),_.analyticsConnectorInstances[t]},e}(),F=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},U=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,d,p,f,m,g,y,v,w,b,S,C,k;if("object"!=typeof e)return null;var x=e.code||0,O=this.buildStatus(x);switch(O){case h.Success:return{status:O,statusCode:x,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 h.Invalid:return{status:O,statusCode:x,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!==(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 h.PayloadTooLarge:return{status:O,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case h.RateLimit:return{status:O,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v: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!==(k=e.throttled_events)&&void 0!==k?k:[]}};case h.Timeout:default:return{status:O,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),j=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return r(t,e),t.prototype.send=function(e,t){return i(this,void 0,void 0,function(){var r,n,s;return a(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:o({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=i.sent()).text()];case 2:s=i.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(U),B=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),z=401,W=403,$=429,q=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new B(e,t)}return e.prototype.subscribe=function(e,t,r){var n=y(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return i(this,void 0,void 0,function(){var e,t=this;return a(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return i(this,void 0,void 0,function(){var t,r,n,s=this;return a(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return s.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=s.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),i(this,void 0,void 0,function(){var r,n,s,o,i,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,i,l,u,h,d;return a(this,function(a){switch(a.label){case 0:s=!0,i=new AbortController,l=setTimeout(function(){return i.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(u=a.sent()).ok?[3,4]:[4,u.text()];case 3:return h=a.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(h)),u.status===z||u.status===W?(o.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,s=!1):u.status>=400&&u.status<500&&u.status!==$&&(s=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=a.sent())instanceof Error&&"AbortError"===d.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(l),[7];case 9:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11]:[2,"break"];case 10:a.sent(),a.label=11;case 11:return[2]}})},o=this,i=0,u.label=1;case 1:return i<e?[5,s(i)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];if("break"===l)return[3,4];u.label=3;case 3:return i++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(N||(N={}));var V,G="https://app.amplitude.com",H={US:G,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var J="__AMPLITUDE_MESSENGER_INSTANCE__",K="__AMPLITUDE_MESSENGER__",Y=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?G:t;this[V]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,s;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(s=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===s||s.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var s="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:s,action:e,args:t};return new Promise(function(t,i){n.requestCallbacks[s]={resolve:t,reject:i},n.notify(o),r.timeout>0&&setTimeout(function(){i(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},r.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var r,n,s,o;this.actionHandlers.has(e)&&(null===(o=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===o||o.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var i=this.pendingMessages.get(e);if(i){this.pendingMessages.delete(e);try{for(var a=l(i),c=a.next();!c.done;c=a.next()){t(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return i(this,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,o=s.logger,i=s.endpoint;o&&(this.logger=o),i&&this.endpoint===G&&(this.endpoint=i),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,s,o,i;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(o=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===o||o.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(i=n.pendingMessages.get(l))&&void 0!==i?i:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=m();(null==e?void 0:e[K])===this&&delete e[K]},e}();function X(e){var t,r=m(),n=null==r?void 0:r[K];if("object"==typeof(t=n)&&null!==t&&J in t&&!0===t[J])return n;var s=new Y(e);return r&&(r[K]=s),s}V=J;var Z="__AMPLITUDE_BACKGROUND_CAPTURE__";var Q,ee="[Amplitude]",te="".concat(ee," Session Replay ID"),re=N.US,ne={enabled:!0},se=1e3,oe="".concat(ee," Session Replay Debug"),ie="amp-mask",ae="https://api-sr.amplitude.com/sessions/v2/track",le="https://api-sr.eu.amplitude.com/sessions/v2/track",ce="https://api-sr.stag2.amplitude.com/sessions/v2/track";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(Q||(Q={}));var ue=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}(),he="medium";function de(e,t){return t||("STAGING"===e?ce:"EU"===e?le:ae)}var pe=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 pe(e,he,r)}},fe=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var o=l(t.urlMaskLevels),i=o.next();!i.done;i=o.next()){var a=i.value;if(be(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:he},me=function(e,t,r,n){var s,o;if(void 0===t&&(t={defaultMaskLevel:he}),r){if(r.closest("."+ie))return!0;var i=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(o=t.unmaskSelector)&&void 0!==o?o:[]).some(function(e){return r.closest(e)});if(a)return!1}return pe(e,fe(n,t),r)},ge=function(e,t,r){return function(n,s){return me(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},ye=function(e,t){return function(r,n,s){var o;return"style"===r?n:(null!==(o=null==e?void 0:e.maskAttributes)&&void 0!==o?o:[]).includes(r)&&me("text",e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},ve=function(){var e=m();return(null==e?void 0:e.location)?e.location.href:""},we=new Map,be=function(e){var t=we.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",o="\0ST\0",i="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,o)).replace(/\?/g,i)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(o).join(".*")).split(i).join(".");var l=new RegExp("^".concat(a,"$"));return we.set(e,l),l},Se=function(e,t){var r,n;try{for(var s=l(t),o=s.next();!o.done;o=s.next()){var i=o.value,a=be(i.selector);if(a.test(e))return e.replace(a,i.replacement)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},Ce=function(){return i(void 0,void 0,void 0,function(){var e,t,r,n,s,o,i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=m())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,s=t.usageDetails,o=r?Math.round(r/1024):0,i=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:i,usageDetails:JSON.stringify(s)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},ke=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},xe=function(){return{flushMaxRetries:2,logLevel:f.Warn,loggerProvider:new b,transportProvider:new j}},Oe=function(e){function t(t,r){var n,s,i,a,l,c,u,h=this,d=xe();if((h=e.call(this,o(o({transportProvider:d.transportProvider,loggerProvider:new ue(r.loggerProvider||d.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=d.flushMaxRetries?r.flushMaxRetries:d.flushMaxRetries,h.apiKey=t,h.sampleRate=r.sampleRate||0,h.serverZone=r.serverZone||re,h.configServerUrl=r.configServerUrl,h.trackServerUrl=r.trackServerUrl,h.shouldInlineStylesheet=r.shouldInlineStylesheet,h.version=r.version,h.performanceConfig=r.performanceConfig||ne,h.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",h.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,h.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,h.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:se,h.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(h.privacyConfig=r.privacyConfig),r.interactionConfig&&(h.interactionConfig=r.interactionConfig,h.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")}(h.interactionConfig.ugcFilterRules)),r.debugMode&&(h.debugMode=r.debugMode),void 0!==r.useWebWorker)h.useWebWorker=r.useWebWorker;else{var p=r;void 0!==(null===(c=p.experimental)||void 0===c?void 0:c.useWebWorker)&&(h.useWebWorker=p.experimental.useWebWorker)}return r.omitElementTags&&(h.omitElementTags=r.omitElementTags),h.captureAdoptedStyleSheets=null===(u=r.captureAdoptedStyleSheets)||void 0===u||u,h}return r(t,e),t}(C),Ee=(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))(Ee||{}),Ie=(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))(Ie||{}),Me=(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))(Me||{}),Re=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r,n,s,h,d;return i(this,void 0,void 0,function(){var i,p,f,m,g,y,v,w,b,S,C,k,x,O,E,I,M,R=this;return a(this,function(a){switch(a.label){case 0:(i=o({},this.localConfig)).optOut=this.localConfig.optOut,i.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(e,t){R.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,n){var s;if(R.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var o=r,a=o.sr_sampling_config,l=o.sr_privacy_config,c=o.sr_targeting_config,u=null===(s=i.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;i.interactionConfig=o.sr_interaction_config,i.interactionConfig&&u&&(i.interactionConfig.ugcFilterRules=u),i.loggingConfig=o.sr_logging_config,(a||l||c)&&(p={},a&&(p.sr_sampling_config=a),l&&(p.sr_privacy_config=l),c&&(p.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return a.sent(),[3,4];case 3:return f=a.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",f),i.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:void 0}];case 4:if(!p)return[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:p}];if(m=p.sr_sampling_config,g=p.sr_privacy_config,y=p.sr_targeting_config,m&&Object.keys(m).length>0?(Object.prototype.hasOwnProperty.call(m,"capture_enabled")?i.captureEnabled=m.capture_enabled:i.captureEnabled=!1,Object.prototype.hasOwnProperty.call(m,"sample_rate")&&(i.sampleRate=m.sample_rate)):(i.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),g){v=null!==(e=i.privacyConfig)&&void 0!==e?e:{},w={defaultMaskLevel:null!==(r=null!==(t=g.defaultMaskLevel)&&void 0!==t?t:v.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:u([],c(new Set(u(u([],c(null!==(n=v.maskAttributes)&&void 0!==n?n:[]),!1),c(null!==(s=g.maskAttributes)&&void 0!==s?s:[]),!1))),!1),urlMaskLevels:u(u([],c(null!==(h=g.urlMaskLevels)&&void 0!==h?h:[]),!1),c(null!==(d=v.urlMaskLevels)&&void 0!==d?d:[]),!1)},b=function(e){var t,r,n,s,o,i,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=l(null!==(a=e.blockSelector)&&void 0!==a?a:[]),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=l(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=l(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),y=g.next();!y.done;y=g.next()){h[y.value]="unmask"}}catch(e){o={error:e}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return h},S=o(o({},b(v)),b(g));try{for(C=l(Object.entries(S)),k=C.next();!k.done;k=C.next())x=c(k.value,2),O=x[0],"mask"===(E=x[1])?w.maskSelector.push(O):"block"===E?w.blockSelector.push(O):"unmask"===E&&w.unmaskSelector.push(O)}catch(e){I={error:e}}finally{try{k&&!k.done&&(M=C.return)&&M.call(C)}finally{if(I)throw I.error}}i.privacyConfig=(P=w,A=this.localConfig.loggerProvider,T=document.createDocumentFragment(),N=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{T.querySelector(e)}catch(t){return A.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},P.blockSelector=N(P.blockSelector),P.maskSelector=N(P.maskSelector),P.unmaskSelector=N(P.unmaskSelector),P)}return y&&Object.keys(y).length>0&&(i.targetingConfig=y),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:ke(i)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:p}]}var P,A,T,N})})},e}(),Pe=function(e,t){return i(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new Oe(e,t),n=new q(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new Re(n,r)]})})};function Ae(e){if(e.type!==Ee.IncrementalSnapshot)return!1;var t=e.data;return t.source===Ie.Mutation&&!t.isAttachIframe}function Te(e){var t,r,n,s,i=e[0],a=new Map,u=new Map,h=new Map,d=new Map,p=new Map;e.forEach(function(e,t){var r,n,s,o,i=e.data;try{for(var c=l(i.adds),f=c.next();!f.done;f=c.next()){var m=f.value;a.has(m.node.id)||a.set(m.node.id,t),u.set(m.node.id,t),p.set(m.node.id,m.parentId)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}try{for(var g=l(i.removes),y=g.next();!y.done;y=g.next()){var v=y.value;h.has(v.id)||h.set(v.id,t),d.set(v.id,t)}}catch(e){s={error:e}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(s)throw s.error}}});var f=new Set,m=new Set;try{for(var g=l(a),y=g.next();!y.done;y=g.next()){var v=c(y.value,2),w=v[0],b=v[1],S=h.get(w);if(void 0!==S)u.get(w)>=d.get(w)||(b<S?f.add(w):S<b&&m.add(w))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}var C=new Set;if(f.size>0||m.size>0)for(var k=!0;k;){k=!1;try{for(var x=(n=void 0,l(p)),O=x.next();!O.done;O=x.next()){var E=c(O.value,2),I=E[0],M=E[1];if(!f.has(I)&&!m.has(I)&&!C.has(I)&&(f.has(M)||m.has(M)||C.has(M))){var R=h.get(I),P=a.get(I);void 0!==R&&void 0!==P&&R<P?m.add(I):void 0!==R&&void 0!==P&&R===P?C.add(I):f.add(I),k=!0}}}catch(e){n={error:e}}finally{try{O&&!O.done&&(s=x.return)&&s.call(x)}finally{if(n)throw n.error}}}var A=f.size>0||m.size>0||C.size>0,T=[];e.forEach(function(e,t){var r,n;try{for(var s=l(e.data.removes),o=s.next();!o.done;o=s.next()){var i=o.value;f.has(i.id)||(m.has(i.id)&&t>=a.get(i.id)||C.has(i.id)&&(f.has(i.parentId)||m.has(i.parentId)||C.has(i.parentId))||T.push(i))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}});var N=e.flatMap(function(e){return e.data.adds}),L=e.flatMap(function(e){return e.data.texts}),_=e.flatMap(function(e){return e.data.attributes}),D={source:Ie.Mutation,removes:T,adds:A?N.filter(function(e){return!f.has(e.node.id)&&!m.has(e.node.id)&&!C.has(e.node.id)}):N,texts:A?L.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):L,attributes:A?_.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):_};return o(o({},i),{data:D})}function Ne(e){if(e.length<=1)return e;for(var t=[],r=0;r<e.length;)if(Ae(e[r])){for(var n=r+1;n<e.length&&Ae(e[n]);)n++;t.push(n>r+1?Te(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}var Le=function(){function e(e,t,r,n,s){var o,i=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,s=t.delay,o=t.data;return null!=s?JSON.stringify({type:r,timestamp:n,delay:s,data:o}):JSON.stringify({type:r,timestamp:n,data:o})},this.addCompressedEventToManager=function(e,t){i.eventsManager&&i.deviceId&&i.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:i.deviceId})},this.addCompressedEvent=function(e,t){if(i.worker)try{i.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?i.worker.postMessage(JSON.stringify({event:e,sessionId:t})):i.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=i.compressEvent(e);i.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=i.worker)||void 0===e||e.terminate()};var a=m();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(o=t.performanceConfig)||void 0===o?void 0:o.timeout)||2e3,this.onFullSnapshotProcessed=s,n){t.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([n],{type:"application/javascript"}),c=URL.createObjectURL(l),u=new Worker(c);u.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),u.terminate(),i.worker=void 0},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;i.addCompressedEventToManager(r,n)},this.worker=u}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}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,n,s,o;if(e.type===Ee.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var i=u(u([],c(this.taskQueue.splice(0)),!1),c(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=l(i),h=a.next();!h.done;h=a.next()){var d=h.value,p=this.compressEvent(d.event);this.addCompressedEventToManager(p,d.sessionId)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}this.isProcessing=!1}var f=this.compressEvent(e);return this.addCompressedEventToManager(f,t),void(null===(s=this.onFullSnapshotProcessed)||void 0===s||s.call(this))}this.canUseIdleCallback&&(null===(o=this.config.performanceConfig)||void 0===o?void 0:o.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.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){var t,r=this;for(this.pendingQueue.length>0&&(t=this.taskQueue).push.apply(t,u([],c(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var s=n.event,o=n.sessionId;this.addCompressedEvent(s,o)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(e){r.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e.prototype.mergeMutationTasks=function(e){var t,r,n;if(!(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var s=[],o=0;o<e.length;){for(var i=e[o].sessionId,a=o+1;a<e.length&&e[a].sessionId===i;)a++;var c=Ne(e.slice(o,a).map(function(e){return e.event}));try{for(var u=(t=void 0,l(c)),h=u.next();!h.done;h=u.next()){var d=h.value;s.push({event:d,sessionId:i})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}o=a}return s},e}(),_e="Session replay event batch rejected due to exceeded retry count",De="Failed to store session replay events in IndexedDB",Fe="1.40.0";function Ue(e,t){return i(this,void 0,void 0,function(){var r,n,s,o,c,u,h,d,p,f,m,g,y,v,w=this;return a(this,function(b){switch(b.label){case 0:return b.trys.push([0,4,,5]),r=t.CompressionStream,n=new r("gzip"),s=n.writable.getWriter(),o=n.readable.getReader(),c=[],u=i(w,void 0,void 0,function(){var e,t,r;return a(this,function(n){switch(n.label){case 0:return[4,o.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];c.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,s.write((new TextEncoder).encode(e))];case 1:return b.sent(),[4,s.close()];case 2:return b.sent(),[4,u];case 3:b.sent(),h=c.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(h),p=0;try{for(f=l(c),m=f.next();!m.done;m=f.next())g=m.value,d.set(g,p),p+=g.length}catch(e){y={error:e}}finally{try{m&&!m.done&&(v=f.return)&&v.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return b.sent(),[2,null];case 5:return[2]}})})}var je=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher,s=e.workerScript,o=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t,s)try{var i=new Blob([s],{type:"application/javascript"}),a=URL.createObjectURL(i),u=new Worker(a);u.onerror=function(e){var t,n;e.preventDefault(),r.error("Track destination worker failed, falling back to main-thread sending: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),u.terminate(),o.worker=void 0;try{for(var s=l(o.pendingWorkerRequests),i=s.next();!i.done;i=s.next()){var a=c(i.value,2)[1];r.warn("Session replay event send failed due to worker crash: ".concat(e.message)),a.resolve()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}o.pendingWorkerRequests.clear()},u.onmessage=function(e){var t=e.data;if("log"===t.type)r.log(t.message);else if("warn"===t.type)r.warn(t.message);else if("complete"===t.type){var n=o.pendingWorkerRequests.get(t.id);n&&(o.completeRequest({context:n.context}),n.resolve(),o.pendingWorkerRequests.delete(t.id))}},this.worker=u}catch(e){r.error("Failed to create track destination worker, falling back to main-thread sending:",e)}}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.sendBeacon=function(e){var t,r,n=e.events,s=e.sessionId,o=e.deviceId,i=e.apiKey,a=e.serverZone,l=function(e){return new Blob([e]).size},c=n,u=JSON.stringify({version:2,events:c});if(l(u)>65536){for(var h=0,d=c.length;h<d;){var p=Math.floor((h+d+1)/2);l(JSON.stringify({version:2,events:c.slice(0,p)}))<=65536?h=p:d=p-1}c=c.slice(0,h),u=JSON.stringify({version:2,events:c}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(n.length," to ").concat(c.length," events"))}if(0!==c.length){var f=new URLSearchParams({device_id:o,session_id:String(s),type:"replay",api_key:i}),g="".concat(de(a,this.trackServerUrl),"?").concat(f.toString()),y=m();try{var v=new Blob([u],{type:"application/json"});!1===(null===(r=null===(t=null==y?void 0:y.navigator)||void 0===t?void 0:t.sendBeacon)||void 0===r?void 0:r.call(t,g,v))&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch(e){}}},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:_e}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),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),i(this,void 0,void 0,function(){var t,r,n,s,o,i,c;return a(this,function(a){switch(a.label){case 0:t=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(t),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,this.send(s,e)]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 8:return[2]}})})},e.prototype.send=function(e,t){return void 0===t&&(t=!0),i(this,void 0,void 0,function(){var r,n,s,o;return a(this,function(i){return(r=e.apiKey)?(n=e.deviceId)?0===(s=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(o=this.worker)?[2,this.sendViaWorker(o,e,s,t)]:[2,this.sendOnMainThread(r,n,e,s,t)]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})]})})},e.prototype.sendViaWorker=function(e,t,r,n){return i(this,void 0,void 0,function(){var s,o=this;return a(this,function(i){return s="".concat(++this.sendIdCounter),[2,new Promise(function(i){var a;o.pendingWorkerRequests.set(s,{context:t,resolve:i}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(a=t.flushMaxRetries)&&void 0!==a?a:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:o.trackServerUrl,version:t.version,currentUrl:ve(),sdkVersion:Fe}})})]})})},e.prototype.sendOnMainThread=function(e,t,r,n,s){var l,c,u,h;return i(this,void 0,void 0,function(){var i,d,p,f,g,y,v,w,b,S,C,k,x,O;return a(this,function(a){switch(a.label){case 0:i=ve(),d=Fe,p=r.sampleRate,f=new URLSearchParams({device_id:t,session_id:"".concat(r.sessionId),type:"".concat(r.type)}),g="".concat(null!==(c=null===(l=r.version)||void 0===l?void 0:l.type)&&void 0!==c?c:"standalone","/").concat(null!==(h=null===(u=r.version)||void 0===u?void 0:u.version)&&void 0!==h?h:d),a.label=1;case 1:return a.trys.push([1,9,,10]),y=JSON.stringify(n),(v=m())&&"CompressionStream"in v?[4,Ue(y,v)]:[3,3];case 2:return b=a.sent(),[3,4];case 3:b=null,a.label=4;case 4:return w=b,S={headers:o({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":d,"X-Client-Library":g,"X-Client-Url":i.substring(0,1e3),"X-Client-Sample-Rate":"".concat(p),"X-Sampling-Hash-Alg":"xxhash32"},w?{"Content-Encoding":"gzip"}:{}),body:null!=w?w:y,method:"POST"},C="".concat(de(r.serverZone,this.trackServerUrl),"?").concat(f.toString()),[4,fetch(C,S)];case 5:if(null===(k=a.sent()))return this.completeRequest({context:r,err:"Unexpected error occurred"}),[2];if(s)return[3,6];x="";try{x=JSON.stringify(k.body,null,2)}catch(e){}return this.completeRequest({context:r,success:"".concat(k.status,": ").concat(x)}),[3,8];case 6:return[4,this.handleReponse(k.status,r)];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:return O=a.sent(),this.completeRequest({context:r,err:O}),[3,10];case 10:return[2]}})})},e.prototype.handleReponse=function(e,t){return i(this,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:switch(r=(new U).buildStatus(e),r){case h.Success:return[3,1];case h.Failed:case h.Timeout:case h.RateLimit:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(t),[3,7];case 2:return[4,this.handleOtherResponse(t)];case 3:return n.sent(),[3,7];case 4:return 499!==e?[3,6]:[4,this.handleOtherResponse(t)];case 5:return n.sent(),[3,7];case 6:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),n.label=7;case 7:return[2]}})})},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){return i(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return t=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:_e}),[2]):[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},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 Be=(e,t)=>t.some(t=>e instanceof t);let ze,We;const $e=new WeakMap,qe=new WeakMap,Ve=new WeakMap;let Ge={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return $e.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ye(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function He(e){Ge=e(Ge)}function Je(e){return(We||(We=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Xe(this),t),Ye(this.request)}:function(...t){return Ye(e.apply(Xe(this),t))}}function Ke(e){return"function"==typeof e?Je(e):(e instanceof IDBTransaction&&function(e){if($e.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)});$e.set(e,t)}(e),Be(e,ze||(ze=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Ge):e)}function Ye(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(Ye(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return Ve.set(t,e),t}(e);if(qe.has(e))return qe.get(e);const t=Ke(e);return t!==e&&(qe.set(e,t),Ve.set(t,e)),t}const Xe=e=>Ve.get(e);function Ze(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=Ye(i);return n&&i.addEventListener("upgradeneeded",e=>{n(Ye(i.result),e.oldVersion,e.newVersion,Ye(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 Qe=["get","getKey","getAll","getAllKeys","count"],et=["put","add","delete","clear"],tt=new Map;function rt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(tt.get(t))return tt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=et.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Qe.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 tt.set(t,o),o}He(e=>({...e,get:(t,r,n)=>rt(t,r)||e.get(t,r,n),has:(t,r)=>!!rt(t,r)||e.has(t,r)}));const nt=["continue","continuePrimaryKey","advance"],st={},ot=new WeakMap,it=new WeakMap,at={get(e,t){if(!nt.includes(t))return e[t];let r=st[t];return r||(r=st[t]=function(...e){ot.set(this,it.get(this)[t](...e))}),r}};async function*lt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,at);for(it.set(r,t),Ve.set(r,Xe(t));t;)yield r,t=await(ot.get(r)||t.continue()),ot.delete(r)}function ct(e,t){return t===Symbol.asyncIterator&&Be(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Be(e,[IDBIndex,IDBObjectStore])}He(e=>({...e,get:(t,r,n)=>ct(t,r)?lt:e.get(t,r,n),has:(t,r)=>ct(t,r)||e.has(t,r)}));var ut,ht,dt,pt=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=s.getStringSize(t);return s.getEventsArraySize(e)+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.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=l(e),o=s.next();!o.done;o=s.next()){var i=o.value;n+=this.getStringSize(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}(),ft=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)},mt="sessionCurrentSequence",gt="sequencesToSend",yt=function(e){var t,r;return e.objectStoreNames.contains(mt)||(r=e.createObjectStore(mt,{keyPath:"sessionId"})),e.objectStoreNames.contains(gt)||(t=e.createObjectStore(gt,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},vt=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,Ze(e,1,{upgrade:yt})];case 1:return[2,t.sent()]}})})},wt=function(e){function t(t){var r,n=this;return(n=e.call(this,t)||this).consecutiveFailures=0,n.hasTriggeredFallback=!1,n.getSequencesToSend=function(){return i(n,void 0,void 0,function(){var e,t,r,n,s,o,i,l,c=this;return a(this,function(a){switch(a.label){case 0:e=!1,a.label=1;case 1:return a.trys.push([1,6,,7]),t=[],(r=this.db.transaction("sequencesToSend")).done.catch(function(t){e||ft(c.loggerProvider,"".concat(De,": ").concat(t),t)}),[4,r.store.openCursor()];case 2:n=a.sent(),a.label=3;case 3:return n?(s=n.value,o=s.sessionId,i=s.events,t.push({events:i,sequenceId:n.key,sessionId:o}),[4,n.continue()]):[3,5];case 4:return n=a.sent(),[3,3];case 5:return this.recordSuccess(),[2,t];case 6:return l=a.sent(),e=!0,ft(this.loggerProvider,"".concat(De,": ").concat(l),l),this.recordFailure(),[3,7];case 7:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return i(n,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(mt,e)];case 1:return(t=s.sent())?[4,this.db.put(gt,{sessionId:e,events:t.events})]:(this.recordSuccess(),[2,void 0]);case 2:return r=s.sent(),[4,this.db.put(mt,{sessionId:e,events:[]})];case 3:return s.sent(),this.recordSuccess(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),ft(this.loggerProvider,"".concat(De,": ").concat(n),n),this.recordFailure(),[3,5];case 5:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return i(n,void 0,void 0,function(){var r,n,s,o,i,l,c=this;return a(this,function(a){switch(a.label){case 0:r=!1,a.label=1;case 1:return a.trys.push([1,9,,10]),(n=this.db.transaction([mt,gt],"readwrite")).done.catch(function(e){r||ft(c.loggerProvider,"".concat(De,": ").concat(e),e)}),[4,n.objectStore(mt).get(e)];case 2:return(s=a.sent())?[3,4]:[4,n.objectStore(mt).put({sessionId:e,events:[t]})];case 3:return a.sent(),this.recordSuccess(),[2,void 0];case 4:return this.shouldSplitEventsList(s.events,t)?[3,6]:[4,n.objectStore(mt).put({sessionId:e,events:s.events.concat(t)})];case 5:return a.sent(),this.recordSuccess(),[2,void 0];case 6:return o=s.events,[4,n.objectStore(mt).put({sessionId:e,events:[t]})];case 7:return a.sent(),[4,n.objectStore(gt).put({sessionId:e,events:o})];case 8:return i=a.sent(),this.recordSuccess(),[2,{events:o,sessionId:e,sequenceId:i}];case 9:return l=a.sent(),r=!0,ft(this.loggerProvider,"".concat(De,": ").concat(l),l),this.recordFailure(),[3,10];case 10:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return i(n,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.db.put(gt,{sessionId:e,events:t})];case 1:return r=s.sent(),this.recordSuccess(),[2,r];case 2:return n=s.sent(),ft(this.loggerProvider,"".concat(De,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return i(n,void 0,void 0,function(){var e;return a(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(gt,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),ft(this.loggerProvider,"".concat(De,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},n.db=t.db,n.onPersistentFailure=t.onPersistentFailure,n.consecutiveFailureThreshold=null!==(r=t.consecutiveFailureThreshold)&&void 0!==r?r:3,n}return r(t,e),t.prototype.recordFailure=function(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))},t.prototype.recordSuccess=function(){this.consecutiveFailures=0},t.new=function(e,r){return i(this,void 0,void 0,function(){var n,s,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="replay"===e?"":"_".concat(e),s="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(n),[4,vt(s)];case 1:return i=a.sent(),[2,new t(o(o({},r),{db:i}))];case 2:return l=a.sent(),ft(r.loggerProvider,"".concat(De,": ").concat(l),l),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return i(this,void 0,void 0,function(){var t,r,n,s,o,i,c;return a(this,function(a){switch(a.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=a.sent())?[2,[s]]:[2,void 0];case 2:t=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=l.apply(void 0,[a.sent()]),n=r.next(),a.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),a.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=a.sent(),i={error:o},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 10:return[2,t]}})})},t}(pt),bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=u([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return i(this,void 0,void 0,function(){return a(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],s=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:s,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return i(this,void 0,void 0,function(){var r;return a(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]})})},t.prototype.storeSendingEvents=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(pt),St=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.type,l=e.payloadBatcher,h=e.storeType,d=e.trackDestinationWorkerScript;return i(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(t){return[2,p.flush(e)]})})}var p,f,m,g,y,v,w,b,S,C,k,x,O,E,I;return a(this,function(M){switch(M.label){case 0:return p=new je(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:l,workerScript:d})),f=function(){return new bt({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r})},g=!1,v=function(){return i(void 0,void 0,void 0,function(){var e,r,n;return a(this,function(s){switch(s.label){case 0:return g?(g=!1,t.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),m?[4,y.getSequencesToSend()]:[3,2]):[2];case 1:return r=s.sent(),[3,3];case 2:r=void 0,s.label=3;case 3:return e=r,y=f(),e&&m&&(n=m,e.forEach(function(e){x({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},w=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(o){switch(o.label){case 0:return[4,wt.new(s,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,apiKey:t.apiKey,onPersistentFailure:function(){v()}})];case 1:return(e=o.sent())?(g=!0,[2,e]):(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,f()])}})})},"idb"!==h?[3,2]:[4,w()];case 1:return b=M.sent(),[3,3];case 2:b=f(),M.label=3;case 3:return y=b,S=[],C=0,k=function(e){if(!(e<=C)){var t=Math.min(e-C,S.length);t>0&&(S.splice(0,t),C=e)}},x=function(e){var r=e.events,n=e.sessionId,o=e.deviceId,l=e.sequenceId;t.debugMode&&Ce().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(){}),p.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:o,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return i(void 0,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,y.cleanUpSessionEventsStore(n,l)];case 1:return e.sent(),[2]}})})}})},O=function(e){var r=e.sessionId,n=e.deviceId;m=n;var s=C+S.length;y.storeCurrentSequence(r).then(function(e){e&&(k(s),x({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)})},E=function(e){var t=e.deviceId;return i(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return m=t,[4,y.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){x({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},I=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;m=s;var o=C+S.length;S.push(r.data),y.addEventToCurrentSequence(n,r.data).then(function(e){e&&(k(o),x({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:O,addEvent:I,sendStoredEvents:E,flush:e,getBeaconEvents:function(){return u([],c(S),!1)},trackDestination:p}]}})})},Ct=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 i(this,void 0,void 0,function(){var t;return a(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 i(this,void 0,void 0,function(){var t;return a(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 kt(e,t){if(dt=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 r={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};ut=o(o({},r),t),ht=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(ut.root,r);var n=xt(e,"all",function(){return xt(e,"two",function(){return xt(e,"one",function(){return xt(e,"none")})})});if(n){var s=Lt(_t(n,e));return s.length>0&&(n=s[0]),Et(n)}throw new Error("Selector was not found.")}function xt(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,h=(new Date).getTime()-dt.getTime();if(void 0!==ut.timeoutMs&&h>ut.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=At(function(e){var t=e.getAttribute("id");if(t&&ut.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||At.apply(void 0,u([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return ut.attr(e.name,e.value)});return t.map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(o)),!1))||At.apply(void 0,u([],c(function(e){var t=Array.from(e.classList).filter(ut.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||At(function(e){var t=e.tagName.toLowerCase();if(ut.tagName(t))return{name:t,penalty:2};return null}(o))||[{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}(o);if("all"==t)p&&(d=d.concat(d.filter(Pt).map(function(e){return Rt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Pt).map(function(e){return Rt(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Pt(f)&&(d=[Rt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Rt(d[0],p)]));try{for(var m=(e=void 0,l(d)),g=m.next();!g.done;g=m.next()){(f=g.value).level=i}}catch(t){e={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(e)throw e.error}}if(s.push(d),s.length>=ut.seedMinLength&&(n=Ot(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=Ot(s,r)),!n&&r?r():n}function Ot(e,t){var r,n,s=Lt(Nt(e));if(s.length>ut.threshold)return t?t():null;try{for(var o=l(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(Mt(a))return a}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function Et(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 It(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Mt(e){var t=Et(e);switch(ht.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 Rt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Pt(e){return"html"!==e.name&&!e.name.startsWith("#")}function At(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Tt);return r.length>0?r:null}function Tt(e){return null!=e}function Nt(e,t){var r,n,s,o,i,c;return void 0===t&&(t=[]),a(this,function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(e[0]),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,l(Nt(e.slice(1,e.length),t.concat(s)))]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}})}function Lt(e){return u([],c(e),!1).sort(function(e,t){return It(e)-It(t)})}function _t(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),a(this,function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>ut.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>ut.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),o=Et(s),r.visited.has(o)?[2]:Mt(s)&&function(e,t){return ht.querySelector(Et(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,l(_t(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Dt=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}},Ft=function(e){var t=e.version,r=e.events,n=[];r.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)});var s=n.reduce(function(e,t){var r=t.x,n=t.y,s=t.selector,i=t.timestamp,a=i-i%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=o(o({},t),{timestamp:a,count:1}),e},{});return{version:t,events:Object.values(s)}},Ut=function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,s=e.deviceIdFn,o=e.mirror,i=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type===Me.Click){var l=m();if(l){var c=l.location,u=l.innerHeight,h=l.innerWidth;if(c){var d=e.x,p=e.y;if(void 0!==d&&void 0!==p){var f,g=o.getNode(e.id);if(g)try{f=kt(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var y=Se(c.href,i),v={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:u,viewportWidth:h,pageUrl:y,timestamp:Date.now(),type:"click"},w=s();w&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(v)},deviceId:w})}}}}}},this.logger=e,this.scrollWatcher=t};function jt(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Bt(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var zt=function(){function e(e,t){var r=m();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=de(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}(),Wt=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,i,a=e(),l=m();if(l&&a){var c=null!==(n=l.scrollX)&&void 0!==n?n:0,u=null!==(s=l.scrollY)&&void 0!==s?s:0;(c>0||u>0)&&r.update({id:1,x:c,y:u}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:jt(),viewportWidth:Bt(),pageUrl:Se(l.location.href,null!==(i=null===(o=r.config.interactionConfig)||void 0===o?void 0:o.ugcFilterRules)&&void 0!==i?i:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Bt(),this._maxScrollHeight=jt(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new zt(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}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=Bt();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=jt();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),$t=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))},qt=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,Ze(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return i(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId;return i(e,void 0,void 0,function(){var e,t,o,i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return i=a.sent(),ft(r,"Failed to get targeting match for session id ".concat(s,": ").concat(i),i),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId,o=t.targetingMatch;return i(e,void 0,void 0,function(){var e,t,i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return i=a.sent(),ft(r,"Failed to store targeting match for session id ".concat(s,": ").concat(i),i),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return i(e,void 0,void 0,function(){var e,t,o,i,l,c,u,h;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:i=a.sent(),l=0,a.label=3;case 3:return l<i.length?(c=i[l],u=Date.now()-c.lastUpdated,c.sessionId!==t&&u>1728e5?[4,o.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:return l++,[3,3];case 6:return[4,o.done];case 7:return a.sent(),[3,9];case 8:return h=a.sent(),ft(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},Vt=new qt,Gt=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,l=e.targetingParams,c=e.urlChange,u=void 0!==c&&c;return i(void 0,void 0,void 0,function(){var e,i,c,h,d,p;return a(this,function(a){switch(a.label){case 0:return[4,Vt.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,Vt.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===a.sent()&&!u)return[2,!0];e=!0,a.label=3;case 3:return a.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return cn})];case 4:return i=a.sent().evaluateTargeting,c=o(o({},l),{flag:r,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:s,loggerProvider:n}),[4,i(c)];case 5:return(h=a.sent())&&h.sr_targeting_config&&(e="on"===h.sr_targeting_config.key),Vt.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return d=a.sent(),p=d,n.warn(p.message),[3,7];case 7:return[2,e]}})})},Ht=2654435761,Jt=2246822519,Kt=3266489917,Yt=374761393;function Xt(e,t){return(e<<t|e>>>32-t)>>>0}function Zt(e,t){return e=Xt(e=e+Math.imul(t,Jt)>>>0,13),e=Math.imul(e,Ht)>>>0}function Qt(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function er(e,t){void 0===t&&(t=0);var r,n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){var s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(n=s-56320+(n-55296<<10)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),s=n.length,o=0;if(s>=16){for(var i=t+Ht+Jt>>>0,a=t+Jt>>>0,l=t>>>0,c=t-Ht>>>0;o<=s-16;)i=Zt(i,Qt(n,o)),a=Zt(a,Qt(n,o+=4)),l=Zt(l,Qt(n,o+=4)),c=Zt(c,Qt(n,o+=4)),o+=4;r=Xt(i,1)+Xt(a,7)+Xt(l,12)+Xt(c,18)>>>0}else r=t+Yt>>>0;for(r=r+s>>>0;o<=s-4;)r=r+Math.imul(Qt(n,o),Kt)>>>0,r=Math.imul(Xt(r,17),668265263)>>>0,o+=4;for(;o<s;)r=r+Math.imul(n[o],Yt)>>>0,r=Math.imul(Xt(r,11),Ht)>>>0,o++;return r^=r>>>15,r=Math.imul(r,Jt)>>>0,r^=r>>>13,r=Math.imul(r,Kt)>>>0,(r^=r>>>16)>>>0}var tr="__amplitude_url_tracking_patched__",rr=new WeakMap;function nr(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,s=void 0!==n&&n,o=r.pollingInterval,i=void 0===o?se:o;if(s){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),c=e.setInterval(function(){var e=a();e!==l&&(l=e,t(e))},i);return function(){null!=c&&e.clearInterval(c)}}var u=rr.get(e);if(!u){var h=void 0,d=new Set,p=function(){var t=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&t===h||(h=t,d.forEach(function(e){return e(t)}))},f=function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return p(),n};return t[tr]=!0,t},m=e.history;if(null==m?void 0:m.pushState){var g=Reflect.get(m,"pushState");g[tr]||(m.pushState=f(g))}if(null==m?void 0:m.replaceState){var y=Reflect.get(m,"replaceState");y[tr]||(m.replaceState=f(y))}u={callbacks:d,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},rr.set(e,u)}var v=u;return v.listenersAttached||(e.addEventListener("popstate",v.onPopStateOrHashChange),e.addEventListener("hashchange",v.onPopStateOrHashChange),v.listenersAttached=!0),v.callbacks.add(t),function(){v.callbacks.delete(t),0===v.callbacks.size&&v.listenersAttached&&(e.removeEventListener("popstate",v.onPopStateOrHashChange),e.removeEventListener("hashchange",v.onPopStateOrHashChange),v.listenersAttached=!1)}}function sr(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var s,i,a,l=o(o({},e),n),c=l.ugcFilterRules||[],u=null!==(s=l.enablePolling)&&void 0!==s&&s,h=null!==(i=l.pollingInterval)&&void 0!==i?i:se,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f=function(){return r.location&&r.location.href||""},m=function(){var e=f();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=f(),o="";return d&&(o=(null==n?void 0:n.title)||""),{href:c.length>0?Se(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=nr(r,function(){return m()},u?{enablePolling:!0,pollingInterval:h}:{});return m(),function(){return g()}},options:e}}sr();var or,ir,ar,lr=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.recordEventsInFlight=!1,this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var r=m();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(){if(e.recordCancelCallback&&e.recordFunction)try{e.recordFunction.takeFullSnapshot(!0)}catch(t){e.loggerProvider.warn("Failed to take full snapshot on focus:",t)}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,o){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),i(e,void 0,void 0,function(){var e,i,l,c,u,h,d,p,f,g,y,v;return a(this,function(a){switch(a.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,e=this.config.targetingConfig,e&&!this.sessionTargetingMatch?(i=o?this.latestUrlChangeTargetingEvaluationId:void 0,(l=t.event)&&Object.values(s).includes(l.event_type)&&(l=void 0),c=null!==(y=null!==(p=null===(d=t.page)||void 0===d?void 0:d.url)&&void 0!==p?p:null===(g=null===(f=m())||void 0===f?void 0:f.location)||void 0===g?void 0:g.href)&&void 0!==y?y:"",u=null!==(v=t.page)&&void 0!==v?v:""!==c?{url:c}:void 0,[4,Gt({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:l,page:u},urlChange:o})]):[3,2];case 1:if(h=a.sent(),o&&void 0!==i&&i!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(i,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||h,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:l,targetingParams:t},null,2)),a.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return!n&&this.recordCancelCallback?[3,5]:(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]);case 4:a.sent(),a.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),i(e,void 0,void 0,function(){var e,s,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==Q.METADATA?(e={config:ke(s),version:Fe},n?[4,Ce()]:[3,2]):[3,2];case 1:i=a.sent(),e=o(o({},i),e),a.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,o(o({},r),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=a.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 ue(new b)}return e.prototype.init=function(e,t){return v(this._init(e,t))},e.prototype.setupUrlChangeListener=function(){var e,t,r=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var n=m();if(null==n?void 0:n.location){var s=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),o=nr(n,function(e){if(r.currentPageUrl=e,s){var t=++r.latestUrlChangeTargetingEvaluationId;r.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),r.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(t," for ").concat(e,"."))}});this.urlChangeCleanup=function(){o(),r.urlChangeCleanup=null}}},e.prototype.getCurrentPageForTargeting=function(){var e,t,r=null===(t=null===(e=m())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0},e.prototype._init=function(e,t){var r,n,s,l,h,d,p,f,g,y,v;return i(this,void 0,void 0,function(){var i,w,S,C,k,x,O,E,I,M,R,P,A,T,N,L,_,D,F,U,j,B=this;return a(this,function(a){switch(a.label){case 0:return null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.loggerProvider=new ue(t.loggerProvider||new b),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=ve(),this.identifiers=new $t({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,Pe(e,t)];case 1:return i.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return w=a.sent(),S=w.joinedConfig,C=w.localConfig,k=w.remoteConfig,this.config=S,this.setMetadata(t.sessionId,S,C,k,null===(n=t.version)||void 0===n?void 0:n.version,Fe,null===(s=t.version)||void 0===s?void 0:s.type),this.pageLeaveFns=[],t.sessionId&&(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled)&&(x=Wt.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[x.send(this.getDeviceId.bind(this)).bind(x)],this.scrollHook=x.hook.bind(x),this.clickHandler=new Ut(this.loggerProvider,x)),O=[],"idb"!==(E=this.config.storeType)||(null===(h=m())||void 0===h?void 0:h.indexedDB)||(E="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(E," for event storage.")),R=m(),this.config.useWebWorker&&R&&R.Worker?[4,Promise.resolve().then(function(){return un})]:[3,4];case 3:P=a.sent(),A=P.compressionScript,T=P.trackDestinationScript,I=A,M=T,a.label=4;case 4:return a.trys.push([4,6,,7]),[4,St({config:this.config,type:"replay",storeType:E,trackDestinationWorkerScript:M})];case 5:return N=a.sent(),O.push({name:"replay",manager:N}),[3,7];case 6:return L=a.sent(),U=L,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(U.toString())),[3,7];case 7:if(!(null===(d=this.config.interactionConfig)||void 0===d?void 0:d.enabled))return[3,11];_=this.config.interactionConfig.batch?Ft:Dt,a.label=8;case 8:return a.trys.push([8,10,,11]),[4,St({config:this.config,type:"interaction",minInterval:null!==(p=this.config.interactionConfig.trackEveryNms)&&void 0!==p?p:3e4,maxInterval:6e4,payloadBatcher:_,storeType:E,trackDestinationWorkerScript:M})];case 9:return D=a.sent(),O.push({name:"interaction",manager:D}),[3,11];case 10:return F=a.sent(),U=F,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(U.toString())),[3,11];case 11:return this.eventsManager=new(Ct.bind.apply(Ct,u([void 0],c(O),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new Le(this.eventsManager,this.config,this.getDeviceId(),I,function(){return B.sendEvents()}),this.pageLeaveFns=u(u([],c(this.pageLeaveFns),!1),[function(){var e;if(B.config&&(null===(e=B.identifiers)||void 0===e?void 0:e.sessionId)&&N){var t=N.getBeaconEvents();if(t.length){var r=B.getDeviceId();r&&N.trackDestination.sendBeacon({events:t,sessionId:B.identifiers.sessionId,deviceId:r,apiKey:B.config.apiKey,serverZone:B.config.serverZone})}}}],!1),[4,this.initializeNetworkObservers()];case 12:return a.sent(),(null===(f=m())||void 0===f?void 0:f.opener)&&(function(e,t){var r,n=e;if(!0!==n[Z]){n[Z]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",o=null,i=function(t,r){var n,s;"background-capture-complete"===t&&(null===(s=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===s||s.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var n=new URL(s,e.endpoint).toString();e.loadScriptOnce(n).then(function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),o=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:i}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}(j=X()),j.setup(o({logger:this.loggerProvider},this.config.serverZone&&{endpoint:H[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return a.sent(),(this.config.targetingConfig||(null!==(v=null===(y=null===(g=this.config.privacyConfig)||void 0===g?void 0:g.urlMaskLevels)||void 0===y?void 0:y.length)&&void 0!==v?v:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return v(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return i(this,void 0,void 0,function(){var s,o,i;return a(this,function(a){switch(a.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),o=t||this.getDeviceId(),this.identifiers=new $t({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:i=a.sent().joinedConfig,this.config=i,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[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={})[te]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[oe]=JSON.stringify({appHash:F(t.apiKey).toString()}))),this.addCustomRRWebEvent(Q.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),i(this,void 0,void 0,function(){var r;return a(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=d),D.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=!1,n="",s=!1;this.config.targetingConfig?this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),r=!0,s=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,s=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,er(e.toString())%1e6/1e6<t)?(r=!0,s=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,s=!1);return this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Q.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:s,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},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=null===(e=this.config)||void 0===e?void 0:e.privacyConfig;if("conservative"===(r?fe(this.currentPageUrl,r):void 0))return"*";if(null===(t=null==r?void 0:r.urlMaskLevels)||void 0===t?void 0:t.some(function(e){return"conservative"===e.maskLevel}))return"*";var n=null==r?void 0:r.urlMaskLevels;if("conservative"===(null==r?void 0:r.defaultMaskLevel)&&n&&n.length>0)return"*";var s=null==r?void 0:r.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,o,l;return i(this,void 0,void 0,function(){var i,c,u,h;return a(this,function(a){switch(a.label){case 0:i=[];try{c=sr({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(o=this.config)||void 0===o?void 0:o.captureDocumentTitle}),i.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(l=null==e?void 0:e.console)||void 0===l?void 0:l.enabled))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Oa})];case 2:return u=a.sent().getRecordConsolePlugin,i.push(u({level:e.console.levels})),[3,4];case 3:return h=a.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,i.length>0?i:void 0]}})})},e.prototype.getRecordFunction=function(){return i(this,void 0,void 0,function(){var e,t;return a(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Cp})];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,r.label=1;case 1:return r.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:r.sent(),r.label=3;case 3:return null===this.recordEventsPendingShouldLogMetadata?[3,5]:(t=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(t)]);case 4:return r.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},e.prototype._recordEvents=function(e){var t,r,n,s,o,l,c,u;return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var i,h,d,p,f,m,g,y,v,w,b,S,C,k,x,O,E=this;return a(this,function(a){switch(a.label){case 0:return i=this.config,h=this.getShouldRecord(),d=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,h&&d&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(p=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),f=null===(r=i.loggingConfig)||void 0===r?void 0:r.network,m=de(i.serverZone,i.trackServerUrl),g=[ae,le,ce,m],null===(n=this.networkObservers)||void 0===n||n.start(function(e){g.some(function(t){return e.url.startsWith(t)})||E.addCustomRRWebEvent(Q.FETCH_REQUEST,e)},f),y=i.privacyConfig,v=i.interactionConfig,w=i.loggingConfig,b=(null==v?void 0:v.enabled)?{mouseInteraction:this.eventsManager&&(null===(s=this.clickHandler)||void 0===s?void 0:s.createHook({eventsManager:this.eventsManager,sessionId:d,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(o=v.ugcFilterRules)&&void 0!==o?o:[],performanceOptions:null===(l=i.performanceConfig)||void 0===l?void 0:l.interaction})),scroll:this.scrollHook}:{},S=(null==v?void 0:v.enabled)&&v.ugcFilterRules?v.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(d,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),C=this,k=p,O={emit:function(e){if(E.shouldOptOut())return E.loggerProvider.log("Opting session ".concat(d," out of recording due to optOut config.")),E.stopRecordingEvents(),void E.sendEvents();e.type===Ee.Meta&&(e.data.href=Se(e.data.href,S)),E.eventCompressor&&E.eventCompressor.enqueueEvent(e,d)},inlineStylesheet:i.shouldInlineStylesheet,hooks:b,maskAllInputs:!0,maskTextClass:ie,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:ge("input",y,function(){return E.currentPageUrl}),maskTextFn:ge("text",y,function(){return E.currentPageUrl}),maskAttributeFn:ye(y,function(){return E.currentPageUrl}),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,captureAdoptedStyleSheets:i.captureAdoptedStyleSheets,slimDOMOptions:{script:null===(c=i.omitElementTags)||void 0===c?void 0:c.script,comment:null===(u=i.omitElementTags)||void 0===u?void 0:u.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return E.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(w)];case 4:return C.recordCancelCallback=k.apply(void 0,[(O.plugins=a.sent(),O)]),this.addCustomRRWebEvent(Q.DEBUG_INFO),e&&this.addCustomRRWebEvent(Q.METADATA,this.metadata),[3,6];case 5:return x=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",x),[3,6];case 6: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),i(this,void 0,void 0,function(){return a(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),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())?F(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.prototype.initializeNetworkObservers=function(){var e,t,r;return i(this,void 0,void 0,function(){var n,s;return a(this,function(o){switch(o.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Ep})];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return s=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),cr=function(e){return function(){var t=e.config||xe();return{logger:t.loggerProvider,logLevel:t.logLevel}}},ur=function(){var e=new lr;return{init:O(e.init.bind(e),"init",cr(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",cr(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",cr(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",cr(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",cr(e)),flush:O(e.flush.bind(e),"flush",cr(e)),shutdown:O(e.shutdown.bind(e),"shutdown",cr(e))}}(),hr=ur.init,dr=ur.setSessionId,pr=ur.getSessionId,fr=ur.getSessionReplayProperties,mr=ur.flush,gr=ur.shutdown,yr=ur.evaluateTargetingAndCapture;!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(or||(or={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(ir||(ir={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(ar||(ar={}));const vr=[or.SET,or.SET_ONCE,or.ADD,or.APPEND,or.PREPEND,or.POSTINSERT],wr="1.29.0";class br{constructor(e){this.name=br.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:mr,getSessionId:pr,getSessionReplayProperties:fr,init:hr,setSessionId:dr,shutdown:gr,evaluateTargetingAndCapture:yr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,o,a,l,c,u;return i(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${wr}.`),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=Object.assign(Object.assign({},e.defaultTracking),{sessions:!0}));const i=(t=this.config.instanceName,void 0===t&&(t="$default_instance"),D.getInstance(t)).identityStore.getIdentity().userProperties;this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null===(n=this.config.remoteConfig)||void 0===n?void 0:n.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.blockSelector,maskSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.maskSelector,unmaskSelector:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.unmaskSelector,defaultMaskLevel:null===(l=this.options.privacyConfig)||void 0===l?void 0:l.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:wr},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(c=this.options.useWebWorker)&&void 0!==c?c:null===(u=this.options.experimental)||void 0===u?void 0:u.useWebWorker,userProperties:i,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets},yield this.sessionReplay.init(e.apiKey,this.srInitOptions).promise}catch(t){null==e||e.loggerProvider.error(`Session Replay: Failed to initialize due to ${t.message}`)}var t})}onSessionIdChanged(e){var t;return i(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`Analytics session id is changed to ${e}, SR session id is ${String(this.sessionReplay.getSessionId())}.`),yield this.sessionReplay.setSessionId(e).promise})}onOptOutChanged(e){var t;return i(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():null!=this.config&&(yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise)})}execute(e){var t,r,n;return i(this,void 0,void 0,function*(){try{if(this.options.customSessionId){const t=this.options.customSessionId(e);if(t){t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise);const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}else{const n=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(n&&n!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(n).promise),n&&n===e.session_id){let t;e.event_type===s.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(vr.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e));const n=m();yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t,page:null!=(null===(r=null==n?void 0:n.location)||void 0===r?void 0:r.href)?{url:n.location.href}:void 0});const o=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),o)}}return e.event_type===s.IDENTIFY&&e.event_properties&&delete e.event_properties["[Amplitude] Session Replay ID"],Promise.resolve(e)}catch(t){return null===(n=this.config)||void 0===n||n.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){var e;return i(this,void 0,void 0,function*(){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error(`Session Replay: teardown failed due to ${t.message}`)}})}getSessionReplayProperties(){return this.sessionReplay.getSessionReplayProperties()}}br.pluginName="@amplitude/plugin-session-replay-browser";const Sr=e=>new br(e);var Cr=function(e,t){return Cr=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])},Cr(e,t)};var kr=function(){return kr=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},kr.apply(this,arguments)};function xr(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"==typeof SuppressedError&&SuppressedError;var Or="is",Er="is not",Ir="contains",Mr="does not contain",Rr="less",Pr="less or equal",Ar="greater",Tr="greater or equal",Nr="version less",Lr="version less or equal",_r="version greater",Dr="version greater or equal",Fr="set is",Ur="set is not",jr="set contains",Br="set does not contain",zr="set contains any",Wr="set does not contain any",$r="regex match",qr="regex does not match",Vr=-862048943,Gr=461845907,Hr=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,o=t,i=0;i<s;i++){var a=Xr(r,i<<2);o=Jr(a,o)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Vr),c=Yr(c,15),o^=c=Math.imul(c,Gr);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Vr),c=Yr(c,15),o^=c=Math.imul(c,Gr);break;case 1:c^=r[l],c=Math.imul(c,Vr),c=Yr(c,15),o^=c=Math.imul(c,Gr)}return Kr(o^=n)>>>0},Jr=function(e,t){var r=e,n=t;return r=Math.imul(r,Vr),r=Yr(r,15),r=Math.imul(r,Gr),n=Yr(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Kr=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},Yr=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Xr=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Zr(r)},Zr=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Qr=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(!i||!e||"object"!=typeof e)return;e=e[i]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e||void 0}},en="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),tn=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(en).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),rn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=xr(t),a=i.next();!a.done;a=i.next()){var l=a.value,c=this.evaluateFlag(o,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var o=xr(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=kr(kr(kr({},t.metadata),a.metadata),s.metadata);s=kr(kr({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,o,i;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=xr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(o=void 0,xr(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Qr(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return Hr(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(Qr(e,t.bucket.selector));if(!i||0===i.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(i),l=this.getHash(a),c=l%100,u=Math.floor(l/100);try{for(var h=xr(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],m=p.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,xr(p.distributions)),y=g.next();!y.done;y=g.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case Or:case Ir:case Rr:case Pr:case Ar:case Tr:case Nr:case Lr:case _r:case Dr:case Fr:case jr:case zr:return r;case Er:case Mr:case Br:case Wr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Fr:return this.setEquals(e,r);case Ur:return!this.setEquals(e,r);case jr:return this.matchesSetContainsAll(e,r);case Br:return!this.matchesSetContainsAll(e,r);case zr:return this.matchesSetContainsAny(e,r);case Wr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Or:return this.matchesIs(e,r);case Er:return!this.matchesIs(e,r);case Ir:return this.matchesContains(e,r);case Mr:return!this.matchesContains(e,r);case Rr:case Pr:case Ar:case Tr:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Nr:case Lr:case _r:case Dr:return this.matchesComparable(e,t,r,function(e){return tn.parse(e)},this.versionComparator);case $r:return this.matchesRegex(e,r);case qr:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(e.toLowerCase().includes(i.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var o=this,i=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===i||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return s(i,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case Rr:case Nr:return e<r;case Pr:case Lr:return e<=r;case Ar:case _r:return e>r;case Tr:case Dr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Rr:case Nr:return n<0;case Pr:case Lr:return n<=0;case Ar:case _r:return n>0;case Tr:case Dr:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case Fr:case Ur:case jr:case Br:case zr:case Wr:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(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(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}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(!this.matchesIs(i,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=xr(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(this.matchesIs(i,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;(e=>{let t={};e.forEach((e,r)=>t[e]=r)})(Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){function t(r,n){var s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Cr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var nn,sn=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,Ze(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return i(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,l=t.loggerProvider,c=t.tx;return i(e,void 0,void 0,function(){var e,t,i,u,h,d,p,f,m;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),i=t?t.eventTypes:{},u=i[n]||{},h=o(o({},i),((f={})[n]=o(o({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return a.sent(),[2,h];case 3:return p=a.sent(),l.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return i(e,void 0,void 0,function(){var e,t,o,i,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),o=0,a.label=2;case 2:return o<t.length?(i=t[o],l=Date.now()-i.lastUpdated,i.sessionId!==e&&l>1728e5?[4,s.store.delete(i.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return c=a.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,o=t.eventTime,l=t.apiKey;return i(e,void 0,void 0,function(){var e,t,i,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:o})]:[2];case 2:return i=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,i];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},on=new sn,an=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,l=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return i(e,void 0,void 0,function(){var e,t,i,p;return a(this,function(a){switch(a.label){case 0:return s&&s.time?[4,on.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:l,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return i=(e=t)&&new Set(Object.keys(e)),p={session_id:l,event:s,event_types:i&&Array.from(i),user:o(o({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new rn},ln=function(){var e=new an;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,cn=Object.freeze({__proto__:null,evaluateTargeting:ln}),un=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n',trackDestinationScript:'var WebWorker=function(e){"use strict";var t,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 a(e){try{i(n.next(e))}catch(e){o(e)}}function c(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,c)}i((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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(i){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&c[0]?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:case 1:s=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!s||c[1]>s[0]&&c[1]<s[3])){o.label=c[1];break}if(6===c[0]&&o.label<s[1]){o.label=s[1],s=c;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(c);break}s[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=s=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o;!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(o||(o={}));function a(e,t){return n(this,void 0,void 0,function(){var r,o,a,c,i,u,l,d,f,p,h,v,y,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,o=new r("gzip"),a=o.writable.getWriter(),c=o.readable.getReader(),i=[],u=n(g,void 0,void 0,function(){var e,t,r;return s(this,function(n){switch(n.label){case 0:return[4,c.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];i.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,u];case 3:m.sent(),l=i.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),f=0;try{for(p=function(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.")}(i),h=p.next();!h.done;h=p.next())v=h.value,d.set(v,f),f+=v.length}catch(e){y={error:e}}finally{try{h&&!h.done&&(b=p.return)&&b.call(p)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function c(e,t){var o,c,i,u;return n(this,void 0,void 0,function(){var n,l,d,f,p,h,v,y,b;return s(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),"CompressionStream"in self?[4,a(e,self)]:[3,2];case 1:return l=s.sent(),[3,3];case 2:l=null,s.label=3;case 3:return n=l,d="".concat(null!==(c=null===(o=t.version)||void 0===o?void 0:o.type)&&void 0!==c?c:"standalone","/").concat(null!==(u=null===(i=t.version)||void 0===i?void 0:i.version)&&void 0!==u?u:t.sdkVersion),f=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),p="".concat((g=t.serverZone,m=t.trackServerUrl,m||("STAGING"===g?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===g?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(f.toString()),h=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":d,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},n?{"Content-Encoding":"gzip"}:{}),[4,fetch(p,{method:"POST",headers:h,body:null!=n?n:e})];case 4:return null===(v=s.sent())?[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}]:v.status>=200&&v.status<300?(y=Math.round(new Blob(t.events).size/1024),[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(y," KB")}]):v.status>=500||408===v.status||429===v.status||499===v.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(v.status)}]:[2,{shouldRetry:!1,success:!1,message:"Network error occurred, event batch rejected"}];case 5:return b=s.sent(),[2,{shouldRetry:!1,success:!1,message:String(b)}];case 6:return[2]}var g,m})})}function i(e,t,r,o){return n(this,void 0,void 0,function(){var n,a,i;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,c(t,r)];case 2:return(a=s.sent()).success?(postMessage({type:"log",id:e,message:a.message}),postMessage({type:"complete",id:e}),[2]):o&&a.shouldRetry&&n<r.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*n*1e3)})]:[3,4];case 3:return s.sent(),n++,[3,5];case 4:return i=n>=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":a.message,postMessage({type:"warn",id:e,message:i}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,o,a,c,u;return s(this,function(s){switch(s.label){case 0:return t=e.data,r=t.type,n=t.id,o=t.payload,a=t.context,c=t.useRetry,"send"!==r?[3,2]:(u=JSON.stringify(o),[4,i(n,u,a,c)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var u=onmessage;return e.trackDestinationOnMessage=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),hn=Object.defineProperty,dn=(e,t,r)=>((e,t,r)=>t in e?hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),pn=Object.defineProperty,fn=(e,t,r)=>((e,t,r)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),mn=Object.defineProperty,gn=(e,t,r)=>((e,t,r)=>t in e?mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const yn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},vn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wn={};function bn(e){if(wn[e])return wn[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in yn?yn[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 vn?vn[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)return wn[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?wn[e]=o:r}catch{return r}}const Sn={};function Cn(e,t,r){var n;const s=`${e}.${String(r)}`;if(Sn[s])return Sn[s].call(t);const o=bn(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Sn[s]=i,i.call(t)):t[r]}const kn={};function xn(e,t,r){const n=`${e}.${String(r)}`;if(kn[n])return kn[n].bind(t);const s=bn(e)[r];return"function"!=typeof s?t[r]:(kn[n]=s,s.bind(t))}const On={childNodes:function(e){return Cn("Node",e,"childNodes")},parentNode:function(e){return Cn("Node",e,"parentNode")},parentElement:function(e){return Cn("Node",e,"parentElement")},textContent:function(e){return Cn("Node",e,"textContent")},contains:function(e,t){return xn("Node",e,"contains")(t)},getRootNode:function(e){return xn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Cn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Cn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Cn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Cn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return bn("MutationObserver").constructor}};class En{constructor(){gn(this,"idNodeMap",new Map),gn(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 In(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&In(On.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&In(On.parentNode(e),t,r)}function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Rn(e){if(Object.prototype.hasOwnProperty.call(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 Pn,An={exports:{}};function Tn(){if(Pn)return An.exports;Pn=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return An.exports=t(),An.exports.createColors=t,An.exports}const Nn=Rn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ln,_n;function Dn(){if(_n)return Ln;_n=1;let e=Tn(),t=Nn;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Ln=r,r.default=r,Ln}var Fn,Un,jn,Bn,zn,Wn,$n,qn,Vn,Gn,Hn,Jn,Kn,Yn,Xn,Zn,Qn,es,ts,rs,ns,ss,os,is,as,ls,cs,us,hs,ds,ps,fs,ms,gs,ys,vs,ws,bs,Ss,Cs,ks,xs,Os,Es,Is,Ms,Rs,Ps,As,Ts,Ns,Ls,_s,Ds={};function Fs(){return Fn||(Fn=1,Ds.isClean=Symbol("isClean"),Ds.my=Symbol("my")),Ds}function Us(){if(jn)return Un;jn=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return Un=t,t.default=t,Un}function js(){if(zn)return Bn;zn=1;let e=Us();function t(t,r){new e(r).stringify(t)}return Bn=t,t.default=t,Bn}function Bs(){if($n)return Wn;$n=1;let{isClean:e,my:t}=Fs(),r=Dn(),n=Us(),s=js();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return Wn=i,i.default=i,Wn}function zs(){if(Vn)return qn;Vn=1;let e=Bs();class t extends e{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]}}return qn=t,t.default=t,qn}function Ws(){if(Hn)return Gn;Hn=1;return Gn={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}},Gn}function $s(){if(Kn)return Jn;Kn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Nn,{existsSync:r,readFileSync:n}=Nn,{dirname:s,join:o}=Nn;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Jn=i,i.default=i,Jn}function qs(){if(Xn)return Yn;Xn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Nn,{fileURLToPath:r,pathToFileURL:n}=Nn,{isAbsolute:s,resolve:o}=Nn,{nanoid:i}=Ws(),a=Nn,l=Dn(),c=$s(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Yn=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Yn}function Vs(){if(Qn)return Zn;Qn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Nn,{dirname:r,relative:n,resolve:s,sep:o}=Nn,{pathToFileURL:i}=Nn,a=qs(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Zn=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Gs(){if(ts)return es;ts=1;let e=Bs();class t extends e{constructor(e){super(e),this.type="comment"}}return es=t,t.default=t,es}function Hs(){if(ns)return rs;ns=1;let e,t,r,n,{isClean:s,my:o}=Fs(),i=zs(),a=Gs(),l=Bs();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},rs=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},rs}function Js(){if(os)return ss;os=1;let e,t,r=Hs();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ss=n,n.default=n,ss}function Ks(){if(as)return is;as=1;let e={};return is=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ys(){if(cs)return ls;cs=1;class e{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}}return ls=e,e.default=e,ls}function Xs(){if(hs)return us;hs=1;let e=Ys();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return us=t,t.default=t,us}function Zs(){if(ms)return fs;ms=1;let e=Hs();class t extends e{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)}}return fs=t,t.default=t,e.registerAtRule(t),fs}function Qs(){if(ys)return gs;ys=1;let e,t,r=Hs();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},gs=n,n.default=n,r.registerRoot(n),gs}function eo(){if(ws)return vs;ws=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return vs=e,e.default=e,vs}function to(){if(Ss)return bs;Ss=1;let e=Hs(),t=eo();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return bs=r,r.default=r,e.registerRule(r),bs}function ro(){if(ks)return Cs;ks=1;let e=zs(),t=function(){if(ps)return ds;ps=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return ds=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=Gs(),n=Zs(),s=Qs(),o=to();const i={empty:!0,space:!0};return Cs=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},Cs}function no(){if(Os)return xs;Os=1;let e=Hs(),t=ro(),r=qs();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return xs=n,n.default=n,e.registerParse(n),xs}function so(){if(Is)return Es;Is=1;let{isClean:e,my:t}=Fs(),r=Vs(),n=js(),s=Hs(),o=Js(),i=Ks(),a=Xs(),l=no(),c=Qs();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},Es=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Es}function oo(){if(As)return Ps;As=1;let e=function(){if(Rs)return Ms;Rs=1;let e=Vs(),t=js(),r=Ks(),n=no();const s=Xs();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return Ms=o,o.default=o,Ms}(),t=so(),r=Js(),n=Qs();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ps=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Ps}const io=Mn(function(){if(_s)return Ls;_s=1;let e=Dn(),t=zs(),r=so(),n=Hs(),s=oo(),o=js(),i=function(){if(Ns)return Ts;Ns=1;let e=zs(),t=$s(),r=Gs(),n=Zs(),s=qs(),o=Qs(),i=to();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Ts=a,a.default=a,Ts}(),a=Js(),l=Ys(),c=Gs(),u=Zs(),h=Xs(),d=qs(),p=no(),f=eo(),m=to(),g=Qs(),y=Bs();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Ls=v,v.default=v,Ls}());io.stringify,io.fromJSON,io.plugin,io.parse,io.list,io.document,io.comment,io.atRule,io.rule,io.decl,io.root,io.CssSyntaxError,io.Declaration,io.Container,io.Processor,io.Document,io.Comment,io.Warning,io.AtRule,io.Result,io.Input,io.Rule,io.Root,io.Node;var ao=Object.defineProperty,lo=(e,t,r)=>((e,t,r)=>t in e?ao(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function co(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function uo(e){if(Object.prototype.hasOwnProperty.call(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 ho,po={exports:{}};function fo(){if(ho)return po.exports;ho=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return po.exports=t(),po.exports.createColors=t,po.exports}const mo=uo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var go,yo;function vo(){if(yo)return go;yo=1;let e=fo(),t=mo;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return go=r,r.default=r,go}var wo,bo,So,Co,ko,xo,Oo,Eo,Io,Mo,Ro,Po,Ao,To,No,Lo,_o,Do,Fo,Uo,jo,Bo,zo,Wo,$o,qo,Vo,Go,Ho,Jo,Ko,Yo,Xo,Zo,Qo,ei,ti,ri,ni,si,oi,ii,ai,li,ci,ui,hi,di,pi,fi,mi,gi,yi,vi={};function wi(){return wo||(wo=1,vi.isClean=Symbol("isClean"),vi.my=Symbol("my")),vi}function bi(){if(So)return bo;So=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return bo=t,t.default=t,bo}function Si(){if(ko)return Co;ko=1;let e=bi();function t(t,r){new e(r).stringify(t)}return Co=t,t.default=t,Co}function Ci(){if(Oo)return xo;Oo=1;let{isClean:e,my:t}=wi(),r=vo(),n=bi(),s=Si();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return xo=i,i.default=i,xo}function ki(){if(Io)return Eo;Io=1;let e=Ci();class t extends e{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]}}return Eo=t,t.default=t,Eo}function xi(){if(Ro)return Mo;Ro=1;return Mo={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}},Mo}function Oi(){if(Ao)return Po;Ao=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mo,{existsSync:r,readFileSync:n}=mo,{dirname:s,join:o}=mo;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Po=i,i.default=i,Po}function Ei(){if(No)return To;No=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mo,{fileURLToPath:r,pathToFileURL:n}=mo,{isAbsolute:s,resolve:o}=mo,{nanoid:i}=xi(),a=mo,l=vo(),c=Oi(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return To=p,p.default=p,a&&a.registerInput&&a.registerInput(p),To}function Ii(){if(_o)return Lo;_o=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mo,{dirname:r,relative:n,resolve:s,sep:o}=mo,{pathToFileURL:i}=mo,a=Ei(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Lo=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Mi(){if(Fo)return Do;Fo=1;let e=Ci();class t extends e{constructor(e){super(e),this.type="comment"}}return Do=t,t.default=t,Do}function Ri(){if(jo)return Uo;jo=1;let e,t,r,n,{isClean:s,my:o}=wi(),i=ki(),a=Mi(),l=Ci();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Uo=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Uo}function Pi(){if(zo)return Bo;zo=1;let e,t,r=Ri();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Bo=n,n.default=n,Bo}function Ai(){if($o)return Wo;$o=1;let e={};return Wo=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ti(){if(Vo)return qo;Vo=1;class e{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}}return qo=e,e.default=e,qo}function Ni(){if(Ho)return Go;Ho=1;let e=Ti();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Go=t,t.default=t,Go}function Li(){if(Xo)return Yo;Xo=1;let e=Ri();class t extends e{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)}}return Yo=t,t.default=t,e.registerAtRule(t),Yo}function _i(){if(Qo)return Zo;Qo=1;let e,t,r=Ri();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Zo=n,n.default=n,r.registerRoot(n),Zo}function Di(){if(ti)return ei;ti=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return ei=e,e.default=e,ei}function Fi(){if(ni)return ri;ni=1;let e=Ri(),t=Di();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return ri=r,r.default=r,e.registerRule(r),ri}function Ui(){if(oi)return si;oi=1;let e=ki(),t=function(){if(Ko)return Jo;Ko=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Jo=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=Mi(),n=Li(),s=_i(),o=Fi();const i={empty:!0,space:!0};return si=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},si}function ji(){if(ai)return ii;ai=1;let e=Ri(),t=Ui(),r=Ei();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return ii=n,n.default=n,e.registerParse(n),ii}function Bi(){if(ci)return li;ci=1;let{isClean:e,my:t}=wi(),r=Ii(),n=Si(),s=Ri(),o=Pi(),i=Ai(),a=Ni(),l=ji(),c=_i();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},li=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),li}function zi(){if(pi)return di;pi=1;let e=function(){if(hi)return ui;hi=1;let e=Ii(),t=Si(),r=Ai(),n=ji();const s=Ni();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return ui=o,o.default=o,ui}(),t=Bi(),r=Pi(),n=_i();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return di=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),di}const Wi=co(function(){if(yi)return gi;yi=1;let e=vo(),t=ki(),r=Bi(),n=Ri(),s=zi(),o=Si(),i=function(){if(mi)return fi;mi=1;let e=ki(),t=Oi(),r=Mi(),n=Li(),s=Ei(),o=_i(),i=Fi();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return fi=a,a.default=a,fi}(),a=Pi(),l=Ti(),c=Mi(),u=Li(),h=Ni(),d=Ei(),p=ji(),f=Di(),m=Fi(),g=_i(),y=Ci();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),gi=v,v.default=v,gi}());Wi.stringify,Wi.fromJSON,Wi.plugin,Wi.parse,Wi.list,Wi.document,Wi.comment,Wi.atRule,Wi.rule,Wi.decl,Wi.root,Wi.CssSyntaxError,Wi.Declaration,Wi.Container,Wi.Processor,Wi.Document,Wi.Comment,Wi.Warning,Wi.AtRule,Wi.Result,Wi.Input,Wi.Rule,Wi.Root,Wi.Node;class $i{constructor(...e){lo(this,"parentElement",null),lo(this,"parentNode",null),lo(this,"ownerDocument"),lo(this,"firstChild",null),lo(this,"lastChild",null),lo(this,"previousSibling",null),lo(this,"nextSibling",null),lo(this,"ELEMENT_NODE",1),lo(this,"TEXT_NODE",3),lo(this,"nodeType"),lo(this,"nodeName"),lo(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 $i))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 qi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Vi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Gi={};function Hi(e){if(Gi[e])return Gi[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in qi?qi[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 Vi?Vi[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)return Gi[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?Gi[e]=o:r}catch{return r}}const Ji={};function Ki(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ji[s])return Ji[s].call(t);const o=Hi(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ji[s]=i,i.call(t)):t[r]}const Yi={};function Xi(e,t,r){const n=`${e}.${String(r)}`;if(Yi[n])return Yi[n].bind(t);const s=Hi(e)[r];return"function"!=typeof s?t[r]:(Yi[n]=s,s.bind(t))}const Zi={childNodes:function(e){return Ki("Node",e,"childNodes")},parentNode:function(e){return Ki("Node",e,"parentNode")},parentElement:function(e){return Ki("Node",e,"parentElement")},textContent:function(e){return Ki("Node",e,"textContent")},contains:function(e,t){return Xi("Node",e,"contains")(t)},getRootNode:function(e){return Xi("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ki("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ki("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ki("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ki("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Hi("MutationObserver").constructor}};const Qi="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 ea={map:{},getId:()=>(console.error(Qi),-1),getNode:()=>(console.error(Qi),null),removeNodeFromMap(){console.error(Qi)},has:()=>(console.error(Qi),!1),reset(){console.error(Qi)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ea=new Proxy(ea,{get:(e,t,r)=>("map"===t&&console.error(Qi),Reflect.get(e,t,r))}));let ta=Date.now;function ra(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Zi.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ta=()=>(new Date).getTime());function na(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Zi.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Zi.host(Zi.getRootNode(e))&&(r=Zi.host(Zi.getRootNode(e))),r}function sa(e){let t,r=e;for(;t=na(r);)r=t;return r}function oa(e){const t=e.ownerDocument;if(!t)return!1;const r=sa(e);return Zi.contains(t,r)}const ia=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){fn(this,"id",1),fn(this,"styleIDMap",new WeakMap),fn(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++}},get _mirror(){return ea},closestElementOfNode:ra,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:sa,getShadowHost:na,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(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=Zi.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=Zi.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof $i&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Zi.shadowRoot(e)))},hookSetter:function e(t,r,n,s,o=window){const i=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,r,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(Zi.contains(t,e)||oa(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&On.host(e)||null;return Boolean(t&&"shadowRoot"in t&&On.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Zi.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=ra(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(In(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},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},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:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return ta},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(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()=>{}}},polyfill:function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},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))}continue}if(o in t){const e=t[o];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:oa,throttle:function(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))}},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"}));for(var aa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",la="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ca=0;ca<64;ca++)la[aa.charCodeAt(ca)]=ca;"undefined"!=typeof self&&self.Blob&&new Blob(['(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(nn=e.contentWindow)?void 0:nn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ua,ha;new En,(ha=ua||(ua={}))[ha.NotStarted=0]="NotStarted",ha[ha.Running=1]="Running",ha[ha.Stopped=2]="Stopped";class da{constructor(e){dn(this,"fileName"),dn(this,"functionName"),dn(this,"lineNumber"),dn(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const pa=/(^|@)\S+:\d+/,fa=/^\s*at .*(\S+:\d+|\(native\))/m,ma=/^(eval@)?(\[native code])?$/,ga={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(fa)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(fa)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),s=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new da({functionName:o,fileName:i,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(ma)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new da({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new da({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new da({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new da({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(pa)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new da({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function ya(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,s=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function va(e){return"[object Object]"===Object.prototype.toString.call(e)}function wa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(va(e[n])&&wa(e[n],t-1))return!0;return!1}function ba(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];return JSON.stringify(e,function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(va(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(va(e)&&wa(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=ya(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const Sa={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Ca(e,t,r){const n=r?Object.assign({},Sa,r):Sa,s=n.logger;if(!s)return()=>{};let o;o="string"==typeof s?t[s]:s;let i=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,o=ga.parse(s).map(e=>e.toString()),i=[ba(r,n.stringifyOptions)];e({level:"error",trace:o,payload:i})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[ba(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[ba("Uncaught (in promise)",n.stringifyOptions),ba(t.reason,n.stringifyOptions)]);const o=ga.parse(r).map(e=>e.toString());e({level:"error",trace:o,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(o,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?ia.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=ga.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>ba(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[ba("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const ka="rrweb/console@1";var xa,Oa=Object.freeze({__proto__:null,PLUGIN_NAME:ka,getRecordConsolePlugin:e=>({name:ka,observer:Ca,options:e})}),Ea=Object.defineProperty,Ia=(e,t,r)=>((e,t,r)=>t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ma=Object.defineProperty,Ra=(e,t,r)=>((e,t,r)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Pa=(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))(Pa||{});const Aa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ta={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Na={};function La(e){if(Na[e])return Na[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Aa?Aa[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 Ta?Ta[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)return Na[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?Na[e]=o:r}catch{return r}}const _a={};function Da(e,t,r){var n;const s=`${e}.${String(r)}`;if(_a[s])return _a[s].call(t);const o=La(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(_a[s]=i,i.call(t)):t[r]}const Fa={};function Ua(e,t,r){const n=`${e}.${String(r)}`;if(Fa[n])return Fa[n].bind(t);const s=La(e)[r];return"function"!=typeof s?t[r]:(Fa[n]=s,s.bind(t))}const ja={childNodes:function(e){return Da("Node",e,"childNodes")},parentNode:function(e){return Da("Node",e,"parentNode")},parentElement:function(e){return Da("Node",e,"parentElement")},textContent:function(e){return Da("Node",e,"textContent")},contains:function(e,t){return Ua("Node",e,"contains")(t)},getRootNode:function(e){return Ua("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Da("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Da("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Da("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Da("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return La("MutationObserver").constructor}};function Ba(e){return e.nodeType===e.ELEMENT_NODE}function za(e){const t=e&&"host"in e&&"mode"in e&&ja.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ja.shadowRoot(t)===e)}function Wa(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function $a(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=>qa(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 qa(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=$a(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?tl(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?tl(r,t):r}}class Va{constructor(){Ra(this,"idNodeMap",new Map),Ra(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 Ga({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&Ha(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function Ha(e){return e.toLowerCase()}const Ja="__rrweb_original__";function Ka(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ha(t):null}function Ya(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 Xa=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Za=/^(?:[a-z+]+:)?\/\//i,Qa=/^www\..*/i,el=/^(data:)([^,]*),(.*)/i;function tl(e,t){return(e||"").replace(Xa,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(Za.test(a)||Qa.test(a))return`url(${l}${a}${l})`;if(el.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 rl(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function nl(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=rl(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=rl(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=rl(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=rl(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 sl="lightgrey";let ol=1;const il=new RegExp("[^a-z0-9-_:]");function al(){return ol++}let ll,cl;const ul=/^[^ \t\n\r\u000c]+/,hl=/^[, \t\n\r\u000c]+/;const dl=new WeakMap;function pl(e,t){return t&&""!==t.trim()?ml(e,t):t}function fl(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ml(e,t){let r=dl.get(e);if(r||(r=e.createElement("a"),dl.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function gl(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?pl(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(hl),!(r>=t.length);){let o=n(ul);if(","===o.slice(-1))o=pl(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=pl(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?tl(n,ml(e)):"object"===t&&"data"===r?pl(e,n):n:pl(e,n):n}function yl(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function vl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vl(ja.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&vl(ja.parentNode(e),t,r)}function wl(e,t,r,n){let s;if(Ba(e)){if(s=e,!ja.childNodes(s).length)return!1}else{if(null===ja.parentElement(e))return!1;s=ja.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(vl(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 bl(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g=!1,cssCaptured:y=!1,applyBackgroundColorToBlockedElements:v=!1}=t,w=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:Pa.Document,childNodes:[],compatMode:e.compatMode}:{type:Pa.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pa.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:m=!1}=t,g=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),y=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ha(e.tagName);return il.test(t)?"div":t}(e);let v={};const w=e.attributes.length;for(let t=0;t<w;t++){const n=e.attributes[t];if(!yl(y,n.name,n.value)){const t=gl(r,y,Ha(n.name),n.value);if(l&&null!==t){const r=l(n.name,t,e);null!==r&&(v[n.name]=r)}else v[n.name]=t}}if("link"===y&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=$a(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===y&&e.sheet){let t=$a(e.sheet);t&&(e.childNodes.length>1&&(t=nl(t,e)),v._cssText=t)}if("input"===y||"textarea"===y||"select"===y){const t=e.value,r=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&t?v.value=Ga({element:e,type:Ka(e),tagName:y,value:t,maskInputOptions:i,maskInputFn:a}):r&&(v.checked=r)}"option"===y&&(e.selected&&!i.select?v.selected=!0:delete v.selected);"dialog"===y&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===y&&h)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=Ja in s?s[Ja]: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(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(v.rr_dataURL=t)}if("img"===y&&u){ll||(ll=r.createElement("canvas"),cl=ll.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ll.width=t.naturalWidth,ll.height=t.naturalHeight,cl.drawImage(t,0,0),v.rr_dataURL=ll.toDataURL(c.type,c.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"===y||"video"===y){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}p||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(g){const{width:t,height:r}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${r}px`,...m?{rr_background_color:sl}:{}}}"iframe"!==y||d(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(y)&&(b=!0)}catch(e){}return{type:Pa.Element,tagName:y,attributes:v,childNodes:[],isSVG:fl(e)||void 0,needBlock:g,rootId:f,isCustom:b}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g,rootId:w,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=ja.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=ja.textContent(e),c&&l&&(l=tl(l,ml(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,ja.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Pa.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:w,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Pa.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Pa.Comment,textContent:ja.textContent(e)||"",rootId:w};default:return!1}}function Sl(e){return null==e?"":e.toLowerCase()}function Cl(e,t,r){return Array.from(e).map(e=>{const n=t(e);let s=[];if(!r.has(n)){r.add(n);try{s=Array.from(e.cssRules,(t,r)=>({rule:qa(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function kl(e,t){var r,n;const{doc:s,mirror:o,blockClass:i,blockSelector:a,maskTextClass:l,maskTextSelector:c,skipChild:u=!1,inlineStylesheet:h=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y={},inlineImages:v=!1,recordCanvas:w=!1,onSerialize:b,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:I=!1,cssCaptured:M=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=t._emittedStyleIds??new Set;let{needsMask:A}=t,{preserveWhiteSpace:T=!0}=t;if(!A){A=wl(e,l,c,void 0===A)}const N=bl(e,{doc:s,mirror:o,blockClass:i,blockSelector:a,needsMask:A,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,dataURLOptions:y,inlineImages:v,recordCanvas:w,keepIframeSrcFn:E,newlyAddedElement:I,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!N)return console.warn(e,"not serialized"),null;let L;L=o.hasNode(e)?o.getId(e):function(e,t){if(t.comment&&e.type===Pa.Comment)return!0;if(e.type===Pa.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"===Ya(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Sl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Sl(e.attributes.name)||"icon"===Sl(e.attributes.rel)||"apple-touch-icon"===Sl(e.attributes.rel)||"shortcut icon"===Sl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Sl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Sl(e.attributes.property).match(/^(og|twitter|fb):/)||Sl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Sl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Sl(e.attributes.name)||"googlebot"===Sl(e.attributes.name)||"bingbot"===Sl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Sl(e.attributes.name)||"generator"===Sl(e.attributes.name)||"framework"===Sl(e.attributes.name)||"publisher"===Sl(e.attributes.name)||"progid"===Sl(e.attributes.name)||Sl(e.attributes.property).match(/^article:/)||Sl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Sl(e.attributes.name)||"yandex-verification"===Sl(e.attributes.name)||"csrf-token"===Sl(e.attributes.name)||"p:domain_verify"===Sl(e.attributes.name)||"verify-v1"===Sl(e.attributes.name)||"verification"===Sl(e.attributes.name)||"shopify-checkout-api-token"===Sl(e.attributes.name)))return!0}}return!1}(N,g)||!T&&N.type===Pa.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?-2:al();const _=Object.assign(N,{id:L});if(o.add(e,_),-2===L)return null;b&&b(e);let D=!u;if(_.type===Pa.Element){D=D&&!_.needBlock,delete _.needBlock;const t=ja.shadowRoot(e);t&&Wa(t)&&(_.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(_.adoptedStyleSheets=Cl(t.adoptedStyleSheets,S,P)))}if(_.type===Pa.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(_.adoptedStyleSheets=Cl(t.adoptedStyleSheets,S,P))}if((_.type===Pa.Document||_.type===Pa.Element)&&D){g.headWhitespace&&_.type===Pa.Element&&"head"===_.tagName&&(T=!1);const t={doc:s,mirror:o,blockClass:i,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:E,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(_.type===Pa.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else{_.type===Pa.Element&&void 0!==_.attributes._cssText&&"string"==typeof _.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(ja.childNodes(e))){const e=kl(r,t);e&&_.childNodes.push(e)}}let r=null;if(Ba(e)&&(r=ja.shadowRoot(e)))for(const e of Array.from(ja.childNodes(r))){const n=kl(e,t);n&&(Wa(r)&&(n.isShadow=!0),_.childNodes.push(n))}}const F=ja.parentNode(e);return F&&za(F)&&Wa(F)&&(_.isShadow=!0),_.type===Pa.Element&&"iframe"===_.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&&C){const r=kl(t,{doc:t,mirror:o,blockClass:i,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:E});r&&C(e,r)}},k),_.type===Pa.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===Ya(_.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(x){const t=kl(e,{doc:s,mirror:o,blockClass:i,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:E});t&&x(e,t)}},O),_}function xl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ol(e){if(Object.prototype.hasOwnProperty.call(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 El,Il={exports:{}};function Ml(){if(El)return Il.exports;El=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Il.exports=t(),Il.exports.createColors=t,Il.exports}const Rl=Ol(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Pl,Al;function Tl(){if(Al)return Pl;Al=1;let e=Ml(),t=Rl;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Pl=r,r.default=r,Pl}var Nl,Ll,_l,Dl,Fl,Ul,jl,Bl,zl,Wl,$l,ql,Vl,Gl,Hl,Jl,Kl,Yl,Xl,Zl,Ql,ec,tc,rc,nc,sc,oc,ic,ac,lc,cc,uc,hc,dc,pc,fc,mc,gc,yc,vc,wc,bc,Sc,Cc,kc,xc,Oc,Ec,Ic,Mc,Rc,Pc,Ac,Tc={};function Nc(){return Nl||(Nl=1,Tc.isClean=Symbol("isClean"),Tc.my=Symbol("my")),Tc}function Lc(){if(_l)return Ll;_l=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return Ll=t,t.default=t,Ll}function _c(){if(Fl)return Dl;Fl=1;let e=Lc();function t(t,r){new e(r).stringify(t)}return Dl=t,t.default=t,Dl}function Dc(){if(jl)return Ul;jl=1;let{isClean:e,my:t}=Nc(),r=Tl(),n=Lc(),s=_c();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return Ul=i,i.default=i,Ul}function Fc(){if(zl)return Bl;zl=1;let e=Dc();class t extends e{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]}}return Bl=t,t.default=t,Bl}function Uc(){if($l)return Wl;$l=1;return Wl={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}},Wl}function jc(){if(Vl)return ql;Vl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Rl,{existsSync:r,readFileSync:n}=Rl,{dirname:s,join:o}=Rl;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ql=i,i.default=i,ql}function Bc(){if(Hl)return Gl;Hl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Rl,{fileURLToPath:r,pathToFileURL:n}=Rl,{isAbsolute:s,resolve:o}=Rl,{nanoid:i}=Uc(),a=Rl,l=Tl(),c=jc(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Gl=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Gl}function zc(){if(Kl)return Jl;Kl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Rl,{dirname:r,relative:n,resolve:s,sep:o}=Rl,{pathToFileURL:i}=Rl,a=Bc(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Jl=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Jl}function Wc(){if(Xl)return Yl;Xl=1;let e=Dc();class t extends e{constructor(e){super(e),this.type="comment"}}return Yl=t,t.default=t,Yl}function $c(){if(Ql)return Zl;Ql=1;let e,t,r,n,{isClean:s,my:o}=Nc(),i=Fc(),a=Wc(),l=Dc();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Zl=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Zl}function qc(){if(tc)return ec;tc=1;let e,t,r=$c();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ec=n,n.default=n,ec}function Vc(){if(nc)return rc;nc=1;let e={};return rc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Gc(){if(oc)return sc;oc=1;class e{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}}return sc=e,e.default=e,sc}function Hc(){if(ac)return ic;ac=1;let e=Gc();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return ic=t,t.default=t,ic}function Jc(){if(hc)return uc;hc=1;let e=$c();class t extends e{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)}}return uc=t,t.default=t,e.registerAtRule(t),uc}function Kc(){if(pc)return dc;pc=1;let e,t,r=$c();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},dc=n,n.default=n,r.registerRoot(n),dc}function Yc(){if(mc)return fc;mc=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return fc=e,e.default=e,fc}function Xc(){if(yc)return gc;yc=1;let e=$c(),t=Yc();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return gc=r,r.default=r,e.registerRule(r),gc}function Zc(){if(wc)return vc;wc=1;let e=Fc(),t=function(){if(cc)return lc;cc=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return lc=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=Wc(),n=Jc(),s=Kc(),o=Xc();const i={empty:!0,space:!0};return vc=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},vc}function Qc(){if(Sc)return bc;Sc=1;let e=$c(),t=Zc(),r=Bc();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return bc=n,n.default=n,e.registerParse(n),bc}function eu(){if(kc)return Cc;kc=1;let{isClean:e,my:t}=Nc(),r=zc(),n=_c(),s=$c(),o=qc(),i=Vc(),a=Hc(),l=Qc(),c=Kc();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},Cc=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Cc}function tu(){if(Ic)return Ec;Ic=1;let e=function(){if(Oc)return xc;Oc=1;let e=zc(),t=_c(),r=Vc(),n=Qc();const s=Hc();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return xc=o,o.default=o,xc}(),t=eu(),r=qc(),n=Kc();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ec=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Ec}var ru=function(){if(Ac)return Pc;Ac=1;let e=Tl(),t=Fc(),r=eu(),n=$c(),s=tu(),o=_c(),i=function(){if(Rc)return Mc;Rc=1;let e=Fc(),t=jc(),r=Wc(),n=Jc(),s=Bc(),o=Kc(),i=Xc();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Mc=a,a.default=a,Mc}(),a=qc(),l=Gc(),c=Wc(),u=Jc(),h=Hc(),d=Bc(),p=Qc(),f=Yc(),m=Xc(),g=Kc(),y=Dc();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Pc=v,v.default=v,Pc}();const nu=xl(ru);nu.stringify,nu.fromJSON,nu.plugin,nu.parse,nu.list,nu.document,nu.comment,nu.atRule,nu.rule,nu.decl,nu.root,nu.CssSyntaxError,nu.Declaration,nu.Container,nu.Processor,nu.Document,nu.Comment,nu.Warning,nu.AtRule,nu.Result,nu.Input,nu.Rule,nu.Root,nu.Node;var su=Object.defineProperty,ou=(e,t,r)=>((e,t,r)=>t in e?su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function iu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function au(e){if(Object.prototype.hasOwnProperty.call(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 lu,cu={exports:{}};function uu(){if(lu)return cu.exports;lu=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return cu.exports=t(),cu.exports.createColors=t,cu.exports}const hu=au(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var du,pu;function fu(){if(pu)return du;pu=1;let e=uu(),t=hu;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let s,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),o=e=>r(e)}else s=o=e=>e;return i.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+o(n)+e+"\n "+t+s("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return du=r,r.default=r,du}var mu,gu,yu,vu,wu,bu,Su,Cu,ku,xu,Ou,Eu,Iu,Mu,Ru,Pu,Au,Tu,Nu,Lu,_u,Du,Fu,Uu,ju,Bu,zu,Wu,$u,qu,Vu,Gu,Hu,Ju,Ku,Yu,Xu,Zu,Qu,eh,th,rh,nh,sh,oh,ih,ah,lh,ch,uh,hh,dh,ph,fh={};function mh(){return mu||(mu=1,fh.isClean=Symbol("isClean"),fh.my=Symbol("my")),fh}function gh(){if(yu)return gu;yu=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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)}}return gu=t,t.default=t,gu}function yh(){if(wu)return vu;wu=1;let e=gh();function t(t,r){new e(r).stringify(t)}return vu=t,t.default=t,vu}function vh(){if(Su)return bu;Su=1;let{isClean:e,my:t}=mh(),r=fu(),n=gh(),s=yh();function o(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}class i{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=s){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}}return bu=i,i.default=i,bu}function wh(){if(ku)return Cu;ku=1;let e=vh();class t extends e{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]}}return Cu=t,t.default=t,Cu}function bh(){if(Ou)return xu;Ou=1;return xu={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}},xu}function Sh(){if(Iu)return Eu;Iu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=hu,{existsSync:r,readFileSync:n}=hu,{dirname:s,join:o}=hu;class i{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=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Eu=i,i.default=i,Eu}function Ch(){if(Ru)return Mu;Ru=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=hu,{fileURLToPath:r,pathToFileURL:n}=hu,{isAbsolute:s,resolve:o}=hu,{nanoid:i}=bh(),a=hu,l=fu(),c=Sh(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&s);class p{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&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new c(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 "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let o,i,a;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);i=e.line,a=e.col}else i=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,i,a);return o=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:a,line:i},this.css,this.file,s.plugin),o.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[u])r=this[u];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[u]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,i){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof o&&(a=c.originalPositionFor({column:i,line:o})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Mu=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Mu}function kh(){if(Au)return Pu;Au=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=hu,{dirname:r,relative:n,resolve:s,sep:o}=hu,{pathToFileURL:i}=hu,a=Ch(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Pu=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 t of this.previous()){let n,s=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,this.toUrl(this.path(o)))}}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(),c&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(i.generated.line=n,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=s-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=s-1,this.map.addMapping(i)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(s(o,this.mapOpts.annotation)));let i=n(o,e);return this.memoizedPaths.set(e,i),i}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 a(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(i){let t=i(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Pu}function xh(){if(Nu)return Tu;Nu=1;let e=vh();class t extends e{constructor(e){super(e),this.type="comment"}}return Tu=t,t.default=t,Tu}function Oh(){if(_u)return Lu;_u=1;let e,t,r,n,{isClean:s,my:o}=mh(),i=wh(),a=xh(),l=vh();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new i(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Lu=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Lu}function Eh(){if(Fu)return Du;Fu=1;let e,t,r=Oh();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Du=n,n.default=n,Du}function Ih(){if(ju)return Uu;ju=1;let e={};return Uu=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Mh(){if(zu)return Bu;zu=1;class e{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}}return Bu=e,e.default=e,Bu}function Rh(){if($u)return Wu;$u=1;let e=Mh();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Wu=t,t.default=t,Wu}function Ph(){if(Hu)return Gu;Hu=1;let e=Oh();class t extends e{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)}}return Gu=t,t.default=t,e.registerAtRule(t),Gu}function Ah(){if(Ku)return Ju;Ku=1;let e,t,r=Oh();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Ju=n,n.default=n,r.registerRoot(n),Ju}function Th(){if(Xu)return Yu;Xu=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return Yu=e,e.default=e,Yu}function Nh(){if(Qu)return Zu;Qu=1;let e=Oh(),t=Th();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Zu=r,r.default=r,e.registerRule(r),Zu}function Lh(){if(th)return eh;th=1;let e=wh(),t=function(){if(Vu)return qu;Vu=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return qu=function(k,x={}){let O,E,I,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(k){if(B.length)return B.pop();if(U>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(U),O){case s:case o:case a:case l:case i:E=U;do{E+=1,O=_.charCodeAt(E)}while(O===o||O===s||O===a||O===l||O===i);L=["space",_.slice(U,E)],U=E-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(T=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===T&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){E=U;do{if(P=!1,E=_.indexOf(")",E+1),-1===E){if(D||x){E=U;break}z("bracket")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(U,E+1),U,E],U=E}else E=_.indexOf(")",U+1),M=_.slice(U,E+1),-1===E||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,E],U=E);break;case e:case t:I=O===e?"'":'"',E=U;do{if(P=!1,E=_.indexOf(I,E+1),-1===E){if(D||x){E=U+1;break}z("string")}for(A=E;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(U,E+1),U,E],U=E;break;case v:w.lastIndex=U+1,w.test(_),E=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(U,E+1),U,E],U=E;break;case r:for(E=U,R=!0;_.charCodeAt(E+1)===r;)E+=1,R=!R;if(O=_.charCodeAt(E+1),R&&O!==n&&O!==o&&O!==s&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(_.charAt(E)))){for(;C.test(_.charAt(E+1));)E+=1;_.charCodeAt(E+1)===o&&(E+=1)}L=["word",_.slice(U,E+1),U,E],U=E;break;default:O===n&&_.charCodeAt(U+1)===g?(E=_.indexOf("*/",U+2)+1,0===E&&(D||x?E=_.length:z("comment")),L=["comment",_.slice(U,E+1),U,E],U=E):(b.lastIndex=U+1,b.test(_),E=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(U,E+1),U,E],j.push(L),U=E)}return U++,L},position:function(){return U}}}}(),r=xh(),n=Ph(),s=Ah(),o=Nh();const i={empty:!0,space:!0};return eh=class{constructor(e){this.input=e,this.root=new s,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,s,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new o;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})}},eh}function _h(){if(nh)return rh;nh=1;let e=Oh(),t=Lh(),r=Ch();function n(e,n){let s=new r(e,n),o=new t(s);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return rh=n,n.default=n,e.registerParse(n),rh}function Dh(){if(oh)return sh;oh=1;let{isClean:e,my:t}=mh(),r=kh(),n=yh(),s=Oh(),o=Eh(),i=Ih(),a=Rh(),l=_h(),c=Ah();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)o=g(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&s.rebuild(o)}else o=g(r);this.result=new a(e,o,n),this.helpers={...y,postcss:y,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,o=r.iterator;for(;s=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return v.registerPostcss=e=>{y=e},sh=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),sh}function Fh(){if(ch)return lh;ch=1;let e=function(){if(ah)return ih;ah=1;let e=kh(),t=yh(),r=Ih(),n=_h();const s=Rh();class o{constructor(r,n,o){let i;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new s(this._processor,i,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,n);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||r("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=n;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"}}return ih=o,o.default=o,ih}(),t=Dh(),r=Eh(),n=Ah();class s{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return lh=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),lh}var Uh=function(){if(ph)return dh;ph=1;let e=fu(),t=wh(),r=Dh(),n=Oh(),s=Fh(),o=yh(),i=function(){if(hh)return uh;hh=1;let e=wh(),t=Sh(),r=xh(),n=Ph(),s=Ch(),o=Ah(),i=Nh();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return uh=a,a.default=a,uh}(),a=Eh(),l=Mh(),c=xh(),u=Ph(),h=Rh(),d=Ch(),p=_h(),f=Th(),m=Nh(),g=Ah(),y=vh();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new s).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return v([o(r)]).process(e,t)},o},v.stringify=o,v.parse=p,v.fromJSON=i,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),dh=v,v.default=v,dh}();const jh=iu(Uh);jh.stringify,jh.fromJSON,jh.plugin,jh.parse,jh.list,jh.document,jh.comment,jh.atRule,jh.rule,jh.decl,jh.root,jh.CssSyntaxError,jh.Declaration,jh.Container,jh.Processor,jh.Document,jh.Comment,jh.Warning,jh.AtRule,jh.Result,jh.Input,jh.Rule,jh.Root,jh.Node;class Bh{constructor(...e){ou(this,"parentElement",null),ou(this,"parentNode",null),ou(this,"ownerDocument"),ou(this,"firstChild",null),ou(this,"lastChild",null),ou(this,"previousSibling",null),ou(this,"nextSibling",null),ou(this,"ELEMENT_NODE",1),ou(this,"TEXT_NODE",3),ou(this,"nodeType"),ou(this,"nodeName"),ou(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 Bh))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 zh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Wh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$h={};function qh(e){if($h[e])return $h[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in zh?zh[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 Wh?Wh[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)return $h[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?$h[e]=o:r}catch{return r}}const Vh={};function Gh(e,t,r){var n;const s=`${e}.${String(r)}`;if(Vh[s])return Vh[s].call(t);const o=qh(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Vh[s]=i,i.call(t)):t[r]}const Hh={};function Jh(e,t,r){const n=`${e}.${String(r)}`;if(Hh[n])return Hh[n].bind(t);const s=qh(e)[r];return"function"!=typeof s?t[r]:(Hh[n]=s,s.bind(t))}function Kh(){return qh("MutationObserver").constructor}const Yh={childNodes:function(e){return Gh("Node",e,"childNodes")},parentNode:function(e){return Gh("Node",e,"parentNode")},parentElement:function(e){return Gh("Node",e,"parentElement")},textContent:function(e){return Gh("Node",e,"textContent")},contains:function(e,t){return Jh("Node",e,"contains")(t)},getRootNode:function(e){return Jh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Gh("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Gh("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Gh("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Gh("Element",e,"querySelectorAll")(t)},mutationObserver:Kh};function Xh(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Zh="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 Qh={map:{},getId:()=>(console.error(Zh),-1),getNode:()=>(console.error(Zh),null),removeNodeFromMap(){console.error(Zh)},has:()=>(console.error(Zh),!1),reset(){console.error(Zh)}};function ed(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 td(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)}}),()=>td(e,t,o||{},!0)}function rd(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&&(Qh=new Proxy(Qh,{get:(e,t,r)=>("map"===t&&console.error(Zh),Reflect.get(e,t,r))}));let nd=Date.now;function sd(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=Yh.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=Yh.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function od(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function id(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ad(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Yh.parentElement(e)}function ld(e,t,r,n){if(!e)return!1;const s=ad(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(vl(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 cd(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function ud(e,t){if(za(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Yh.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||ud(n,t))}function hd(e){return Boolean(e.changedTouches)}function dd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function pd(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function fd(e){return!!e&&(e instanceof Bh&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Yh.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(nd=()=>(new Date).getTime());class md{constructor(){Ia(this,"id",1),Ia(this,"styleIDMap",new WeakMap),Ia(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 gd(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Yh.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Yh.host(Yh.getRootNode(e))&&(r=Yh.host(Yh.getRootNode(e))),r}function yd(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=gd(r);)r=t;return r}(e);return Yh.contains(t,r)}function vd(e){const t=e.ownerDocument;return!!t&&(Yh.contains(t,e)||yd(e))}var wd=(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))(wd||{}),bd=(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))(bd||{}),Sd=(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))(Sd||{}),Cd=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Cd||{}),kd=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(kd||{}),xd=(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))(xd||{}),Od=(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))(Od||{});function Ed(e){return"__ln"in e}class Id{constructor(){Ia(this,"length",0),Ia(this,"head",null),Ia(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&&Ed(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&&Ed(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 Md=(e,t)=>`${e}@${t}`;class Rd{constructor(){Ia(this,"frozen",!1),Ia(this,"locked",!1),Ia(this,"texts",[]),Ia(this,"attributes",[]),Ia(this,"attributeMap",new WeakMap),Ia(this,"removes",[]),Ia(this,"mapRemoves",[]),Ia(this,"movedMap",{}),Ia(this,"addedSet",new Set),Ia(this,"movedSet",new Set),Ia(this,"droppedSet",new Set),Ia(this,"removesSubTreeCache",new Set),Ia(this,"mutationCb"),Ia(this,"blockClass"),Ia(this,"blockSelector"),Ia(this,"maskTextClass"),Ia(this,"maskTextSelector"),Ia(this,"inlineStylesheet"),Ia(this,"maskInputOptions"),Ia(this,"maskTextFn"),Ia(this,"maskInputFn"),Ia(this,"maskAttributeFn"),Ia(this,"keepIframeSrcFn"),Ia(this,"recordCanvas"),Ia(this,"inlineImages"),Ia(this,"slimDOMOptions"),Ia(this,"dataURLOptions"),Ia(this,"doc"),Ia(this,"mirror"),Ia(this,"iframeManager"),Ia(this,"stylesheetManager"),Ia(this,"shadowDomManager"),Ia(this,"canvasManager"),Ia(this,"processedNodeManager"),Ia(this,"unattachedDoc"),Ia(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Ia(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Id,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=Yh.parentNode(s);if(!o||!vd(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=za(o)?this.mirror.getId(gd(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=kl(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=>{dd(e,this.mirror)&&this.iframeManager.addIframe(e),pd(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),fd(s)&&this.shadowDomManager.addShadowRoot(Yh.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)Ad(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Yh.parentNode(e))||s(e);for(const e of this.addedSet)Td(this.droppedSet,e)||Ad(this.removesSubTreeCache,e,this.mirror)?Td(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(Yh.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(Yh.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Yh.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Yh.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=Yh.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))}),Ia(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(Yh.childNodes(e),e=>Yh.textContent(e)||"").join("");t.attributes.value=Ga({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Ka(e),value:r,maskInputFn:this.maskInputFn})}),Ia(this,"processMutation",e=>{if(!cd(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Yh.textContent(e.target);ld(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:wl(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ad(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=Ka(t);n=Ga({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(ld(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"),!yl(t.tagName,r)){if(s.attributes[r]=gl(this.doc,Ha(t.tagName),Ha(r),n),this.maskAttributeFn&&"string"==typeof s.attributes[r]){const e=this.maskAttributeFn(r,s.attributes[r],t);null!==e?s.attributes[r]=e:delete s.attributes[r]}if("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(ld(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=za(e.target)?this.mirror.getId(Yh.host(e.target)):this.mirror.getId(e.target);ld(e.target,this.blockClass,this.blockSelector,!1)||cd(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Pd(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||ud(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Md(r,n)]?Pd(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!za(e.target)||!Wa(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Yh.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Ia(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(cd(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[Md(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ld(e,this.blockClass,this.blockSelector,!1)||(Yh.childNodes(e).forEach(e=>this.genAdds(e)),fd(e)&&Yh.childNodes(Yh.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAttributeFn","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 Pd(e,t){e.delete(t),Yh.childNodes(t).forEach(t=>Pd(e,t))}function Ad(e,t,r){return 0!==e.size&&function(e,t){const r=Yh.parentNode(t);return!!r&&e.has(r)}(e,t)}function Td(e,t){return 0!==e.size&&Nd(e,t)}function Nd(e,t){const r=Yh.parentNode(t);return!!r&&(!!e.has(r)||Nd(e,r))}let Ld;const _d=e=>{if(!Ld)return e;return(...t)=>{try{return e(...t)}catch(e){if(Ld&&!0===Ld(e))return;throw e}}};function Dd(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Fd=[];function Ud(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 jd(e,t){const r=new Rd;Fd.push(r),r.init(e);const n=new(Kh())(_d(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Bd({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(Sd).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=Ha(o);const c=(t=>o=>{const i=Ud(o);if(ld(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Cd.Mouse;break;case"touch":a=Cd.Touch;break;case"pen":a=Cd.Pen}a===Cd.Touch?Sd[t]===Sd.MouseDown?c="TouchStart":Sd[t]===Sd.MouseUp&&(c="TouchEnd"):Cd.Pen}else hd(o)&&(a=Cd.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Cd.Touch||c.startsWith("Mouse")&&a===Cd.Mouse)&&(a=null)):Sd[t]===Sd.Click&&(a=l,l=null);const u=hd(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;_d(e)({type:Sd[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Sd[o]){case Sd.MouseDown:case Sd.MouseUp:i=i.replace("mouse","pointer");break;case Sd.TouchStart:case Sd.TouchEnd:return}a.push(Xh(i,c,t))}),_d(()=>{a.forEach(e=>e())})}function zd({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=_d(ed(_d(o=>{const i=Ud(o);if(!i||ld(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=sd(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 Xh("scroll",i,t)}const Wd=["INPUT","TEXTAREA","SELECT"],$d=new WeakMap;function qd(e){return function(e,t){if(Jd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Jd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Jd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Jd("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 Vd(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Gd({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Yh.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}}),_d(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Hd(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=jd(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=ed(_d(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=_d(ed(_d(e=>{const t=Ud(e),{clientX:r,clientY:s}=hd(e)?e.changedTouches[0]:e;i||(i=nd()),a.push({x:r,y:s,id:n.getId(t),timeOffset:nd()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?bd.Drag:e instanceof MouseEvent?bd.MouseMove:bd.TouchMove)}),s,{trailing:!1})),u=[Xh("mousemove",c,r),Xh("touchmove",c,r),Xh("drag",c,r)];return _d(()=>{u.forEach(e=>e())})}(e),o=Bd(e),i=zd(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Xh("resize",_d(ed(_d(()=>{const t=od(),s=id();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=Ud(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Yh.parentElement(r)),!r||!h||Wd.indexOf(h)<0||ld(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=Ka(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Ga({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=$d.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){$d.set(t,n);const s=r.getId(t);_d(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Xh(e,_d(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=>td(e[0],e[1],{set(){_d(h)({target:this,isTrusted:!1})}},!1,f))),_d(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=_d(o=>ed(_d(s=>{const i=Ud(s);if(!i||ld(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=[Xh("play",i(xd.Play),o),Xh("pause",i(xd.Pause),o),Xh("seeked",i(xd.Seeked),o),Xh("volumechange",i(xd.VolumeChange),o),Xh("ratechange",i(xd.RateChange),o)];return _d(()=>{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:_d((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Vd(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),Dd(()=>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:_d((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Vd(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),Dd(()=>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:_d((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Vd(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:_d((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Vd(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};Kd("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Kd("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Kd("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Kd("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:_d((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Vd(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...qd(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:_d((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Vd(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...qd(s),i]}]}),n.apply(s,o)})})}),_d(()=>{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=Gd(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:_d((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}=Vd(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:qd(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:_d((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=Vd(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:qd(o.parentRule)}),s.apply(o,a)})}),_d(()=>{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=rd(t.fonts,"add",function(t){return function(r){return setTimeout(_d(()=>{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),_d(()=>{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=_d(()=>{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;ld(i,n,s,!0)||ld(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Xh("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?rd(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 _d(()=>{Fd.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 Jd(e){return void 0!==window[e]}function Kd(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Yd{constructor(e){Ia(this,"iframeIdToRemoteIdMap",new WeakMap),Ia(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 Xd{constructor(e){Ia(this,"iframes",new WeakMap),Ia(this,"crossOriginIframeMap",new WeakMap),Ia(this,"crossOriginIframeMirror",new Yd(al)),Ia(this,"crossOriginIframeStyleMirror"),Ia(this,"crossOriginIframeRootIdMap",new WeakMap),Ia(this,"mirror"),Ia(this,"mutationCb"),Ia(this,"wrappedEmit"),Ia(this,"loadListener"),Ia(this,"stylesheetManager"),Ia(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Yd(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 wd.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:wd.IncrementalSnapshot,data:{source:bd.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case wd.Meta:case wd.Load:case wd.DomContentLoaded:return!1;case wd.Plugin:return t;case wd.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case wd.IncrementalSnapshot:switch(t.data.source){case bd.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 bd.Drag:case bd.TouchMove:case bd.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case bd.ViewportResize:return!1;case bd.MediaInteraction:case bd.MouseInteraction:case bd.Scroll:case bd.CanvasMutation:case bd.Input:return this.replaceIds(t.data,e,["id"]),t;case bd.StyleSheetRule:case bd.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case bd.Font:return t;case bd.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case bd.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===Od.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Zd{constructor(e){Ia(this,"shadowDoms",new WeakSet),Ia(this,"mutationCb"),Ia(this,"scrollCb"),Ia(this,"bypassOptions"),Ia(this,"mirror"),Ia(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(!Wa(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=jd({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(zd({...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(Yh.host(e))),this.restoreHandlers.push(Gd({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(rd(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=Yh.shadowRoot(this);return o&&vd(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Qd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ep="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tp=0;tp<64;tp++)ep[Qd.charCodeAt(tp)]=tp;const rp=new Map;const np=(e,t,r)=>{if(!e||!ip(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=rp.get(e);return r||(r=new Map,rp.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 sp(e,t,r){if(e instanceof Array)return e.map(e=>sp(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+=Qd[r[t]>>2],s+=Qd[(3&r[t])<<4|r[t+1]>>4],s+=Qd[(15&r[t+1])<<2|r[t+2]>>6],s+=Qd[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:[sp(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:[sp(e.data,t,r),e.width,e.height]}}if(ip(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:np(e,t,r)}}return e}const op=(e,t,r)=>e.map(e=>sp(e,t,r)),ip=(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 ap(e,t,r,n){const s=[];try{const o=rd(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!ld(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 lp(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=rd(e,l,function(e){return function(...i){const a=e.apply(this,i);if(np(a,o,this),"tagName"in this.canvas&&!ld(this.canvas,n,s,!0)){const e=op(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=td(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const cp='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',up="undefined"!=typeof self&&self.Blob&&new Blob([cp],{type:"text/javascript;charset=utf-8"});function hp(e){let t;try{if(t=up&&(self.URL||self.webkitURL).createObjectURL(up),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(cp),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class dp{constructor(e){Ia(this,"pendingCanvasMutations",new Map),Ia(this,"rafStamps",{latestId:0,invokeId:null}),Ia(this,"mirror"),Ia(this,"mutationCb"),Ia(this,"resetObservers"),Ia(this,"frozen",!1),Ia(this,"locked",!1),Ia(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=ap(t,r,n,!0),i=new Map,a=new hp;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:kd["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=>{ld(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=ap(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=rd(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return ld(this.canvas,r,n,!0)||setTimeout(()=>{const r=op(o,t,this);e(this.canvas,{type:kd["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=td(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:kd["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(...lp(t.WebGLRenderingContext.prototype,kd.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...lp(t.WebGL2RenderingContext.prototype,kd.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 pp{constructor(e){Ia(this,"trackedLinkElements",new WeakSet),Ia(this,"mutationCb"),Ia(this,"adoptedStyleSheetCb"),Ia(this,"styleMirror",new md),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;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);let r=[];try{r=Array.from(t.cssRules,(e,r)=>({rule:qa(e,t.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}n.push({styleId:e,rules: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 fp{constructor(){Ia(this,"nodeMap",new WeakMap),Ia(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 mp,gp,yp,vp=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(xa=e.contentWindow)?void 0:xa.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const wp=new Va;function bp(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,maskAttributeFn:g,hooks:y,packFn:v,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:k=!1,recordCrossOriginIframes:x=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:I=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!0,plugins:P,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N,applyBackgroundColorToBlockedElements:L=!1}=e;Ld=N;const _=!x||window.parent===window;let D=!1;if(!_)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!D)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),wp.reset();const F=!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},U=!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 j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const z=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!D&&(e=v(e)),e};mp=(e,s)=>{var o;const i=e;if(i.timestamp=nd(),!(null==(o=Fd[0])?void 0:o.isFrozen())||i.type===wd.FullSnapshot||i.type===wd.IncrementalSnapshot&&i.data.source===bd.Mutation||Fd.forEach(e=>e.unfreeze()),_)null==t||t(z(i),s);else if(D){const e={type:"rrweb",event:z(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===wd.FullSnapshot)j=i,B=0;else if(i.type===wd.IncrementalSnapshot){if(i.data.source===bd.Mutation&&i.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&i.timestamp-j.timestamp>r;(e||t)&&gp(!0)}};const W=e=>{mp({type:wd.IncrementalSnapshot,data:{source:bd.Mutation,...e}})},$=e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.Scroll,...e}}),q=e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.CanvasMutation,...e}}),V=new pp({mutationCb:W,adoptedStyleSheetCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.AdoptedStyleSheet,...e}})}),G=new Xd({mirror:wp,mutationCb:W,stylesheetManager:V,recordCrossOriginIframes:x,wrappedEmit:mp});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:wp,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new fp;yp=new dp({recordCanvas:k,mutationCb:q,win:window,blockClass:s,blockSelector:o,mirror:wp,sampling:w.canvas,dataURLOptions:b});const J=new Zd({mutationCb:W,scrollCb:$,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:b,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:k,inlineImages:M,sampling:w,slimDOMOptions:U,iframeManager:G,stylesheetManager:V,canvasManager:yp,keepIframeSrcFn:A,processedNodeManager:H},mirror:wp});gp=(e=!1)=>{if(!C)return;mp({type:wd.Meta,data:{href:window.location.href,width:id(),height:od()}},e),V.reset(),J.init(),Fd.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Va,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,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:y,onAdoptedStyleSheet:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k=()=>!1,applyBackgroundColorToBlockedElements:x=!1}=t||{};return kl(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,maskAttributeFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:y,onAdoptedStyleSheet:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:x})}(document,{mirror:wp,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:U,dataURLOptions:b,recordCanvas:k,inlineImages:M,applyBackgroundColorToBlockedElements:L,onSerialize:e=>{dd(e,wp)&&G.addIframe(e),pd(e,wp)&&V.trackLinkElement(e),fd(e)&&J.addShadowRoot(Yh.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):void 0,onIframeLoad:(e,t)=>{G.attachIframe(e,t),J.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");mp({type:wd.FullSnapshot,data:{node:t,initialOffset:sd(window)}},e),Fd.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,wp.getId(document))};try{const e=[],t=e=>{var t;return _d(Hd)({mutationCb:W,mousemoveCb:(e,t)=>mp({type:wd.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.MouseInteraction,...e}}),scrollCb:$,viewportResizeCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.ViewportResize,...e}}),inputCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.Input,...e}}),mediaInteractionCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.MediaInteraction,...e}}),styleSheetRuleCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.StyleSheetRule,...e}}),styleDeclarationCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.StyleDeclaration,...e}}),canvasMutationCb:q,fontCb:e=>mp({type:wd.IncrementalSnapshot,data:{source:bd.Font,...e}}),selectionCb:e=>{mp({type:wd.IncrementalSnapshot,data:{source:bd.Selection,...e}})},customElementCb:e=>{mp({type:wd.IncrementalSnapshot,data:{source:bd.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:w,recordDOM:C,recordCanvas:k,inlineImages:M,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:U,dataURLOptions:b,mirror:wp,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,canvasManager:yp,ignoreCSSAttributes:T,plugins:(null==(t=null==P?void 0:P.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>mp({type:wd.Plugin,data:{plugin:e.name,payload:t}})})))||[]},y)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{gp(),e.push(t(document)),vp=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Xh("DOMContentLoaded",()=>{mp({type:wd.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&r()})),e.push(Xh("load",()=>{mp({type:wd.Load,data:{}}),"load"===O&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),vp=!1,Ld=void 0}}catch(e){console.warn(e)}}var Sp;bp.addCustomEvent=(e,t)=>{if(!vp)throw new Error("please add custom event after start recording");mp({type:wd.Custom,data:{tag:e,payload:t}})},bp.freezePage=()=>{Fd.forEach(e=>e.freeze())},bp.takeFullSnapshot=e=>{if(!vp)throw new Error("please take full snapshot after start recording");gp(e)},bp.mirror=wp,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Sp||(Sp={}));var Cp=Object.freeze({__proto__:null,record:bp}),kp=["image/","audio/","video/","application/octet-stream","font/"];function xp(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var r=0,n=Math.min(e.length,t);r<n;){var s=Math.ceil((r+n)/2);new Blob([e.slice(0,s)]).size<=t?r=s:n=s-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}var Op=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e,t){this.eventCallback=e,this.networkConfig=t,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,this.networkConfig=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=m();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return i(e,void 0,void 0,function(){var e,s,o,i,l,c,u,h,d,p,f,m,g=this;return a(this,function(a){switch(a.label){case 0:e=Date.now(),s={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(null==(o=null===(f=this.networkConfig)||void 0===f?void 0:f.body)?void 0:o.request)&&void 0!==(i=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(e,r){t.push("".concat(r,"=").concat("string"==typeof e?e:"[File]"))}),t.join("&")}}}(null==n?void 0:n.body))&&(l=null!==(m=o.maxBodySizeBytes)&&void 0!==m?m:10240,s.requestBody=xp(i,l).value),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return c=a.sent(),d=Date.now(),s.status=c.status,s.duration=d-e,u={},c.headers.forEach(function(e,t){u[t]=e}),s.responseHeaders=u,(null==o?void 0:o.response)?!function(e){return!!e&&kp.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?c.clone().text().then(function(e){var t,r=xp(e,null!==(t=o.maxBodySizeBytes)&&void 0!==t?t:10240),n=r.value,i=r.truncated;s.responseBody=n,s.responseBodyStatus=i?"truncated":"captured",g.notifyEvent(s)},function(){s.responseBodyStatus="error",g.notifyEvent(s)}):(s.responseBodyStatus="skipped_binary",this.notifyEvent(s)):this.notifyEvent(s),[2,c];case 3:throw h=a.sent(),d=Date.now(),s.duration=d-e,p=h,s.error={name:p.name||"UnknownError",message:p.message||"An unknown error occurred"},this.notifyEvent(s),h;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),Ep=Object.freeze({__proto__:null,NetworkObservers:Op});return e.SessionReplayPlugin=br,e.plugin=Sr,e.sessionReplayPlugin=Sr,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
2
2
|
//# sourceMappingURL=plugin-session-replay-browser-min.js.map
|