@adora-so/adora-js 0.0.2 → 0.0.3
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/dist/index.cjs +22 -22
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +22 -22
- package/dist/index.mjs.map +4 -4
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var Nl=Object.defineProperty;var Ml=(s,e,t)=>e in s?Nl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var fe=(s,e,t)=>Ml(s,typeof e!="symbol"?e+"":e,t);var kl={"Content-Type":"application/json"},Pl=/\{[^{}]+\}/g,is=class extends Request{constructor(e,t){super(e,t);for(let r in t)r in this||(this[r]=t[r])}};function as(s){let{baseUrl:e="",fetch:t=globalThis.fetch,querySerializer:r,bodySerializer:n,headers:o,...i}={...s};e.endsWith("/")&&(e=e.substring(0,e.length-1)),o=uo(kl,o);let l=[];async function a(u,c){let{fetch:d=t,headers:p,params:m={},parseAs:g="json",querySerializer:f,bodySerializer:h=n??Ll,...E}=c||{},S=typeof r=="function"?r:lo(r);f&&(S=typeof f=="function"?f:lo({...typeof r=="object"?r:{},...f}));let w={redirect:"follow",...i,...E,headers:uo(o,p,m.header)};w.body&&(w.body=h(w.body)),w.body instanceof FormData&&w.headers.delete("Content-Type");let I=new is(Fl(u,{baseUrl:e,params:m,querySerializer:S}),w),_={baseUrl:e,fetch:d,parseAs:g,querySerializer:S,bodySerializer:h};for(let v of l)if(v&&typeof v=="object"&&typeof v.onRequest=="function"){I.schemaPath=u,I.params=m;let x=await v.onRequest(I,_);if(x){if(!(x instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");I=x}}let y=await d(I);for(let v=l.length-1;v>=0;v--){let x=l[v];if(x&&typeof x=="object"&&typeof x.onResponse=="function"){let O=await x.onResponse(y,_);if(O){if(!(O instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");y=O}}}if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok)return g==="stream"?{data:y.body,response:y}:{data:await y[g](),response:y};let R=await y.text();try{R=JSON.parse(R)}catch{}return{error:R,response:y}}return{async GET(u,c){return a(u,{...c,method:"GET"})},async PUT(u,c){return a(u,{...c,method:"PUT"})},async POST(u,c){return a(u,{...c,method:"POST"})},async DELETE(u,c){return a(u,{...c,method:"DELETE"})},async OPTIONS(u,c){return a(u,{...c,method:"OPTIONS"})},async HEAD(u,c){return a(u,{...c,method:"HEAD"})},async PATCH(u,c){return a(u,{...c,method:"PATCH"})},async TRACE(u,c){return a(u,{...c,method:"TRACE"})},use(...u){for(let c of u)if(c){if(typeof c!="object"||!("onRequest"in c||"onResponse"in c))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");l.push(c)}},eject(...u){for(let c of u){let d=l.indexOf(c);d!==-1&&l.splice(d,1)}}}}function Gt(s,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${s}=${t?.allowReserved===!0?e:encodeURIComponent(e)}`}function co(s,e,t){if(!e||typeof e!="object")return"";let r=[],n={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(let l in e)r.push(l,t.allowReserved===!0?e[l]:encodeURIComponent(e[l]));let i=r.join(",");switch(t.style){case"form":return`${s}=${i}`;case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;default:return i}}for(let i in e){let l=t.style==="deepObject"?`${s}[${i}]`:i;r.push(Gt(l,e[i],t))}let o=r.join(n);return t.style==="label"||t.style==="matrix"?`${n}${o}`:o}function ho(s,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){let o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",i=(t.allowReserved===!0?e:e.map(l=>encodeURIComponent(l))).join(o);switch(t.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;default:return`${s}=${i}`}}let r={simple:",",label:".",matrix:";"}[t.style]||"&",n=[];for(let o of e)t.style==="simple"||t.style==="label"?n.push(t.allowReserved===!0?o:encodeURIComponent(o)):n.push(Gt(s,o,t));return t.style==="label"||t.style==="matrix"?`${r}${n.join(r)}`:n.join(r)}function lo(s){return function(t){let r=[];if(t&&typeof t=="object")for(let n in t){let o=t[n];if(o!=null){if(Array.isArray(o)){r.push(ho(n,o,{style:"form",explode:!0,...s?.array,allowReserved:s?.allowReserved||!1}));continue}if(typeof o=="object"){r.push(co(n,o,{style:"deepObject",explode:!0,...s?.object,allowReserved:s?.allowReserved||!1}));continue}r.push(Gt(n,o,s))}}return r.join("&")}}function $l(s,e){let t=s;for(let r of s.match(Pl)??[]){let n=r.substring(1,r.length-1),o=!1,i="simple";if(n.endsWith("*")&&(o=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(i="label",n=n.substring(1)):n.startsWith(";")&&(i="matrix",n=n.substring(1)),!e||e[n]===void 0||e[n]===null)continue;let l=e[n];if(Array.isArray(l)){t=t.replace(r,ho(n,l,{style:i,explode:o}));continue}if(typeof l=="object"){t=t.replace(r,co(n,l,{style:i,explode:o}));continue}if(i==="matrix"){t=t.replace(r,`;${Gt(n,l)}`);continue}t=t.replace(r,i==="label"?`.${l}`:l)}return t}function Ll(s){return JSON.stringify(s)}function Fl(s,e){let t=`${e.baseUrl}${s}`;e.params?.path&&(t=$l(t,e.params.path));let r=e.querySerializer(e.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(t+=`?${r}`),t}function uo(...s){let e=new Headers;for(let t of s){if(!t||typeof t!="object")continue;let r=t instanceof Headers?t.entries():Object.entries(t);for(let[n,o]of r)if(o===null)e.delete(n);else if(Array.isArray(o))for(let i of o)e.append(n,i);else o!==void 0&&e.set(n,o)}return e}var we=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(we||{}),pt=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(pt||{}),ls=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(ls||{});var Ul="Adora.URLChange",fo="Adora.Cohort",zl="Adora.AddCohort",Hl="Adora.Click";var us=["onclick","ondblclick","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onchange","onfocus","onblur","onscroll","onselect","onsubmit","onkeydown","onkeypress","onkeyup","onload","onunload"];function po({dom0EventHandlers:s,delay:e,timestamp:t}){return{type:we.Custom,data:{tag:Hl,payload:{dom0EventHandlers:s}},delay:e,timestamp:t}}function mt({payload:s,delay:e,timestamp:t}){return{type:we.Custom,data:{tag:zl,payload:s},delay:e,timestamp:t}}function mo({href:s,delay:e,timestamp:t}){return{type:we.Custom,data:{tag:Ul,payload:{href:s}},delay:e,timestamp:t}}function he(s){throw new Error(`This code path should be unreachable: ${s}`)}import{uuidv7 as Jm}from"uuidv7";var ig=1e3*60*30;var ag=10080*60*1e3;var yo="https://c.adora-cdn.com";var Oe=class{constructor(e){fe(this,"backendClient");fe(this,"eventPostBackendClient");this.backendClient=ds({baseUrl:e??yo})}getOrCreateEventPostClient(e){return!e.eventPostUrl||!e.eventPostToken?{path:e.sessionId,client:this.backendClient}:(this.eventPostBackendClient||(this.eventPostBackendClient=ds({baseUrl:e.eventPostUrl})),{path:e.sessionId,client:this.eventPostBackendClient})}async sessionPreload({orgId:e}){return this.backendClient.POST("/sessions/preload",{body:{orgId:e},mode:"cors"}).catch(()=>{})}async startSession({bypassSampling:e,orgId:t,language:r,domain:n,userCohorts:o,uid:i,devicePixelRatio:l,adoraUserId:a,userAgent:u,documentReferrer:c,snippetVersion:d}){return this.backendClient.POST("/sessions/start",{body:{bypassSampling:e,orgId:t,language:r,domain:n,devicePixelRatio:l,userCohorts:o||{},userAgent:u,uid:typeof i=="number"?i.toString():i!=="null"&&i!=="undefined"?i:void 0,adoraUserId:a,documentReferrer:c,snippetVersion:d},mode:"cors"}).catch(()=>{})}async gzipWithCompressionStream(e){let t=JSON.stringify(e),n=new TextEncoder().encode(t),o=new CompressionStream("gzip"),l=new ReadableStream({start(u){u.enqueue(n),u.close()}}).pipeThrough(o);return new Response(l).arrayBuffer()}async saveSessionEvents({sessionId:e,events:t,metadata:r,eventPostUrl:n,eventPostToken:o,fastpathToken:i}){let{path:l,client:a}=this.getOrCreateEventPostClient({sessionId:e,eventPostToken:o,eventPostUrl:n}),u={events:t.slice(),metadata:r,fastpathToken:i},c={params:{path:{sessionId:l}},headers:o?{token:o}:void 0};if(typeof CompressionStream<"u"){let d=await this.gzipWithCompressionStream(u);return a.POSTGzipped("/sessions/{sessionId}/events",{...c,body:d}).catch(()=>{})}return a.POST("/sessions/{sessionId}/events",{...c,body:u}).catch(()=>{})}async refreshEventToken(e){return await this.backendClient.POST("/sessions/{sessionId}/events/token",{params:{path:{sessionId:e.sessionId}},body:{},mode:"cors"}).catch(()=>{})}async syncSession(e){return await this.backendClient.POST("/sessions/{sessionId}/sync",{params:{path:{sessionId:e.sessionId}}}).catch(()=>{})}};import{makeRe as Ql,minimatch as eu}from"minimatch";function tu(s){return s.endsWith("$")&&(s=s.substring(0,s.length-1)),(s.endsWith("+?")||s.endsWith("*?"))&&(s=s.substring(0,s.length-1)),s}function Je(s,e){let t=e.replace||e.path;switch(e.type){case"regexp":{let r=(e.path.startsWith("^")?"":"^")+e.path+(!e.path.endsWith("$")&&!e.partial?"$":""),n=new RegExp(r);return n.test(s)?e.partial?s.replace(n,t):t:void 0}case"wildcard":case void 0:if(e.partial){let r=Ql(e.path,{partial:e.partial,dot:!0});if(!r)throw new Error("unable to make regexp");let n=new RegExp(tu(r.source));return n.test(s)?s.replace(n,t):void 0}return eu(s,e.path,{dot:!0})?t:void 0;default:he(e.type)}}var hs;(function(s){s.GOAL_SURVEY_FINISHED="goal_survey_finished",s.WELCOME_DIALOG_FINISHED="welcome_dialog_finished"})(hs||(hs={}));var fs;(function(s){s.EXPLORE_AND_VISUALIZE="Explore and visualize",s.MEASURE_AND_OPTIMIZE="Measure and optimize",s.IDENTIFY_FRICTION="Identify friction",s.DIAGNOSE_ISSUES="Diagnose issues"})(fs||(fs={}));var ps;(function(s){s.SKIPPED="skipped",s.COMPLETED="completed"})(ps||(ps={}));var ms;(function(s){s.NONE="none",s.NEW_USER_GOAL_SURVEY="new_user_goal_survey",s.EXISTING_USER_WELCOME_DIALOG="existing_user_welcome_dialog"})(ms||(ms={}));var ds=s=>({...as(s),POSTGzipped:async(t,r)=>{if(!r?.body)throw new Error("Body is required for gzipped requests");let n={...r.headers,"Content-Type":"application/json","Content-Encoding":"gzip"},o=t;r.params?.path&&Object.entries(r.params.path).forEach(([a,u])=>{o=o.replace(`{${a}}`,u)});let i=await fetch(`${s.baseUrl}${o}`,{method:"POST",headers:n,body:r.body});if(!i.ok){let a=await i.text();try{a=JSON.parse(a)}catch{}return{data:void 0,error:a,response:i}}return{data:await i.json(),error:void 0,response:i}}});import{strictDeepEqual as zp}from"fast-equals";import ss from"js-cookie";import{uuidv7 as Hp}from"uuidv7";var jt=class{constructor(e,t){this.storage=t;this.eventStorageKey=e==="adoraSessionScript"?"adoraEventsScript":"adoraEventsExtension"}getEvents(){let e=this.storage.getItem(this.eventStorageKey);return e?JSON.parse(e):null}setEvents(e){this.storage.setItem(this.eventStorageKey,JSON.stringify(e))}removeEvents(){this.storage.removeItem(this.eventStorageKey)}};function gs(s){return`${s}-rate-limit-timestamp`}var Le=class{constructor(e,t){this.sessionType=e;this.storage=t}get lastRateLimitedTimestamp(){let e=this.storage.getItem(gs(this.sessionType));if(ru(e))return e}clearLastRateLimitedTimestamp(){this.storage.removeItem(gs(this.sessionType))}setLastRateLimitedTimestamp(e){this.storage.setItem(gs(this.sessionType),e.toString())}getSession(){let e=this.storage.getItem(this.sessionType);return e?JSON.parse(e):null}setSession(e){this.storage.setItem(this.sessionType,JSON.stringify(e))}removeSession(){this.storage.removeItem(this.sessionType)}};function ru(s){return!isNaN(Number(s))}function b(s,...e){(typeof window=="object"&&window.enableAdoraDebugLogs||typeof window=="object"&&window.localStorage.getItem("enableAdoraDebugLogs"))&&console.log(s,...e)}var De=class{getItem(e){if(!ys())return null;try{return window.sessionStorage.getItem(e)}catch{return null}}setItem(e,t){if(!ys())return null;try{return window.sessionStorage.setItem(e,t)}catch{return null}}removeItem(e){if(!ys())return null;try{return window.sessionStorage.removeItem(e)}catch{return null}}};function ys(){return typeof window.sessionStorage=="object"}var Kt="v0.0.1";var wo=async(s,e,t)=>{let r=new Le(s,new De),n=new Oe(t.backendUrl),o=await su(n,t,e);return o.type==="success"&&r.setSession(o.storedSession),o};async function su(s,e,t){try{b("starting session over network",{uid:e.uid,userCohorts:e.userCohorts||{}});let r=await s.startSession({bypassSampling:e.bypassSampling,orgId:e.orgId,language:e.language||navigator.language,domain:new URL(window.location.href).hostname,userCohorts:e.userCohorts||{},uid:e.uid,devicePixelRatio:window.devicePixelRatio,adoraUserId:t,documentReferrer:document.referrer,snippetVersion:Kt});if(!r)return{type:"error",code:void 0};if(r.error)return{type:"error",code:r.error.code};if(r.response.status!==201)return b("session not created, aborting"),{type:"error",code:"code"in r.data?r.data.code:void 0};if(r.data&&"scheduledDowntime"in r.data)return b("scheduled downtime, exiting"),{type:"error",code:void 0};if(!r.data||!("session"in r.data))return b("malformed session, exiting"),{type:"error",code:void 0};let{session:n,organization:o,eventPostUrl:i,eventPostToken:l}=r.data;return{type:"success",storedSession:{id:n.id,createdAt:n.createdAt,status:n.status,lastSyncedAt:n.lastSyncedAt,domain:n.domain,requestIp:n.requestIp,country:n.country,userAgent:n.userAgent,language:n.language,initialUserCohorts:n.initialUserCohorts,devicePixelRatio:n.devicePixelRatio,organization:o,documentReferrer:n.documentReferrer,canvasRecordingEnabled:n.canvasRecordingEnabled||!1,adoraUserId:t,settings:e,eventPostUrl:i,eventPostToken:l,limitedCanvasRecording:n.limitedCanvasRecording||!1,compressionType:n.compressionType}}}catch{return{type:"error",code:void 0}}}import*as dt from"web-vitals";var So="__STATSIG__",nu="statsig@@",vo=s=>{try{if(!s[So])return;let e=s[So];if(!iu(e))return;let t={};return Object.values(e.instances).forEach(r=>{r._logger?._lastExposureTimeMap&&Object.keys(r._logger?._lastExposureTimeMap).forEach(n=>{let o=ou(n);if(!o)return;let i=r.getExperiment(o);uu(i)&&(t[nu+i.name]=i.groupName)})}),t}catch{return}},ou=s=>{let e=s.split("|");if(e.length>3)return e[3]};function iu(s){if(!s||typeof s!="object"||!("instances"in s)||typeof s.instances!="object"||!s.instances)return!1;let e=Object.values(s.instances);for(let t of e)if(!au(t))return!1;return!0}function au(s){return!s||typeof s!="object"?!1:"_logger"in s&&typeof s._logger=="object"&&lu(s._logger)&&"_sdkKey"in s&&typeof s._sdkKey=="string"&&"getExperiment"in s&&typeof s.getExperiment=="function"}function lu(s){return!s||typeof s!="object"?!1:"_lastExposureTimeMap"in s&&typeof s._lastExposureTimeMap=="object"}function uu(s){return!s||typeof s!="object"?!1:"name"in s&&typeof s.name=="string"&&"groupName"in s&&typeof s.groupName=="string"}function Jt(s,e){if(!e.windowGetters)return;let t={};if(e.windowGetters.forEach(({key:r,paths:n})=>{let o=cu(s,n);o&&(t[r]=o)}),Object.keys(t).length!==0)return t}function cu(s,e){if(typeof s>"u")return;let t=s;for(let n=0;n<e.length-1;n++)if(t=t[e[n]],typeof t!="object")return;let r=t[e[e.length-1]];if(typeof r=="string")return r;if(typeof r=="boolean"||typeof r=="number")return r.toString()}function ws(s){return vo(s)}var du=Object.defineProperty,hu=(s,e,t)=>e in s?du(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,C=(s,e,t)=>hu(s,typeof e!="symbol"?e+"":e,t),Co,fu=Object.defineProperty,pu=(s,e,t)=>e in s?fu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,bo=(s,e,t)=>pu(s,typeof e!="symbol"?e+"":e,t),q=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(q||{}),Eo={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ro={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Zt={};function Rn(s){if(Zt[s])return Zt[s];let e=globalThis[s],t=e.prototype,r=s in Eo?Eo[s]:void 0,n=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in Ro?Ro[s]:void 0,i=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(n&&i)return Zt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Zt[s]=u:t}catch{return t}}var Ss={};function Ue(s,e,t){var r;let n=`${s}.${String(t)}`;if(Ss[n])return Ss[n].call(e);let o=Rn(s),i=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return i?(Ss[n]=i,i.call(e)):e[t]}var vs={};function Si(s,e,t){let r=`${s}.${String(t)}`;if(vs[r])return vs[r].bind(e);let o=Rn(s)[t];return typeof o!="function"?e[t]:(vs[r]=o,o.bind(e))}function mu(s){return Ue("Node",s,"childNodes")}function gu(s){return Ue("Node",s,"parentNode")}function yu(s){return Ue("Node",s,"parentElement")}function wu(s){return Ue("Node",s,"textContent")}function Su(s,e){return Si("Node",s,"contains")(e)}function vu(s){return Si("Node",s,"getRootNode")()}function Cu(s){return!s||!("host"in s)?null:Ue("ShadowRoot",s,"host")}function bu(s){return s.styleSheets}function Eu(s){return!s||!("shadowRoot"in s)?null:Ue("Element",s,"shadowRoot")}function Ru(s,e){return Ue("Element",s,"querySelector")(e)}function Iu(s,e){return Ue("Element",s,"querySelectorAll")(e)}function xu(){return Rn("MutationObserver").constructor}var ne={childNodes:mu,parentNode:gu,parentElement:yu,textContent:wu,contains:Su,getRootNode:vu,host:Cu,styleSheets:bu,shadowRoot:Eu,querySelector:Ru,querySelectorAll:Iu,mutationObserver:xu};function vi(s){return s.nodeType===s.ELEMENT_NODE}function Ct(s){let e=s&&"host"in s&&"mode"in s&&ne.host(s)||null;return!!(e&&"shadowRoot"in e&&ne.shadowRoot(e)===s)}function bt(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Au(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function _u(s){let{cssText:e}=s;if(e.split('"').length<3)return e;let t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function ks(s){try{let e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);let r=Array.from(e,n=>Ci(n,t)).join("");return Au(r)}catch{return null}}function Ci(s,e){if(Du(s)){let t;try{t=ks(s.styleSheet)||_u(s)}catch{t=s.cssText}return s.styleSheet.href?xr(t,s.styleSheet.href):t}else{let t=s.cssText;return Tu(s)&&s.selectorText.includes(":")&&(t=Ou(t)),e?xr(t,e):t}}function Ou(s){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Du(s){return"styleSheet"in s}function Tu(s){return"selectorText"in s}var Rr=class{constructor(){bo(this,"idNodeMap",new Map),bo(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Nu(){return new Rr}function Ir({element:s,maskInputOptions:e,tagName:t,type:r,value:n,maskInputFn:o}){let i=n||"",l=r&&Be(r);return(e[t.toLowerCase()]||l&&e[l])&&(o?i=o(i,s):i="*".repeat(i.length)),i}function Be(s){return s.toLowerCase()}var Io="__rrweb_original__";function Mu(s){let e=s.getContext("2d");if(!e)return!0;let t=50;for(let r=0;r<s.width;r+=t)for(let n=0;n<s.height;n+=t){let o=e.getImageData,i=Io in o?o[Io]:o;if(new Uint32Array(i.call(e,r,n,Math.min(t,s.width-r),Math.min(t,s.height-n)).data.buffer).some(a=>a!==0))return!1}return!0}function In(s){let e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Be(e):null}function bi(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,n=t.pathname.match(r);return n?.[1]??null}function ku(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}var Pu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$u=/^(?:[a-z+]+:)?\/\//i,Lu=/^www\..*/i,Fu=/^(data:)([^,]*),(.*)/i;function xr(s,e){return(s||"").replace(Pu,(t,r,n,o,i,l)=>{let a=n||i||l,u=r||o||"";if(!a)return t;if($u.test(a)||Lu.test(a))return`url(${u}${a}${u})`;if(Fu.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${ku(e)+a}${u})`;let c=e.split("/"),d=a.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Cs(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Uu(s,e){let t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){let n=Cs(s);for(let o=1;o<t.length;o++)if(t[o].textContent&&typeof t[o].textContent=="string"){let i=Cs(t[o].textContent);for(let l=3;l<i.length;l++){let a=i.substring(0,l);if(n.split(a).length===2){let u=n.indexOf(a);for(let c=u;c<s.length;c++)if(Cs(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function zu(s,e){return Uu(s,e).join("/* rr_split */")}var Hu=1,Bu=new RegExp("[^a-z0-9-_:]"),Rt=-2;function Ei(){return Hu++}function Wu(s){if(s instanceof HTMLFormElement)return"form";let e=Be(s.tagName);return Bu.test(e)?"div":e}var Ze,xo,Vu=/^[^ \t\n\r\u000c]+/,Yu=/^[, \t\n\r\u000c]+/;function Gu(s,e){if(e.trim()==="")return e;let t=0;function r(o){let i,l=o.exec(e.substring(t));return l?(i=l[0],t+=i.length,i):""}let n=[];for(;r(Yu),!(t>=e.length);){let o=r(Vu);if(o.slice(-1)===",")o=Qe(s,o.substring(0,o.length-1)),n.push(o);else{let i="";o=Qe(s,o);let l=!1;for(;;){let a=e.charAt(t);if(a===""){n.push((o+i).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,n.push((o+i).trim());break}else a==="("&&(l=!0);i+=a,t+=1}}}return n.join(", ")}var Ao=new WeakMap;function Qe(s,e){return!e||e.trim()===""?e:xn(s,e)}function ju(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function xn(s,e){let t=Ao.get(s);if(t||(t=s.createElement("a"),Ao.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Ri(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Qe(s,r):t==="srcset"?Gu(s,r):t==="style"?xr(r,xn(s)):e==="object"&&t==="data"?Qe(s,r):r)}function Ii(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function Ku(s,e,t,r){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let n=s.classList.length;n--;){let o=s.classList[n];if(e.test(o))return!0}if(t)return s.matches(t);if(r&&s.tagName==="IMG"){let n=s.getAttribute("src");if(n&&r.test(n))return!0}}catch{}return!1}function Ar(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?Ar(ne.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){let n=s.classList[r];if(e.test(n))return!0}return t?Ar(ne.parentNode(s),e,t):!1}function xi(s,e,t,r){let n;if(vi(s)){if(n=s,!ne.childNodes(n).length)return!1}else{if(ne.parentElement(s)===null)return!1;n=ne.parentElement(s)}try{if(typeof e=="string"){if(r){if(n.closest(`.${e}`))return!0}else if(n.classList.contains(e))return!0}else if(Ar(n,e,r))return!0;if(t){if(r){if(n.closest(t))return!0}else if(n.matches(t))return!0}if(n.getAttribute("contenteditable")||n.closest('[contenteditable="true"]'))return!0}catch{}return!1}function Ju(s,e,t){let r=s.contentWindow;if(!r)return;let n=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let l=setTimeout(()=>{n||(e(),n=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),n=!0,e()});return}let i="about:blank";if(r.location.href!==i||s.src===i||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Zu(s,e,t){let r=!1,n;try{n=s.sheet}catch{return}if(n)return;let o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function Xu(s,e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,maskAnchorHrefFn:d,blockImgSrcPattern:p,blockImgSrcFillOptions:m,dataURLOptions:g={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:E,newlyAddedElement:S=!1,cssCaptured:w=!1}=e,I=qu(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:q.Document,childNodes:[],compatMode:s.compatMode}:{type:q.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:q.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:I};case s.ELEMENT_NODE:return ec(s,{doc:t,blockClass:n,blockSelector:o,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,maskAnchorHrefFn:d,blockImgSrcPattern:p,blockImgSrcFillOptions:m,dataURLOptions:g,inlineImages:f,recordCanvas:h,keepIframeSrcFn:E,newlyAddedElement:S,rootId:I});case s.TEXT_NODE:return Qu(s,{doc:t,needsMask:i,maskTextFn:u,rootId:I,cssCaptured:w});case s.CDATA_SECTION_NODE:return{type:q.CDATA,textContent:"",rootId:I};case s.COMMENT_NODE:return{type:q.Comment,textContent:ne.textContent(s)||"",rootId:I};default:return!1}}function qu(s,e){if(!e.hasNode(s))return;let t=e.getId(s);return t===1?void 0:t}function Qu(s,e){let{needsMask:t,maskTextFn:r,rootId:n,cssCaptured:o}=e,i=ne.parentNode(s),l=i&&i.tagName,a="",u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":o||(a=ne.textContent(s),u&&a&&(a=xr(a,xn(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,ne.parentElement(s)):a.replace(/[\S]/g,"*")),{type:q.Text,textContent:a||"",rootId:n}}function ec(s,e){let{doc:t,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:l,maskAnchorHrefFn:a,blockImgSrcPattern:u,blockImgSrcFillOptions:c,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:f=!1,rootId:h}=e,E=Ku(s,r,n,u),S=Wu(s),w={},I=s.attributes.length;for(let y=0;y<I;y++){let R=s.attributes[y];Ii(S,R.name,R.value)||(w[R.name]=Ri(t,S,Be(R.name),R.value))}if(S==="a"&&a&&typeof w.href=="string"&&(w.href=a(w.href,s)),S==="link"&&o){let y=Array.from(t.styleSheets).find(v=>v.href===s.href);if(!y&&s.href.includes(".css")){let v=window.location.origin,x=s.href.replace(window.location.href,""),O=v+"/"+x;y=Array.from(t.styleSheets).find(le=>le.href===O)}let R=null;y&&(R=ks(y)),R&&(delete w.rel,delete w.href,w._cssText=R)}if(S==="style"&&s.sheet){let y=ks(s.sheet);y&&(s.childNodes.length>1&&(y=zu(y,s)),w._cssText=y)}if(S==="input"||S==="textarea"||S==="select"){let y=s.value,R=s.checked;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&y?w.value=Ir({element:s,type:In(s),tagName:S,value:y,maskInputOptions:i,maskInputFn:l}):R&&(w.checked=R)}if(S==="option"&&(s.selected&&!i.select?w.selected=!0:delete w.selected),S==="dialog"&&s.open&&(w.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),S==="canvas"&&m){if(s.__context==="2d")Mu(s)||(w.rr_dataURL=s.toDataURL(d.type,d.quality));else if(!("__context"in s)){let y=s.toDataURL(d.type,d.quality),R=t.createElement("canvas");R.width=s.width,R.height=s.height;let v=R.toDataURL(d.type,d.quality);y!==v&&(w.rr_dataURL=y)}}if(S==="img"&&p){Ze||(Ze=t.createElement("canvas"),xo=Ze.getContext("2d"));let y=s,R=y.currentSrc||y.getAttribute("src")||"<unknown-src>",v=y.crossOrigin,x=()=>{y.removeEventListener("load",x);try{Ze.width=y.naturalWidth,Ze.height=y.naturalHeight,xo.drawImage(y,0,0),w.rr_dataURL=Ze.toDataURL(d.type,d.quality)}catch(O){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?x():y.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${R}! Error: ${O}`)}y.crossOrigin==="anonymous"&&(v?w.crossOrigin=v:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?x():y.addEventListener("load",x)}if(S==="audio"||S==="video"){let y=w;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(f||(s.scrollLeft&&(w.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(w.rr_scrollTop=s.scrollTop)),E){let{width:y,height:R}=s.getBoundingClientRect();w={class:w.class,rr_width:`${y}px`,rr_height:`${R}px`}}E&&S==="img"&&(w={...w,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP89v3nfwAJuAPnyTr4jAAAAABJRU5ErkJggg==",rr_fill:c.backgroundColor,rr_stroke:c.strokeColor,rr_stroke_width:c.strokeWidth}),S==="iframe"&&!g(w.src)&&(s.contentDocument||(w.rr_src=w.src),delete w.src);let _;try{customElements.get(S)&&(_=!0)}catch{}return{type:q.Element,tagName:S,attributes:w,childNodes:[],isSVG:ju(s)||void 0,needBlock:E,rootId:h,isCustom:_}}function z(s){return s==null?"":s.toLowerCase()}function tc(s,e){if(e.comment&&s.type===q.Comment)return!0;if(s.type===q.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&bi(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(z(s.attributes.name).match(/^msapplication-tile(image|color)$/)||z(s.attributes.name)==="application-name"||z(s.attributes.rel)==="icon"||z(s.attributes.rel)==="apple-touch-icon"||z(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&z(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(z(s.attributes.property).match(/^(og|twitter|fb):/)||z(s.attributes.name).match(/^(og|twitter):/)||z(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(z(s.attributes.name)==="robots"||z(s.attributes.name)==="googlebot"||z(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(z(s.attributes.name)==="author"||z(s.attributes.name)==="generator"||z(s.attributes.name)==="framework"||z(s.attributes.name)==="publisher"||z(s.attributes.name)==="progid"||z(s.attributes.property).match(/^article:/)||z(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(z(s.attributes.name)==="google-site-verification"||z(s.attributes.name)==="yandex-verification"||z(s.attributes.name)==="csrf-token"||z(s.attributes.name)==="p:domain_verify"||z(s.attributes.name)==="verify-v1"||z(s.attributes.name)==="verification"||z(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function et(s,e){if(s.nodeName.toLowerCase().includes("grammarly"))return null;let{doc:t,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E={},inlineImages:S=!1,recordCanvas:w=!1,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:O=!1,cssCaptured:le=!1}=e,{needsMask:Y}=e,{preserveWhiteSpace:ue=!0}=e;Y||(Y=xi(s,i,l,Y===void 0));let X=Xu(s,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,dataURLOptions:E,inlineImages:S,recordCanvas:w,keepIframeSrcFn:x,newlyAddedElement:O,cssCaptured:le});if(!X)return console.warn(s,"not serialized"),null;let j;r.hasNode(s)?j=r.getId(s):tc(X,h)||!ue&&X.type===q.Text&&!X.textContent.replace(/^\s+|\s+$/gm,"").length?j=Rt:j=Ei();let A=Object.assign(X,{id:j});if(r.add(s,A),j===Rt)return null;I&&I(s);let G=!a;if(A.type===q.Element){G=G&&!A.needBlock,delete A.needBlock;let F=ne.shadowRoot(s);F&&bt(F)&&(A.isShadowHost=!0)}if((A.type===q.Document||A.type===q.Element)&&G){h.headWhitespace&&A.type===q.Element&&A.tagName==="head"&&(ue=!1);let F={doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ue,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x,cssCaptured:!1};if(!(A.type===q.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===q.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(F.cssCaptured=!0);for(let Q of Array.from(ne.childNodes(s))){let re=et(Q,F);re&&A.childNodes.push(re)}}let te=null;if(vi(s)&&(te=ne.shadowRoot(s)))for(let Q of Array.from(ne.childNodes(te))){let re=et(Q,F);re&&(bt(te)&&(re.isShadow=!0),A.childNodes.push(re))}}let ee=ne.parentNode(s);return ee&&Ct(ee)&&bt(ee)&&(A.isShadow=!0),A.type===q.Element&&A.tagName==="iframe"&&Ju(s,()=>{let F=s.contentDocument;if(F&&_){let te=et(F,{doc:F,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ue,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x});te&&_(s,te)}},y),A.type===q.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&bi(A.attributes.href)==="css")&&Zu(s,()=>{if(R){let F=et(s,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ue,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x});F&&R(s,F)}},v),A}function rc(s,e){let{mirror:t=new Rr,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g=null,blockImgSrcFillOptions:f={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},slimDOM:h=!1,dataURLOptions:E,preserveWhiteSpace:S,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:R,keepIframeSrcFn:v=()=>!1}=e||{};return et(s,{doc:s,mirror:t,blockClass:r,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!0?{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}:c===!1?{password:!0}:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:h==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:h===!1?{}:h,dataURLOptions:E,inlineImages:a,recordCanvas:u,preserveWhiteSpace:S,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:R,keepIframeSrcFn:v,newlyAddedElement:!1})}function sc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function nc(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var An={exports:{}},H=String,Ai=function(){return{isColorSupported:!1,reset:H,bold:H,dim:H,italic:H,underline:H,inverse:H,hidden:H,strikethrough:H,black:H,red:H,green:H,yellow:H,blue:H,magenta:H,cyan:H,white:H,gray:H,bgBlack:H,bgRed:H,bgGreen:H,bgYellow:H,bgBlue:H,bgMagenta:H,bgCyan:H,bgWhite:H}};An.exports=Ai();An.exports.createColors=Ai;var oc=An.exports,ic={},ac=Object.freeze(Object.defineProperty({__proto__:null,default:ic},Symbol.toStringTag,{value:"Module"})),ve=nc(ac),_o=oc,Oo=ve,Ps=class _i extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,_i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=_o.isColorSupported),Oo&&e&&(t=Oo(t));let r=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),i=String(o).length,l,a;if(e){let{bold:u,gray:c,red:d}=_o.createColors(!0);l=p=>u(d(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(n,o).map((u,c)=>{let d=n+1+c,p=" "+(" "+d).slice(-i)+" | ";if(d===this.line){let m=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
|
|
1
|
+
var Pl=Object.defineProperty;var $l=(s,e,t)=>e in s?Pl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var pe=(s,e,t)=>$l(s,typeof e!="symbol"?e+"":e,t);var Ll={"Content-Type":"application/json"},Fl=/\{[^{}]+\}/g,us=class extends Request{constructor(e,t){super(e,t);for(let r in t)r in this||(this[r]=t[r])}};function cs(s){let{baseUrl:e="",fetch:t=globalThis.fetch,querySerializer:r,bodySerializer:n,headers:o,...i}={...s};e.endsWith("/")&&(e=e.substring(0,e.length-1)),o=fo(Ll,o);let l=[];async function a(u,c){let{fetch:d=t,headers:p,params:m={},parseAs:g="json",querySerializer:f,bodySerializer:h=n??zl,...E}=c||{},S=typeof r=="function"?r:ho(r);f&&(S=typeof f=="function"?f:ho({...typeof r=="object"?r:{},...f}));let w={redirect:"follow",...i,...E,headers:fo(o,p,m.header)};w.body&&(w.body=h(w.body)),w.body instanceof FormData&&w.headers.delete("Content-Type");let I=new us(Bl(u,{baseUrl:e,params:m,querySerializer:S}),w),_={baseUrl:e,fetch:d,parseAs:g,querySerializer:S,bodySerializer:h};for(let v of l)if(v&&typeof v=="object"&&typeof v.onRequest=="function"){I.schemaPath=u,I.params=m;let x=await v.onRequest(I,_);if(x){if(!(x instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");I=x}}let y=await d(I);for(let v=l.length-1;v>=0;v--){let x=l[v];if(x&&typeof x=="object"&&typeof x.onResponse=="function"){let O=await x.onResponse(y,_);if(O){if(!(O instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");y=O}}}if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok)return g==="stream"?{data:y.body,response:y}:{data:await y[g](),response:y};let R=await y.text();try{R=JSON.parse(R)}catch{}return{error:R,response:y}}return{async GET(u,c){return a(u,{...c,method:"GET"})},async PUT(u,c){return a(u,{...c,method:"PUT"})},async POST(u,c){return a(u,{...c,method:"POST"})},async DELETE(u,c){return a(u,{...c,method:"DELETE"})},async OPTIONS(u,c){return a(u,{...c,method:"OPTIONS"})},async HEAD(u,c){return a(u,{...c,method:"HEAD"})},async PATCH(u,c){return a(u,{...c,method:"PATCH"})},async TRACE(u,c){return a(u,{...c,method:"TRACE"})},use(...u){for(let c of u)if(c){if(typeof c!="object"||!("onRequest"in c||"onResponse"in c))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");l.push(c)}},eject(...u){for(let c of u){let d=l.indexOf(c);d!==-1&&l.splice(d,1)}}}}function Gt(s,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${s}=${t?.allowReserved===!0?e:encodeURIComponent(e)}`}function po(s,e,t){if(!e||typeof e!="object")return"";let r=[],n={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(let l in e)r.push(l,t.allowReserved===!0?e[l]:encodeURIComponent(e[l]));let i=r.join(",");switch(t.style){case"form":return`${s}=${i}`;case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;default:return i}}for(let i in e){let l=t.style==="deepObject"?`${s}[${i}]`:i;r.push(Gt(l,e[i],t))}let o=r.join(n);return t.style==="label"||t.style==="matrix"?`${n}${o}`:o}function mo(s,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){let o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",i=(t.allowReserved===!0?e:e.map(l=>encodeURIComponent(l))).join(o);switch(t.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;default:return`${s}=${i}`}}let r={simple:",",label:".",matrix:";"}[t.style]||"&",n=[];for(let o of e)t.style==="simple"||t.style==="label"?n.push(t.allowReserved===!0?o:encodeURIComponent(o)):n.push(Gt(s,o,t));return t.style==="label"||t.style==="matrix"?`${r}${n.join(r)}`:n.join(r)}function ho(s){return function(t){let r=[];if(t&&typeof t=="object")for(let n in t){let o=t[n];if(o!=null){if(Array.isArray(o)){r.push(mo(n,o,{style:"form",explode:!0,...s?.array,allowReserved:s?.allowReserved||!1}));continue}if(typeof o=="object"){r.push(po(n,o,{style:"deepObject",explode:!0,...s?.object,allowReserved:s?.allowReserved||!1}));continue}r.push(Gt(n,o,s))}}return r.join("&")}}function Ul(s,e){let t=s;for(let r of s.match(Fl)??[]){let n=r.substring(1,r.length-1),o=!1,i="simple";if(n.endsWith("*")&&(o=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(i="label",n=n.substring(1)):n.startsWith(";")&&(i="matrix",n=n.substring(1)),!e||e[n]===void 0||e[n]===null)continue;let l=e[n];if(Array.isArray(l)){t=t.replace(r,mo(n,l,{style:i,explode:o}));continue}if(typeof l=="object"){t=t.replace(r,po(n,l,{style:i,explode:o}));continue}if(i==="matrix"){t=t.replace(r,`;${Gt(n,l)}`);continue}t=t.replace(r,i==="label"?`.${l}`:l)}return t}function zl(s){return JSON.stringify(s)}function Bl(s,e){let t=`${e.baseUrl}${s}`;e.params?.path&&(t=Ul(t,e.params.path));let r=e.querySerializer(e.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(t+=`?${r}`),t}function fo(...s){let e=new Headers;for(let t of s){if(!t||typeof t!="object")continue;let r=t instanceof Headers?t.entries():Object.entries(t);for(let[n,o]of r)if(o===null)e.delete(n);else if(Array.isArray(o))for(let i of o)e.append(n,i);else o!==void 0&&e.set(n,o)}return e}var oe=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(oe||{}),Be=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(Be||{}),ds=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(ds||{});var Hl="Adora.URLChange",go="Adora.Cohort",Wl="Adora.AddCohort",Vl="Adora.Click";var hs=["onclick","ondblclick","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onchange","onfocus","onblur","onscroll","onselect","onsubmit","onkeydown","onkeypress","onkeyup","onload","onunload"];function yo({dom0EventHandlers:s,delay:e,timestamp:t}){return{type:oe.Custom,data:{tag:Vl,payload:{dom0EventHandlers:s}},delay:e,timestamp:t}}function mt({payload:s,delay:e,timestamp:t}){return{type:oe.Custom,data:{tag:Wl,payload:s},delay:e,timestamp:t}}function wo({href:s,delay:e,timestamp:t}){return{type:oe.Custom,data:{tag:Hl,payload:{href:s}},delay:e,timestamp:t}}function fe(s){throw new Error(`This code path should be unreachable: ${s}`)}import{uuidv7 as Qm}from"uuidv7";var cg=1e3*60*30;var dg=10080*60*1e3;var vo="https://c.adora-cdn.com";var De=class{constructor(e){pe(this,"backendClient");pe(this,"eventPostBackendClient");this.backendClient=ps({baseUrl:e??vo})}getOrCreateEventPostClient(e){return!e.eventPostUrl||!e.eventPostToken?{path:e.sessionId,client:this.backendClient}:(this.eventPostBackendClient||(this.eventPostBackendClient=ps({baseUrl:e.eventPostUrl})),{path:e.sessionId,client:this.eventPostBackendClient})}async sessionPreload({orgId:e}){return this.backendClient.POST("/sessions/preload",{body:{orgId:e},mode:"cors"}).catch(()=>{})}async startSession({bypassSampling:e,orgId:t,language:r,domain:n,userCohorts:o,uid:i,devicePixelRatio:l,adoraUserId:a,userAgent:u,documentReferrer:c,snippetVersion:d}){return this.backendClient.POST("/sessions/start",{body:{bypassSampling:e,orgId:t,language:r,domain:n,devicePixelRatio:l,userCohorts:o||{},userAgent:u,uid:typeof i=="number"?i.toString():i!=="null"&&i!=="undefined"?i:void 0,adoraUserId:a,documentReferrer:c,snippetVersion:d},mode:"cors"}).catch(()=>{})}async gzipWithCompressionStream(e){let t=JSON.stringify(e),n=new TextEncoder().encode(t),o=new CompressionStream("gzip"),l=new ReadableStream({start(u){u.enqueue(n),u.close()}}).pipeThrough(o);return new Response(l).arrayBuffer()}async saveSessionEvents({sessionId:e,events:t,metadata:r,eventPostUrl:n,eventPostToken:o,fastpathToken:i}){let{path:l,client:a}=this.getOrCreateEventPostClient({sessionId:e,eventPostToken:o,eventPostUrl:n}),u={events:t.slice(),metadata:r,fastpathToken:i},c={params:{path:{sessionId:l}},headers:o?{token:o}:void 0};if(typeof CompressionStream<"u"){let d=await this.gzipWithCompressionStream(u);return a.POSTGzipped("/sessions/{sessionId}/events",{...c,body:d}).catch(()=>{})}return a.POST("/sessions/{sessionId}/events",{...c,body:u}).catch(()=>{})}async refreshEventToken(e){return await this.backendClient.POST("/sessions/{sessionId}/events/token",{params:{path:{sessionId:e.sessionId}},body:{},mode:"cors"}).catch(()=>{})}async syncSession(e){return await this.backendClient.POST("/sessions/{sessionId}/sync",{params:{path:{sessionId:e.sessionId}}}).catch(()=>{})}};import{makeRe as ru,minimatch as su}from"minimatch";function nu(s){return s.endsWith("$")&&(s=s.substring(0,s.length-1)),(s.endsWith("+?")||s.endsWith("*?"))&&(s=s.substring(0,s.length-1)),s}function Ze(s,e){let t=e.replace||e.path;switch(e.type){case"regexp":{let r=(e.path.startsWith("^")?"":"^")+e.path+(!e.path.endsWith("$")&&!e.partial?"$":""),n=new RegExp(r);return n.test(s)?e.partial?s.replace(n,t):t:void 0}case"wildcard":case void 0:if(e.partial){let r=ru(e.path,{partial:e.partial,dot:!0});if(!r)throw new Error("unable to make regexp");let n=new RegExp(nu(r.source));return n.test(s)?s.replace(n,t):void 0}return su(s,e.path,{dot:!0})?t:void 0;default:fe(e.type)}}var ms;(function(s){s.GOAL_SURVEY_FINISHED="goal_survey_finished",s.WELCOME_DIALOG_FINISHED="welcome_dialog_finished"})(ms||(ms={}));var gs;(function(s){s.EXPLORE_AND_VISUALIZE="Explore and visualize",s.MEASURE_AND_OPTIMIZE="Measure and optimize",s.IDENTIFY_FRICTION="Identify friction",s.DIAGNOSE_ISSUES="Diagnose issues"})(gs||(gs={}));var ys;(function(s){s.SKIPPED="skipped",s.COMPLETED="completed"})(ys||(ys={}));var ws;(function(s){s.NONE="none",s.NEW_USER_GOAL_SURVEY="new_user_goal_survey",s.EXISTING_USER_WELCOME_DIALOG="existing_user_welcome_dialog"})(ws||(ws={}));var ps=s=>({...cs(s),POSTGzipped:async(t,r)=>{if(!r?.body)throw new Error("Body is required for gzipped requests");let n={...r.headers,"Content-Type":"application/json","Content-Encoding":"gzip"},o=t;r.params?.path&&Object.entries(r.params.path).forEach(([a,u])=>{o=o.replace(`{${a}}`,u)});let i=await fetch(`${s.baseUrl}${o}`,{method:"POST",headers:n,body:r.body});if(!i.ok){let a=await i.text();try{a=JSON.parse(a)}catch{}return{data:void 0,error:a,response:i}}return{data:await i.json(),error:void 0,response:i}}});import{strictDeepEqual as Vp}from"fast-equals";import is from"js-cookie";import{uuidv7 as Yp}from"uuidv7";var jt=class{constructor(e,t){this.storage=t;this.eventStorageKey=e==="adoraSessionScript"?"adoraEventsScript":"adoraEventsExtension"}getEvents(){let e=this.storage.getItem(this.eventStorageKey);return e?JSON.parse(e):null}setEvents(e){this.storage.setItem(this.eventStorageKey,JSON.stringify(e))}removeEvents(){this.storage.removeItem(this.eventStorageKey)}};function Ss(s){return`${s}-rate-limit-timestamp`}var Le=class{constructor(e,t){this.sessionType=e;this.storage=t}get lastRateLimitedTimestamp(){let e=this.storage.getItem(Ss(this.sessionType));if(ou(e))return e}clearLastRateLimitedTimestamp(){this.storage.removeItem(Ss(this.sessionType))}setLastRateLimitedTimestamp(e){this.storage.setItem(Ss(this.sessionType),e.toString())}getSession(){let e=this.storage.getItem(this.sessionType);return e?JSON.parse(e):null}setSession(e){this.storage.setItem(this.sessionType,JSON.stringify(e))}removeSession(){this.storage.removeItem(this.sessionType)}};function ou(s){return!isNaN(Number(s))}function C(s,...e){(typeof window=="object"&&window.enableAdoraDebugLogs||typeof window=="object"&&window.localStorage.getItem("enableAdoraDebugLogs"))&&console.log(s,...e)}var Te=class{getItem(e){if(!vs())return null;try{return window.sessionStorage.getItem(e)}catch{return null}}setItem(e,t){if(!vs())return null;try{return window.sessionStorage.setItem(e,t)}catch{return null}}removeItem(e){if(!vs())return null;try{return window.sessionStorage.removeItem(e)}catch{return null}}};function vs(){return typeof window.sessionStorage=="object"}var Kt="v0.0.1";var bo=async(s,e,t)=>{let r=new Le(s,new Te),n=new De(t.backendUrl),o=await iu(n,t,e);return o.type==="success"&&r.setSession(o.storedSession),o};async function iu(s,e,t){try{C("starting session over network",{uid:e.uid,userCohorts:e.userCohorts||{}});let r=await s.startSession({bypassSampling:e.bypassSampling,orgId:e.orgId,language:e.language||navigator.language,domain:new URL(window.location.href).hostname,userCohorts:e.userCohorts||{},uid:e.uid,devicePixelRatio:window.devicePixelRatio,adoraUserId:t,documentReferrer:document.referrer,snippetVersion:Kt});if(!r)return{type:"error",code:void 0};if(r.error)return{type:"error",code:r.error.code};if(r.response.status!==201)return C("session not created, aborting"),{type:"error",code:"code"in r.data?r.data.code:void 0};if(r.data&&"scheduledDowntime"in r.data)return C("scheduled downtime, exiting"),{type:"error",code:void 0};if(!r.data||!("session"in r.data))return C("malformed session, exiting"),{type:"error",code:void 0};let{session:n,organization:o,eventPostUrl:i,eventPostToken:l}=r.data;return{type:"success",storedSession:{id:n.id,createdAt:n.createdAt,status:n.status,lastSyncedAt:n.lastSyncedAt,domain:n.domain,requestIp:n.requestIp,country:n.country,userAgent:n.userAgent,language:n.language,initialUserCohorts:n.initialUserCohorts,devicePixelRatio:n.devicePixelRatio,organization:o,documentReferrer:n.documentReferrer,canvasRecordingEnabled:n.canvasRecordingEnabled||!1,adoraUserId:t,settings:e,eventPostUrl:i,eventPostToken:l,limitedCanvasRecording:n.limitedCanvasRecording||!1,compressionType:n.compressionType}}}catch{return{type:"error",code:void 0}}}import*as ht from"web-vitals";var Co="__STATSIG__",au="statsig@@",Eo=s=>{try{if(!s[Co])return;let e=s[Co];if(!uu(e))return;let t={};return Object.values(e.instances).forEach(r=>{r._logger?._lastExposureTimeMap&&Object.keys(r._logger?._lastExposureTimeMap).forEach(n=>{let o=lu(n);if(!o)return;let i=r.getExperiment(o);hu(i)&&(t[au+i.name]=i.groupName)})}),t}catch{return}},lu=s=>{let e=s.split("|");if(e.length>3)return e[3]};function uu(s){if(!s||typeof s!="object"||!("instances"in s)||typeof s.instances!="object"||!s.instances)return!1;let e=Object.values(s.instances);for(let t of e)if(!cu(t))return!1;return!0}function cu(s){return!s||typeof s!="object"?!1:"_logger"in s&&typeof s._logger=="object"&&du(s._logger)&&"_sdkKey"in s&&typeof s._sdkKey=="string"&&"getExperiment"in s&&typeof s.getExperiment=="function"}function du(s){return!s||typeof s!="object"?!1:"_lastExposureTimeMap"in s&&typeof s._lastExposureTimeMap=="object"}function hu(s){return!s||typeof s!="object"?!1:"name"in s&&typeof s.name=="string"&&"groupName"in s&&typeof s.groupName=="string"}function Jt(s,e){if(!e.windowGetters)return;let t={};if(e.windowGetters.forEach(({key:r,paths:n})=>{let o=fu(s,n);o&&(t[r]=o)}),Object.keys(t).length!==0)return t}function fu(s,e){if(typeof s>"u")return;let t=s;for(let n=0;n<e.length-1;n++)if(t=t[e[n]],typeof t!="object")return;let r=t[e[e.length-1]];if(typeof r=="string")return r;if(typeof r=="boolean"||typeof r=="number")return r.toString()}function bs(s){return Eo(s)}var pu=Object.defineProperty,mu=(s,e,t)=>e in s?pu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,b=(s,e,t)=>mu(s,typeof e!="symbol"?e+"":e,t),Ro,gu=Object.defineProperty,yu=(s,e,t)=>e in s?gu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Io=(s,e,t)=>yu(s,typeof e!="symbol"?e+"":e,t),q=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(q||{}),xo={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ao={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Zt={};function An(s){if(Zt[s])return Zt[s];let e=globalThis[s],t=e.prototype,r=s in xo?xo[s]:void 0,n=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in Ao?Ao[s]:void 0,i=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(n&&i)return Zt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Zt[s]=u:t}catch{return t}}var Cs={};function Ue(s,e,t){var r;let n=`${s}.${String(t)}`;if(Cs[n])return Cs[n].call(e);let o=An(s),i=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return i?(Cs[n]=i,i.call(e)):e[t]}var Es={};function Ci(s,e,t){let r=`${s}.${String(t)}`;if(Es[r])return Es[r].bind(e);let o=An(s)[t];return typeof o!="function"?e[t]:(Es[r]=o,o.bind(e))}function wu(s){return Ue("Node",s,"childNodes")}function Su(s){return Ue("Node",s,"parentNode")}function vu(s){return Ue("Node",s,"parentElement")}function bu(s){return Ue("Node",s,"textContent")}function Cu(s,e){return Ci("Node",s,"contains")(e)}function Eu(s){return Ci("Node",s,"getRootNode")()}function Ru(s){return!s||!("host"in s)?null:Ue("ShadowRoot",s,"host")}function Iu(s){return s.styleSheets}function xu(s){return!s||!("shadowRoot"in s)?null:Ue("Element",s,"shadowRoot")}function Au(s,e){return Ue("Element",s,"querySelector")(e)}function _u(s,e){return Ue("Element",s,"querySelectorAll")(e)}function Ou(){return An("MutationObserver").constructor}var ne={childNodes:wu,parentNode:Su,parentElement:vu,textContent:bu,contains:Cu,getRootNode:Eu,host:Ru,styleSheets:Iu,shadowRoot:xu,querySelector:Au,querySelectorAll:_u,mutationObserver:Ou};function Ei(s){return s.nodeType===s.ELEMENT_NODE}function bt(s){let e=s&&"host"in s&&"mode"in s&&ne.host(s)||null;return!!(e&&"shadowRoot"in e&&ne.shadowRoot(e)===s)}function Ct(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Du(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function Tu(s){let{cssText:e}=s;if(e.split('"').length<3)return e;let t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function Ls(s){try{let e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);let r=Array.from(e,n=>Ri(n,t)).join("");return Du(r)}catch{return null}}function Ri(s,e){if(Mu(s)){let t;try{t=Ls(s.styleSheet)||Tu(s)}catch{t=s.cssText}return s.styleSheet.href?xr(t,s.styleSheet.href):t}else{let t=s.cssText;return ku(s)&&s.selectorText.includes(":")&&(t=Nu(t)),e?xr(t,e):t}}function Nu(s){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Mu(s){return"styleSheet"in s}function ku(s){return"selectorText"in s}var Rr=class{constructor(){Io(this,"idNodeMap",new Map),Io(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Pu(){return new Rr}function Ir({element:s,maskInputOptions:e,tagName:t,type:r,value:n,maskInputFn:o}){let i=n||"",l=r&&We(r);return(e[t.toLowerCase()]||l&&e[l])&&(o?i=o(i,s):i="*".repeat(i.length)),i}function We(s){return s.toLowerCase()}var _o="__rrweb_original__";function $u(s){let e=s.getContext("2d");if(!e)return!0;let t=50;for(let r=0;r<s.width;r+=t)for(let n=0;n<s.height;n+=t){let o=e.getImageData,i=_o in o?o[_o]:o;if(new Uint32Array(i.call(e,r,n,Math.min(t,s.width-r),Math.min(t,s.height-n)).data.buffer).some(a=>a!==0))return!1}return!0}function _n(s){let e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?We(e):null}function Ii(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,n=t.pathname.match(r);return n?.[1]??null}function Lu(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}var Fu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Uu=/^(?:[a-z+]+:)?\/\//i,zu=/^www\..*/i,Bu=/^(data:)([^,]*),(.*)/i;function xr(s,e){return(s||"").replace(Fu,(t,r,n,o,i,l)=>{let a=n||i||l,u=r||o||"";if(!a)return t;if(Uu.test(a)||zu.test(a))return`url(${u}${a}${u})`;if(Bu.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${Lu(e)+a}${u})`;let c=e.split("/"),d=a.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Rs(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Hu(s,e){let t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){let n=Rs(s);for(let o=1;o<t.length;o++)if(t[o].textContent&&typeof t[o].textContent=="string"){let i=Rs(t[o].textContent);for(let l=3;l<i.length;l++){let a=i.substring(0,l);if(n.split(a).length===2){let u=n.indexOf(a);for(let c=u;c<s.length;c++)if(Rs(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function Wu(s,e){return Hu(s,e).join("/* rr_split */")}var Vu=1,Yu=new RegExp("[^a-z0-9-_:]"),Rt=-2;function xi(){return Vu++}function Gu(s){if(s instanceof HTMLFormElement)return"form";let e=We(s.tagName);return Yu.test(e)?"div":e}var Xe,Oo,ju=/^[^ \t\n\r\u000c]+/,Ku=/^[, \t\n\r\u000c]+/;function Ju(s,e){if(e.trim()==="")return e;let t=0;function r(o){let i,l=o.exec(e.substring(t));return l?(i=l[0],t+=i.length,i):""}let n=[];for(;r(Ku),!(t>=e.length);){let o=r(ju);if(o.slice(-1)===",")o=et(s,o.substring(0,o.length-1)),n.push(o);else{let i="";o=et(s,o);let l=!1;for(;;){let a=e.charAt(t);if(a===""){n.push((o+i).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,n.push((o+i).trim());break}else a==="("&&(l=!0);i+=a,t+=1}}}return n.join(", ")}var Do=new WeakMap;function et(s,e){return!e||e.trim()===""?e:On(s,e)}function Zu(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function On(s,e){let t=Do.get(s);if(t||(t=s.createElement("a"),Do.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Ai(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?et(s,r):t==="srcset"?Ju(s,r):t==="style"?xr(r,On(s)):e==="object"&&t==="data"?et(s,r):r)}function _i(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function Xu(s,e,t,r){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let n=s.classList.length;n--;){let o=s.classList[n];if(e.test(o))return!0}if(t)return s.matches(t);if(r&&s.tagName==="IMG"){let n=s.getAttribute("src");if(n&&r.test(n))return!0}}catch{}return!1}function Ar(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?Ar(ne.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){let n=s.classList[r];if(e.test(n))return!0}return t?Ar(ne.parentNode(s),e,t):!1}function Oi(s,e,t,r){let n;if(Ei(s)){if(n=s,!ne.childNodes(n).length)return!1}else{if(ne.parentElement(s)===null)return!1;n=ne.parentElement(s)}try{if(typeof e=="string"){if(r){if(n.closest(`.${e}`))return!0}else if(n.classList.contains(e))return!0}else if(Ar(n,e,r))return!0;if(t){if(r){if(n.closest(t))return!0}else if(n.matches(t))return!0}if(n.getAttribute("contenteditable")||n.closest('[contenteditable="true"]'))return!0}catch{}return!1}function qu(s,e,t){let r=s.contentWindow;if(!r)return;let n=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let l=setTimeout(()=>{n||(e(),n=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),n=!0,e()});return}let i="about:blank";if(r.location.href!==i||s.src===i||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Qu(s,e,t){let r=!1,n;try{n=s.sheet}catch{return}if(n)return;let o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function ec(s,e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,maskAnchorHrefFn:d,blockImgSrcPattern:p,blockImgSrcFillOptions:m,dataURLOptions:g={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:E,newlyAddedElement:S=!1,cssCaptured:w=!1}=e,I=tc(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:q.Document,childNodes:[],compatMode:s.compatMode}:{type:q.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:q.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:I};case s.ELEMENT_NODE:return sc(s,{doc:t,blockClass:n,blockSelector:o,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,maskAnchorHrefFn:d,blockImgSrcPattern:p,blockImgSrcFillOptions:m,dataURLOptions:g,inlineImages:f,recordCanvas:h,keepIframeSrcFn:E,newlyAddedElement:S,rootId:I});case s.TEXT_NODE:return rc(s,{doc:t,needsMask:i,maskTextFn:u,rootId:I,cssCaptured:w});case s.CDATA_SECTION_NODE:return{type:q.CDATA,textContent:"",rootId:I};case s.COMMENT_NODE:return{type:q.Comment,textContent:ne.textContent(s)||"",rootId:I};default:return!1}}function tc(s,e){if(!e.hasNode(s))return;let t=e.getId(s);return t===1?void 0:t}function rc(s,e){let{needsMask:t,maskTextFn:r,rootId:n,cssCaptured:o}=e,i=ne.parentNode(s),l=i&&i.tagName,a="",u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":o||(a=ne.textContent(s),u&&a&&(a=xr(a,On(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,ne.parentElement(s)):a.replace(/[\S]/g,"*")),{type:q.Text,textContent:a||"",rootId:n}}function sc(s,e){let{doc:t,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:l,maskAnchorHrefFn:a,blockImgSrcPattern:u,blockImgSrcFillOptions:c,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:f=!1,rootId:h}=e,E=Xu(s,r,n,u),S=Gu(s),w={},I=s.attributes.length;for(let y=0;y<I;y++){let R=s.attributes[y];_i(S,R.name,R.value)||(w[R.name]=Ai(t,S,We(R.name),R.value))}if(S==="a"&&a&&typeof w.href=="string"&&(w.href=a(w.href,s)),S==="link"&&o){let y=Array.from(t.styleSheets).find(v=>v.href===s.href);if(!y&&s.href.includes(".css")){let v=window.location.origin,x=s.href.replace(window.location.href,""),O=v+"/"+x;y=Array.from(t.styleSheets).find(ue=>ue.href===O)}let R=null;y&&(R=Ls(y)),R&&(delete w.rel,delete w.href,w._cssText=R)}if(S==="style"&&s.sheet){let y=Ls(s.sheet);y&&(s.childNodes.length>1&&(y=Wu(y,s)),w._cssText=y)}if(S==="input"||S==="textarea"||S==="select"){let y=s.value,R=s.checked;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&y?w.value=Ir({element:s,type:_n(s),tagName:S,value:y,maskInputOptions:i,maskInputFn:l}):R&&(w.checked=R)}if(S==="option"&&(s.selected&&!i.select?w.selected=!0:delete w.selected),S==="dialog"&&s.open&&(w.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),S==="canvas"&&m){if(s.__context==="2d")$u(s)||(w.rr_dataURL=s.toDataURL(d.type,d.quality));else if(!("__context"in s)){let y=s.toDataURL(d.type,d.quality),R=t.createElement("canvas");R.width=s.width,R.height=s.height;let v=R.toDataURL(d.type,d.quality);y!==v&&(w.rr_dataURL=y)}}if(S==="img"&&p){Xe||(Xe=t.createElement("canvas"),Oo=Xe.getContext("2d"));let y=s,R=y.currentSrc||y.getAttribute("src")||"<unknown-src>",v=y.crossOrigin,x=()=>{y.removeEventListener("load",x);try{Xe.width=y.naturalWidth,Xe.height=y.naturalHeight,Oo.drawImage(y,0,0),w.rr_dataURL=Xe.toDataURL(d.type,d.quality)}catch(O){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?x():y.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${R}! Error: ${O}`)}y.crossOrigin==="anonymous"&&(v?w.crossOrigin=v:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?x():y.addEventListener("load",x)}if(S==="audio"||S==="video"){let y=w;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(f||(s.scrollLeft&&(w.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(w.rr_scrollTop=s.scrollTop)),E){let{width:y,height:R}=s.getBoundingClientRect();w={class:w.class,rr_width:`${y}px`,rr_height:`${R}px`}}E&&S==="img"&&(w={...w,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP89v3nfwAJuAPnyTr4jAAAAABJRU5ErkJggg==",rr_fill:c.backgroundColor,rr_stroke:c.strokeColor,rr_stroke_width:c.strokeWidth}),S==="iframe"&&!g(w.src)&&(s.contentDocument||(w.rr_src=w.src),delete w.src);let _;try{customElements.get(S)&&(_=!0)}catch{}return{type:q.Element,tagName:S,attributes:w,childNodes:[],isSVG:Zu(s)||void 0,needBlock:E,rootId:h,isCustom:_}}function z(s){return s==null?"":s.toLowerCase()}function nc(s,e){if(e.comment&&s.type===q.Comment)return!0;if(s.type===q.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&Ii(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(z(s.attributes.name).match(/^msapplication-tile(image|color)$/)||z(s.attributes.name)==="application-name"||z(s.attributes.rel)==="icon"||z(s.attributes.rel)==="apple-touch-icon"||z(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&z(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(z(s.attributes.property).match(/^(og|twitter|fb):/)||z(s.attributes.name).match(/^(og|twitter):/)||z(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(z(s.attributes.name)==="robots"||z(s.attributes.name)==="googlebot"||z(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(z(s.attributes.name)==="author"||z(s.attributes.name)==="generator"||z(s.attributes.name)==="framework"||z(s.attributes.name)==="publisher"||z(s.attributes.name)==="progid"||z(s.attributes.property).match(/^article:/)||z(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(z(s.attributes.name)==="google-site-verification"||z(s.attributes.name)==="yandex-verification"||z(s.attributes.name)==="csrf-token"||z(s.attributes.name)==="p:domain_verify"||z(s.attributes.name)==="verify-v1"||z(s.attributes.name)==="verification"||z(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function tt(s,e){if(s.nodeName.toLowerCase().includes("grammarly"))return null;let{doc:t,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E={},inlineImages:S=!1,recordCanvas:w=!1,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:O=!1,cssCaptured:ue=!1}=e,{needsMask:Y}=e,{preserveWhiteSpace:ce=!0}=e;Y||(Y=Oi(s,i,l,Y===void 0));let X=ec(s,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,dataURLOptions:E,inlineImages:S,recordCanvas:w,keepIframeSrcFn:x,newlyAddedElement:O,cssCaptured:ue});if(!X)return console.warn(s,"not serialized"),null;let j;r.hasNode(s)?j=r.getId(s):nc(X,h)||!ce&&X.type===q.Text&&!X.textContent.replace(/^\s+|\s+$/gm,"").length?j=Rt:j=xi();let A=Object.assign(X,{id:j});if(r.add(s,A),j===Rt)return null;I&&I(s);let G=!a;if(A.type===q.Element){G=G&&!A.needBlock,delete A.needBlock;let F=ne.shadowRoot(s);F&&Ct(F)&&(A.isShadowHost=!0)}if((A.type===q.Document||A.type===q.Element)&&G){h.headWhitespace&&A.type===q.Element&&A.tagName==="head"&&(ce=!1);let F={doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ce,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x,cssCaptured:!1};if(!(A.type===q.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===q.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(F.cssCaptured=!0);for(let Q of Array.from(ne.childNodes(s))){let re=tt(Q,F);re&&A.childNodes.push(re)}}let te=null;if(Ei(s)&&(te=ne.shadowRoot(s)))for(let Q of Array.from(ne.childNodes(te))){let re=tt(Q,F);re&&(Ct(te)&&(re.isShadow=!0),A.childNodes.push(re))}}let ee=ne.parentNode(s);return ee&&bt(ee)&&Ct(ee)&&(A.isShadow=!0),A.type===q.Element&&A.tagName==="iframe"&&qu(s,()=>{let F=s.contentDocument;if(F&&_){let te=tt(F,{doc:F,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ce,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x});te&&_(s,te)}},y),A.type===q.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&Ii(A.attributes.href)==="css")&&Qu(s,()=>{if(R){let F=tt(s,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ce,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x});F&&R(s,F)}},v),A}function oc(s,e){let{mirror:t=new Rr,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g=null,blockImgSrcFillOptions:f={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},slimDOM:h=!1,dataURLOptions:E,preserveWhiteSpace:S,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:R,keepIframeSrcFn:v=()=>!1}=e||{};return tt(s,{doc:s,mirror:t,blockClass:r,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!0?{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}:c===!1?{password:!0}:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:h==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:h===!1?{}:h,dataURLOptions:E,inlineImages:a,recordCanvas:u,preserveWhiteSpace:S,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:R,keepIframeSrcFn:v,newlyAddedElement:!1})}function ic(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function ac(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var Dn={exports:{}},B=String,Di=function(){return{isColorSupported:!1,reset:B,bold:B,dim:B,italic:B,underline:B,inverse:B,hidden:B,strikethrough:B,black:B,red:B,green:B,yellow:B,blue:B,magenta:B,cyan:B,white:B,gray:B,bgBlack:B,bgRed:B,bgGreen:B,bgYellow:B,bgBlue:B,bgMagenta:B,bgCyan:B,bgWhite:B}};Dn.exports=Di();Dn.exports.createColors=Di;var lc=Dn.exports,uc={},cc=Object.freeze(Object.defineProperty({__proto__:null,default:uc},Symbol.toStringTag,{value:"Module"})),ve=ac(cc),To=lc,No=ve,Fs=class Ti extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ti)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=To.isColorSupported),No&&e&&(t=No(t));let r=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),i=String(o).length,l,a;if(e){let{bold:u,gray:c,red:d}=To.createColors(!0);l=p=>u(d(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(n,o).map((u,c)=>{let d=n+1+c,p=" "+(" "+d).slice(-i)+" | ";if(d===this.line){let m=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
|
|
2
2
|
`+m+l("^")}return" "+a(p)+u}).join(`
|
|
3
3
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
4
4
|
|
|
5
5
|
`+e+`
|
|
6
|
-
`),this.name+": "+this.message+e}},
|
|
6
|
+
`),this.name+": "+this.message+e}},Tn=Fs;Fs.default=Fs;var kt={};kt.isClean=Symbol("isClean");kt.my=Symbol("my");var Mo={after:`
|
|
7
7
|
`,beforeClose:`
|
|
8
8
|
`,beforeComment:`
|
|
9
9
|
`,beforeDecl:`
|
|
10
10
|
`,beforeOpen:" ",beforeRule:`
|
|
11
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
12
|
-
`)){let i=this.raw(e,null,"indent");if(i.length)for(let l=0;l<o;l++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return
|
|
11
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function dc(s){return s[0].toUpperCase()+s.slice(1)}var Us=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+n+o,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,o=0;for(;n&&n.type!=="root";)o+=1,n=n.parent;if(r.includes(`
|
|
12
|
+
`)){let i=this.raw(e,null,"indent");if(i.length)for(let l=0;l<o;l++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Mo[r];let i=e.root();if(i.rawCache||(i.rawCache={}),typeof i.rawCache[r]<"u")return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+dc(r);this[l]?n=this[l](i,e):i.walk(a=>{if(n=a.raws[t],typeof n<"u")return!1})}return typeof n>"u"&&(n=Mo[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
|
|
13
13
|
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
14
14
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
15
15
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
|
|
16
16
|
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))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&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
17
|
-
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))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)}},
|
|
18
|
-
`?(n=1,o+=1):n+=1;return{column:n,line:o}}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(),o=n.indexOf(e.word);o!==-1&&(t=this.positionInside(o,n),r=this.positionInside(o+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}:typeof e.endIndex=="number"?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
|
|
19
|
-
`);r=new Array(o.length);let i=0;for(let l=0,a=o.length;l<a;l++)r[l]=i,i+=o[l].length+1;this[
|
|
17
|
+
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))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)}},Ni=Us;Us.default=Us;var hc=Ni;function zs(s,e){new hc(e).stringify(s)}var zr=zs;zs.default=zs;var{isClean:Xt,my:fc}=kt,pc=Tn,mc=Ni,gc=zr;function Bs(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let n=s[r],o=typeof n;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=n:Array.isArray(n)?t[r]=n.map(i=>Bs(i,t)):(o==="object"&&n!==null&&(n=Bs(n)),t[r]=n)}return t}var Hs=class{constructor(e={}){this.raws={},this[Xt]=!1,this[fc]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Bs(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 pc(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Xt]){this[Xt]=!1;let e=this;for(;e=e.parent;)e[Xt]=!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){t=this.toString();let n=t.indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,o=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
|
|
18
|
+
`?(n=1,o+=1):n+=1;return{column:n,line:o}}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(),o=n.indexOf(e.word);o!==-1&&(t=this.positionInside(o,n),r=this.positionInside(o+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}:typeof e.endIndex=="number"?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 mc().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&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},n=t==null;t=t||new Map;let o=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let l=this[i];if(Array.isArray(l))r[i]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[i]=l.toJSON(null,t);else if(i==="source"){let a=t.get(l.input);a==null&&(a=o,t.set(l.input,o),o++),r[i]={end:l.end,inputId:a,start:l.start}}else r[i]=l}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=gc){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let o in r)n[o]=r[o];return e.warn(t,n)}get proxyOf(){return this}},Br=Hs;Hs.default=Hs;var yc=Br,Ws=class extends yc{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Hr=Ws;Ws.default=Ws;var wc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Sc=(s,e=21)=>(t=e)=>{let r="",n=t;for(;n--;)r+=s[Math.random()*s.length|0];return r},vc=(s=21)=>{let e="",t=s;for(;t--;)e+=wc[Math.random()*64|0];return e},bc={nanoid:vc,customAlphabet:Sc},{SourceMapConsumer:ko,SourceMapGenerator:Po}=ve,{existsSync:Cc,readFileSync:Ec}=ve,{dirname:Is,join:Rc}=ve;function Ic(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var Vs=class{constructor(e,t){if(t.map===!1)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=Is(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ko(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(n.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Ic(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||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=Is(e),Cc(e))return this.mapFile=e,Ec(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}else{if(t instanceof ko)return Po.fromSourceMap(t).toString();if(t instanceof Po)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Rc(Is(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Mi=Vs;Vs.default=Vs;var{SourceMapConsumer:xc,SourceMapGenerator:Ac}=ve,{fileURLToPath:$o,pathToFileURL:qt}=ve,{isAbsolute:Ys,resolve:Gs}=ve,{nanoid:_c}=bc,xs=ve,Lo=Tn,Oc=Mi,As=Symbol("fromOffsetCache"),Dc=!!(xc&&Ac),Fo=!!(Gs&&Ys),_r=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Fo||/^\w+:\/\//.test(t.from)||Ys(t.from)?this.file=t.from:this.file=Gs(t.from)),Fo&&Dc){let r=new Oc(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+_c(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let o,i,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);t=d.line,r=d.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);i=d.line,l=d.col}else i=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,i,l);return a?o=new Lo(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):o=new Lo(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:l,line:i},this.css,this.file,n.plugin),o.input={column:r,endColumn:l,endLine:i,line:t,source:this.css},this.file&&(qt&&(o.input.url=qt(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[As])r=this[As];else{let o=this.css.split(`
|
|
19
|
+
`);r=new Array(o.length);let i=0;for(let l=0,a=o.length;l<a;l++)r[l]=i,i+=o[l].length+1;this[As]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let o=r.length-2,i;for(;n<o;)if(i=n+(o-n>>1),e<r[i])o=i-1;else if(e>=r[i+1])n=i+1;else{n=i;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Gs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let o=this.map.consumer(),i=o.originalPositionFor({column:t,line:e});if(!i.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:n,line:r}));let a;Ys(i.source)?a=qt(i.source):a=new URL(i.source,this.map.consumer().sourceRoot||qt(this.map.mapFile));let u={column:i.column,endColumn:l&&l.column,endLine:l&&l.line,line:i.line,url:a.toString()};if(a.protocol==="file:")if($o)u.file=$o(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(i.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(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}},Wr=_r;_r.default=_r;xs&&xs.registerInput&&xs.registerInput(_r);var{SourceMapConsumer:ki,SourceMapGenerator:wr}=ve,{dirname:Sr,relative:Pi,resolve:$i,sep:Li}=ve,{pathToFileURL:Uo}=ve,Tc=Wr,Nc=!!(ki&&wr),Mc=!!(Sr&&$i&&Pi&&Li),kc=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;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
20
20
|
`;this.css.includes(`\r
|
|
21
21
|
`)&&(t=`\r
|
|
22
|
-
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Sr(e.file),n;this.mapOpts.sourcesContent===!1?(n=new
|
|
23
|
-
`),t=l.length-i):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Sr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Sr(Mi(r,this.mapOpts.annotation)));let n=Ni(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new _c(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 t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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($o){let r=$o(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;ki==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Pi=Tc,Nc=Hr,Vs=class extends Nc{constructor(e){super(e),this.type="comment"}},Vr=Vs;Vs.default=Vs;var{isClean:$i,my:Li}=kt,Fi=Br,Ui=Vr,Mc=Hr,zi,On,Dn,Hi;function Bi(s){return s.map(e=>(e.nodes&&(e.nodes=Bi(e.nodes)),delete e.source,e))}function Wi(s){if(s[$i]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Wi(e)}var Ne=class Vi extends Mc{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}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=this.getIterator(),r,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(n=>typeof n=="function"?(o,i)=>n(o.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...o)=>r(n.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let o;for(let i in this.indexes)o=this.indexes[i],r<o&&(this.indexes[i]=o+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let i;for(let l in this.indexes)i=this.indexes[l],r<=i&&(this.indexes[l]=i+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Bi(zi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Fi(e)]}else if(e.selector)e=[new On(e)];else if(e.name)e=[new Dn(e)];else if(e.text)e=[new Ui(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[Li]||Vi.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[$i]&&Wi(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(o){throw t.addToError(o)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}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]}};Ne.registerParse=s=>{zi=s};Ne.registerRule=s=>{On=s};Ne.registerAtRule=s=>{Dn=s};Ne.registerRoot=s=>{Hi=s};var We=Ne;Ne.default=Ne;Ne.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Dn.prototype):s.type==="rule"?Object.setPrototypeOf(s,On.prototype):s.type==="decl"?Object.setPrototypeOf(s,Fi.prototype):s.type==="comment"?Object.setPrototypeOf(s,Ui.prototype):s.type==="root"&&Object.setPrototypeOf(s,Hi.prototype),s[Li]=!0,s.nodes&&s.nodes.forEach(e=>{Ne.rebuild(e)})};var kc=We,Yi,Gi,It=class extends kc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Yi(new Gi,this,e).stringify()}};It.registerLazyResult=s=>{Yi=s};It.registerProcessor=s=>{Gi=s};var Tn=It;It.default=It;var Ys=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},ji=Ys;Ys.default=Ys;var Pc=ji,Gs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Pc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Nn=Gs;Gs.default=Gs;var Is=39,Lo=34,Qt=92,Fo=47,er=10,gt=32,tr=12,rr=9,sr=13,$c=91,Lc=93,Fc=40,Uc=41,zc=123,Hc=125,Bc=59,Wc=42,Vc=58,Yc=64,nr=/[\t\n\f\r "#'()/;[\\\]{}]/g,or=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Gc=/.[\r\n"'(/\\]/,Uo=/[\da-f]/i,jc=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,o,i,l,a,u,c,d,p,m,g,f=r.length,h=0,E=[],S=[];function w(){return h}function I(v){throw e.error("Unclosed "+v,h)}function _(){return S.length===0&&h>=f}function y(v){if(S.length)return S.pop();if(h>=f)return;let x=v?v.ignoreUnclosed:!1;switch(o=r.charCodeAt(h),o){case er:case gt:case rr:case sr:case tr:{i=h;do i+=1,o=r.charCodeAt(i);while(o===gt||o===er||o===rr||o===sr||o===tr);g=["space",r.slice(h,i)],h=i-1;break}case $c:case Lc:case zc:case Hc:case Vc:case Bc:case Uc:{let O=String.fromCharCode(o);g=[O,O,h];break}case Fc:{if(p=E.length?E.pop()[1]:"",m=r.charCodeAt(h+1),p==="url"&&m!==Is&&m!==Lo&&m!==gt&&m!==er&&m!==rr&&m!==tr&&m!==sr){i=h;do{if(c=!1,i=r.indexOf(")",i+1),i===-1)if(n||x){i=h;break}else I("bracket");for(d=i;r.charCodeAt(d-1)===Qt;)d-=1,c=!c}while(c);g=["brackets",r.slice(h,i+1),h,i],h=i}else i=r.indexOf(")",h+1),a=r.slice(h,i+1),i===-1||Gc.test(a)?g=["(","(",h]:(g=["brackets",a,h,i],h=i);break}case Is:case Lo:{l=o===Is?"'":'"',i=h;do{if(c=!1,i=r.indexOf(l,i+1),i===-1)if(n||x){i=h+1;break}else I("string");for(d=i;r.charCodeAt(d-1)===Qt;)d-=1,c=!c}while(c);g=["string",r.slice(h,i+1),h,i],h=i;break}case Yc:{nr.lastIndex=h+1,nr.test(r),nr.lastIndex===0?i=r.length-1:i=nr.lastIndex-2,g=["at-word",r.slice(h,i+1),h,i],h=i;break}case Qt:{for(i=h,u=!0;r.charCodeAt(i+1)===Qt;)i+=1,u=!u;if(o=r.charCodeAt(i+1),u&&o!==Fo&&o!==gt&&o!==er&&o!==rr&&o!==sr&&o!==tr&&(i+=1,Uo.test(r.charAt(i)))){for(;Uo.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===gt&&(i+=1)}g=["word",r.slice(h,i+1),h,i],h=i;break}default:{o===Fo&&r.charCodeAt(h+1)===Wc?(i=r.indexOf("*/",h+2)+1,i===0&&(n||x?i=r.length:I("comment")),g=["comment",r.slice(h,i+1),h,i],h=i):(or.lastIndex=h+1,or.test(r),or.lastIndex===0?i=r.length-1:i=or.lastIndex-2,g=["word",r.slice(h,i+1),h,i],E.push(g),h=i);break}}return h++,g}function R(v){S.push(v)}return{back:R,endOfFile:_,nextToken:y,position:w}},Ki=We,Or=class extends Ki{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},Mn=Or;Or.default=Or;Ki.registerAtRule(Or);var Ji=We,Zi,Xi,rt=class extends Ji{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of n)o.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Zi(new Xi,this,e).stringify()}};rt.registerLazyResult=s=>{Zi=s};rt.registerProcessor=s=>{Xi=s};var Pt=rt;rt.default=rt;Ji.registerRoot(rt);var xt={comma(s){return xt.split(s,[","],!0)},space(s){let e=[" ",`
|
|
24
|
-
`," "];return xt.split(s,e)},split(s,e,t){let r=[],n="",o=!1,i=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?i+=1:c===")"?i>0&&(i-=1):i===0&&e.includes(c)&&(o=!0),o?(n!==""&&r.push(n.trim()),n="",o=!1):n+=c;return(t||n!=="")&&r.push(n.trim()),r}},qi=xt;xt.default=xt;var Qi=We,Kc=qi,Dr=class extends Qi{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Kc.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)}},kn=Dr;Dr.default=Dr;Qi.registerRule(Dr);var Jc=Br,Zc=jc,Xc=Vr,qc=Mn,Qc=Pt,zo=kn,Ho={empty:!0,space:!0};function ed(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var td=class{constructor(e){this.input=e,this.root=new Qc,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=new qc;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,o,i=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,n=a[o];n&&n[0]==="space";)n=a[--o];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let o=t-1;o>=0&&(n=e[o],!(n[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,o;for(let[i,l]of e.entries()){if(r=l,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return i}o=r}return!1}comment(e){let t=new Xc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Zc(this.input)}decl(e,t){let r=new Jc;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||ed(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),d="";for(let p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=i.map(u=>u[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new zo;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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.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="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,i=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")o||(o=u),i.push(r==="("?")":"]");else if(l&&n&&r==="{")o||(o=u),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&n){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}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);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,i,l=r.length,a="",u=!0,c,d;for(let p=0;p<l;p+=1)o=r[p],i=o[0],i==="space"&&p===l-1&&!n?u=!1:i==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!Ho[d]&&!Ho[c]?a.slice(-1)===","?u=!1:a+=o[1]:u=!1):a+=o[1];if(!u){let p=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new zo;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],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)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})}},rd=td,sd=We,nd=rd,od=Wr;function Tr(s,e){let t=new od(s,e),r=new nd(t);try{r.parse()}catch(n){throw n}return r.root}var Pn=Tr;Tr.default=Tr;sd.registerParse(Tr);var{isClean:Ie,my:id}=kt,ad=Pi,ld=zr,ud=We,cd=Tn;var Bo=Nn,dd=Pn,hd=Pt,fd={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},pd={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},md={Once:!0,postcssPlugin:!0,prepare:!0},st=0;function yt(s){return typeof s=="object"&&typeof s.then=="function"}function ea(s){let e=!1,t=fd[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,st,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,st,t+"Exit"]:[t,t+"Exit"]}function Wo(s){let e;return s.type==="document"?e=["Document",st,"DocumentExit"]:s.type==="root"?e=["Root",st,"RootExit"]:e=ea(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function js(s){return s[Ie]=!1,s.nodes&&s.nodes.forEach(e=>js(e)),s}var Ks={},nt=class ta{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=js(t);else if(t instanceof ta||t instanceof Bo)n=js(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=dd;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{n=o(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[id]&&ud.rebuild(n)}this.result=new Bo(e,n,r),this.helpers={...Ks,postcss:Ks,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!pd[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!md[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);else typeof t[r]=="function"&&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(yt(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];){e[Ie]=!0;let t=[Wo(e)];for(;t.length>0;){let r=this.visitTick(t);if(yt(r))try{await r}catch(n){let o=t[t.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(o=>r(o,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return yt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ld;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new ad(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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){let t=this.runOnRoot(e);if(yt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];)e[Ie]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let o;try{o=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(yt(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,l]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let i=t.iterator,l;for(;l=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!l[Ie]){l[Ie]=!0,e.push(Wo(l));return}t.iterator=0,delete r.indexes[i]}let o=t.events;for(;t.eventIndex<o.length;){let i=o[t.eventIndex];if(t.eventIndex+=1,i===st){r.nodes&&r.nodes.length&&(r[Ie]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[Ie]=!0;let t=ea(e);for(let r of t)if(r===st)e.nodes&&e.each(n=>{n[Ie]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};nt.registerPostcss=s=>{Ks=s};var ra=nt;nt.default=nt;hd.registerLazyResult(nt);cd.registerLazyResult(nt);var gd=Pi,yd=zr;var wd=Pn,Sd=Nn,Js=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n,o=yd;this.result=new Sd(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let l=new gd(o,n,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.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 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=wd;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},vd=Js;Js.default=Js;var Cd=vd,bd=ra,Ed=Tn,Rd=Pt,At=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Cd(this,e,t):new bd(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Id=At;At.default=At;Rd.registerProcessor(At);Ed.registerProcessor(At);var xd=Br,Ad=Di,_d=Vr,Od=Mn,Dd=Wr,Td=Pt,Nd=kn;function _t(s,e){if(Array.isArray(s))return s.map(n=>_t(n));let{inputs:t,...r}=s;if(t){e=[];for(let n of t){let o={...n,__proto__:Dd.prototype};o.map&&(o.map={...o.map,__proto__:Ad.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>_t(n,e))),r.source){let{inputId:n,...o}=r.source;r.source=o,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new Td(r);if(r.type==="decl")return new xd(r);if(r.type==="rule")return new Nd(r);if(r.type==="comment")return new _d(r);if(r.type==="atrule")return new Od(r);throw new Error("Unknown node type: "+s.type)}var Md=_t;_t.default=_t;var kd=_n,sa=Br,Pd=ra,$d=We,$n=Id,Ld=zr,Fd=Md,na=Tn,Ud=ji,oa=Vr,ia=Mn,zd=Nn,Hd=Wr,Bd=Pn,Wd=qi,aa=kn,la=Pt,Vd=Hr;function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new $n(s)}$.plugin=function(e,t){let r=!1;function n(...i){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
22
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Sr(e.file),n;this.mapOpts.sourcesContent===!1?(n=new ki(e.text),n.sourcesContent&&(n.sourcesContent=null)):n=e.consumer(),this.map.applySourceMap(n,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Mc&&Nc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=wr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new wr({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 wr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,i;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(n.generated.line=e,n.generated.column=t-1,a.source&&a.source.start?(n.source=this.sourcePath(a),n.original.line=a.source.start.line,n.original.column=a.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),o=l.match(/\n/g),o?(e+=o.length,i=l.lastIndexOf(`
|
|
23
|
+
`),t=l.length-i):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Sr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Sr($i(r,this.mapOpts.annotation)));let n=Pi(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Tc(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 t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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(Uo){let r=Uo(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;Li==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Fi=kc,Pc=Br,js=class extends Pc{constructor(e){super(e),this.type="comment"}},Vr=js;js.default=js;var{isClean:Ui,my:zi}=kt,Bi=Hr,Hi=Vr,$c=Br,Wi,Nn,Mn,Vi;function Yi(s){return s.map(e=>(e.nodes&&(e.nodes=Yi(e.nodes)),delete e.source,e))}function Gi(s){if(s[Ui]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Gi(e)}var Me=class ji extends $c{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}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=this.getIterator(),r,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(n=>typeof n=="function"?(o,i)=>n(o.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...o)=>r(n.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let o;for(let i in this.indexes)o=this.indexes[i],r<o&&(this.indexes[i]=o+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let i;for(let l in this.indexes)i=this.indexes[l],r<=i&&(this.indexes[l]=i+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Yi(Wi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Bi(e)]}else if(e.selector)e=[new Nn(e)];else if(e.name)e=[new Mn(e)];else if(e.text)e=[new Hi(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[zi]||ji.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[Ui]&&Gi(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(o){throw t.addToError(o)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}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]}};Me.registerParse=s=>{Wi=s};Me.registerRule=s=>{Nn=s};Me.registerAtRule=s=>{Mn=s};Me.registerRoot=s=>{Vi=s};var Ve=Me;Me.default=Me;Me.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Mn.prototype):s.type==="rule"?Object.setPrototypeOf(s,Nn.prototype):s.type==="decl"?Object.setPrototypeOf(s,Bi.prototype):s.type==="comment"?Object.setPrototypeOf(s,Hi.prototype):s.type==="root"&&Object.setPrototypeOf(s,Vi.prototype),s[zi]=!0,s.nodes&&s.nodes.forEach(e=>{Me.rebuild(e)})};var Lc=Ve,Ki,Ji,It=class extends Lc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ki(new Ji,this,e).stringify()}};It.registerLazyResult=s=>{Ki=s};It.registerProcessor=s=>{Ji=s};var kn=It;It.default=It;var Ks=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Zi=Ks;Ks.default=Ks;var Fc=Zi,Js=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Fc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Pn=Js;Js.default=Js;var _s=39,zo=34,Qt=92,Bo=47,er=10,gt=32,tr=12,rr=9,sr=13,Uc=91,zc=93,Bc=40,Hc=41,Wc=123,Vc=125,Yc=59,Gc=42,jc=58,Kc=64,nr=/[\t\n\f\r "#'()/;[\\\]{}]/g,or=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Jc=/.[\r\n"'(/\\]/,Ho=/[\da-f]/i,Zc=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,o,i,l,a,u,c,d,p,m,g,f=r.length,h=0,E=[],S=[];function w(){return h}function I(v){throw e.error("Unclosed "+v,h)}function _(){return S.length===0&&h>=f}function y(v){if(S.length)return S.pop();if(h>=f)return;let x=v?v.ignoreUnclosed:!1;switch(o=r.charCodeAt(h),o){case er:case gt:case rr:case sr:case tr:{i=h;do i+=1,o=r.charCodeAt(i);while(o===gt||o===er||o===rr||o===sr||o===tr);g=["space",r.slice(h,i)],h=i-1;break}case Uc:case zc:case Wc:case Vc:case jc:case Yc:case Hc:{let O=String.fromCharCode(o);g=[O,O,h];break}case Bc:{if(p=E.length?E.pop()[1]:"",m=r.charCodeAt(h+1),p==="url"&&m!==_s&&m!==zo&&m!==gt&&m!==er&&m!==rr&&m!==tr&&m!==sr){i=h;do{if(c=!1,i=r.indexOf(")",i+1),i===-1)if(n||x){i=h;break}else I("bracket");for(d=i;r.charCodeAt(d-1)===Qt;)d-=1,c=!c}while(c);g=["brackets",r.slice(h,i+1),h,i],h=i}else i=r.indexOf(")",h+1),a=r.slice(h,i+1),i===-1||Jc.test(a)?g=["(","(",h]:(g=["brackets",a,h,i],h=i);break}case _s:case zo:{l=o===_s?"'":'"',i=h;do{if(c=!1,i=r.indexOf(l,i+1),i===-1)if(n||x){i=h+1;break}else I("string");for(d=i;r.charCodeAt(d-1)===Qt;)d-=1,c=!c}while(c);g=["string",r.slice(h,i+1),h,i],h=i;break}case Kc:{nr.lastIndex=h+1,nr.test(r),nr.lastIndex===0?i=r.length-1:i=nr.lastIndex-2,g=["at-word",r.slice(h,i+1),h,i],h=i;break}case Qt:{for(i=h,u=!0;r.charCodeAt(i+1)===Qt;)i+=1,u=!u;if(o=r.charCodeAt(i+1),u&&o!==Bo&&o!==gt&&o!==er&&o!==rr&&o!==sr&&o!==tr&&(i+=1,Ho.test(r.charAt(i)))){for(;Ho.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===gt&&(i+=1)}g=["word",r.slice(h,i+1),h,i],h=i;break}default:{o===Bo&&r.charCodeAt(h+1)===Gc?(i=r.indexOf("*/",h+2)+1,i===0&&(n||x?i=r.length:I("comment")),g=["comment",r.slice(h,i+1),h,i],h=i):(or.lastIndex=h+1,or.test(r),or.lastIndex===0?i=r.length-1:i=or.lastIndex-2,g=["word",r.slice(h,i+1),h,i],E.push(g),h=i);break}}return h++,g}function R(v){S.push(v)}return{back:R,endOfFile:_,nextToken:y,position:w}},Xi=Ve,Or=class extends Xi{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)}},$n=Or;Or.default=Or;Xi.registerAtRule(Or);var qi=Ve,Qi,ea,st=class extends qi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of n)o.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Qi(new ea,this,e).stringify()}};st.registerLazyResult=s=>{Qi=s};st.registerProcessor=s=>{ea=s};var Pt=st;st.default=st;qi.registerRoot(st);var xt={comma(s){return xt.split(s,[","],!0)},space(s){let e=[" ",`
|
|
24
|
+
`," "];return xt.split(s,e)},split(s,e,t){let r=[],n="",o=!1,i=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?i+=1:c===")"?i>0&&(i-=1):i===0&&e.includes(c)&&(o=!0),o?(n!==""&&r.push(n.trim()),n="",o=!1):n+=c;return(t||n!=="")&&r.push(n.trim()),r}},ta=xt;xt.default=xt;var ra=Ve,Xc=ta,Dr=class extends ra{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Xc.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)}},Ln=Dr;Dr.default=Dr;ra.registerRule(Dr);var qc=Hr,Qc=Zc,ed=Vr,td=$n,rd=Pt,Wo=Ln,Vo={empty:!0,space:!0};function sd(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var nd=class{constructor(e){this.input=e,this.root=new rd,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=new td;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,o,i=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,n=a[o];n&&n[0]==="space";)n=a[--o];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let o=t-1;o>=0&&(n=e[o],!(n[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,o;for(let[i,l]of e.entries()){if(r=l,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return i}o=r}return!1}comment(e){let t=new ed;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Qc(this.input)}decl(e,t){let r=new qc;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||sd(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),d="";for(let p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=i.map(u=>u[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Wo;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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.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="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,i=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")o||(o=u),i.push(r==="("?")":"]");else if(l&&n&&r==="{")o||(o=u),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&n){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}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);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,i,l=r.length,a="",u=!0,c,d;for(let p=0;p<l;p+=1)o=r[p],i=o[0],i==="space"&&p===l-1&&!n?u=!1:i==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!Vo[d]&&!Vo[c]?a.slice(-1)===","?u=!1:a+=o[1]:u=!1):a+=o[1];if(!u){let p=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new Wo;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],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)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})}},od=nd,id=Ve,ad=od,ld=Wr;function Tr(s,e){let t=new ld(s,e),r=new ad(t);try{r.parse()}catch(n){throw n}return r.root}var Fn=Tr;Tr.default=Tr;id.registerParse(Tr);var{isClean:Ie,my:ud}=kt,cd=Fi,dd=zr,hd=Ve,fd=kn;var Yo=Pn,pd=Fn,md=Pt,gd={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},yd={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},wd={Once:!0,postcssPlugin:!0,prepare:!0},nt=0;function yt(s){return typeof s=="object"&&typeof s.then=="function"}function sa(s){let e=!1,t=gd[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,nt,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,nt,t+"Exit"]:[t,t+"Exit"]}function Go(s){let e;return s.type==="document"?e=["Document",nt,"DocumentExit"]:s.type==="root"?e=["Root",nt,"RootExit"]:e=sa(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Zs(s){return s[Ie]=!1,s.nodes&&s.nodes.forEach(e=>Zs(e)),s}var Xs={},ot=class na{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=Zs(t);else if(t instanceof na||t instanceof Yo)n=Zs(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=pd;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{n=o(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[ud]&&hd.rebuild(n)}this.result=new Yo(e,n,r),this.helpers={...Xs,postcss:Xs,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!yd[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!wd[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);else typeof t[r]=="function"&&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(yt(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];){e[Ie]=!0;let t=[Go(e)];for(;t.length>0;){let r=this.visitTick(t);if(yt(r))try{await r}catch(n){let o=t[t.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(o=>r(o,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return yt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=dd;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new cd(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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){let t=this.runOnRoot(e);if(yt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];)e[Ie]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let o;try{o=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(yt(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,l]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let i=t.iterator,l;for(;l=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!l[Ie]){l[Ie]=!0,e.push(Go(l));return}t.iterator=0,delete r.indexes[i]}let o=t.events;for(;t.eventIndex<o.length;){let i=o[t.eventIndex];if(t.eventIndex+=1,i===nt){r.nodes&&r.nodes.length&&(r[Ie]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[Ie]=!0;let t=sa(e);for(let r of t)if(r===nt)e.nodes&&e.each(n=>{n[Ie]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ot.registerPostcss=s=>{Xs=s};var oa=ot;ot.default=ot;md.registerLazyResult(ot);fd.registerLazyResult(ot);var Sd=Fi,vd=zr;var bd=Fn,Cd=Pn,qs=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n,o=vd;this.result=new Cd(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let l=new Sd(o,n,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.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 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=bd;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},Ed=qs;qs.default=qs;var Rd=Ed,Id=oa,xd=kn,Ad=Pt,At=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Rd(this,e,t):new Id(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},_d=At;At.default=At;Ad.registerProcessor(At);xd.registerProcessor(At);var Od=Hr,Dd=Mi,Td=Vr,Nd=$n,Md=Wr,kd=Pt,Pd=Ln;function _t(s,e){if(Array.isArray(s))return s.map(n=>_t(n));let{inputs:t,...r}=s;if(t){e=[];for(let n of t){let o={...n,__proto__:Md.prototype};o.map&&(o.map={...o.map,__proto__:Dd.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>_t(n,e))),r.source){let{inputId:n,...o}=r.source;r.source=o,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new kd(r);if(r.type==="decl")return new Od(r);if(r.type==="rule")return new Pd(r);if(r.type==="comment")return new Td(r);if(r.type==="atrule")return new Nd(r);throw new Error("Unknown node type: "+s.type)}var $d=_t;_t.default=_t;var Ld=Tn,ia=Hr,Fd=oa,Ud=Ve,Un=_d,zd=zr,Bd=$d,aa=kn,Hd=Zi,la=Vr,ua=$n,Wd=Pn,Vd=Wr,Yd=Fn,Gd=ta,ca=Ln,da=Pt,jd=Br;function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Un(s)}$.plugin=function(e,t){let r=!1;function n(...i){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
25
25
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
26
|
-
https://www.w3ctech.com/topic/2226`));let l=t(...i);return l.postcssPlugin=e,l.postcssVersion=new
|
|
26
|
+
https://www.w3ctech.com/topic/2226`));let l=t(...i);return l.postcssPlugin=e,l.postcssVersion=new Un().version,l}let o;return Object.defineProperty(n,"postcss",{get(){return o||(o=n()),o}}),n.process=function(i,l,a){return $([n(a)]).process(i,l)},n};$.stringify=zd;$.parse=Yd;$.fromJSON=Bd;$.list=Gd;$.comment=s=>new la(s);$.atRule=s=>new ua(s);$.decl=s=>new ia(s);$.rule=s=>new ca(s);$.root=s=>new da(s);$.document=s=>new aa(s);$.CssSyntaxError=Ld;$.Declaration=ia;$.Container=Ud;$.Processor=Un;$.Document=aa;$.Comment=la;$.Warning=Hd;$.AtRule=ua;$.Result=Wd;$.Input=Vd;$.Rule=ca;$.Root=da;$.Node=jd;Fd.registerPostcss($);var Kd=$;$.default=$;var W=ic(Kd);W.stringify;W.fromJSON;W.plugin;W.parse;W.list;W.document;W.comment;W.atRule;W.rule;W.decl;W.root;W.CssSyntaxError;W.Declaration;W.Container;W.Processor;W.Document;W.Comment;W.Warning;W.AtRule;W.Result;W.Input;W.Rule;W.Root;W.Node;var Jd=Object.defineProperty,Zd=(s,e,t)=>e in s?Jd(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,me=(s,e,t)=>Zd(s,typeof e!="symbol"?e+"":e,t);function Xd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function qd(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var zn={exports:{}},H=String,ha=function(){return{isColorSupported:!1,reset:H,bold:H,dim:H,italic:H,underline:H,inverse:H,hidden:H,strikethrough:H,black:H,red:H,green:H,yellow:H,blue:H,magenta:H,cyan:H,white:H,gray:H,bgBlack:H,bgRed:H,bgGreen:H,bgYellow:H,bgBlue:H,bgMagenta:H,bgCyan:H,bgWhite:H}};zn.exports=ha();zn.exports.createColors=ha;var Qd=zn.exports,eh={},th=Object.freeze(Object.defineProperty({__proto__:null,default:eh},Symbol.toStringTag,{value:"Module"})),be=qd(th),jo=Qd,Ko=be,Qs=class fa extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,fa)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=jo.isColorSupported),Ko&&e&&(t=Ko(t));let r=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),i=String(o).length,l,a;if(e){let{bold:u,gray:c,red:d}=jo.createColors(!0);l=p=>u(d(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(n,o).map((u,c)=>{let d=n+1+c,p=" "+(" "+d).slice(-i)+" | ";if(d===this.line){let m=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
|
|
27
27
|
`+m+l("^")}return" "+a(p)+u}).join(`
|
|
28
28
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
29
29
|
|
|
30
30
|
`+e+`
|
|
31
|
-
`),this.name+": "+this.message+e}},
|
|
31
|
+
`),this.name+": "+this.message+e}},Bn=Qs;Qs.default=Qs;var $t={};$t.isClean=Symbol("isClean");$t.my=Symbol("my");var Jo={after:`
|
|
32
32
|
`,beforeClose:`
|
|
33
33
|
`,beforeComment:`
|
|
34
34
|
`,beforeDecl:`
|
|
35
35
|
`,beforeOpen:" ",beforeRule:`
|
|
36
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
37
|
-
`)){let i=this.raw(e,null,"indent");if(i.length)for(let l=0;l<o;l++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return
|
|
36
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function rh(s){return s[0].toUpperCase()+s.slice(1)}var en=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+n+o,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,o=0;for(;n&&n.type!=="root";)o+=1,n=n.parent;if(r.includes(`
|
|
37
|
+
`)){let i=this.raw(e,null,"indent");if(i.length)for(let l=0;l<o;l++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Jo[r];let i=e.root();if(i.rawCache||(i.rawCache={}),typeof i.rawCache[r]<"u")return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+rh(r);this[l]?n=this[l](i,e):i.walk(a=>{if(n=a.raws[t],typeof n<"u")return!1})}return typeof n>"u"&&(n=Jo[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
|
|
38
38
|
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
39
39
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
40
40
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
|
|
41
41
|
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))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&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
42
|
-
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))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)}},
|
|
43
|
-
`?(n=1,o+=1):n+=1;return{column:n,line:o}}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(),o=n.indexOf(e.word);o!==-1&&(t=this.positionInside(o,n),r=this.positionInside(o+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}:typeof e.endIndex=="number"?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
|
|
44
|
-
`);r=new Array(o.length);let i=0;for(let l=0,a=o.length;l<a;l++)r[l]=i,i+=o[l].length+1;this[
|
|
42
|
+
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))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)}},pa=en;en.default=en;var sh=pa;function tn(s,e){new sh(e).stringify(s)}var Yr=tn;tn.default=tn;var{isClean:ir,my:nh}=$t,oh=Bn,ih=pa,ah=Yr;function rn(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let n=s[r],o=typeof n;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=n:Array.isArray(n)?t[r]=n.map(i=>rn(i,t)):(o==="object"&&n!==null&&(n=rn(n)),t[r]=n)}return t}var sn=class{constructor(e={}){this.raws={},this[ir]=!1,this[nh]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=rn(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 oh(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[ir]){this[ir]=!1;let e=this;for(;e=e.parent;)e[ir]=!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){t=this.toString();let n=t.indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,o=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
|
|
43
|
+
`?(n=1,o+=1):n+=1;return{column:n,line:o}}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(),o=n.indexOf(e.word);o!==-1&&(t=this.positionInside(o,n),r=this.positionInside(o+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}:typeof e.endIndex=="number"?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 ih().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&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},n=t==null;t=t||new Map;let o=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let l=this[i];if(Array.isArray(l))r[i]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[i]=l.toJSON(null,t);else if(i==="source"){let a=t.get(l.input);a==null&&(a=o,t.set(l.input,o),o++),r[i]={end:l.end,inputId:a,start:l.start}}else r[i]=l}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ah){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let o in r)n[o]=r[o];return e.warn(t,n)}get proxyOf(){return this}},Gr=sn;sn.default=sn;var lh=Gr,nn=class extends lh{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},jr=nn;nn.default=nn;var uh="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ch=(s,e=21)=>(t=e)=>{let r="",n=t;for(;n--;)r+=s[Math.random()*s.length|0];return r},dh=(s=21)=>{let e="",t=s;for(;t--;)e+=uh[Math.random()*64|0];return e},hh={nanoid:dh,customAlphabet:ch},{SourceMapConsumer:Zo,SourceMapGenerator:Xo}=be,{existsSync:fh,readFileSync:ph}=be,{dirname:Os,join:mh}=be;function gh(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var on=class{constructor(e,t){if(t.map===!1)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=Os(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Zo(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(n.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return gh(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||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=Os(e),fh(e))return this.mapFile=e,ph(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}else{if(t instanceof Zo)return Xo.fromSourceMap(t).toString();if(t instanceof Xo)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=mh(Os(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},ma=on;on.default=on;var{SourceMapConsumer:yh,SourceMapGenerator:wh}=be,{fileURLToPath:qo,pathToFileURL:ar}=be,{isAbsolute:an,resolve:ln}=be,{nanoid:Sh}=hh,Ds=be,Qo=Bn,vh=ma,Ts=Symbol("fromOffsetCache"),bh=!!(yh&&wh),ei=!!(ln&&an),Nr=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ei||/^\w+:\/\//.test(t.from)||an(t.from)?this.file=t.from:this.file=ln(t.from)),ei&&bh){let r=new vh(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+Sh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let o,i,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);t=d.line,r=d.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);i=d.line,l=d.col}else i=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,i,l);return a?o=new Qo(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):o=new Qo(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:l,line:i},this.css,this.file,n.plugin),o.input={column:r,endColumn:l,endLine:i,line:t,source:this.css},this.file&&(ar&&(o.input.url=ar(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[Ts])r=this[Ts];else{let o=this.css.split(`
|
|
44
|
+
`);r=new Array(o.length);let i=0;for(let l=0,a=o.length;l<a;l++)r[l]=i,i+=o[l].length+1;this[Ts]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let o=r.length-2,i;for(;n<o;)if(i=n+(o-n>>1),e<r[i])o=i-1;else if(e>=r[i+1])n=i+1;else{n=i;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ln(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let o=this.map.consumer(),i=o.originalPositionFor({column:t,line:e});if(!i.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:n,line:r}));let a;an(i.source)?a=ar(i.source):a=new URL(i.source,this.map.consumer().sourceRoot||ar(this.map.mapFile));let u={column:i.column,endColumn:l&&l.column,endLine:l&&l.line,line:i.line,url:a.toString()};if(a.protocol==="file:")if(qo)u.file=qo(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(i.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(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}},Kr=Nr;Nr.default=Nr;Ds&&Ds.registerInput&&Ds.registerInput(Nr);var{SourceMapConsumer:ga,SourceMapGenerator:vr}=be,{dirname:br,relative:ya,resolve:wa,sep:Sa}=be,{pathToFileURL:ti}=be,Ch=Kr,Eh=!!(ga&&vr),Rh=!!(br&&wa&&ya&&Sa),Ih=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;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
45
45
|
`;this.css.includes(`\r
|
|
46
46
|
`)&&(t=`\r
|
|
47
|
-
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||
|
|
48
|
-
`),t=l.length-i):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Cr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Cr(ma(r,this.mapOpts.annotation)));let n=pa(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Sh(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 t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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(qo){let r=qo(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;ga==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},ya=bh,Eh=Gr,on=class extends Eh{constructor(e){super(e),this.type="comment"}},Jr=on;on.default=on;var{isClean:wa,my:Sa}=$t,va=jr,Ca=Jr,Rh=Gr,ba,Un,zn,Ea;function Ra(s){return s.map(e=>(e.nodes&&(e.nodes=Ra(e.nodes)),delete e.source,e))}function Ia(s){if(s[wa]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Ia(e)}var Me=class xa extends Rh{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}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=this.getIterator(),r,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(n=>typeof n=="function"?(o,i)=>n(o.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...o)=>r(n.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let o;for(let i in this.indexes)o=this.indexes[i],r<o&&(this.indexes[i]=o+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let i;for(let l in this.indexes)i=this.indexes[l],r<=i&&(this.indexes[l]=i+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Ra(ba(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new va(e)]}else if(e.selector)e=[new Un(e)];else if(e.name)e=[new zn(e)];else if(e.text)e=[new Ca(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[Sa]||xa.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[wa]&&Ia(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(o){throw t.addToError(o)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}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]}};Me.registerParse=s=>{ba=s};Me.registerRule=s=>{Un=s};Me.registerAtRule=s=>{zn=s};Me.registerRoot=s=>{Ea=s};var Ve=Me;Me.default=Me;Me.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,zn.prototype):s.type==="rule"?Object.setPrototypeOf(s,Un.prototype):s.type==="decl"?Object.setPrototypeOf(s,va.prototype):s.type==="comment"?Object.setPrototypeOf(s,Ca.prototype):s.type==="root"&&Object.setPrototypeOf(s,Ea.prototype),s[Sa]=!0,s.nodes&&s.nodes.forEach(e=>{Me.rebuild(e)})};var Ih=Ve,Aa,_a,Ot=class extends Ih{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Aa(new _a,this,e).stringify()}};Ot.registerLazyResult=s=>{Aa=s};Ot.registerProcessor=s=>{_a=s};var Hn=Ot;Ot.default=Ot;var an=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Oa=an;an.default=an;var xh=Oa,ln=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new xh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Bn=ln;ln.default=ln;var Os=39,Qo=34,lr=92,ei=47,ur=10,wt=32,cr=12,dr=9,hr=13,Ah=91,_h=93,Oh=40,Dh=41,Th=123,Nh=125,Mh=59,kh=42,Ph=58,$h=64,fr=/[\t\n\f\r "#'()/;[\\\]{}]/g,pr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Lh=/.[\r\n"'(/\\]/,ti=/[\da-f]/i,Fh=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,o,i,l,a,u,c,d,p,m,g,f=r.length,h=0,E=[],S=[];function w(){return h}function I(v){throw e.error("Unclosed "+v,h)}function _(){return S.length===0&&h>=f}function y(v){if(S.length)return S.pop();if(h>=f)return;let x=v?v.ignoreUnclosed:!1;switch(o=r.charCodeAt(h),o){case ur:case wt:case dr:case hr:case cr:{i=h;do i+=1,o=r.charCodeAt(i);while(o===wt||o===ur||o===dr||o===hr||o===cr);g=["space",r.slice(h,i)],h=i-1;break}case Ah:case _h:case Th:case Nh:case Ph:case Mh:case Dh:{let O=String.fromCharCode(o);g=[O,O,h];break}case Oh:{if(p=E.length?E.pop()[1]:"",m=r.charCodeAt(h+1),p==="url"&&m!==Os&&m!==Qo&&m!==wt&&m!==ur&&m!==dr&&m!==cr&&m!==hr){i=h;do{if(c=!1,i=r.indexOf(")",i+1),i===-1)if(n||x){i=h;break}else I("bracket");for(d=i;r.charCodeAt(d-1)===lr;)d-=1,c=!c}while(c);g=["brackets",r.slice(h,i+1),h,i],h=i}else i=r.indexOf(")",h+1),a=r.slice(h,i+1),i===-1||Lh.test(a)?g=["(","(",h]:(g=["brackets",a,h,i],h=i);break}case Os:case Qo:{l=o===Os?"'":'"',i=h;do{if(c=!1,i=r.indexOf(l,i+1),i===-1)if(n||x){i=h+1;break}else I("string");for(d=i;r.charCodeAt(d-1)===lr;)d-=1,c=!c}while(c);g=["string",r.slice(h,i+1),h,i],h=i;break}case $h:{fr.lastIndex=h+1,fr.test(r),fr.lastIndex===0?i=r.length-1:i=fr.lastIndex-2,g=["at-word",r.slice(h,i+1),h,i],h=i;break}case lr:{for(i=h,u=!0;r.charCodeAt(i+1)===lr;)i+=1,u=!u;if(o=r.charCodeAt(i+1),u&&o!==ei&&o!==wt&&o!==ur&&o!==dr&&o!==hr&&o!==cr&&(i+=1,ti.test(r.charAt(i)))){for(;ti.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===wt&&(i+=1)}g=["word",r.slice(h,i+1),h,i],h=i;break}default:{o===ei&&r.charCodeAt(h+1)===kh?(i=r.indexOf("*/",h+2)+1,i===0&&(n||x?i=r.length:I("comment")),g=["comment",r.slice(h,i+1),h,i],h=i):(pr.lastIndex=h+1,pr.test(r),pr.lastIndex===0?i=r.length-1:i=pr.lastIndex-2,g=["word",r.slice(h,i+1),h,i],E.push(g),h=i);break}}return h++,g}function R(v){S.push(v)}return{back:R,endOfFile:_,nextToken:y,position:w}},Da=Ve,Mr=class extends Da{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)}},Wn=Mr;Mr.default=Mr;Da.registerAtRule(Mr);var Ta=Ve,Na,Ma,ot=class extends Ta{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of n)o.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Na(new Ma,this,e).stringify()}};ot.registerLazyResult=s=>{Na=s};ot.registerProcessor=s=>{Ma=s};var Lt=ot;ot.default=ot;Ta.registerRoot(ot);var Dt={comma(s){return Dt.split(s,[","],!0)},space(s){let e=[" ",`
|
|
49
|
-
`," "];return Dt.split(s,e)},split(s,e,t){let r=[],n="",o=!1,i=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?i+=1:c===")"?i>0&&(i-=1):i===0&&e.includes(c)&&(o=!0),o?(n!==""&&r.push(n.trim()),n="",o=!1):n+=c;return(t||n!=="")&&r.push(n.trim()),r}},ka=Dt;Dt.default=Dt;var Pa=Ve,Uh=ka,kr=class extends Pa{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Uh.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)}},Vn=kr;kr.default=kr;Pa.registerRule(kr);var zh=jr,Hh=Fh,Bh=Jr,Wh=Wn,Vh=Lt,ri=Vn,si={empty:!0,space:!0};function Yh(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var Gh=class{constructor(e){this.input=e,this.root=new Vh,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=new Wh;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,o,i=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,n=a[o];n&&n[0]==="space";)n=a[--o];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let o=t-1;o>=0&&(n=e[o],!(n[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,o;for(let[i,l]of e.entries()){if(r=l,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return i}o=r}return!1}comment(e){let t=new Bh;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Hh(this.input)}decl(e,t){let r=new zh;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||Yh(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),d="";for(let p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=i.map(u=>u[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ri;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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.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="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,i=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")o||(o=u),i.push(r==="("?")":"]");else if(l&&n&&r==="{")o||(o=u),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&n){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}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);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,i,l=r.length,a="",u=!0,c,d;for(let p=0;p<l;p+=1)o=r[p],i=o[0],i==="space"&&p===l-1&&!n?u=!1:i==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!si[d]&&!si[c]?a.slice(-1)===","?u=!1:a+=o[1]:u=!1):a+=o[1];if(!u){let p=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new ri;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],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)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})}},jh=Gh,Kh=Ve,Jh=jh,Zh=Kr;function Pr(s,e){let t=new Zh(s,e),r=new Jh(t);try{r.parse()}catch(n){throw n}return r.root}var Yn=Pr;Pr.default=Pr;Kh.registerParse(Pr);var{isClean:xe,my:Xh}=$t,qh=ya,Qh=Yr,ef=Ve,tf=Hn;var ni=Bn,rf=Yn,sf=Lt,nf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},of={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},af={Once:!0,postcssPlugin:!0,prepare:!0},it=0;function St(s){return typeof s=="object"&&typeof s.then=="function"}function $a(s){let e=!1,t=nf[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,it,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,it,t+"Exit"]:[t,t+"Exit"]}function oi(s){let e;return s.type==="document"?e=["Document",it,"DocumentExit"]:s.type==="root"?e=["Root",it,"RootExit"]:e=$a(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function un(s){return s[xe]=!1,s.nodes&&s.nodes.forEach(e=>un(e)),s}var cn={},at=class La{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=un(t);else if(t instanceof La||t instanceof ni)n=un(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=rf;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{n=o(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[Xh]&&ef.rebuild(n)}this.result=new ni(e,n,r),this.helpers={...cn,postcss:cn,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!of[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!af[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);else typeof t[r]=="function"&&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(St(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xe];){e[xe]=!0;let t=[oi(e)];for(;t.length>0;){let r=this.visitTick(t);if(St(r))try{await r}catch(n){let o=t[t.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(o=>r(o,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return St(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Qh;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new qh(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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){let t=this.runOnRoot(e);if(St(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xe];)e[xe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let o;try{o=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(St(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,l]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let i=t.iterator,l;for(;l=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!l[xe]){l[xe]=!0,e.push(oi(l));return}t.iterator=0,delete r.indexes[i]}let o=t.events;for(;t.eventIndex<o.length;){let i=o[t.eventIndex];if(t.eventIndex+=1,i===it){r.nodes&&r.nodes.length&&(r[xe]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[xe]=!0;let t=$a(e);for(let r of t)if(r===it)e.nodes&&e.each(n=>{n[xe]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};at.registerPostcss=s=>{cn=s};var Fa=at;at.default=at;sf.registerLazyResult(at);tf.registerLazyResult(at);var lf=ya,uf=Yr;var cf=Yn,df=Bn,dn=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n,o=uf;this.result=new df(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let l=new lf(o,n,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.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 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=cf;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},hf=dn;dn.default=dn;var ff=hf,pf=Fa,mf=Hn,gf=Lt,Tt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new ff(this,e,t):new pf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},yf=Tt;Tt.default=Tt;gf.registerProcessor(Tt);mf.registerProcessor(Tt);var wf=jr,Sf=ha,vf=Jr,Cf=Wn,bf=Kr,Ef=Lt,Rf=Vn;function Nt(s,e){if(Array.isArray(s))return s.map(n=>Nt(n));let{inputs:t,...r}=s;if(t){e=[];for(let n of t){let o={...n,__proto__:bf.prototype};o.map&&(o.map={...o.map,__proto__:Sf.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>Nt(n,e))),r.source){let{inputId:n,...o}=r.source;r.source=o,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new Ef(r);if(r.type==="decl")return new wf(r);if(r.type==="rule")return new Rf(r);if(r.type==="comment")return new vf(r);if(r.type==="atrule")return new Cf(r);throw new Error("Unknown node type: "+s.type)}var If=Nt;Nt.default=Nt;var xf=Fn,Ua=jr,Af=Fa,_f=Ve,Gn=yf,Of=Yr,Df=If,za=Hn,Tf=Oa,Ha=Jr,Ba=Wn,Nf=Bn,Mf=Kr,kf=Yn,Pf=ka,Wa=Vn,Va=Lt,$f=Gr;function L(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Gn(s)}L.plugin=function(e,t){let r=!1;function n(...i){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
47
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||br(e.file),n;this.mapOpts.sourcesContent===!1?(n=new ga(e.text),n.sourcesContent&&(n.sourcesContent=null)):n=e.consumer(),this.map.applySourceMap(n,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Rh&&Eh&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=vr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new vr({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 vr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,i;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(n.generated.line=e,n.generated.column=t-1,a.source&&a.source.start?(n.source=this.sourcePath(a),n.original.line=a.source.start.line,n.original.column=a.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),o=l.match(/\n/g),o?(e+=o.length,i=l.lastIndexOf(`
|
|
48
|
+
`),t=l.length-i):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?br(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=br(wa(r,this.mapOpts.annotation)));let n=ya(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ch(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 t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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(ti){let r=ti(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;Sa==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},va=Ih,xh=Gr,un=class extends xh{constructor(e){super(e),this.type="comment"}},Jr=un;un.default=un;var{isClean:ba,my:Ca}=$t,Ea=jr,Ra=Jr,Ah=Gr,Ia,Hn,Wn,xa;function Aa(s){return s.map(e=>(e.nodes&&(e.nodes=Aa(e.nodes)),delete e.source,e))}function _a(s){if(s[ba]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)_a(e)}var ke=class Oa extends Ah{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}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=this.getIterator(),r,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(n=>typeof n=="function"?(o,i)=>n(o.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...o)=>r(n.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let o;for(let i in this.indexes)o=this.indexes[i],r<o&&(this.indexes[i]=o+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let i;for(let l in this.indexes)i=this.indexes[l],r<=i&&(this.indexes[l]=i+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Aa(Ia(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ea(e)]}else if(e.selector)e=[new Hn(e)];else if(e.name)e=[new Wn(e)];else if(e.text)e=[new Ra(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[Ca]||Oa.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[ba]&&_a(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(o){throw t.addToError(o)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}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]}};ke.registerParse=s=>{Ia=s};ke.registerRule=s=>{Hn=s};ke.registerAtRule=s=>{Wn=s};ke.registerRoot=s=>{xa=s};var Ye=ke;ke.default=ke;ke.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Wn.prototype):s.type==="rule"?Object.setPrototypeOf(s,Hn.prototype):s.type==="decl"?Object.setPrototypeOf(s,Ea.prototype):s.type==="comment"?Object.setPrototypeOf(s,Ra.prototype):s.type==="root"&&Object.setPrototypeOf(s,xa.prototype),s[Ca]=!0,s.nodes&&s.nodes.forEach(e=>{ke.rebuild(e)})};var _h=Ye,Da,Ta,Ot=class extends _h{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Da(new Ta,this,e).stringify()}};Ot.registerLazyResult=s=>{Da=s};Ot.registerProcessor=s=>{Ta=s};var Vn=Ot;Ot.default=Ot;var cn=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Na=cn;cn.default=cn;var Oh=Na,dn=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Oh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Yn=dn;dn.default=dn;var Ns=39,ri=34,lr=92,si=47,ur=10,wt=32,cr=12,dr=9,hr=13,Dh=91,Th=93,Nh=40,Mh=41,kh=123,Ph=125,$h=59,Lh=42,Fh=58,Uh=64,fr=/[\t\n\f\r "#'()/;[\\\]{}]/g,pr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,zh=/.[\r\n"'(/\\]/,ni=/[\da-f]/i,Bh=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,o,i,l,a,u,c,d,p,m,g,f=r.length,h=0,E=[],S=[];function w(){return h}function I(v){throw e.error("Unclosed "+v,h)}function _(){return S.length===0&&h>=f}function y(v){if(S.length)return S.pop();if(h>=f)return;let x=v?v.ignoreUnclosed:!1;switch(o=r.charCodeAt(h),o){case ur:case wt:case dr:case hr:case cr:{i=h;do i+=1,o=r.charCodeAt(i);while(o===wt||o===ur||o===dr||o===hr||o===cr);g=["space",r.slice(h,i)],h=i-1;break}case Dh:case Th:case kh:case Ph:case Fh:case $h:case Mh:{let O=String.fromCharCode(o);g=[O,O,h];break}case Nh:{if(p=E.length?E.pop()[1]:"",m=r.charCodeAt(h+1),p==="url"&&m!==Ns&&m!==ri&&m!==wt&&m!==ur&&m!==dr&&m!==cr&&m!==hr){i=h;do{if(c=!1,i=r.indexOf(")",i+1),i===-1)if(n||x){i=h;break}else I("bracket");for(d=i;r.charCodeAt(d-1)===lr;)d-=1,c=!c}while(c);g=["brackets",r.slice(h,i+1),h,i],h=i}else i=r.indexOf(")",h+1),a=r.slice(h,i+1),i===-1||zh.test(a)?g=["(","(",h]:(g=["brackets",a,h,i],h=i);break}case Ns:case ri:{l=o===Ns?"'":'"',i=h;do{if(c=!1,i=r.indexOf(l,i+1),i===-1)if(n||x){i=h+1;break}else I("string");for(d=i;r.charCodeAt(d-1)===lr;)d-=1,c=!c}while(c);g=["string",r.slice(h,i+1),h,i],h=i;break}case Uh:{fr.lastIndex=h+1,fr.test(r),fr.lastIndex===0?i=r.length-1:i=fr.lastIndex-2,g=["at-word",r.slice(h,i+1),h,i],h=i;break}case lr:{for(i=h,u=!0;r.charCodeAt(i+1)===lr;)i+=1,u=!u;if(o=r.charCodeAt(i+1),u&&o!==si&&o!==wt&&o!==ur&&o!==dr&&o!==hr&&o!==cr&&(i+=1,ni.test(r.charAt(i)))){for(;ni.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===wt&&(i+=1)}g=["word",r.slice(h,i+1),h,i],h=i;break}default:{o===si&&r.charCodeAt(h+1)===Lh?(i=r.indexOf("*/",h+2)+1,i===0&&(n||x?i=r.length:I("comment")),g=["comment",r.slice(h,i+1),h,i],h=i):(pr.lastIndex=h+1,pr.test(r),pr.lastIndex===0?i=r.length-1:i=pr.lastIndex-2,g=["word",r.slice(h,i+1),h,i],E.push(g),h=i);break}}return h++,g}function R(v){S.push(v)}return{back:R,endOfFile:_,nextToken:y,position:w}},Ma=Ye,Mr=class extends Ma{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)}},Gn=Mr;Mr.default=Mr;Ma.registerAtRule(Mr);var ka=Ye,Pa,$a,it=class extends ka{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of n)o.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Pa(new $a,this,e).stringify()}};it.registerLazyResult=s=>{Pa=s};it.registerProcessor=s=>{$a=s};var Lt=it;it.default=it;ka.registerRoot(it);var Dt={comma(s){return Dt.split(s,[","],!0)},space(s){let e=[" ",`
|
|
49
|
+
`," "];return Dt.split(s,e)},split(s,e,t){let r=[],n="",o=!1,i=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?i+=1:c===")"?i>0&&(i-=1):i===0&&e.includes(c)&&(o=!0),o?(n!==""&&r.push(n.trim()),n="",o=!1):n+=c;return(t||n!=="")&&r.push(n.trim()),r}},La=Dt;Dt.default=Dt;var Fa=Ye,Hh=La,kr=class extends Fa{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Hh.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)}},jn=kr;kr.default=kr;Fa.registerRule(kr);var Wh=jr,Vh=Bh,Yh=Jr,Gh=Gn,jh=Lt,oi=jn,ii={empty:!0,space:!0};function Kh(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var Jh=class{constructor(e){this.input=e,this.root=new jh,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=new Gh;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,o,i=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,n=a[o];n&&n[0]==="space";)n=a[--o];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let o=t-1;o>=0&&(n=e[o],!(n[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,o;for(let[i,l]of e.entries()){if(r=l,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return i}o=r}return!1}comment(e){let t=new Yh;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Vh(this.input)}decl(e,t){let r=new Wh;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||Kh(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),d="";for(let p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=i.map(u=>u[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new oi;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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.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="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,i=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")o||(o=u),i.push(r==="("?")":"]");else if(l&&n&&r==="{")o||(o=u),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&n){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}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);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,i,l=r.length,a="",u=!0,c,d;for(let p=0;p<l;p+=1)o=r[p],i=o[0],i==="space"&&p===l-1&&!n?u=!1:i==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!ii[d]&&!ii[c]?a.slice(-1)===","?u=!1:a+=o[1]:u=!1):a+=o[1];if(!u){let p=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new oi;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],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)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})}},Zh=Jh,Xh=Ye,qh=Zh,Qh=Kr;function Pr(s,e){let t=new Qh(s,e),r=new qh(t);try{r.parse()}catch(n){throw n}return r.root}var Kn=Pr;Pr.default=Pr;Xh.registerParse(Pr);var{isClean:xe,my:ef}=$t,tf=va,rf=Yr,sf=Ye,nf=Vn;var ai=Yn,of=Kn,af=Lt,lf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},uf={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},cf={Once:!0,postcssPlugin:!0,prepare:!0},at=0;function St(s){return typeof s=="object"&&typeof s.then=="function"}function Ua(s){let e=!1,t=lf[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,at,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,at,t+"Exit"]:[t,t+"Exit"]}function li(s){let e;return s.type==="document"?e=["Document",at,"DocumentExit"]:s.type==="root"?e=["Root",at,"RootExit"]:e=Ua(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function hn(s){return s[xe]=!1,s.nodes&&s.nodes.forEach(e=>hn(e)),s}var fn={},lt=class za{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=hn(t);else if(t instanceof za||t instanceof ai)n=hn(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=of;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{n=o(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[ef]&&sf.rebuild(n)}this.result=new ai(e,n,r),this.helpers={...fn,postcss:fn,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!uf[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!cf[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);else typeof t[r]=="function"&&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(St(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xe];){e[xe]=!0;let t=[li(e)];for(;t.length>0;){let r=this.visitTick(t);if(St(r))try{await r}catch(n){let o=t[t.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(o=>r(o,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return St(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=rf;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new tf(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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){let t=this.runOnRoot(e);if(St(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xe];)e[xe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let o;try{o=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(St(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,l]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let i=t.iterator,l;for(;l=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!l[xe]){l[xe]=!0,e.push(li(l));return}t.iterator=0,delete r.indexes[i]}let o=t.events;for(;t.eventIndex<o.length;){let i=o[t.eventIndex];if(t.eventIndex+=1,i===at){r.nodes&&r.nodes.length&&(r[xe]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[xe]=!0;let t=Ua(e);for(let r of t)if(r===at)e.nodes&&e.each(n=>{n[xe]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};lt.registerPostcss=s=>{fn=s};var Ba=lt;lt.default=lt;af.registerLazyResult(lt);nf.registerLazyResult(lt);var df=va,hf=Yr;var ff=Kn,pf=Yn,pn=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n,o=hf;this.result=new pf(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let l=new df(o,n,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.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 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=ff;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},mf=pn;pn.default=pn;var gf=mf,yf=Ba,wf=Vn,Sf=Lt,Tt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new gf(this,e,t):new yf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},vf=Tt;Tt.default=Tt;Sf.registerProcessor(Tt);wf.registerProcessor(Tt);var bf=jr,Cf=ma,Ef=Jr,Rf=Gn,If=Kr,xf=Lt,Af=jn;function Nt(s,e){if(Array.isArray(s))return s.map(n=>Nt(n));let{inputs:t,...r}=s;if(t){e=[];for(let n of t){let o={...n,__proto__:If.prototype};o.map&&(o.map={...o.map,__proto__:Cf.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>Nt(n,e))),r.source){let{inputId:n,...o}=r.source;r.source=o,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new xf(r);if(r.type==="decl")return new bf(r);if(r.type==="rule")return new Af(r);if(r.type==="comment")return new Ef(r);if(r.type==="atrule")return new Rf(r);throw new Error("Unknown node type: "+s.type)}var _f=Nt;Nt.default=Nt;var Of=Bn,Ha=jr,Df=Ba,Tf=Ye,Jn=vf,Nf=Yr,Mf=_f,Wa=Vn,kf=Na,Va=Jr,Ya=Gn,Pf=Yn,$f=Kr,Lf=Kn,Ff=La,Ga=jn,ja=Lt,Uf=Gr;function L(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Jn(s)}L.plugin=function(e,t){let r=!1;function n(...i){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
50
50
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
51
|
-
https://www.w3ctech.com/topic/2226`));let l=t(...i);return l.postcssPlugin=e,l.postcssVersion=new
|
|
51
|
+
https://www.w3ctech.com/topic/2226`));let l=t(...i);return l.postcssPlugin=e,l.postcssVersion=new Jn().version,l}let o;return Object.defineProperty(n,"postcss",{get(){return o||(o=n()),o}}),n.process=function(i,l,a){return L([n(a)]).process(i,l)},n};L.stringify=Nf;L.parse=Lf;L.fromJSON=Mf;L.list=Ff;L.comment=s=>new Va(s);L.atRule=s=>new Ya(s);L.decl=s=>new Ha(s);L.rule=s=>new Ga(s);L.root=s=>new ja(s);L.document=s=>new Wa(s);L.CssSyntaxError=Of;L.Declaration=Ha;L.Container=Tf;L.Processor=Jn;L.Document=Wa;L.Comment=Va;L.Warning=kf;L.AtRule=Ya;L.Result=Pf;L.Input=$f;L.Rule=Ga;L.Root=ja;L.Node=Uf;Df.registerPostcss(L);var zf=L;L.default=L;var V=Xd(zf);V.stringify;V.fromJSON;V.plugin;V.parse;V.list;V.document;V.comment;V.atRule;V.rule;V.decl;V.root;V.CssSyntaxError;V.Declaration;V.Container;V.Processor;V.Document;V.Comment;V.Warning;V.AtRule;V.Result;V.Input;V.Rule;V.Root;V.Node;var mn=class s{constructor(...e){me(this,"parentElement",null),me(this,"parentNode",null),me(this,"ownerDocument"),me(this,"firstChild",null),me(this,"lastChild",null),me(this,"previousSibling",null),me(this,"nextSibling",null),me(this,"ELEMENT_NODE",1),me(this,"TEXT_NODE",3),me(this,"nodeType"),me(this,"nodeName"),me(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;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"}},ui={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ci={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},mr={};function Zn(s){if(mr[s])return mr[s];let e=globalThis[s],t=e.prototype,r=s in ui?ui[s]:void 0,n=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in ci?ci[s]:void 0,i=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(n&&i)return mr[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?mr[s]=u:t}catch{return t}}var Ms={};function ze(s,e,t){var r;let n=`${s}.${String(t)}`;if(Ms[n])return Ms[n].call(e);let o=Zn(s),i=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return i?(Ms[n]=i,i.call(e)):e[t]}var ks={};function Ka(s,e,t){let r=`${s}.${String(t)}`;if(ks[r])return ks[r].bind(e);let o=Zn(s)[t];return typeof o!="function"?e[t]:(ks[r]=o,o.bind(e))}function Bf(s){return ze("Node",s,"childNodes")}function Hf(s){return ze("Node",s,"parentNode")}function Wf(s){return ze("Node",s,"parentElement")}function Vf(s){return ze("Node",s,"textContent")}function Yf(s,e){return Ka("Node",s,"contains")(e)}function Gf(s){return Ka("Node",s,"getRootNode")()}function jf(s){return!s||!("host"in s)?null:ze("ShadowRoot",s,"host")}function Kf(s){return s.styleSheets}function Jf(s){return!s||!("shadowRoot"in s)?null:ze("Element",s,"shadowRoot")}function Zf(s,e){return ze("Element",s,"querySelector")(e)}function Xf(s,e){return ze("Element",s,"querySelectorAll")(e)}function Ja(){return Zn("MutationObserver").constructor}var D={childNodes:Bf,parentNode:Hf,parentElement:Wf,textContent:Vf,contains:Yf,getRootNode:Gf,host:jf,styleSheets:Kf,shadowRoot:Jf,querySelector:Zf,querySelectorAll:Xf,mutationObserver:Ja};function ie(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var qe=`Please stop import mirror directly. Instead of that,\r
|
|
52
52
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
53
|
-
or you can use record.mirror to access the mirror instance during recording.`,li={map:{},getId(){return console.error(Xe),-1},getNode(){return console.error(Xe),null},removeNodeFromMap(){console.error(Xe)},has(){return console.error(Xe),!1},reset(){console.error(Xe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(li=new Proxy(li,{get(s,e,t){return e==="map"&&console.error(Xe),Reflect.get(s,e,t)}}));function Mt(s,e,t={}){let r=null,n=0;return function(...o){let i=Date.now();!n&&t.leading===!1&&(n=i);let l=e-(i-n),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),n=i,s.apply(a,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{n=t.leading===!1?0:Date.now(),r=null,s.apply(a,o)},l))}}function Zr(s,e,t,r,n=window){let o=n.Object.getOwnPropertyDescriptor(s,e);return n.Object.defineProperty(s,e,r?t:{set(i){setTimeout(()=>{t.set.call(this,i)},0),o&&o.set&&o.set.call(this,i)}}),()=>Zr(s,e,o||{},!0)}function ut(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],n=t(r);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=n,()=>{s[e]=r}}catch{return()=>{}}}var $r=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||($r=()=>new Date().getTime());function ja(s){var e,t,r,n;let o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=D.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o?.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=D.parentElement(o.body))==null?void 0:r.scrollTop)||((n=o?.body)==null?void 0:n.scrollTop)||0}}function Ka(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ja(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Za(s){return s?s.nodeType===s.ELEMENT_NODE?s:D.parentElement(s):null}function ie(s,e,t,r){if(!s)return!1;let n=Za(s);if(!n)return!1;try{if(typeof e=="string"){if(n.classList.contains(e)||r&&n.closest("."+e)!==null)return!0}else if(Ar(n,e,r))return!0}catch{}return!!(t&&(n.matches(t)||r&&n.closest(t)!==null))}function Jf(s,e){return e.getId(s)!==-1}function Ns(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Rt}function Xa(s,e){if(Ct(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=D.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Xa(r,e):!0}function fn(s){return!!s.changedTouches}function Zf(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function qa(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Qa(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function pn(s){return s?s instanceof hn&&"shadowRoot"in s?!!s.shadowRoot:!!D.shadowRoot(s):!1}var mn=class{constructor(){C(this,"id",1),C(this,"styleIDMap",new WeakMap),C(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 t===void 0?r=this.id++:r=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 el(s){var e;let t=null;return"getRootNode"in s&&((e=D.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D.host(D.getRootNode(s))&&(t=D.host(D.getRootNode(s))),t}function Xf(s){let e=s,t;for(;t=el(e);)e=t;return e}function qf(s){let e=s.ownerDocument;if(!e)return!1;let t=Xf(s);return D.contains(e,t)}function tl(s){let e=s.ownerDocument;return e?D.contains(e,s)||qf(s):!1}var k=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(k||{}),T=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(T||{}),de=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(de||{}),Te=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Te||{}),lt=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(lt||{}),qe=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(qe||{});function ui(s){return"__ln"in s}var gn=class{constructor(){C(this,"length",0),C(this,"head",null),C(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=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ui(e.previousSibling)){let 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&&ui(e.nextSibling)&&e.nextSibling.__ln.previous){let 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;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},ci=(s,e)=>`${s}@${e}`,yn=class{constructor(){C(this,"frozen",!1),C(this,"locked",!1),C(this,"texts",[]),C(this,"attributes",[]),C(this,"attributeMap",new WeakMap),C(this,"removes",[]),C(this,"mapRemoves",[]),C(this,"movedMap",{}),C(this,"addedSet",new Set),C(this,"movedSet",new Set),C(this,"droppedSet",new Set),C(this,"mutationCb"),C(this,"blockClass"),C(this,"blockSelector"),C(this,"maskTextClass"),C(this,"maskTextSelector"),C(this,"inlineStylesheet"),C(this,"maskInputOptions"),C(this,"maskTextFn"),C(this,"maskInputFn"),C(this,"maskAnchorHrefFn"),C(this,"blockImgSrcPattern"),C(this,"blockImgSrcFillOptions"),C(this,"keepIframeSrcFn"),C(this,"recordCanvas"),C(this,"inlineImages"),C(this,"slimDOMOptions"),C(this,"dataURLOptions"),C(this,"doc"),C(this,"mirror"),C(this,"iframeManager"),C(this,"stylesheetManager"),C(this,"shadowDomManager"),C(this,"canvasManager"),C(this,"processedNodeManager"),C(this,"unattachedDoc"),C(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),C(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new gn,n=a=>{let u=a,c=Rt;for(;c===Rt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=a=>{let u=D.parentNode(a);if(!u||!tl(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Ct(u)?this.mirror.getId(el(a)):this.mirror.getId(u),p=n(a);if(d===-1||p===-1)return r.addNode(a);let m=et(a,{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,maskAnchorHrefFn:this.maskAnchorHrefFn,blockImgSrcPattern:this.blockImgSrcPattern,blockImgSrcFillOptions:this.blockImgSrcFillOptions,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{qa(g,this.mirror)&&this.iframeManager.addIframe(g),Qa(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),pn(a)&&this.shadowDomManager.addShadowRoot(D.shadowRoot(a),this.doc)},onIframeLoad:(g,f)=>{this.iframeManager.attachIframe(g,f),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,f)=>{this.stylesheetManager.attachLinkElement(g,f)},cssCaptured:c});m&&(e.push({parentId:d,nextId:p,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)di(this.removes,a,this.mirror)&&!this.movedSet.has(D.parentNode(a))||o(a);for(let a of this.addedSet)!hi(this.droppedSet,a)&&!di(this.removes,a,this.mirror)||hi(this.movedSet,a)?o(a):this.droppedSet.add(a);let i=null;for(;r.length;){let a=null;if(i){let u=this.mirror.getId(D.parentNode(i.value)),c=n(i.value);u!==-1&&c!==-1&&(a=i)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(D.parentNode(c.value));if(n(c.value)===-1)continue;if(d!==-1){a=c;break}else{let m=c.value,g=D.parentNode(m);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=D.host(g);if(this.mirror.getId(f)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}i=a.previous,r.removeNode(a.value),o(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=D.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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.movedMap={},this.mutationCb(l))}),C(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));let r=t.attributes.value=Array.from(D.childNodes(e),n=>D.textContent(n)||"").join("");t.attributes.value=Ir({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:null,value:r,maskInputFn:this.maskInputFn})}),C(this,"processMutation",e=>{if(!Ns(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=D.textContent(e.target);!ie(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:xi(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Za(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,n=e.target.getAttribute(r);if(r==="value"){let l=In(t);n=Ir({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:l,value:n,maskInputFn:this.maskInputFn})}let o=ie(e.target,this.blockClass,this.blockSelector,!1);if(o&&r==="style"){let l=e.target,{width:a,height:u}=l.getBoundingClientRect(),c=this.attributeMap.get(e.target);c||(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(c),this.attributeMap.set(e.target,c)),c.attributes.rr_width=`${a}px`,c.attributes.rr_height=`${u}px`}if(o||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(n))if(!t.contentDocument)r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ii(t.tagName,r))if(i.attributes[r]=Ri(this.doc,Be(t.tagName),Be(r),n),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let l=this.unattachedDoc.createElement("span");e.oldValue&&l.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let u=t.style.getPropertyValue(a),c=t.style.getPropertyPriority(a);u!==l.style.getPropertyValue(a)||c!==l.style.getPropertyPriority(a)?c===""?i.styleDiff[a]=u:i.styleDiff[a]=[u,c]:i._unchangedStyles[a]=[u,c]}for(let a of Array.from(l.style))t.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":{if(ie(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),n=Ct(e.target)?this.mirror.getId(D.host(e.target)):this.mirror.getId(e.target);ie(e.target,this.blockClass,this.blockSelector,!1)||Ns(t,this.mirror,this.slimDOMOptions)||!Jf(t,this.mirror)||(this.addedSet.has(t)?(wn(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Xa(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ci(r,n)]?wn(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:Ct(e.target)&&bt(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}}),C(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ns(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[ci(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ie(e,this.blockClass,this.blockSelector,!1)||(D.childNodes(e).forEach(r=>this.genAdds(r)),pn(e)&&D.childNodes(D.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAnchorHrefFn","blockImgSrcPattern","blockImgSrcFillOptions","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 wn(s,e){s.delete(e),D.childNodes(e).forEach(t=>wn(s,t))}function di(s,e,t){return s.length===0?!1:Qf(s,e,t)}function Qf(s,e,t){let r=D.parentNode(e);for(;r;){let n=t.getId(r);if(s.some(o=>o.id===n))return!0;r=D.parentNode(r)}return!1}function hi(s,e){return s.size===0?!1:rl(s,e)}function rl(s,e){let t=D.parentNode(e);return t?s.has(t)?!0:rl(s,t):!1}var Et;function ep(s){Et=s}function tp(){Et=void 0}var M=s=>Et?(...t)=>{try{return s(...t)}catch(r){if(Et&&Et(r)===!0)return;throw r}}:s,He=[];function Ft(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function sl(s,e){let t=new yn;He.push(t),t.init(s);let r=new(Ga())(M(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function rp({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let n=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,i=[],l,a=Mt(M(d=>{let p=Date.now()-l;s(i.map(m=>(m.timeOffset-=p,m)),d),i=[],l=null}),o),u=M(Mt(M(d=>{let p=Ft(d),{clientX:m,clientY:g}=fn(d)?d.changedTouches[0]:d;l||(l=$r()),i.push({x:m,y:g,id:r.getId(p),timeOffset:$r()-l}),a(typeof DragEvent<"u"&&d instanceof DragEvent?T.Drag:d instanceof MouseEvent?T.MouseMove:T.TouchMove)}),n,{trailing:!1})),c=[oe("mousemove",u,t),oe("touchmove",u,t),oe("drag",u,t)];return M(()=>{c.forEach(d=>d())})}function sp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=null,u=c=>d=>{let p=Ft(d);if(ie(p,r,n,!0))return;let m=null,g=c;if("pointerType"in d){switch(d.pointerType){case"mouse":m=Te.Mouse;break;case"touch":m=Te.Touch;break;case"pen":m=Te.Pen;break}m===Te.Touch?de[c]===de.MouseDown?g="TouchStart":de[c]===de.MouseUp&&(g="TouchEnd"):Te.Pen}else fn(d)&&(m=Te.Touch);m!==null?(a=m,(g.startsWith("Touch")&&m===Te.Touch||g.startsWith("Mouse")&&m===Te.Mouse)&&(m=null)):de[c]===de.Click&&(m=a,a=null);let f=fn(d)?d.changedTouches[0]:d;if(!f)return;let h=t.getId(p),{clientX:E,clientY:S}=f;M(s)({type:de[g],id:h,x:E,y:S,...m!==null&&{pointerType:m}})};return Object.keys(de).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{let d=Be(c),p=u(c);if(window.PointerEvent)switch(de[c]){case de.MouseDown:case de.MouseUp:d=d.replace("mouse","pointer");break;case de.TouchStart:case de.TouchEnd:return}l.push(oe(d,p,e))}),M(()=>{l.forEach(c=>c())})}function nl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,sampling:o}){let i=M(Mt(M(l=>{let a=Ft(l);if(!a||ie(a,r,n,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=ja(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100));return oe("scroll",i,e)}function np({viewportResizeCb:s},{win:e}){let t=-1,r=-1,n=M(Mt(M(()=>{let o=Ka(),i=Ja();(t!==o||r!==i)&&(s({width:Number(i),height:Number(o)}),t=o,r=i)}),200));return oe("resize",n,e)}var op=["INPUT","TEXTAREA","SELECT"],fi=new WeakMap;function ip({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function d(S){let w=Ft(S),I=S.isTrusted,_=w&&w.tagName;if(w&&_==="OPTION"&&(w=D.parentElement(w)),!w||!_||op.indexOf(_)<0||ie(w,r,n,!0)||w.classList.contains(o)||i&&w.matches(i))return;let y=w.value,R=!1,v=In(w)||"";v==="radio"||v==="checkbox"?R=w.checked:(l[_.toLowerCase()]||l[v])&&(y=Ir({element:w,maskInputOptions:l,tagName:_,type:v,value:y,maskInputFn:a})),p(w,c?{text:y,isChecked:R,userTriggered:I}:{text:y,isChecked:R});let x=w.name;v==="radio"&&x&&R&&e.querySelectorAll(`input[type="radio"][name="${ap(x)}"]`).forEach(O=>{if(O!==w){let le=O.value;p(O,c?{text:le,isChecked:!R,userTriggered:!1}:{text:le,isChecked:!R})}})}function p(S,w){let I=fi.get(S);if(!I||I.text!==w.text||I.isChecked!==w.isChecked){fi.set(S,w);let _=t.getId(S);M(s)({...w,id:_})}}let g=(u.input==="last"?["change"]:["input","change"]).map(S=>oe(S,M(d),e)),f=e.defaultView;if(!f)return()=>{g.forEach(S=>S())};let h=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),E=[[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 h&&h.set&&g.push(...E.map(S=>Zr(S[0],S[1],{set(){M(d)({target:this,isTrusted:!1})}},!1,f))),M(()=>{g.forEach(S=>S())})}function Lr(s){let e=[];function t(r,n){if(gr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||gr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||gr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||gr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let i=Array.from(r.parentRule.cssRules).indexOf(r);n.unshift(i)}else if(r.parentStyleSheet){let i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);n.unshift(i)}return n}return t(s,e)}function ap(s){return s.replace(/["\\]/g,"\\$&")}function Fe(s,e,t){let r,n;return s?(s.ownerNode?r=e.getId(s.ownerNode):n=t.getId(s),{styleId:n,id:r}):{}}function lp({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:M((c,d,p)=>{let[m,g]=p,{id:f,styleId:h}=Fe(d,e,t.styleMirror);return(f&&f!==-1||h&&h!==-1)&&s({id:f,styleId:h,adds:[{rule:m,index:g}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let m=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,p])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,removes:[{index:m}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,replace:m}),c.apply(d,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,replaceSync:m}),c.apply(d,p)})}));let a={};yr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(yr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),yr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),yr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:M((p,m,g)=>{let[f,h]=g,{id:E,styleId:S}=Fe(m.parentStyleSheet,e,t.styleMirror);return(E&&E!==-1||S&&S!==-1)&&s({id:E,styleId:S,adds:[{rule:f,index:[...Lr(m),h||0]}]}),p.apply(m,g)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:M((p,m,g)=>{let[f]=g,{id:h,styleId:E}=Fe(m.parentStyleSheet,e,t.styleMirror);return(h&&h!==-1||E&&E!==-1)&&s({id:h,styleId:E,removes:[{index:[...Lr(m),f]}]}),p.apply(m,g)})})}),M(()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function ol({mirror:s,stylesheetManager:e},t){var r,n,o;let i=null;t.nodeName==="#document"?i=s.getId(t):i=s.getId(D.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:o.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return i===null||i===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=a.set)==null?void 0:c.call(this,u);if(i!==null&&i!==-1)try{e.adoptStyleSheets(u,i)}catch{}return d}}),M(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function up({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:n}){let o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:M((l,a,u)=>{var c;let[d,p,m]=u;if(t.has(d))return o.apply(a,[d,p,m]);let{id:g,styleId:f}=Fe((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,set:{property:d,value:p,priority:m},index:Lr(a.parentRule)}),l.apply(a,u)})});let i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:M((l,a,u)=>{var c;let[d]=u;if(t.has(d))return i.apply(a,[d]);let{id:p,styleId:m}=Fe((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,remove:{property:d},index:Lr(a.parentRule)}),l.apply(a,u)})}),M(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}function cp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:n,doc:o}){let i=M(a=>Mt(M(u=>{let c=Ft(u);if(!c||ie(c,e,t,!0))return;let{currentTime:d,volume:p,muted:m,playbackRate:g,loop:f}=c;s({type:a,id:r.getId(c),currentTime:d,volume:p,muted:m,playbackRate:g,loop:f})}),n.media||500)),l=[oe("play",i(qe.Play),o),oe("pause",i(qe.Pause),o),oe("seeked",i(qe.Seeked),o),oe("volumechange",i(qe.VolumeChange),o),oe("ratechange",i(qe.RateChange),o)];return M(()=>{l.forEach(a=>a())})}function dp({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],n=new WeakMap,o=t.FontFace;t.FontFace=function(a,u,c){let d=new o(a,u,c);return n.set(d,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let i=ut(e.fonts,"add",function(l){return function(a){return setTimeout(M(()=>{let u=n.get(a);u&&(s(u),n.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=o}),r.push(i),M(()=>{r.forEach(l=>l())})}function hp(s){let{doc:e,mirror:t,blockClass:r,blockSelector:n,selectionCb:o}=s,i=!0,l=M(()=>{let a=e.getSelection();if(!a||i&&a?.isCollapsed)return;i=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let d=0;d<c;d++){let p=a.getRangeAt(d),{startContainer:m,startOffset:g,endContainer:f,endOffset:h}=p;ie(m,r,n,!0)||ie(f,r,n,!0)||u.push({start:t.getId(m),startOffset:g,end:t.getId(f),endOffset:h})}o({ranges:u})});return l(),oe("selectionchange",l)}function fp({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:ut(t.customElements,"define",function(n){return function(o,i,l){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,i,l])}})}function pp(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:m,customElementCb:g}=s;s.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),t(...f)},s.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),r(...f)},s.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),n(...f)},s.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},s.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),i(...f)},s.inputCb=(...f)=>{e.input&&e.input(...f),l(...f)},s.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),a(...f)},s.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),u(...f)},s.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),c(...f)},s.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),d(...f)},s.fontCb=(...f)=>{e.font&&e.font(...f),p(...f)},s.selectionCb=(...f)=>{e.selection&&e.selection(...f),m(...f)},s.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),g(...f)}}function mp(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};pp(s,e);let r;s.recordDOM&&(r=sl(s,s.doc));let n=rp(s),o=sp(s),i=nl(s),l=np(s,{win:t}),a=ip(s),u=cp(s),c=()=>{},d=()=>{},p=()=>{},m=()=>{};s.recordDOM&&(c=lp(s,{win:t}),d=ol(s,s.doc),p=up(s,{win:t}),s.collectFonts&&(m=dp(s)));let g=hp(s),f=fp(s),h=[];for(let E of s.plugins)h.push(E.observer(E.callback,t,E.options));return M(()=>{He.forEach(E=>E.reset()),r?.disconnect(),n(),o(),i(),l(),a(),u(),c(),d(),p(),m(),g(),f(),h.forEach(E=>E())})}function gr(s){return typeof window[s]<"u"}function yr(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var Fr=class{constructor(e){C(this,"iframeIdToRemoteIdMap",new WeakMap),C(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){let o=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e),l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),i.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,n))}getRemoteId(e,t,r){let n=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let o=n.get(t);return o||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getRemoteId(e,n,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},Sn=class{constructor(e){C(this,"iframes",new WeakMap),C(this,"crossOriginIframeMap",new WeakMap),C(this,"crossOriginIframeMirror",new Fr(Ei)),C(this,"crossOriginIframeStyleMirror"),C(this,"crossOriginIframeRootIdMap",new WeakMap),C(this,"mirror"),C(this,"mutationCb"),C(this,"wrappedEmit"),C(this,"loadListener"),C(this,"stylesheetManager"),C(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Fr(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&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(n=this.loadListener)==null||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){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let o=this.transformCrossOriginEvent(n,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:k.IncrementalSnapshot,data:{source:T.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return t;case k.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case k.IncrementalSnapshot:switch(t.data.source){case T.Mutation:return t.data.adds.forEach(n=>{this.replaceIds(n,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(n.node,o)}),t.data.removes.forEach(n=>{this.replaceIds(n,e,["parentId","id"])}),t.data.attributes.forEach(n=>{this.replaceIds(n,e,["id"])}),t.data.texts.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case T.Drag:case T.TouchMove:case T.MouseMove:return t.data.positions.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case T.ViewportResize:return!1;case T.MediaInteraction:case T.MouseInteraction:case T.Scroll:case T.CanvasMutation:case T.Input:return this.replaceIds(t.data,e,["id"]),t;case T.StyleSheetRule:case T.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case T.Font:return t;case T.Selection:return t.data.ranges.forEach(n=>{this.replaceIds(n,e,["start","end"])}),t;case T.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(n=>{this.replaceStyleIds(n,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(let o of n)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));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(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==q.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},vn=class{constructor(e){C(this,"shadowDoms",new WeakSet),C(this,"mutationCb"),C(this,"scrollCb"),C(this,"bypassOptions"),C(this,"mirror"),C(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(!bt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=sl({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(nl({...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(D.host(e))),this.restoreHandlers.push(ol({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){let r=this;this.restoreHandlers.push(ut(e.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o),l=D.shadowRoot(this);return l&&tl(this)&&r.addShadowRoot(l,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gp=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(vt=0;vt<tt.length;vt++)gp[tt.charCodeAt(vt)]=vt;var vt,yp=function(s){var e=new Uint8Array(s),t,r=e.length,n="";for(t=0;t<r;t+=3)n+=tt[e[t]>>2],n+=tt[(e[t]&3)<<4|e[t+1]>>4],n+=tt[(e[t+1]&15)<<2|e[t+2]>>6],n+=tt[e[t+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n},pi=new Map;function wp(s,e){let t=pi.get(s);return t||(t=new Map,pi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var il=(s,e,t)=>{if(!s||!(ll(s,e)||typeof s=="object"))return;let r=s.constructor.name,n=wp(t,r),o=n.indexOf(s);return o===-1&&(o=n.length,n.push(s)),o};function br(s,e,t){if(s instanceof Array)return s.map(r=>br(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,n=yp(s);return{rr_type:r,base64:n}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[br(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:n}=s;return{rr_type:r,src:n}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",n=s.toDataURL();return{rr_type:r,src:n}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[br(s.data,e,t),s.width,s.height]};if(ll(s,e)||typeof s=="object"){let r=s.constructor.name,n=il(s,e,t);return{rr_type:r,index:n}}}}return s}var al=(s,e,t)=>s.map(r=>br(r,e,t)),ll=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof e[n]=="function").find(n=>s instanceof e[n]);function Sp(s,e,t,r){let n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let i of o)try{if(typeof e.CanvasRenderingContext2D.prototype[i]!="function")continue;let l=ut(e.CanvasRenderingContext2D.prototype,i,function(a){return function(...u){return ie(this.canvas,t,r,!0)||setTimeout(()=>{let c=al(u,e,this);s(this.canvas,{type:lt["2D"],property:i,args:c})},0),a.apply(this,u)}});n.push(l)}catch{let l=Zr(e.CanvasRenderingContext2D.prototype,i,{set(a){s(this.canvas,{type:lt["2D"],property:i,args:[a],setter:!0})}});n.push(l)}return()=>{n.forEach(i=>i())}}function vp(s){return s==="experimental-webgl"?"webgl":s}function mi(s,e,t,r){let n=[];try{let o=ut(s.HTMLCanvasElement.prototype,"getContext",function(i){return function(l,...a){if(!ie(this,e,t,!0)){let u=vp(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return i.apply(this,[l,...a])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(o=>o())}}function gi(s,e,t,r,n,o){let i=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=ut(s,a,function(c){return function(...d){let p=c.apply(this,d);if(il(p,o,this),"tagName"in this.canvas&&!ie(this.canvas,r,n,!0)){let m=al(d,o,this),g={type:e,property:a,args:m};t(this.canvas,g)}return p}});i.push(u)}catch{let u=Zr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});i.push(u)}return i}function Cp(s,e,t,r){let n=[];return n.push(...gi(e.WebGLRenderingContext.prototype,lt.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&n.push(...gi(e.WebGL2RenderingContext.prototype,lt.WebGL2,s,t,r,e)),()=>{n.forEach(o=>o())}}var ul="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",bp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),yi=typeof window<"u"&&window.Blob&&new Blob([bp(ul)],{type:"text/javascript;charset=utf-8"});function Ep(s){let e;try{if(e=yi&&(window.URL||window.webkitURL).createObjectURL(yi),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+ul,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var Cn=class{constructor(e){C(this,"pendingCanvasMutations",new Map),C(this,"rafStamps",{latestId:0,invokeId:null}),C(this,"mirror"),C(this,"mutationCb"),C(this,"resetObservers"),C(this,"frozen",!1),C(this,"locked",!1),C(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&t==="all"&&this.initCanvasMutationObserver(r,n,o),i&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:l})}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,o){let i=mi(t,r,n,!0),l=new Map,a=new Ep;a.onmessage=g=>{let{id:f}=g.data;if(l.set(f,!1),!("base64"in g.data))return;let{base64:h,type:E,width:S,height:w}=g.data;this.mutationCb({id:f,type:lt["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:E}]},0,0]}]})};let u=1e3/e,c=0,d,p=()=>{let g=[];return t.document.querySelectorAll("canvas").forEach(f=>{ie(f,r,n,!0)||g.push(f)}),g},m=g=>{if(c&&g-c<u){d=requestAnimationFrame(m);return}c=g,p().forEach(async f=>{var h;let E=this.mirror.getId(f);if(l.get(E)||f.width===0||f.height===0)return;if(l.set(E,!0),["webgl","webgl2"].includes(f.__context)){let w=f.getContext(f.__context);((h=w?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let S=await createImageBitmap(f);a.postMessage({id:E,bitmap:S,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[S])}),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{i(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=mi(e,t,r,!1),o=Sp(this.processMutation.bind(this),e,t,r),i=Cp(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let n=r.map(i=>{let{type:l,...a}=i;return a}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}},bn=class{constructor(e){C(this,"trackedLinkElements",new WeakSet),C(this,"mutationCb"),C(this,"adoptedStyleSheetCb"),C(this,"styleMirror",new mn),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(e.length===0)return;let r={id:t,styleIds:[]},n=[];for(let o of e){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),n.push({styleId:i,rules:Array.from(o.rules||CSSRule,(l,a)=>({rule:Ci(l,o.href),index:a}))})),r.styleIds.push(i)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},En=class{constructor(){C(this,"nodeMap",new WeakMap),C(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(n=>n!==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(){}},Z,Er,Ms,Ur=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Co=s.contentWindow)==null?void 0:Co.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var Se=Nu();function ke(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:m,maskInputFn:g,maskTextFn:f,maskAnchorHrefFn:h,blockImgSrcPattern:E=null,blockImgSrcFillOptions:S={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},hooks:w,packFn:I,sampling:_={},dataURLOptions:y={},mousemoveWait:R,recordDOM:v=!0,recordCanvas:x=!1,recordCrossOriginIframes:O=!1,recordAfter:le=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:ue=!1,inlineImages:X=!1,plugins:j,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:ee}=s;ep(ee);let F=O?window.parent===window:!0,te=!1;if(!F)try{window.parent.document&&(te=!1)}catch{te=!0}if(F&&!e)throw new Error("emit function is required");if(!F&&!te)return()=>{};R!==void 0&&_.mousemove===void 0&&(_.mousemove=R),Se.reset();let Q=d===!0?{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}:p!==void 0?p:{password:!0},re=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all",headTitleMutations:m==="all"}:m||{};Zf();let _e,ce=0,se=N=>{for(let ye of j||[])ye.eventProcessor&&(N=ye.eventProcessor(N));return I&&!te&&(N=I(N)),N};Z=(N,ye)=>{var K;let J=N;if(J.timestamp=$r(),(K=He[0])!=null&&K.isFrozen()&&J.type!==k.FullSnapshot&&!(J.type===k.IncrementalSnapshot&&J.data.source===T.Mutation)&&He.forEach(Re=>Re.unfreeze()),F)e?.(se(J),ye);else if(te){let Re={type:"rrweb",event:se(J),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(Re,"*")}if(J.type===k.FullSnapshot)_e=J,ce=0;else if(J.type===k.IncrementalSnapshot){if(J.data.source===T.Mutation&&J.data.isAttachIframe)return;ce++;let Re=r&&ce>=r,U=t&&J.timestamp-_e.timestamp>t;(Re||U)&&Er(!0)}};let Ge=N=>{Z({type:k.IncrementalSnapshot,data:{source:T.Mutation,...N}})},ft=N=>Z({type:k.IncrementalSnapshot,data:{source:T.Scroll,...N}}),je=N=>Z({type:k.IncrementalSnapshot,data:{source:T.CanvasMutation,...N}}),ns=N=>Z({type:k.IncrementalSnapshot,data:{source:T.AdoptedStyleSheet,...N}}),be=new bn({mutationCb:Ge,adoptedStyleSheetCb:ns}),Ee=new Sn({mirror:Se,mutationCb:Ge,stylesheetManager:be,recordCrossOriginIframes:O,wrappedEmit:Z});for(let N of j||[])N.getMirror&&N.getMirror({nodeMirror:Se,crossOriginIframeMirror:Ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ee.crossOriginIframeStyleMirror});let Ke=new En;Ms=new Cn({recordCanvas:x,mutationCb:je,win:window,blockClass:n,blockSelector:o,mirror:Se,sampling:_.canvas,dataURLOptions:y});let Yt=new vn({mutationCb:Ge,scrollCb:ft,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Q,dataURLOptions:y,maskTextFn:f,maskInputFn:g,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,recordCanvas:x,inlineImages:X,sampling:_,slimDOMOptions:re,iframeManager:Ee,stylesheetManager:be,canvasManager:Ms,keepIframeSrcFn:A,processedNodeManager:Ke},mirror:Se});Er=(N=!1)=>{if(!v)return;Z({type:k.Meta,data:{href:window.location.href,width:Ja(),height:Ka()}},N),be.reset(),Yt.init(),He.forEach(K=>K.lock());let ye=rc(document,{mirror:Se,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Q,maskTextFn:f,maskInputFn:g,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,slimDOM:re,dataURLOptions:y,recordCanvas:x,inlineImages:X,onSerialize:K=>{qa(K,Se)&&Ee.addIframe(K),Qa(K,Se)&&be.trackLinkElement(K),pn(K)&&Yt.addShadowRoot(D.shadowRoot(K),document)},onIframeLoad:(K,J)=>{Ee.attachIframe(K,J),Yt.observeAttachShadow(K)},onStylesheetLoad:(K,J)=>{be.attachLinkElement(K,J)},keepIframeSrcFn:A});if(!ye)return console.warn("Failed to snapshot the document");Z({type:k.FullSnapshot,data:{node:ye,initialOffset:ja(window)}},N),He.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,Se.getId(document))};try{let N=[],ye=J=>{var Re;return M(mp)({mutationCb:Ge,mousemoveCb:(U,os)=>Z({type:k.IncrementalSnapshot,data:{source:os,positions:U}}),mouseInteractionCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.MouseInteraction,...U}}),scrollCb:ft,viewportResizeCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.ViewportResize,...U}}),inputCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.Input,...U}}),mediaInteractionCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.MediaInteraction,...U}}),styleSheetRuleCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.StyleSheetRule,...U}}),styleDeclarationCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.StyleDeclaration,...U}}),canvasMutationCb:je,fontCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.Font,...U}}),selectionCb:U=>{Z({type:k.IncrementalSnapshot,data:{source:T.Selection,...U}})},customElementCb:U=>{Z({type:k.IncrementalSnapshot,data:{source:T.CustomElement,...U}})},blockClass:n,ignoreClass:i,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:Q,inlineStylesheet:c,sampling:_,recordDOM:v,recordCanvas:x,inlineImages:X,userTriggeredOnInput:Y,collectFonts:ue,doc:J,maskInputFn:g,maskTextFn:f,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:re,dataURLOptions:y,mirror:Se,iframeManager:Ee,stylesheetManager:be,shadowDomManager:Yt,processedNodeManager:Ke,canvasManager:Ms,ignoreCSSAttributes:G,plugins:((Re=j?.filter(U=>U.observer))==null?void 0:Re.map(U=>({observer:U.observer,options:U.options,callback:os=>Z({type:k.Plugin,data:{plugin:U.name,payload:os}})})))||[]},w)};Ee.addLoadListener(J=>{try{N.push(ye(J.contentDocument))}catch(Re){console.warn(Re)}});let K=()=>{Er(),N.push(ye(document)),Ur=!0};return document.readyState==="interactive"||document.readyState==="complete"?K():(N.push(oe("DOMContentLoaded",()=>{Z({type:k.DomContentLoaded,data:{}}),le==="DOMContentLoaded"&&K()})),N.push(oe("load",()=>{Z({type:k.Load,data:{}}),le==="load"&&K()},window))),()=>{N.forEach(J=>J()),Ke.destroy(),Ur=!1,tp()}}catch(N){console.warn(N)}}ke.addCustomEvent=(s,e)=>{if(!Ur)throw new Error("please add custom event after start recording");Z({type:k.Custom,data:{tag:s,payload:e}})};ke.freezePage=()=>{He.forEach(s=>s.freeze())};ke.takeFullSnapshot=s=>{if(!Ur)throw new Error("please take full snapshot after start recording");Er(s)};ke.mirror=Se;var wi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(wi||(wi={}));function Xr(s,e){if(!e)return;let t=new URL(s),r={};for(let[n,o]of t.searchParams)e.includes(n)&&(r[n]=o);return Object.keys(r).length>0?r:void 0}import{minimatch as xp}from"minimatch";function Kn(s){throw new Error(`This code path should be unreachable: ${s}`)}function Rp(s){return(s.startsWith("http://")||s.startsWith("https://"))&&(s=s.replace(/^https?:\/\//,"")),s.endsWith("/")&&(s=s.substring(0,s.length-1)),s=s.replace(/:\d+$/,""),s}function Ip(s,e){if(!e||e==="")return!1;if(e==="*")return!0;let t=Rp(e);return s===t}function me({urlStr:s,pathConfig:e}){let t=new URL(s),r=t.pathname,n=t.hostname,o=e.rules.filter(l=>Ip(n,l.domain));if(o.length>0){let l=o.find(a=>a.path==="**");if(!l)return e.defaultAction==="allow"?t:void 0;for(let a of o){if(a.path==="**")continue;let u=Je(r,a);if(u!==void 0)switch(a.action){case"allow":return t;case"block":return;case"replace":return t.pathname=u,t;default:Kn(a.action)}}return l.action==="allow"?t:void 0}let i=e.rules.filter(l=>!l.domain);for(let l of i){let a=Je(r,l);if(a!==void 0)switch(l.action){case"allow":return t;case"block":return;case"replace":return t.pathname=a,t;default:Kn(l.action)}}return e.defaultAction==="allow"?t:void 0}function Ut(s,e,t){let r=me({urlStr:s,pathConfig:t});r||(r=new URL(s));let n=Ap(r.pathname,e.rules||[]),o=[];for(let i of r.searchParams.keys()){let l=_p(i,n?.rules||[]);switch(l){case"accept":break;case"delete":o.push(i);break;case"anonymize":r.searchParams.set(i,"*");break;default:he(l)}}for(let i of o)r.searchParams.delete(i);if(r.pathname.includes("%3F")){let i=r.pathname.split("/");i[i.length-1]=i[i.length-1].split("%3F")[0],r.pathname=i.join("/")}return r.hash.includes("=")&&(r.hash=""),r.toString()}function Ap(s,e){for(let t of e)if(Je(s,{path:t.path}))return t}function _p(s,e){for(let t of e)if(xp(s,t.param))return t.anonymizeValue?"anonymize":"accept";return"delete"}var Jn=class{constructor(e,t,r){this.org=e;this.recorder=t;this.events=[];this._estimatedByteSize=0;this.events=r,this._estimatedByteSize=this.calculateTotalSize()}get estimatedByteSize(){return this._estimatedByteSize}calculateTotalSize(){try{let e=JSON.stringify(this.events,this.getCircularReplacer());return Op(e)}catch(e){return b(`Error calculating event size: ${e}. Falling back to approximation.`),this.events.length*500}}getCircularReplacer(){let e=new WeakSet;return(t,r)=>{if(typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}}clearEvents(){this.events=[],this._estimatedByteSize=this.calculateTotalSize()}pushEvent({eventHref:e,event:t}){if(!me({urlStr:e,pathConfig:this.org.pathConfig})){b(`URL not accepted: ${e}`);return}if(!this.recorder.isRecording){b("Dropping event - recorder is not recording");return}this.events.push(t),this._estimatedByteSize=this.calculateTotalSize()}getEvents(){return this.events}},qr=class{constructor(e,t,r,n,o){this.org=e;this.eventStorage=t;this.getHref=r;this.eventStore=new Jn(e,n,o)}get estimatedSerializedByteSize(){return this.eventStore.estimatedByteSize}clear(){this.eventStore.clearEvents(),this.eventStorage.removeEvents()}getEvents(){return this.eventStore.getEvents()}onVisibilityChange(e){e||this.eventStorage.setEvents(this.getEvents())}append(e){let t=this.getHref();if(e.type===we.Meta)e.data.href=Ut(e.data.href,this.org.allowedQueryParams,this.org.pathConfig),this.lastHref=this.getHref();else if(this.lastHref&&t!=this.lastHref){b(`URL changed from ${this.lastHref} to ${t}, adding artificial meta event for ${this.getHref()}`),this.eventStore.pushEvent({eventHref:t,event:mo({href:Ut(t,this.org.allowedQueryParams,this.org.pathConfig),delay:e.delay,timestamp:e.timestamp})});let r=Xr(t,this.org.customQueryParamsCohorts);r&&this.eventStore.pushEvent({eventHref:t,event:mt({payload:{userCohorts:r,source:"query_params"},timestamp:e.timestamp,delay:e.delay})}),this.lastHref=this.getHref()}if(e.type===we.IncrementalSnapshot&&e.data.source===pt.MouseInteraction&&e.data.type===ls.Click){let r=ke.mirror.getNode(e.data.id);if(r){let n=Dp(r),o=po({dom0EventHandlers:n,delay:e.delay,timestamp:e.timestamp});this.eventStore.pushEvent({eventHref:t,event:o})}}this.eventStore.pushEvent({eventHref:t,event:e})}};function Op(s){return new Blob([s]).size}function Dp(s){let e=[];for(let t=0;t<us.length;t++){let n=us[t];typeof s[n]=="function"&&e.push(n)}return e}var ge=Uint8Array,ae=Uint16Array,Wt=Uint32Array,to=new ge([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]),ro=new ge([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]),cl=new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pl=function(s,e){for(var t=new ae(31),r=0;r<31;++r)t[r]=e+=1<<s[r-1];for(var n=new Wt(t[30]),r=1;r<30;++r)for(var o=t[r];o<t[r+1];++o)n[o]=o-t[r]<<5|r;return[t,n]},ml=pl(to,2),Tp=ml[0],Xn=ml[1];Tp[28]=258,Xn[258]=28;var gl=pl(ro,0),Tw=gl[0],dl=gl[1],qn=new ae(32768);for(P=0;P<32768;++P)Pe=(P&43690)>>>1|(P&21845)<<1,Pe=(Pe&52428)>>>2|(Pe&13107)<<2,Pe=(Pe&61680)>>>4|(Pe&3855)<<4,qn[P]=((Pe&65280)>>>8|(Pe&255)<<8)>>>1;var Pe,P,Bt=function(s,e,t){for(var r=s.length,n=0,o=new ae(e);n<r;++n)++o[s[n]-1];var i=new ae(e);for(n=0;n<e;++n)i[n]=i[n-1]+o[n-1]<<1;var l;if(t){l=new ae(1<<e);var a=15-e;for(n=0;n<r;++n)if(s[n])for(var u=n<<4|s[n],c=e-s[n],d=i[s[n]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)l[qn[d]>>>a]=u}else for(l=new ae(r),n=0;n<r;++n)l[n]=qn[i[s[n]-1]++]>>>15-s[n];return l},Ye=new ge(288);for(P=0;P<144;++P)Ye[P]=8;var P;for(P=144;P<256;++P)Ye[P]=9;var P;for(P=256;P<280;++P)Ye[P]=7;var P;for(P=280;P<288;++P)Ye[P]=8;var P,Qr=new ge(32);for(P=0;P<32;++P)Qr[P]=5;var P,Np=Bt(Ye,9,0);var Mp=Bt(Qr,5,0);var yl=function(s){return(s/8>>0)+(s&7&&1)},wl=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var r=new(s instanceof ae?ae:s instanceof Wt?Wt:ge)(t-e);return r.set(s.subarray(e,t)),r};var $e=function(s,e,t){t<<=e&7;var r=e/8>>0;s[r]|=t,s[r+1]|=t>>>8},zt=function(s,e,t){t<<=e&7;var r=e/8>>0;s[r]|=t,s[r+1]|=t>>>8,s[r+2]|=t>>>16},Zn=function(s,e){for(var t=[],r=0;r<s.length;++r)s[r]&&t.push({s:r,f:s[r]});var n=t.length,o=t.slice();if(!n)return[new ge(0),0];if(n==1){var i=new ge(t[0].s+1);return i[t[0].s]=1,[i,1]}t.sort(function(_,y){return _.f-y.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],u=0,c=1,d=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};c!=n-1;)l=t[t[u].f<t[d].f?u++:d++],a=t[u!=c&&t[u].f<t[d].f?u++:d++],t[c++]={s:-1,f:l.f+a.f,l,r:a};for(var p=o[0].s,r=1;r<n;++r)o[r].s>p&&(p=o[r].s);var m=new ae(p+1),g=Qn(t[c-1],m,0);if(g>e){var r=0,f=0,h=g-e,E=1<<h;for(o.sort(function(y,R){return m[R.s]-m[y.s]||y.f-R.f});r<n;++r){var S=o[r].s;if(m[S]>e)f+=E-(1<<g-m[S]),m[S]=e;else break}for(f>>>=h;f>0;){var w=o[r].s;m[w]<e?f-=1<<e-m[w]++-1:++r}for(;r>=0&&f;--r){var I=o[r].s;m[I]==e&&(--m[I],++f)}g=e}return[new ge(m),g]},Qn=function(s,e,t){return s.s==-1?Math.max(Qn(s.l,e,t+1),Qn(s.r,e,t+1)):e[s.s]=t},hl=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new ae(++e),r=0,n=s[0],o=1,i=function(a){t[r++]=a},l=1;l<=e;++l)if(s[l]==n&&l!=e)++o;else{if(!n&&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(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=s[l]}return[t.subarray(0,r),e]},Ht=function(s,e){for(var t=0,r=0;r<e.length;++r)t+=s[r]*e[r];return t},eo=function(s,e,t){var r=t.length,n=yl(e+2);s[n]=r&255,s[n+1]=r>>>8,s[n+2]=s[n]^255,s[n+3]=s[n+1]^255;for(var o=0;o<r;++o)s[n+o+4]=t[o];return(n+4+r)*8},fl=function(s,e,t,r,n,o,i,l,a,u,c){$e(e,c++,t),++n[256];for(var d=Zn(n,15),p=d[0],m=d[1],g=Zn(o,15),f=g[0],h=g[1],E=hl(p),S=E[0],w=E[1],I=hl(f),_=I[0],y=I[1],R=new ae(19),v=0;v<S.length;++v)R[S[v]&31]++;for(var v=0;v<_.length;++v)R[_[v]&31]++;for(var x=Zn(R,7),O=x[0],le=x[1],Y=19;Y>4&&!O[cl[Y-1]];--Y);var ue=u+5<<3,X=Ht(n,Ye)+Ht(o,Qr)+i,j=Ht(n,p)+Ht(o,f)+i+14+3*Y+Ht(R,O)+(2*R[16]+3*R[17]+7*R[18]);if(ue<=X&&ue<=j)return eo(e,c,s.subarray(a,a+u));var A,G,ee,F;if($e(e,c,1+(j<X)),c+=2,j<X){A=Bt(p,m,0),G=p,ee=Bt(f,h,0),F=f;var te=Bt(O,le,0);$e(e,c,w-257),$e(e,c+5,y-1),$e(e,c+10,Y-4),c+=14;for(var v=0;v<Y;++v)$e(e,c+3*v,O[cl[v]]);c+=3*Y;for(var Q=[S,_],re=0;re<2;++re)for(var _e=Q[re],v=0;v<_e.length;++v){var ce=_e[v]&31;$e(e,c,te[ce]),c+=O[ce],ce>15&&($e(e,c,_e[v]>>>5&127),c+=_e[v]>>>12)}}else A=Np,G=Ye,ee=Mp,F=Qr;for(var v=0;v<l;++v)if(r[v]>255){var ce=r[v]>>>18&31;zt(e,c,A[ce+257]),c+=G[ce+257],ce>7&&($e(e,c,r[v]>>>23&31),c+=to[ce]);var se=r[v]&31;zt(e,c,ee[se]),c+=F[se],se>3&&(zt(e,c,r[v]>>>5&8191),c+=ro[se])}else zt(e,c,A[r[v]]),c+=G[r[v]];return zt(e,c,A[256]),c+G[256]},kp=new Wt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pp=function(s,e,t,r,n,o){var i=s.length,l=new ge(r+i+5*(1+Math.floor(i/7e3))+n),a=l.subarray(r,l.length-n),u=0;if(!e||i<8)for(var c=0;c<=i;c+=65535){var d=c+65535;d<i?u=eo(a,u,s.subarray(c,d)):(a[c]=o,u=eo(a,u,s.subarray(c,i)))}else{for(var p=kp[e-1],m=p>>>13,g=p&8191,f=(1<<t)-1,h=new ae(32768),E=new ae(f+1),S=Math.ceil(t/3),w=2*S,I=function(N){return(s[N]^s[N+1]<<S^s[N+2]<<w)&f},_=new Wt(25e3),y=new ae(288),R=new ae(32),v=0,x=0,c=0,O=0,le=0,Y=0;c<i;++c){var ue=I(c),X=c&32767,j=E[ue];if(h[X]=j,E[ue]=X,le<=c){var A=i-c;if((v>7e3||O>24576)&&A>423){u=fl(s,a,0,_,y,R,x,O,Y,c-Y,u),O=v=x=0,Y=c;for(var G=0;G<286;++G)y[G]=0;for(var G=0;G<30;++G)R[G]=0}var ee=2,F=0,te=g,Q=X-j&32767;if(A>2&&ue==I(c-Q))for(var re=Math.min(m,A)-1,_e=Math.min(32767,c),ce=Math.min(258,A);Q<=_e&&--te&&X!=j;){if(s[c+ee]==s[c+ee-Q]){for(var se=0;se<ce&&s[c+se]==s[c+se-Q];++se);if(se>ee){if(ee=se,F=Q,se>re)break;for(var Ge=Math.min(Q,se-2),ft=0,G=0;G<Ge;++G){var je=c-Q+G+32768&32767,ns=h[je],be=je-ns+32768&32767;be>ft&&(ft=be,j=je)}}}X=j,j=h[X],Q+=X-j+32768&32767}if(F){_[O++]=268435456|Xn[ee]<<18|dl[F];var Ee=Xn[ee]&31,Ke=dl[F]&31;x+=to[Ee]+ro[Ke],++y[257+Ee],++R[Ke],le=c+ee,++v}else _[O++]=s[c],++y[s[c]]}}u=fl(s,a,o,_,y,R,x,O,Y,c-Y,u)}return wl(l,0,r+yl(u)+n)},$p=function(){var s=1,e=0;return{p:function(t){for(var r=s,n=e,o=t.length,i=0;i!=o;){for(var l=Math.min(i+5552,o);i<l;++i)r+=t[i],n+=r;r%=65521,n%=65521}s=r,e=n},d:function(){return(s>>>8<<16|(e&255)<<8|e>>>8)+((s&255)<<23)*2}}},Lp=function(s,e,t,r,n){return Pp(s,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(s.length)))*1.5):12+e.mem,t,r,!n)},Fp=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8},Up=function(s,e){var t=e.level,r=t==0?0:t<6?1:t==9?3:2;s[0]=120,s[1]=r<<6|(r?32-2*r:1)};function Sl(s,e){e===void 0&&(e={});var t=$p();t.p(s);var r=Lp(s,e,2,4);return Up(r,e),Fp(r,r.length-4,t.d()),r}function so(s,e){var t=s.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var r=new ge(s.length+(s.length>>>1)),n=0,o=function(u){r[n++]=u},i=0;i<t;++i){if(n+5>r.length){var l=new ge(n+8+(t-i<<1));l.set(r),r=l}var a=s.charCodeAt(i);a<128||e?o(a):a<2048?(o(192|a>>>6),o(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|s.charCodeAt(++i)&1023,o(240|a>>>18),o(128|a>>>12&63),o(128|a>>>6&63),o(128|a&63)):(o(224|a>>>12),o(128|a>>>6&63),o(128|a&63))}return wl(r,0,n)}function no(s,e){var t="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(s);for(var r=0;r<s.length;){var n=s[r++];n<128||e?t+=String.fromCharCode(n):n<224?t+=String.fromCharCode((n&31)<<6|s[r++]&63):n<240?t+=String.fromCharCode((n&15)<<12|(s[r++]&63)<<6|s[r++]&63):(n=((n&15)<<18|(s[r++]&63)<<12|(s[r++]&63)<<6|s[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023))}return t}var oo="v1";var io=s=>{let e={...s,v:oo};return no(Sl(so(JSON.stringify(e))),!0)};function vl(s){let e=new URL(s),t={};for(let[r,n]of e.searchParams)switch(r){case"utm_source":case"utm_medium":case"utm_campaign":case"utm_term":case"utm_content":t[`UTM@@${r}`]=n;break}return Object.keys(t).length>0?t:void 0}var Cl=3*1024*1024,bl=5e3,es=class{constructor(e,t,r,n,o,i,l){this.window=e;this.storage=t;this.eventHolder=r;this.recorder=n;this.api=o;this.organization=i;this.windowGetters=l;this.lastSendTime=-1;this.lastAutoCohorts=void 0;this.fastpathToken=void 0;n.setOnEvent(a=>this.onEvent(a))}onEvent(e){if(e.type===we.FullSnapshot){let o,i=Jt(this.window,this.organization.cohortsBootstrapConfig),l=vl(this.windowGetters.getHref()),a=Xr(this.windowGetters.getHref(),this.organization.customQueryParamsCohorts),u=ws(this.window);this.lastAutoCohorts=u,(l||i||u||a)&&(o=mt({payload:{userCohorts:{...i||{},...u||{},...l||{},...a||{}},source:"window_getters"},delay:e.delay,timestamp:e.timestamp}));let c=o?[...this.eventHolder.getEvents(),o,e]:[...this.eventHolder.getEvents(),e];this.clearAndSaveEvents(c);return}else if(e.type===we.IncrementalSnapshot&&e.data.source===pt.Mutation){let o=ws(this.window);o&&(!this.lastAutoCohorts||Object.keys(o).length!==Object.keys(this.lastAutoCohorts).length)&&(b("auto cohorts different, appending new event",o),this.eventHolder.append(mt({payload:{userCohorts:o,source:"window_getters"},delay:e.delay,timestamp:e.timestamp}))),this.lastAutoCohorts=o}this.eventHolder.append(e);let t=this.eventHolder.estimatedSerializedByteSize,n=Date.now()-this.lastSendTime;t>Cl&&n>=bl&&(b(`MAX_EVENT_BYTE_SIZE and timeSinceLastSend exceeded: ${t} > ${Cl} and ${n} >= ${bl}`),this.clearAndSaveEvents())}async clearAndSaveEvents(e){let t=this.windowGetters.getHref();if(!me({urlStr:t,pathConfig:this.organization.pathConfig}))return;let r=e||this.eventHolder.getEvents();if(r.length!==0){this.eventHolder.clear();try{b("saving events...");let n=await this.prepareAndSendEvents(r);switch(b("save events result",n.type),n.type){case"success":break;case"recreate-session":await this.recreateSession(n.session);break;case"no-session":case"unknown-failure":case"rate-limit-exceeded":this.storage.removeSession(),this.eventHolder.clear();break;default:he(n)}}catch(n){throw b("error saving events",n),this.storage.removeSession(),n}}}async prepareAndSendEvents(e){this.lastSendTime=Date.now();let t=this.storage.getSession();if(!t)return{type:"no-session"};if(t.eventPostUrl&&t.eventPostToken){let o=JSON.parse(atob(t.eventPostToken.split(".")[1]));if(o&&Date.now()>o.lastEventAt-10*1e3){b("refreshing token as it is about to expire");let i=await this.refreshToken(t);if(i.type!=="success")return i;if(t=this.storage.getSession(),!t)return{type:"no-session"}}}let r=t.compressionType==="RRWEB_PACK"?e.map(o=>io(o)):e,n=await this.api.saveSessionEvents({sessionId:t.id,events:r,metadata:{url:Ut(this.windowGetters.getHref(),this.organization.allowedQueryParams,this.organization.pathConfig)},eventPostUrl:t.eventPostUrl,eventPostToken:t.eventPostToken,fastpathToken:this.fastpathToken});if(!n)return{type:"unknown-failure"};if(n.error)switch(n.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:t};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}if(!n.data)return{type:"unknown-failure"};if(n.data&&"code"in n.data)switch(n.data.code){case"TOKEN_REFRESH":{b("refreshing token as it expired on the worker");let o=await this.refreshToken(t);return o.type!=="success"?o:this.prepareAndSendEvents(e)}default:he(n.data.code)}if(this.fastpathToken=n.data.fastpathToken,n.response.status<200||n.response.status>201)throw new Error(`got status ${n.response.status}`);return{type:"success"}}async refreshToken(e){let t=await this.api.refreshEventToken({sessionId:e.id});if(!t)return{type:"unknown-failure"};if(t.error)switch(t.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:e};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}return t.data?(this.storage.setSession({...e,eventPostToken:t.data.token}),{type:"success"}):{type:"unknown-failure"}}async recreateSession(e){b("recreating sessions");let t,r=this.recorder.isRecording;this.recorder.setRecording(!1),this.storage.removeSession(),this.fastpathToken=void 0;let n,o;try{b("recreating session...");let l=await this.api.startSession({orgId:e.settings.orgId,language:e.settings.language||this.windowGetters.getLanguage(),domain:new URL(this.windowGetters.getHref()).hostname,userCohorts:e.settings.userCohorts||{},uid:e.settings.uid,devicePixelRatio:this.windowGetters.getDevicePixelRatio(),adoraUserId:e.adoraUserId,documentReferrer:e.documentReferrer,snippetVersion:Kt});if(!l||l.error)return;if(l.response.status!==201){b("session not created, aborting");return}if(!l.data||!("session"in l.data)){b("malformed session, exiting");return}l?.data&&"eventPostUrl"in l.data&&l.data.eventPostUrl&&"eventPostToken"in l.data&&l.data.eventPostToken&&(n=l.data.eventPostUrl,o=l.data.eventPostToken),t=l.data}catch{}if(!t)return;let i={id:t.session.id,createdAt:t.session.createdAt,status:t.session.status,lastSyncedAt:t.session.lastSyncedAt,domain:t.session.domain,requestIp:t.session.requestIp,country:t.session.country,userAgent:t.session.userAgent,language:t.session.language,initialUserCohorts:t.session.initialUserCohorts,devicePixelRatio:t.session.devicePixelRatio,organization:t.organization,settings:e.settings,adoraUserId:e.adoraUserId,documentReferrer:e.documentReferrer,canvasRecordingEnabled:e.canvasRecordingEnabled,eventPostUrl:n,eventPostToken:o,limitedCanvasRecording:e.limitedCanvasRecording,compressionType:e.compressionType};this.storage.setSession(i),this.eventHolder.clear(),r&&this.recorder.setRecording(!0)}};var ct,El=()=>{if(ct!==void 0)return ct;try{return ct=document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")===0,b("adora script - isWebpSupported? - ",ct),ct}catch{return ct=!1,!1}};var ts=class{constructor(e,t,r,n){this.limitedCanvasRecording=e;this.canvasRecordingEnabled=t;this.org=r;this.rrwebRecorder=n;this.startable=!0;b("new recorder")}setOnEvent(e){this.onEvent=e}get args(){let e=this.org.blockedCSSClasses.length>0?`|(${this.org.blockedCSSClasses.join(")|(")})`:"",t=this.org.maskedCSSClasses&&this.org.maskedCSSClasses?.length>0?`|(${this.org.maskedCSSClasses?.join(")|(")})`:"",r=El()?"image/webp":this.limitedCanvasRecording?"image/jpeg":"image/png";return{emit:n=>{if(!this.onEvent)throw new Error("onEvent must be assigned before starting recording");this.onEvent(n)},userTriggeredOnInput:!0,blockClass:new RegExp(`(adora-block)|(rr-block|fs-exclude|ph-no-capture)${e}`),maskTextClass:new RegExp(`(adora-mask)|(rr-mask|fs-mask)${t}`),maskAllInputs:!0,maskInputFn:(n,o)=>Rl(this.org,o)?n:"*".repeat(n.length),maskTextFn:(n,o)=>o&&this.org.maskByDefault&&o.closest('button,a,div[role="button"],div[role*="menuitem"],input[type="button"],input[type="submit"],input[type="reset"]')||o&&Rl(this.org,o)?n:n.replace(/[\S]/g,"*"),maskTextSelector:this.org?.maskByDefault?"*":"",recordCanvas:this.canvasRecordingEnabled,sampling:this.canvasRecordingEnabled?{canvas:this.limitedCanvasRecording?1:2}:void 0,dataURLOptions:this.canvasRecordingEnabled?{type:r,quality:.6}:{}}}recordChangeCustomCohort(e){b("sending custom cohort change",e),this.rrwebRecorder.addCustomEvent(fo,e)}recordCLS(e){this.rrwebRecorder.addCustomEvent("CLS",e)}recordFID(e){this.rrwebRecorder.addCustomEvent("FID",e)}recordLCP(e){this.rrwebRecorder.addCustomEvent("LCP",e)}recordVisibilityChange(e){this.rrwebRecorder.addCustomEvent("Adora.VisibilityChange",{visibilityState:e})}recordFocusChange(e){this.rrwebRecorder.addCustomEvent("Adora.FocusChange",{focusState:e})}get isRecording(){return this.rrwebRecorder.isRecording}setRecording(e){if(b("setRecording",`requested status: ${e}`,`current status ${this.rrwebRecorder.isRecording}`),this.rrwebRecorder.isRecording!==e){if(e){this.startRecording();return}this.stopRecording()}}startRecording(){if(this.isRecording)throw new Error("recording already in progress!");if(!this.startable){b("recorder is not startable, returning");return}this.rrwebRecorder.record(this.args)}stopRecording(){this.rrwebRecorder.stop()}stopFutureRecordings(){this.startable=!1}};function Rl(s,e){if(e.classList.contains("adora-unmask"))return!0;for(let t of s.unmaskSelectors)if(Array.from(document.querySelectorAll(t)).find(r=>r===e))return!0;return!1}var rs=class{constructor(){this._isRecording=!1}get isRecording(){return this._isRecording}record(e){if(b("record",{stopFn:typeof this.stopFn,isRecording:this._isRecording}),this.stopFn!==void 0&&this.stop(),this._isRecording=!0,this.stopFn=ke(e),!this.stopFn)throw new Error("recorder could not successfully start")}stop(){this._isRecording=!1,this.stopFn&&(this.stopFn(),this.stopFn=void 0)}addCustomEvent(e,t){if(!this._isRecording)return b("WARNING! attempting to add custom event with recording off"),!1;try{ke.addCustomEvent(e,t)}catch(r){return b("trying to record an event even though",r),!1}return!0}};var Il=5e3;function xl({sessionType:s}){b("initialize recording");let e=new Le(s,new De),t=e.getSession();if(!t)return;let r=new Oe(t.settings.backendUrl),n=new jt(s,new De),o=n.getEvents();n.removeEvents();let i=()=>window.location.href,l=()=>window.navigator.language,a=()=>window.devicePixelRatio,u=new rs,c=new ts(t.limitedCanvasRecording??!1,t.canvasRecordingEnabled??!1,t.organization,u),d=new qr(t.organization,n,i,c,o||[]),p=new es(window,e,d,c,r,t.organization,{getHref:i,getLanguage:l,getDevicePixelRatio:a}),m=window.location.href;me({urlStr:m,pathConfig:t.organization.pathConfig})?(b("starting recording..."),c.setRecording(!0)):b("recording did not start as current URL is blocked");let g=Jt(window,t.organization.cohortsBootstrapConfig);c.isRecording&&(c.recordChangeCustomCohort({uid:t.settings.uid,userCohorts:t.settings.userCohorts?{...g,...t.settings.userCohorts}:{}}),e.setSession(t)),dt.onCLS(I=>{c.isRecording&&c.recordCLS(I)}),dt.onFID(I=>{c.isRecording&&c.recordFID(I)}),dt.onLCP(I=>{c.isRecording&&c.recordLCP(I)});let f=()=>{p.clearAndSaveEvents(d.getEvents())},h=window.setInterval(f,Il);window.addEventListener("blur",()=>{c.recordFocusChange("blur")}),window.addEventListener("focus",()=>{c.recordFocusChange("focus")}),document.addEventListener("visibilitychange",()=>{if(b(`detected a visibility change to ${document.visibilityState}`),c.isRecording&&c.recordVisibilityChange(document.visibilityState),document.visibilityState==="hidden"){h&&(b("clearing the saveInterval"),clearInterval(h),h=void 0),d.onVisibilityChange(!1);return}h||(b("resuming the saveInterval"),h=window.setInterval(f,Il))});let E=m,S=new MutationObserver(function(){if(d&&window.location.href!==E){let I=me({urlStr:window.location.href,pathConfig:t.organization.pathConfig});b(`url changed detected, status: ${!!I}`),c.setRecording(!!I),E=window.location.href}});return S.observe(document,{subtree:!0,childList:!0}),{recorder:c,eventSync:p,urlChangeObserverDispose:()=>{S.disconnect()}}}var Al=s=>xl(s);var ht=!1,_l="_adora_user_id",Ol="_adora_rate_limited",Ae,Vt,ao="stopped",Dl=()=>{b("startRecording",`adoraIsRunning: ${ht}`),ao==="started"&&(Ae=Al({sessionType:"adoraSessionScript"}))},Tl=1e3*60*30,LS=async({userCohorts:s,...e})=>{let t=e;if(ao="started",b("adora start",{adoraIsRunning:ht,uid:t.uid,userCohorts:s||{}}),typeof window.sessionStorage!="object"){b("SSR detected");return}if(s){t.userCohorts={};for(let[a,u]of Object.entries(s))u!==void 0?(b("setting user cohorts key",{key:a,value:u}),t.userCohorts[a]=u):b("found undefined user cohorts key",{key:a})}let r=new Le("adoraSessionScript",new De),n=r.getSession();if(n){b("session detected; finding if changes should be written");let a=!1;if(t.uid&&n.settings.uid!==t.uid&&(b("detected uid change"),n.settings.uid=t.uid,r.setSession(n),a=!0),t.userCohorts&&Object.keys(t.userCohorts).length>0){b("detected user cohorts");let u=structuredClone(n.settings.userCohorts);zp(u,t.userCohorts)||(b("detected user cohorts have been changed"),n.settings.userCohorts=t.userCohorts,r.setSession(n),a=!0)}a&&Ae?.recorder&&Ae?.recorder.isRecording&&(b("writing cohort change to recorder"),Ae?.recorder.recordChangeCustomCohort({uid:n.settings.uid,userCohorts:n.settings.userCohorts?{...n.settings.userCohorts}:{}}))}if(ht===!0)return;ht=!0;let o=r.lastRateLimitedTimestamp;if(o!==void 0){if(Date.now()-o<Tl){b("exiting as the session has been rate limited recently");return}r.clearLastRateLimitedTimestamp()}if(ss.get(Ol)){b("exiting as the domain has been rate limited recently");return}if(n){b("start recording for existing session"),Dl();return}let i=!1,l=async(a,u)=>{if(b("start status",{started:i}),i)return;i=!0;let c=await wo("adoraSessionScript",u,t);if(c.type==="error"){c.code==="RateLimitExceeded"&&(b("setting expiration on local storage"),r.setLastRateLimitedTimestamp(Date.now()),a&&(b("setting expiration cookie"),ss.set(Ol,a,{expires:new Date(Date.now()+Tl),domain:a})));return}Dl()};b("launching session preload");try{let a=await new Oe(t.backendUrl).sessionPreload({orgId:t.orgId});b("session preload resolved");let u=window.location.href;if(a){if(a.error){b("error preloading",a.error);return}if("scheduledDowntime"in a.data){b("scheduled downtime; exiting");return}let{organization:c}=a.data;b("session preload success");let d=ss.get(_l),p;b("existing adora user id cookie:",d);for(let m of c.cookieDomains)(window.location.hostname.toLowerCase()===m||window.location.hostname.toLowerCase().endsWith("."+m))&&(p=m,d||(d=Hp(),ss.set(_l,d,{domain:m,expires:new Date(Date.now()+365*24*60*60*1e3)}),b("setting adoraUserId cookie on domain",d)));b("using adora user id:",d),me({urlStr:u,pathConfig:c.pathConfig})?(b("at an unblocked URL, starting adora"),await l(p,d)):(b("at an blocked URL, waiting for unblocked URL to start adora"),Vt&&Vt.disconnect(),Vt=new MutationObserver(function(m,g){if(u!=window.location.href){let f=window.location.href,h=me({urlStr:f,pathConfig:c.pathConfig});if(b(`url changed detected during blocked state, status: ${!!h}`),h){b("disconnecting observer"),g.disconnect(),b("scheduling adora to start"),l(p,d);return}u=f}}),Vt.observe(document,{subtree:!0,childList:!0}))}}catch(a){b("Error in adoraStart:",a)}},FS=async()=>{ao="stopped",b("adora stop",{adoraIsRunning:ht}),Ae&&(Ae.recorder.setRecording(!1),Ae.recorder.stopFutureRecordings(),Ae.urlChangeObserverDispose(),await Ae.eventSync.clearAndSaveEvents()),Vt?.disconnect(),ht=!1,Ae=void 0};export{ht as adoraIsRunning,LS as adoraStart,FS as adoraStop};
|
|
53
|
+
or you can use record.mirror to access the mirror instance during recording.`,di={map:{},getId(){return console.error(qe),-1},getNode(){return console.error(qe),null},removeNodeFromMap(){console.error(qe)},has(){return console.error(qe),!1},reset(){console.error(qe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(di=new Proxy(di,{get(s,e,t){return e==="map"&&console.error(qe),Reflect.get(s,e,t)}}));function Mt(s,e,t={}){let r=null,n=0;return function(...o){let i=Date.now();!n&&t.leading===!1&&(n=i);let l=e-(i-n),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),n=i,s.apply(a,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{n=t.leading===!1?0:Date.now(),r=null,s.apply(a,o)},l))}}function Zr(s,e,t,r,n=window){let o=n.Object.getOwnPropertyDescriptor(s,e);return n.Object.defineProperty(s,e,r?t:{set(i){setTimeout(()=>{t.set.call(this,i)},0),o&&o.set&&o.set.call(this,i)}}),()=>Zr(s,e,o||{},!0)}function ct(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],n=t(r);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=n,()=>{s[e]=r}}catch{return()=>{}}}var $r=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||($r=()=>new Date().getTime());function Za(s){var e,t,r,n;let o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=D.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o?.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=D.parentElement(o.body))==null?void 0:r.scrollTop)||((n=o?.body)==null?void 0:n.scrollTop)||0}}function Xa(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Qa(s){return s?s.nodeType===s.ELEMENT_NODE?s:D.parentElement(s):null}function ae(s,e,t,r){if(!s)return!1;let n=Qa(s);if(!n)return!1;try{if(typeof e=="string"){if(n.classList.contains(e)||r&&n.closest("."+e)!==null)return!0}else if(Ar(n,e,r))return!0}catch{}return!!(t&&(n.matches(t)||r&&n.closest(t)!==null))}function qf(s,e){return e.getId(s)!==-1}function Ps(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Rt}function el(s,e){if(bt(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=D.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?el(r,e):!0}function gn(s){return!!s.changedTouches}function Qf(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function tl(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function rl(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function yn(s){return s?s instanceof mn&&"shadowRoot"in s?!!s.shadowRoot:!!D.shadowRoot(s):!1}var wn=class{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(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 t===void 0?r=this.id++:r=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 sl(s){var e;let t=null;return"getRootNode"in s&&((e=D.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D.host(D.getRootNode(s))&&(t=D.host(D.getRootNode(s))),t}function ep(s){let e=s,t;for(;t=sl(e);)e=t;return e}function tp(s){let e=s.ownerDocument;if(!e)return!1;let t=ep(s);return D.contains(e,t)}function nl(s){let e=s.ownerDocument;return e?D.contains(e,s)||tp(s):!1}var k=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(k||{}),T=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(T||{}),he=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(he||{}),Ne=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Ne||{}),ut=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(ut||{}),Qe=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Qe||{});function hi(s){return"__ln"in s}var Sn=class{constructor(){b(this,"length",0),b(this,"head",null),b(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=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&hi(e.previousSibling)){let 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&&hi(e.nextSibling)&&e.nextSibling.__ln.previous){let 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;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},fi=(s,e)=>`${s}@${e}`,vn=class{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"maskAnchorHrefFn"),b(this,"blockImgSrcPattern"),b(this,"blockImgSrcFillOptions"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new Sn,n=a=>{let u=a,c=Rt;for(;c===Rt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=a=>{let u=D.parentNode(a);if(!u||!nl(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=bt(u)?this.mirror.getId(sl(a)):this.mirror.getId(u),p=n(a);if(d===-1||p===-1)return r.addNode(a);let m=tt(a,{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,maskAnchorHrefFn:this.maskAnchorHrefFn,blockImgSrcPattern:this.blockImgSrcPattern,blockImgSrcFillOptions:this.blockImgSrcFillOptions,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{tl(g,this.mirror)&&this.iframeManager.addIframe(g),rl(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),yn(a)&&this.shadowDomManager.addShadowRoot(D.shadowRoot(a),this.doc)},onIframeLoad:(g,f)=>{this.iframeManager.attachIframe(g,f),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,f)=>{this.stylesheetManager.attachLinkElement(g,f)},cssCaptured:c});m&&(e.push({parentId:d,nextId:p,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)pi(this.removes,a,this.mirror)&&!this.movedSet.has(D.parentNode(a))||o(a);for(let a of this.addedSet)!mi(this.droppedSet,a)&&!pi(this.removes,a,this.mirror)||mi(this.movedSet,a)?o(a):this.droppedSet.add(a);let i=null;for(;r.length;){let a=null;if(i){let u=this.mirror.getId(D.parentNode(i.value)),c=n(i.value);u!==-1&&c!==-1&&(a=i)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(D.parentNode(c.value));if(n(c.value)===-1)continue;if(d!==-1){a=c;break}else{let m=c.value,g=D.parentNode(m);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=D.host(g);if(this.mirror.getId(f)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}i=a.previous,r.removeNode(a.value),o(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=D.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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.movedMap={},this.mutationCb(l))}),b(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));let r=t.attributes.value=Array.from(D.childNodes(e),n=>D.textContent(n)||"").join("");t.attributes.value=Ir({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:null,value:r,maskInputFn:this.maskInputFn})}),b(this,"processMutation",e=>{if(!Ps(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=D.textContent(e.target);!ae(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Oi(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Qa(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,n=e.target.getAttribute(r);if(r==="value"){let l=_n(t);n=Ir({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:l,value:n,maskInputFn:this.maskInputFn})}let o=ae(e.target,this.blockClass,this.blockSelector,!1);if(o&&r==="style"){let l=e.target,{width:a,height:u}=l.getBoundingClientRect(),c=this.attributeMap.get(e.target);c||(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(c),this.attributeMap.set(e.target,c)),c.attributes.rr_width=`${a}px`,c.attributes.rr_height=`${u}px`}if(o||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(n))if(!t.contentDocument)r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!_i(t.tagName,r))if(i.attributes[r]=Ai(this.doc,We(t.tagName),We(r),n),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let l=this.unattachedDoc.createElement("span");e.oldValue&&l.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let u=t.style.getPropertyValue(a),c=t.style.getPropertyPriority(a);u!==l.style.getPropertyValue(a)||c!==l.style.getPropertyPriority(a)?c===""?i.styleDiff[a]=u:i.styleDiff[a]=[u,c]:i._unchangedStyles[a]=[u,c]}for(let a of Array.from(l.style))t.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":{if(ae(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),n=bt(e.target)?this.mirror.getId(D.host(e.target)):this.mirror.getId(e.target);ae(e.target,this.blockClass,this.blockSelector,!1)||Ps(t,this.mirror,this.slimDOMOptions)||!qf(t,this.mirror)||(this.addedSet.has(t)?(bn(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||el(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[fi(r,n)]?bn(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:bt(e.target)&&Ct(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ps(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[fi(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ae(e,this.blockClass,this.blockSelector,!1)||(D.childNodes(e).forEach(r=>this.genAdds(r)),yn(e)&&D.childNodes(D.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAnchorHrefFn","blockImgSrcPattern","blockImgSrcFillOptions","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 bn(s,e){s.delete(e),D.childNodes(e).forEach(t=>bn(s,t))}function pi(s,e,t){return s.length===0?!1:rp(s,e,t)}function rp(s,e,t){let r=D.parentNode(e);for(;r;){let n=t.getId(r);if(s.some(o=>o.id===n))return!0;r=D.parentNode(r)}return!1}function mi(s,e){return s.size===0?!1:ol(s,e)}function ol(s,e){let t=D.parentNode(e);return t?s.has(t)?!0:ol(s,t):!1}var Et;function sp(s){Et=s}function np(){Et=void 0}var M=s=>Et?(...t)=>{try{return s(...t)}catch(r){if(Et&&Et(r)===!0)return;throw r}}:s,He=[];function Ft(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function il(s,e){let t=new vn;He.push(t),t.init(s);let r=new(Ja())(M(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function op({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let n=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,i=[],l,a=Mt(M(d=>{let p=Date.now()-l;s(i.map(m=>(m.timeOffset-=p,m)),d),i=[],l=null}),o),u=M(Mt(M(d=>{let p=Ft(d),{clientX:m,clientY:g}=gn(d)?d.changedTouches[0]:d;l||(l=$r()),i.push({x:m,y:g,id:r.getId(p),timeOffset:$r()-l}),a(typeof DragEvent<"u"&&d instanceof DragEvent?T.Drag:d instanceof MouseEvent?T.MouseMove:T.TouchMove)}),n,{trailing:!1})),c=[ie("mousemove",u,t),ie("touchmove",u,t),ie("drag",u,t)];return M(()=>{c.forEach(d=>d())})}function ip({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=null,u=c=>d=>{let p=Ft(d);if(ae(p,r,n,!0))return;let m=null,g=c;if("pointerType"in d){switch(d.pointerType){case"mouse":m=Ne.Mouse;break;case"touch":m=Ne.Touch;break;case"pen":m=Ne.Pen;break}m===Ne.Touch?he[c]===he.MouseDown?g="TouchStart":he[c]===he.MouseUp&&(g="TouchEnd"):Ne.Pen}else gn(d)&&(m=Ne.Touch);m!==null?(a=m,(g.startsWith("Touch")&&m===Ne.Touch||g.startsWith("Mouse")&&m===Ne.Mouse)&&(m=null)):he[c]===he.Click&&(m=a,a=null);let f=gn(d)?d.changedTouches[0]:d;if(!f)return;let h=t.getId(p),{clientX:E,clientY:S}=f;M(s)({type:he[g],id:h,x:E,y:S,...m!==null&&{pointerType:m}})};return Object.keys(he).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{let d=We(c),p=u(c);if(window.PointerEvent)switch(he[c]){case he.MouseDown:case he.MouseUp:d=d.replace("mouse","pointer");break;case he.TouchStart:case he.TouchEnd:return}l.push(ie(d,p,e))}),M(()=>{l.forEach(c=>c())})}function al({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,sampling:o}){let i=M(Mt(M(l=>{let a=Ft(l);if(!a||ae(a,r,n,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Za(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100));return ie("scroll",i,e)}function ap({viewportResizeCb:s},{win:e}){let t=-1,r=-1,n=M(Mt(M(()=>{let o=Xa(),i=qa();(t!==o||r!==i)&&(s({width:Number(i),height:Number(o)}),t=o,r=i)}),200));return ie("resize",n,e)}var lp=["INPUT","TEXTAREA","SELECT"],gi=new WeakMap;function up({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function d(S){let w=Ft(S),I=S.isTrusted,_=w&&w.tagName;if(w&&_==="OPTION"&&(w=D.parentElement(w)),!w||!_||lp.indexOf(_)<0||ae(w,r,n,!0)||w.classList.contains(o)||i&&w.matches(i))return;let y=w.value,R=!1,v=_n(w)||"";v==="radio"||v==="checkbox"?R=w.checked:(l[_.toLowerCase()]||l[v])&&(y=Ir({element:w,maskInputOptions:l,tagName:_,type:v,value:y,maskInputFn:a})),p(w,c?{text:y,isChecked:R,userTriggered:I}:{text:y,isChecked:R});let x=w.name;v==="radio"&&x&&R&&e.querySelectorAll(`input[type="radio"][name="${cp(x)}"]`).forEach(O=>{if(O!==w){let ue=O.value;p(O,c?{text:ue,isChecked:!R,userTriggered:!1}:{text:ue,isChecked:!R})}})}function p(S,w){let I=gi.get(S);if(!I||I.text!==w.text||I.isChecked!==w.isChecked){gi.set(S,w);let _=t.getId(S);M(s)({...w,id:_})}}let g=(u.input==="last"?["change"]:["input","change"]).map(S=>ie(S,M(d),e)),f=e.defaultView;if(!f)return()=>{g.forEach(S=>S())};let h=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),E=[[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 h&&h.set&&g.push(...E.map(S=>Zr(S[0],S[1],{set(){M(d)({target:this,isTrusted:!1})}},!1,f))),M(()=>{g.forEach(S=>S())})}function Lr(s){let e=[];function t(r,n){if(gr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||gr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||gr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||gr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let i=Array.from(r.parentRule.cssRules).indexOf(r);n.unshift(i)}else if(r.parentStyleSheet){let i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);n.unshift(i)}return n}return t(s,e)}function cp(s){return s.replace(/["\\]/g,"\\$&")}function Fe(s,e,t){let r,n;return s?(s.ownerNode?r=e.getId(s.ownerNode):n=t.getId(s),{styleId:n,id:r}):{}}function dp({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:M((c,d,p)=>{let[m,g]=p,{id:f,styleId:h}=Fe(d,e,t.styleMirror);return(f&&f!==-1||h&&h!==-1)&&s({id:f,styleId:h,adds:[{rule:m,index:g}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let m=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,p])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,removes:[{index:m}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,replace:m}),c.apply(d,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,replaceSync:m}),c.apply(d,p)})}));let a={};yr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(yr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),yr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),yr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:M((p,m,g)=>{let[f,h]=g,{id:E,styleId:S}=Fe(m.parentStyleSheet,e,t.styleMirror);return(E&&E!==-1||S&&S!==-1)&&s({id:E,styleId:S,adds:[{rule:f,index:[...Lr(m),h||0]}]}),p.apply(m,g)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:M((p,m,g)=>{let[f]=g,{id:h,styleId:E}=Fe(m.parentStyleSheet,e,t.styleMirror);return(h&&h!==-1||E&&E!==-1)&&s({id:h,styleId:E,removes:[{index:[...Lr(m),f]}]}),p.apply(m,g)})})}),M(()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function ll({mirror:s,stylesheetManager:e},t){var r,n,o;let i=null;t.nodeName==="#document"?i=s.getId(t):i=s.getId(D.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:o.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return i===null||i===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=a.set)==null?void 0:c.call(this,u);if(i!==null&&i!==-1)try{e.adoptStyleSheets(u,i)}catch{}return d}}),M(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function hp({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:n}){let o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:M((l,a,u)=>{var c;let[d,p,m]=u;if(t.has(d))return o.apply(a,[d,p,m]);let{id:g,styleId:f}=Fe((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,set:{property:d,value:p,priority:m},index:Lr(a.parentRule)}),l.apply(a,u)})});let i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:M((l,a,u)=>{var c;let[d]=u;if(t.has(d))return i.apply(a,[d]);let{id:p,styleId:m}=Fe((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,remove:{property:d},index:Lr(a.parentRule)}),l.apply(a,u)})}),M(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}function fp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:n,doc:o}){let i=M(a=>Mt(M(u=>{let c=Ft(u);if(!c||ae(c,e,t,!0))return;let{currentTime:d,volume:p,muted:m,playbackRate:g,loop:f}=c;s({type:a,id:r.getId(c),currentTime:d,volume:p,muted:m,playbackRate:g,loop:f})}),n.media||500)),l=[ie("play",i(Qe.Play),o),ie("pause",i(Qe.Pause),o),ie("seeked",i(Qe.Seeked),o),ie("volumechange",i(Qe.VolumeChange),o),ie("ratechange",i(Qe.RateChange),o)];return M(()=>{l.forEach(a=>a())})}function pp({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],n=new WeakMap,o=t.FontFace;t.FontFace=function(a,u,c){let d=new o(a,u,c);return n.set(d,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let i=ct(e.fonts,"add",function(l){return function(a){return setTimeout(M(()=>{let u=n.get(a);u&&(s(u),n.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=o}),r.push(i),M(()=>{r.forEach(l=>l())})}function mp(s){let{doc:e,mirror:t,blockClass:r,blockSelector:n,selectionCb:o}=s,i=!0,l=M(()=>{let a=e.getSelection();if(!a||i&&a?.isCollapsed)return;i=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let d=0;d<c;d++){let p=a.getRangeAt(d),{startContainer:m,startOffset:g,endContainer:f,endOffset:h}=p;ae(m,r,n,!0)||ae(f,r,n,!0)||u.push({start:t.getId(m),startOffset:g,end:t.getId(f),endOffset:h})}o({ranges:u})});return l(),ie("selectionchange",l)}function gp({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:ct(t.customElements,"define",function(n){return function(o,i,l){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,i,l])}})}function yp(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:m,customElementCb:g}=s;s.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),t(...f)},s.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),r(...f)},s.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),n(...f)},s.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},s.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),i(...f)},s.inputCb=(...f)=>{e.input&&e.input(...f),l(...f)},s.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),a(...f)},s.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),u(...f)},s.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),c(...f)},s.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),d(...f)},s.fontCb=(...f)=>{e.font&&e.font(...f),p(...f)},s.selectionCb=(...f)=>{e.selection&&e.selection(...f),m(...f)},s.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),g(...f)}}function wp(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};yp(s,e);let r;s.recordDOM&&(r=il(s,s.doc));let n=op(s),o=ip(s),i=al(s),l=ap(s,{win:t}),a=up(s),u=fp(s),c=()=>{},d=()=>{},p=()=>{},m=()=>{};s.recordDOM&&(c=dp(s,{win:t}),d=ll(s,s.doc),p=hp(s,{win:t}),s.collectFonts&&(m=pp(s)));let g=mp(s),f=gp(s),h=[];for(let E of s.plugins)h.push(E.observer(E.callback,t,E.options));return M(()=>{He.forEach(E=>E.reset()),r?.disconnect(),n(),o(),i(),l(),a(),u(),c(),d(),p(),m(),g(),f(),h.forEach(E=>E())})}function gr(s){return typeof window[s]<"u"}function yr(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var Fr=class{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){let o=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e),l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),i.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,n))}getRemoteId(e,t,r){let n=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let o=n.get(t);return o||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getRemoteId(e,n,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},Cn=class{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Fr(xi)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Fr(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&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(n=this.loadListener)==null||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){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let o=this.transformCrossOriginEvent(n,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:k.IncrementalSnapshot,data:{source:T.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return t;case k.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case k.IncrementalSnapshot:switch(t.data.source){case T.Mutation:return t.data.adds.forEach(n=>{this.replaceIds(n,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(n.node,o)}),t.data.removes.forEach(n=>{this.replaceIds(n,e,["parentId","id"])}),t.data.attributes.forEach(n=>{this.replaceIds(n,e,["id"])}),t.data.texts.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case T.Drag:case T.TouchMove:case T.MouseMove:return t.data.positions.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case T.ViewportResize:return!1;case T.MediaInteraction:case T.MouseInteraction:case T.Scroll:case T.CanvasMutation:case T.Input:return this.replaceIds(t.data,e,["id"]),t;case T.StyleSheetRule:case T.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case T.Font:return t;case T.Selection:return t.data.ranges.forEach(n=>{this.replaceIds(n,e,["start","end"])}),t;case T.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(n=>{this.replaceStyleIds(n,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(let o of n)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));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(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==q.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},En=class{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(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(!Ct(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=il({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(al({...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(D.host(e))),this.restoreHandlers.push(ll({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){let r=this;this.restoreHandlers.push(ct(e.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o),l=D.shadowRoot(this);return l&&nl(this)&&r.addShadowRoot(l,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sp=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(vt=0;vt<rt.length;vt++)Sp[rt.charCodeAt(vt)]=vt;var vt,vp=function(s){var e=new Uint8Array(s),t,r=e.length,n="";for(t=0;t<r;t+=3)n+=rt[e[t]>>2],n+=rt[(e[t]&3)<<4|e[t+1]>>4],n+=rt[(e[t+1]&15)<<2|e[t+2]>>6],n+=rt[e[t+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n},yi=new Map;function bp(s,e){let t=yi.get(s);return t||(t=new Map,yi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var ul=(s,e,t)=>{if(!s||!(dl(s,e)||typeof s=="object"))return;let r=s.constructor.name,n=bp(t,r),o=n.indexOf(s);return o===-1&&(o=n.length,n.push(s)),o};function Cr(s,e,t){if(s instanceof Array)return s.map(r=>Cr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,n=vp(s);return{rr_type:r,base64:n}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Cr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:n}=s;return{rr_type:r,src:n}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",n=s.toDataURL();return{rr_type:r,src:n}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Cr(s.data,e,t),s.width,s.height]};if(dl(s,e)||typeof s=="object"){let r=s.constructor.name,n=ul(s,e,t);return{rr_type:r,index:n}}}}return s}var cl=(s,e,t)=>s.map(r=>Cr(r,e,t)),dl=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof e[n]=="function").find(n=>s instanceof e[n]);function Cp(s,e,t,r){let n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let i of o)try{if(typeof e.CanvasRenderingContext2D.prototype[i]!="function")continue;let l=ct(e.CanvasRenderingContext2D.prototype,i,function(a){return function(...u){return ae(this.canvas,t,r,!0)||setTimeout(()=>{let c=cl(u,e,this);s(this.canvas,{type:ut["2D"],property:i,args:c})},0),a.apply(this,u)}});n.push(l)}catch{let l=Zr(e.CanvasRenderingContext2D.prototype,i,{set(a){s(this.canvas,{type:ut["2D"],property:i,args:[a],setter:!0})}});n.push(l)}return()=>{n.forEach(i=>i())}}function Ep(s){return s==="experimental-webgl"?"webgl":s}function wi(s,e,t,r){let n=[];try{let o=ct(s.HTMLCanvasElement.prototype,"getContext",function(i){return function(l,...a){if(!ae(this,e,t,!0)){let u=Ep(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return i.apply(this,[l,...a])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(o=>o())}}function Si(s,e,t,r,n,o){let i=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=ct(s,a,function(c){return function(...d){let p=c.apply(this,d);if(ul(p,o,this),"tagName"in this.canvas&&!ae(this.canvas,r,n,!0)){let m=cl(d,o,this),g={type:e,property:a,args:m};t(this.canvas,g)}return p}});i.push(u)}catch{let u=Zr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});i.push(u)}return i}function Rp(s,e,t,r){let n=[];return n.push(...Si(e.WebGLRenderingContext.prototype,ut.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&n.push(...Si(e.WebGL2RenderingContext.prototype,ut.WebGL2,s,t,r,e)),()=>{n.forEach(o=>o())}}var hl="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ip=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),vi=typeof window<"u"&&window.Blob&&new Blob([Ip(hl)],{type:"text/javascript;charset=utf-8"});function xp(s){let e;try{if(e=vi&&(window.URL||window.webkitURL).createObjectURL(vi),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+hl,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var Rn=class{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&t==="all"&&this.initCanvasMutationObserver(r,n,o),i&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:l})}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,o){let i=wi(t,r,n,!0),l=new Map,a=new xp;a.onmessage=g=>{let{id:f}=g.data;if(l.set(f,!1),!("base64"in g.data))return;let{base64:h,type:E,width:S,height:w}=g.data;this.mutationCb({id:f,type:ut["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:E}]},0,0]}]})};let u=1e3/e,c=0,d,p=()=>{let g=[];return t.document.querySelectorAll("canvas").forEach(f=>{ae(f,r,n,!0)||g.push(f)}),g},m=g=>{if(c&&g-c<u){d=requestAnimationFrame(m);return}c=g,p().forEach(async f=>{var h;let E=this.mirror.getId(f);if(l.get(E)||f.width===0||f.height===0)return;if(l.set(E,!0),["webgl","webgl2"].includes(f.__context)){let w=f.getContext(f.__context);((h=w?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let S=await createImageBitmap(f);a.postMessage({id:E,bitmap:S,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[S])}),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{i(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=wi(e,t,r,!1),o=Cp(this.processMutation.bind(this),e,t,r),i=Rp(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let n=r.map(i=>{let{type:l,...a}=i;return a}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}},In=class{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new wn),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(e.length===0)return;let r={id:t,styleIds:[]},n=[];for(let o of e){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),n.push({styleId:i,rules:Array.from(o.rules||CSSRule,(l,a)=>({rule:Ri(l,o.href),index:a}))})),r.styleIds.push(i)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},xn=class{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(n=>n!==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(){}},Z,Er,$s,Ur=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Ro=s.contentWindow)==null?void 0:Ro.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var Se=Pu();function Ae(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:m,maskInputFn:g,maskTextFn:f,maskAnchorHrefFn:h,blockImgSrcPattern:E=null,blockImgSrcFillOptions:S={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},hooks:w,packFn:I,sampling:_={},dataURLOptions:y={},mousemoveWait:R,recordDOM:v=!0,recordCanvas:x=!1,recordCrossOriginIframes:O=!1,recordAfter:ue=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:ce=!1,inlineImages:X=!1,plugins:j,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:ee}=s;sp(ee);let F=O?window.parent===window:!0,te=!1;if(!F)try{window.parent.document&&(te=!1)}catch{te=!0}if(F&&!e)throw new Error("emit function is required");if(!F&&!te)return()=>{};R!==void 0&&_.mousemove===void 0&&(_.mousemove=R),Se.reset();let Q=d===!0?{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}:p!==void 0?p:{password:!0},re=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all",headTitleMutations:m==="all"}:m||{};Qf();let Oe,de=0,se=N=>{for(let we of j||[])we.eventProcessor&&(N=we.eventProcessor(N));return I&&!te&&(N=I(N)),N};Z=(N,we)=>{var K;let J=N;if(J.timestamp=$r(),(K=He[0])!=null&&K.isFrozen()&&J.type!==k.FullSnapshot&&!(J.type===k.IncrementalSnapshot&&J.data.source===T.Mutation)&&He.forEach(Re=>Re.unfreeze()),F)e?.(se(J),we);else if(te){let Re={type:"rrweb",event:se(J),origin:window.location.origin,isCheckout:we};window.parent.postMessage(Re,"*")}if(J.type===k.FullSnapshot)Oe=J,de=0;else if(J.type===k.IncrementalSnapshot){if(J.data.source===T.Mutation&&J.data.isAttachIframe)return;de++;let Re=r&&de>=r,U=t&&J.timestamp-Oe.timestamp>t;(Re||U)&&Er(!0)}};let je=N=>{Z({type:k.IncrementalSnapshot,data:{source:T.Mutation,...N}})},pt=N=>Z({type:k.IncrementalSnapshot,data:{source:T.Scroll,...N}}),Ke=N=>Z({type:k.IncrementalSnapshot,data:{source:T.CanvasMutation,...N}}),as=N=>Z({type:k.IncrementalSnapshot,data:{source:T.AdoptedStyleSheet,...N}}),Ce=new In({mutationCb:je,adoptedStyleSheetCb:as}),Ee=new Cn({mirror:Se,mutationCb:je,stylesheetManager:Ce,recordCrossOriginIframes:O,wrappedEmit:Z});for(let N of j||[])N.getMirror&&N.getMirror({nodeMirror:Se,crossOriginIframeMirror:Ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ee.crossOriginIframeStyleMirror});let Je=new xn;$s=new Rn({recordCanvas:x,mutationCb:Ke,win:window,blockClass:n,blockSelector:o,mirror:Se,sampling:_.canvas,dataURLOptions:y});let Yt=new En({mutationCb:je,scrollCb:pt,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Q,dataURLOptions:y,maskTextFn:f,maskInputFn:g,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,recordCanvas:x,inlineImages:X,sampling:_,slimDOMOptions:re,iframeManager:Ee,stylesheetManager:Ce,canvasManager:$s,keepIframeSrcFn:A,processedNodeManager:Je},mirror:Se});Er=(N=!1)=>{if(!v)return;Z({type:k.Meta,data:{href:window.location.href,width:qa(),height:Xa()}},N),Ce.reset(),Yt.init(),He.forEach(K=>K.lock());let we=oc(document,{mirror:Se,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Q,maskTextFn:f,maskInputFn:g,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,slimDOM:re,dataURLOptions:y,recordCanvas:x,inlineImages:X,onSerialize:K=>{tl(K,Se)&&Ee.addIframe(K),rl(K,Se)&&Ce.trackLinkElement(K),yn(K)&&Yt.addShadowRoot(D.shadowRoot(K),document)},onIframeLoad:(K,J)=>{Ee.attachIframe(K,J),Yt.observeAttachShadow(K)},onStylesheetLoad:(K,J)=>{Ce.attachLinkElement(K,J)},keepIframeSrcFn:A});if(!we)return console.warn("Failed to snapshot the document");Z({type:k.FullSnapshot,data:{node:we,initialOffset:Za(window)}},N),He.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ce.adoptStyleSheets(document.adoptedStyleSheets,Se.getId(document))};try{let N=[],we=J=>{var Re;return M(wp)({mutationCb:je,mousemoveCb:(U,ls)=>Z({type:k.IncrementalSnapshot,data:{source:ls,positions:U}}),mouseInteractionCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.MouseInteraction,...U}}),scrollCb:pt,viewportResizeCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.ViewportResize,...U}}),inputCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.Input,...U}}),mediaInteractionCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.MediaInteraction,...U}}),styleSheetRuleCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.StyleSheetRule,...U}}),styleDeclarationCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.StyleDeclaration,...U}}),canvasMutationCb:Ke,fontCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.Font,...U}}),selectionCb:U=>{Z({type:k.IncrementalSnapshot,data:{source:T.Selection,...U}})},customElementCb:U=>{Z({type:k.IncrementalSnapshot,data:{source:T.CustomElement,...U}})},blockClass:n,ignoreClass:i,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:Q,inlineStylesheet:c,sampling:_,recordDOM:v,recordCanvas:x,inlineImages:X,userTriggeredOnInput:Y,collectFonts:ce,doc:J,maskInputFn:g,maskTextFn:f,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:re,dataURLOptions:y,mirror:Se,iframeManager:Ee,stylesheetManager:Ce,shadowDomManager:Yt,processedNodeManager:Je,canvasManager:$s,ignoreCSSAttributes:G,plugins:((Re=j?.filter(U=>U.observer))==null?void 0:Re.map(U=>({observer:U.observer,options:U.options,callback:ls=>Z({type:k.Plugin,data:{plugin:U.name,payload:ls}})})))||[]},w)};Ee.addLoadListener(J=>{try{N.push(we(J.contentDocument))}catch(Re){console.warn(Re)}});let K=()=>{Er(),N.push(we(document)),Ur=!0};return document.readyState==="interactive"||document.readyState==="complete"?K():(N.push(ie("DOMContentLoaded",()=>{Z({type:k.DomContentLoaded,data:{}}),ue==="DOMContentLoaded"&&K()})),N.push(ie("load",()=>{Z({type:k.Load,data:{}}),ue==="load"&&K()},window))),()=>{N.forEach(J=>J()),Je.destroy(),Ur=!1,np()}}catch(N){console.warn(N)}}Ae.addCustomEvent=(s,e)=>{if(!Ur)throw new Error("please add custom event after start recording");Z({type:k.Custom,data:{tag:s,payload:e}})};Ae.freezePage=()=>{He.forEach(s=>s.freeze())};Ae.takeFullSnapshot=s=>{if(!Ur)throw new Error("please take full snapshot after start recording");Er(s)};Ae.mirror=Se;var bi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(bi||(bi={}));function Xr(s,e){if(!e)return;let t=new URL(s),r={};for(let[n,o]of t.searchParams)e.includes(n)&&(r[n]=o);return Object.keys(r).length>0?r:void 0}import{minimatch as Op}from"minimatch";function Xn(s){throw new Error(`This code path should be unreachable: ${s}`)}function Ap(s){return(s.startsWith("http://")||s.startsWith("https://"))&&(s=s.replace(/^https?:\/\//,"")),s.endsWith("/")&&(s=s.substring(0,s.length-1)),s=s.replace(/:\d+$/,""),s}function _p(s,e){if(!e||e==="")return!1;if(e==="*")return!0;let t=Ap(e);return s===t}function ge({urlStr:s,pathConfig:e}){let t=new URL(s),r=t.pathname,n=t.hostname,o=e.rules.filter(l=>_p(n,l.domain));if(o.length>0){let l=o.find(a=>a.path==="**");if(!l)return e.defaultAction==="allow"?t:void 0;for(let a of o){if(a.path==="**")continue;let u=Ze(r,a);if(u!==void 0)switch(a.action){case"allow":return t;case"block":return;case"replace":return t.pathname=u,t;default:Xn(a.action)}}return l.action==="allow"?t:void 0}let i=e.rules.filter(l=>!l.domain);for(let l of i){let a=Ze(r,l);if(a!==void 0)switch(l.action){case"allow":return t;case"block":return;case"replace":return t.pathname=a,t;default:Xn(l.action)}}return e.defaultAction==="allow"?t:void 0}function Ut(s,e,t){let r=ge({urlStr:s,pathConfig:t});r||(r=new URL(s));let n=Dp(r.pathname,e.rules||[]),o=[];for(let i of r.searchParams.keys()){let l=Tp(i,n?.rules||[]);switch(l){case"accept":break;case"delete":o.push(i);break;case"anonymize":r.searchParams.set(i,"*");break;default:fe(l)}}for(let i of o)r.searchParams.delete(i);if(r.pathname.includes("%3F")){let i=r.pathname.split("/");i[i.length-1]=i[i.length-1].split("%3F")[0],r.pathname=i.join("/")}return r.hash.includes("=")&&(r.hash=""),r.toString()}function Dp(s,e){for(let t of e)if(Ze(s,{path:t.path}))return t}function Tp(s,e){for(let t of e)if(Op(s,t.param))return t.anonymizeValue?"anonymize":"accept";return"delete"}var qn=class{constructor(e,t,r){this.org=e;this.recorder=t;this.events=[];this._estimatedByteSize=0;this.events=r,this._estimatedByteSize=this.calculateTotalSize()}get estimatedByteSize(){return this._estimatedByteSize}calculateTotalSize(){try{let e=JSON.stringify(this.events,this.getCircularReplacer());return Np(e)}catch(e){return C(`Error calculating event size: ${e}. Falling back to approximation.`),this.events.length*500}}getCircularReplacer(){let e=new WeakSet;return(t,r)=>{if(typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}}clearEvents(){this.events=[],this._estimatedByteSize=this.calculateTotalSize()}pushEvent({eventHref:e,event:t}){if(!ge({urlStr:e,pathConfig:this.org.pathConfig})){C(`URL not accepted: ${e}`);return}if(!this.recorder.isRecording){C("Dropping event - recorder is not recording");return}this.events.push(t),this._estimatedByteSize=this.calculateTotalSize()}getEvents(){return this.events}},qr=class{constructor(e,t,r,n,o){this.org=e;this.eventStorage=t;this.getHref=r;this.eventStore=new qn(e,n,o)}get estimatedSerializedByteSize(){return this.eventStore.estimatedByteSize}clear(){this.eventStore.clearEvents(),this.eventStorage.removeEvents()}getEvents(){return this.eventStore.getEvents()}onVisibilityChange(e){e||this.eventStorage.setEvents(this.getEvents())}append(e){let t=this.getHref();if(e.type===oe.Meta)e.data.href=Ut(e.data.href,this.org.allowedQueryParams,this.org.pathConfig),this.lastHref=this.getHref();else if(this.lastHref&&t!=this.lastHref){C(`URL changed from ${this.lastHref} to ${t}, adding artificial meta event for ${this.getHref()}`),this.eventStore.pushEvent({eventHref:t,event:wo({href:Ut(t,this.org.allowedQueryParams,this.org.pathConfig),delay:e.delay,timestamp:e.timestamp})});let r=Xr(t,this.org.customQueryParamsCohorts);r&&this.eventStore.pushEvent({eventHref:t,event:mt({payload:{userCohorts:r,source:"query_params"},timestamp:e.timestamp,delay:e.delay})}),this.lastHref=this.getHref()}if(e.type===oe.IncrementalSnapshot&&e.data.source===Be.MouseInteraction&&e.data.type===ds.Click){let r=Ae.mirror.getNode(e.data.id);if(r){let n=Mp(r),o=yo({dom0EventHandlers:n,delay:e.delay,timestamp:e.timestamp});this.eventStore.pushEvent({eventHref:t,event:o})}}this.eventStore.pushEvent({eventHref:t,event:e})}};function Np(s){return new Blob([s]).size}function Mp(s){let e=[];for(let t=0;t<hs.length;t++){let n=hs[t];typeof s[n]=="function"&&e.push(n)}return e}var ye=Uint8Array,le=Uint16Array,Wt=Uint32Array,no=new ye([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]),oo=new ye([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]),fl=new ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yl=function(s,e){for(var t=new le(31),r=0;r<31;++r)t[r]=e+=1<<s[r-1];for(var n=new Wt(t[30]),r=1;r<30;++r)for(var o=t[r];o<t[r+1];++o)n[o]=o-t[r]<<5|r;return[t,n]},wl=yl(no,2),kp=wl[0],eo=wl[1];kp[28]=258,eo[258]=28;var Sl=yl(oo,0),Pw=Sl[0],pl=Sl[1],to=new le(32768);for(P=0;P<32768;++P)Pe=(P&43690)>>>1|(P&21845)<<1,Pe=(Pe&52428)>>>2|(Pe&13107)<<2,Pe=(Pe&61680)>>>4|(Pe&3855)<<4,to[P]=((Pe&65280)>>>8|(Pe&255)<<8)>>>1;var Pe,P,Ht=function(s,e,t){for(var r=s.length,n=0,o=new le(e);n<r;++n)++o[s[n]-1];var i=new le(e);for(n=0;n<e;++n)i[n]=i[n-1]+o[n-1]<<1;var l;if(t){l=new le(1<<e);var a=15-e;for(n=0;n<r;++n)if(s[n])for(var u=n<<4|s[n],c=e-s[n],d=i[s[n]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)l[to[d]>>>a]=u}else for(l=new le(r),n=0;n<r;++n)l[n]=to[i[s[n]-1]++]>>>15-s[n];return l},Ge=new ye(288);for(P=0;P<144;++P)Ge[P]=8;var P;for(P=144;P<256;++P)Ge[P]=9;var P;for(P=256;P<280;++P)Ge[P]=7;var P;for(P=280;P<288;++P)Ge[P]=8;var P,Qr=new ye(32);for(P=0;P<32;++P)Qr[P]=5;var P,Pp=Ht(Ge,9,0);var $p=Ht(Qr,5,0);var vl=function(s){return(s/8>>0)+(s&7&&1)},bl=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var r=new(s instanceof le?le:s instanceof Wt?Wt:ye)(t-e);return r.set(s.subarray(e,t)),r};var $e=function(s,e,t){t<<=e&7;var r=e/8>>0;s[r]|=t,s[r+1]|=t>>>8},zt=function(s,e,t){t<<=e&7;var r=e/8>>0;s[r]|=t,s[r+1]|=t>>>8,s[r+2]|=t>>>16},Qn=function(s,e){for(var t=[],r=0;r<s.length;++r)s[r]&&t.push({s:r,f:s[r]});var n=t.length,o=t.slice();if(!n)return[new ye(0),0];if(n==1){var i=new ye(t[0].s+1);return i[t[0].s]=1,[i,1]}t.sort(function(_,y){return _.f-y.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],u=0,c=1,d=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};c!=n-1;)l=t[t[u].f<t[d].f?u++:d++],a=t[u!=c&&t[u].f<t[d].f?u++:d++],t[c++]={s:-1,f:l.f+a.f,l,r:a};for(var p=o[0].s,r=1;r<n;++r)o[r].s>p&&(p=o[r].s);var m=new le(p+1),g=ro(t[c-1],m,0);if(g>e){var r=0,f=0,h=g-e,E=1<<h;for(o.sort(function(y,R){return m[R.s]-m[y.s]||y.f-R.f});r<n;++r){var S=o[r].s;if(m[S]>e)f+=E-(1<<g-m[S]),m[S]=e;else break}for(f>>>=h;f>0;){var w=o[r].s;m[w]<e?f-=1<<e-m[w]++-1:++r}for(;r>=0&&f;--r){var I=o[r].s;m[I]==e&&(--m[I],++f)}g=e}return[new ye(m),g]},ro=function(s,e,t){return s.s==-1?Math.max(ro(s.l,e,t+1),ro(s.r,e,t+1)):e[s.s]=t},ml=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new le(++e),r=0,n=s[0],o=1,i=function(a){t[r++]=a},l=1;l<=e;++l)if(s[l]==n&&l!=e)++o;else{if(!n&&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(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=s[l]}return[t.subarray(0,r),e]},Bt=function(s,e){for(var t=0,r=0;r<e.length;++r)t+=s[r]*e[r];return t},so=function(s,e,t){var r=t.length,n=vl(e+2);s[n]=r&255,s[n+1]=r>>>8,s[n+2]=s[n]^255,s[n+3]=s[n+1]^255;for(var o=0;o<r;++o)s[n+o+4]=t[o];return(n+4+r)*8},gl=function(s,e,t,r,n,o,i,l,a,u,c){$e(e,c++,t),++n[256];for(var d=Qn(n,15),p=d[0],m=d[1],g=Qn(o,15),f=g[0],h=g[1],E=ml(p),S=E[0],w=E[1],I=ml(f),_=I[0],y=I[1],R=new le(19),v=0;v<S.length;++v)R[S[v]&31]++;for(var v=0;v<_.length;++v)R[_[v]&31]++;for(var x=Qn(R,7),O=x[0],ue=x[1],Y=19;Y>4&&!O[fl[Y-1]];--Y);var ce=u+5<<3,X=Bt(n,Ge)+Bt(o,Qr)+i,j=Bt(n,p)+Bt(o,f)+i+14+3*Y+Bt(R,O)+(2*R[16]+3*R[17]+7*R[18]);if(ce<=X&&ce<=j)return so(e,c,s.subarray(a,a+u));var A,G,ee,F;if($e(e,c,1+(j<X)),c+=2,j<X){A=Ht(p,m,0),G=p,ee=Ht(f,h,0),F=f;var te=Ht(O,ue,0);$e(e,c,w-257),$e(e,c+5,y-1),$e(e,c+10,Y-4),c+=14;for(var v=0;v<Y;++v)$e(e,c+3*v,O[fl[v]]);c+=3*Y;for(var Q=[S,_],re=0;re<2;++re)for(var Oe=Q[re],v=0;v<Oe.length;++v){var de=Oe[v]&31;$e(e,c,te[de]),c+=O[de],de>15&&($e(e,c,Oe[v]>>>5&127),c+=Oe[v]>>>12)}}else A=Pp,G=Ge,ee=$p,F=Qr;for(var v=0;v<l;++v)if(r[v]>255){var de=r[v]>>>18&31;zt(e,c,A[de+257]),c+=G[de+257],de>7&&($e(e,c,r[v]>>>23&31),c+=no[de]);var se=r[v]&31;zt(e,c,ee[se]),c+=F[se],se>3&&(zt(e,c,r[v]>>>5&8191),c+=oo[se])}else zt(e,c,A[r[v]]),c+=G[r[v]];return zt(e,c,A[256]),c+G[256]},Lp=new Wt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fp=function(s,e,t,r,n,o){var i=s.length,l=new ye(r+i+5*(1+Math.floor(i/7e3))+n),a=l.subarray(r,l.length-n),u=0;if(!e||i<8)for(var c=0;c<=i;c+=65535){var d=c+65535;d<i?u=so(a,u,s.subarray(c,d)):(a[c]=o,u=so(a,u,s.subarray(c,i)))}else{for(var p=Lp[e-1],m=p>>>13,g=p&8191,f=(1<<t)-1,h=new le(32768),E=new le(f+1),S=Math.ceil(t/3),w=2*S,I=function(N){return(s[N]^s[N+1]<<S^s[N+2]<<w)&f},_=new Wt(25e3),y=new le(288),R=new le(32),v=0,x=0,c=0,O=0,ue=0,Y=0;c<i;++c){var ce=I(c),X=c&32767,j=E[ce];if(h[X]=j,E[ce]=X,ue<=c){var A=i-c;if((v>7e3||O>24576)&&A>423){u=gl(s,a,0,_,y,R,x,O,Y,c-Y,u),O=v=x=0,Y=c;for(var G=0;G<286;++G)y[G]=0;for(var G=0;G<30;++G)R[G]=0}var ee=2,F=0,te=g,Q=X-j&32767;if(A>2&&ce==I(c-Q))for(var re=Math.min(m,A)-1,Oe=Math.min(32767,c),de=Math.min(258,A);Q<=Oe&&--te&&X!=j;){if(s[c+ee]==s[c+ee-Q]){for(var se=0;se<de&&s[c+se]==s[c+se-Q];++se);if(se>ee){if(ee=se,F=Q,se>re)break;for(var je=Math.min(Q,se-2),pt=0,G=0;G<je;++G){var Ke=c-Q+G+32768&32767,as=h[Ke],Ce=Ke-as+32768&32767;Ce>pt&&(pt=Ce,j=Ke)}}}X=j,j=h[X],Q+=X-j+32768&32767}if(F){_[O++]=268435456|eo[ee]<<18|pl[F];var Ee=eo[ee]&31,Je=pl[F]&31;x+=no[Ee]+oo[Je],++y[257+Ee],++R[Je],ue=c+ee,++v}else _[O++]=s[c],++y[s[c]]}}u=gl(s,a,o,_,y,R,x,O,Y,c-Y,u)}return bl(l,0,r+vl(u)+n)},Up=function(){var s=1,e=0;return{p:function(t){for(var r=s,n=e,o=t.length,i=0;i!=o;){for(var l=Math.min(i+5552,o);i<l;++i)r+=t[i],n+=r;r%=65521,n%=65521}s=r,e=n},d:function(){return(s>>>8<<16|(e&255)<<8|e>>>8)+((s&255)<<23)*2}}},zp=function(s,e,t,r,n){return Fp(s,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(s.length)))*1.5):12+e.mem,t,r,!n)},Bp=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8},Hp=function(s,e){var t=e.level,r=t==0?0:t<6?1:t==9?3:2;s[0]=120,s[1]=r<<6|(r?32-2*r:1)};function Cl(s,e){e===void 0&&(e={});var t=Up();t.p(s);var r=zp(s,e,2,4);return Hp(r,e),Bp(r,r.length-4,t.d()),r}function io(s,e){var t=s.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var r=new ye(s.length+(s.length>>>1)),n=0,o=function(u){r[n++]=u},i=0;i<t;++i){if(n+5>r.length){var l=new ye(n+8+(t-i<<1));l.set(r),r=l}var a=s.charCodeAt(i);a<128||e?o(a):a<2048?(o(192|a>>>6),o(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|s.charCodeAt(++i)&1023,o(240|a>>>18),o(128|a>>>12&63),o(128|a>>>6&63),o(128|a&63)):(o(224|a>>>12),o(128|a>>>6&63),o(128|a&63))}return bl(r,0,n)}function ao(s,e){var t="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(s);for(var r=0;r<s.length;){var n=s[r++];n<128||e?t+=String.fromCharCode(n):n<224?t+=String.fromCharCode((n&31)<<6|s[r++]&63):n<240?t+=String.fromCharCode((n&15)<<12|(s[r++]&63)<<6|s[r++]&63):(n=((n&15)<<18|(s[r++]&63)<<12|(s[r++]&63)<<6|s[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023))}return t}var lo="v1";var uo=s=>{let e={...s,v:lo};return ao(Cl(io(JSON.stringify(e))),!0)};function El(s){let e=new URL(s),t={};for(let[r,n]of e.searchParams)switch(r){case"utm_source":case"utm_medium":case"utm_campaign":case"utm_term":case"utm_content":t[`UTM@@${r}`]=n;break}return Object.keys(t).length>0?t:void 0}var Rl=3*1024*1024,Il=5e3,es=class{constructor(e,t,r,n,o,i,l){this.window=e;this.storage=t;this.eventHolder=r;this.recorder=n;this.api=o;this.organization=i;this.windowGetters=l;this.lastSendTime=-1;this.lastAutoCohorts=void 0;this.fastpathToken=void 0;n.setOnEvent(a=>this.onEvent(a))}onEvent(e){if(e.type===oe.FullSnapshot){let o,i=Jt(this.window,this.organization.cohortsBootstrapConfig),l=El(this.windowGetters.getHref()),a=Xr(this.windowGetters.getHref(),this.organization.customQueryParamsCohorts),u=bs(this.window);this.lastAutoCohorts=u,(l||i||u||a)&&(o=mt({payload:{userCohorts:{...i||{},...u||{},...l||{},...a||{}},source:"window_getters"},delay:e.delay,timestamp:e.timestamp}));let c=o?[...this.eventHolder.getEvents(),o,e]:[...this.eventHolder.getEvents(),e];this.clearAndSaveEvents(c);return}else if(e.type===oe.IncrementalSnapshot&&e.data.source===Be.Mutation){let o=bs(this.window);o&&(!this.lastAutoCohorts||Object.keys(o).length!==Object.keys(this.lastAutoCohorts).length)&&(C("auto cohorts different, appending new event",o),this.eventHolder.append(mt({payload:{userCohorts:o,source:"window_getters"},delay:e.delay,timestamp:e.timestamp}))),this.lastAutoCohorts=o}this.eventHolder.append(e);let t=this.eventHolder.estimatedSerializedByteSize,n=Date.now()-this.lastSendTime;t>Rl&&n>=Il&&(C(`MAX_EVENT_BYTE_SIZE and timeSinceLastSend exceeded: ${t} > ${Rl} and ${n} >= ${Il}`),this.clearAndSaveEvents())}async clearAndSaveEvents(e){let t=this.windowGetters.getHref();if(!ge({urlStr:t,pathConfig:this.organization.pathConfig}))return;let r=e||this.eventHolder.getEvents();if(r.length!==0){this.eventHolder.clear();try{C("saving events...");let n=await this.prepareAndSendEvents(r);switch(C("save events result",n.type),n.type){case"success":break;case"recreate-session":await this.recreateSession(n.session);break;case"no-session":case"unknown-failure":case"rate-limit-exceeded":this.storage.removeSession(),this.eventHolder.clear();break;default:fe(n)}}catch(n){throw C("error saving events",n),this.storage.removeSession(),n}}}async prepareAndSendEvents(e){this.lastSendTime=Date.now();let t=this.storage.getSession();if(!t)return{type:"no-session"};if(t.eventPostUrl&&t.eventPostToken){let o=JSON.parse(atob(t.eventPostToken.split(".")[1]));if(o&&Date.now()>o.lastEventAt-10*1e3){C("refreshing token as it is about to expire");let i=await this.refreshToken(t);if(i.type!=="success")return i;if(t=this.storage.getSession(),!t)return{type:"no-session"}}}let r=t.compressionType==="RRWEB_PACK"?e.map(o=>uo(o)):e,n=await this.api.saveSessionEvents({sessionId:t.id,events:r,metadata:{url:Ut(this.windowGetters.getHref(),this.organization.allowedQueryParams,this.organization.pathConfig)},eventPostUrl:t.eventPostUrl,eventPostToken:t.eventPostToken,fastpathToken:this.fastpathToken});if(!n)return{type:"unknown-failure"};if(n.error)switch(n.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:t};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}if(!n.data)return{type:"unknown-failure"};if(n.data&&"code"in n.data)switch(n.data.code){case"TOKEN_REFRESH":{C("refreshing token as it expired on the worker");let o=await this.refreshToken(t);return o.type!=="success"?o:this.prepareAndSendEvents(e)}default:fe(n.data.code)}if(this.fastpathToken=n.data.fastpathToken,n.response.status<200||n.response.status>201)throw new Error(`got status ${n.response.status}`);return{type:"success"}}async refreshToken(e){let t=await this.api.refreshEventToken({sessionId:e.id});if(!t)return{type:"unknown-failure"};if(t.error)switch(t.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:e};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}return t.data?(this.storage.setSession({...e,eventPostToken:t.data.token}),{type:"success"}):{type:"unknown-failure"}}async recreateSession(e){C("recreating sessions");let t,r=this.recorder.isRecording;this.recorder.setRecording(!1),this.storage.removeSession(),this.fastpathToken=void 0;let n,o;try{C("recreating session...");let l=await this.api.startSession({orgId:e.settings.orgId,language:e.settings.language||this.windowGetters.getLanguage(),domain:new URL(this.windowGetters.getHref()).hostname,userCohorts:e.settings.userCohorts||{},uid:e.settings.uid,devicePixelRatio:this.windowGetters.getDevicePixelRatio(),adoraUserId:e.adoraUserId,documentReferrer:e.documentReferrer,snippetVersion:Kt});if(!l||l.error)return;if(l.response.status!==201){C("session not created, aborting");return}if(!l.data||!("session"in l.data)){C("malformed session, exiting");return}l?.data&&"eventPostUrl"in l.data&&l.data.eventPostUrl&&"eventPostToken"in l.data&&l.data.eventPostToken&&(n=l.data.eventPostUrl,o=l.data.eventPostToken),t=l.data}catch{}if(!t)return;let i={id:t.session.id,createdAt:t.session.createdAt,status:t.session.status,lastSyncedAt:t.session.lastSyncedAt,domain:t.session.domain,requestIp:t.session.requestIp,country:t.session.country,userAgent:t.session.userAgent,language:t.session.language,initialUserCohorts:t.session.initialUserCohorts,devicePixelRatio:t.session.devicePixelRatio,organization:t.organization,settings:e.settings,adoraUserId:e.adoraUserId,documentReferrer:e.documentReferrer,canvasRecordingEnabled:e.canvasRecordingEnabled,eventPostUrl:n,eventPostToken:o,limitedCanvasRecording:e.limitedCanvasRecording,compressionType:e.compressionType};this.storage.setSession(i),this.eventHolder.clear(),r&&this.recorder.setRecording(!0)}};var rs=class{constructor(e){this._options=e;this._buckets={};this._refillBuckets=()=>{Object.keys(this._buckets).forEach(e=>{let t=this._getBucket(e)+this._refillRate;t>=this._bucketSize?delete this._buckets[e]:this._setBucket(e,t)})};this._getBucket=e=>this._buckets[String(e)];this._setBucket=(e,t)=>{this._buckets[String(e)]=t};this.consumeRateLimit=e=>{let t=this._getBucket(e)??this._bucketSize;if(t=Math.max(t-1,0),t===0)return!0;this._setBucket(e,t);let r=t===0;return r&&this._onBucketRateLimited?.(e),r};this._onBucketRateLimited=this._options._onBucketRateLimited,this._bucketSize=ts(this._options.bucketSize,0,100),this._refillRate=ts(this._options.refillRate,0,this._bucketSize),this._refillInterval=ts(this._options.refillInterval,0,864e5),this._removeInterval=setInterval(()=>{this._refillBuckets()},this._refillInterval)}stop(){this._removeInterval&&(clearInterval(this._removeInterval),this._removeInterval=void 0)}};function ts(s,e,t,r){return e>t&&(e=t),Wp(s)?s>t?t:s<e?e:s:ts(r||t,e,t)}var Wp=s=>toString.call(s)=="[object Number]";var ss=class{constructor(e,t={}){this._rrweb=e;this._options=t;this._loggedTracker={};this._onNodeRateLimited=e=>{if(!this._loggedTracker[e]){this._loggedTracker[e]=!0;let t=this._getNode(e);this._options.onBlockedNode?.(e,t)}};this._getNodeOrRelevantParent=e=>{let t=this._getNode(e);if(t?.nodeName!=="svg"&&t instanceof Element){let r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]};this._getNode=e=>this._rrweb.mirror.getNode(e);this._numberOfChanges=e=>(e.removes?.length??0)+(e.attributes?.length??0)+(e.texts?.length??0)+(e.adds?.length??0);this.throttleMutations=e=>{if(e.type!==oe.IncrementalSnapshot||e.data.source!==Be.Mutation)return e;let t=e.data,r=this._numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(o=>{let[i]=this._getNodeOrRelevantParent(o.id);return this._rateLimiter.consumeRateLimit(i)?!1:o}));let n=this._numberOfChanges(t);if(!(n===0&&r!==n))return e};this._rateLimiter=new rs({bucketSize:this._options.bucketSize??100,refillRate:this._options.refillRate??10,refillInterval:1e3,_onBucketRateLimited:this._onNodeRateLimited})}reset(){this._loggedTracker={}}stop(){this._rateLimiter.stop(),this.reset()}};var dt,xl=()=>{if(dt!==void 0)return dt;try{return dt=document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")===0,C("adora script - isWebpSupported? - ",dt),dt}catch{return dt=!1,!1}};var ns=class{constructor(e,t,r,n){this.limitedCanvasRecording=e;this.canvasRecordingEnabled=t;this.org=r;this.rrwebRecorder=n;this.startable=!0;C("new recorder")}setOnEvent(e){this.onEvent=e}get args(){let e=this.org.blockedCSSClasses.length>0?`|(${this.org.blockedCSSClasses.join(")|(")})`:"",t=this.org.maskedCSSClasses&&this.org.maskedCSSClasses?.length>0?`|(${this.org.maskedCSSClasses?.join(")|(")})`:"",r=xl()?"image/webp":this.limitedCanvasRecording?"image/jpeg":"image/png";return{emit:n=>{if(!this.onEvent)throw new Error("onEvent must be assigned before starting recording");n.type===oe.FullSnapshot&&this.mutationThrottler?.reset();let o=this.mutationThrottler?this.mutationThrottler.throttleMutations(n):n;o&&this.onEvent(o)},userTriggeredOnInput:!0,blockClass:new RegExp(`(adora-block)|(rr-block|fs-exclude|ph-no-capture)${e}`),maskTextClass:new RegExp(`(adora-mask)|(rr-mask|fs-mask)${t}`),maskAllInputs:!0,maskInputFn:(n,o)=>Al(this.org,o)?n:"*".repeat(n.length),maskTextFn:(n,o)=>o&&this.org.maskByDefault&&o.closest('button,a,div[role="button"],div[role*="menuitem"],input[type="button"],input[type="submit"],input[type="reset"]')||o&&Al(this.org,o)?n:n.replace(/[\S]/g,"*"),maskTextSelector:this.org?.maskByDefault?"*":"",recordCanvas:this.canvasRecordingEnabled,sampling:this.canvasRecordingEnabled?{canvas:this.limitedCanvasRecording?1:2}:void 0,dataURLOptions:this.canvasRecordingEnabled?{type:r,quality:.6}:{}}}recordChangeCustomCohort(e){C("sending custom cohort change",e),this.rrwebRecorder.addCustomEvent(go,e)}recordCLS(e){this.rrwebRecorder.addCustomEvent("CLS",e)}recordFID(e){this.rrwebRecorder.addCustomEvent("FID",e)}recordLCP(e){this.rrwebRecorder.addCustomEvent("LCP",e)}recordVisibilityChange(e){this.rrwebRecorder.addCustomEvent("Adora.VisibilityChange",{visibilityState:e})}recordFocusChange(e){this.rrwebRecorder.addCustomEvent("Adora.FocusChange",{focusState:e})}get isRecording(){return this.rrwebRecorder.isRecording}setRecording(e){if(C("setRecording",`requested status: ${e}`,`current status ${this.rrwebRecorder.isRecording}`),this.rrwebRecorder.isRecording!==e){if(e){this.startRecording();return}this.stopRecording()}}startRecording(){if(this.isRecording)throw new Error("recording already in progress!");if(!this.startable){C("recorder is not startable, returning");return}this.mutationThrottler=new ss(this.rrwebRecorder,{bucketSize:100,refillRate:10,onBlockedNode:(e,t)=>{C("mutation throttler blocked node",{id:e,node:t})}}),this.rrwebRecorder.record(this.args)}stopRecording(){this.mutationThrottler?.stop(),this.mutationThrottler=void 0,this.rrwebRecorder.stop()}stopFutureRecordings(){this.startable=!1}};function Al(s,e){if(e.classList.contains("adora-unmask"))return!0;for(let t of s.unmaskSelectors)if(Array.from(document.querySelectorAll(t)).find(r=>r===e))return!0;return!1}var os=class{constructor(){this._isRecording=!1}get isRecording(){return this._isRecording}get mirror(){return Ae.mirror}record(e){if(C("record",{stopFn:typeof this.stopFn,isRecording:this._isRecording}),this.stopFn!==void 0&&this.stop(),this._isRecording=!0,this.stopFn=Ae(e),!this.stopFn)throw new Error("recorder could not successfully start")}stop(){this._isRecording=!1,this.stopFn&&(this.stopFn(),this.stopFn=void 0)}addCustomEvent(e,t){if(!this._isRecording)return C("WARNING! attempting to add custom event with recording off"),!1;try{Ae.addCustomEvent(e,t)}catch(r){return C("trying to record an event even though",r),!1}return!0}};var _l=5e3;function Ol({sessionType:s}){C("initialize recording");let e=new Le(s,new Te),t=e.getSession();if(!t)return;let r=new De(t.settings.backendUrl),n=new jt(s,new Te),o=n.getEvents();n.removeEvents();let i=()=>window.location.href,l=()=>window.navigator.language,a=()=>window.devicePixelRatio,u=new os,c=new ns(t.limitedCanvasRecording??!1,t.canvasRecordingEnabled??!1,t.organization,u),d=new qr(t.organization,n,i,c,o||[]),p=new es(window,e,d,c,r,t.organization,{getHref:i,getLanguage:l,getDevicePixelRatio:a}),m=window.location.href;ge({urlStr:m,pathConfig:t.organization.pathConfig})?(C("starting recording..."),c.setRecording(!0)):C("recording did not start as current URL is blocked");let g=Jt(window,t.organization.cohortsBootstrapConfig);c.isRecording&&(c.recordChangeCustomCohort({uid:t.settings.uid,userCohorts:t.settings.userCohorts?{...g,...t.settings.userCohorts}:{}}),e.setSession(t)),ht.onCLS(I=>{c.isRecording&&c.recordCLS(I)}),ht.onFID(I=>{c.isRecording&&c.recordFID(I)}),ht.onLCP(I=>{c.isRecording&&c.recordLCP(I)});let f=()=>{p.clearAndSaveEvents(d.getEvents())},h=window.setInterval(f,_l);window.addEventListener("blur",()=>{c.recordFocusChange("blur")}),window.addEventListener("focus",()=>{c.recordFocusChange("focus")}),document.addEventListener("visibilitychange",()=>{if(C(`detected a visibility change to ${document.visibilityState}`),c.isRecording&&c.recordVisibilityChange(document.visibilityState),document.visibilityState==="hidden"){h&&(C("clearing the saveInterval"),clearInterval(h),h=void 0),d.onVisibilityChange(!1);return}h||(C("resuming the saveInterval"),h=window.setInterval(f,_l))});let E=m,S=new MutationObserver(function(){if(d&&window.location.href!==E){let I=ge({urlStr:window.location.href,pathConfig:t.organization.pathConfig});C(`url changed detected, status: ${!!I}`),c.setRecording(!!I),E=window.location.href}});return S.observe(document,{subtree:!0,childList:!0}),{recorder:c,eventSync:p,urlChangeObserverDispose:()=>{S.disconnect()}}}var Dl=s=>Ol(s);var ft=!1,Tl="_adora_user_id",Nl="_adora_rate_limited",_e,Vt,co="stopped",Ml=()=>{C("startRecording",`adoraIsRunning: ${ft}`),co==="started"&&(_e=Dl({sessionType:"adoraSessionScript"}))},kl=1e3*60*30,ZS=async({userCohorts:s,...e})=>{let t=e;if(co="started",C("adora start",{adoraIsRunning:ft,uid:t.uid,userCohorts:s||{}}),typeof window.sessionStorage!="object"){C("SSR detected");return}if(s){t.userCohorts={};for(let[a,u]of Object.entries(s))u!==void 0?(C("setting user cohorts key",{key:a,value:u}),t.userCohorts[a]=u):C("found undefined user cohorts key",{key:a})}let r=new Le("adoraSessionScript",new Te),n=r.getSession();if(n){C("session detected; finding if changes should be written");let a=!1;if(t.uid&&n.settings.uid!==t.uid&&(C("detected uid change"),n.settings.uid=t.uid,r.setSession(n),a=!0),t.userCohorts&&Object.keys(t.userCohorts).length>0){C("detected user cohorts");let u=structuredClone(n.settings.userCohorts);Vp(u,t.userCohorts)||(C("detected user cohorts have been changed"),n.settings.userCohorts=t.userCohorts,r.setSession(n),a=!0)}a&&_e?.recorder&&_e?.recorder.isRecording&&(C("writing cohort change to recorder"),_e?.recorder.recordChangeCustomCohort({uid:n.settings.uid,userCohorts:n.settings.userCohorts?{...n.settings.userCohorts}:{}}))}if(ft===!0)return;ft=!0;let o=r.lastRateLimitedTimestamp;if(o!==void 0){if(Date.now()-o<kl){C("exiting as the session has been rate limited recently");return}r.clearLastRateLimitedTimestamp()}if(is.get(Nl)){C("exiting as the domain has been rate limited recently");return}if(n){C("start recording for existing session"),Ml();return}let i=!1,l=async(a,u)=>{if(C("start status",{started:i}),i)return;i=!0;let c=await bo("adoraSessionScript",u,t);if(c.type==="error"){c.code==="RateLimitExceeded"&&(C("setting expiration on local storage"),r.setLastRateLimitedTimestamp(Date.now()),a&&(C("setting expiration cookie"),is.set(Nl,a,{expires:new Date(Date.now()+kl),domain:a})));return}Ml()};C("launching session preload");try{let a=await new De(t.backendUrl).sessionPreload({orgId:t.orgId});C("session preload resolved");let u=window.location.href;if(a){if(a.error){C("error preloading",a.error);return}if("scheduledDowntime"in a.data){C("scheduled downtime; exiting");return}let{organization:c}=a.data;C("session preload success");let d=is.get(Tl),p;C("existing adora user id cookie:",d);for(let m of c.cookieDomains)(window.location.hostname.toLowerCase()===m||window.location.hostname.toLowerCase().endsWith("."+m))&&(p=m,d||(d=Yp(),is.set(Tl,d,{domain:m,expires:new Date(Date.now()+365*24*60*60*1e3)}),C("setting adoraUserId cookie on domain",d)));C("using adora user id:",d),ge({urlStr:u,pathConfig:c.pathConfig})?(C("at an unblocked URL, starting adora"),await l(p,d)):(C("at an blocked URL, waiting for unblocked URL to start adora"),Vt&&Vt.disconnect(),Vt=new MutationObserver(function(m,g){if(u!=window.location.href){let f=window.location.href,h=ge({urlStr:f,pathConfig:c.pathConfig});if(C(`url changed detected during blocked state, status: ${!!h}`),h){C("disconnecting observer"),g.disconnect(),C("scheduling adora to start"),l(p,d);return}u=f}}),Vt.observe(document,{subtree:!0,childList:!0}))}}catch(a){C("Error in adoraStart:",a)}},XS=async()=>{co="stopped",C("adora stop",{adoraIsRunning:ft}),_e&&(_e.recorder.setRecording(!1),_e.recorder.stopFutureRecordings(),_e.urlChangeObserverDispose(),await _e.eventSync.clearAndSaveEvents()),Vt?.disconnect(),ft=!1,_e=void 0};export{ft as adoraIsRunning,ZS as adoraStart,XS as adoraStop};
|
|
54
54
|
//# sourceMappingURL=index.mjs.map
|