@amplitude/plugin-session-replay-browser 1.26.0 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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/package.json +5 -5
|
@@ -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,p="$default_instance",d="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:p,logLevel:f.Warn,loggerProvider:new b,offline:!1,optOut:!1,serverUrl:d,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=k(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}(),x=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":d},k=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:x(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 p=e.apply(s,o);return p&&p.promise?p.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))),p}},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 T(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 A=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(!A(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){A(e[r],t[r])||(h=!1)}),h}for(var p=0;p<e.length;p++)if(!A(e[p],t[p]))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=T(u.value,2),p=h[0],d=h[1];switch(p){case"$set":try{for(var f=(s=void 0,P(Object.entries(d))),m=f.next();!m.done;m=f.next()){var g=T(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(d))),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),A(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,p,d,f,m,g,y,v,w,b,S,C,x;if("object"!=typeof e)return null;var k=e.code||0,O=this.buildStatus(k);switch(O){case h.Success:return{status:O,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case h.Invalid:return{status:O,statusCode:k,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(i=e.events_with_invalid_fields)&&void 0!==i?i:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(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!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],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:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case h.RateLimit:return{status:O,statusCode:k,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!==(x=e.throttled_events)&&void 0!==x?x:[]}};case h.Timeout:default:return{status:O,statusCode:k}}},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=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,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.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;return a(this,function(a){switch(a.label){case 0:s=new AbortController,i=setTimeout(function(){return s.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(l=a.sent()).ok?[3,4]:[4,l.text()];case 3:return u=a.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(u)),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=a.sent())instanceof Error&&"AbortError"===h.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: "),h),[3,9];case 8:return clearTimeout(i),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11];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];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 W,$="https://app.amplitude.com",q={US:$,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var V="__AMPLITUDE_MESSENGER_INSTANCE__",H="__AMPLITUDE_MESSENGER__",G=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?$:t;this[W]=!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===$&&(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[H])===this&&delete e[H]},e}();function J(e){var t,r=m(),n=null==r?void 0:r[H];if("object"==typeof(t=n)&&null!==t&&V in t&&!0===t[V])return n;var s=new G(e);return r&&(r[H]=s),s}W=V;var K="__AMPLITUDE_BACKGROUND_CAPTURE__";var Y,X="[Amplitude]",Z="".concat(X," Session Replay ID"),Q=N.US,ee={enabled:!0},te=1e3,re="".concat(X," Session Replay Debug"),ne="amp-mask";!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"}(Y||(Y={}));var se=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}(),oe="medium";var ie=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 ie(e,oe,r)}},ae=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:oe}),r){if(r.closest("."+ne))return!0;var i=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(a)return!1}return ie(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:oe,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},le=function(e,t){return t||(e===N.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===N.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},ce=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},ue=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=ce(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},he=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:""}]}})})},pe=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},de=function(){return{flushMaxRetries:2,logLevel:f.Warn,loggerProvider:new b,transportProvider:new j}},fe=function(e){function t(t,r){var n,s,i,a,l,c,u=this,h=de();if((u=e.call(this,o(o({transportProvider:h.transportProvider,loggerProvider:new se(r.loggerProvider||h.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=h.flushMaxRetries?r.flushMaxRetries:h.flushMaxRetries,u.apiKey=t,u.sampleRate=r.sampleRate||0,u.serverZone=r.serverZone||Q,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||ee,u.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",u.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,u.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,u.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:te,u.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(u.privacyConfig=r.privacyConfig),r.interactionConfig&&(u.interactionConfig=r.interactionConfig,u.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")}(u.interactionConfig.ugcFilterRules)),r.debugMode&&(u.debugMode=r.debugMode),void 0!==r.useWebWorker)u.useWebWorker=r.useWebWorker;else{var p=r;void 0!==(null===(c=p.experimental)||void 0===c?void 0:c.useWebWorker)&&(u.useWebWorker=p.experimental.useWebWorker)}return r.omitElementTags&&(u.omitElementTags=r.omitElementTags),u}return r(t,e),t}(C),me=(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))(me||{}),ge=(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))(ge||{}),ye=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r;return i(this,void 0,void 0,function(){var n,s,i,u,h,p,d,f,m,g,y,v,w,b,S,C,x,k=this;return a(this,function(a){switch(a.label){case 0:(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(e,t){k.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,o){var i;if(k.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(o,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,c=a.sr_privacy_config,u=a.sr_targeting_config,h=null===(i=n.interactionConfig)||void 0===i?void 0:i.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||c||u)&&(s={},l&&(s.sr_sampling_config=l),c&&(s.sr_privacy_config=c),u&&(s.sr_targeting_config=u)),e()}else t(new Error("No remote config received"))})})];case 2:return a.sent(),[3,4];case 3:return i=a.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",i),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!s)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}];if(u=s.sr_sampling_config,h=s.sr_privacy_config,p=s.sr_targeting_config,u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?n.captureEnabled=u.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(n.sampleRate=u.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){d=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:d.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},m=function(e){var t,r,n,s,o,i,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var p=l(null!==(a=e.blockSelector)&&void 0!==a?a:[]),d=p.next();!d.done;d=p.next()){h[d.value]="block"}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=p.return)&&r.call(p)}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},g=o(o({},m(d)),m(h));try{for(y=l(Object.entries(g)),v=y.next();!v.done;v=y.next())w=c(v.value,2),b=w[0],"mask"===(S=w[1])?f.maskSelector.push(b):"block"===S?f.blockSelector.push(b):"unmask"===S&&f.unmaskSelector.push(b)}catch(e){C={error:e}}finally{try{v&&!v.done&&(x=y.return)&&x.call(y)}finally{if(C)throw C.error}}n.privacyConfig=(O=f,E=this.localConfig.loggerProvider,I=document.createDocumentFragment(),M=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{I.querySelector(e)}catch(t){return E.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},O.blockSelector=M(O.blockSelector),O.maskSelector=M(O.maskSelector),O.unmaskSelector=M(O.unmaskSelector),O)}return p&&Object.keys(p).length>0&&(n.targetingConfig=p),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:pe(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}]}var O,E,I,M})})},e}(),ve=function(e,t){return i(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new fe(e,t),n=new z(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new ye(n,r)]})})},we=Uint8Array,be=Uint16Array,Se=Uint32Array,Ce=new we([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xe=new we([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ke=new we([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oe=function(e,t){for(var r=new be(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new Se(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)s[o]=o-r[n]<<5|n;return[r,s]},Ee=Oe(Ce,2),Ie=Ee[0],Me=Ee[1];Ie[28]=258,Me[258]=28;for(var Re=Oe(xe,0)[1],Pe=new be(32768),Te=0;Te<32768;++Te){var Ae=(43690&Te)>>>1|(21845&Te)<<1;Ae=(61680&(Ae=(52428&Ae)>>>2|(13107&Ae)<<2))>>>4|(3855&Ae)<<4,Pe[Te]=((65280&Ae)>>>8|(255&Ae)<<8)>>>1}var Ne=function(e,t,r){for(var n=e.length,s=0,o=new be(t);s<n;++s)++o[e[s]-1];var i,a=new be(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new be(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)i[Pe[h]>>>l]=c}else for(i=new be(n),s=0;s<n;++s)i[s]=Pe[a[e[s]-1]++]>>>15-e[s];return i},Le=new we(288);for(Te=0;Te<144;++Te)Le[Te]=8;for(Te=144;Te<256;++Te)Le[Te]=9;for(Te=256;Te<280;++Te)Le[Te]=7;for(Te=280;Te<288;++Te)Le[Te]=8;var _e=new we(32);for(Te=0;Te<32;++Te)_e[Te]=5;var De=Ne(Le,9,0),Fe=Ne(_e,5,0),Ue=function(e){return(e/8|0)+(7&e&&1)},je=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof be?be:e instanceof Se?Se:we)(r-t);return n.set(e.subarray(t,r)),n},Be=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},ze=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},We=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,o=r.slice();if(!s)return[new we(0),0];if(1==s){var i=new we(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var p=o[0].s;for(n=1;n<s;++n)o[n].s>p&&(p=o[n].s);var d=new be(p+1),f=$e(r[u-1],d,0);if(f>t){n=0;var m=0,g=f-t,y=1<<g;for(o.sort(function(e,t){return d[t.s]-d[e.s]||e.f-t.f});n<s;++n){var v=o[n].s;if(!(d[v]>t))break;m+=y-(1<<f-d[v]),d[v]=t}for(m>>>=g;m>0;){var w=o[n].s;d[w]<t?m-=1<<t-d[w]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;d[b]==t&&(--d[b],++m)}f=t}return[new we(d),f]},$e=function(e,t,r){return-1==e.s?Math.max($e(e.l,t,r+1),$e(e.r,t,r+1)):t[e.s]=r},qe=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new be(++t),n=0,s=e[0],o=1,i=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=e[a]}return[r.subarray(0,n),t]},Ve=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},He=function(e,t,r){var n=r.length,s=Ue(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var o=0;o<n;++o)e[s+o+4]=r[o];return 8*(s+4+n)},Ge=function(e,t,r,n,s,o,i,a,l,c,u){Be(t,u++,r),++s[256];for(var h=We(s,15),p=h[0],d=h[1],f=We(o,15),m=f[0],g=f[1],y=qe(p),v=y[0],w=y[1],b=qe(m),S=b[0],C=b[1],x=new be(19),k=0;k<v.length;++k)x[31&v[k]]++;for(k=0;k<S.length;++k)x[31&S[k]]++;for(var O=We(x,7),E=O[0],I=O[1],M=19;M>4&&!E[ke[M-1]];--M);var R,P,T,A,N=c+5<<3,L=Ve(s,Le)+Ve(o,_e)+i,_=Ve(s,p)+Ve(o,m)+i+14+3*M+Ve(x,E)+(2*x[16]+3*x[17]+7*x[18]);if(N<=L&&N<=_)return He(t,u,e.subarray(l,l+c));if(Be(t,u,1+(_<L)),u+=2,_<L){R=Ne(p,d,0),P=p,T=Ne(m,g,0),A=m;var D=Ne(E,I,0);Be(t,u,w-257),Be(t,u+5,C-1),Be(t,u+10,M-4),u+=14;for(k=0;k<M;++k)Be(t,u+3*k,E[ke[k]]);u+=3*M;for(var F=[v,S],U=0;U<2;++U){var j=F[U];for(k=0;k<j.length;++k){var B=31&j[k];Be(t,u,D[B]),u+=E[B],B>15&&(Be(t,u,j[k]>>>5&127),u+=j[k]>>>12)}}}else R=De,P=Le,T=Fe,A=_e;for(k=0;k<a;++k)if(n[k]>255){B=n[k]>>>18&31;ze(t,u,R[B+257]),u+=P[B+257],B>7&&(Be(t,u,n[k]>>>23&31),u+=Ce[B]);var z=31&n[k];ze(t,u,T[z]),u+=A[z],z>3&&(ze(t,u,n[k]>>>5&8191),u+=xe[z])}else ze(t,u,R[n[k]]),u+=P[n[k]];return ze(t,u,R[256]),u+P[256]},Je=new Se([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ke=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new we(n+i+5*(1+Math.floor(i/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||i<8)for(var u=0;u<=i;u+=65535){var h=u+65535;h<i?c=He(l,c,e.subarray(u,h)):(l[u]=o,c=He(l,c,e.subarray(u,i)))}else{for(var p=Je[t-1],d=p>>>13,f=8191&p,m=(1<<r)-1,g=new be(32768),y=new be(m+1),v=Math.ceil(r/3),w=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<w)&m},S=new Se(25e3),C=new be(288),x=new be(32),k=0,O=0,E=(u=0,0),I=0,M=0;u<i;++u){var R=b(u),P=32767&u,T=y[R];if(g[P]=T,y[R]=P,I<=u){var A=i-u;if((k>7e3||E>24576)&&A>423){c=Ge(e,l,0,S,C,x,O,E,M,u-M,c),E=k=O=0,M=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)x[N]=0}var L=2,_=0,D=f,F=P-T&32767;if(A>2&&R==b(u-F))for(var U=Math.min(d,A)-1,j=Math.min(32767,u),B=Math.min(258,A);F<=j&&--D&&P!=T;){if(e[u+L]==e[u+L-F]){for(var z=0;z<B&&e[u+z]==e[u+z-F];++z);if(z>L){if(L=z,_=F,z>U)break;var W=Math.min(F,z-2),$=0;for(N=0;N<W;++N){var q=u-F+N+32768&32767,V=q-g[q]+32768&32767;V>$&&($=V,T=q)}}}F+=(P=T)-(T=g[P])+32768&32767}if(_){S[E++]=268435456|Me[L]<<18|Re[_];var H=31&Me[L],G=31&Re[_];O+=Ce[H]+xe[G],++C[257+H],++x[G],I=u+L,++k}else S[E++]=e[u],++C[e[u]]}}c=Ge(e,l,o,S,C,x,O,E,M,u-M,c)}return je(a,0,n+Ue(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!0)};function Ye(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,o=r.length,i=0;i!=o;){for(var a=Math.min(i+5552,o);i<a;++i)s+=n+=r[i];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,o,i=Ke(e,t,2,4);return n=i,s=t.level,o=0==s?0:s<6?1:9==s?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(i,i.length-4,r.d()),i}const Xe=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(Ye(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new we(e.length+(e.length>>>1)),s=0,o=function(e){n[s++]=e},i=0;i<r;++i){if(s+5>n.length){var a=new we(s+8+(r-i<<1));a.set(n),n=a}var l=e.charCodeAt(i);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return je(n,0,s)}(JSON.stringify(t))),!0)};var Ze=function(){function e(e,t,r,n){var s,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=Xe(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=o.compressEvent(e);o.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var i=m();if(this.canUseIdleCallback=i&&"requestIdleCallback"in i,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3,n){t.loggerProvider.log("Enabling web worker for compression");try{var a=new Blob([n],{type:"application/javascript"}),l=URL.createObjectURL(a),c=new Worker(l);c.onerror=function(e){t.loggerProvider.error("Worker failed, falling back to non-worker compression:",e),c.terminate(),o.worker=void 0},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=c}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;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),Qe="Session replay event batch rejected due to exceeded retry count",et="Failed to store session replay events in IndexedDB",tt="1.32.0",rt=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:Qe}),!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){var r,n;return void 0===t&&(t=!0),i(this,void 0,void 0,function(){var s,o,i,l,c,u,h,p,d,f,g,y,v;return a(this,function(a){switch(a.label){case 0:if(!(s=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=m(),i=(null==w?void 0:w.location)?w.location.href:"",l=tt,c=e.sampleRate,u=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||l),0===(p=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];a.label=1;case 1:return a.trys.push([1,6,,7]),d={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":i.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(p),method:"POST"},f="".concat(le(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,d)];case 2:if(null===(g=a.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)return[3,3];y="";try{y=JSON.stringify(g.body,null,2)}catch(e){}return this.completeRequest({context:e,success:"".concat(g.status,": ").concat(y)}),[3,5];case 3:return[4,this.handleReponse(g.status,e)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:return v=a.sent(),this.completeRequest({context:e,err:v}),[3,7];case 7:return[2]}var w})})},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:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(t),[3,5];case 2:return[4,this.handleOtherResponse(t)];case 3:return n.sent(),[3,5];case 4:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),n.label=5;case 5: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=e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:Qe}),[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 nt=(e,t)=>t.some(t=>e instanceof t);let st,ot;const it=new WeakMap,at=new WeakMap,lt=new WeakMap;let ct={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return it.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return dt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ut(e){ct=e(ct)}function ht(e){return(ot||(ot=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ft(this),t),dt(this.request)}:function(...t){return dt(e.apply(ft(this),t))}}function pt(e){return"function"==typeof e?ht(e):(e instanceof IDBTransaction&&function(e){if(it.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)});it.set(e,t)}(e),nt(e,st||(st=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,ct):e)}function dt(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(dt(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return lt.set(t,e),t}(e);if(at.has(e))return at.get(e);const t=pt(e);return t!==e&&(at.set(e,t),lt.set(t,e)),t}const ft=e=>lt.get(e);function mt(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=dt(i);return n&&i.addEventListener("upgradeneeded",e=>{n(dt(i.result),e.oldVersion,e.newVersion,dt(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 gt=["get","getKey","getAll","getAllKeys","count"],yt=["put","add","delete","clear"],vt=new Map;function wt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(vt.get(t))return vt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=yt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!gt.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 vt.set(t,o),o}ut(e=>({...e,get:(t,r,n)=>wt(t,r)||e.get(t,r,n),has:(t,r)=>!!wt(t,r)||e.has(t,r)}));const bt=["continue","continuePrimaryKey","advance"],St={},Ct=new WeakMap,xt=new WeakMap,kt={get(e,t){if(!bt.includes(t))return e[t];let r=St[t];return r||(r=St[t]=function(...e){Ct.set(this,xt.get(this)[t](...e))}),r}};async function*Ot(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,kt);for(xt.set(r,t),lt.set(r,ft(t));t;)yield r,t=await(Ct.get(r)||t.continue()),Ct.delete(r)}function Et(e,t){return t===Symbol.asyncIterator&&nt(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&nt(e,[IDBIndex,IDBObjectStore])}ut(e=>({...e,get:(t,r,n)=>Et(t,r)?Ot:e.get(t,r,n),has:(t,r)=>Et(t,r)||e.has(t,r)}));var It,Mt,Rt,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}(),Tt=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)},At="sessionCurrentSequence",Nt="sequencesToSend",Lt=function(e){var t,r;return e.objectStoreNames.contains(At)||(r=e.createObjectStore(At,{keyPath:"sessionId"})),e.objectStoreNames.contains(Nt)||(t=e.createObjectStore(Nt,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},_t=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,mt(e,1,{upgrade:Lt})];case 1:return[2,t.sent()]}})})},Dt=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return i(r,void 0,void 0,function(){var e,t,r,n,s,o;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=i.sent(),i.label=2;case 2:return t?(r=t.value,n=r.sessionId,s=r.events,e.push({events:s,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=i.sent(),[3,2];case 4:return[2,e];case 5:return o=i.sent(),Tt(this.loggerProvider,"".concat(et,": ").concat(o),o),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return i(r,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(At,e)];case 1:return(t=s.sent())?[4,this.db.put(Nt,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(At,{sessionId:e,events:[]})];case 3:return s.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),Tt(this.loggerProvider,"".concat(et,": ").concat(n),n),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return i(r,void 0,void 0,function(){var r,n,s,o,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),[4,(r=this.db.transaction(At,"readwrite")).store.get(e)];case 1:return(n=a.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return a.sent(),[2];case 3:return s=void 0,this.shouldSplitEventsList(n.events,t)?(s=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return a.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:a.sent(),a.label=7;case 7:return[4,r.done];case 8:return a.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(i=a.sent())?[2,{events:s,sessionId:e,sequenceId:i}]:[2,void 0];case 10:return l=a.sent(),Tt(this.loggerProvider,"".concat(et,": ").concat(l),l),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return i(r,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(Nt,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),Tt(this.loggerProvider,"".concat(et,": ").concat(r),r),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return i(r,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(Nt,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),Tt(this.loggerProvider,"".concat(et,": ").concat(e),e),[3,4];case 4:return[2]}})})},r.db=t.db,r}return r(t,e),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,_t(s)];case 1:return i=a.sent(),[2,new t(o(o({},r),{db:i}))];case 2:return l=a.sent(),Tt(r.loggerProvider,"".concat(et,": ").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),Ft=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),Ut=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.type,l=e.payloadBatcher,c=e.storeType;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,u.flush(e)]})})}var u,h,p,d,f,m,g,y,v;return a(this,function(w){switch(w.label){case 0:return u=new rt(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:l})),h=function(){return new Ft({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r})},p=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(o){switch(o.label){case 0:return[4,Dt.new(s,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,apiKey:t.apiKey})];case 1:return(e=o.sent())?[2,e]:(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,h()])}})})},"idb"!==c?[3,2]:[4,p()];case 1:return f=w.sent(),[3,3];case 2:f=h(),w.label=3;case 3:return d=f,m=function(e){var r=e.events,n=e.sessionId,o=e.deviceId,l=e.sequenceId;t.debugMode&&he().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(){}),u.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,d.cleanUpSessionEventsStore(n,l)];case 1:return e.sent(),[2]}})})}})},g=function(e){var r=e.sessionId,n=e.deviceId;d.storeCurrentSequence(r).then(function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},y=function(e){var t=e.deviceId;return i(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return[4,d.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},v=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;d.addEventToCurrentSequence(n,r.data).then(function(e){return e&&m({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:g,addEvent:v,sendStoredEvents:y,flush:e}]}})})},jt=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 Bt(e,t){if(Rt=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};It=o(o({},r),t),Mt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(It.root,r);var n=zt(e,"all",function(){return zt(e,"two",function(){return zt(e,"one",function(){return zt(e,"none")})})});if(n){var s=Xt(Zt(n,e));return s.length>0&&(n=s[0]),$t(n)}throw new Error("Selector was not found.")}function zt(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,h=(new Date).getTime()-Rt.getTime();if(void 0!==It.timeoutMs&&h>It.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var p=Jt(function(e){var t=e.getAttribute("id");if(t&&It.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Jt.apply(void 0,u([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return It.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))||Jt.apply(void 0,u([],c(function(e){var t=Array.from(e.classList).filter(It.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||Jt(function(e){var t=e.tagName.toLowerCase();if(It.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],d=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)d&&(p=p.concat(p.filter(Gt).map(function(e){return Ht(e,d)})));else if("two"==t)p=p.slice(0,1),d&&(p=p.concat(p.filter(Gt).map(function(e){return Ht(e,d)})));else if("one"==t){var f=c(p=p.slice(0,1),1)[0];d&&Gt(f)&&(p=[Ht(f,d)])}else"none"==t&&(p=[{name:"*",penalty:3}],d&&(p=[Ht(p[0],d)]));try{for(var m=(e=void 0,l(p)),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(p),s.length>=It.seedMinLength&&(n=Wt(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=Wt(s,r)),!n&&r?r():n}function Wt(e,t){var r,n,s=Xt(Yt(e));if(s.length>It.threshold)return t?t():null;try{for(var o=l(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(Vt(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 $t(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 qt(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Vt(e){var t=$t(e);switch(Mt.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 Ht(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Gt(e){return"html"!==e.name&&!e.name.startsWith("#")}function Jt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Kt);return r.length>0?r:null}function Kt(e){return null!=e}function Yt(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(Yt(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 Xt(e){return u([],c(e),!1).sort(function(e,t){return qt(e)-qt(t)})}function Zt(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>It.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>It.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),o=$t(s),r.visited.has(o)?[2]:Vt(s)&&function(e,t){return Mt.querySelector($t(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,l(Zt(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Qt=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}},er=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)}},tr=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===ge.Click){var l=m();if(l){var c=l.location,u=l.innerHeight,h=l.innerWidth;if(c){var p=e.x,d=e.y;if(void 0!==p&&void 0!==d){var f,g=o.getNode(e.id);if(g)try{f=Bt(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var y=ue(c.href,i),v={x:p+r.scrollWatcher.currentScrollX,y:d+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 rr(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function nr(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var sr=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=le(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}(),or=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,s,o=e(),i=m();i&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:rr(),viewportWidth:nr(),pageUrl:ue(i.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=nr(),this._maxScrollHeight=rr(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new sr(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=nr();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=rr();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),ir=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))},ar=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,mt(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(),Tt(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(),Tt(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(),Tt(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},lr=new ar,cr=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,p,d;return a(this,function(a){switch(a.label){case 0:return[4,lr.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,lr.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 vn})];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),lr.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return p=a.sent(),d=p,n.warn(d.message),[3,7];case 7:return[2,e]}})})},ur="__amplitude_url_tracking_patched__",hr=new WeakMap;function pr(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?te: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=hr.get(e);if(!u){var h=void 0,p=new Set,d=function(){var t=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&t===h||(h=t,p.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 d(),n};return t[ur]=!0,t},m=e.history;if(null==m?void 0:m.pushState){var g=Reflect.get(m,"pushState");g[ur]||(m.pushState=f(g))}if(null==m?void 0:m.replaceState){var y=Reflect.get(m,"replaceState");y[ur]||(m.replaceState=f(y))}u={callbacks:p,notify:d,onPopStateOrHashChange:function(){return d()},listenersAttached:!1},hr.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 dr(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:te,p=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var d=void 0,f=function(){return r.location&&r.location.href||""},m=function(){var e=f();if(void 0===d||e!==d){d=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=f(),o="";return p&&(o=(null==n?void 0:n.title)||""),{href:c.length>0?ue(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=pr(r,function(){return m()},u?{enablePolling:!0,pollingInterval:h}:{});return m(),function(){return g()}},options:e}}dr();var fr,mr,gr,yr=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.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(){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,p,d,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!==(d=null===(p=t.page)||void 0===p?void 0:p.url)&&void 0!==d?d: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,cr({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!==Y.METADATA?(e={config:pe(s),version:tt},n?[4,he()]:[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 se(new b)}return e.prototype.init=function(e,t){return v(this._init(e,t))},e.prototype.setupUrlChangeListenerForTargeting=function(){var e,t=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var r=m();if(null==r?void 0:r.location){var n=pr(r,function(e){var r=++t.latestUrlChangeTargetingEvaluationId;t.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),t.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(r," for ").concat(e,"."))});this.urlChangeCleanup=function(){n(),t.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,p,d,f;return i(this,void 0,void 0,function(){var i,g,y,v,w,S,C,x,k,O,E,I,M,R,P,T,A,N;return a(this,function(a){switch(a.label){case 0:return null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.loggerProvider=new se(t.loggerProvider||new b),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new ir({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,ve(e,t)];case 1:return i.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:g=a.sent(),y=g.joinedConfig,v=g.localConfig,w=g.remoteConfig,this.config=y,this.setMetadata(t.sessionId,y,v,w,null===(n=t.version)||void 0===n?void 0:n.version,tt,null===(s=t.version)||void 0===s?void 0:s.type),t.sessionId&&(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled)&&(S=or.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[S.send(this.getDeviceId.bind(this)).bind(S)],this.scrollHook=S.hook.bind(S),this.clickHandler=new tr(this.loggerProvider,S)),C=[],"idb"!==(x=this.config.storeType)||(null===(h=m())||void 0===h?void 0:h.indexedDB)||(x="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(x," for event storage.")),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,Ut({config:this.config,type:"replay",storeType:x})];case 4:return k=a.sent(),C.push({name:"replay",manager:k}),[3,6];case 5:return O=a.sent(),R=O,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(R.toString())),[3,6];case 6:if(!(null===(p=this.config.interactionConfig)||void 0===p?void 0:p.enabled))return[3,10];E=this.config.interactionConfig.batch?er:Qt,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,Ut({config:this.config,type:"interaction",minInterval:null!==(d=this.config.interactionConfig.trackEveryNms)&&void 0!==d?d:3e4,maxInterval:6e4,payloadBatcher:E,storeType:x})];case 8:return I=a.sent(),C.push({name:"interaction",manager:I}),[3,10];case 9:return M=a.sent(),R=M,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(R.toString())),[3,10];case 10:return this.eventsManager=new(jt.bind.apply(jt,u([void 0],c(C),!1))),this.eventCompressor&&this.eventCompressor.terminate(),P=void 0,T=m(),this.config.useWebWorker&&T&&T.Worker?[4,Promise.resolve().then(function(){return wn})]:[3,12];case 11:A=a.sent().compressionScript,P=A,a.label=12;case 12:return this.eventCompressor=new Ze(this.eventsManager,this.config,this.getDeviceId(),P),[4,this.initializeNetworkObservers()];case 13:return a.sent(),(null===(f=m())||void 0===f?void 0:f.opener)&&(function(e,t){var r,n=e;if(!0!==n[K]){n[K]=!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.2.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})}}(N=J()),N.setup(o({logger:this.loggerProvider},this.config.serverZone&&{endpoint:q[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 14:return a.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[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 ir({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={})[Z]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[re]=JSON.stringify({appHash:F(t.apiKey).toString()}))),this.addCustomRRWebEvent(Y.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=p),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,n=!1,s="",o=!1;this.config.targetingConfig?this.sessionTargetingMatch?(s="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(s),n=!0,o=!0):(s="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(s),n=!1,o=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=F(e.toString()),31*Math.abs(r)%1e6/1e6<t)?(n=!0,o=!0):(s="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(s),n=!1,o=!1);return this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Y.TARGETING_DECISION,{message:s,sessionId:this.identifiers.sessionId,matched:o,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var s=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t,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=dr({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 La})];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 Pd})];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){var t,r,n,s,o,l,c;return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var i,u,h,p,d,f,m,g,y,v,w,b,S,C=this;return a(this,function(a){switch(a.label){case 0:return i=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,u&&h&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(p=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){C.addCustomRRWebEvent(Y.FETCH_REQUEST,e)}),d=i.privacyConfig,f=i.interactionConfig,m=i.loggingConfig,g=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(s=f.ugcFilterRules)&&void 0!==s?s:[],performanceOptions:null===(o=i.performanceConfig)||void 0===o?void 0:o.interaction})),scroll:this.scrollHook}:{},y=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),v=this,w=p,S={emit:function(e){if(C.shouldOptOut())return C.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),C.stopRecordingEvents(),void C.sendEvents();e.type===me.Meta&&(e.data.href=ue(e.data.href,y)),C.eventCompressor&&C.eventCompressor.enqueueEvent(e,h)},inlineStylesheet:i.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:ne,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:ae("input",d),maskTextFn:ae("text",d),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(l=i.omitElementTags)||void 0===l?void 0:l.script,comment:null===(c=i.omitElementTags)||void 0===c?void 0:c.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return C.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(m)];case 4:return v.recordCancelCallback=w.apply(void 0,[(S.plugins=a.sent(),S)]),this.addCustomRRWebEvent(Y.DEBUG_INFO),e&&this.addCustomRRWebEvent(Y.METADATA,this.metadata),[3,6];case 5:return b=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[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 Ad})];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}(),vr=function(e){return function(){var t=e.config||de();return{logger:t.loggerProvider,logLevel:t.logLevel}}},wr=function(){var e=new yr;return{init:O(e.init.bind(e),"init",vr(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",vr(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",vr(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",vr(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",vr(e)),flush:O(e.flush.bind(e),"flush",vr(e)),shutdown:O(e.shutdown.bind(e),"shutdown",vr(e))}}(),br=wr.init,Sr=wr.setSessionId,Cr=wr.getSessionId,xr=wr.getSessionReplayProperties,kr=wr.flush,Or=wr.shutdown,Er=wr.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"}(fr||(fr={})),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"}(mr||(mr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(gr||(gr={}));const Ir=[fr.SET,fr.SET_ONCE,fr.ADD,fr.APPEND,fr.PREPEND,fr.POSTINSERT],Mr="1.26.0";class Rr{constructor(e){this.name=Rr.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:kr,getSessionId:Cr,getSessionReplayProperties:xr,init:br,setSessionId:Sr,shutdown:Or,evaluateTargetingAndCapture:Er},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 ${Mr}.`),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:Mr},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},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(Ir.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()}}Rr.pluginName="@amplitude/plugin-session-replay-browser";const Pr=e=>new Rr(e);var Tr=function(e,t){return Tr=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])},Tr(e,t)};var Ar=function(){return Ar=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},Ar.apply(this,arguments)};function Nr(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 Lr="is",_r="is not",Dr="contains",Fr="does not contain",Ur="less",jr="less or equal",Br="greater",zr="greater or equal",Wr="version less",$r="version less or equal",qr="version greater",Vr="version greater or equal",Hr="set is",Gr="set is not",Jr="set contains",Kr="set does not contain",Yr="set contains any",Xr="set does not contain any",Zr="regex match",Qr="regex does not match",en=-862048943,tn=461845907,rn=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=an(r,i<<2);o=nn(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,en),c=on(c,15),o^=c=Math.imul(c,tn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,en),c=on(c,15),o^=c=Math.imul(c,tn);break;case 1:c^=r[l],c=Math.imul(c,en),c=on(c,15),o^=c=Math.imul(c,tn)}return sn(o^=n)>>>0},nn=function(e,t){var r=e,n=t;return r=Math.imul(r,en),r=on(r,15),r=Math.imul(r,tn),n=on(n^=r,13),(n=Math.imul(n,5))+-430675100|0},sn=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},on=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},an=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 ln(r)},ln=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},cn=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=Nr(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}},un="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),hn=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(un).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}(),pn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=Nr(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=Nr(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=Ar(Ar(Ar({},t.metadata),a.metadata),s.metadata);s=Ar(Ar({},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=Nr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var p=(o=void 0,Nr(u)),d=p.next();!d.done;d=p.next()){var f=d.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}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=cn(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 rn(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(cn(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=Nr(t.bucket.allocations),p=h.next();!p.done;p=h.next()){var d=p.value,f=d.range[0],m=d.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,Nr(d.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{p&&!p.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 Lr:case Dr:case Ur:case jr:case Br:case zr:case Wr:case $r:case qr:case Vr:case Hr:case Jr:case Yr:return r;case _r:case Fr:case Kr:case Xr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Hr:return this.setEquals(e,r);case Gr:return!this.setEquals(e,r);case Jr:return this.matchesSetContainsAll(e,r);case Kr:return!this.matchesSetContainsAll(e,r);case Yr:return this.matchesSetContainsAny(e,r);case Xr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Lr:return this.matchesIs(e,r);case _r:return!this.matchesIs(e,r);case Dr:return this.matchesContains(e,r);case Fr:return!this.matchesContains(e,r);case Ur:case jr:case Br:case zr:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Wr:case $r:case qr:case Vr:return this.matchesComparable(e,t,r,function(e){return hn.parse(e)},this.versionComparator);case Zr: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=Nr(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 Ur:case Wr:return e<r;case jr:case $r:return e<=r;case Br:case qr:return e>r;case zr:case Vr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Ur:case Wr:return n<0;case jr:case $r:return n<=0;case Br:case qr:return n>0;case zr:case Vr: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 Hr:case Gr:case Jr:case Kr:case Yr:case Xr: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=Nr(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=Nr(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}Tr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var dn,fn=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,mt(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,p,d,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)),p={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(p)];case 2:return a.sent(),[2,h];case 3:return d=a.sent(),l.warn("Failed to store events for targeting ".concat(r,": ").concat(d)),[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]}})})}},mn=new fn,gn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,l=t.userProperties,c=t.deviceId,u=t.page,h=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,mn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,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:o,event:s,event_types:i&&Array.from(i),user:{device_id:c,user_properties:l},page:u},[2,this.evaluationEngine.evaluate(p,[h])]}})})},this.evaluationEngine=new pn},yn=function(){var e=new gn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,vn=Object.freeze({__proto__:null,evaluateTargeting:yn}),wn=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!0)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),bn=Object.defineProperty,Sn=(e,t,r)=>((e,t,r)=>t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Cn=Object.defineProperty,xn=(e,t,r)=>((e,t,r)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),kn=Object.defineProperty,On=(e,t,r)=>((e,t,r)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const En={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},In={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Mn={};function Rn(e){if(Mn[e])return Mn[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 En?En[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 In?In[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 Mn[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?Mn[e]=o:r}catch{return r}}const Pn={};function Tn(e,t,r){var n;const s=`${e}.${String(r)}`;if(Pn[s])return Pn[s].call(t);const o=Rn(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Pn[s]=i,i.call(t)):t[r]}const An={};function Nn(e,t,r){const n=`${e}.${String(r)}`;if(An[n])return An[n].bind(t);const s=Rn(e)[r];return"function"!=typeof s?t[r]:(An[n]=s,s.bind(t))}const Ln={childNodes:function(e){return Tn("Node",e,"childNodes")},parentNode:function(e){return Tn("Node",e,"parentNode")},parentElement:function(e){return Tn("Node",e,"parentElement")},textContent:function(e){return Tn("Node",e,"textContent")},contains:function(e,t){return Nn("Node",e,"contains")(t)},getRootNode:function(e){return Nn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Tn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Tn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Tn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Tn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Rn("MutationObserver").constructor}};class _n{constructor(){On(this,"idNodeMap",new Map),On(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 Dn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Dn(Ln.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Dn(Ln.parentNode(e),t,r)}function Fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Un(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 jn,Bn={exports:{}};function zn(){if(jn)return Bn.exports;jn=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 Bn.exports=t(),Bn.exports.createColors=t,Bn.exports}const Wn=Un(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var $n,qn;function Vn(){if(qn)return $n;qn=1;let e=zn(),t=Wn;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 $n=r,r.default=r,$n}var Hn,Gn,Jn,Kn,Yn,Xn,Zn,Qn,es,ts,rs,ns,ss,os,is,as,ls,cs,us,hs,ps,ds,fs,ms,gs,ys,vs,ws,bs,Ss,Cs,xs,ks,Os,Es,Is,Ms,Rs,Ps,Ts,As,Ns,Ls,_s,Ds,Fs,Us,js,Bs,zs,Ws,$s,qs,Vs={};function Hs(){return Hn||(Hn=1,Vs.isClean=Symbol("isClean"),Vs.my=Symbol("my")),Vs}function Gs(){if(Jn)return Gn;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 Gn=t,t.default=t,Gn}function Js(){if(Yn)return Kn;Yn=1;let e=Gs();function t(t,r){new e(r).stringify(t)}return Kn=t,t.default=t,Kn}function Ks(){if(Zn)return Xn;Zn=1;let{isClean:e,my:t}=Hs(),r=Vn(),n=Gs(),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 Xn=i,i.default=i,Xn}function Ys(){if(es)return Qn;es=1;let e=Ks();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 Xs(){if(rs)return ts;rs=1;return ts={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}},ts}function Zs(){if(ss)return ns;ss=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Wn,{existsSync:r,readFileSync:n}=Wn,{dirname:s,join:o}=Wn;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 ns=i,i.default=i,ns}function Qs(){if(is)return os;is=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Wn,{fileURLToPath:r,pathToFileURL:n}=Wn,{isAbsolute:s,resolve:o}=Wn,{nanoid:i}=Xs(),a=Wn,l=Vn(),c=Zs(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 os=d,d.default=d,a&&a.registerInput&&a.registerInput(d),os}function eo(){if(ls)return as;ls=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Wn,{dirname:r,relative:n,resolve:s,sep:o}=Wn,{pathToFileURL:i}=Wn,a=Qs(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return as=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 to(){if(us)return cs;us=1;let e=Ks();class t extends e{constructor(e){super(e),this.type="comment"}}return cs=t,t.default=t,cs}function ro(){if(ps)return hs;ps=1;let e,t,r,n,{isClean:s,my:o}=Hs(),i=Ys(),a=to(),l=Ks();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},hs=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)})},hs}function no(){if(fs)return ds;fs=1;let e,t,r=ro();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},ds=n,n.default=n,ds}function so(){if(gs)return ms;gs=1;let e={};return ms=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function oo(){if(vs)return ys;vs=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 ys=e,e.default=e,ys}function io(){if(bs)return ws;bs=1;let e=oo();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 ws=t,t.default=t,ws}function ao(){if(ks)return xs;ks=1;let e=ro();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 xs=t,t.default=t,e.registerAtRule(t),xs}function lo(){if(Es)return Os;Es=1;let e,t,r=ro();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},Os=n,n.default=n,r.registerRoot(n),Os}function co(){if(Ms)return Is;Ms=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 Is=e,e.default=e,Is}function uo(){if(Ps)return Rs;Ps=1;let e=ro(),t=co();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 Rs=r,r.default=r,e.registerRule(r),Rs}function ho(){if(As)return Ts;As=1;let e=Ys(),t=function(){if(Cs)return Ss;Cs=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),p=")".charCodeAt(0),d="{".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 Ss=function(x,k={}){let O,E,I,M,R,P,T,A,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===A&&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||k){E=U;break}z("bracket")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k){E=U+1;break}z("string")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k?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=to(),n=ao(),s=lo(),o=uo();const i={empty:!0,space:!0};return Ts=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})}},Ts}function po(){if(Ls)return Ns;Ls=1;let e=ro(),t=ho(),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 Ns=n,n.default=n,e.registerParse(n),Ns}function fo(){if(Ds)return _s;Ds=1;let{isClean:e,my:t}=Hs(),r=eo(),n=Js(),s=ro(),o=no(),i=so(),a=io(),l=po(),c=lo();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},_s=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),_s}function mo(){if(Bs)return js;Bs=1;let e=function(){if(Us)return Fs;Us=1;let e=eo(),t=Js(),r=so(),n=po();const s=io();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 Fs=o,o.default=o,Fs}(),t=fo(),r=no(),n=lo();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 js=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),js}const go=Fn(function(){if(qs)return $s;qs=1;let e=Vn(),t=Ys(),r=fo(),n=ro(),s=mo(),o=Js(),i=function(){if(Ws)return zs;Ws=1;let e=Ys(),t=Zs(),r=to(),n=ao(),s=Qs(),o=lo(),i=uo();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 zs=a,a.default=a,zs}(),a=no(),l=oo(),c=to(),u=ao(),h=io(),p=Qs(),d=po(),f=co(),m=uo(),g=lo(),y=Ks();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),$s=v,v.default=v,$s}());go.stringify,go.fromJSON,go.plugin,go.parse,go.list,go.document,go.comment,go.atRule,go.rule,go.decl,go.root,go.CssSyntaxError,go.Declaration,go.Container,go.Processor,go.Document,go.Comment,go.Warning,go.AtRule,go.Result,go.Input,go.Rule,go.Root,go.Node;var yo=Object.defineProperty,vo=(e,t,r)=>((e,t,r)=>t in e?yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bo(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 So,Co={exports:{}};function xo(){if(So)return Co.exports;So=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 Co.exports=t(),Co.exports.createColors=t,Co.exports}const ko=bo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Oo,Eo;function Io(){if(Eo)return Oo;Eo=1;let e=xo(),t=ko;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 Oo=r,r.default=r,Oo}var Mo,Ro,Po,To,Ao,No,Lo,_o,Do,Fo,Uo,jo,Bo,zo,Wo,$o,qo,Vo,Ho,Go,Jo,Ko,Yo,Xo,Zo,Qo,ei,ti,ri,ni,si,oi,ii,ai,li,ci,ui,hi,pi,di,fi,mi,gi,yi,vi,wi,bi,Si,Ci,xi,ki,Oi,Ei,Ii={};function Mi(){return Mo||(Mo=1,Ii.isClean=Symbol("isClean"),Ii.my=Symbol("my")),Ii}function Ri(){if(Po)return Ro;Po=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 Ro=t,t.default=t,Ro}function Pi(){if(Ao)return To;Ao=1;let e=Ri();function t(t,r){new e(r).stringify(t)}return To=t,t.default=t,To}function Ti(){if(Lo)return No;Lo=1;let{isClean:e,my:t}=Mi(),r=Io(),n=Ri(),s=Pi();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 No=i,i.default=i,No}function Ai(){if(Do)return _o;Do=1;let e=Ti();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 _o=t,t.default=t,_o}function Ni(){if(Uo)return Fo;Uo=1;return Fo={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}},Fo}function Li(){if(Bo)return jo;Bo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ko,{existsSync:r,readFileSync:n}=ko,{dirname:s,join:o}=ko;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 jo=i,i.default=i,jo}function _i(){if(Wo)return zo;Wo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ko,{fileURLToPath:r,pathToFileURL:n}=ko,{isAbsolute:s,resolve:o}=ko,{nanoid:i}=Ni(),a=ko,l=Io(),c=Li(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 zo=d,d.default=d,a&&a.registerInput&&a.registerInput(d),zo}function Di(){if(qo)return $o;qo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ko,{dirname:r,relative:n,resolve:s,sep:o}=ko,{pathToFileURL:i}=ko,a=_i(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return $o=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 Fi(){if(Ho)return Vo;Ho=1;let e=Ti();class t extends e{constructor(e){super(e),this.type="comment"}}return Vo=t,t.default=t,Vo}function Ui(){if(Jo)return Go;Jo=1;let e,t,r,n,{isClean:s,my:o}=Mi(),i=Ai(),a=Fi(),l=Ti();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},Go=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)})},Go}function ji(){if(Yo)return Ko;Yo=1;let e,t,r=Ui();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},Ko=n,n.default=n,Ko}function Bi(){if(Zo)return Xo;Zo=1;let e={};return Xo=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function zi(){if(ei)return Qo;ei=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 Wi(){if(ri)return ti;ri=1;let e=zi();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 ti=t,t.default=t,ti}function $i(){if(ii)return oi;ii=1;let e=Ui();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 oi=t,t.default=t,e.registerAtRule(t),oi}function qi(){if(li)return ai;li=1;let e,t,r=Ui();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},ai=n,n.default=n,r.registerRoot(n),ai}function Vi(){if(ui)return ci;ui=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 ci=e,e.default=e,ci}function Hi(){if(pi)return hi;pi=1;let e=Ui(),t=Vi();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 hi=r,r.default=r,e.registerRule(r),hi}function Gi(){if(fi)return di;fi=1;let e=Ai(),t=function(){if(si)return ni;si=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),p=")".charCodeAt(0),d="{".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 ni=function(x,k={}){let O,E,I,M,R,P,T,A,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===A&&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||k){E=U;break}z("bracket")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k){E=U+1;break}z("string")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k?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=Fi(),n=$i(),s=qi(),o=Hi();const i={empty:!0,space:!0};return di=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})}},di}function Ji(){if(gi)return mi;gi=1;let e=Ui(),t=Gi(),r=_i();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 mi=n,n.default=n,e.registerParse(n),mi}function Ki(){if(vi)return yi;vi=1;let{isClean:e,my:t}=Mi(),r=Di(),n=Pi(),s=Ui(),o=ji(),i=Bi(),a=Wi(),l=Ji(),c=qi();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},yi=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),yi}function Yi(){if(Ci)return Si;Ci=1;let e=function(){if(bi)return wi;bi=1;let e=Di(),t=Pi(),r=Bi(),n=Ji();const s=Wi();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 wi=o,o.default=o,wi}(),t=Ki(),r=ji(),n=qi();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 Si=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Si}const Xi=wo(function(){if(Ei)return Oi;Ei=1;let e=Io(),t=Ai(),r=Ki(),n=Ui(),s=Yi(),o=Pi(),i=function(){if(ki)return xi;ki=1;let e=Ai(),t=Li(),r=Fi(),n=$i(),s=_i(),o=qi(),i=Hi();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 xi=a,a.default=a,xi}(),a=ji(),l=zi(),c=Fi(),u=$i(),h=Wi(),p=_i(),d=Ji(),f=Vi(),m=Hi(),g=qi(),y=Ti();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Oi=v,v.default=v,Oi}());Xi.stringify,Xi.fromJSON,Xi.plugin,Xi.parse,Xi.list,Xi.document,Xi.comment,Xi.atRule,Xi.rule,Xi.decl,Xi.root,Xi.CssSyntaxError,Xi.Declaration,Xi.Container,Xi.Processor,Xi.Document,Xi.Comment,Xi.Warning,Xi.AtRule,Xi.Result,Xi.Input,Xi.Rule,Xi.Root,Xi.Node;class Zi{constructor(...e){vo(this,"parentElement",null),vo(this,"parentNode",null),vo(this,"ownerDocument"),vo(this,"firstChild",null),vo(this,"lastChild",null),vo(this,"previousSibling",null),vo(this,"nextSibling",null),vo(this,"ELEMENT_NODE",1),vo(this,"TEXT_NODE",3),vo(this,"nodeType"),vo(this,"nodeName"),vo(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 Zi))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:[]},ea={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ta={};function ra(e){if(ta[e])return ta[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 ea?ea[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 ta[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?ta[e]=o:r}catch{return r}}const na={};function sa(e,t,r){var n;const s=`${e}.${String(r)}`;if(na[s])return na[s].call(t);const o=ra(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(na[s]=i,i.call(t)):t[r]}const oa={};function ia(e,t,r){const n=`${e}.${String(r)}`;if(oa[n])return oa[n].bind(t);const s=ra(e)[r];return"function"!=typeof s?t[r]:(oa[n]=s,s.bind(t))}const aa={childNodes:function(e){return sa("Node",e,"childNodes")},parentNode:function(e){return sa("Node",e,"parentNode")},parentElement:function(e){return sa("Node",e,"parentElement")},textContent:function(e){return sa("Node",e,"textContent")},contains:function(e,t){return ia("Node",e,"contains")(t)},getRootNode:function(e){return ia("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?sa("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?sa("Element",e,"shadowRoot"):null},querySelector:function(e,t){return sa("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return sa("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ra("MutationObserver").constructor}};const la="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 ca={map:{},getId:()=>(console.error(la),-1),getNode:()=>(console.error(la),null),removeNodeFromMap(){console.error(la)},has:()=>(console.error(la),!1),reset(){console.error(la)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ca=new Proxy(ca,{get:(e,t,r)=>("map"===t&&console.error(la),Reflect.get(e,t,r))}));let ua=Date.now;function ha(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:aa.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ua=()=>(new Date).getTime());function pa(e){var t;let r=null;return"getRootNode"in e&&(null==(t=aa.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&aa.host(aa.getRootNode(e))&&(r=aa.host(aa.getRootNode(e))),r}function da(e){let t,r=e;for(;t=pa(r);)r=t;return r}function fa(e){const t=e.ownerDocument;if(!t)return!1;const r=da(e);return aa.contains(t,r)}const ma=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){xn(this,"id",1),xn(this,"styleIDMap",new WeakMap),xn(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 ca},closestElementOfNode:ha,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:da,getShadowHost:pa,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=aa.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=aa.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 Zi&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(aa.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&&(aa.contains(t,e)||fa(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Ln.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Ln.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=aa.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=ha(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(Dn(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 ua},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:fa,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 ga="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ya="undefined"==typeof Uint8Array?[]:new Uint8Array(256),va=0;va<64;va++)ya[ga.charCodeAt(va)]=va;"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==(dn=e.contentWindow)?void 0:dn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var wa,ba;new _n,(ba=wa||(wa={}))[ba.NotStarted=0]="NotStarted",ba[ba.Running=1]="Running",ba[ba.Stopped=2]="Stopped";class Sa{constructor(e){Sn(this,"fileName"),Sn(this,"functionName"),Sn(this,"lineNumber"),Sn(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 Ca=/(^|@)\S+:\d+/,xa=/^\s*at .*(\S+:\d+|\(native\))/m,ka=/^(eval@)?(\[native code])?$/,Oa={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(xa)?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(xa)},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 Sa({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(ka)},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 Sa({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Sa({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 Sa({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 Sa({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(Ca)&&!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 Sa({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ea(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 Ia(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ma(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ia(e[n])&&Ma(e[n],t-1))return!0;return!1}function Ra(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(Ia(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ia(e)&&Ma(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]=Ea(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 Pa={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 Ta(e,t,r){const n=r?Object.assign({},Pa,r):Pa,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=Oa.parse(s).map(e=>e.toString()),i=[Ra(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=[Ra(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[Ra("Uncaught (in promise)",n.stringifyOptions),Ra(t.reason,n.stringifyOptions)]);const o=Oa.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]?ma.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Oa.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>Ra(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Ra("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const Aa="rrweb/console@1";var Na,La=Object.freeze({__proto__:null,PLUGIN_NAME:Aa,getRecordConsolePlugin:e=>({name:Aa,observer:Ta,options:e})}),_a=Object.defineProperty,Da=(e,t,r)=>((e,t,r)=>t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Fa=Object.defineProperty,Ua=(e,t,r)=>((e,t,r)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ja=(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))(ja||{});const Ba={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},za={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wa={};function $a(e){if(Wa[e])return Wa[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 Ba?Ba[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 za?za[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 Wa[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?Wa[e]=o:r}catch{return r}}const qa={};function Va(e,t,r){var n;const s=`${e}.${String(r)}`;if(qa[s])return qa[s].call(t);const o=$a(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(qa[s]=i,i.call(t)):t[r]}const Ha={};function Ga(e,t,r){const n=`${e}.${String(r)}`;if(Ha[n])return Ha[n].bind(t);const s=$a(e)[r];return"function"!=typeof s?t[r]:(Ha[n]=s,s.bind(t))}const Ja={childNodes:function(e){return Va("Node",e,"childNodes")},parentNode:function(e){return Va("Node",e,"parentNode")},parentElement:function(e){return Va("Node",e,"parentElement")},textContent:function(e){return Va("Node",e,"textContent")},contains:function(e,t){return Ga("Node",e,"contains")(t)},getRootNode:function(e){return Ga("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Va("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Va("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Va("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Va("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return $a("MutationObserver").constructor}};function Ka(e){return e.nodeType===e.ELEMENT_NODE}function Ya(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 Xa(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Za(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=Za(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?ul(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?ul(r,t):r}}class el{constructor(){Ua(this,"idNodeMap",new Map),Ua(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 tl({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&rl(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function rl(e){return e.toLowerCase()}const nl="__rrweb_original__";function sl(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?rl(t):null}function ol(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 il=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,al=/^(?:[a-z+]+:)?\/\//i,ll=/^www\..*/i,cl=/^(data:)([^,]*),(.*)/i;function ul(e,t){return(e||"").replace(il,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(al.test(a)||ll.test(a))return`url(${l}${a}${l})`;if(cl.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 hl(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function pl(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=hl(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=hl(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),p=t.split(h),d=-1;if(2===p.length)d=p[0].length;else if(p.length>2&&""===p[0]&&""!==n[a-1].textContent)d=t.indexOf(h,1);else if(1===p.length){if(h=h.substring(0,h.length-1),p=t.split(h),p.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(d=t.indexOf(h));if(p.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=hl(e).length;d=t.indexOf(h,r)}-1===d&&(d=p[0].length)}if(-1!==d){let a=Math.floor(d/i);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;const l=hl(e.substring(0,a),r);if(l.length===d){s.push(e.substring(0,a)),e=e.substring(a),t=t.substring(d);break}l.length<d?a+=Math.max(1,Math.floor((d-l.length)/i)):a-=Math.max(1,Math.floor((l.length-d)*i))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const dl="lightgrey";let fl=1;const ml=new RegExp("[^a-z0-9-_:]");function gl(){return fl++}let yl,vl;const wl=/^[^ \t\n\r\u000c]+/,bl=/^[, \t\n\r\u000c]+/;const Sl=new WeakMap;function Cl(e,t){return t&&""!==t.trim()?kl(e,t):t}function xl(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function kl(e,t){let r=Sl.get(e);if(r||(r=e.createElement("a"),Sl.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ol(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Cl(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(bl),!(r>=t.length);){let o=n(wl);if(","===o.slice(-1))o=Cl(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=Cl(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?ul(n,kl(e)):"object"===t&&"data"===r?Cl(e,n):n:Cl(e,n):n}function El(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Il(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Il(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&&Il(Ja.parentNode(e),t,r)}function Ml(e,t,r,n){let s;if(Ka(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(Il(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 Rl(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1,applyBackgroundColorToBlockedElements:y=!1}=t,v=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:ja.Document,childNodes:[],compatMode:e.compatMode}:{type:ja.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ja.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:d,applyBackgroundColorToBlockedElements:f=!1}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=rl(e.tagName);return ml.test(t)?"div":t}(e);let y={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];El(g,n.name,n.value)||(y[n.name]=Ol(r,g,rl(n.name),n.value))}if("link"===g&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Za(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===g&&e.sheet){let t=Za(e.sheet);t&&(e.childNodes.length>1&&(t=pl(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=tl({element:e,type:sl(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:a}):r&&(y.checked=r)}"option"===g&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const s=t.getImageData,o=nl in s?s[nl]: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)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(y.rr_dataURL=t)}if("img"===g&&c){yl||(yl=r.createElement("canvas"),vl=yl.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{yl.width=t.naturalWidth,yl.height=t.naturalHeight,vl.drawImage(t,0,0),y.rr_dataURL=yl.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?y.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=y;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&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:dl}:{}}}"iframe"!==g||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(g)&&(w=!0)}catch(e){}return{type:ja.Element,tagName:g,attributes:y,childNodes:[],isSVG:xl(e)||void 0,needBlock:m,rootId:d,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m,rootId:v,applyBackgroundColorToBlockedElements:y});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=ul(l,kl(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Ja.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:ja.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:ja.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:ja.Comment,textContent:Ja.textContent(e)||"",rootId:v};default:return!1}}function Pl(e){return null==e?"":e.toLowerCase()}function Tl(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:p,slimDOMOptions:d,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:x=!1,cssCaptured:k=!1,applyBackgroundColorToBlockedElements:O=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=Ml(e,i,a,void 0===E)}const M=Rl(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:E,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:x,cssCaptured:k,applyBackgroundColorToBlockedElements:O});if(!M)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===ja.Comment)return!0;if(e.type===ja.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"===ol(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Pl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Pl(e.attributes.name)||"icon"===Pl(e.attributes.rel)||"apple-touch-icon"===Pl(e.attributes.rel)||"shortcut icon"===Pl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Pl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Pl(e.attributes.property).match(/^(og|twitter|fb):/)||Pl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Pl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Pl(e.attributes.name)||"googlebot"===Pl(e.attributes.name)||"bingbot"===Pl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Pl(e.attributes.name)||"generator"===Pl(e.attributes.name)||"framework"===Pl(e.attributes.name)||"publisher"===Pl(e.attributes.name)||"progid"===Pl(e.attributes.name)||Pl(e.attributes.property).match(/^article:/)||Pl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Pl(e.attributes.name)||"yandex-verification"===Pl(e.attributes.name)||"csrf-token"===Pl(e.attributes.name)||"p:domain_verify"===Pl(e.attributes.name)||"verify-v1"===Pl(e.attributes.name)||"verification"===Pl(e.attributes.name)||"shopify-checkout-api-token"===Pl(e.attributes.name)))return!0}}return!1}(M,d)||!I&&M.type===ja.Text&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?-2:gl();const P=Object.assign(M,{id:R});if(n.add(e,P),-2===R)return null;y&&y(e);let T=!l;if(P.type===ja.Element){T=T&&!P.needBlock,delete P.needBlock;const t=Ja.shadowRoot(e);t&&Xa(t)&&(P.isShadowHost=!0)}if((P.type===ja.Document||P.type===ja.Element)&&T){d.headWhitespace&&P.type===ja.Element&&"head"===P.tagName&&(I=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:E,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:O};if(P.type===ja.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else{P.type===ja.Element&&void 0!==P.attributes._cssText&&"string"==typeof P.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Ja.childNodes(e))){const e=Tl(r,t);e&&P.childNodes.push(e)}}let x=null;if(Ka(e)&&(x=Ja.shadowRoot(e)))for(const e of Array.from(Ja.childNodes(x))){const r=Tl(e,t);r&&(Xa(x)&&(r.isShadow=!0),P.childNodes.push(r))}}const A=Ja.parentNode(e);return A&&Ya(A)&&Xa(A)&&(P.isShadow=!0),P.type===ja.Element&&"iframe"===P.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&&v){const r=Tl(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:E,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}},w),P.type===ja.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===ol(P.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}(e,()=>{if(b){const t=Tl(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:E,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),P}function Al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nl(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 Ll,_l={exports:{}};function Dl(){if(Ll)return _l.exports;Ll=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 _l.exports=t(),_l.exports.createColors=t,_l.exports}const Fl=Nl(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ul,jl;function Bl(){if(jl)return Ul;jl=1;let e=Dl(),t=Fl;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 Ul=r,r.default=r,Ul}var zl,Wl,$l,ql,Vl,Hl,Gl,Jl,Kl,Yl,Xl,Zl,Ql,ec,tc,rc,nc,sc,oc,ic,ac,lc,cc,uc,hc,pc,dc,fc,mc,gc,yc,vc,wc,bc,Sc,Cc,xc,kc,Oc,Ec,Ic,Mc,Rc,Pc,Tc,Ac,Nc,Lc,_c,Dc,Fc,Uc,jc,Bc={};function zc(){return zl||(zl=1,Bc.isClean=Symbol("isClean"),Bc.my=Symbol("my")),Bc}function Wc(){if($l)return Wl;$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 Wl=t,t.default=t,Wl}function $c(){if(Vl)return ql;Vl=1;let e=Wc();function t(t,r){new e(r).stringify(t)}return ql=t,t.default=t,ql}function qc(){if(Gl)return Hl;Gl=1;let{isClean:e,my:t}=zc(),r=Bl(),n=Wc(),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 Hl=i,i.default=i,Hl}function Vc(){if(Kl)return Jl;Kl=1;let e=qc();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 Hc(){if(Xl)return Yl;Xl=1;return Yl={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}},Yl}function Gc(){if(Ql)return Zl;Ql=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fl,{existsSync:r,readFileSync:n}=Fl,{dirname:s,join:o}=Fl;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 Zl=i,i.default=i,Zl}function Jc(){if(tc)return ec;tc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fl,{fileURLToPath:r,pathToFileURL:n}=Fl,{isAbsolute:s,resolve:o}=Fl,{nanoid:i}=Hc(),a=Fl,l=Bl(),c=Gc(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 ec=d,d.default=d,a&&a.registerInput&&a.registerInput(d),ec}function Kc(){if(nc)return rc;nc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fl,{dirname:r,relative:n,resolve:s,sep:o}=Fl,{pathToFileURL:i}=Fl,a=Jc(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return rc=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}},rc}function Yc(){if(oc)return sc;oc=1;let e=qc();class t extends e{constructor(e){super(e),this.type="comment"}}return sc=t,t.default=t,sc}function Xc(){if(ac)return ic;ac=1;let e,t,r,n,{isClean:s,my:o}=zc(),i=Vc(),a=Yc(),l=qc();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},ic=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)})},ic}function Zc(){if(cc)return lc;cc=1;let e,t,r=Xc();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},lc=n,n.default=n,lc}function Qc(){if(hc)return uc;hc=1;let e={};return uc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function eu(){if(dc)return pc;dc=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 pc=e,e.default=e,pc}function tu(){if(mc)return fc;mc=1;let e=eu();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 fc=t,t.default=t,fc}function ru(){if(wc)return vc;wc=1;let e=Xc();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 vc=t,t.default=t,e.registerAtRule(t),vc}function nu(){if(Sc)return bc;Sc=1;let e,t,r=Xc();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},bc=n,n.default=n,r.registerRoot(n),bc}function su(){if(xc)return Cc;xc=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 Cc=e,e.default=e,Cc}function ou(){if(Oc)return kc;Oc=1;let e=Xc(),t=su();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 kc=r,r.default=r,e.registerRule(r),kc}function iu(){if(Ic)return Ec;Ic=1;let e=Vc(),t=function(){if(yc)return gc;yc=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),p=")".charCodeAt(0),d="{".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 gc=function(x,k={}){let O,E,I,M,R,P,T,A,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===A&&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||k){E=U;break}z("bracket")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k){E=U+1;break}z("string")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k?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=Yc(),n=ru(),s=nu(),o=ou();const i={empty:!0,space:!0};return Ec=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})}},Ec}function au(){if(Rc)return Mc;Rc=1;let e=Xc(),t=iu(),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 Mc=n,n.default=n,e.registerParse(n),Mc}function lu(){if(Tc)return Pc;Tc=1;let{isClean:e,my:t}=zc(),r=Kc(),n=$c(),s=Xc(),o=Zc(),i=Qc(),a=tu(),l=au(),c=nu();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},Pc=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Pc}function cu(){if(_c)return Lc;_c=1;let e=function(){if(Nc)return Ac;Nc=1;let e=Kc(),t=$c(),r=Qc(),n=au();const s=tu();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 Ac=o,o.default=o,Ac}(),t=lu(),r=Zc(),n=nu();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 Lc=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Lc}var uu=function(){if(jc)return Uc;jc=1;let e=Bl(),t=Vc(),r=lu(),n=Xc(),s=cu(),o=$c(),i=function(){if(Fc)return Dc;Fc=1;let e=Vc(),t=Gc(),r=Yc(),n=ru(),s=Jc(),o=nu(),i=ou();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 Dc=a,a.default=a,Dc}(),a=Zc(),l=eu(),c=Yc(),u=ru(),h=tu(),p=Jc(),d=au(),f=su(),m=ou(),g=nu(),y=qc();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Uc=v,v.default=v,Uc}();const hu=Al(uu);hu.stringify,hu.fromJSON,hu.plugin,hu.parse,hu.list,hu.document,hu.comment,hu.atRule,hu.rule,hu.decl,hu.root,hu.CssSyntaxError,hu.Declaration,hu.Container,hu.Processor,hu.Document,hu.Comment,hu.Warning,hu.AtRule,hu.Result,hu.Input,hu.Rule,hu.Root,hu.Node;var pu=Object.defineProperty,du=(e,t,r)=>((e,t,r)=>t in e?pu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function fu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mu(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 gu,yu={exports:{}};function vu(){if(gu)return yu.exports;gu=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 yu.exports=t(),yu.exports.createColors=t,yu.exports}const wu=mu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var bu,Su;function Cu(){if(Su)return bu;Su=1;let e=vu(),t=wu;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 bu=r,r.default=r,bu}var xu,ku,Ou,Eu,Iu,Mu,Ru,Pu,Tu,Au,Nu,Lu,_u,Du,Fu,Uu,ju,Bu,zu,Wu,$u,qu,Vu,Hu,Gu,Ju,Ku,Yu,Xu,Zu,Qu,eh,th,rh,nh,sh,oh,ih,ah,lh,ch,uh,hh,ph,dh,fh,mh,gh,yh,vh,wh,bh,Sh,Ch={};function xh(){return xu||(xu=1,Ch.isClean=Symbol("isClean"),Ch.my=Symbol("my")),Ch}function kh(){if(Ou)return ku;Ou=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 ku=t,t.default=t,ku}function Oh(){if(Iu)return Eu;Iu=1;let e=kh();function t(t,r){new e(r).stringify(t)}return Eu=t,t.default=t,Eu}function Eh(){if(Ru)return Mu;Ru=1;let{isClean:e,my:t}=xh(),r=Cu(),n=kh(),s=Oh();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 Mu=i,i.default=i,Mu}function Ih(){if(Tu)return Pu;Tu=1;let e=Eh();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 Pu=t,t.default=t,Pu}function Mh(){if(Nu)return Au;Nu=1;return Au={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}},Au}function Rh(){if(_u)return Lu;_u=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=wu,{existsSync:r,readFileSync:n}=wu,{dirname:s,join:o}=wu;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 Lu=i,i.default=i,Lu}function Ph(){if(Fu)return Du;Fu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=wu,{fileURLToPath:r,pathToFileURL:n}=wu,{isAbsolute:s,resolve:o}=wu,{nanoid:i}=Mh(),a=wu,l=Cu(),c=Rh(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 Du=d,d.default=d,a&&a.registerInput&&a.registerInput(d),Du}function Th(){if(ju)return Uu;ju=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=wu,{dirname:r,relative:n,resolve:s,sep:o}=wu,{pathToFileURL:i}=wu,a=Ph(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Uu=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}},Uu}function Ah(){if(zu)return Bu;zu=1;let e=Eh();class t extends e{constructor(e){super(e),this.type="comment"}}return Bu=t,t.default=t,Bu}function Nh(){if($u)return Wu;$u=1;let e,t,r,n,{isClean:s,my:o}=xh(),i=Ih(),a=Ah(),l=Eh();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},Wu=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)})},Wu}function Lh(){if(Vu)return qu;Vu=1;let e,t,r=Nh();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},qu=n,n.default=n,qu}function _h(){if(Gu)return Hu;Gu=1;let e={};return Hu=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Dh(){if(Ku)return Ju;Ku=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 Fh(){if(Xu)return Yu;Xu=1;let e=Dh();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 Yu=t,t.default=t,Yu}function Uh(){if(th)return eh;th=1;let e=Nh();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 eh=t,t.default=t,e.registerAtRule(t),eh}function jh(){if(nh)return rh;nh=1;let e,t,r=Nh();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},rh=n,n.default=n,r.registerRoot(n),rh}function Bh(){if(oh)return sh;oh=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 sh=e,e.default=e,sh}function zh(){if(ah)return ih;ah=1;let e=Nh(),t=Bh();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 ih=r,r.default=r,e.registerRule(r),ih}function Wh(){if(ch)return lh;ch=1;let e=Ih(),t=function(){if(Qu)return Zu;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),p=")".charCodeAt(0),d="{".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 Zu=function(x,k={}){let O,E,I,M,R,P,T,A,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{let e=String.fromCharCode(O);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",N=_.charCodeAt(U+1),"url"===A&&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||k){E=U;break}z("bracket")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k){E=U+1;break}z("string")}for(T=E;_.charCodeAt(T-1)===r;)T-=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||k?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=Ah(),n=Uh(),s=jh(),o=zh();const i={empty:!0,space:!0};return lh=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})}},lh}function $h(){if(hh)return uh;hh=1;let e=Nh(),t=Wh(),r=Ph();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 uh=n,n.default=n,e.registerParse(n),uh}function qh(){if(dh)return ph;dh=1;let{isClean:e,my:t}=xh(),r=Th(),n=Oh(),s=Nh(),o=Lh(),i=_h(),a=Fh(),l=$h(),c=jh();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},ph=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),ph}function Vh(){if(yh)return gh;yh=1;let e=function(){if(mh)return fh;mh=1;let e=Th(),t=Oh(),r=_h(),n=$h();const s=Fh();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 fh=o,o.default=o,fh}(),t=qh(),r=Lh(),n=jh();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 gh=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),gh}var Hh=function(){if(Sh)return bh;Sh=1;let e=Cu(),t=Ih(),r=qh(),n=Nh(),s=Vh(),o=Oh(),i=function(){if(wh)return vh;wh=1;let e=Ih(),t=Rh(),r=Ah(),n=Uh(),s=Ph(),o=jh(),i=zh();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 vh=a,a.default=a,vh}(),a=Lh(),l=Dh(),c=Ah(),u=Uh(),h=Fh(),p=Ph(),d=$h(),f=Bh(),m=zh(),g=jh(),y=Eh();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),bh=v,v.default=v,bh}();const Gh=fu(Hh);Gh.stringify,Gh.fromJSON,Gh.plugin,Gh.parse,Gh.list,Gh.document,Gh.comment,Gh.atRule,Gh.rule,Gh.decl,Gh.root,Gh.CssSyntaxError,Gh.Declaration,Gh.Container,Gh.Processor,Gh.Document,Gh.Comment,Gh.Warning,Gh.AtRule,Gh.Result,Gh.Input,Gh.Rule,Gh.Root,Gh.Node;class Jh{constructor(...e){du(this,"parentElement",null),du(this,"parentNode",null),du(this,"ownerDocument"),du(this,"firstChild",null),du(this,"lastChild",null),du(this,"previousSibling",null),du(this,"nextSibling",null),du(this,"ELEMENT_NODE",1),du(this,"TEXT_NODE",3),du(this,"nodeType"),du(this,"nodeName"),du(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 Kh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xh={};function Zh(e){if(Xh[e])return Xh[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 Kh?Kh[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 Yh?Yh[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 Xh[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?Xh[e]=o:r}catch{return r}}const Qh={};function ep(e,t,r){var n;const s=`${e}.${String(r)}`;if(Qh[s])return Qh[s].call(t);const o=Zh(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Qh[s]=i,i.call(t)):t[r]}const tp={};function rp(e,t,r){const n=`${e}.${String(r)}`;if(tp[n])return tp[n].bind(t);const s=Zh(e)[r];return"function"!=typeof s?t[r]:(tp[n]=s,s.bind(t))}function np(){return Zh("MutationObserver").constructor}const sp={childNodes:function(e){return ep("Node",e,"childNodes")},parentNode:function(e){return ep("Node",e,"parentNode")},parentElement:function(e){return ep("Node",e,"parentElement")},textContent:function(e){return ep("Node",e,"textContent")},contains:function(e,t){return rp("Node",e,"contains")(t)},getRootNode:function(e){return rp("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ep("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ep("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ep("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ep("Element",e,"querySelectorAll")(t)},mutationObserver:np};function op(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const ip="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 ap={map:{},getId:()=>(console.error(ip),-1),getNode:()=>(console.error(ip),null),removeNodeFromMap(){console.error(ip)},has:()=>(console.error(ip),!1),reset(){console.error(ip)}};function lp(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 cp(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)}}),()=>cp(e,t,o||{},!0)}function up(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&&(ap=new Proxy(ap,{get:(e,t,r)=>("map"===t&&console.error(ip),Reflect.get(e,t,r))}));let hp=Date.now;function pp(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=sp.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=sp.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function dp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function fp(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mp(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:sp.parentElement(e)}function gp(e,t,r,n){if(!e)return!1;const s=mp(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(Il(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 yp(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function vp(e,t){if(Ya(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=sp.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||vp(n,t))}function wp(e){return Boolean(e.changedTouches)}function bp(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Sp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Cp(e){return!!e&&(e instanceof Jh&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(sp.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(hp=()=>(new Date).getTime());class xp{constructor(){Da(this,"id",1),Da(this,"styleIDMap",new WeakMap),Da(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 kp(e){var t;let r=null;return"getRootNode"in e&&(null==(t=sp.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&sp.host(sp.getRootNode(e))&&(r=sp.host(sp.getRootNode(e))),r}function Op(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=kp(r);)r=t;return r}(e);return sp.contains(t,r)}function Ep(e){const t=e.ownerDocument;return!!t&&(sp.contains(t,e)||Op(e))}var Ip=(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))(Ip||{}),Mp=(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))(Mp||{}),Rp=(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))(Rp||{}),Pp=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pp||{}),Tp=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Tp||{}),Ap=(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))(Ap||{}),Np=(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))(Np||{});function Lp(e){return"__ln"in e}class _p{constructor(){Da(this,"length",0),Da(this,"head",null),Da(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&&Lp(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&&Lp(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 Dp=(e,t)=>`${e}@${t}`;class Fp{constructor(){Da(this,"frozen",!1),Da(this,"locked",!1),Da(this,"texts",[]),Da(this,"attributes",[]),Da(this,"attributeMap",new WeakMap),Da(this,"removes",[]),Da(this,"mapRemoves",[]),Da(this,"movedMap",{}),Da(this,"addedSet",new Set),Da(this,"movedSet",new Set),Da(this,"droppedSet",new Set),Da(this,"removesSubTreeCache",new Set),Da(this,"mutationCb"),Da(this,"blockClass"),Da(this,"blockSelector"),Da(this,"maskTextClass"),Da(this,"maskTextSelector"),Da(this,"inlineStylesheet"),Da(this,"maskInputOptions"),Da(this,"maskTextFn"),Da(this,"maskInputFn"),Da(this,"keepIframeSrcFn"),Da(this,"recordCanvas"),Da(this,"inlineImages"),Da(this,"slimDOMOptions"),Da(this,"dataURLOptions"),Da(this,"doc"),Da(this,"mirror"),Da(this,"iframeManager"),Da(this,"stylesheetManager"),Da(this,"shadowDomManager"),Da(this,"canvasManager"),Da(this,"processedNodeManager"),Da(this,"unattachedDoc"),Da(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Da(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new _p,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=sp.parentNode(s);if(!o||!Ep(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=Ya(o)?this.mirror.getId(kp(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Tl(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=>{bp(e,this.mirror)&&this.iframeManager.addIframe(e),Sp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Cp(s)&&this.shadowDomManager.addShadowRoot(sp.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)jp(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(sp.parentNode(e))||s(e);for(const e of this.addedSet)Bp(this.droppedSet,e)||jp(this.removesSubTreeCache,e,this.mirror)?Bp(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(sp.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(sp.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=sp.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=sp.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=sp.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))}),Da(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(sp.childNodes(e),e=>sp.textContent(e)||"").join("");t.attributes.value=tl({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:sl(e),value:r,maskInputFn:this.maskInputFn})}),Da(this,"processMutation",e=>{if(!yp(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=sp.textContent(e.target);gp(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Ml(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,mp(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=sl(t);n=tl({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(gp(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"),!El(t.tagName,r))if(s.attributes[r]=Ol(this.doc,rl(t.tagName),rl(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===o?n:[n,o]:s._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":if(gp(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=Ya(e.target)?this.mirror.getId(sp.host(e.target)):this.mirror.getId(e.target);gp(e.target,this.blockClass,this.blockSelector,!1)||yp(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Up(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||vp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Dp(r,n)]?Up(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Ya(e.target)||!Xa(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),sp.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Da(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(yp(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[Dp(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);gp(e,this.blockClass,this.blockSelector,!1)||(sp.childNodes(e).forEach(e=>this.genAdds(e)),Cp(e)&&sp.childNodes(sp.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Up(e,t){e.delete(t),sp.childNodes(t).forEach(t=>Up(e,t))}function jp(e,t,r){return 0!==e.size&&function(e,t){const r=sp.parentNode(t);return!!r&&e.has(r)}(e,t)}function Bp(e,t){return 0!==e.size&&zp(e,t)}function zp(e,t){const r=sp.parentNode(t);return!!r&&(!!e.has(r)||zp(e,r))}let Wp;const $p=e=>{if(!Wp)return e;return(...t)=>{try{return e(...t)}catch(e){if(Wp&&!0===Wp(e))return;throw e}}};function qp(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Vp=[];function Hp(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 Gp(e,t){const r=new Fp;Vp.push(r),r.init(e);const n=new(np())($p(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Jp({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(Rp).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=rl(o);const c=(t=>o=>{const i=Hp(o);if(gp(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Pp.Mouse;break;case"touch":a=Pp.Touch;break;case"pen":a=Pp.Pen}a===Pp.Touch?Rp[t]===Rp.MouseDown?c="TouchStart":Rp[t]===Rp.MouseUp&&(c="TouchEnd"):Pp.Pen}else wp(o)&&(a=Pp.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Pp.Touch||c.startsWith("Mouse")&&a===Pp.Mouse)&&(a=null)):Rp[t]===Rp.Click&&(a=l,l=null);const u=wp(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:p,clientY:d}=u;$p(e)({type:Rp[c],id:h,x:p,y:d,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Rp[o]){case Rp.MouseDown:case Rp.MouseUp:i=i.replace("mouse","pointer");break;case Rp.TouchStart:case Rp.TouchEnd:return}a.push(op(i,c,t))}),$p(()=>{a.forEach(e=>e())})}function Kp({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=$p(lp($p(o=>{const i=Hp(o);if(!i||gp(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=pp(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 op("scroll",i,t)}const Yp=["INPUT","TEXTAREA","SELECT"],Xp=new WeakMap;function Zp(e){return function(e,t){if(rd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||rd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||rd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||rd("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 Qp(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function ed({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(sp.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}}),$p(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function td(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:p,selectionCb:d,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),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Gp(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=lp($p(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=$p(lp($p(e=>{const t=Hp(e),{clientX:r,clientY:s}=wp(e)?e.changedTouches[0]:e;i||(i=hp()),a.push({x:r,y:s,id:n.getId(t),timeOffset:hp()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Mp.Drag:e instanceof MouseEvent?Mp.MouseMove:Mp.TouchMove)}),s,{trailing:!1})),u=[op("mousemove",c,r),op("touchmove",c,r),op("drag",c,r)];return $p(()=>{u.forEach(e=>e())})}(e),o=Jp(e),i=Kp(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return op("resize",$p(lp($p(()=>{const t=dp(),s=fp();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=Hp(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=sp.parentElement(r)),!r||!h||Yp.indexOf(h)<0||gp(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let d=r.value,f=!1;const m=sl(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(d=tl({element:r,maskInputOptions:a,tagName:h,type:m,value:d,maskInputFn:l})),p(r,u?{text:d,isChecked:f,userTriggered:c}:{text:d,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;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,n){const s=Xp.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Xp.set(t,n);const s=r.getId(t);$p(e)({...n,id:s})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>op(e,$p(h),t)),f=t.defaultView;if(!f)return()=>{d.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&&d.push(...g.map(e=>cp(e[0],e[1],{set(){$p(h)({target:this,isTrusted:!1})}},!1,f))),$p(()=>{d.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=$p(o=>lp($p(s=>{const i=Hp(s);if(!i||gp(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=[op("play",i(Ap.Play),o),op("pause",i(Ap.Pause),o),op("seeked",i(Ap.Seeked),o),op("volumechange",i(Ap.VolumeChange),o),op("ratechange",i(Ap.RateChange),o)];return $p(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},p=()=>{},d=()=>{};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:$p((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Qp(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),qp(()=>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:$p((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Qp(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),qp(()=>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:$p((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Qp(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:$p((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Qp(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};nd("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(nd("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),nd("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),nd("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:$p((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Qp(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Zp(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:$p((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Qp(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Zp(s),i]}]}),n.apply(s,o)})})}),$p(()=>{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=ed(e,e.doc),p=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:$p((s,i,a)=>{var l;const[c,u,h]=a;if(r.has(c))return o.apply(i,[c,u,h]);const{id:p,styleId:d}=Qp(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(p&&-1!==p||d&&-1!==d)&&e({id:p,styleId:d,set:{property:c,value:u,priority:h},index:Zp(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:$p((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=Qp(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:Zp(o.parentRule)}),s.apply(o,a)})}),$p(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(d=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=up(t.fonts,"add",function(t){return function(r){return setTimeout($p(()=>{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),$p(()=>{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=$p(()=>{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;gp(i,n,s,!0)||gp(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),op("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?up(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 $p(()=>{Vp.forEach(e=>e.reset()),null==n||n.disconnect(),s(),o(),i(),a(),l(),c(),u(),h(),p(),d(),f(),m(),g.forEach(e=>e())})}function rd(e){return void 0!==window[e]}function nd(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class sd{constructor(e){Da(this,"iframeIdToRemoteIdMap",new WeakMap),Da(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 od{constructor(e){Da(this,"iframes",new WeakMap),Da(this,"crossOriginIframeMap",new WeakMap),Da(this,"crossOriginIframeMirror",new sd(gl)),Da(this,"crossOriginIframeStyleMirror"),Da(this,"crossOriginIframeRootIdMap",new WeakMap),Da(this,"mirror"),Da(this,"mutationCb"),Da(this,"wrappedEmit"),Da(this,"loadListener"),Da(this,"stylesheetManager"),Da(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new sd(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 Ip.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:Ip.IncrementalSnapshot,data:{source:Mp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ip.Meta:case Ip.Load:case Ip.DomContentLoaded:return!1;case Ip.Plugin:return t;case Ip.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ip.IncrementalSnapshot:switch(t.data.source){case Mp.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 Mp.Drag:case Mp.TouchMove:case Mp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Mp.ViewportResize:return!1;case Mp.MediaInteraction:case Mp.MouseInteraction:case Mp.Scroll:case Mp.CanvasMutation:case Mp.Input:return this.replaceIds(t.data,e,["id"]),t;case Mp.StyleSheetRule:case Mp.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Mp.Font:return t;case Mp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Mp.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===Np.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class id{constructor(e){Da(this,"shadowDoms",new WeakSet),Da(this,"mutationCb"),Da(this,"scrollCb"),Da(this,"bypassOptions"),Da(this,"mirror"),Da(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(!Xa(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Gp({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Kp({...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(sp.host(e))),this.restoreHandlers.push(ed({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(up(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=sp.shadowRoot(this);return o&&Ep(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ad="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ld="undefined"==typeof Uint8Array?[]:new Uint8Array(256),cd=0;cd<64;cd++)ld[ad.charCodeAt(cd)]=cd;const ud=new Map;const hd=(e,t,r)=>{if(!e||!fd(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=ud.get(e);return r||(r=new Map,ud.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 pd(e,t,r){if(e instanceof Array)return e.map(e=>pd(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+=ad[r[t]>>2],s+=ad[(3&r[t])<<4|r[t+1]>>4],s+=ad[(15&r[t+1])<<2|r[t+2]>>6],s+=ad[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:[pd(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:[pd(e.data,t,r),e.width,e.height]}}if(fd(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:hd(e,t,r)}}return e}const dd=(e,t,r)=>e.map(e=>pd(e,t,r)),fd=(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 md(e,t,r,n){const s=[];try{const o=up(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!gp(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 gd(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=up(e,l,function(e){return function(...i){const a=e.apply(this,i);if(hd(a,o,this),"tagName"in this.canvas&&!gp(this.canvas,n,s,!0)){const e=dd(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=cp(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const yd='(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',vd="undefined"!=typeof self&&self.Blob&&new Blob([yd],{type:"text/javascript;charset=utf-8"});function wd(e){let t;try{if(t=vd&&(self.URL||self.webkitURL).createObjectURL(vd),!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(yd),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class bd{constructor(e){Da(this,"pendingCanvasMutations",new Map),Da(this,"rafStamps",{latestId:0,invokeId:null}),Da(this,"mirror"),Da(this,"mutationCb"),Da(this,"resetObservers"),Da(this,"frozen",!1),Da(this,"locked",!1),Da(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=md(t,r,n,!0),i=new Map,a=new wd;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:Tp["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=>{gp(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=md(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=up(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return gp(this.canvas,r,n,!0)||setTimeout(()=>{const r=dd(o,t,this);e(this.canvas,{type:Tp["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=cp(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Tp["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(...gd(t.WebGLRenderingContext.prototype,Tp.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...gd(t.WebGL2RenderingContext.prototype,Tp.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 Sd{constructor(e){Da(this,"trackedLinkElements",new WeakSet),Da(this,"mutationCb"),Da(this,"adoptedStyleSheetCb"),Da(this,"styleMirror",new xp),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 Cd{constructor(){Da(this,"nodeMap",new WeakMap),Da(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 xd,kd,Od,Ed=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Na=e.contentWindow)?void 0:Na.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Id=new el;function Md(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:p,slimDOMOptions:d,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:v={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:x=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:I=!1,plugins:M,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:T,applyBackgroundColorToBlockedElements:A=!1}=e;Wp=T;const N=!x||window.parent===window;let L=!1;if(!N)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!L)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),Id.reset();const _=!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!==p?p:{password:!0},D=!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===d,headMetaDescKeywords:"all"===d,headTitleMutations:"all"===d}:d||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const j=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!L&&(e=y(e)),e};xd=(e,s)=>{var o;const i=e;if(i.timestamp=hp(),!(null==(o=Vp[0])?void 0:o.isFrozen())||i.type===Ip.FullSnapshot||i.type===Ip.IncrementalSnapshot&&i.data.source===Mp.Mutation||Vp.forEach(e=>e.unfreeze()),N)null==t||t(j(i),s);else if(L){const e={type:"rrweb",event:j(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===Ip.FullSnapshot)F=i,U=0;else if(i.type===Ip.IncrementalSnapshot){if(i.data.source===Mp.Mutation&&i.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&i.timestamp-F.timestamp>r;(e||t)&&kd(!0)}};const B=e=>{xd({type:Ip.IncrementalSnapshot,data:{source:Mp.Mutation,...e}})},z=e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.Scroll,...e}}),W=e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.CanvasMutation,...e}}),$=new Sd({mutationCb:B,adoptedStyleSheetCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.AdoptedStyleSheet,...e}})}),q=new od({mirror:Id,mutationCb:B,stylesheetManager:$,recordCrossOriginIframes:x,wrappedEmit:xd});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:Id,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const V=new Cd;Od=new bd({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:o,mirror:Id,sampling:v.canvas,dataURLOptions:w});const H=new id({mutationCb:B,scrollCb:z,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:_,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:I,sampling:v,slimDOMOptions:D,iframeManager:q,stylesheetManager:$,canvasManager:Od,keepIframeSrcFn:R,processedNodeManager:V},mirror:Id});kd=(e=!1)=>{if(!S)return;xd({type:Ip.Meta,data:{href:window.location.href,width:fp(),height:dp()}},e),$.reset(),H.init(),Vp.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new el,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:p,slimDOM:d=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return Tl(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:p,slimDOMOptions:!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===d,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===d?{}:d,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:Id,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:_,maskTextFn:m,maskInputFn:f,slimDOM:D,dataURLOptions:w,recordCanvas:C,inlineImages:I,applyBackgroundColorToBlockedElements:A,onSerialize:e=>{bp(e,Id)&&q.addIframe(e),Sp(e,Id)&&$.trackLinkElement(e),Cp(e)&&H.addShadowRoot(sp.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{$.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");xd({type:Ip.FullSnapshot,data:{node:t,initialOffset:pp(window)}},e),Vp.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&$.adoptStyleSheets(document.adoptedStyleSheets,Id.getId(document))};try{const e=[],t=e=>{var t;return $p(td)({mutationCb:B,mousemoveCb:(e,t)=>xd({type:Ip.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.ViewportResize,...e}}),inputCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.Input,...e}}),mediaInteractionCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.MediaInteraction,...e}}),styleSheetRuleCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.StyleSheetRule,...e}}),styleDeclarationCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>xd({type:Ip.IncrementalSnapshot,data:{source:Mp.Font,...e}}),selectionCb:e=>{xd({type:Ip.IncrementalSnapshot,data:{source:Mp.Selection,...e}})},customElementCb:e=>{xd({type:Ip.IncrementalSnapshot,data:{source:Mp.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:_,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:I,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:D,dataURLOptions:w,mirror:Id,iframeManager:q,stylesheetManager:$,shadowDomManager:H,processedNodeManager:V,canvasManager:Od,ignoreCSSAttributes:P,plugins:(null==(t=null==M?void 0:M.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>xd({type:Ip.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};q.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{kd(),e.push(t(document)),Ed=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(op("DOMContentLoaded",()=>{xd({type:Ip.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(op("load",()=>{xd({type:Ip.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),V.destroy(),Ed=!1,Wp=void 0}}catch(e){console.warn(e)}}var Rd;Md.addCustomEvent=(e,t)=>{if(!Ed)throw new Error("please add custom event after start recording");xd({type:Ip.Custom,data:{tag:e,payload:t}})},Md.freezePage=()=>{Vp.forEach(e=>e.freeze())},Md.takeFullSnapshot=e=>{if(!Ed)throw new Error("please take full snapshot after start recording");kd(e)},Md.mirror=Id,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Rd||(Rd={}));var Pd=Object.freeze({__proto__:null,record:Md}),Td=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=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;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},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=a.sent(),c=Date.now(),s.status=o.status,s.duration=c-e,i={},o.headers.forEach(function(e,t){i[t]=e}),s.responseHeaders=i,this.notifyEvent(s),[2,o];case 3:throw l=a.sent(),c=Date.now(),s.duration=c-e,u=l,s.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(s),l;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),Ad=Object.freeze({__proto__:null,NetworkObservers:Td});return e.SessionReplayPlugin=Rr,e.plugin=Pr,e.sessionReplayPlugin=Pr,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,p="$default_instance",d="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:p,logLevel:f.Warn,loggerProvider:new b,offline:!1,optOut:!1,serverUrl:d,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=k(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}(),x=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":d},k=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:x(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 p=e.apply(s,o);return p&&p.promise?p.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))),p}},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 p=0;p<e.length;p++)if(!T(e[p],t[p]))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),p=h[0],d=h[1];switch(p){case"$set":try{for(var f=(s=void 0,P(Object.entries(d))),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(d))),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,p,d,f,m,g,y,v,w,b,S,C,x;if("object"!=typeof e)return null;var k=e.code||0,O=this.buildStatus(k);switch(O){case h.Success:return{status:O,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case h.Invalid:return{status:O,statusCode:k,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(i=e.events_with_invalid_fields)&&void 0!==i?i:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(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!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],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:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case h.RateLimit:return{status:O,statusCode:k,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!==(x=e.throttled_events)&&void 0!==x?x:[]}};case h.Timeout:default:return{status:O,statusCode:k}}},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=429,$=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,p;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?(o.logger.error("Remote config client fetch failed with ".concat(z,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,s=!1):u.status>=400&&u.status<500&&u.status!==W&&(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(p=a.sent())instanceof Error&&"AbortError"===p.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: "),p),[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 q,V="https://app.amplitude.com",H={US:V,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var G="__AMPLITUDE_MESSENGER_INSTANCE__",J="__AMPLITUDE_MESSENGER__",K=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?V:t;this[q]=!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===V&&(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[J])===this&&delete e[J]},e}();function Y(e){var t,r=m(),n=null==r?void 0:r[J];if("object"==typeof(t=n)&&null!==t&&G in t&&!0===t[G])return n;var s=new K(e);return r&&(r[J]=s),s}q=G;var X="__AMPLITUDE_BACKGROUND_CAPTURE__";var Z,Q="[Amplitude]",ee="".concat(Q," Session Replay ID"),te=N.US,re={enabled:!0},ne=1e3,se="".concat(Q," Session Replay Debug"),oe="amp-mask";!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"}(Z||(Z={}));var ie=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}(),ae="medium";var le=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 le(e,ae,r)}},ce=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:ae}),r){if(r.closest("."+oe))return!0;var i=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(a)return!1}return le(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:ae,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ue=function(e,t){return t||(e===N.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===N.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},he=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},pe=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=he(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},de=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:""}]}})})},fe=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},me=function(){return{flushMaxRetries:2,logLevel:f.Warn,loggerProvider:new b,transportProvider:new j}},ge=function(e){function t(t,r){var n,s,i,a,l,c,u=this,h=me();if((u=e.call(this,o(o({transportProvider:h.transportProvider,loggerProvider:new ie(r.loggerProvider||h.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=h.flushMaxRetries?r.flushMaxRetries:h.flushMaxRetries,u.apiKey=t,u.sampleRate=r.sampleRate||0,u.serverZone=r.serverZone||te,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||re,u.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",u.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,u.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,u.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:ne,u.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(u.privacyConfig=r.privacyConfig),r.interactionConfig&&(u.interactionConfig=r.interactionConfig,u.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")}(u.interactionConfig.ugcFilterRules)),r.debugMode&&(u.debugMode=r.debugMode),void 0!==r.useWebWorker)u.useWebWorker=r.useWebWorker;else{var p=r;void 0!==(null===(c=p.experimental)||void 0===c?void 0:c.useWebWorker)&&(u.useWebWorker=p.experimental.useWebWorker)}return r.omitElementTags&&(u.omitElementTags=r.omitElementTags),u}return r(t,e),t}(C),ye=(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))(ye||{}),ve=(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))(ve||{}),we=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r;return i(this,void 0,void 0,function(){var n,s,i,u,h,p,d,f,m,g,y,v,w,b,S,C,x,k=this;return a(this,function(a){switch(a.label){case 0:(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(e,t){k.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,o){var i;if(k.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(o,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,c=a.sr_privacy_config,u=a.sr_targeting_config,h=null===(i=n.interactionConfig)||void 0===i?void 0:i.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||c||u)&&(s={},l&&(s.sr_sampling_config=l),c&&(s.sr_privacy_config=c),u&&(s.sr_targeting_config=u)),e()}else t(new Error("No remote config received"))})})];case 2:return a.sent(),[3,4];case 3:return i=a.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",i),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!s)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}];if(u=s.sr_sampling_config,h=s.sr_privacy_config,p=s.sr_targeting_config,u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?n.captureEnabled=u.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(n.sampleRate=u.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){d=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:d.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},m=function(e){var t,r,n,s,o,i,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var p=l(null!==(a=e.blockSelector)&&void 0!==a?a:[]),d=p.next();!d.done;d=p.next()){h[d.value]="block"}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=p.return)&&r.call(p)}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},g=o(o({},m(d)),m(h));try{for(y=l(Object.entries(g)),v=y.next();!v.done;v=y.next())w=c(v.value,2),b=w[0],"mask"===(S=w[1])?f.maskSelector.push(b):"block"===S?f.blockSelector.push(b):"unmask"===S&&f.unmaskSelector.push(b)}catch(e){C={error:e}}finally{try{v&&!v.done&&(x=y.return)&&x.call(y)}finally{if(C)throw C.error}}n.privacyConfig=(O=f,E=this.localConfig.loggerProvider,I=document.createDocumentFragment(),M=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{I.querySelector(e)}catch(t){return E.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},O.blockSelector=M(O.blockSelector),O.maskSelector=M(O.maskSelector),O.unmaskSelector=M(O.unmaskSelector),O)}return p&&Object.keys(p).length>0&&(n.targetingConfig=p),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:fe(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}]}var O,E,I,M})})},e}(),be=function(e,t){return i(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new ge(e,t),n=new $(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new we(n,r)]})})},Se=Uint8Array,Ce=Uint16Array,xe=Uint32Array,ke=new Se([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Oe=new Se([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ee=new Se([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ie=function(e,t){for(var r=new Ce(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new xe(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)s[o]=o-r[n]<<5|n;return[r,s]},Me=Ie(ke,2),Re=Me[0],Pe=Me[1];Re[28]=258,Pe[258]=28;for(var Ae=Ie(Oe,0)[1],Te=new Ce(32768),Ne=0;Ne<32768;++Ne){var Le=(43690&Ne)>>>1|(21845&Ne)<<1;Le=(61680&(Le=(52428&Le)>>>2|(13107&Le)<<2))>>>4|(3855&Le)<<4,Te[Ne]=((65280&Le)>>>8|(255&Le)<<8)>>>1}var _e=function(e,t,r){for(var n=e.length,s=0,o=new Ce(t);s<n;++s)++o[e[s]-1];var i,a=new Ce(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new Ce(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)i[Te[h]>>>l]=c}else for(i=new Ce(n),s=0;s<n;++s)i[s]=Te[a[e[s]-1]++]>>>15-e[s];return i},De=new Se(288);for(Ne=0;Ne<144;++Ne)De[Ne]=8;for(Ne=144;Ne<256;++Ne)De[Ne]=9;for(Ne=256;Ne<280;++Ne)De[Ne]=7;for(Ne=280;Ne<288;++Ne)De[Ne]=8;var Fe=new Se(32);for(Ne=0;Ne<32;++Ne)Fe[Ne]=5;var Ue=_e(De,9,0),je=_e(Fe,5,0),Be=function(e){return(e/8|0)+(7&e&&1)},ze=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Ce?Ce:e instanceof xe?xe:Se)(r-t);return n.set(e.subarray(t,r)),n},We=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},$e=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},qe=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,o=r.slice();if(!s)return[new Se(0),0];if(1==s){var i=new Se(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var p=o[0].s;for(n=1;n<s;++n)o[n].s>p&&(p=o[n].s);var d=new Ce(p+1),f=Ve(r[u-1],d,0);if(f>t){n=0;var m=0,g=f-t,y=1<<g;for(o.sort(function(e,t){return d[t.s]-d[e.s]||e.f-t.f});n<s;++n){var v=o[n].s;if(!(d[v]>t))break;m+=y-(1<<f-d[v]),d[v]=t}for(m>>>=g;m>0;){var w=o[n].s;d[w]<t?m-=1<<t-d[w]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;d[b]==t&&(--d[b],++m)}f=t}return[new Se(d),f]},Ve=function(e,t,r){return-1==e.s?Math.max(Ve(e.l,t,r+1),Ve(e.r,t,r+1)):t[e.s]=r},He=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ce(++t),n=0,s=e[0],o=1,i=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=e[a]}return[r.subarray(0,n),t]},Ge=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Je=function(e,t,r){var n=r.length,s=Be(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var o=0;o<n;++o)e[s+o+4]=r[o];return 8*(s+4+n)},Ke=function(e,t,r,n,s,o,i,a,l,c,u){We(t,u++,r),++s[256];for(var h=qe(s,15),p=h[0],d=h[1],f=qe(o,15),m=f[0],g=f[1],y=He(p),v=y[0],w=y[1],b=He(m),S=b[0],C=b[1],x=new Ce(19),k=0;k<v.length;++k)x[31&v[k]]++;for(k=0;k<S.length;++k)x[31&S[k]]++;for(var O=qe(x,7),E=O[0],I=O[1],M=19;M>4&&!E[Ee[M-1]];--M);var R,P,A,T,N=c+5<<3,L=Ge(s,De)+Ge(o,Fe)+i,_=Ge(s,p)+Ge(o,m)+i+14+3*M+Ge(x,E)+(2*x[16]+3*x[17]+7*x[18]);if(N<=L&&N<=_)return Je(t,u,e.subarray(l,l+c));if(We(t,u,1+(_<L)),u+=2,_<L){R=_e(p,d,0),P=p,A=_e(m,g,0),T=m;var D=_e(E,I,0);We(t,u,w-257),We(t,u+5,C-1),We(t,u+10,M-4),u+=14;for(k=0;k<M;++k)We(t,u+3*k,E[Ee[k]]);u+=3*M;for(var F=[v,S],U=0;U<2;++U){var j=F[U];for(k=0;k<j.length;++k){var B=31&j[k];We(t,u,D[B]),u+=E[B],B>15&&(We(t,u,j[k]>>>5&127),u+=j[k]>>>12)}}}else R=Ue,P=De,A=je,T=Fe;for(k=0;k<a;++k)if(n[k]>255){B=n[k]>>>18&31;$e(t,u,R[B+257]),u+=P[B+257],B>7&&(We(t,u,n[k]>>>23&31),u+=ke[B]);var z=31&n[k];$e(t,u,A[z]),u+=T[z],z>3&&($e(t,u,n[k]>>>5&8191),u+=Oe[z])}else $e(t,u,R[n[k]]),u+=P[n[k]];return $e(t,u,R[256]),u+P[256]},Ye=new xe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xe=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new Se(n+i+5*(1+Math.floor(i/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||i<8)for(var u=0;u<=i;u+=65535){var h=u+65535;h<i?c=Je(l,c,e.subarray(u,h)):(l[u]=o,c=Je(l,c,e.subarray(u,i)))}else{for(var p=Ye[t-1],d=p>>>13,f=8191&p,m=(1<<r)-1,g=new Ce(32768),y=new Ce(m+1),v=Math.ceil(r/3),w=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<w)&m},S=new xe(25e3),C=new Ce(288),x=new Ce(32),k=0,O=0,E=(u=0,0),I=0,M=0;u<i;++u){var R=b(u),P=32767&u,A=y[R];if(g[P]=A,y[R]=P,I<=u){var T=i-u;if((k>7e3||E>24576)&&T>423){c=Ke(e,l,0,S,C,x,O,E,M,u-M,c),E=k=O=0,M=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)x[N]=0}var L=2,_=0,D=f,F=P-A&32767;if(T>2&&R==b(u-F))for(var U=Math.min(d,T)-1,j=Math.min(32767,u),B=Math.min(258,T);F<=j&&--D&&P!=A;){if(e[u+L]==e[u+L-F]){for(var z=0;z<B&&e[u+z]==e[u+z-F];++z);if(z>L){if(L=z,_=F,z>U)break;var W=Math.min(F,z-2),$=0;for(N=0;N<W;++N){var q=u-F+N+32768&32767,V=q-g[q]+32768&32767;V>$&&($=V,A=q)}}}F+=(P=A)-(A=g[P])+32768&32767}if(_){S[E++]=268435456|Pe[L]<<18|Ae[_];var H=31&Pe[L],G=31&Ae[_];O+=ke[H]+Oe[G],++C[257+H],++x[G],I=u+L,++k}else S[E++]=e[u],++C[e[u]]}}c=Ke(e,l,o,S,C,x,O,E,M,u-M,c)}return ze(a,0,n+Be(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!0)};function Ze(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,o=r.length,i=0;i!=o;){for(var a=Math.min(i+5552,o);i<a;++i)s+=n+=r[i];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,o,i=Xe(e,t,2,4);return n=i,s=t.level,o=0==s?0:s<6?1:9==s?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(i,i.length-4,r.d()),i}const Qe=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(Ze(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Se(e.length+(e.length>>>1)),s=0,o=function(e){n[s++]=e},i=0;i<r;++i){if(s+5>n.length){var a=new Se(s+8+(r-i<<1));a.set(n),n=a}var l=e.charCodeAt(i);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return ze(n,0,s)}(JSON.stringify(t))),!0)};var et=function(){function e(e,t,r,n){var s,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=Qe(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=o.compressEvent(e);o.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var i=m();if(this.canUseIdleCallback=i&&"requestIdleCallback"in i,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3,n){t.loggerProvider.log("Enabling web worker for compression");try{var a=new Blob([n],{type:"application/javascript"}),l=URL.createObjectURL(a),c=new Worker(l);c.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression:",e),c.terminate(),o.worker=void 0},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=c}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;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),tt="Session replay event batch rejected due to exceeded retry count",rt="Failed to store session replay events in IndexedDB",nt="1.32.1",st=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:tt}),!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){var r,n;return void 0===t&&(t=!0),i(this,void 0,void 0,function(){var s,o,i,l,c,u,h,p,d,f,g,y,v;return a(this,function(a){switch(a.label){case 0:if(!(s=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=m(),i=(null==w?void 0:w.location)?w.location.href:"",l=nt,c=e.sampleRate,u=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||l),0===(p=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];a.label=1;case 1:return a.trys.push([1,6,,7]),d={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":i.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(p),method:"POST"},f="".concat(ue(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,d)];case 2:if(null===(g=a.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)return[3,3];y="";try{y=JSON.stringify(g.body,null,2)}catch(e){}return this.completeRequest({context:e,success:"".concat(g.status,": ").concat(y)}),[3,5];case 3:return[4,this.handleReponse(g.status,e)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:return v=a.sent(),this.completeRequest({context:e,err:v}),[3,7];case 7:return[2]}var w})})},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:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(t),[3,5];case 2:return[4,this.handleOtherResponse(t)];case 3:return n.sent(),[3,5];case 4:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),n.label=5;case 5: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=e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:tt}),[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 ot=(e,t)=>t.some(t=>e instanceof t);let it,at;const lt=new WeakMap,ct=new WeakMap,ut=new WeakMap;let ht={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return lt.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return mt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function pt(e){ht=e(ht)}function dt(e){return(at||(at=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(gt(this),t),mt(this.request)}:function(...t){return mt(e.apply(gt(this),t))}}function ft(e){return"function"==typeof e?dt(e):(e instanceof IDBTransaction&&function(e){if(lt.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)});lt.set(e,t)}(e),ot(e,it||(it=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,ht):e)}function mt(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(mt(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return ut.set(t,e),t}(e);if(ct.has(e))return ct.get(e);const t=ft(e);return t!==e&&(ct.set(e,t),ut.set(t,e)),t}const gt=e=>ut.get(e);function yt(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=mt(i);return n&&i.addEventListener("upgradeneeded",e=>{n(mt(i.result),e.oldVersion,e.newVersion,mt(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 vt=["get","getKey","getAll","getAllKeys","count"],wt=["put","add","delete","clear"],bt=new Map;function St(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(bt.get(t))return bt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=wt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!vt.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 bt.set(t,o),o}pt(e=>({...e,get:(t,r,n)=>St(t,r)||e.get(t,r,n),has:(t,r)=>!!St(t,r)||e.has(t,r)}));const Ct=["continue","continuePrimaryKey","advance"],xt={},kt=new WeakMap,Ot=new WeakMap,Et={get(e,t){if(!Ct.includes(t))return e[t];let r=xt[t];return r||(r=xt[t]=function(...e){kt.set(this,Ot.get(this)[t](...e))}),r}};async function*It(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Et);for(Ot.set(r,t),ut.set(r,gt(t));t;)yield r,t=await(kt.get(r)||t.continue()),kt.delete(r)}function Mt(e,t){return t===Symbol.asyncIterator&&ot(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&ot(e,[IDBIndex,IDBObjectStore])}pt(e=>({...e,get:(t,r,n)=>Mt(t,r)?It:e.get(t,r,n),has:(t,r)=>Mt(t,r)||e.has(t,r)}));var Rt,Pt,At,Tt=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}(),Nt=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)},Lt="sessionCurrentSequence",_t="sequencesToSend",Dt=function(e){var t,r;return e.objectStoreNames.contains(Lt)||(r=e.createObjectStore(Lt,{keyPath:"sessionId"})),e.objectStoreNames.contains(_t)||(t=e.createObjectStore(_t,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Ft=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,yt(e,1,{upgrade:Dt})];case 1:return[2,t.sent()]}})})},Ut=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return i(r,void 0,void 0,function(){var e,t,r,n,s,o;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=i.sent(),i.label=2;case 2:return t?(r=t.value,n=r.sessionId,s=r.events,e.push({events:s,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=i.sent(),[3,2];case 4:return[2,e];case 5:return o=i.sent(),Nt(this.loggerProvider,"".concat(rt,": ").concat(o),o),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return i(r,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(Lt,e)];case 1:return(t=s.sent())?[4,this.db.put(_t,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(Lt,{sessionId:e,events:[]})];case 3:return s.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),Nt(this.loggerProvider,"".concat(rt,": ").concat(n),n),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return i(r,void 0,void 0,function(){var r,n,s,o,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),[4,(r=this.db.transaction(Lt,"readwrite")).store.get(e)];case 1:return(n=a.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return a.sent(),[2];case 3:return s=void 0,this.shouldSplitEventsList(n.events,t)?(s=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return a.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:a.sent(),a.label=7;case 7:return[4,r.done];case 8:return a.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(i=a.sent())?[2,{events:s,sessionId:e,sequenceId:i}]:[2,void 0];case 10:return l=a.sent(),Nt(this.loggerProvider,"".concat(rt,": ").concat(l),l),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return i(r,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(_t,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),Nt(this.loggerProvider,"".concat(rt,": ").concat(r),r),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return i(r,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(_t,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),Nt(this.loggerProvider,"".concat(rt,": ").concat(e),e),[3,4];case 4:return[2]}})})},r.db=t.db,r}return r(t,e),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,Ft(s)];case 1:return i=a.sent(),[2,new t(o(o({},r),{db:i}))];case 2:return l=a.sent(),Nt(r.loggerProvider,"".concat(rt,": ").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}(Tt),jt=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}(Tt),Bt=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.type,l=e.payloadBatcher,c=e.storeType;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,u.flush(e)]})})}var u,h,p,d,f,m,g,y,v;return a(this,function(w){switch(w.label){case 0:return u=new st(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:l})),h=function(){return new jt({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r})},p=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(o){switch(o.label){case 0:return[4,Ut.new(s,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,apiKey:t.apiKey})];case 1:return(e=o.sent())?[2,e]:(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,h()])}})})},"idb"!==c?[3,2]:[4,p()];case 1:return f=w.sent(),[3,3];case 2:f=h(),w.label=3;case 3:return d=f,m=function(e){var r=e.events,n=e.sessionId,o=e.deviceId,l=e.sequenceId;t.debugMode&&de().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(){}),u.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,d.cleanUpSessionEventsStore(n,l)];case 1:return e.sent(),[2]}})})}})},g=function(e){var r=e.sessionId,n=e.deviceId;d.storeCurrentSequence(r).then(function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},y=function(e){var t=e.deviceId;return i(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return[4,d.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},v=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;d.addEventToCurrentSequence(n,r.data).then(function(e){return e&&m({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:g,addEvent:v,sendStoredEvents:y,flush:e}]}})})},zt=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 Wt(e,t){if(At=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};Rt=o(o({},r),t),Pt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Rt.root,r);var n=$t(e,"all",function(){return $t(e,"two",function(){return $t(e,"one",function(){return $t(e,"none")})})});if(n){var s=Qt(er(n,e));return s.length>0&&(n=s[0]),Vt(n)}throw new Error("Selector was not found.")}function $t(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,h=(new Date).getTime()-At.getTime();if(void 0!==Rt.timeoutMs&&h>Rt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var p=Yt(function(e){var t=e.getAttribute("id");if(t&&Rt.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Yt.apply(void 0,u([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Rt.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))||Yt.apply(void 0,u([],c(function(e){var t=Array.from(e.classList).filter(Rt.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||Yt(function(e){var t=e.tagName.toLowerCase();if(Rt.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],d=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)d&&(p=p.concat(p.filter(Kt).map(function(e){return Jt(e,d)})));else if("two"==t)p=p.slice(0,1),d&&(p=p.concat(p.filter(Kt).map(function(e){return Jt(e,d)})));else if("one"==t){var f=c(p=p.slice(0,1),1)[0];d&&Kt(f)&&(p=[Jt(f,d)])}else"none"==t&&(p=[{name:"*",penalty:3}],d&&(p=[Jt(p[0],d)]));try{for(var m=(e=void 0,l(p)),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(p),s.length>=Rt.seedMinLength&&(n=qt(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=qt(s,r)),!n&&r?r():n}function qt(e,t){var r,n,s=Qt(Zt(e));if(s.length>Rt.threshold)return t?t():null;try{for(var o=l(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(Gt(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 Vt(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 Ht(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Gt(e){var t=Vt(e);switch(Pt.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 Jt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Kt(e){return"html"!==e.name&&!e.name.startsWith("#")}function Yt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Xt);return r.length>0?r:null}function Xt(e){return null!=e}function Zt(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(Zt(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 Qt(e){return u([],c(e),!1).sort(function(e,t){return Ht(e)-Ht(t)})}function er(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>Rt.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>Rt.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),o=Vt(s),r.visited.has(o)?[2]:Gt(s)&&function(e,t){return Pt.querySelector(Vt(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,l(er(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var tr=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}},rr=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)}},nr=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===ve.Click){var l=m();if(l){var c=l.location,u=l.innerHeight,h=l.innerWidth;if(c){var p=e.x,d=e.y;if(void 0!==p&&void 0!==d){var f,g=o.getNode(e.id);if(g)try{f=Wt(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var y=pe(c.href,i),v={x:p+r.scrollWatcher.currentScrollX,y:d+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 sr(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function or(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var ir=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=ue(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}(),ar=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,s,o=e(),i=m();i&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:sr(),viewportWidth:or(),pageUrl:pe(i.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=or(),this._maxScrollHeight=sr(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new ir(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=or();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=sr();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),lr=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))},cr=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,yt(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(),Nt(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(),Nt(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(),Nt(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},ur=new cr,hr=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,p,d;return a(this,function(a){switch(a.label){case 0:return[4,ur.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,ur.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 bn})];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),ur.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return p=a.sent(),d=p,n.warn(d.message),[3,7];case 7:return[2,e]}})})},pr="__amplitude_url_tracking_patched__",dr=new WeakMap;function fr(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?ne: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=dr.get(e);if(!u){var h=void 0,p=new Set,d=function(){var t=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&t===h||(h=t,p.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 d(),n};return t[pr]=!0,t},m=e.history;if(null==m?void 0:m.pushState){var g=Reflect.get(m,"pushState");g[pr]||(m.pushState=f(g))}if(null==m?void 0:m.replaceState){var y=Reflect.get(m,"replaceState");y[pr]||(m.replaceState=f(y))}u={callbacks:p,notify:d,onPopStateOrHashChange:function(){return d()},listenersAttached:!1},dr.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 mr(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:ne,p=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var d=void 0,f=function(){return r.location&&r.location.href||""},m=function(){var e=f();if(void 0===d||e!==d){d=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=f(),o="";return p&&(o=(null==n?void 0:n.title)||""),{href:c.length>0?pe(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=fr(r,function(){return m()},u?{enablePolling:!0,pollingInterval:h}:{});return m(),function(){return g()}},options:e}}mr();var gr,yr,vr,wr=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.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(){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,p,d,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!==(d=null===(p=t.page)||void 0===p?void 0:p.url)&&void 0!==d?d: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,hr({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!==Z.METADATA?(e={config:fe(s),version:nt},n?[4,de()]:[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 ie(new b)}return e.prototype.init=function(e,t){return v(this._init(e,t))},e.prototype.setupUrlChangeListenerForTargeting=function(){var e,t=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var r=m();if(null==r?void 0:r.location){var n=fr(r,function(e){var r=++t.latestUrlChangeTargetingEvaluationId;t.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),t.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(r," for ").concat(e,"."))});this.urlChangeCleanup=function(){n(),t.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,p,d,f;return i(this,void 0,void 0,function(){var i,g,y,v,w,S,C,x,k,O,E,I,M,R,P,A,T,N;return a(this,function(a){switch(a.label){case 0:return null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.loggerProvider=new ie(t.loggerProvider||new b),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new lr({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,be(e,t)];case 1:return i.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:g=a.sent(),y=g.joinedConfig,v=g.localConfig,w=g.remoteConfig,this.config=y,this.setMetadata(t.sessionId,y,v,w,null===(n=t.version)||void 0===n?void 0:n.version,nt,null===(s=t.version)||void 0===s?void 0:s.type),t.sessionId&&(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled)&&(S=ar.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[S.send(this.getDeviceId.bind(this)).bind(S)],this.scrollHook=S.hook.bind(S),this.clickHandler=new nr(this.loggerProvider,S)),C=[],"idb"!==(x=this.config.storeType)||(null===(h=m())||void 0===h?void 0:h.indexedDB)||(x="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(x," for event storage.")),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,Bt({config:this.config,type:"replay",storeType:x})];case 4:return k=a.sent(),C.push({name:"replay",manager:k}),[3,6];case 5:return O=a.sent(),R=O,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(R.toString())),[3,6];case 6:if(!(null===(p=this.config.interactionConfig)||void 0===p?void 0:p.enabled))return[3,10];E=this.config.interactionConfig.batch?rr:tr,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,Bt({config:this.config,type:"interaction",minInterval:null!==(d=this.config.interactionConfig.trackEveryNms)&&void 0!==d?d:3e4,maxInterval:6e4,payloadBatcher:E,storeType:x})];case 8:return I=a.sent(),C.push({name:"interaction",manager:I}),[3,10];case 9:return M=a.sent(),R=M,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(R.toString())),[3,10];case 10:return this.eventsManager=new(zt.bind.apply(zt,u([void 0],c(C),!1))),this.eventCompressor&&this.eventCompressor.terminate(),P=void 0,A=m(),this.config.useWebWorker&&A&&A.Worker?[4,Promise.resolve().then(function(){return Sn})]:[3,12];case 11:T=a.sent().compressionScript,P=T,a.label=12;case 12:return this.eventCompressor=new et(this.eventsManager,this.config,this.getDeviceId(),P),[4,this.initializeNetworkObservers()];case 13:return a.sent(),(null===(f=m())||void 0===f?void 0:f.opener)&&(function(e,t){var r,n=e;if(!0!==n[X]){n[X]=!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.2.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})}}(N=Y()),N.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 14:return a.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[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 lr({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={})[ee]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[se]=JSON.stringify({appHash:F(t.apiKey).toString()}))),this.addCustomRRWebEvent(Z.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=p),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,n=!1,s="",o=!1;this.config.targetingConfig?this.sessionTargetingMatch?(s="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(s),n=!0,o=!0):(s="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(s),n=!1,o=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=F(e.toString()),31*Math.abs(r)%1e6/1e6<t)?(n=!0,o=!0):(s="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(s),n=!1,o=!1);return this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Z.TARGETING_DECISION,{message:s,sessionId:this.identifiers.sessionId,matched:o,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var s=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t,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=mr({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 Da})];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 Td})];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){var t,r,n,s,o,l,c;return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var i,u,h,p,d,f,m,g,y,v,w,b,S,C=this;return a(this,function(a){switch(a.label){case 0:return i=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,u&&h&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(p=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){C.addCustomRRWebEvent(Z.FETCH_REQUEST,e)}),d=i.privacyConfig,f=i.interactionConfig,m=i.loggingConfig,g=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(s=f.ugcFilterRules)&&void 0!==s?s:[],performanceOptions:null===(o=i.performanceConfig)||void 0===o?void 0:o.interaction})),scroll:this.scrollHook}:{},y=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),v=this,w=p,S={emit:function(e){if(C.shouldOptOut())return C.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),C.stopRecordingEvents(),void C.sendEvents();e.type===ye.Meta&&(e.data.href=pe(e.data.href,y)),C.eventCompressor&&C.eventCompressor.enqueueEvent(e,h)},inlineStylesheet:i.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:oe,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:ce("input",d),maskTextFn:ce("text",d),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(l=i.omitElementTags)||void 0===l?void 0:l.script,comment:null===(c=i.omitElementTags)||void 0===c?void 0:c.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return C.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(m)];case 4:return v.recordCancelCallback=w.apply(void 0,[(S.plugins=a.sent(),S)]),this.addCustomRRWebEvent(Z.DEBUG_INFO),e&&this.addCustomRRWebEvent(Z.METADATA,this.metadata),[3,6];case 5:return b=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[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 Ld})];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}(),br=function(e){return function(){var t=e.config||me();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Sr=function(){var e=new wr;return{init:O(e.init.bind(e),"init",br(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",br(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",br(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",br(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",br(e)),flush:O(e.flush.bind(e),"flush",br(e)),shutdown:O(e.shutdown.bind(e),"shutdown",br(e))}}(),Cr=Sr.init,xr=Sr.setSessionId,kr=Sr.getSessionId,Or=Sr.getSessionReplayProperties,Er=Sr.flush,Ir=Sr.shutdown,Mr=Sr.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"}(gr||(gr={})),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"}(yr||(yr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(vr||(vr={}));const Rr=[gr.SET,gr.SET_ONCE,gr.ADD,gr.APPEND,gr.PREPEND,gr.POSTINSERT],Pr="1.26.1";class Ar{constructor(e){this.name=Ar.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:Er,getSessionId:kr,getSessionReplayProperties:Or,init:Cr,setSessionId:xr,shutdown:Ir,evaluateTargetingAndCapture:Mr},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 ${Pr}.`),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:Pr},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},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(Rr.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()}}Ar.pluginName="@amplitude/plugin-session-replay-browser";const Tr=e=>new Ar(e);var Nr=function(e,t){return Nr=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])},Nr(e,t)};var Lr=function(){return Lr=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},Lr.apply(this,arguments)};function _r(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 Dr="is",Fr="is not",Ur="contains",jr="does not contain",Br="less",zr="less or equal",Wr="greater",$r="greater or equal",qr="version less",Vr="version less or equal",Hr="version greater",Gr="version greater or equal",Jr="set is",Kr="set is not",Yr="set contains",Xr="set does not contain",Zr="set contains any",Qr="set does not contain any",en="regex match",tn="regex does not match",rn=-862048943,nn=461845907,sn=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=cn(r,i<<2);o=on(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,rn),c=ln(c,15),o^=c=Math.imul(c,nn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,rn),c=ln(c,15),o^=c=Math.imul(c,nn);break;case 1:c^=r[l],c=Math.imul(c,rn),c=ln(c,15),o^=c=Math.imul(c,nn)}return an(o^=n)>>>0},on=function(e,t){var r=e,n=t;return r=Math.imul(r,rn),r=ln(r,15),r=Math.imul(r,nn),n=ln(n^=r,13),(n=Math.imul(n,5))+-430675100|0},an=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},ln=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},cn=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 un(r)},un=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},hn=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=_r(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}},pn="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),dn=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(pn).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}(),fn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=_r(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=_r(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=Lr(Lr(Lr({},t.metadata),a.metadata),s.metadata);s=Lr(Lr({},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=_r(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var p=(o=void 0,_r(u)),d=p.next();!d.done;d=p.next()){var f=d.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}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=hn(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 sn(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(hn(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=_r(t.bucket.allocations),p=h.next();!p.done;p=h.next()){var d=p.value,f=d.range[0],m=d.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,_r(d.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{p&&!p.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 Dr:case Ur:case Br:case zr:case Wr:case $r:case qr:case Vr:case Hr:case Gr:case Jr:case Yr:case Zr:return r;case Fr:case jr:case Xr:case Qr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Jr:return this.setEquals(e,r);case Kr:return!this.setEquals(e,r);case Yr:return this.matchesSetContainsAll(e,r);case Xr:return!this.matchesSetContainsAll(e,r);case Zr:return this.matchesSetContainsAny(e,r);case Qr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Dr:return this.matchesIs(e,r);case Fr:return!this.matchesIs(e,r);case Ur:return this.matchesContains(e,r);case jr:return!this.matchesContains(e,r);case Br:case zr:case Wr:case $r:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case qr:case Vr:case Hr:case Gr:return this.matchesComparable(e,t,r,function(e){return dn.parse(e)},this.versionComparator);case en:return this.matchesRegex(e,r);case tn: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=_r(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 Br:case qr:return e<r;case zr:case Vr:return e<=r;case Wr:case Hr:return e>r;case $r:case Gr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Br:case qr:return n<0;case zr:case Vr:return n<=0;case Wr:case Hr:return n>0;case $r:case Gr: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 Jr:case Kr:case Yr:case Xr:case Zr:case Qr: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=_r(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=_r(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}Nr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var mn,gn=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,yt(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,p,d,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)),p={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(p)];case 2:return a.sent(),[2,h];case 3:return d=a.sent(),l.warn("Failed to store events for targeting ".concat(r,": ").concat(d)),[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]}})})}},yn=new gn,vn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,l=t.userProperties,c=t.deviceId,u=t.page,h=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,yn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,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:o,event:s,event_types:i&&Array.from(i),user:{device_id:c,user_properties:l},page:u},[2,this.evaluationEngine.evaluate(p,[h])]}})})},this.evaluationEngine=new fn},wn=function(){var e=new vn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,bn=Object.freeze({__proto__:null,evaluateTargeting:wn}),Sn=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!0)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),Cn=Object.defineProperty,xn=(e,t,r)=>((e,t,r)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),kn=Object.defineProperty,On=(e,t,r)=>((e,t,r)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),En=Object.defineProperty,In=(e,t,r)=>((e,t,r)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Mn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Rn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Pn={};function An(e){if(Pn[e])return Pn[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 Mn?Mn[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 Rn?Rn[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 Pn[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?Pn[e]=o:r}catch{return r}}const Tn={};function Nn(e,t,r){var n;const s=`${e}.${String(r)}`;if(Tn[s])return Tn[s].call(t);const o=An(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Tn[s]=i,i.call(t)):t[r]}const Ln={};function _n(e,t,r){const n=`${e}.${String(r)}`;if(Ln[n])return Ln[n].bind(t);const s=An(e)[r];return"function"!=typeof s?t[r]:(Ln[n]=s,s.bind(t))}const Dn={childNodes:function(e){return Nn("Node",e,"childNodes")},parentNode:function(e){return Nn("Node",e,"parentNode")},parentElement:function(e){return Nn("Node",e,"parentElement")},textContent:function(e){return Nn("Node",e,"textContent")},contains:function(e,t){return _n("Node",e,"contains")(t)},getRootNode:function(e){return _n("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Nn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Nn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Nn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Nn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return An("MutationObserver").constructor}};class Fn{constructor(){In(this,"idNodeMap",new Map),In(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 Un(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Un(Dn.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Un(Dn.parentNode(e),t,r)}function jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Bn(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 zn,Wn={exports:{}};function $n(){if(zn)return Wn.exports;zn=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 Wn.exports=t(),Wn.exports.createColors=t,Wn.exports}const qn=Bn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Vn,Hn;function Gn(){if(Hn)return Vn;Hn=1;let e=$n(),t=qn;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 Vn=r,r.default=r,Vn}var Jn,Kn,Yn,Xn,Zn,Qn,es,ts,rs,ns,ss,os,is,as,ls,cs,us,hs,ps,ds,fs,ms,gs,ys,vs,ws,bs,Ss,Cs,xs,ks,Os,Es,Is,Ms,Rs,Ps,As,Ts,Ns,Ls,_s,Ds,Fs,Us,js,Bs,zs,Ws,$s,qs,Vs,Hs,Gs={};function Js(){return Jn||(Jn=1,Gs.isClean=Symbol("isClean"),Gs.my=Symbol("my")),Gs}function Ks(){if(Yn)return Kn;Yn=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 Kn=t,t.default=t,Kn}function Ys(){if(Zn)return Xn;Zn=1;let e=Ks();function t(t,r){new e(r).stringify(t)}return Xn=t,t.default=t,Xn}function Xs(){if(es)return Qn;es=1;let{isClean:e,my:t}=Js(),r=Gn(),n=Ks(),s=Ys();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 Qn=i,i.default=i,Qn}function Zs(){if(rs)return ts;rs=1;let e=Xs();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 ts=t,t.default=t,ts}function Qs(){if(ss)return ns;ss=1;return ns={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}},ns}function eo(){if(is)return os;is=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qn,{existsSync:r,readFileSync:n}=qn,{dirname:s,join:o}=qn;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 os=i,i.default=i,os}function to(){if(ls)return as;ls=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qn,{fileURLToPath:r,pathToFileURL:n}=qn,{isAbsolute:s,resolve:o}=qn,{nanoid:i}=Qs(),a=qn,l=Gn(),c=eo(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 as=d,d.default=d,a&&a.registerInput&&a.registerInput(d),as}function ro(){if(us)return cs;us=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qn,{dirname:r,relative:n,resolve:s,sep:o}=qn,{pathToFileURL:i}=qn,a=to(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return cs=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 no(){if(ps)return hs;ps=1;let e=Xs();class t extends e{constructor(e){super(e),this.type="comment"}}return hs=t,t.default=t,hs}function so(){if(fs)return ds;fs=1;let e,t,r,n,{isClean:s,my:o}=Js(),i=Zs(),a=no(),l=Xs();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},ds=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)})},ds}function oo(){if(gs)return ms;gs=1;let e,t,r=so();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},ms=n,n.default=n,ms}function io(){if(vs)return ys;vs=1;let e={};return ys=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function ao(){if(bs)return ws;bs=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 ws=e,e.default=e,ws}function lo(){if(Cs)return Ss;Cs=1;let e=ao();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 Ss=t,t.default=t,Ss}function co(){if(Es)return Os;Es=1;let e=so();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 Os=t,t.default=t,e.registerAtRule(t),Os}function uo(){if(Ms)return Is;Ms=1;let e,t,r=so();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},Is=n,n.default=n,r.registerRoot(n),Is}function ho(){if(Ps)return Rs;Ps=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 Rs=e,e.default=e,Rs}function po(){if(Ts)return As;Ts=1;let e=so(),t=ho();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 As=r,r.default=r,e.registerRule(r),As}function fo(){if(Ls)return Ns;Ls=1;let e=Zs(),t=function(){if(ks)return xs;ks=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),p=")".charCodeAt(0),d="{".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 xs=function(x,k={}){let O,E,I,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{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||k){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||k){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||k?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=no(),n=co(),s=uo(),o=po();const i={empty:!0,space:!0};return Ns=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})}},Ns}function mo(){if(Ds)return _s;Ds=1;let e=so(),t=fo(),r=to();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 _s=n,n.default=n,e.registerParse(n),_s}function go(){if(Us)return Fs;Us=1;let{isClean:e,my:t}=Js(),r=ro(),n=Ys(),s=so(),o=oo(),i=io(),a=lo(),l=mo(),c=uo();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},Fs=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Fs}function yo(){if(Ws)return zs;Ws=1;let e=function(){if(Bs)return js;Bs=1;let e=ro(),t=Ys(),r=io(),n=mo();const s=lo();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 js=o,o.default=o,js}(),t=go(),r=oo(),n=uo();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 zs=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),zs}const vo=jn(function(){if(Hs)return Vs;Hs=1;let e=Gn(),t=Zs(),r=go(),n=so(),s=yo(),o=Ys(),i=function(){if(qs)return $s;qs=1;let e=Zs(),t=eo(),r=no(),n=co(),s=to(),o=uo(),i=po();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 $s=a,a.default=a,$s}(),a=oo(),l=ao(),c=no(),u=co(),h=lo(),p=to(),d=mo(),f=ho(),m=po(),g=uo(),y=Xs();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Vs=v,v.default=v,Vs}());vo.stringify,vo.fromJSON,vo.plugin,vo.parse,vo.list,vo.document,vo.comment,vo.atRule,vo.rule,vo.decl,vo.root,vo.CssSyntaxError,vo.Declaration,vo.Container,vo.Processor,vo.Document,vo.Comment,vo.Warning,vo.AtRule,vo.Result,vo.Input,vo.Rule,vo.Root,vo.Node;var wo=Object.defineProperty,bo=(e,t,r)=>((e,t,r)=>t in e?wo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function So(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Co(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 xo,ko={exports:{}};function Oo(){if(xo)return ko.exports;xo=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 ko.exports=t(),ko.exports.createColors=t,ko.exports}const Eo=Co(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Io,Mo;function Ro(){if(Mo)return Io;Mo=1;let e=Oo(),t=Eo;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 Io=r,r.default=r,Io}var Po,Ao,To,No,Lo,_o,Do,Fo,Uo,jo,Bo,zo,Wo,$o,qo,Vo,Ho,Go,Jo,Ko,Yo,Xo,Zo,Qo,ei,ti,ri,ni,si,oi,ii,ai,li,ci,ui,hi,pi,di,fi,mi,gi,yi,vi,wi,bi,Si,Ci,xi,ki,Oi,Ei,Ii,Mi,Ri={};function Pi(){return Po||(Po=1,Ri.isClean=Symbol("isClean"),Ri.my=Symbol("my")),Ri}function Ai(){if(To)return Ao;To=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 Ao=t,t.default=t,Ao}function Ti(){if(Lo)return No;Lo=1;let e=Ai();function t(t,r){new e(r).stringify(t)}return No=t,t.default=t,No}function Ni(){if(Do)return _o;Do=1;let{isClean:e,my:t}=Pi(),r=Ro(),n=Ai(),s=Ti();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 _o=i,i.default=i,_o}function Li(){if(Uo)return Fo;Uo=1;let e=Ni();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 Fo=t,t.default=t,Fo}function _i(){if(Bo)return jo;Bo=1;return jo={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}},jo}function Di(){if(Wo)return zo;Wo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Eo,{existsSync:r,readFileSync:n}=Eo,{dirname:s,join:o}=Eo;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 zo=i,i.default=i,zo}function Fi(){if(qo)return $o;qo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Eo,{fileURLToPath:r,pathToFileURL:n}=Eo,{isAbsolute:s,resolve:o}=Eo,{nanoid:i}=_i(),a=Eo,l=Ro(),c=Di(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 $o=d,d.default=d,a&&a.registerInput&&a.registerInput(d),$o}function Ui(){if(Ho)return Vo;Ho=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Eo,{dirname:r,relative:n,resolve:s,sep:o}=Eo,{pathToFileURL:i}=Eo,a=Fi(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Vo=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 ji(){if(Jo)return Go;Jo=1;let e=Ni();class t extends e{constructor(e){super(e),this.type="comment"}}return Go=t,t.default=t,Go}function Bi(){if(Yo)return Ko;Yo=1;let e,t,r,n,{isClean:s,my:o}=Pi(),i=Li(),a=ji(),l=Ni();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},Ko=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)})},Ko}function zi(){if(Zo)return Xo;Zo=1;let e,t,r=Bi();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},Xo=n,n.default=n,Xo}function Wi(){if(ei)return Qo;ei=1;let e={};return Qo=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function $i(){if(ri)return ti;ri=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 ti=e,e.default=e,ti}function qi(){if(si)return ni;si=1;let e=$i();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 ni=t,t.default=t,ni}function Vi(){if(li)return ai;li=1;let e=Bi();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 ai=t,t.default=t,e.registerAtRule(t),ai}function Hi(){if(ui)return ci;ui=1;let e,t,r=Bi();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},ci=n,n.default=n,r.registerRoot(n),ci}function Gi(){if(pi)return hi;pi=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 hi=e,e.default=e,hi}function Ji(){if(fi)return di;fi=1;let e=Bi(),t=Gi();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 di=r,r.default=r,e.registerRule(r),di}function Ki(){if(gi)return mi;gi=1;let e=Li(),t=function(){if(ii)return oi;ii=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),p=")".charCodeAt(0),d="{".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 oi=function(x,k={}){let O,E,I,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{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||k){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||k){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||k?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=ji(),n=Vi(),s=Hi(),o=Ji();const i={empty:!0,space:!0};return mi=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})}},mi}function Yi(){if(vi)return yi;vi=1;let e=Bi(),t=Ki(),r=Fi();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 yi=n,n.default=n,e.registerParse(n),yi}function Xi(){if(bi)return wi;bi=1;let{isClean:e,my:t}=Pi(),r=Ui(),n=Ti(),s=Bi(),o=zi(),i=Wi(),a=qi(),l=Yi(),c=Hi();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},wi=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),wi}function Zi(){if(ki)return xi;ki=1;let e=function(){if(Ci)return Si;Ci=1;let e=Ui(),t=Ti(),r=Wi(),n=Yi();const s=qi();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 Si=o,o.default=o,Si}(),t=Xi(),r=zi(),n=Hi();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 xi=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),xi}const Qi=So(function(){if(Mi)return Ii;Mi=1;let e=Ro(),t=Li(),r=Xi(),n=Bi(),s=Zi(),o=Ti(),i=function(){if(Ei)return Oi;Ei=1;let e=Li(),t=Di(),r=ji(),n=Vi(),s=Fi(),o=Hi(),i=Ji();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 Oi=a,a.default=a,Oi}(),a=zi(),l=$i(),c=ji(),u=Vi(),h=qi(),p=Fi(),d=Yi(),f=Gi(),m=Ji(),g=Hi(),y=Ni();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Ii=v,v.default=v,Ii}());Qi.stringify,Qi.fromJSON,Qi.plugin,Qi.parse,Qi.list,Qi.document,Qi.comment,Qi.atRule,Qi.rule,Qi.decl,Qi.root,Qi.CssSyntaxError,Qi.Declaration,Qi.Container,Qi.Processor,Qi.Document,Qi.Comment,Qi.Warning,Qi.AtRule,Qi.Result,Qi.Input,Qi.Rule,Qi.Root,Qi.Node;class ea{constructor(...e){bo(this,"parentElement",null),bo(this,"parentNode",null),bo(this,"ownerDocument"),bo(this,"firstChild",null),bo(this,"lastChild",null),bo(this,"previousSibling",null),bo(this,"nextSibling",null),bo(this,"ELEMENT_NODE",1),bo(this,"TEXT_NODE",3),bo(this,"nodeType"),bo(this,"nodeName"),bo(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 ea))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 ta={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ra={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},na={};function sa(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 ta?ta[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 ra?ra[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 oa={};function ia(e,t,r){var n;const s=`${e}.${String(r)}`;if(oa[s])return oa[s].call(t);const o=sa(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(oa[s]=i,i.call(t)):t[r]}const aa={};function la(e,t,r){const n=`${e}.${String(r)}`;if(aa[n])return aa[n].bind(t);const s=sa(e)[r];return"function"!=typeof s?t[r]:(aa[n]=s,s.bind(t))}const ca={childNodes:function(e){return ia("Node",e,"childNodes")},parentNode:function(e){return ia("Node",e,"parentNode")},parentElement:function(e){return ia("Node",e,"parentElement")},textContent:function(e){return ia("Node",e,"textContent")},contains:function(e,t){return la("Node",e,"contains")(t)},getRootNode:function(e){return la("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ia("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ia("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ia("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ia("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return sa("MutationObserver").constructor}};const ua="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 ha={map:{},getId:()=>(console.error(ua),-1),getNode:()=>(console.error(ua),null),removeNodeFromMap(){console.error(ua)},has:()=>(console.error(ua),!1),reset(){console.error(ua)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ha=new Proxy(ha,{get:(e,t,r)=>("map"===t&&console.error(ua),Reflect.get(e,t,r))}));let pa=Date.now;function da(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ca.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(pa=()=>(new Date).getTime());function fa(e){var t;let r=null;return"getRootNode"in e&&(null==(t=ca.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ca.host(ca.getRootNode(e))&&(r=ca.host(ca.getRootNode(e))),r}function ma(e){let t,r=e;for(;t=fa(r);)r=t;return r}function ga(e){const t=e.ownerDocument;if(!t)return!1;const r=ma(e);return ca.contains(t,r)}const ya=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){On(this,"id",1),On(this,"styleIDMap",new WeakMap),On(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 ha},closestElementOfNode:da,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:ma,getShadowHost:fa,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=ca.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=ca.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 ea&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ca.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&&(ca.contains(t,e)||ga(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Dn.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Dn.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=ca.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=da(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(Un(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 pa},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:ga,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 va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wa="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ba=0;ba<64;ba++)wa[va.charCodeAt(ba)]=ba;"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==(mn=e.contentWindow)?void 0:mn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Sa,Ca;new Fn,(Ca=Sa||(Sa={}))[Ca.NotStarted=0]="NotStarted",Ca[Ca.Running=1]="Running",Ca[Ca.Stopped=2]="Stopped";class xa{constructor(e){xn(this,"fileName"),xn(this,"functionName"),xn(this,"lineNumber"),xn(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 ka=/(^|@)\S+:\d+/,Oa=/^\s*at .*(\S+:\d+|\(native\))/m,Ea=/^(eval@)?(\[native code])?$/,Ia={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Oa)?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(Oa)},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 xa({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(Ea)},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 xa({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new xa({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 xa({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 xa({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(ka)&&!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 xa({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ma(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 Ra(e){return"[object Object]"===Object.prototype.toString.call(e)}function Pa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ra(e[n])&&Pa(e[n],t-1))return!0;return!1}function Aa(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(Ra(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ra(e)&&Pa(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]=Ma(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 Ta={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 Na(e,t,r){const n=r?Object.assign({},Ta,r):Ta,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=Ia.parse(s).map(e=>e.toString()),i=[Aa(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=[Aa(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[Aa("Uncaught (in promise)",n.stringifyOptions),Aa(t.reason,n.stringifyOptions)]);const o=Ia.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]?ya.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Ia.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>Aa(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Aa("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const La="rrweb/console@1";var _a,Da=Object.freeze({__proto__:null,PLUGIN_NAME:La,getRecordConsolePlugin:e=>({name:La,observer:Na,options:e})}),Fa=Object.defineProperty,Ua=(e,t,r)=>((e,t,r)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ja=Object.defineProperty,Ba=(e,t,r)=>((e,t,r)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),za=(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))(za||{});const Wa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$a={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},qa={};function Va(e){if(qa[e])return qa[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 Wa?Wa[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 $a?$a[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 qa[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?qa[e]=o:r}catch{return r}}const Ha={};function Ga(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ha[s])return Ha[s].call(t);const o=Va(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ha[s]=i,i.call(t)):t[r]}const Ja={};function Ka(e,t,r){const n=`${e}.${String(r)}`;if(Ja[n])return Ja[n].bind(t);const s=Va(e)[r];return"function"!=typeof s?t[r]:(Ja[n]=s,s.bind(t))}const Ya={childNodes:function(e){return Ga("Node",e,"childNodes")},parentNode:function(e){return Ga("Node",e,"parentNode")},parentElement:function(e){return Ga("Node",e,"parentElement")},textContent:function(e){return Ga("Node",e,"textContent")},contains:function(e,t){return Ka("Node",e,"contains")(t)},getRootNode:function(e){return Ka("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ga("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ga("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ga("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ga("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Va("MutationObserver").constructor}};function Xa(e){return e.nodeType===e.ELEMENT_NODE}function Za(e){const t=e&&"host"in e&&"mode"in e&&Ya.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Ya.shadowRoot(t)===e)}function Qa(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function el(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=>tl(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 tl(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=el(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?pl(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?pl(r,t):r}}class rl{constructor(){Ba(this,"idNodeMap",new Map),Ba(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 nl({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&sl(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function sl(e){return e.toLowerCase()}const ol="__rrweb_original__";function il(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?sl(t):null}function al(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 ll=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,cl=/^(?:[a-z+]+:)?\/\//i,ul=/^www\..*/i,hl=/^(data:)([^,]*),(.*)/i;function pl(e,t){return(e||"").replace(ll,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(cl.test(a)||ul.test(a))return`url(${l}${a}${l})`;if(hl.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 dl(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function fl(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=dl(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=dl(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),p=t.split(h),d=-1;if(2===p.length)d=p[0].length;else if(p.length>2&&""===p[0]&&""!==n[a-1].textContent)d=t.indexOf(h,1);else if(1===p.length){if(h=h.substring(0,h.length-1),p=t.split(h),p.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(d=t.indexOf(h));if(p.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=dl(e).length;d=t.indexOf(h,r)}-1===d&&(d=p[0].length)}if(-1!==d){let a=Math.floor(d/i);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;const l=dl(e.substring(0,a),r);if(l.length===d){s.push(e.substring(0,a)),e=e.substring(a),t=t.substring(d);break}l.length<d?a+=Math.max(1,Math.floor((d-l.length)/i)):a-=Math.max(1,Math.floor((l.length-d)*i))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const ml="lightgrey";let gl=1;const yl=new RegExp("[^a-z0-9-_:]");function vl(){return gl++}let wl,bl;const Sl=/^[^ \t\n\r\u000c]+/,Cl=/^[, \t\n\r\u000c]+/;const xl=new WeakMap;function kl(e,t){return t&&""!==t.trim()?El(e,t):t}function Ol(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function El(e,t){let r=xl.get(e);if(r||(r=e.createElement("a"),xl.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Il(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?kl(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(Cl),!(r>=t.length);){let o=n(Sl);if(","===o.slice(-1))o=kl(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=kl(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?pl(n,El(e)):"object"===t&&"data"===r?kl(e,n):n:kl(e,n):n}function Ml(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Rl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Rl(Ya.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Rl(Ya.parentNode(e),t,r)}function Pl(e,t,r,n){let s;if(Xa(e)){if(s=e,!Ya.childNodes(s).length)return!1}else{if(null===Ya.parentElement(e))return!1;s=Ya.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(Rl(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 Al(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1,applyBackgroundColorToBlockedElements:y=!1}=t,v=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:za.Document,childNodes:[],compatMode:e.compatMode}:{type:za.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:za.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:d,applyBackgroundColorToBlockedElements:f=!1}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=sl(e.tagName);return yl.test(t)?"div":t}(e);let y={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];Ml(g,n.name,n.value)||(y[n.name]=Il(r,g,sl(n.name),n.value))}if("link"===g&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=el(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===g&&e.sheet){let t=el(e.sheet);t&&(e.childNodes.length>1&&(t=fl(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=nl({element:e,type:il(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:a}):r&&(y.checked=r)}"option"===g&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const s=t.getImageData,o=ol in s?s[ol]: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)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(y.rr_dataURL=t)}if("img"===g&&c){wl||(wl=r.createElement("canvas"),bl=wl.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{wl.width=t.naturalWidth,wl.height=t.naturalHeight,bl.drawImage(t,0,0),y.rr_dataURL=wl.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?y.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=y;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&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:ml}:{}}}"iframe"!==g||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(g)&&(w=!0)}catch(e){}return{type:za.Element,tagName:g,attributes:y,childNodes:[],isSVG:Ol(e)||void 0,needBlock:m,rootId:d,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m,rootId:v,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=Ya.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=Ya.textContent(e),c&&l&&(l=pl(l,El(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Ya.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:za.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:za.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:za.Comment,textContent:Ya.textContent(e)||"",rootId:v};default:return!1}}function Tl(e){return null==e?"":e.toLowerCase()}function Nl(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:p,slimDOMOptions:d,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:x=!1,cssCaptured:k=!1,applyBackgroundColorToBlockedElements:O=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=Pl(e,i,a,void 0===E)}const M=Al(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:E,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:x,cssCaptured:k,applyBackgroundColorToBlockedElements:O});if(!M)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===za.Comment)return!0;if(e.type===za.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"===al(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Tl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Tl(e.attributes.name)||"icon"===Tl(e.attributes.rel)||"apple-touch-icon"===Tl(e.attributes.rel)||"shortcut icon"===Tl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Tl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Tl(e.attributes.property).match(/^(og|twitter|fb):/)||Tl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Tl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Tl(e.attributes.name)||"googlebot"===Tl(e.attributes.name)||"bingbot"===Tl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Tl(e.attributes.name)||"generator"===Tl(e.attributes.name)||"framework"===Tl(e.attributes.name)||"publisher"===Tl(e.attributes.name)||"progid"===Tl(e.attributes.name)||Tl(e.attributes.property).match(/^article:/)||Tl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Tl(e.attributes.name)||"yandex-verification"===Tl(e.attributes.name)||"csrf-token"===Tl(e.attributes.name)||"p:domain_verify"===Tl(e.attributes.name)||"verify-v1"===Tl(e.attributes.name)||"verification"===Tl(e.attributes.name)||"shopify-checkout-api-token"===Tl(e.attributes.name)))return!0}}return!1}(M,d)||!I&&M.type===za.Text&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?-2:vl();const P=Object.assign(M,{id:R});if(n.add(e,P),-2===R)return null;y&&y(e);let A=!l;if(P.type===za.Element){A=A&&!P.needBlock,delete P.needBlock;const t=Ya.shadowRoot(e);t&&Qa(t)&&(P.isShadowHost=!0)}if((P.type===za.Document||P.type===za.Element)&&A){d.headWhitespace&&P.type===za.Element&&"head"===P.tagName&&(I=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:E,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:O};if(P.type===za.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else{P.type===za.Element&&void 0!==P.attributes._cssText&&"string"==typeof P.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Ya.childNodes(e))){const e=Nl(r,t);e&&P.childNodes.push(e)}}let x=null;if(Xa(e)&&(x=Ya.shadowRoot(e)))for(const e of Array.from(Ya.childNodes(x))){const r=Nl(e,t);r&&(Qa(x)&&(r.isShadow=!0),P.childNodes.push(r))}}const T=Ya.parentNode(e);return T&&Za(T)&&Qa(T)&&(P.isShadow=!0),P.type===za.Element&&"iframe"===P.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&&v){const r=Nl(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:E,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}},w),P.type===za.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===al(P.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}(e,()=>{if(b){const t=Nl(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:E,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),P}function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _l(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 Dl,Fl={exports:{}};function Ul(){if(Dl)return Fl.exports;Dl=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 Fl.exports=t(),Fl.exports.createColors=t,Fl.exports}const jl=_l(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Bl,zl;function Wl(){if(zl)return Bl;zl=1;let e=Ul(),t=jl;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 Bl=r,r.default=r,Bl}var $l,ql,Vl,Hl,Gl,Jl,Kl,Yl,Xl,Zl,Ql,ec,tc,rc,nc,sc,oc,ic,ac,lc,cc,uc,hc,pc,dc,fc,mc,gc,yc,vc,wc,bc,Sc,Cc,xc,kc,Oc,Ec,Ic,Mc,Rc,Pc,Ac,Tc,Nc,Lc,_c,Dc,Fc,Uc,jc,Bc,zc,Wc={};function $c(){return $l||($l=1,Wc.isClean=Symbol("isClean"),Wc.my=Symbol("my")),Wc}function qc(){if(Vl)return ql;Vl=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 ql=t,t.default=t,ql}function Vc(){if(Gl)return Hl;Gl=1;let e=qc();function t(t,r){new e(r).stringify(t)}return Hl=t,t.default=t,Hl}function Hc(){if(Kl)return Jl;Kl=1;let{isClean:e,my:t}=$c(),r=Wl(),n=qc(),s=Vc();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 Jl=i,i.default=i,Jl}function Gc(){if(Xl)return Yl;Xl=1;let e=Hc();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 Yl=t,t.default=t,Yl}function Jc(){if(Ql)return Zl;Ql=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 Kc(){if(tc)return ec;tc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=jl,{existsSync:r,readFileSync:n}=jl,{dirname:s,join:o}=jl;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 ec=i,i.default=i,ec}function Yc(){if(nc)return rc;nc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=jl,{fileURLToPath:r,pathToFileURL:n}=jl,{isAbsolute:s,resolve:o}=jl,{nanoid:i}=Jc(),a=jl,l=Wl(),c=Kc(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 rc=d,d.default=d,a&&a.registerInput&&a.registerInput(d),rc}function Xc(){if(oc)return sc;oc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=jl,{dirname:r,relative:n,resolve:s,sep:o}=jl,{pathToFileURL:i}=jl,a=Yc(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return sc=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}},sc}function Zc(){if(ac)return ic;ac=1;let e=Hc();class t extends e{constructor(e){super(e),this.type="comment"}}return ic=t,t.default=t,ic}function Qc(){if(cc)return lc;cc=1;let e,t,r,n,{isClean:s,my:o}=$c(),i=Gc(),a=Zc(),l=Hc();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},lc=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)})},lc}function eu(){if(hc)return uc;hc=1;let e,t,r=Qc();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},uc=n,n.default=n,uc}function tu(){if(dc)return pc;dc=1;let e={};return pc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function ru(){if(mc)return fc;mc=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 fc=e,e.default=e,fc}function nu(){if(yc)return gc;yc=1;let e=ru();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 gc=t,t.default=t,gc}function su(){if(Sc)return bc;Sc=1;let e=Qc();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 bc=t,t.default=t,e.registerAtRule(t),bc}function ou(){if(xc)return Cc;xc=1;let e,t,r=Qc();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},Cc=n,n.default=n,r.registerRoot(n),Cc}function iu(){if(Oc)return kc;Oc=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 kc=e,e.default=e,kc}function au(){if(Ic)return Ec;Ic=1;let e=Qc(),t=iu();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 Ec=r,r.default=r,e.registerRule(r),Ec}function lu(){if(Rc)return Mc;Rc=1;let e=Gc(),t=function(){if(wc)return vc;wc=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),p=")".charCodeAt(0),d="{".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 vc=function(x,k={}){let O,E,I,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{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||k){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||k){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||k?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=su(),s=ou(),o=au();const i={empty:!0,space:!0};return Mc=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})}},Mc}function cu(){if(Ac)return Pc;Ac=1;let e=Qc(),t=lu(),r=Yc();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 Pc=n,n.default=n,e.registerParse(n),Pc}function uu(){if(Nc)return Tc;Nc=1;let{isClean:e,my:t}=$c(),r=Xc(),n=Vc(),s=Qc(),o=eu(),i=tu(),a=nu(),l=cu(),c=ou();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},Tc=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),Tc}function hu(){if(Fc)return Dc;Fc=1;let e=function(){if(_c)return Lc;_c=1;let e=Xc(),t=Vc(),r=tu(),n=cu();const s=nu();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 Lc=o,o.default=o,Lc}(),t=uu(),r=eu(),n=ou();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 Dc=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Dc}var pu=function(){if(zc)return Bc;zc=1;let e=Wl(),t=Gc(),r=uu(),n=Qc(),s=hu(),o=Vc(),i=function(){if(jc)return Uc;jc=1;let e=Gc(),t=Kc(),r=Zc(),n=su(),s=Yc(),o=ou(),i=au();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 Uc=a,a.default=a,Uc}(),a=eu(),l=ru(),c=Zc(),u=su(),h=nu(),p=Yc(),d=cu(),f=iu(),m=au(),g=ou(),y=Hc();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Bc=v,v.default=v,Bc}();const du=Ll(pu);du.stringify,du.fromJSON,du.plugin,du.parse,du.list,du.document,du.comment,du.atRule,du.rule,du.decl,du.root,du.CssSyntaxError,du.Declaration,du.Container,du.Processor,du.Document,du.Comment,du.Warning,du.AtRule,du.Result,du.Input,du.Rule,du.Root,du.Node;var fu=Object.defineProperty,mu=(e,t,r)=>((e,t,r)=>t in e?fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function gu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yu(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 vu,wu={exports:{}};function bu(){if(vu)return wu.exports;vu=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 wu.exports=t(),wu.exports.createColors=t,wu.exports}const Su=yu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Cu,xu;function ku(){if(xu)return Cu;xu=1;let e=bu(),t=Su;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 Cu=r,r.default=r,Cu}var Ou,Eu,Iu,Mu,Ru,Pu,Au,Tu,Nu,Lu,_u,Du,Fu,Uu,ju,Bu,zu,Wu,$u,qu,Vu,Hu,Gu,Ju,Ku,Yu,Xu,Zu,Qu,eh,th,rh,nh,sh,oh,ih,ah,lh,ch,uh,hh,ph,dh,fh,mh,gh,yh,vh,wh,bh,Sh,Ch,xh,kh={};function Oh(){return Ou||(Ou=1,kh.isClean=Symbol("isClean"),kh.my=Symbol("my")),kh}function Eh(){if(Iu)return Eu;Iu=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 Eu=t,t.default=t,Eu}function Ih(){if(Ru)return Mu;Ru=1;let e=Eh();function t(t,r){new e(r).stringify(t)}return Mu=t,t.default=t,Mu}function Mh(){if(Au)return Pu;Au=1;let{isClean:e,my:t}=Oh(),r=ku(),n=Eh(),s=Ih();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 Pu=i,i.default=i,Pu}function Rh(){if(Nu)return Tu;Nu=1;let e=Mh();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 Tu=t,t.default=t,Tu}function Ph(){if(_u)return Lu;_u=1;return Lu={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}},Lu}function Ah(){if(Fu)return Du;Fu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Su,{existsSync:r,readFileSync:n}=Su,{dirname:s,join:o}=Su;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 Du=i,i.default=i,Du}function Th(){if(ju)return Uu;ju=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Su,{fileURLToPath:r,pathToFileURL:n}=Su,{isAbsolute:s,resolve:o}=Su,{nanoid:i}=Ph(),a=Su,l=ku(),c=Ah(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),p=Boolean(o&&s);class d{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&&(!p||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=o(t.from)),p&&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 p=c.sourceContentFor(u.source);return p&&(h.source=p),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 Uu=d,d.default=d,a&&a.registerInput&&a.registerInput(d),Uu}function Nh(){if(zu)return Bu;zu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Su,{dirname:r,relative:n,resolve:s,sep:o}=Su,{pathToFileURL:i}=Su,a=Th(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&o);return Bu=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}},Bu}function Lh(){if($u)return Wu;$u=1;let e=Mh();class t extends e{constructor(e){super(e),this.type="comment"}}return Wu=t,t.default=t,Wu}function _h(){if(Vu)return qu;Vu=1;let e,t,r,n,{isClean:s,my:o}=Oh(),i=Rh(),a=Lh(),l=Mh();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},qu=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)})},qu}function Dh(){if(Gu)return Hu;Gu=1;let e,t,r=_h();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},Hu=n,n.default=n,Hu}function Fh(){if(Ku)return Ju;Ku=1;let e={};return Ju=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Uh(){if(Xu)return Yu;Xu=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 Yu=e,e.default=e,Yu}function jh(){if(Qu)return Zu;Qu=1;let e=Uh();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 Bh(){if(nh)return rh;nh=1;let e=_h();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 rh=t,t.default=t,e.registerAtRule(t),rh}function zh(){if(oh)return sh;oh=1;let e,t,r=_h();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},sh=n,n.default=n,r.registerRoot(n),sh}function Wh(){if(ah)return ih;ah=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 ih=e,e.default=e,ih}function $h(){if(ch)return lh;ch=1;let e=_h(),t=Wh();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 lh=r,r.default=r,e.registerRule(r),lh}function qh(){if(hh)return uh;hh=1;let e=Rh(),t=function(){if(th)return eh;th=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),p=")".charCodeAt(0),d="{".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 eh=function(x,k={}){let O,E,I,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,U=0,j=[],B=[];function z(e){throw x.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(x){if(B.length)return B.pop();if(U>=F)return;let k=!!x&&x.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 d:case f:case y:case m:case p:{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||k){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||k){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||k?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=Lh(),n=Bh(),s=zh(),o=$h();const i={empty:!0,space:!0};return uh=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})}},uh}function Vh(){if(dh)return ph;dh=1;let e=_h(),t=qh(),r=Th();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 ph=n,n.default=n,e.registerParse(n),ph}function Hh(){if(mh)return fh;mh=1;let{isClean:e,my:t}=Oh(),r=Nh(),n=Ih(),s=_h(),o=Dh(),i=Fh(),a=jh(),l=Vh(),c=zh();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},p={Once:!0,postcssPlugin:!0,prepare:!0};function d(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(!p[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(d(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(d(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 d(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(d(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(d(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},fh=v,v.default=v,c.registerLazyResult(v),o.registerLazyResult(v),fh}function Gh(){if(wh)return vh;wh=1;let e=function(){if(yh)return gh;yh=1;let e=Nh(),t=Ih(),r=Fh(),n=Vh();const s=jh();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 gh=o,o.default=o,gh}(),t=Hh(),r=Dh(),n=zh();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 vh=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),vh}var Jh=function(){if(xh)return Ch;xh=1;let e=ku(),t=Rh(),r=Hh(),n=_h(),s=Gh(),o=Ih(),i=function(){if(Sh)return bh;Sh=1;let e=Rh(),t=Ah(),r=Lh(),n=Bh(),s=Th(),o=zh(),i=$h();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 bh=a,a.default=a,bh}(),a=Dh(),l=Uh(),c=Lh(),u=Bh(),h=jh(),p=Th(),d=Vh(),f=Wh(),m=$h(),g=zh(),y=Mh();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=d,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=p,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Ch=v,v.default=v,Ch}();const Kh=gu(Jh);Kh.stringify,Kh.fromJSON,Kh.plugin,Kh.parse,Kh.list,Kh.document,Kh.comment,Kh.atRule,Kh.rule,Kh.decl,Kh.root,Kh.CssSyntaxError,Kh.Declaration,Kh.Container,Kh.Processor,Kh.Document,Kh.Comment,Kh.Warning,Kh.AtRule,Kh.Result,Kh.Input,Kh.Rule,Kh.Root,Kh.Node;class Yh{constructor(...e){mu(this,"parentElement",null),mu(this,"parentNode",null),mu(this,"ownerDocument"),mu(this,"firstChild",null),mu(this,"lastChild",null),mu(this,"previousSibling",null),mu(this,"nextSibling",null),mu(this,"ELEMENT_NODE",1),mu(this,"TEXT_NODE",3),mu(this,"nodeType"),mu(this,"nodeName"),mu(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 Yh))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 Xh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Qh={};function ep(e){if(Qh[e])return Qh[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 Xh?Xh[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 Qh[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?Qh[e]=o:r}catch{return r}}const tp={};function rp(e,t,r){var n;const s=`${e}.${String(r)}`;if(tp[s])return tp[s].call(t);const o=ep(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(tp[s]=i,i.call(t)):t[r]}const np={};function sp(e,t,r){const n=`${e}.${String(r)}`;if(np[n])return np[n].bind(t);const s=ep(e)[r];return"function"!=typeof s?t[r]:(np[n]=s,s.bind(t))}function op(){return ep("MutationObserver").constructor}const ip={childNodes:function(e){return rp("Node",e,"childNodes")},parentNode:function(e){return rp("Node",e,"parentNode")},parentElement:function(e){return rp("Node",e,"parentElement")},textContent:function(e){return rp("Node",e,"textContent")},contains:function(e,t){return sp("Node",e,"contains")(t)},getRootNode:function(e){return sp("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?rp("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?rp("Element",e,"shadowRoot"):null},querySelector:function(e,t){return rp("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return rp("Element",e,"querySelectorAll")(t)},mutationObserver:op};function ap(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const lp="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 cp={map:{},getId:()=>(console.error(lp),-1),getNode:()=>(console.error(lp),null),removeNodeFromMap(){console.error(lp)},has:()=>(console.error(lp),!1),reset(){console.error(lp)}};function up(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 hp(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)}}),()=>hp(e,t,o||{},!0)}function pp(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&&(cp=new Proxy(cp,{get:(e,t,r)=>("map"===t&&console.error(lp),Reflect.get(e,t,r))}));let dp=Date.now;function fp(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=ip.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=ip.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function mp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gp(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function yp(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ip.parentElement(e)}function vp(e,t,r,n){if(!e)return!1;const s=yp(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(Rl(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 wp(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function bp(e,t){if(Za(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=ip.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||bp(n,t))}function Sp(e){return Boolean(e.changedTouches)}function Cp(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function xp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function kp(e){return!!e&&(e instanceof Yh&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ip.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(dp=()=>(new Date).getTime());class Op{constructor(){Ua(this,"id",1),Ua(this,"styleIDMap",new WeakMap),Ua(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 Ep(e){var t;let r=null;return"getRootNode"in e&&(null==(t=ip.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ip.host(ip.getRootNode(e))&&(r=ip.host(ip.getRootNode(e))),r}function Ip(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Ep(r);)r=t;return r}(e);return ip.contains(t,r)}function Mp(e){const t=e.ownerDocument;return!!t&&(ip.contains(t,e)||Ip(e))}var Rp=(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))(Rp||{}),Pp=(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))(Pp||{}),Ap=(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))(Ap||{}),Tp=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Tp||{}),Np=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Np||{}),Lp=(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))(Lp||{}),_p=(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))(_p||{});function Dp(e){return"__ln"in e}class Fp{constructor(){Ua(this,"length",0),Ua(this,"head",null),Ua(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&&Dp(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&&Dp(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 Up=(e,t)=>`${e}@${t}`;class jp{constructor(){Ua(this,"frozen",!1),Ua(this,"locked",!1),Ua(this,"texts",[]),Ua(this,"attributes",[]),Ua(this,"attributeMap",new WeakMap),Ua(this,"removes",[]),Ua(this,"mapRemoves",[]),Ua(this,"movedMap",{}),Ua(this,"addedSet",new Set),Ua(this,"movedSet",new Set),Ua(this,"droppedSet",new Set),Ua(this,"removesSubTreeCache",new Set),Ua(this,"mutationCb"),Ua(this,"blockClass"),Ua(this,"blockSelector"),Ua(this,"maskTextClass"),Ua(this,"maskTextSelector"),Ua(this,"inlineStylesheet"),Ua(this,"maskInputOptions"),Ua(this,"maskTextFn"),Ua(this,"maskInputFn"),Ua(this,"keepIframeSrcFn"),Ua(this,"recordCanvas"),Ua(this,"inlineImages"),Ua(this,"slimDOMOptions"),Ua(this,"dataURLOptions"),Ua(this,"doc"),Ua(this,"mirror"),Ua(this,"iframeManager"),Ua(this,"stylesheetManager"),Ua(this,"shadowDomManager"),Ua(this,"canvasManager"),Ua(this,"processedNodeManager"),Ua(this,"unattachedDoc"),Ua(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Ua(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Fp,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=ip.parentNode(s);if(!o||!Mp(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(Ep(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Nl(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=>{Cp(e,this.mirror)&&this.iframeManager.addIframe(e),xp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),kp(s)&&this.shadowDomManager.addShadowRoot(ip.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)zp(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(ip.parentNode(e))||s(e);for(const e of this.addedSet)Wp(this.droppedSet,e)||zp(this.removesSubTreeCache,e,this.mirror)?Wp(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(ip.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(ip.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=ip.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=ip.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=ip.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))}),Ua(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(ip.childNodes(e),e=>ip.textContent(e)||"").join("");t.attributes.value=nl({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:il(e),value:r,maskInputFn:this.maskInputFn})}),Ua(this,"processMutation",e=>{if(!wp(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=ip.textContent(e.target);vp(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Pl(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,yp(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=il(t);n=nl({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(vp(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"),!Ml(t.tagName,r))if(s.attributes[r]=Il(this.doc,sl(t.tagName),sl(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===o?n:[n,o]:s._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":if(vp(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(ip.host(e.target)):this.mirror.getId(e.target);vp(e.target,this.blockClass,this.blockSelector,!1)||wp(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Bp(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||bp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Up(r,n)]?Bp(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Za(e.target)||!Qa(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),ip.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Ua(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(wp(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[Up(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);vp(e,this.blockClass,this.blockSelector,!1)||(ip.childNodes(e).forEach(e=>this.genAdds(e)),kp(e)&&ip.childNodes(ip.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Bp(e,t){e.delete(t),ip.childNodes(t).forEach(t=>Bp(e,t))}function zp(e,t,r){return 0!==e.size&&function(e,t){const r=ip.parentNode(t);return!!r&&e.has(r)}(e,t)}function Wp(e,t){return 0!==e.size&&$p(e,t)}function $p(e,t){const r=ip.parentNode(t);return!!r&&(!!e.has(r)||$p(e,r))}let qp;const Vp=e=>{if(!qp)return e;return(...t)=>{try{return e(...t)}catch(e){if(qp&&!0===qp(e))return;throw e}}};function Hp(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Gp=[];function Jp(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 Kp(e,t){const r=new jp;Gp.push(r),r.init(e);const n=new(op())(Vp(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Yp({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(Ap).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=sl(o);const c=(t=>o=>{const i=Jp(o);if(vp(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Tp.Mouse;break;case"touch":a=Tp.Touch;break;case"pen":a=Tp.Pen}a===Tp.Touch?Ap[t]===Ap.MouseDown?c="TouchStart":Ap[t]===Ap.MouseUp&&(c="TouchEnd"):Tp.Pen}else Sp(o)&&(a=Tp.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Tp.Touch||c.startsWith("Mouse")&&a===Tp.Mouse)&&(a=null)):Ap[t]===Ap.Click&&(a=l,l=null);const u=Sp(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:p,clientY:d}=u;Vp(e)({type:Ap[c],id:h,x:p,y:d,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Ap[o]){case Ap.MouseDown:case Ap.MouseUp:i=i.replace("mouse","pointer");break;case Ap.TouchStart:case Ap.TouchEnd:return}a.push(ap(i,c,t))}),Vp(()=>{a.forEach(e=>e())})}function Xp({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=Vp(up(Vp(o=>{const i=Jp(o);if(!i||vp(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=fp(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 ap("scroll",i,t)}const Zp=["INPUT","TEXTAREA","SELECT"],Qp=new WeakMap;function ed(e){return function(e,t){if(sd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||sd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||sd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||sd("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 td(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function rd({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(ip.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}}),Vp(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function nd(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:p,selectionCb:d,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),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Kp(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=up(Vp(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=Vp(up(Vp(e=>{const t=Jp(e),{clientX:r,clientY:s}=Sp(e)?e.changedTouches[0]:e;i||(i=dp()),a.push({x:r,y:s,id:n.getId(t),timeOffset:dp()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Pp.Drag:e instanceof MouseEvent?Pp.MouseMove:Pp.TouchMove)}),s,{trailing:!1})),u=[ap("mousemove",c,r),ap("touchmove",c,r),ap("drag",c,r)];return Vp(()=>{u.forEach(e=>e())})}(e),o=Yp(e),i=Xp(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return ap("resize",Vp(up(Vp(()=>{const t=mp(),s=gp();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=Jp(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=ip.parentElement(r)),!r||!h||Zp.indexOf(h)<0||vp(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let d=r.value,f=!1;const m=il(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(d=nl({element:r,maskInputOptions:a,tagName:h,type:m,value:d,maskInputFn:l})),p(r,u?{text:d,isChecked:f,userTriggered:c}:{text:d,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;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,n){const s=Qp.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Qp.set(t,n);const s=r.getId(t);Vp(e)({...n,id:s})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>ap(e,Vp(h),t)),f=t.defaultView;if(!f)return()=>{d.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&&d.push(...g.map(e=>hp(e[0],e[1],{set(){Vp(h)({target:this,isTrusted:!1})}},!1,f))),Vp(()=>{d.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=Vp(o=>up(Vp(s=>{const i=Jp(s);if(!i||vp(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=[ap("play",i(Lp.Play),o),ap("pause",i(Lp.Pause),o),ap("seeked",i(Lp.Seeked),o),ap("volumechange",i(Lp.VolumeChange),o),ap("ratechange",i(Lp.RateChange),o)];return Vp(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},p=()=>{},d=()=>{};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:Vp((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=td(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),Hp(()=>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:Vp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=td(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),Hp(()=>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:Vp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=td(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:Vp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=td(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};od("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(od("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),od("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),od("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:Vp((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=td(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...ed(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:Vp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=td(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...ed(s),i]}]}),n.apply(s,o)})})}),Vp(()=>{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=rd(e,e.doc),p=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:Vp((s,i,a)=>{var l;const[c,u,h]=a;if(r.has(c))return o.apply(i,[c,u,h]);const{id:p,styleId:d}=td(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(p&&-1!==p||d&&-1!==d)&&e({id:p,styleId:d,set:{property:c,value:u,priority:h},index:ed(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Vp((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=td(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:ed(o.parentRule)}),s.apply(o,a)})}),Vp(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(d=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=pp(t.fonts,"add",function(t){return function(r){return setTimeout(Vp(()=>{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),Vp(()=>{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=Vp(()=>{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;vp(i,n,s,!0)||vp(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),ap("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?pp(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 Vp(()=>{Gp.forEach(e=>e.reset()),null==n||n.disconnect(),s(),o(),i(),a(),l(),c(),u(),h(),p(),d(),f(),m(),g.forEach(e=>e())})}function sd(e){return void 0!==window[e]}function od(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class id{constructor(e){Ua(this,"iframeIdToRemoteIdMap",new WeakMap),Ua(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 ad{constructor(e){Ua(this,"iframes",new WeakMap),Ua(this,"crossOriginIframeMap",new WeakMap),Ua(this,"crossOriginIframeMirror",new id(vl)),Ua(this,"crossOriginIframeStyleMirror"),Ua(this,"crossOriginIframeRootIdMap",new WeakMap),Ua(this,"mirror"),Ua(this,"mutationCb"),Ua(this,"wrappedEmit"),Ua(this,"loadListener"),Ua(this,"stylesheetManager"),Ua(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new id(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 Rp.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:Rp.IncrementalSnapshot,data:{source:Pp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Rp.Meta:case Rp.Load:case Rp.DomContentLoaded:return!1;case Rp.Plugin:return t;case Rp.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Rp.IncrementalSnapshot:switch(t.data.source){case Pp.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 Pp.Drag:case Pp.TouchMove:case Pp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Pp.ViewportResize:return!1;case Pp.MediaInteraction:case Pp.MouseInteraction:case Pp.Scroll:case Pp.CanvasMutation:case Pp.Input:return this.replaceIds(t.data,e,["id"]),t;case Pp.StyleSheetRule:case Pp.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Pp.Font:return t;case Pp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Pp.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===_p.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class ld{constructor(e){Ua(this,"shadowDoms",new WeakSet),Ua(this,"mutationCb"),Ua(this,"scrollCb"),Ua(this,"bypassOptions"),Ua(this,"mirror"),Ua(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(!Qa(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Kp({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Xp({...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(ip.host(e))),this.restoreHandlers.push(rd({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(pp(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=ip.shadowRoot(this);return o&&Mp(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var cd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ud="undefined"==typeof Uint8Array?[]:new Uint8Array(256),hd=0;hd<64;hd++)ud[cd.charCodeAt(hd)]=hd;const pd=new Map;const dd=(e,t,r)=>{if(!e||!gd(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=pd.get(e);return r||(r=new Map,pd.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 fd(e,t,r){if(e instanceof Array)return e.map(e=>fd(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+=cd[r[t]>>2],s+=cd[(3&r[t])<<4|r[t+1]>>4],s+=cd[(15&r[t+1])<<2|r[t+2]>>6],s+=cd[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:[fd(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:[fd(e.data,t,r),e.width,e.height]}}if(gd(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:dd(e,t,r)}}return e}const md=(e,t,r)=>e.map(e=>fd(e,t,r)),gd=(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 yd(e,t,r,n){const s=[];try{const o=pp(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!vp(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 vd(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=pp(e,l,function(e){return function(...i){const a=e.apply(this,i);if(dd(a,o,this),"tagName"in this.canvas&&!vp(this.canvas,n,s,!0)){const e=md(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=hp(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const wd='(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',bd="undefined"!=typeof self&&self.Blob&&new Blob([wd],{type:"text/javascript;charset=utf-8"});function Sd(e){let t;try{if(t=bd&&(self.URL||self.webkitURL).createObjectURL(bd),!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(wd),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Cd{constructor(e){Ua(this,"pendingCanvasMutations",new Map),Ua(this,"rafStamps",{latestId:0,invokeId:null}),Ua(this,"mirror"),Ua(this,"mutationCb"),Ua(this,"resetObservers"),Ua(this,"frozen",!1),Ua(this,"locked",!1),Ua(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=yd(t,r,n,!0),i=new Map,a=new Sd;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:Np["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=>{vp(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=yd(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=pp(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return vp(this.canvas,r,n,!0)||setTimeout(()=>{const r=md(o,t,this);e(this.canvas,{type:Np["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=hp(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Np["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(...vd(t.WebGLRenderingContext.prototype,Np.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...vd(t.WebGL2RenderingContext.prototype,Np.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 xd{constructor(e){Ua(this,"trackedLinkElements",new WeakSet),Ua(this,"mutationCb"),Ua(this,"adoptedStyleSheetCb"),Ua(this,"styleMirror",new Op),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:tl(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 kd{constructor(){Ua(this,"nodeMap",new WeakMap),Ua(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 Od,Ed,Id,Md=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(_a=e.contentWindow)?void 0:_a.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Rd=new rl;function Pd(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:p,slimDOMOptions:d,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:v={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:x=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:I=!1,plugins:M,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:A,applyBackgroundColorToBlockedElements:T=!1}=e;qp=A;const N=!x||window.parent===window;let L=!1;if(!N)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!L)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),Rd.reset();const _=!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!==p?p:{password:!0},D=!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===d,headMetaDescKeywords:"all"===d,headTitleMutations:"all"===d}:d||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const j=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!L&&(e=y(e)),e};Od=(e,s)=>{var o;const i=e;if(i.timestamp=dp(),!(null==(o=Gp[0])?void 0:o.isFrozen())||i.type===Rp.FullSnapshot||i.type===Rp.IncrementalSnapshot&&i.data.source===Pp.Mutation||Gp.forEach(e=>e.unfreeze()),N)null==t||t(j(i),s);else if(L){const e={type:"rrweb",event:j(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===Rp.FullSnapshot)F=i,U=0;else if(i.type===Rp.IncrementalSnapshot){if(i.data.source===Pp.Mutation&&i.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&i.timestamp-F.timestamp>r;(e||t)&&Ed(!0)}};const B=e=>{Od({type:Rp.IncrementalSnapshot,data:{source:Pp.Mutation,...e}})},z=e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.Scroll,...e}}),W=e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.CanvasMutation,...e}}),$=new xd({mutationCb:B,adoptedStyleSheetCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.AdoptedStyleSheet,...e}})}),q=new ad({mirror:Rd,mutationCb:B,stylesheetManager:$,recordCrossOriginIframes:x,wrappedEmit:Od});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:Rd,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const V=new kd;Id=new Cd({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:o,mirror:Rd,sampling:v.canvas,dataURLOptions:w});const H=new ld({mutationCb:B,scrollCb:z,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:_,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:I,sampling:v,slimDOMOptions:D,iframeManager:q,stylesheetManager:$,canvasManager:Id,keepIframeSrcFn:R,processedNodeManager:V},mirror:Rd});Ed=(e=!1)=>{if(!S)return;Od({type:Rp.Meta,data:{href:window.location.href,width:gp(),height:mp()}},e),$.reset(),H.init(),Gp.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new rl,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:p,slimDOM:d=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return Nl(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:p,slimDOMOptions:!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===d,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===d?{}:d,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:Rd,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:_,maskTextFn:m,maskInputFn:f,slimDOM:D,dataURLOptions:w,recordCanvas:C,inlineImages:I,applyBackgroundColorToBlockedElements:T,onSerialize:e=>{Cp(e,Rd)&&q.addIframe(e),xp(e,Rd)&&$.trackLinkElement(e),kp(e)&&H.addShadowRoot(ip.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{$.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");Od({type:Rp.FullSnapshot,data:{node:t,initialOffset:fp(window)}},e),Gp.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&$.adoptStyleSheets(document.adoptedStyleSheets,Rd.getId(document))};try{const e=[],t=e=>{var t;return Vp(nd)({mutationCb:B,mousemoveCb:(e,t)=>Od({type:Rp.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.ViewportResize,...e}}),inputCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.Input,...e}}),mediaInteractionCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.MediaInteraction,...e}}),styleSheetRuleCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.StyleSheetRule,...e}}),styleDeclarationCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>Od({type:Rp.IncrementalSnapshot,data:{source:Pp.Font,...e}}),selectionCb:e=>{Od({type:Rp.IncrementalSnapshot,data:{source:Pp.Selection,...e}})},customElementCb:e=>{Od({type:Rp.IncrementalSnapshot,data:{source:Pp.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:_,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:I,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:D,dataURLOptions:w,mirror:Rd,iframeManager:q,stylesheetManager:$,shadowDomManager:H,processedNodeManager:V,canvasManager:Id,ignoreCSSAttributes:P,plugins:(null==(t=null==M?void 0:M.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Od({type:Rp.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};q.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Ed(),e.push(t(document)),Md=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(ap("DOMContentLoaded",()=>{Od({type:Rp.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(ap("load",()=>{Od({type:Rp.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),V.destroy(),Md=!1,qp=void 0}}catch(e){console.warn(e)}}var Ad;Pd.addCustomEvent=(e,t)=>{if(!Md)throw new Error("please add custom event after start recording");Od({type:Rp.Custom,data:{tag:e,payload:t}})},Pd.freezePage=()=>{Gp.forEach(e=>e.freeze())},Pd.takeFullSnapshot=e=>{if(!Md)throw new Error("please take full snapshot after start recording");Ed(e)},Pd.mirror=Rd,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Ad||(Ad={}));var Td=Object.freeze({__proto__:null,record:Pd}),Nd=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=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;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},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=a.sent(),c=Date.now(),s.status=o.status,s.duration=c-e,i={},o.headers.forEach(function(e,t){i[t]=e}),s.responseHeaders=i,this.notifyEvent(s),[2,o];case 3:throw l=a.sent(),c=Date.now(),s.duration=c-e,u=l,s.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(s),l;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),Ld=Object.freeze({__proto__:null,NetworkObservers:Nd});return e.SessionReplayPlugin=Ar,e.plugin=Tr,e.sessionReplayPlugin=Tr,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
2
2
|
//# sourceMappingURL=plugin-session-replay-browser-min.js.map
|