@sprig-technologies/sprig-bundled 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-C7xpx0J5.cjs +66 -0
- package/dist/index-DvS_ADe1.js +8507 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +630 -1443
- package/dist/index.js +7 -1
- package/dist/view-BTlAJUks.js +1927 -0
- package/dist/view-CDCFNST3.cjs +12 -0
- package/package.json +2 -2
- package/dist/index-B-8qprPE.cjs +0 -31
- package/dist/index-Cr-P2Ow4.js +0 -31
- package/dist/view-B7PNPO8b.js +0 -28
- package/dist/view-FVRV2uPm.cjs +0 -28
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";var ud=Object.defineProperty;var dd=(e,t,r)=>t in e?ud(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var pe=(e,t,r)=>(dd(e,typeof t!="symbol"?t+"":t,r),r);var pd=Object.create,no=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,md=Object.getOwnPropertyNames,fd=Object.getPrototypeOf,gd=Object.prototype.hasOwnProperty,hr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yd=hr((e,t)=>{var r;r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t.exports=r}),wd=hr((e,t)=>{t.exports=function(n){if(!n)return!1;var s=r.call(n);return s==="[object Function]"||typeof n=="function"&&s!=="[object RegExp]"||typeof window<"u"&&(n===window.setTimeout||n===window.alert||n===window.confirm||n===window.prompt)};var r=Object.prototype.toString}),vd=hr((e,t)=>{var r=function(s){return s.replace(/^\s+|\s+$/g,"")},n=function(s){return Object.prototype.toString.call(s)==="[object Array]"};t.exports=function(s){if(!s)return{};for(var i={},a=r(s).split(`
|
|
2
|
+
`),o=0;o<a.length;o++){var l=a[o],c=l.indexOf(":"),u=r(l.slice(0,c)).toLowerCase(),p=r(l.slice(c+1));i[u]===void 0?i[u]=p:n(i[u])?i[u].push(p):i[u]=[i[u],p]}return i}}),bd=hr((e,t)=>{t.exports=function(){for(var n={},s=0;s<arguments.length;s++){var i=arguments[s];for(var a in i)r.call(i,a)&&(n[a]=i[a])}return n};var r=Object.prototype.hasOwnProperty}),Sd=hr((e,t)=>{var r=yd(),n=wd(),s=vd(),i=bd();function a(c,u,p){var d=c;return n(u)?(p=u,typeof c=="string"&&(d={uri:c})):d=i(u,{uri:c}),d.callback=p,d}function o(c,u,p){return l(u=a(c,u,p))}function l(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,p=function(L,E,I){u||(u=!0,c.callback(L,E,I))};function d(){var L=void 0;if(L=h.response?h.response:h.responseText||function(E){try{if(E.responseType==="document")return E.responseXML;var I=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!I)return E.responseXML}catch{}return null}(h),D)try{L=JSON.parse(L)}catch{}return L}function f(L){return clearTimeout(g),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,p(L,k)}function w(){if(!m){var L;clearTimeout(g),L=c.useXDR&&h.status===void 0?200:h.status===1223?204:h.status;var E=k,I=null;return L!==0?(E={body:d(),statusCode:L,method:S,headers:{},url:b,rawRequest:h},h.getAllResponseHeaders&&(E.headers=s(h.getAllResponseHeaders()))):I=new Error("Internal XMLHttpRequest Error"),p(I,E,E.body)}}var h=c.xhr||null;h||(h=c.cors||c.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var U,m,g,b=h.url=c.uri||c.url,S=h.method=c.method||"GET",M=c.body||c.data,C=h.headers=c.headers||{},A=!!c.sync,D=!1,k={body:void 0,headers:{},statusCode:0,method:S,url:b,rawRequest:h};if("json"in c&&c.json!==!1&&(D=!0,C.accept||C.Accept||(C.Accept="application/json"),S!=="GET"&&S!=="HEAD"&&(C["content-type"]||C["Content-Type"]||(C["Content-Type"]="application/json"),M=JSON.stringify(c.json===!0?M:c.json))),h.onreadystatechange=function(){h.readyState===4&&setTimeout(w,0)},h.onload=w,h.onerror=f,h.onprogress=function(){},h.onabort=function(){m=!0},h.ontimeout=f,h.open(S,b,!A,c.username,c.password),A||(h.withCredentials=!!c.withCredentials),!A&&c.timeout>0&&(g=setTimeout(function(){if(!m){m=!0,h.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",f(L)}},c.timeout)),h.setRequestHeader)for(U in C)C.hasOwnProperty(U)&&h.setRequestHeader(U,C[U]);else if(c.headers&&!function(L){for(var E in L)if(L.hasOwnProperty(E))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(h.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(h),h.send(M||null),h}t.exports=o,t.exports.default=o,o.XMLHttpRequest=r.XMLHttpRequest||function(){},o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:r.XDomainRequest,function(c,u){for(var p=0;p<c.length;p++)u(c[p])}(["get","put","post","patch","head","delete"],function(c){o[c==="delete"?"del":c]=function(u,p,d){return(p=a(u,p,d)).method=c.toUpperCase(),l(p)}})});function xi(e,t,...r){if(!e)throw new TypeError(rl(t,r))}function rl(e,t){let r=0;return e.replace(/%[os]/gu,()=>nl(t[r++]))}function nl(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var Ae=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,lt=class{constructor(e,t){this.code=e,this.message=t}warn(...e){var t;try{let r=((t=new Error().stack)!==null&&t!==void 0?t:"").replace(/^(?:.+?\n){2}/gu,`
|
|
3
|
+
`);console.warn(this.message,...e,r)}catch{}}},Id=new lt("W01","Unable to initialize event under dispatching."),Cd=new lt("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),kd=new lt("W03","Assigning any truthy value to 'returnValue' property has no effect."),Ed=new lt("W04","Unable to preventDefault on non-cancelable events."),xd=new lt("W05","Unable to preventDefault inside passive event listener invocation."),Rd=new lt("W06","An event listener wasn't added because it has been added already: %o, %o"),Yn=new lt("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),so=new lt("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),qe=class{static get NONE(){return io}static get CAPTURING_PHASE(){return oo}static get AT_TARGET(){return ao}static get BUBBLING_PHASE(){return lo}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=t??{};vs.set(this,{type:String(e),bubbles:!!r.bubbles,cancelable:!!r.cancelable,composed:!!r.composed,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return de(this).type}get target(){return de(this).target}get srcElement(){return de(this).target}get currentTarget(){return de(this).currentTarget}composedPath(){let e=de(this).currentTarget;return e?[e]:[]}get NONE(){return io}get CAPTURING_PHASE(){return oo}get AT_TARGET(){return ao}get BUBBLING_PHASE(){return lo}get eventPhase(){return de(this).dispatchFlag?2:0}stopPropagation(){de(this).stopPropagationFlag=!0}get cancelBubble(){return de(this).stopPropagationFlag}set cancelBubble(e){e?de(this).stopPropagationFlag=!0:Cd.warn()}stopImmediatePropagation(){let e=de(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return de(this).bubbles}get cancelable(){return de(this).cancelable}get returnValue(){return!de(this).canceledFlag}set returnValue(e){e?kd.warn():co(de(this))}preventDefault(){co(de(this))}get defaultPrevented(){return de(this).canceledFlag}get composed(){return de(this).composed}get isTrusted(){return!1}get timeStamp(){return de(this).timeStamp}initEvent(e,t=!1,r=!1){let n=de(this);n.dispatchFlag?Id.warn():vs.set(this,{...n,type:String(e),bubbles:!!t,cancelable:!!r,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}},io=0,oo=1,ao=2,lo=3,vs=new WeakMap;function de(e,t="this"){let r=vs.get(e);return xi(r!=null,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),r}function co(e){e.inPassiveListenerFlag?xd.warn():e.cancelable?e.canceledFlag=!0:Ed.warn()}Object.defineProperty(qe,"NONE",{enumerable:!0}),Object.defineProperty(qe,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(qe,"AT_TARGET",{enumerable:!0}),Object.defineProperty(qe,"BUBBLING_PHASE",{enumerable:!0});var Jn=Object.getOwnPropertyNames(qe.prototype);for(let e=0;e<Jn.length;++e)Jn[e]!=="constructor"&&Object.defineProperty(qe.prototype,Jn[e],{enumerable:!0});Ae!==void 0&&Ae.Event!==void 0&&Object.setPrototypeOf(qe.prototype,Ae.Event.prototype);var yt,uo={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function po(e){let t=Object.keys(uo);for(let r=0;r<t.length;++r){let n=t[r],s=uo[n];Object.defineProperty(e,n,{get:()=>s,configurable:!0,enumerable:!0})}}var pn=class extends qe{static wrap(e){return new(il(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),sl.set(this,{original:e});let t=Object.keys(e);for(let r=0;r<t.length;++r){let n=t[r];n in this||Object.defineProperty(this,n,ol(e,n))}}stopPropagation(){super.stopPropagation();let{original:e}=rt(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=rt(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=rt(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=rt(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=rt(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=rt(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},sl=new WeakMap;function rt(e){let t=sl.get(e);return xi(t!=null,"'this' is expected an Event object, but got",e),t}var hn=new WeakMap;function il(e){let t=Object.getPrototypeOf(e);if(t==null)return pn;let r=hn.get(t);return r==null&&(r=function(n,s){class i extends n{}let a=Object.keys(s);for(let o=0;o<a.length;++o)Object.defineProperty(i.prototype,a[o],ol(s,a[o]));return i}(il(t),t),hn.set(t,r)),r}function ol(e,t){let r=Object.getOwnPropertyDescriptor(e,t);return{get(){let n=rt(this).original,s=n[t];return typeof s=="function"?s.bind(n):s},set(n){rt(this).original[t]=n},configurable:r.configurable,enumerable:r.enumerable}}function al(e){return!(1&~e.flags)}function ho(e){return!(2&~e.flags)}function mo(e){return!(4&~e.flags)}function Ld(e){return!(8&~e.flags)}function Od({callback:e},t,r){try{typeof e=="function"?e.call(t,r):typeof e.handleEvent=="function"&&e.handleEvent(r)}catch(n){(function(s){try{let i=s instanceof Error?s:new Error(nl(s));if(typeof dispatchEvent=="function"&&typeof ErrorEvent=="function")dispatchEvent(new ErrorEvent("error",{error:i,message:i.message}));else if(typeof process<"u"&&typeof process.emit=="function")return void process.emit("uncaughtException",i);console.error(i)}catch{}})(n)}}function ll({listeners:e},t,r){for(let n=0;n<e.length;++n)if(e[n].callback===t&&al(e[n])===r)return n;return-1}function fo(e,t,r){let n=ll(e,t,r);return n!==-1&&cl(e,n)}function cl(e,t,r=!1){let n=e.listeners[t];return function(s){s.flags|=8}(n),n.signal&&n.signal.removeEventListener("abort",n.signalListener),e.cow&&!r?(e.cow=!1,e.listeners=e.listeners.filter((s,i)=>i!==t),!1):(e.listeners.splice(t,1),!0)}hn.set(Object.prototype,pn),Ae!==void 0&&Ae.Event!==void 0&&hn.set(Ae.Event.prototype,pn);var On=class{constructor(){dl.set(this,Object.create(null))}addEventListener(e,t,r){let n=qn(this),{callback:s,capture:i,once:a,passive:o,signal:l,type:c}=function(d,f,w){var h;return go(f),typeof w=="object"&&w!==null?{type:String(d),callback:f??void 0,capture:!!w.capture,passive:!!w.passive,once:!!w.once,signal:(h=w.signal)!==null&&h!==void 0?h:void 0}:{type:String(d),callback:f??void 0,capture:!!w,passive:!1,once:!1,signal:void 0}}(e,t,r);if(s==null||l!=null&&l.aborted)return;let u=function(d,f){var w;return(w=d[f])!==null&&w!==void 0?w:d[f]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(n,c),p=ll(u,s,i);p===-1?function(d,f,w,h,U,m){let g;m&&(g=fo.bind(null,d,f,w),m.addEventListener("abort",g));let b=function(S,M,C,A,D,k){return{callback:S,flags:(M?1:0)|(C?2:0)|(A?4:0),signal:D,signalListener:k}}(f,w,h,U,m,g);d.cow?(d.cow=!1,d.listeners=[...d.listeners,b]):d.listeners.push(b)}(u,s,i,o,a,l):function(d,f,w,h){Rd.warn(al(d)?"capture":"bubble",d.callback),ho(d)!==f&&Yn.warn("passive"),mo(d)!==w&&Yn.warn("once"),d.signal!==h&&Yn.warn("signal")}(u.listeners[p],o,a,l)}removeEventListener(e,t,r){let n=qn(this),{callback:s,capture:i,type:a}=function(l,c,u){return go(c),typeof u=="object"&&u!==null?{type:String(l),callback:c??void 0,capture:!!u.capture}:{type:String(l),callback:c??void 0,capture:!!u}}(e,t,r),o=n[a];s!=null&&o&&fo(o,s,i)}dispatchEvent(e){let t=qn(this)[String(e.type)];if(t==null)return!0;let r=e instanceof qe?e:pn.wrap(e),n=de(r,"event");if(n.dispatchFlag)throw s="This event has been in dispatching.",Ae.DOMException?new Ae.DOMException(s,"InvalidStateError"):(yt==null&&(yt=class ul extends Error{constructor(a){super(a),Error.captureStackTrace&&Error.captureStackTrace(this,ul)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(yt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),po(yt),po(yt.prototype)),new yt(s));var s;if(n.dispatchFlag=!0,n.target=n.currentTarget=this,!n.stopPropagationFlag){let{cow:i,listeners:a}=t;t.cow=!0;for(let o=0;o<a.length;++o){let l=a[o];if(!Ld(l)&&(mo(l)&&cl(t,o,!i)&&(o-=1),n.inPassiveListenerFlag=ho(l),Od(l,this,r),n.inPassiveListenerFlag=!1,n.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return n.target=null,n.currentTarget=null,n.stopImmediatePropagationFlag=!1,n.stopPropagationFlag=!1,n.dispatchFlag=!1,!n.canceledFlag}},dl=new WeakMap;function qn(e,t="this"){let r=dl.get(e);return xi(r!=null,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),r}function go(e){if(typeof e!="function"&&(typeof e!="object"||e===null||typeof e.handleEvent!="function")){if(e==null||typeof e=="object")return void so.warn(e);throw new TypeError(rl(so.message,[e]))}}var Xn=Object.getOwnPropertyNames(On.prototype);for(let e=0;e<Xn.length;++e)Xn[e]!=="constructor"&&Object.defineProperty(On.prototype,Xn[e],{enumerable:!0});Ae!==void 0&&Ae.EventTarget!==void 0&&Object.setPrototypeOf(On.prototype,Ae.EventTarget.prototype);var yo,Ad=((e,t,r)=>(r=e!=null?pd(fd(e)):{},((n,s,i,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of md(s))!gd.call(n,o)&&o!==i&&no(n,o,{get:()=>s[o],enumerable:!(a=hd(s,o))||a.enumerable});return n})(e&&e.__esModule?r:no(r,"default",{value:e,enumerable:!0}),e)))(Sd()),An=512e3,Mn=256,bs=(e,{minChunkSize:t=Mn,maxChunkSize:r=An}={})=>e==null||typeof e=="number"&&e>=256&&e%256==0&&e>=t&&e<=r,Ss=(e,{minChunkSize:t=Mn,maxChunkSize:r=An}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${r}`),Md=class{constructor(e,t={}){var r,n,s;if(this.readableStream=e,!bs(t.defaultChunkSize,t))throw Ss(t.defaultChunkSize,t);this.defaultChunkSize=(r=t.defaultChunkSize)!=null?r:30720,this.minChunkSize=(n=t.minChunkSize)!=null?n:Mn,this.maxChunkSize=(s=t.maxChunkSize)!=null?s:An}get chunkSize(){var e;return(e=this._chunkSize)!=null?e:this.defaultChunkSize}set chunkSize(e){if(!bs(e,this))throw Ss(e,this);this._chunkSize=e}get chunkByteSize(){return 1024*this.chunkSize}async*[Symbol.asyncIterator](){let e,t=this.readableStream.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r){if(e){let i=e;e=void 0,yield i}break}let s=n instanceof Uint8Array?new Blob([n],{type:"application/octet-stream"}):n;for(e=e?new Blob([e,s]):s;e;){if(e.size===this.chunkByteSize){let i=e;e=void 0,yield i;break}if(e.size<this.chunkByteSize)break;{let i=e.slice(0,this.chunkByteSize);e=e.slice(this.chunkByteSize),yield i}}}}finally{if(e){let r=e;e=void 0,yield r}return void t.releaseLock()}}},Ud=[200,201,202,204,308],pl=[408,502,503,504],hl=(e,t)=>!!e&&Ud.includes(e.statusCode),Dd=(e,t)=>t.attemptCount>=t.attempts||!(hl(e)||((r,{retryCodes:n=pl})=>!r||n.includes(r.statusCode))(e,t)),ml=class{static createUpload(e){return new ml(e)}constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.headers=e.headers||{},this.method=e.method||"PUT",this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.retryCodes=e.retryCodes||pl,this.dynamicChunkSize=e.dynamicChunkSize||!1,this.maxFileBytes=1024*(e.maxFileSize||0),this.chunkCount=0,this.attemptCount=0,this.offline=!1,this._paused=!1,this.success=!1,this.nextChunkRangeStart=0,this.chunkedStreamIterable=new Md(this.file.stream(),{...e,defaultChunkSize:e.chunkSize}),this.chunkedStreamIterator=this.chunkedStreamIterable[Symbol.asyncIterator](),this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.eventTarget=new On,this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{!this.offline||(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}get maxChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.maxChunkSize)!=null?t:An}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:Mn}get chunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.chunkSize)!=null?t:30720}set chunkSize(e){this.chunkedStreamIterable.chunkSize=e}get chunkByteSize(){return this.chunkedStreamIterable.chunkByteSize}get totalChunkSize(){return Math.ceil(this.file.size/this.chunkByteSize)}on(e,t){this.eventTarget.addEventListener(e,t)}once(e,t){this.eventTarget.addEventListener(e,t,{once:!0})}off(e,t){this.eventTarget.removeEventListener(e,t)}get paused(){return this._paused}abort(){var e;this.pause(),(e=this.currentXhr)==null||e.abort()}pause(){this._paused=!0}resume(){this._paused&&(this._paused=!1,this.sendChunks())}dispatch(e,t){let r=new CustomEvent(e,{detail:t});this.eventTarget.dispatchEvent(r)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint must be defined as a string or a function that returns a promise");if(!(this.file instanceof File))throw new TypeError("file must be a File object");if(this.headers&&typeof this.headers!="function"&&typeof this.headers!="object")throw new TypeError("headers must be null, an object, or a function that returns an object or a promise");if(!bs(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize}))throw Ss(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize});if(this.maxChunkSize&&(typeof this.maxChunkSize!="number"||this.maxChunkSize<256||this.maxChunkSize%256!=0||this.maxChunkSize<this.chunkSize||this.maxChunkSize<this.minChunkSize))throw new TypeError(`maxChunkSize must be a positive number in multiples of 256, and larger than or equal to both ${this.minChunkSize} and ${this.chunkSize}`);if(this.minChunkSize&&(typeof this.minChunkSize!="number"||this.minChunkSize<256||this.minChunkSize%256!=0||this.minChunkSize>this.chunkSize||this.minChunkSize>this.maxChunkSize))throw new TypeError(`minChunkSize must be a positive number in multiples of 256, and smaller than ${this.chunkSize} and ${this.maxChunkSize}`);if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`file size exceeds maximum (${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("retries must be a positive number");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("delayBeforeAttempt must be a positive number")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(e=>(this.endpointValue=e,this.endpointValue))}xhrPromise(e){let t=r=>{r.upload.onprogress=n=>{var s;let i=this.totalChunks-this.chunkCount,a=(this.file.size-this.nextChunkRangeStart)/this.file.size/i,o=this.nextChunkRangeStart/this.file.size,l=n.loaded/((s=n.total)!=null?s:this.chunkByteSize)*a;this.dispatch("progress",Math.min(100*(o+l),100))}};return new Promise((r,n)=>{this.currentXhr=(0,Ad.default)({...e,beforeSend:t},(s,i)=>(this.currentXhr=void 0,s?n(s):r(i)))})}async sendChunk(e){let t=this.nextChunkRangeStart,r=t+e.size-1,n={...await(typeof this.headers=="function"?this.headers():this.headers),"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${r}/${this.file.size}`};return this.dispatch("attempt",{chunkNumber:this.chunkCount,totalChunks:this.totalChunks,chunkSize:this.chunkSize}),this.xhrPromise({headers:n,url:this.endpointValue,method:this.method,body:e})}async sendChunkWithRetries(e){let t;try{this.attemptCount=this.attemptCount+1,this.lastChunkStart=new Date,t=await this.sendChunk(e)}catch{}let r={retryCodes:this.retryCodes,attemptCount:this.attemptCount,attempts:this.attempts};return hl(t)?(async n=>{var s;let i=(new Date().getTime()-this.lastChunkStart.getTime())/1e3;if(this.dispatch("chunkSuccess",{chunk:this.chunkCount,chunkSize:this.chunkSize,attempts:this.attemptCount,timeInterval:i,response:n}),this.attemptCount=0,this.chunkCount=((s=this.chunkCount)!=null?s:0)+1,this.nextChunkRangeStart=this.nextChunkRangeStart+this.chunkByteSize,this.dynamicChunkSize){let a=this.chunkSize;i<10?a=Math.min(2*this.chunkSize,this.maxChunkSize):i>30&&(a=Math.max(this.chunkSize/2,this.minChunkSize)),this.chunkSize=256*Math.ceil(a/256);let o=(this.file.size-this.nextChunkRangeStart)/this.chunkByteSize;this.totalChunks=Math.ceil(this.chunkCount+o)}return!0})(t):Dd(t,r)?(async n=>(this.dispatch("error",{message:`Server responded with ${n.statusCode}. Stopping upload.`,chunk:this.chunkCount,attempts:this.attemptCount}),!1))(t):(async()=>(this.dispatch("attemptFailure",{message:`An error occured uploading chunk ${this.chunkCount}. ${this.attempts-this.attemptCount} retries left.`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount}),new Promise(n=>{setTimeout(async()=>{if(this._paused||this.offline)return this.pendingChunk=e,void n(!1);let s=await this.sendChunkWithRetries(e);n(s)},1e3*this.delayBeforeAttempt)})))()}async sendChunks(){if(this.pendingChunk&&!this._paused&&!this.offline){let e=this.pendingChunk;this.pendingChunk=void 0;let t=await this.sendChunkWithRetries(e);this.success&&t&&this.dispatch("success")}for(;!(this.success||this._paused||this.offline);){let{value:e,done:t}=await this.chunkedStreamIterator.next(),r=!e&&t;if(e&&(r=await this.sendChunkWithRetries(e)),this.success=!!t,this.success&&r&&this.dispatch("success"),!r)return}}},Td=ml.createUpload,Pd=Object.defineProperty,x=(e,t,r)=>((n,s,i)=>s in n?Pd(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),_d=Object.defineProperty,wo=(e,t,r)=>((n,s,i)=>s in n?_d(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),he=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(he||{});const vo={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},bo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},vr={};function Ri(e){if(vr[e])return vr[e];const t=globalThis[e],r=t.prototype,n=e in vo?vo[e]:void 0,s=!!(n&&n.every(o=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,o))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in bo?bo[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return vr[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?vr[e]=c:r}catch{return r}}const Zn={};function Qe(e,t,r){var n;const s=`${e}.${String(r)}`;if(Zn[s])return Zn[s].call(t);const i=Ri(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(Zn[s]=a,a.call(t)):t[r]}const Kn={};function So(e,t,r){const n=`${e}.${String(r)}`;if(Kn[n])return Kn[n].bind(t);const s=Ri(e)[r];return typeof s!="function"?t[r]:(Kn[n]=s,s.bind(t))}const ge={childNodes:function(e){return Qe("Node",e,"childNodes")},parentNode:function(e){return Qe("Node",e,"parentNode")},parentElement:function(e){return Qe("Node",e,"parentElement")},textContent:function(e){return Qe("Node",e,"textContent")},contains:function(e,t){return So("Node",e,"contains")(t)},getRootNode:function(e){return So("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qe("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qe("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qe("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qe("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ri("MutationObserver").constructor}};function fl(e){return e.nodeType===e.ELEMENT_NODE}function Jt(e){const t=e&&"host"in e&&"mode"in e&&ge.host(e)||null;return!!(t&&"shadowRoot"in t&&ge.shadowRoot(t)===e)}function qt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function $r(e){try{const r=e.rules||e.cssRules;return r?((t=Array.from(r,s=>gl(s,e.href)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch{return null}var t}function gl(e,t){if(function(r){return"styleSheet"in r}(e)){let r;try{r=$r(e.styleSheet)||function(n){const{cssText:s}=n;if(s.split('"').length<3)return s;const i=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?i.push("layer"):n.layerName&&i.push(`layer(${n.layerName})`),n.supportsText&&i.push(`supports(${n.supportsText})`),n.media.length&&i.push(n.media.mediaText),i.join(" ")+";"}(e)}catch{r=e.cssText}return e.styleSheet.href?mn(r,e.styleSheet.href):r}{let r=e.cssText;return function(n){return"selectorText"in n}(e)&&e.selectorText.includes(":")&&(r=function(n){const s=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(s,"$1\\$2")}(r)),t?mn(r,t):r}}class yl{constructor(){wo(this,"idNodeMap",new Map),wo(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Li({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let a=s||"";const o=n&&pt(n);return(t[r.toLowerCase()]||o&&t[o])&&(a=i?i(a,e):"*".repeat(a.length)),a}function pt(e){return e.toLowerCase()}const Io="__rrweb_original__";function Oi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?pt(t):null}function Co(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(n==null?void 0:n[1])??null}const Nd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Fd=/^(?:[a-z+]+:)?\/\//i,Bd=/^www\..*/i,zd=/^(data:)([^,]*),(.*)/i;function mn(e,t){return(e||"").replace(Nd,(r,n,s,i,a,o)=>{const l=s||a||o,c=n||i||"";if(!l)return r;if(Fd.test(l)||Bd.test(l))return`url(${c}${l}${c})`;if(zd.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${function(d){let f="";return f=d.indexOf("//")>-1?d.split("/").slice(0,3).join("/"):d.split("/")[0],f=f.split("?")[0],f}(t)+l}${c})`;const u=t.split("/"),p=l.split("/");u.pop();for(const d of p)d!=="."&&(d===".."?u.pop():u.push(d));return`url(${c}${u.join("/")}${c})`})}let jd=1;const Wd=new RegExp("[^a-z0-9-_:]");function wl(){return jd++}let wt,ko;const Vd=/^[^ \t\n\r\u000c]+/,Gd=/^[, \t\n\r\u000c]+/,Eo=new WeakMap;function Pt(e,t){return t&&t.trim()!==""?Ai(e,t):t}function Hd(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ai(e,t){let r=Eo.get(e);if(r||(r=e.createElement("a"),Eo.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function vl(e,t,r,n){return n&&(r==="src"||r==="href"&&(t!=="use"||n[0]!=="#")||r==="xlink:href"&&n[0]!=="#"?Pt(e,n):r!=="background"||t!=="table"&&t!=="td"&&t!=="th"?r==="srcset"?function(s,i){if(i.trim()==="")return i;let a=0;function o(c){let u;const p=c.exec(i.substring(a));return p?(u=p[0],a+=u.length,u):""}const l=[];for(;o(Gd),!(a>=i.length);){let c=o(Vd);if(c.slice(-1)===",")c=Pt(s,c.substring(0,c.length-1)),l.push(c);else{let u="";c=Pt(s,c);let p=!1;for(;;){const d=i.charAt(a);if(d===""){l.push((c+u).trim());break}if(p)d===")"&&(p=!1);else{if(d===","){a+=1,l.push((c+u).trim());break}d==="("&&(p=!0)}u+=d,a+=1}}}return l.join(", ")}(e,n):r==="style"?mn(n,Ai(e)):t==="object"&&r==="data"?Pt(e,n):n:Pt(e,n))}function bl(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function fn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&fn(ge.parentNode(e),t,r);for(let n=e.classList.length;n--;){const s=e.classList[n];if(t.test(s))return!0}return!!r&&fn(ge.parentNode(e),t,r)}function Sl(e,t,r,n){let s;if(fl(e)){if(s=e,!ge.childNodes(s).length)return!1}else{if(ge.parentElement(e)===null)return!1;s=ge.parentElement(e)}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(fn(s,t,n))return!0;if(r){if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch{}return!1}function $d(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:a,inlineStylesheet:o,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:w,newlyAddedElement:h=!1}=t,U=function(m,g){if(!g.hasNode(m))return;const b=g.getId(m);return b===1?void 0:b}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:he.Document,childNodes:[],compatMode:e.compatMode}:{type:he.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:he.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:U};case e.ELEMENT_NODE:return function(m,g){const{doc:b,blockClass:S,blockSelector:M,inlineStylesheet:C,maskInputOptions:A={},maskInputFn:D,dataURLOptions:k={},inlineImages:L,recordCanvas:E,keepIframeSrcFn:I,newlyAddedElement:P=!1,rootId:_}=g,v=function(R,O,J){try{if(typeof O=="string"){if(R.classList.contains(O))return!0}else for(let Y=R.classList.length;Y--;){const ue=R.classList[Y];if(O.test(ue))return!0}if(J)return R.matches(J)}catch{}return!1}(m,S,M),y=function(R){if(R instanceof HTMLFormElement)return"form";const O=pt(R.tagName);return Wd.test(O)?"div":O}(m);let T={};const B=m.attributes.length;for(let R=0;R<B;R++){const O=m.attributes[R];bl(y,O.name,O.value)||(T[O.name]=vl(b,y,pt(O.name),O.value))}if(y==="link"&&C){const R=Array.from(b.styleSheets).find(J=>J.href===m.href);let O=null;R&&(O=$r(R)),O&&(delete T.rel,delete T.href,T._cssText=O)}if(y==="style"&&m.sheet&&!(m.innerText||ge.textContent(m)||"").trim().length){const R=$r(m.sheet);R&&(T._cssText=R)}if(y==="input"||y==="textarea"||y==="select"){const R=m.value,O=m.checked;T.type!=="radio"&&T.type!=="checkbox"&&T.type!=="submit"&&T.type!=="button"&&R?T.value=Li({element:m,type:Oi(m),tagName:y,value:R,maskInputOptions:A,maskInputFn:D}):O&&(T.checked=O)}if(y==="option"&&(m.selected&&!A.select?T.selected=!0:delete T.selected),y==="dialog"&&m.open&&(T.rr_open_mode=m.matches("dialog:modal")?"modal":"non-modal"),y==="canvas"&&E){if(m.__context==="2d")(function(R){const O=R.getContext("2d");if(!O)return!0;for(let J=0;J<R.width;J+=50)for(let Y=0;Y<R.height;Y+=50){const ue=O.getImageData,Te=Io in ue?ue[Io]:ue;if(new Uint32Array(Te.call(O,J,Y,Math.min(50,R.width-J),Math.min(50,R.height-Y)).data.buffer).some(Se=>Se!==0))return!1}return!0})(m)||(T.rr_dataURL=m.toDataURL(k.type,k.quality));else if(!("__context"in m)){const R=m.toDataURL(k.type,k.quality),O=b.createElement("canvas");O.width=m.width,O.height=m.height,R!==O.toDataURL(k.type,k.quality)&&(T.rr_dataURL=R)}}if(y==="img"&&L){wt||(wt=b.createElement("canvas"),ko=wt.getContext("2d"));const R=m,O=R.currentSrc||R.getAttribute("src")||"<unknown-src>",J=R.crossOrigin,Y=()=>{R.removeEventListener("load",Y);try{wt.width=R.naturalWidth,wt.height=R.naturalHeight,ko.drawImage(R,0,0),T.rr_dataURL=wt.toDataURL(k.type,k.quality)}catch(ue){if(R.crossOrigin!=="anonymous")return R.crossOrigin="anonymous",void(R.complete&&R.naturalWidth!==0?Y():R.addEventListener("load",Y));console.warn(`Cannot inline img src=${O}! Error: ${ue}`)}R.crossOrigin==="anonymous"&&(J?T.crossOrigin=J:R.removeAttribute("crossorigin"))};R.complete&&R.naturalWidth!==0?Y():R.addEventListener("load",Y)}if(y==="audio"||y==="video"){const R=T;R.rr_mediaState=m.paused?"paused":"played",R.rr_mediaCurrentTime=m.currentTime,R.rr_mediaPlaybackRate=m.playbackRate,R.rr_mediaMuted=m.muted,R.rr_mediaLoop=m.loop,R.rr_mediaVolume=m.volume}if(P||(m.scrollLeft&&(T.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(T.rr_scrollTop=m.scrollTop)),v){const{width:R,height:O}=m.getBoundingClientRect();T={class:T.class,rr_width:`${R}px`,rr_height:`${O}px`}}y!=="iframe"||I(T.src)||(m.contentDocument||(T.rr_src=T.src),delete T.src);let j;try{customElements.get(y)&&(j=!0)}catch{}return{type:he.Element,tagName:y,attributes:T,childNodes:[],isSVG:Hd(m)||void 0,needBlock:v,rootId:_,isCustom:j}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:d,recordCanvas:f,keepIframeSrcFn:w,newlyAddedElement:h,rootId:U});case e.TEXT_NODE:return function(m,g){var b;const{needsMask:S,maskTextFn:M,rootId:C}=g,A=ge.parentNode(m),D=A&&A.tagName;let k=ge.textContent(m);const L=D==="STYLE"||void 0,E=D==="SCRIPT"||void 0;if(L&&k){try{m.nextSibling||m.previousSibling||(b=A.sheet)!=null&&b.cssRules&&(k=$r(A.sheet))}catch(I){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${I}`,m)}k=mn(k,Ai(g.doc))}return E&&(k="SCRIPT_PLACEHOLDER"),!L&&!E&&k&&S&&(k=M?M(k,ge.parentElement(m)):k.replace(/[\S]/g,"*")),{type:he.Text,textContent:k||"",isStyle:L,rootId:C}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:U});case e.CDATA_SECTION_NODE:return{type:he.CDATA,textContent:"",rootId:U};case e.COMMENT_NODE:return{type:he.Comment,textContent:ge.textContent(e)||"",rootId:U};default:return!1}}function ee(e){return e==null?"":e.toLowerCase()}function Ct(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:w={},inlineImages:h=!1,recordCanvas:U=!1,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:A=!1}=t;let{needsMask:D}=t,{preserveWhiteSpace:k=!0}=t;D||(D=Sl(e,a,o,D===void 0));const L=$d(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:D,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,dataURLOptions:w,inlineImages:h,recordCanvas:U,keepIframeSrcFn:C,newlyAddedElement:A});if(!L)return console.warn(e,"not serialized"),null;let E;E=n.hasNode(e)?n.getId(e):!function(v,y){return!!(y.comment&&v.type===he.Comment||v.type===he.Element&&(y.script&&(v.tagName==="script"||v.tagName==="link"&&(v.attributes.rel==="preload"||v.attributes.rel==="modulepreload")&&v.attributes.as==="script"||v.tagName==="link"&&v.attributes.rel==="prefetch"&&typeof v.attributes.href=="string"&&Co(v.attributes.href)==="js")||y.headFavicon&&(v.tagName==="link"&&v.attributes.rel==="shortcut icon"||v.tagName==="meta"&&(ee(v.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(v.attributes.name)==="application-name"||ee(v.attributes.rel)==="icon"||ee(v.attributes.rel)==="apple-touch-icon"||ee(v.attributes.rel)==="shortcut icon"))||v.tagName==="meta"&&(y.headMetaDescKeywords&&ee(v.attributes.name).match(/^description|keywords$/)||y.headMetaSocial&&(ee(v.attributes.property).match(/^(og|twitter|fb):/)||ee(v.attributes.name).match(/^(og|twitter):/)||ee(v.attributes.name)==="pinterest")||y.headMetaRobots&&(ee(v.attributes.name)==="robots"||ee(v.attributes.name)==="googlebot"||ee(v.attributes.name)==="bingbot")||y.headMetaHttpEquiv&&v.attributes["http-equiv"]!==void 0||y.headMetaAuthorship&&(ee(v.attributes.name)==="author"||ee(v.attributes.name)==="generator"||ee(v.attributes.name)==="framework"||ee(v.attributes.name)==="publisher"||ee(v.attributes.name)==="progid"||ee(v.attributes.property).match(/^article:/)||ee(v.attributes.property).match(/^product:/))||y.headMetaVerification&&(ee(v.attributes.name)==="google-site-verification"||ee(v.attributes.name)==="yandex-verification"||ee(v.attributes.name)==="csrf-token"||ee(v.attributes.name)==="p:domain_verify"||ee(v.attributes.name)==="verify-v1"||ee(v.attributes.name)==="verification"||ee(v.attributes.name)==="shopify-checkout-api-token"))))}(L,f)&&(k||L.type!==he.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?wl():-2;const I=Object.assign(L,{id:E});if(n.add(e,I),E===-2)return null;m&&m(e);let P=!l;if(I.type===he.Element){P=P&&!I.needBlock,delete I.needBlock;const v=ge.shadowRoot(e);v&&qt(v)&&(I.isShadowHost=!0)}if((I.type===he.Document||I.type===he.Element)&&P){f.headWhitespace&&I.type===he.Element&&I.tagName==="head"&&(k=!1);const v={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:D,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:w,inlineImages:h,recordCanvas:U,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:M,keepIframeSrcFn:C};if(!(I.type===he.Element&&I.tagName==="textarea"&&I.attributes.value!==void 0))for(const T of Array.from(ge.childNodes(e))){const B=Ct(T,v);B&&I.childNodes.push(B)}let y=null;if(fl(e)&&(y=ge.shadowRoot(e)))for(const T of Array.from(ge.childNodes(y))){const B=Ct(T,v);B&&(qt(y)&&(B.isShadow=!0),I.childNodes.push(B))}}const _=ge.parentNode(e);return _&&Jt(_)&&qt(_)&&(I.isShadow=!0),I.type===he.Element&&I.tagName==="iframe"&&function(v,y,T){const B=v.contentWindow;if(!B)return;let j,R=!1;try{j=B.document.readyState}catch{return}if(j!=="complete"){const J=setTimeout(()=>{R||(y(),R=!0)},T);return void v.addEventListener("load",()=>{clearTimeout(J),R=!0,y()})}const O="about:blank";if(B.location.href!==O||v.src===O||v.src==="")return setTimeout(y,0),v.addEventListener("load",y);v.addEventListener("load",y)}(e,()=>{const v=e.contentDocument;if(v&&g){const y=Ct(v,{doc:v,mirror:n,blockClass:s,blockSelector:i,needsMask:D,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:w,inlineImages:h,recordCanvas:U,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:M,keepIframeSrcFn:C});y&&g(e,y)}},b),I.type===he.Element&&I.tagName==="link"&&typeof I.attributes.rel=="string"&&(I.attributes.rel==="stylesheet"||I.attributes.rel==="preload"&&typeof I.attributes.href=="string"&&Co(I.attributes.href)==="css")&&function(v,y,T){let B,j=!1;try{B=v.sheet}catch{return}if(B)return;const R=setTimeout(()=>{j||(y(),j=!0)},T);v.addEventListener("load",()=>{clearTimeout(R),j=!0,y()})}(e,()=>{if(S){const v=Ct(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:D,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:w,inlineImages:h,recordCanvas:U,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:M,keepIframeSrcFn:C});v&&S(e,v)}},M),I}function Yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jd(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var Is={exports:{}},re=String,xo=function(){return{isColorSupported:!1,reset:re,bold:re,dim:re,italic:re,underline:re,inverse:re,hidden:re,strikethrough:re,black:re,red:re,green:re,yellow:re,blue:re,magenta:re,cyan:re,white:re,gray:re,bgBlack:re,bgRed:re,bgGreen:re,bgYellow:re,bgBlue:re,bgMagenta:re,bgCyan:re,bgWhite:re}};Is.exports=xo(),Is.exports.createColors=xo;var qd=Is.exports;const Ue=Jd(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ro=qd,Lo=Ue,Cs=class Il extends Error{constructor(t,r,n,s,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),a&&(this.plugin=a),r!==void 0&&n!==void 0&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Il)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=Ro.isColorSupported),Lo&&t&&(r=Lo(r));let n,s,i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),l=String(o).length;if(t){let{bold:c,gray:u,red:p}=Ro.createColors(!0);n=d=>c(p(d)),s=d=>u(d)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let p=a+1+u,d=" "+(" "+p).slice(-l)+" | ";if(p===this.line){let f=s(d.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(d)+c+`
|
|
4
|
+
`+f+n("^")}return" "+s(d)+c}).join(`
|
|
5
|
+
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
6
|
+
|
|
7
|
+
`+t+`
|
|
8
|
+
`),this.name+": "+this.message+t}};var Mi=Cs;Cs.default=Cs;var rr={};rr.isClean=Symbol("isClean"),rr.my=Symbol("my");const Oo={after:`
|
|
9
|
+
`,beforeClose:`
|
|
10
|
+
`,beforeComment:`
|
|
11
|
+
`,beforeDecl:`
|
|
12
|
+
`,beforeOpen:" ",beforeRule:`
|
|
13
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ks=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(e.raws.afterName!==void 0?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r=e.type==="decl"?this.raw(e,null,"beforeDecl"):e.type==="comment"?this.raw(e,null,"beforeComment"):t==="before"?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&n.type!=="root";)s+=1,n=n.parent;if(r.includes(`
|
|
14
|
+
`)){let i=this.raw(e,null,"indent");if(i.length)for(let a=0;a<s;a++)r+=i}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],n!==void 0))return n;let s=e.parent;if(r==="before"&&(!s||s.type==="root"&&s.first===e||s&&s.type==="document"))return"";if(!s)return Oo[r];let i=e.root();if(i.rawCache||(i.rawCache={}),i.rawCache[r]!==void 0)return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let o="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[o]?n=this[o](i,e):i.walk(l=>{if(n=l.raws[t],n!==void 0)return!1})}var a;return n===void 0&&(n=Oo[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&r.raws.after!==void 0)return t=r.raws.after,t.includes(`
|
|
15
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
|
|
16
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
|
|
17
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?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,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&r.raws.before!==void 0)return t=r.raws.before,t.includes(`
|
|
18
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(r.raws.between!==void 0)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,t!==void 0))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&&r.raws.before!==void 0){let s=r.raws.before.split(`
|
|
19
|
+
`);return t=s[s.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,t!==void 0))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Cl=ks;ks.default=ks;let Xd=Cl;function Es(e,t){new Xd(t).stringify(e)}var Un=Es;Es.default=Es;let{isClean:br,my:Zd}=rr,Kd=Mi,Qd=Cl,ep=Un;function xs(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let s=e[n],i=typeof s;n==="parent"&&i==="object"?t&&(r[n]=t):n==="source"?r[n]=s:Array.isArray(s)?r[n]=s.map(a=>xs(a,r)):(i==="object"&&s!==null&&(s=xs(s)),r[n]=s)}return r}let Rs=class{constructor(e={}){this.raws={},this[br]=!1,this[Zd]=!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=xs(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 Kd(e)}getProxyProcessor(){return{get:(e,t)=>t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,t!=="prop"&&t!=="value"&&t!=="name"&&t!=="params"&&t!=="important"&&t!=="text"||e.markDirty()),!0)}}markDirty(){if(this[br]){this[br]=!1;let e=this;for(;e=e.parent;)e[br]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
|
|
20
|
+
`?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);s!==-1&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}: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 Qd().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 s=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let a=this[i];if(Array.isArray(a))r[i]=a.map(o=>typeof o=="object"&&o.toJSON?o.toJSON(null,t):o);else if(typeof a=="object"&&a.toJSON)r[i]=a.toJSON(null,t);else if(i==="source"){let o=t.get(a.input);o==null&&(o=s,t.set(a.input,s),s++),r[i]={end:a.end,inputId:o,start:a.start}}else r[i]=a}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=ep){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Dn=Rs;Rs.default=Rs;let tp=Dn,Ls=class extends tp{constructor(e){e&&e.value!==void 0&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Tn=Ls;Ls.default=Ls;var rp={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Ao,SourceMapGenerator:Mo}=Ue,{existsSync:np,readFileSync:sp}=Ue,{dirname:Qn,join:ip}=Ue,Os=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=Qn(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Ao(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e=="object"&&(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=Qn(e),np(e))return this.mapFile=e,sp(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"){if(t instanceof Ao)return Mo.fromSourceMap(t).toString();if(t instanceof Mo)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=ip(Qn(e),r)),this.loadFile(r)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var kl=Os;Os.default=Os;let{SourceMapConsumer:op,SourceMapGenerator:ap}=Ue,{fileURLToPath:Uo,pathToFileURL:Sr}=Ue,{isAbsolute:As,resolve:Ms}=Ue,{nanoid:lp}=rp,es=Ue,Do=Mi,cp=kl,ts=Symbol("fromOffsetCache"),up=!!(op&&ap),To=!!(Ms&&As),Yr=class{constructor(e,t={}){if(e==null||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]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!To||/^\w+:\/\//.test(t.from)||As(t.from)?this.file=t.from:this.file=Ms(t.from)),To&&up){let r=new cp(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 "+lp(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,a;if(t&&typeof t=="object"){let l=t,c=r;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);t=u.line,r=u.col}else t=l.line,r=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);i=u.line,a=u.col}else i=c.line,a=c.column}else if(!r){let l=this.fromOffset(t);t=l.line,r=l.col}let o=this.origin(t,r,i,a);return s=o?new Do(e,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,n.plugin):new Do(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:a,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(Sr&&(s.input.url=Sr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[ts])r=this[ts];else{let s=this.css.split(`
|
|
21
|
+
`);r=new Array(s.length);let i=0;for(let a=0,o=s.length;a<o;a++)r[a]=i,i+=s[a].length+1;this[ts]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let s,i=r.length-2;for(;n<i;)if(s=n+(i-n>>1),e<r[s])i=s-1;else{if(!(e>=r[s+1])){n=s;break}n=s+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ms(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;typeof r=="number"&&(s=a.originalPositionFor({column:n,line:r})),i=As(o.source)?Sr(o.source):new URL(o.source,this.map.consumer().sourceRoot||Sr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!Uo)throw new Error("file: protocol is not available in this PostCSS build");l.file=Uo(i)}let c=a.sourceContentFor(o.source);return c&&(l.source=c),l}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}};var Pn=Yr;Yr.default=Yr,es&&es.registerInput&&es.registerInput(Yr);let{SourceMapConsumer:El,SourceMapGenerator:Jr}=Ue,{dirname:qr,relative:xl,resolve:Rl,sep:Ll}=Ue,{pathToFileURL:Po}=Ue,dp=Pn,pp=!!(El&&Jr),hp=!!(qr&&Rl&&xl&&Ll);var Ol=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t=`
|
|
22
|
+
`;this.css.includes(`\r
|
|
23
|
+
`)&&(t=`\r
|
|
24
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||qr(e.file);this.mapOpts.sourcesContent===!1?(t=new El(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}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(),hp&&pp&&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=Jr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Jr({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 Jr({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(a,o,l)=>{if(this.css+=a,o&&l!=="end"&&(i.generated.line=r,i.generated.column=n-1,o.source&&o.source.start?(i.source=this.sourcePath(o),i.original.line=o.source.start.line,i.original.column=o.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=a.match(/\n/g),e?(r+=e.length,t=a.lastIndexOf(`
|
|
25
|
+
`),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?qr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=qr(Rl(r,this.mapOpts.annotation)));let n=xl(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 dp(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(Po){let r=Po(e).toString();return this.memoizedFileURLs.set(e,r),r}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;Ll==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let mp=Dn,Us=class extends mp{constructor(e){super(e),this.type="comment"}};var _n=Us;Us.default=Us;let Al,Ui,Di,Ml,{isClean:Ul,my:Dl}=rr,Tl=Tn,Pl=_n,fp=Dn;function _l(e){return e.map(t=>(t.nodes&&(t.nodes=_l(t.nodes)),delete t.source,t))}function Nl(e){if(e[Ul]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Nl(t)}let Xe=class Fl extends fp{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let s of n)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r,n,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],n=t(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,r)=>r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(s=>typeof s=="function"?(i,a)=>s(i.toProxy(),a):s)):r==="every"||r==="some"?n=>t[r]((s,...i)=>n(s.toProxy(),...i)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r],set:(t,r,n)=>(t[r]===n||(t[r]=n,r!=="name"&&r!=="params"&&r!=="selector"||t.markDirty()),!0)}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n,s=this.index(t),i=this.normalize(r,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let a of i)this.proxyOf.nodes.splice(s+1,0,a);for(let a in this.indexes)n=this.indexes[a],s<n&&(this.indexes[a]=n+i.length);return this.markDirty(),this}insertBefore(t,r){let n,s=this.index(t),i=s===0&&"prepend",a=this.normalize(r,this.proxyOf.nodes[s],i).reverse();s=this.index(t);for(let o of a)this.proxyOf.nodes.splice(s,0,o);for(let o in this.indexes)n=this.indexes[o],s<=n&&(this.indexes[o]=n+a.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=_l(Al(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Tl(t)]}else if(t.selector)t=[new Ui(t)];else if(t.name)t=[new Di(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Pl(t)]}return t.map(n=>(n[Dl]||Fl.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[Ul]&&Nl(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}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]}};Xe.registerParse=e=>{Al=e},Xe.registerRule=e=>{Ui=e},Xe.registerAtRule=e=>{Di=e},Xe.registerRoot=e=>{Ml=e};var mt=Xe;Xe.default=Xe,Xe.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Di.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ui.prototype):e.type==="decl"?Object.setPrototypeOf(e,Tl.prototype):e.type==="comment"?Object.setPrototypeOf(e,Pl.prototype):e.type==="root"&&Object.setPrototypeOf(e,Ml.prototype),e[Dl]=!0,e.nodes&&e.nodes.forEach(t=>{Xe.rebuild(t)})};let Bl,zl,gp=mt,nr=class extends gp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Bl(new zl,this,e).stringify()}};nr.registerLazyResult=e=>{Bl=e},nr.registerProcessor=e=>{zl=e};var Ti=nr;nr.default=nr;let Ds=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}};var jl=Ds;Ds.default=Ds;let yp=jl,Ts=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 yp(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Pi=Ts;Ts.default=Ts;const rs=39,_o=34,Ir=92,No=47,Cr=10,_t=32,kr=12,Er=9,xr=13,wp=91,vp=93,bp=40,Sp=41,Ip=123,Cp=125,kp=59,Ep=42,xp=58,Rp=64,Rr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Lp=/.[\r\n"'(/\\]/,Fo=/[\da-f]/i;let Wl=mt,Xr=class extends Wl{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var _i=Xr;Xr.default=Xr,Wl.registerAtRule(Xr);let Vl,Gl,Hl=mt,Rt=class extends Hl{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 s of n)s.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 Vl(new Gl,this,e).stringify()}};Rt.registerLazyResult=e=>{Vl=e},Rt.registerProcessor=e=>{Gl=e};var mr=Rt;Rt.default=Rt,Hl.registerRoot(Rt);let sr={comma:e=>sr.split(e,[","],!0),space:e=>sr.split(e,[" ",`
|
|
26
|
+
`," "]),split(e,t,r){let n=[],s="",i=!1,a=0,o=!1,l="",c=!1;for(let u of e)c?c=!1:u==="\\"?c=!0:o?u===l&&(o=!1):u==='"'||u==="'"?(o=!0,l=u):u==="("?a+=1:u===")"?a>0&&(a-=1):a===0&&t.includes(u)&&(i=!0),i?(s!==""&&n.push(s.trim()),s="",i=!1):s+=u;return(r||s!=="")&&n.push(s.trim()),n}};var $l=sr;sr.default=sr;let Yl=mt,Op=$l,Zr=class extends Yl{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Op.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Ni=Zr;Zr.default=Zr,Yl.registerRule(Zr);let Ap=Tn,Mp=function(e,t={}){let r,n,s,i,a,o,l,c,u,p,d=e.css.valueOf(),f=t.ignoreErrors,w=d.length,h=0,U=[],m=[];function g(b){throw e.error("Unclosed "+b,h)}return{back:function(b){m.push(b)},endOfFile:function(){return m.length===0&&h>=w},nextToken:function(b){if(m.length)return m.pop();if(h>=w)return;let S=!!b&&b.ignoreUnclosed;switch(r=d.charCodeAt(h),r){case Cr:case _t:case Er:case xr:case kr:n=h;do n+=1,r=d.charCodeAt(n);while(r===_t||r===Cr||r===Er||r===xr||r===kr);p=["space",d.slice(h,n)],h=n-1;break;case wp:case vp:case Ip:case Cp:case xp:case kp:case Sp:{let M=String.fromCharCode(r);p=[M,M,h];break}case bp:if(c=U.length?U.pop()[1]:"",u=d.charCodeAt(h+1),c==="url"&&u!==rs&&u!==_o&&u!==_t&&u!==Cr&&u!==Er&&u!==kr&&u!==xr){n=h;do{if(o=!1,n=d.indexOf(")",n+1),n===-1){if(f||S){n=h;break}g("bracket")}for(l=n;d.charCodeAt(l-1)===Ir;)l-=1,o=!o}while(o);p=["brackets",d.slice(h,n+1),h,n],h=n}else n=d.indexOf(")",h+1),i=d.slice(h,n+1),n===-1||Lp.test(i)?p=["(","(",h]:(p=["brackets",i,h,n],h=n);break;case rs:case _o:s=r===rs?"'":'"',n=h;do{if(o=!1,n=d.indexOf(s,n+1),n===-1){if(f||S){n=h+1;break}g("string")}for(l=n;d.charCodeAt(l-1)===Ir;)l-=1,o=!o}while(o);p=["string",d.slice(h,n+1),h,n],h=n;break;case Rp:Rr.lastIndex=h+1,Rr.test(d),n=Rr.lastIndex===0?d.length-1:Rr.lastIndex-2,p=["at-word",d.slice(h,n+1),h,n],h=n;break;case Ir:for(n=h,a=!0;d.charCodeAt(n+1)===Ir;)n+=1,a=!a;if(r=d.charCodeAt(n+1),a&&r!==No&&r!==_t&&r!==Cr&&r!==Er&&r!==xr&&r!==kr&&(n+=1,Fo.test(d.charAt(n)))){for(;Fo.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===_t&&(n+=1)}p=["word",d.slice(h,n+1),h,n],h=n;break;default:r===No&&d.charCodeAt(h+1)===Ep?(n=d.indexOf("*/",h+2)+1,n===0&&(f||S?n=d.length:g("comment")),p=["comment",d.slice(h,n+1),h,n],h=n):(Lr.lastIndex=h+1,Lr.test(d),n=Lr.lastIndex===0?d.length-1:Lr.lastIndex-2,p=["word",d.slice(h,n+1),h,n],U.push(p),h=n)}return h++,p},position:function(){return h}}},Up=_n,Dp=_i,Tp=mr,Bo=Ni;const zo={empty:!0,space:!0};var Pp=class{constructor(e){this.input=e,this.root=new Tp,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Dp;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,a=!1,o=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],t==="("||t==="["?l.push(t==="("?")":"]"):t==="{"&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),l.length===0){if(t===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if(t==="{"){a=!0;break}if(t==="}"){if(o.length>0){for(n=o.length-1,r=o[n];r&&r[0]==="space";)r=o[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}o.push(e)}else o.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(o),o.length?(s.raws.afterName=this.spacesAndCommentsFromStart(o),this.raw(s,"params",o),i&&(e=o[o.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),a&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],r[0]==="space"||(n+=1,n!==2));s--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,a]of e.entries()){if(t=a,r=t[0],r==="("&&(s+=1),r===")"&&(s-=1),s===0&&r===":"){if(n){if(n[0]==="word"&&n[1]==="progid")continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Up;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=Mp(this.input)}decl(e,t){let r=new Ap;this.init(r,e[0][2]);let n,s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(o){for(let l=o.length-1;l>=0;l--){let c=o[l],u=c[3]||c[2];if(u)return u}}(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 o=e[0][0];if(o===":"||o==="space"||o==="comment")break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}r.prop[0]!=="_"&&r.prop[0]!=="*"||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],i==="space"||i==="comment");)a.push(e.shift());this.precheckMissedSemicolon(e);for(let o=e.length-1;o>=0;o--){if(n=e[o],n[1].toLowerCase()==="!important"){r.important=!0;let l=this.stringFrom(e,o);l=this.spacesFromEnd(e)+l,l!==" !important"&&(r.raws.important=l);break}if(n[1].toLowerCase()==="important"){let l=e.slice(0),c="";for(let u=o;u>0;u--){let p=l[u][0];if(c.trim().indexOf("!")===0&&p!=="space")break;c=l.pop()[1]+c}c.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=c,e=l)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(r.raws.between+=a.map(o=>o[1]).join(""),a=[]),this.raw(r,"value",a.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 Bo;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,s=null,i=[],a=e[1].startsWith("--"),o=[],l=e;for(;l;){if(r=l[0],o.push(l),r==="("||r==="[")s||(s=l),i.push(r==="("?")":"]");else if(a&&n&&r==="{")s||(s=l),i.push("}");else if(i.length===0){if(r===";"){if(n)return void this.decl(o,a);break}if(r==="{")return void this.rule(o);if(r==="}"){this.tokenizer.back(o.pop()),t=!0;break}r===":"&&(n=!0)}else r===i[i.length-1]&&(i.pop(),i.length===0&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!a)for(;o.length&&(l=o[o.length-1][0],l==="space"||l==="comment");)this.tokenizer.back(o.pop());this.decl(o,a)}else this.unknownWord(o)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,i,a,o,l=r.length,c="",u=!0;for(let p=0;p<l;p+=1)s=r[p],i=s[0],i!=="space"||p!==l-1||n?i==="comment"?(o=r[p-1]?r[p-1][0]:"empty",a=r[p+1]?r[p+1][0]:"empty",zo[o]||zo[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let p=r.reduce((d,f)=>d+f[1],"");e.raws[t]={raw:p,value:c}}e[t]=c}rule(e){e.pop();let t=new Bo;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})}};let _p=mt,Np=Pp,Fp=Pn;function Kr(e,t){let r=new Fp(e,t),n=new Np(r);try{n.parse()}catch(s){throw s}return n.root}var Fi=Kr;Kr.default=Kr,_p.registerParse(Kr);let{isClean:_e,my:Bp}=rr,zp=Ol,jp=Un,Wp=mt,Vp=Ti,jo=Pi,Gp=Fi,Hp=mr;const $p={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Yp={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},Jp={Once:!0,postcssPlugin:!0,prepare:!0};function Nt(e){return typeof e=="object"&&typeof e.then=="function"}function Jl(e){let t=!1,r=$p[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Wo(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:Jl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ps(e){return e[_e]=!1,e.nodes&&e.nodes.forEach(t=>Ps(t)),e}let _s={},kt=class ql{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,typeof r!="object"||r===null||r.type!=="root"&&r.type!=="document")if(r instanceof ql||r instanceof jo)s=Ps(r.root),r.map&&(n.map===void 0&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let i=Gp;n.syntax&&(i=n.syntax.parse),n.parser&&(i=n.parser),i.parse&&(i=i.parse);try{s=i(r,n)}catch(a){this.processed=!0,this.error=a}s&&!s[Bp]&&Wp.rebuild(s)}else s=Ps(r);this.result=new jo(t,s,n),this.helpers={..._s,postcss:_s,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{r&&r.addToError(t),this.error=t,t.name!=="CssSyntaxError"||t.plugin?n.postcssVersion:(t.plugin=n.postcssPlugin,t.setMessage())}catch(s){console&&console.error&&console.error(s)}return t}prepareVisitors(){this.listeners={};let t=(r,n,s)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,s])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!Yp[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Jp[n])if(typeof r[n]=="object")for(let s in r[n])t(r,s==="*"?n:n+"-"+s.toLowerCase(),r[n][s]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Nt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[_e];){t[_e]=!0;let r=[Wo(t)];for(;r.length>0;){let n=this.visitTick(r);if(Nt(n))try{await n}catch(s){let i=r[r.length-1].node;throw this.handleError(s,i)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let s=t.nodes.map(i=>n(i,this.helpers));await Promise.all(s)}else await n(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Nt(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=jp;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new zp(r,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 t of this.plugins)if(Nt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[_e];)t[_e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Nt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[_e])return a[_e]=!0,void t.push(Wo(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[_e]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[_e]=!0;let r=Jl(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[_e]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};kt.registerPostcss=e=>{_s=e};var Xl=kt;kt.default=kt,Hp.registerLazyResult(kt),Vp.registerLazyResult(kt);let qp=Ol,Xp=Un,Zp=Fi;const Kp=Pi;let Ns=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Xp;this.result=new Kp(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new qp(s,n,this._opts,t);if(a.isMap()){let[o,l]=a.generate();o&&(this.result.css=o),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.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=Zp;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"}};var Qp=Ns;Ns.default=Ns;let eh=Qp,th=Xl,rh=Ti,nh=mr,jt=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 th(this,e,t):new eh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var sh=jt;jt.default=jt,nh.registerProcessor(jt),rh.registerProcessor(jt);let ih=Tn,oh=kl,ah=_n,lh=_i,ch=Pn,uh=mr,dh=Ni;function ir(e,t){if(Array.isArray(e))return e.map(s=>ir(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:ch.prototype};i.map&&(i.map={...i.map,__proto__:oh.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>ir(s,t))),n.source){let{inputId:s,...i}=n.source;n.source=i,s!=null&&(n.source.input=t[s])}if(n.type==="root")return new uh(n);if(n.type==="decl")return new ih(n);if(n.type==="rule")return new dh(n);if(n.type==="comment")return new ah(n);if(n.type==="atrule")return new lh(n);throw new Error("Unknown node type: "+e.type)}var ph=ir;ir.default=ir;let hh=Mi,Vo=Tn,mh=Xl,fh=mt,Fs=sh,gh=Un,yh=ph,Go=Ti,wh=jl,Ho=_n,$o=_i,vh=Pi,bh=Pn,Sh=Fi,Ih=$l,Yo=Ni,Jo=mr,Ch=Dn;function X(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Fs(e)}X.plugin=function(e,t){let r,n=!1;function s(...i){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
27
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
28
|
+
https://www.w3ctech.com/topic/2226`));let a=t(...i);return a.postcssPlugin=e,a.postcssVersion=new Fs().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return X([s(o)]).process(i,a)},s},X.stringify=gh,X.parse=Sh,X.fromJSON=yh,X.list=Ih,X.comment=e=>new Ho(e),X.atRule=e=>new $o(e),X.decl=e=>new Vo(e),X.rule=e=>new Yo(e),X.root=e=>new Jo(e),X.document=e=>new Go(e),X.CssSyntaxError=hh,X.Declaration=Vo,X.Container=fh,X.Processor=Fs,X.Document=Go,X.Comment=Ho,X.Warning=wh,X.AtRule=$o,X.Result=vh,X.Input=bh,X.Rule=Yo,X.Root=Jo,X.Node=Ch,mh.registerPostcss(X);var kh=X;X.default=X;const ie=Yd(kh);ie.stringify,ie.fromJSON,ie.plugin,ie.parse,ie.list,ie.document,ie.comment,ie.atRule,ie.rule,ie.decl,ie.root,ie.CssSyntaxError,ie.Declaration,ie.Container,ie.Processor,ie.Document,ie.Comment,ie.Warning,ie.AtRule,ie.Result,ie.Input,ie.Rule,ie.Root,ie.Node;var Eh=Object.defineProperty,xe=(e,t,r)=>((n,s,i)=>s in n?Eh(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r);function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Rh(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var Bs={exports:{}},ne=String,qo=function(){return{isColorSupported:!1,reset:ne,bold:ne,dim:ne,italic:ne,underline:ne,inverse:ne,hidden:ne,strikethrough:ne,black:ne,red:ne,green:ne,yellow:ne,blue:ne,magenta:ne,cyan:ne,white:ne,gray:ne,bgBlack:ne,bgRed:ne,bgGreen:ne,bgYellow:ne,bgBlue:ne,bgMagenta:ne,bgCyan:ne,bgWhite:ne}};Bs.exports=qo(),Bs.exports.createColors=qo;var Lh=Bs.exports;const De=Rh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Xo=Lh,Zo=De,zs=class Zl extends Error{constructor(t,r,n,s,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),a&&(this.plugin=a),r!==void 0&&n!==void 0&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Zl)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=Xo.isColorSupported),Zo&&t&&(r=Zo(r));let n,s,i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),l=String(o).length;if(t){let{bold:c,gray:u,red:p}=Xo.createColors(!0);n=d=>c(p(d)),s=d=>u(d)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let p=a+1+u,d=" "+(" "+p).slice(-l)+" | ";if(p===this.line){let f=s(d.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(d)+c+`
|
|
29
|
+
`+f+n("^")}return" "+s(d)+c}).join(`
|
|
30
|
+
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
31
|
+
|
|
32
|
+
`+t+`
|
|
33
|
+
`),this.name+": "+this.message+t}};var Bi=zs;zs.default=zs;var or={};or.isClean=Symbol("isClean"),or.my=Symbol("my");const Ko={after:`
|
|
34
|
+
`,beforeClose:`
|
|
35
|
+
`,beforeComment:`
|
|
36
|
+
`,beforeDecl:`
|
|
37
|
+
`,beforeOpen:" ",beforeRule:`
|
|
38
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let js=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(e.raws.afterName!==void 0?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r=e.type==="decl"?this.raw(e,null,"beforeDecl"):e.type==="comment"?this.raw(e,null,"beforeComment"):t==="before"?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&n.type!=="root";)s+=1,n=n.parent;if(r.includes(`
|
|
39
|
+
`)){let i=this.raw(e,null,"indent");if(i.length)for(let a=0;a<s;a++)r+=i}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],n!==void 0))return n;let s=e.parent;if(r==="before"&&(!s||s.type==="root"&&s.first===e||s&&s.type==="document"))return"";if(!s)return Ko[r];let i=e.root();if(i.rawCache||(i.rawCache={}),i.rawCache[r]!==void 0)return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let o="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[o]?n=this[o](i,e):i.walk(l=>{if(n=l.raws[t],n!==void 0)return!1})}var a;return n===void 0&&(n=Ko[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&r.raws.after!==void 0)return t=r.raws.after,t.includes(`
|
|
40
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
|
|
41
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
|
|
42
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?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,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&r.raws.before!==void 0)return t=r.raws.before,t.includes(`
|
|
43
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(r.raws.between!==void 0)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,t!==void 0))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&&r.raws.before!==void 0){let s=r.raws.before.split(`
|
|
44
|
+
`);return t=s[s.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,t!==void 0))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Kl=js;js.default=js;let Oh=Kl;function Ws(e,t){new Oh(t).stringify(e)}var Nn=Ws;Ws.default=Ws;let{isClean:Or,my:Ah}=or,Mh=Bi,Uh=Kl,Dh=Nn;function Vs(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let s=e[n],i=typeof s;n==="parent"&&i==="object"?t&&(r[n]=t):n==="source"?r[n]=s:Array.isArray(s)?r[n]=s.map(a=>Vs(a,r)):(i==="object"&&s!==null&&(s=Vs(s)),r[n]=s)}return r}let Gs=class{constructor(e={}){this.raws={},this[Or]=!1,this[Ah]=!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=Vs(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 Mh(e)}getProxyProcessor(){return{get:(e,t)=>t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,t!=="prop"&&t!=="value"&&t!=="name"&&t!=="params"&&t!=="important"&&t!=="text"||e.markDirty()),!0)}}markDirty(){if(this[Or]){this[Or]=!1;let e=this;for(;e=e.parent;)e[Or]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
|
|
45
|
+
`?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);s!==-1&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}: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 Uh().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 s=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let a=this[i];if(Array.isArray(a))r[i]=a.map(o=>typeof o=="object"&&o.toJSON?o.toJSON(null,t):o);else if(typeof a=="object"&&a.toJSON)r[i]=a.toJSON(null,t);else if(i==="source"){let o=t.get(a.input);o==null&&(o=s,t.set(a.input,s),s++),r[i]={end:a.end,inputId:o,start:a.start}}else r[i]=a}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=Dh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Fn=Gs;Gs.default=Gs;let Th=Fn,Hs=class extends Th{constructor(e){e&&e.value!==void 0&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Bn=Hs;Hs.default=Hs;var Ph={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Qo,SourceMapGenerator:ea}=De,{existsSync:_h,readFileSync:Nh}=De,{dirname:ns,join:Fh}=De,$s=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=ns(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Qo(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e=="object"&&(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=ns(e),_h(e))return this.mapFile=e,Nh(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"){if(t instanceof Qo)return ea.fromSourceMap(t).toString();if(t instanceof ea)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Fh(ns(e),r)),this.loadFile(r)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Ql=$s;$s.default=$s;let{SourceMapConsumer:Bh,SourceMapGenerator:zh}=De,{fileURLToPath:ta,pathToFileURL:Ar}=De,{isAbsolute:Ys,resolve:Js}=De,{nanoid:jh}=Ph,ss=De,ra=Bi,Wh=Ql,is=Symbol("fromOffsetCache"),Vh=!!(Bh&&zh),na=!!(Js&&Ys),Qr=class{constructor(e,t={}){if(e==null||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]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!na||/^\w+:\/\//.test(t.from)||Ys(t.from)?this.file=t.from:this.file=Js(t.from)),na&&Vh){let r=new Wh(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 "+jh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,a;if(t&&typeof t=="object"){let l=t,c=r;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);t=u.line,r=u.col}else t=l.line,r=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);i=u.line,a=u.col}else i=c.line,a=c.column}else if(!r){let l=this.fromOffset(t);t=l.line,r=l.col}let o=this.origin(t,r,i,a);return s=o?new ra(e,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,n.plugin):new ra(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:a,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(Ar&&(s.input.url=Ar(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[is])r=this[is];else{let s=this.css.split(`
|
|
46
|
+
`);r=new Array(s.length);let i=0;for(let a=0,o=s.length;a<o;a++)r[a]=i,i+=s[a].length+1;this[is]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let s,i=r.length-2;for(;n<i;)if(s=n+(i-n>>1),e<r[s])i=s-1;else{if(!(e>=r[s+1])){n=s;break}n=s+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Js(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;typeof r=="number"&&(s=a.originalPositionFor({column:n,line:r})),i=Ys(o.source)?Ar(o.source):new URL(o.source,this.map.consumer().sourceRoot||Ar(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!ta)throw new Error("file: protocol is not available in this PostCSS build");l.file=ta(i)}let c=a.sourceContentFor(o.source);return c&&(l.source=c),l}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}};var zn=Qr;Qr.default=Qr,ss&&ss.registerInput&&ss.registerInput(Qr);let{SourceMapConsumer:ec,SourceMapGenerator:en}=De,{dirname:tn,relative:tc,resolve:rc,sep:nc}=De,{pathToFileURL:sa}=De,Gh=zn,Hh=!!(ec&&en),$h=!!(tn&&rc&&tc&&nc);var sc=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t=`
|
|
47
|
+
`;this.css.includes(`\r
|
|
48
|
+
`)&&(t=`\r
|
|
49
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||tn(e.file);this.mapOpts.sourcesContent===!1?(t=new ec(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}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(),$h&&Hh&&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=en.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new en({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 en({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(a,o,l)=>{if(this.css+=a,o&&l!=="end"&&(i.generated.line=r,i.generated.column=n-1,o.source&&o.source.start?(i.source=this.sourcePath(o),i.original.line=o.source.start.line,i.original.column=o.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=a.match(/\n/g),e?(r+=e.length,t=a.lastIndexOf(`
|
|
50
|
+
`),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?tn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=tn(rc(r,this.mapOpts.annotation)));let n=tc(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 Gh(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(sa){let r=sa(e).toString();return this.memoizedFileURLs.set(e,r),r}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;nc==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Yh=Fn,qs=class extends Yh{constructor(e){super(e),this.type="comment"}};var jn=qs;qs.default=qs;let ic,zi,ji,oc,{isClean:ac,my:lc}=or,cc=Bn,uc=jn,Jh=Fn;function dc(e){return e.map(t=>(t.nodes&&(t.nodes=dc(t.nodes)),delete t.source,t))}function pc(e){if(e[ac]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)pc(t)}let Ze=class hc extends Jh{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let s of n)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r,n,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],n=t(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,r)=>r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(s=>typeof s=="function"?(i,a)=>s(i.toProxy(),a):s)):r==="every"||r==="some"?n=>t[r]((s,...i)=>n(s.toProxy(),...i)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r],set:(t,r,n)=>(t[r]===n||(t[r]=n,r!=="name"&&r!=="params"&&r!=="selector"||t.markDirty()),!0)}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n,s=this.index(t),i=this.normalize(r,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let a of i)this.proxyOf.nodes.splice(s+1,0,a);for(let a in this.indexes)n=this.indexes[a],s<n&&(this.indexes[a]=n+i.length);return this.markDirty(),this}insertBefore(t,r){let n,s=this.index(t),i=s===0&&"prepend",a=this.normalize(r,this.proxyOf.nodes[s],i).reverse();s=this.index(t);for(let o of a)this.proxyOf.nodes.splice(s,0,o);for(let o in this.indexes)n=this.indexes[o],s<=n&&(this.indexes[o]=n+a.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=dc(ic(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new cc(t)]}else if(t.selector)t=[new zi(t)];else if(t.name)t=[new ji(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new uc(t)]}return t.map(n=>(n[lc]||hc.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[ac]&&pc(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}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]}};Ze.registerParse=e=>{ic=e},Ze.registerRule=e=>{zi=e},Ze.registerAtRule=e=>{ji=e},Ze.registerRoot=e=>{oc=e};var ft=Ze;Ze.default=Ze,Ze.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,ji.prototype):e.type==="rule"?Object.setPrototypeOf(e,zi.prototype):e.type==="decl"?Object.setPrototypeOf(e,cc.prototype):e.type==="comment"?Object.setPrototypeOf(e,uc.prototype):e.type==="root"&&Object.setPrototypeOf(e,oc.prototype),e[lc]=!0,e.nodes&&e.nodes.forEach(t=>{Ze.rebuild(t)})};let mc,fc,qh=ft,ar=class extends qh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new mc(new fc,this,e).stringify()}};ar.registerLazyResult=e=>{mc=e},ar.registerProcessor=e=>{fc=e};var Wi=ar;ar.default=ar;let Xs=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}};var gc=Xs;Xs.default=Xs;let Xh=gc,Zs=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}};var Vi=Zs;Zs.default=Zs;const os=39,ia=34,Mr=92,oa=47,Ur=10,Ft=32,Dr=12,Tr=9,Pr=13,Zh=91,Kh=93,Qh=40,em=41,tm=123,rm=125,nm=59,sm=42,im=58,om=64,_r=/[\t\n\f\r "#'()/;[\\\]{}]/g,Nr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,am=/.[\r\n"'(/\\]/,aa=/[\da-f]/i;let yc=ft,rn=class extends yc{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Gi=rn;rn.default=rn,yc.registerAtRule(rn);let wc,vc,bc=ft,Lt=class extends bc{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 s of n)s.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 wc(new vc,this,e).stringify()}};Lt.registerLazyResult=e=>{wc=e},Lt.registerProcessor=e=>{vc=e};var fr=Lt;Lt.default=Lt,bc.registerRoot(Lt);let lr={comma:e=>lr.split(e,[","],!0),space:e=>lr.split(e,[" ",`
|
|
51
|
+
`," "]),split(e,t,r){let n=[],s="",i=!1,a=0,o=!1,l="",c=!1;for(let u of e)c?c=!1:u==="\\"?c=!0:o?u===l&&(o=!1):u==='"'||u==="'"?(o=!0,l=u):u==="("?a+=1:u===")"?a>0&&(a-=1):a===0&&t.includes(u)&&(i=!0),i?(s!==""&&n.push(s.trim()),s="",i=!1):s+=u;return(r||s!=="")&&n.push(s.trim()),n}};var Sc=lr;lr.default=lr;let Ic=ft,lm=Sc,nn=class extends Ic{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return lm.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Hi=nn;nn.default=nn,Ic.registerRule(nn);let cm=Bn,um=function(e,t={}){let r,n,s,i,a,o,l,c,u,p,d=e.css.valueOf(),f=t.ignoreErrors,w=d.length,h=0,U=[],m=[];function g(b){throw e.error("Unclosed "+b,h)}return{back:function(b){m.push(b)},endOfFile:function(){return m.length===0&&h>=w},nextToken:function(b){if(m.length)return m.pop();if(h>=w)return;let S=!!b&&b.ignoreUnclosed;switch(r=d.charCodeAt(h),r){case Ur:case Ft:case Tr:case Pr:case Dr:n=h;do n+=1,r=d.charCodeAt(n);while(r===Ft||r===Ur||r===Tr||r===Pr||r===Dr);p=["space",d.slice(h,n)],h=n-1;break;case Zh:case Kh:case tm:case rm:case im:case nm:case em:{let M=String.fromCharCode(r);p=[M,M,h];break}case Qh:if(c=U.length?U.pop()[1]:"",u=d.charCodeAt(h+1),c==="url"&&u!==os&&u!==ia&&u!==Ft&&u!==Ur&&u!==Tr&&u!==Dr&&u!==Pr){n=h;do{if(o=!1,n=d.indexOf(")",n+1),n===-1){if(f||S){n=h;break}g("bracket")}for(l=n;d.charCodeAt(l-1)===Mr;)l-=1,o=!o}while(o);p=["brackets",d.slice(h,n+1),h,n],h=n}else n=d.indexOf(")",h+1),i=d.slice(h,n+1),n===-1||am.test(i)?p=["(","(",h]:(p=["brackets",i,h,n],h=n);break;case os:case ia:s=r===os?"'":'"',n=h;do{if(o=!1,n=d.indexOf(s,n+1),n===-1){if(f||S){n=h+1;break}g("string")}for(l=n;d.charCodeAt(l-1)===Mr;)l-=1,o=!o}while(o);p=["string",d.slice(h,n+1),h,n],h=n;break;case om:_r.lastIndex=h+1,_r.test(d),n=_r.lastIndex===0?d.length-1:_r.lastIndex-2,p=["at-word",d.slice(h,n+1),h,n],h=n;break;case Mr:for(n=h,a=!0;d.charCodeAt(n+1)===Mr;)n+=1,a=!a;if(r=d.charCodeAt(n+1),a&&r!==oa&&r!==Ft&&r!==Ur&&r!==Tr&&r!==Pr&&r!==Dr&&(n+=1,aa.test(d.charAt(n)))){for(;aa.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Ft&&(n+=1)}p=["word",d.slice(h,n+1),h,n],h=n;break;default:r===oa&&d.charCodeAt(h+1)===sm?(n=d.indexOf("*/",h+2)+1,n===0&&(f||S?n=d.length:g("comment")),p=["comment",d.slice(h,n+1),h,n],h=n):(Nr.lastIndex=h+1,Nr.test(d),n=Nr.lastIndex===0?d.length-1:Nr.lastIndex-2,p=["word",d.slice(h,n+1),h,n],U.push(p),h=n)}return h++,p},position:function(){return h}}},dm=jn,pm=Gi,hm=fr,la=Hi;const ca={empty:!0,space:!0};var mm=class{constructor(e){this.input=e,this.root=new hm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new pm;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,a=!1,o=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],t==="("||t==="["?l.push(t==="("?")":"]"):t==="{"&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),l.length===0){if(t===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if(t==="{"){a=!0;break}if(t==="}"){if(o.length>0){for(n=o.length-1,r=o[n];r&&r[0]==="space";)r=o[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}o.push(e)}else o.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(o),o.length?(s.raws.afterName=this.spacesAndCommentsFromStart(o),this.raw(s,"params",o),i&&(e=o[o.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),a&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],r[0]==="space"||(n+=1,n!==2));s--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,a]of e.entries()){if(t=a,r=t[0],r==="("&&(s+=1),r===")"&&(s-=1),s===0&&r===":"){if(n){if(n[0]==="word"&&n[1]==="progid")continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new dm;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=um(this.input)}decl(e,t){let r=new cm;this.init(r,e[0][2]);let n,s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(o){for(let l=o.length-1;l>=0;l--){let c=o[l],u=c[3]||c[2];if(u)return u}}(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 o=e[0][0];if(o===":"||o==="space"||o==="comment")break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}r.prop[0]!=="_"&&r.prop[0]!=="*"||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],i==="space"||i==="comment");)a.push(e.shift());this.precheckMissedSemicolon(e);for(let o=e.length-1;o>=0;o--){if(n=e[o],n[1].toLowerCase()==="!important"){r.important=!0;let l=this.stringFrom(e,o);l=this.spacesFromEnd(e)+l,l!==" !important"&&(r.raws.important=l);break}if(n[1].toLowerCase()==="important"){let l=e.slice(0),c="";for(let u=o;u>0;u--){let p=l[u][0];if(c.trim().indexOf("!")===0&&p!=="space")break;c=l.pop()[1]+c}c.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=c,e=l)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(r.raws.between+=a.map(o=>o[1]).join(""),a=[]),this.raw(r,"value",a.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 la;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,s=null,i=[],a=e[1].startsWith("--"),o=[],l=e;for(;l;){if(r=l[0],o.push(l),r==="("||r==="[")s||(s=l),i.push(r==="("?")":"]");else if(a&&n&&r==="{")s||(s=l),i.push("}");else if(i.length===0){if(r===";"){if(n)return void this.decl(o,a);break}if(r==="{")return void this.rule(o);if(r==="}"){this.tokenizer.back(o.pop()),t=!0;break}r===":"&&(n=!0)}else r===i[i.length-1]&&(i.pop(),i.length===0&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!a)for(;o.length&&(l=o[o.length-1][0],l==="space"||l==="comment");)this.tokenizer.back(o.pop());this.decl(o,a)}else this.unknownWord(o)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,i,a,o,l=r.length,c="",u=!0;for(let p=0;p<l;p+=1)s=r[p],i=s[0],i!=="space"||p!==l-1||n?i==="comment"?(o=r[p-1]?r[p-1][0]:"empty",a=r[p+1]?r[p+1][0]:"empty",ca[o]||ca[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let p=r.reduce((d,f)=>d+f[1],"");e.raws[t]={raw:p,value:c}}e[t]=c}rule(e){e.pop();let t=new la;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})}};let fm=ft,gm=mm,ym=zn;function sn(e,t){let r=new ym(e,t),n=new gm(r);try{n.parse()}catch(s){throw s}return n.root}var $i=sn;sn.default=sn,fm.registerParse(sn);let{isClean:Ne,my:wm}=or,vm=sc,bm=Nn,Sm=ft,Im=Wi,ua=Vi,Cm=$i,km=fr;const Em={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},xm={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},Rm={Once:!0,postcssPlugin:!0,prepare:!0};function Bt(e){return typeof e=="object"&&typeof e.then=="function"}function Cc(e){let t=!1,r=Em[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function da(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:Cc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ks(e){return e[Ne]=!1,e.nodes&&e.nodes.forEach(t=>Ks(t)),e}let Qs={},Et=class kc{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,typeof r!="object"||r===null||r.type!=="root"&&r.type!=="document")if(r instanceof kc||r instanceof ua)s=Ks(r.root),r.map&&(n.map===void 0&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let i=Cm;n.syntax&&(i=n.syntax.parse),n.parser&&(i=n.parser),i.parse&&(i=i.parse);try{s=i(r,n)}catch(a){this.processed=!0,this.error=a}s&&!s[wm]&&Sm.rebuild(s)}else s=Ks(r);this.result=new ua(t,s,n),this.helpers={...Qs,postcss:Qs,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{r&&r.addToError(t),this.error=t,t.name!=="CssSyntaxError"||t.plugin?n.postcssVersion:(t.plugin=n.postcssPlugin,t.setMessage())}catch(s){console&&console.error&&console.error(s)}return t}prepareVisitors(){this.listeners={};let t=(r,n,s)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,s])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!xm[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Rm[n])if(typeof r[n]=="object")for(let s in r[n])t(r,s==="*"?n:n+"-"+s.toLowerCase(),r[n][s]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Bt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ne];){t[Ne]=!0;let r=[da(t)];for(;r.length>0;){let n=this.visitTick(r);if(Bt(n))try{await n}catch(s){let i=r[r.length-1].node;throw this.handleError(s,i)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let s=t.nodes.map(i=>n(i,this.helpers));await Promise.all(s)}else await n(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Bt(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=bm;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new vm(r,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 t of this.plugins)if(Bt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ne];)t[Ne]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Bt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Ne])return a[Ne]=!0,void t.push(da(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Ne]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Ne]=!0;let r=Cc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Ne]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Et.registerPostcss=e=>{Qs=e};var Ec=Et;Et.default=Et,km.registerLazyResult(Et),Im.registerLazyResult(Et);let Lm=sc,Om=Nn,Am=$i;const Mm=Vi;let ei=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Om;this.result=new Mm(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new Lm(s,n,this._opts,t);if(a.isMap()){let[o,l]=a.generate();o&&(this.result.css=o),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.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=Am;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"}};var Um=ei;ei.default=ei;let Dm=Um,Tm=Ec,Pm=Wi,_m=fr,Wt=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 Tm(this,e,t):new Dm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Nm=Wt;Wt.default=Wt,_m.registerProcessor(Wt),Pm.registerProcessor(Wt);let Fm=Bn,Bm=Ql,zm=jn,jm=Gi,Wm=zn,Vm=fr,Gm=Hi;function cr(e,t){if(Array.isArray(e))return e.map(s=>cr(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:Wm.prototype};i.map&&(i.map={...i.map,__proto__:Bm.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>cr(s,t))),n.source){let{inputId:s,...i}=n.source;n.source=i,s!=null&&(n.source.input=t[s])}if(n.type==="root")return new Vm(n);if(n.type==="decl")return new Fm(n);if(n.type==="rule")return new Gm(n);if(n.type==="comment")return new zm(n);if(n.type==="atrule")return new jm(n);throw new Error("Unknown node type: "+e.type)}var Hm=cr;cr.default=cr;let $m=Bi,pa=Bn,Ym=Ec,Jm=ft,ti=Nm,qm=Nn,Xm=Hm,ha=Wi,Zm=gc,ma=jn,fa=Gi,Km=Vi,Qm=zn,ef=$i,tf=Sc,ga=Hi,ya=fr,rf=Fn;function Z(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ti(e)}Z.plugin=function(e,t){let r,n=!1;function s(...i){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
52
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
53
|
+
https://www.w3ctech.com/topic/2226`));let a=t(...i);return a.postcssPlugin=e,a.postcssVersion=new ti().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return Z([s(o)]).process(i,a)},s},Z.stringify=qm,Z.parse=ef,Z.fromJSON=Xm,Z.list=tf,Z.comment=e=>new ma(e),Z.atRule=e=>new fa(e),Z.decl=e=>new pa(e),Z.rule=e=>new ga(e),Z.root=e=>new ya(e),Z.document=e=>new ha(e),Z.CssSyntaxError=$m,Z.Declaration=pa,Z.Container=Jm,Z.Processor=ti,Z.Document=ha,Z.Comment=ma,Z.Warning=Zm,Z.AtRule=fa,Z.Result=Km,Z.Input=Qm,Z.Rule=ga,Z.Root=ya,Z.Node=rf,Ym.registerPostcss(Z);var nf=Z;Z.default=Z;const oe=xh(nf);oe.stringify,oe.fromJSON,oe.plugin,oe.parse,oe.list,oe.document,oe.comment,oe.atRule,oe.rule,oe.decl,oe.root,oe.CssSyntaxError,oe.Declaration,oe.Container,oe.Processor,oe.Document,oe.Comment,oe.Warning,oe.AtRule,oe.Result,oe.Input,oe.Rule,oe.Root,oe.Node;class Yi{constructor(...t){xe(this,"parentElement",null),xe(this,"parentNode",null),xe(this,"ownerDocument"),xe(this,"firstChild",null),xe(this,"lastChild",null),xe(this,"previousSibling",null),xe(this,"nextSibling",null),xe(this,"ELEMENT_NODE",1),xe(this,"TEXT_NODE",3),xe(this,"nodeType"),xe(this,"nodeName"),xe(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(!(t instanceof Yi)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const wa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},va={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fr={};function Ji(e){if(Fr[e])return Fr[e];const t=globalThis[e],r=t.prototype,n=e in wa?wa[e]:void 0,s=!!(n&&n.every(o=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,o))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in va?va[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return Fr[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?Fr[e]=c:r}catch{return r}}const as={};function et(e,t,r){var n;const s=`${e}.${String(r)}`;if(as[s])return as[s].call(t);const i=Ji(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(as[s]=a,a.call(t)):t[r]}const ls={};function ba(e,t,r){const n=`${e}.${String(r)}`;if(ls[n])return ls[n].bind(t);const s=Ji(e)[r];return typeof s!="function"?t[r]:(ls[n]=s,s.bind(t))}function xc(){return Ji("MutationObserver").constructor}const V={childNodes:function(e){return et("Node",e,"childNodes")},parentNode:function(e){return et("Node",e,"parentNode")},parentElement:function(e){return et("Node",e,"parentElement")},textContent:function(e){return et("Node",e,"textContent")},contains:function(e,t){return ba("Node",e,"contains")(t)},getRootNode:function(e){return ba("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?et("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?et("Element",e,"shadowRoot"):null},querySelector:function(e,t){return et("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return et("Element",e,"querySelectorAll")(t)},mutationObserver:xc};function ye(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const bt=`Please stop import mirror directly. Instead of that,\r
|
|
54
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
55
|
+
or you can use record.mirror to access the mirror instance during recording.`;let Sa={map:{},getId:()=>(console.error(bt),-1),getNode:()=>(console.error(bt),null),removeNodeFromMap(){console.error(bt)},has:()=>(console.error(bt),!1),reset(){console.error(bt)}};function Vt(e,t,r={}){let n=null,s=0;return function(...i){const a=Date.now();s||r.leading!==!1||(s=a);const o=t-(a-s),l=this;o<=0||o>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(l,i)):n||r.trailing===!1||(n=setTimeout(()=>{s=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},o))}}function Wn(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Wn(e,t,i||{},!0)}function Ot(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}typeof window<"u"&&window.Proxy&&window.Reflect&&(Sa=new Proxy(Sa,{get:(e,t,r)=>(t==="map"&&console.error(bt),Reflect.get(e,t,r))}));let gn=Date.now;function Rc(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||(i==null?void 0:i.body)&&((t=V.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i==null?void 0:i.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(i==null?void 0:i.documentElement.scrollTop)||(i==null?void 0:i.body)&&((n=V.parentElement(i.body))==null?void 0:n.scrollTop)||((s=i==null?void 0:i.body)==null?void 0:s.scrollTop)||0}}function Lc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Oc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ac(e){return e?e.nodeType===e.ELEMENT_NODE?e:V.parentElement(e):null}function ve(e,t,r,n){if(!e)return!1;const s=Ac(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return!0}else if(fn(s,t,n))return!0}catch{}return!!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function cs(e,t,r){return!(e.tagName!=="TITLE"||!r.headTitleMutations)||t.getId(e)===-2}function Mc(e,t){if(Jt(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=V.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Mc(n,t))}function ri(e){return!!e.changedTouches}function Uc(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Dc(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ni(e){return!!e&&(e instanceof Yi&&"shadowRoot"in e?!!e.shadowRoot:!!V.shadowRoot(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(gn=()=>new Date().getTime());class sf{constructor(){x(this,"id",1),x(this,"styleIDMap",new WeakMap),x(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return n=r===void 0?this.id++:r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Tc(e){var t;let r=null;return"getRootNode"in e&&((t=V.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&V.host(V.getRootNode(e))&&(r=V.host(V.getRootNode(e))),r}function of(e){const t=e.ownerDocument;if(!t)return!1;const r=function(n){let s,i=n;for(;s=Tc(i);)i=s;return i}(e);return V.contains(t,r)}function Pc(e){const t=e.ownerDocument;return!!t&&(V.contains(t,e)||of(e))}var $=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))($||{}),G=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(G||{}),be=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(be||{}),Ye=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ye||{}),St=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(St||{}),It=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(It||{});function Ia(e){return"__ln"in e}class af{constructor(){x(this,"length",0),x(this,"head",null),x(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=(r==null?void 0:r.next)||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Ia(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Ia(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Ca=(e,t)=>`${e}@${t}`;class lf{constructor(){x(this,"frozen",!1),x(this,"locked",!1),x(this,"texts",[]),x(this,"attributes",[]),x(this,"attributeMap",new WeakMap),x(this,"removes",[]),x(this,"mapRemoves",[]),x(this,"movedMap",{}),x(this,"addedSet",new Set),x(this,"movedSet",new Set),x(this,"droppedSet",new Set),x(this,"mutationCb"),x(this,"blockClass"),x(this,"blockSelector"),x(this,"maskTextClass"),x(this,"maskTextSelector"),x(this,"inlineStylesheet"),x(this,"maskInputOptions"),x(this,"maskTextFn"),x(this,"maskInputFn"),x(this,"keepIframeSrcFn"),x(this,"recordCanvas"),x(this,"inlineImages"),x(this,"slimDOMOptions"),x(this,"dataURLOptions"),x(this,"doc"),x(this,"mirror"),x(this,"iframeManager"),x(this,"stylesheetManager"),x(this,"shadowDomManager"),x(this,"canvasManager"),x(this,"processedNodeManager"),x(this,"unattachedDoc"),x(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),x(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new af,s=l=>{let c=l,u=-2;for(;u===-2;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{const c=V.parentNode(l);if(!c||!Pc(l)||c.tagName==="TEXTAREA")return;const u=Jt(c)?this.mirror.getId(Tc(l)):this.mirror.getId(c),p=s(l);if(u===-1||p===-1)return n.addNode(l);const d=Ct(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Uc(f,this.mirror)&&this.iframeManager.addIframe(f),Dc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ni(l)&&this.shadowDomManager.addShadowRoot(V.shadowRoot(l),this.doc)},onIframeLoad:(f,w)=>{this.iframeManager.attachIframe(f,w),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,w)=>{this.stylesheetManager.attachLinkElement(f,w)}});d&&(t.push({parentId:u,nextId:p,node:d}),r.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)ka(this.removes,l,this.mirror)&&!this.movedSet.has(V.parentNode(l))||i(l);for(const l of this.addedSet)Ea(this.droppedSet,l)||ka(this.removes,l,this.mirror)?Ea(this.movedSet,l)?i(l):this.droppedSet.add(l):i(l);let a=null;for(;n.length;){let l=null;if(a){const c=this.mirror.getId(V.parentNode(a.value)),u=s(a.value);c!==-1&&u!==-1&&(l=a)}if(!l){let c=n.tail;for(;c;){const u=c;if(c=c.previous,u){const p=this.mirror.getId(V.parentNode(u.value));if(s(u.value)===-1)continue;if(p!==-1){l=u;break}{const d=u.value,f=V.parentNode(d);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=V.host(f);if(this.mirror.getId(w)!==-1){l=u;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}a=l.previous,n.removeNode(l.value),i(l.value)}const o={texts:this.texts.map(l=>{const c=l.node,u=V.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:c}=l;if(typeof c.style=="string"){const u=JSON.stringify(l.styleDiff),p=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+p).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))}),x(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r)),r.attributes.value=Array.from(V.childNodes(t),n=>V.textContent(n)||"").join("")}),x(this,"processMutation",t=>{if(!cs(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=V.textContent(t.target);ve(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:Sl(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Ac(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,s=t.target.getAttribute(n);if(n==="value"){const a=Oi(r);s=Li({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(ve(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;n="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!bl(r.tagName,n))if(i.attributes[n]=vl(this.doc,pt(r.tagName),pt(n),s),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const o of Array.from(r.style)){const l=r.style.getPropertyValue(o),c=r.style.getPropertyPriority(o);l!==a.style.getPropertyValue(o)||c!==a.style.getPropertyPriority(o)?i.styleDiff[o]=c===""?l:[l,c]:i._unchangedStyles[o]=[l,c]}for(const o of Array.from(a.style))r.style.getPropertyValue(o)===""&&(i.styleDiff[o]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(ve(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA")return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),s=Jt(t.target)?this.mirror.getId(V.host(t.target)):this.mirror.getId(t.target);ve(t.target,this.blockClass,this.blockSelector,!1)||cs(r,this.mirror,this.slimDOMOptions)||!function(i,a){return a.getId(i)!==-1}(r,this.mirror)||(this.addedSet.has(r)?(si(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Mc(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ca(n,s)]?si(this.movedSet,r):this.removes.push({parentId:s,id:n,isShadow:!(!Jt(t.target)||!qt(t.target))||void 0})),this.mapRemoves.push(r))})}}),x(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(cs(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Ca(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ve(t,this.blockClass,this.blockSelector,!1)||(V.childNodes(t).forEach(n=>this.genAdds(n)),ni(t)&&V.childNodes(V.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}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 si(e,t){e.delete(t),V.childNodes(t).forEach(r=>si(e,r))}function ka(e,t,r){return e.length!==0&&function(n,s,i){let a=V.parentNode(s);for(;a;){const o=i.getId(a);if(n.some(l=>l.id===o))return!0;a=V.parentNode(a)}return!1}(e,t,r)}function Ea(e,t){return e.size!==0&&_c(e,t)}function _c(e,t){const r=V.parentNode(t);return!!r&&(!!e.has(r)||_c(e,r))}let Xt;const H=e=>Xt?(...t)=>{try{return e(...t)}catch(r){if(Xt&&Xt(r)===!0)return;throw r}}:e,dt=[];function Zt(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Nc(e,t){const r=new lf;dt.push(r),r.init(e);const n=new(xc())(H(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function cf({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,o=[];let l=null;return Object.keys(be).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let u=pt(c);const p=(d=>f=>{const w=Zt(f);if(ve(w,n,s,!0))return;let h=null,U=d;if("pointerType"in f){switch(f.pointerType){case"mouse":h=Ye.Mouse;break;case"touch":h=Ye.Touch;break;case"pen":h=Ye.Pen}h===Ye.Touch?be[d]===be.MouseDown?U="TouchStart":be[d]===be.MouseUp&&(U="TouchEnd"):Ye.Pen}else ri(f)&&(h=Ye.Touch);h!==null?(l=h,(U.startsWith("Touch")&&h===Ye.Touch||U.startsWith("Mouse")&&h===Ye.Mouse)&&(h=null)):be[d]===be.Click&&(h=l,l=null);const m=ri(f)?f.changedTouches[0]:f;if(!m)return;const g=r.getId(w),{clientX:b,clientY:S}=m;H(e)({type:be[U],id:g,x:b,y:S,...h!==null&&{pointerType:h}})})(c);if(window.PointerEvent)switch(be[c]){case be.MouseDown:case be.MouseUp:u=u.replace("mouse","pointer");break;case be.TouchStart:case be.TouchEnd:return}o.push(ye(u,p,t))}),H(()=>{o.forEach(c=>c())})}function Fc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){return ye("scroll",H(Vt(H(a=>{const o=Zt(a);if(!o||ve(o,n,s,!0))return;const l=r.getId(o);if(o===t&&t.defaultView){const c=Rc(t.defaultView);e({id:l,x:c.left,y:c.top})}else e({id:l,x:o.scrollLeft,y:o.scrollTop})}),i.scroll||100)),t)}const uf=["INPUT","TEXTAREA","SELECT"],xa=new WeakMap;function Br(e){return function(t,r){if(zr("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||zr("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||zr("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||zr("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);r.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function tt(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Bc({mirror:e,stylesheetManager:t},r){var n,s,i;let a=null;a=r.nodeName==="#document"?e.getId(r):e.getId(V.host(r));const o=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:i.ShadowRoot,l=o!=null&&o.prototype?Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets"):void 0;return a!==null&&a!==-1&&o&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;const p=(u=l.set)==null?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return p}}),H(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function df(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;(function(m,g){const{mutationCb:b,mousemoveCb:S,mouseInteractionCb:M,scrollCb:C,viewportResizeCb:A,inputCb:D,mediaInteractionCb:k,styleSheetRuleCb:L,styleDeclarationCb:E,canvasMutationCb:I,fontCb:P,selectionCb:_,customElementCb:v}=m;m.mutationCb=(...y)=>{g.mutation&&g.mutation(...y),b(...y)},m.mousemoveCb=(...y)=>{g.mousemove&&g.mousemove(...y),S(...y)},m.mouseInteractionCb=(...y)=>{g.mouseInteraction&&g.mouseInteraction(...y),M(...y)},m.scrollCb=(...y)=>{g.scroll&&g.scroll(...y),C(...y)},m.viewportResizeCb=(...y)=>{g.viewportResize&&g.viewportResize(...y),A(...y)},m.inputCb=(...y)=>{g.input&&g.input(...y),D(...y)},m.mediaInteractionCb=(...y)=>{g.mediaInteaction&&g.mediaInteaction(...y),k(...y)},m.styleSheetRuleCb=(...y)=>{g.styleSheetRule&&g.styleSheetRule(...y),L(...y)},m.styleDeclarationCb=(...y)=>{g.styleDeclaration&&g.styleDeclaration(...y),E(...y)},m.canvasMutationCb=(...y)=>{g.canvasMutation&&g.canvasMutation(...y),I(...y)},m.fontCb=(...y)=>{g.font&&g.font(...y),P(...y)},m.selectionCb=(...y)=>{g.selection&&g.selection(...y),_(...y)},m.customElementCb=(...y)=>{g.customElement&&g.customElement(...y),v(...y)}})(e,t),e.recordDOM&&(n=Nc(e,e.doc));const s=function({mousemoveCb:m,sampling:g,doc:b,mirror:S}){if(g.mousemove===!1)return()=>{};const M=typeof g.mousemove=="number"?g.mousemove:50,C=typeof g.mousemoveCallback=="number"?g.mousemoveCallback:500;let A,D=[];const k=Vt(H(I=>{const P=Date.now()-A;m(D.map(_=>(_.timeOffset-=P,_)),I),D=[],A=null}),C),L=H(Vt(H(I=>{const P=Zt(I),{clientX:_,clientY:v}=ri(I)?I.changedTouches[0]:I;A||(A=gn()),D.push({x:_,y:v,id:S.getId(P),timeOffset:gn()-A}),k(typeof DragEvent<"u"&&I instanceof DragEvent?G.Drag:I instanceof MouseEvent?G.MouseMove:G.TouchMove)}),M,{trailing:!1})),E=[ye("mousemove",L,b),ye("touchmove",L,b),ye("drag",L,b)];return H(()=>{E.forEach(I=>I())})}(e),i=cf(e),a=Fc(e),o=function({viewportResizeCb:m},{win:g}){let b=-1,S=-1;return ye("resize",H(Vt(H(()=>{const M=Lc(),C=Oc();b===M&&S===C||(m({width:Number(C),height:Number(M)}),b=M,S=C)}),200)),g)}(e,{win:r}),l=function({inputCb:m,doc:g,mirror:b,blockClass:S,blockSelector:M,ignoreClass:C,ignoreSelector:A,maskInputOptions:D,maskInputFn:k,sampling:L,userTriggeredOnInput:E}){function I(B){let j=Zt(B);const R=B.isTrusted,O=j&&j.tagName;if(j&&O==="OPTION"&&(j=V.parentElement(j)),!j||!O||uf.indexOf(O)<0||ve(j,S,M,!0)||j.classList.contains(C)||A&&j.matches(A))return;let J=j.value,Y=!1;const ue=Oi(j)||"";ue==="radio"||ue==="checkbox"?Y=j.checked:(D[O.toLowerCase()]||D[ue])&&(J=Li({element:j,maskInputOptions:D,tagName:O,type:ue,value:J,maskInputFn:k})),P(j,E?{text:J,isChecked:Y,userTriggered:R}:{text:J,isChecked:Y});const Te=j.name;ue==="radio"&&Te&&Y&&g.querySelectorAll(`input[type="radio"][name="${Te}"]`).forEach(Se=>{if(Se!==j){const Pe=Se.value;P(Se,E?{text:Pe,isChecked:!Y,userTriggered:!1}:{text:Pe,isChecked:!Y})}})}function P(B,j){const R=xa.get(B);if(!R||R.text!==j.text||R.isChecked!==j.isChecked){xa.set(B,j);const O=b.getId(B);H(m)({...j,id:O})}}const _=(L.input==="last"?["change"]:["input","change"]).map(B=>ye(B,H(I),g)),v=g.defaultView;if(!v)return()=>{_.forEach(B=>B())};const y=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),T=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&_.push(...T.map(B=>Wn(B[0],B[1],{set(){H(I)({target:this,isTrusted:!1})}},!1,v))),H(()=>{_.forEach(B=>B())})}(e),c=function({mediaInteractionCb:m,blockClass:g,blockSelector:b,mirror:S,sampling:M,doc:C}){const A=H(k=>Vt(H(L=>{const E=Zt(L);if(!E||ve(E,g,b,!0))return;const{currentTime:I,volume:P,muted:_,playbackRate:v,loop:y}=E;m({type:k,id:S.getId(E),currentTime:I,volume:P,muted:_,playbackRate:v,loop:y})}),M.media||500)),D=[ye("play",A(It.Play),C),ye("pause",A(It.Pause),C),ye("seeked",A(It.Seeked),C),ye("volumechange",A(It.VolumeChange),C),ye("ratechange",A(It.RateChange),C)];return H(()=>{D.forEach(k=>k())})}(e);let u=()=>{},p=()=>{},d=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:b},{win:S}){if(!S.CSSStyleSheet||!S.CSSStyleSheet.prototype)return()=>{};const M=S.CSSStyleSheet.prototype.insertRule;S.CSSStyleSheet.prototype.insertRule=new Proxy(M,{apply:H((E,I,P)=>{const[_,v]=P,{id:y,styleId:T}=tt(I,g,b.styleMirror);return(y&&y!==-1||T&&T!==-1)&&m({id:y,styleId:T,adds:[{rule:_,index:v}]}),E.apply(I,P)})}),S.CSSStyleSheet.prototype.addRule=function(E,I,P=this.cssRules.length){const _=`${E} { ${I} }`;return S.CSSStyleSheet.prototype.insertRule.apply(this,[_,P])};const C=S.CSSStyleSheet.prototype.deleteRule;let A,D;S.CSSStyleSheet.prototype.deleteRule=new Proxy(C,{apply:H((E,I,P)=>{const[_]=P,{id:v,styleId:y}=tt(I,g,b.styleMirror);return(v&&v!==-1||y&&y!==-1)&&m({id:v,styleId:y,removes:[{index:_}]}),E.apply(I,P)})}),S.CSSStyleSheet.prototype.removeRule=function(E){return S.CSSStyleSheet.prototype.deleteRule.apply(this,[E])},S.CSSStyleSheet.prototype.replace&&(A=S.CSSStyleSheet.prototype.replace,S.CSSStyleSheet.prototype.replace=new Proxy(A,{apply:H((E,I,P)=>{const[_]=P,{id:v,styleId:y}=tt(I,g,b.styleMirror);return(v&&v!==-1||y&&y!==-1)&&m({id:v,styleId:y,replace:_}),E.apply(I,P)})})),S.CSSStyleSheet.prototype.replaceSync&&(D=S.CSSStyleSheet.prototype.replaceSync,S.CSSStyleSheet.prototype.replaceSync=new Proxy(D,{apply:H((E,I,P)=>{const[_]=P,{id:v,styleId:y}=tt(I,g,b.styleMirror);return(v&&v!==-1||y&&y!==-1)&&m({id:v,styleId:y,replaceSync:_}),E.apply(I,P)})}));const k={};jr("CSSGroupingRule")?k.CSSGroupingRule=S.CSSGroupingRule:(jr("CSSMediaRule")&&(k.CSSMediaRule=S.CSSMediaRule),jr("CSSConditionRule")&&(k.CSSConditionRule=S.CSSConditionRule),jr("CSSSupportsRule")&&(k.CSSSupportsRule=S.CSSSupportsRule));const L={};return Object.entries(k).forEach(([E,I])=>{L[E]={insertRule:I.prototype.insertRule,deleteRule:I.prototype.deleteRule},I.prototype.insertRule=new Proxy(L[E].insertRule,{apply:H((P,_,v)=>{const[y,T]=v,{id:B,styleId:j}=tt(_.parentStyleSheet,g,b.styleMirror);return(B&&B!==-1||j&&j!==-1)&&m({id:B,styleId:j,adds:[{rule:y,index:[...Br(_),T||0]}]}),P.apply(_,v)})}),I.prototype.deleteRule=new Proxy(L[E].deleteRule,{apply:H((P,_,v)=>{const[y]=v,{id:T,styleId:B}=tt(_.parentStyleSheet,g,b.styleMirror);return(T&&T!==-1||B&&B!==-1)&&m({id:T,styleId:B,removes:[{index:[...Br(_),y]}]}),P.apply(_,v)})})}),H(()=>{S.CSSStyleSheet.prototype.insertRule=M,S.CSSStyleSheet.prototype.deleteRule=C,A&&(S.CSSStyleSheet.prototype.replace=A),D&&(S.CSSStyleSheet.prototype.replaceSync=D),Object.entries(k).forEach(([E,I])=>{I.prototype.insertRule=L[E].insertRule,I.prototype.deleteRule=L[E].deleteRule})})}(e,{win:r}),p=Bc(e,e.doc),d=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:b,stylesheetManager:S},{win:M}){const C=M.CSSStyleDeclaration.prototype.setProperty;M.CSSStyleDeclaration.prototype.setProperty=new Proxy(C,{apply:H((D,k,L)=>{var E;const[I,P,_]=L;if(b.has(I))return C.apply(k,[I,P,_]);const{id:v,styleId:y}=tt((E=k.parentRule)==null?void 0:E.parentStyleSheet,g,S.styleMirror);return(v&&v!==-1||y&&y!==-1)&&m({id:v,styleId:y,set:{property:I,value:P,priority:_},index:Br(k.parentRule)}),D.apply(k,L)})});const A=M.CSSStyleDeclaration.prototype.removeProperty;return M.CSSStyleDeclaration.prototype.removeProperty=new Proxy(A,{apply:H((D,k,L)=>{var E;const[I]=L;if(b.has(I))return A.apply(k,[I]);const{id:P,styleId:_}=tt((E=k.parentRule)==null?void 0:E.parentStyleSheet,g,S.styleMirror);return(P&&P!==-1||_&&_!==-1)&&m({id:P,styleId:_,remove:{property:I},index:Br(k.parentRule)}),D.apply(k,L)})}),H(()=>{M.CSSStyleDeclaration.prototype.setProperty=C,M.CSSStyleDeclaration.prototype.removeProperty=A})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:m,doc:g}){const b=g.defaultView;if(!b)return()=>{};const S=[],M=new WeakMap,C=b.FontFace;b.FontFace=function(D,k,L){const E=new C(D,k,L);return M.set(E,{family:D,buffer:typeof k!="string",descriptors:L,fontSource:typeof k=="string"?k:JSON.stringify(Array.from(new Uint8Array(k)))}),E};const A=Ot(g.fonts,"add",function(D){return function(k){return setTimeout(H(()=>{const L=M.get(k);L&&(m(L),M.delete(k))}),0),D.apply(this,[k])}});return S.push(()=>{b.FontFace=C}),S.push(A),H(()=>{S.forEach(D=>D())})}(e)));const w=function(m){const{doc:g,mirror:b,blockClass:S,blockSelector:M,selectionCb:C}=m;let A=!0;const D=H(()=>{const k=g.getSelection();if(!k||A&&(k!=null&&k.isCollapsed))return;A=k.isCollapsed||!1;const L=[],E=k.rangeCount||0;for(let I=0;I<E;I++){const P=k.getRangeAt(I),{startContainer:_,startOffset:v,endContainer:y,endOffset:T}=P;ve(_,S,M,!0)||ve(y,S,M,!0)||L.push({start:b.getId(_),startOffset:v,end:b.getId(y),endOffset:T})}C({ranges:L})});return D(),ye("selectionchange",D)}(e),h=function({doc:m,customElementCb:g}){const b=m.defaultView;return b&&b.customElements?Ot(b.customElements,"define",function(S){return function(M,C,A){try{g({define:{name:M}})}catch{console.warn(`Custom element callback failed for ${M}`)}return S.apply(this,[M,C,A])}}):()=>{}}(e),U=[];for(const m of e.plugins)U.push(m.observer(m.callback,r,m.options));return H(()=>{dt.forEach(m=>m.reset()),n==null||n.disconnect(),s(),i(),a(),o(),l(),c(),u(),p(),d(),f(),w(),h(),U.forEach(m=>m())})}function zr(e){return window[e]!==void 0}function jr(e){return!!(window[e]!==void 0&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ra{constructor(t){x(this,"iframeIdToRemoteIdMap",new WeakMap),x(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,s){const i=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t);let o=i.get(r);return o||(o=this.generateIdFn(),i.set(r,o),a.set(o,r)),o}getIds(t,r){const n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,s))}getRemoteId(t,r,n){const s=n||this.getRemoteIdToIdMap(t);return typeof r!="number"?r:s.get(r)||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class pf{constructor(t){x(this,"iframes",new WeakMap),x(this,"crossOriginIframeMap",new WeakMap),x(this,"crossOriginIframeMirror",new Ra(wl)),x(this,"crossOriginIframeStyleMirror"),x(this,"crossOriginIframeRootIdMap",new WeakMap),x(this,"mirror"),x(this,"mutationCb"),x(this,"wrappedEmit"),x(this,"loadListener"),x(this,"stylesheetManager"),x(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ra(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const s=this.transformCrossOriginEvent(n,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case $.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:$.IncrementalSnapshot,data:{source:G.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $.Meta:case $.Load:case $.DomContentLoaded:return!1;case $.Plugin:return r;case $.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case $.IncrementalSnapshot:switch(r.data.source){case G.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case G.Drag:case G.TouchMove:case G.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case G.ViewportResize:return!1;case G.MediaInteraction:case G.MouseInteraction:case G.Scroll:case G.CanvasMutation:case G.Input:return this.replaceIds(r.data,t,["id"]),r;case G.StyleSheetRule:case G.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case G.Font:return r;case G.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case G.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),r}}return!1}replace(t,r,n,s){for(const i of s)(Array.isArray(r[i])||typeof r[i]=="number")&&(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type===he.Document||t.rootId||(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class hf{constructor(t){x(this,"shadowDoms",new WeakSet),x(this,"mutationCb"),x(this,"scrollCb"),x(this,"bypassOptions"),x(this,"mirror"),x(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!qt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=Nc({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Fc({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(V.host(t))),this.restoreHandlers.push(Bc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(Ot(t.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i),o=V.shadowRoot(this);return o&&Pc(this)&&n.addShadowRoot(o,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mf=typeof Uint8Array>"u"?[]:new Uint8Array(256),Wr=0;Wr<64;Wr++)mf[Gt.charCodeAt(Wr)]=Wr;const La=new Map,zc=(e,t,r)=>{if(!e||!Wc(e,t)&&typeof e!="object")return;const n=function(i,a){let o=La.get(i);return o||(o=new Map,La.set(i,o)),o.has(a)||o.set(a,[]),o.get(a)}(r,e.constructor.name);let s=n.indexOf(e);return s===-1&&(s=n.length,n.push(e)),s};function on(e,t,r){if(e instanceof Array)return e.map(n=>on(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(n){var s,i=new Uint8Array(n),a=i.length,o="";for(s=0;s<a;s+=3)o+=Gt[i[s]>>2],o+=Gt[(3&i[s])<<4|i[s+1]>>4],o+=Gt[(15&i[s+1])<<2|i[s+2]>>6],o+=Gt[63&i[s+2]];return a%3==2?o=o.substring(0,o.length-1)+"=":a%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[on(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:s}=e;return{rr_type:n,src:s}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[on(e.data,t,r),e.width,e.height]}:Wc(e,t)||typeof e=="object"?{rr_type:e.constructor.name,index:zc(e,t,r)}:e}const jc=(e,t,r)=>e.map(n=>on(n,t,r)),Wc=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function").find(n=>e instanceof t[n]);function Oa(e,t,r,n){const s=[];try{const i=Ot(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(o,...l){if(!ve(this,t,r,!0)){const c=function(u){return u==="experimental-webgl"?"webgl":u}(o);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[o,...l])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function Aa(e,t,r,n,s,i){const a=[],o=Object.getOwnPropertyNames(e);for(const l of o)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;const c=Ot(e,l,function(u){return function(...p){const d=u.apply(this,p);if(zc(d,i,this),"tagName"in this.canvas&&!ve(this.canvas,n,s,!0)){const f=jc(p,i,this),w={type:t,property:l,args:f};r(this.canvas,w)}return d}});a.push(c)}catch{const c=Wn(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});a.push(c)}return a}const Vc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ma=typeof window<"u"&&window.Blob&&new Blob([(Ua=Vc,Uint8Array.from(atob(Ua),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Ua;function ff(e){let t;try{if(t=Ma&&(window.URL||window.webkitURL).createObjectURL(Ma),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+Vc,{name:e==null?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class gf{constructor(t){x(this,"pendingCanvasMutations",new Map),x(this,"rafStamps",{latestId:0,invokeId:null}),x(this,"mirror"),x(this,"mutationCb"),x(this,"resetObservers"),x(this,"frozen",!1),x(this,"locked",!1),x(this,"processMutation",(l,c)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});const{sampling:r="all",win:n,blockClass:s,blockSelector:i,recordCanvas:a,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,i),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,i,{dataURLOptions:o})}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(t,r,n,s,i){const a=Oa(r,n,s,!0),o=new Map,l=new ff;l.onmessage=f=>{const{id:w}=f.data;if(o.set(w,!1),!("base64"in f.data))return;const{base64:h,type:U,width:m,height:g}=f.data;this.mutationCb({id:w,type:St["2D"],commands:[{property:"clearRect",args:[0,0,m,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:U}]},0,0]}]})};const c=1e3/t;let u,p=0;const d=f=>{p&&f-p<c||(p=f,(()=>{const w=[];return r.document.querySelectorAll("canvas").forEach(h=>{ve(h,n,s,!0)||w.push(h)}),w})().forEach(async w=>{var h;const U=this.mirror.getId(w);if(o.get(U)||w.width===0||w.height===0)return;if(o.set(U,!0),["webgl","webgl2"].includes(w.__context)){const g=w.getContext(w.__context);((h=g==null?void 0:g.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const m=await createImageBitmap(w);l.postMessage({id:U,bitmap:m,width:w.width,height:w.height,dataURLOptions:i.dataURLOptions},[m])})),u=requestAnimationFrame(d)};u=requestAnimationFrame(d),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Oa(t,r,n,!1),i=function(o,l,c,u){const p=[],d=Object.getOwnPropertyNames(l.CanvasRenderingContext2D.prototype);for(const f of d)try{if(typeof l.CanvasRenderingContext2D.prototype[f]!="function")continue;const w=Ot(l.CanvasRenderingContext2D.prototype,f,function(h){return function(...U){return ve(this.canvas,c,u,!0)||setTimeout(()=>{const m=jc(U,l,this);o(this.canvas,{type:St["2D"],property:f,args:m})},0),h.apply(this,U)}});p.push(w)}catch{const w=Wn(l.CanvasRenderingContext2D.prototype,f,{set(h){o(this.canvas,{type:St["2D"],property:f,args:[h],setter:!0})}});p.push(w)}return()=>{p.forEach(f=>f())}}(this.processMutation.bind(this),t,r,n),a=function(o,l,c,u){const p=[];return p.push(...Aa(l.WebGLRenderingContext.prototype,St.WebGL,o,c,u,l)),l.WebGL2RenderingContext!==void 0&&p.push(...Aa(l.WebGL2RenderingContext.prototype,St.WebGL2,o,c,u,l)),()=>{p.forEach(d=>d())}}(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const s=n.map(a=>{const{type:o,...l}=a;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:s}),this.pendingCanvasMutations.delete(t)}}class yf{constructor(t){x(this,"trackedLinkElements",new WeakSet),x(this,"mutationCb"),x(this,"adoptedStyleSheetCb"),x(this,"styleMirror",new sf),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},s=[];for(const i of t){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(o,l)=>({rule:gl(o,i.href),index:l}))})),n.styleIds.push(a)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class wf{constructor(){x(this,"nodeMap",new WeakMap),x(this,"active",!1)}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let ae,an,us,yn=!1;try{if(Array.from([1],e=>2*e)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((yo=e.contentWindow)==null?void 0:yo.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Le=new yl;function Ht(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:o=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:f,maskInputFn:w,maskTextFn:h,hooks:U,packFn:m,sampling:g={},dataURLOptions:b={},mousemoveWait:S,recordDOM:M=!0,recordCanvas:C=!1,recordCrossOriginIframes:A=!1,recordAfter:D=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:L=!1,inlineImages:E=!1,plugins:I,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:_=new Set([]),errorHandler:v}=e;Xt=v;const y=!A||window.parent===window;let T=!1;if(!y)try{window.parent.document&&(T=!1)}catch{T=!0}if(y&&!t)throw new Error("emit function is required");if(!y&&!T)return()=>{};S!==void 0&&g.mousemove===void 0&&(g.mousemove=S),Le.reset();const B=p===!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}:d!==void 0?d:{password:!0},j=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all",headTitleMutations:f==="all"}:f||{};let R;(function(W=window){"NodeList"in W&&!W.NodeList.prototype.forEach&&(W.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in W&&!W.DOMTokenList.prototype.forEach&&(W.DOMTokenList.prototype.forEach=Array.prototype.forEach)})();let O=0;const J=W=>{for(const Re of I||[])Re.eventProcessor&&(W=Re.eventProcessor(W));return m&&!T&&(W=m(W)),W};ae=(W,Re)=>{var te;const se=W;if(se.timestamp=gn(),!((te=dt[0])!=null&&te.isFrozen())||se.type===$.FullSnapshot||se.type===$.IncrementalSnapshot&&se.data.source===G.Mutation||dt.forEach(Ee=>Ee.unfreeze()),y)t==null||t(J(se),Re);else if(T){const Ee={type:"rrweb",event:J(se),origin:window.location.origin,isCheckout:Re};window.parent.postMessage(Ee,"*")}if(se.type===$.FullSnapshot)R=se,O=0;else if(se.type===$.IncrementalSnapshot){if(se.data.source===G.Mutation&&se.data.isAttachIframe)return;O++;const Ee=n&&O>=n,q=r&&se.timestamp-R.timestamp>r;(Ee||q)&&an(!0)}};const Y=W=>{ae({type:$.IncrementalSnapshot,data:{source:G.Mutation,...W}})},ue=W=>ae({type:$.IncrementalSnapshot,data:{source:G.Scroll,...W}}),Te=W=>ae({type:$.IncrementalSnapshot,data:{source:G.CanvasMutation,...W}}),Se=new yf({mutationCb:Y,adoptedStyleSheetCb:W=>ae({type:$.IncrementalSnapshot,data:{source:G.AdoptedStyleSheet,...W}})}),Pe=new pf({mirror:Le,mutationCb:Y,stylesheetManager:Se,recordCrossOriginIframes:A,wrappedEmit:ae});for(const W of I||[])W.getMirror&&W.getMirror({nodeMirror:Le,crossOriginIframeMirror:Pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pe.crossOriginIframeStyleMirror});const Hn=new wf;us=new gf({recordCanvas:C,mutationCb:Te,win:window,blockClass:s,blockSelector:i,mirror:Le,sampling:g.canvas,dataURLOptions:b});const wr=new hf({mutationCb:Y,scrollCb:ue,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:B,dataURLOptions:b,maskTextFn:h,maskInputFn:w,recordCanvas:C,inlineImages:E,sampling:g,slimDOMOptions:j,iframeManager:Pe,stylesheetManager:Se,canvasManager:us,keepIframeSrcFn:P,processedNodeManager:Hn},mirror:Le});an=(W=!1)=>{if(!M)return;ae({type:$.Meta,data:{href:window.location.href,width:Oc(),height:Lc()}},W),Se.reset(),wr.init(),dt.forEach(te=>te.lock());const Re=function(te,se){const{mirror:Ee=new yl,blockClass:q="rr-block",blockSelector:Dt=null,maskTextClass:qu="rr-mask",maskTextSelector:Xu=null,inlineStylesheet:Zu=!0,inlineImages:Ku=!1,recordCanvas:Qu=!1,maskAllInputs:$n=!1,maskTextFn:ed,maskInputFn:td,slimDOM:Tt=!1,dataURLOptions:rd,preserveWhiteSpace:nd,onSerialize:sd,onIframeLoad:id,iframeLoadTimeout:od,onStylesheetLoad:ad,stylesheetLoadTimeout:ld,keepIframeSrcFn:cd=()=>!1}=se||{};return Ct(te,{doc:te,mirror:Ee,blockClass:q,blockSelector:Dt,maskTextClass:qu,maskTextSelector:Xu,skipChild:!1,inlineStylesheet:Zu,maskInputOptions:$n===!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}:$n===!1?{password:!0}:$n,maskTextFn:ed,maskInputFn:td,slimDOMOptions:Tt===!0||Tt==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:Tt==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:Tt===!1?{}:Tt,dataURLOptions:rd,inlineImages:Ku,recordCanvas:Qu,preserveWhiteSpace:nd,onSerialize:sd,onIframeLoad:id,iframeLoadTimeout:od,onStylesheetLoad:ad,stylesheetLoadTimeout:ld,keepIframeSrcFn:cd,newlyAddedElement:!1})}(document,{mirror:Le,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:B,maskTextFn:h,maskInputFn:w,slimDOM:j,dataURLOptions:b,recordCanvas:C,inlineImages:E,onSerialize:te=>{Uc(te,Le)&&Pe.addIframe(te),Dc(te,Le)&&Se.trackLinkElement(te),ni(te)&&wr.addShadowRoot(V.shadowRoot(te),document)},onIframeLoad:(te,se)=>{Pe.attachIframe(te,se),wr.observeAttachShadow(te)},onStylesheetLoad:(te,se)=>{Se.attachLinkElement(te,se)},keepIframeSrcFn:P});if(!Re)return console.warn("Failed to snapshot the document");ae({type:$.FullSnapshot,data:{node:Re,initialOffset:Rc(window)}},W),dt.forEach(te=>te.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Se.adoptStyleSheets(document.adoptedStyleSheets,Le.getId(document))};try{const W=[],Re=se=>{var Ee;return H(df)({mutationCb:Y,mousemoveCb:(q,Dt)=>ae({type:$.IncrementalSnapshot,data:{source:Dt,positions:q}}),mouseInteractionCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.MouseInteraction,...q}}),scrollCb:ue,viewportResizeCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.ViewportResize,...q}}),inputCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.Input,...q}}),mediaInteractionCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.MediaInteraction,...q}}),styleSheetRuleCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.StyleSheetRule,...q}}),styleDeclarationCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.StyleDeclaration,...q}}),canvasMutationCb:Te,fontCb:q=>ae({type:$.IncrementalSnapshot,data:{source:G.Font,...q}}),selectionCb:q=>{ae({type:$.IncrementalSnapshot,data:{source:G.Selection,...q}})},customElementCb:q=>{ae({type:$.IncrementalSnapshot,data:{source:G.CustomElement,...q}})},blockClass:s,ignoreClass:a,ignoreSelector:o,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:u,sampling:g,recordDOM:M,recordCanvas:C,inlineImages:E,userTriggeredOnInput:k,collectFonts:L,doc:se,maskInputFn:w,maskTextFn:h,keepIframeSrcFn:P,blockSelector:i,slimDOMOptions:j,dataURLOptions:b,mirror:Le,iframeManager:Pe,stylesheetManager:Se,shadowDomManager:wr,processedNodeManager:Hn,canvasManager:us,ignoreCSSAttributes:_,plugins:((Ee=I==null?void 0:I.filter(q=>q.observer))==null?void 0:Ee.map(q=>({observer:q.observer,options:q.options,callback:Dt=>ae({type:$.Plugin,data:{plugin:q.name,payload:Dt}})})))||[]},U)};Pe.addLoadListener(se=>{try{W.push(Re(se.contentDocument))}catch(Ee){console.warn(Ee)}});const te=()=>{an(),W.push(Re(document)),yn=!0};return document.readyState==="interactive"||document.readyState==="complete"?te():(W.push(ye("DOMContentLoaded",()=>{ae({type:$.DomContentLoaded,data:{}}),D==="DOMContentLoaded"&&te()})),W.push(ye("load",()=>{ae({type:$.Load,data:{}}),D==="load"&&te()},window))),()=>{W.forEach(se=>se()),Hn.destroy(),yn=!1,Xt=void 0}}catch(W){console.warn(W)}}var Da,vt;Ht.addCustomEvent=(e,t)=>{if(!yn)throw new Error("please add custom event after start recording");ae({type:$.Custom,data:{tag:e,payload:t}})},Ht.freezePage=()=>{dt.forEach(e=>e.freeze())},Ht.takeFullSnapshot=e=>{if(!yn)throw new Error("please take full snapshot after start recording");an(e)},Ht.mirror=Le,(vt=Da||(Da={}))[vt.NotStarted=0]="NotStarted",vt[vt.Running=1]="Running",vt[vt.Stopped=2]="Stopped";var je=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.FeedbackClosed="feedback.closed",e.PageChange="page.change",e.API="api",e.Override="override",e))(je||{}),F=(e=>(e.ReplayCapture="replay.capture",e.FeedbackButtonLoaded="feedback.button.loaded",e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyCloseRequested="survey.closeRequested",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWidth="survey.width",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e.QuestionAnswered="question.answered",e))(F||{});const ur={FEEDBACK_BUTTON_LOADED:"feedback.button.loaded",SDK_READY:"sdk.ready",SURVEY_APPEARED:"survey.appeared",SURVEY_CLOSED:"survey.closed",SURVEY_DIMENSIONS:"survey.dimensions",SURVEY_FADING_OUT:"survey.fadingOut",SURVEY_HEIGHT:"survey.height",SURVEY_WIDTH:"survey.width",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",QUESTION_ANSWERED:"question.answered",REPLAY_CAPTURE:"replay.capture",CLOSE_SURVEY_ON_OVERLAY_CLICK:"close.survey.overlayClick",VISITOR_ID_UPDATED:"visitor.id.updated",DATA:{DISMISS_REASONS:{API:"api",CLOSED:"close.click",COMPLETE:"survey.completed",PAGE_CHANGE:"page.change",OVERRIDE:"override"},SURVEY_ID:"survey.id"}};let Vr;const vf=new Uint8Array(16);function bf(){if(!Vr&&(Vr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vr(vf)}const fe=[];for(let e=0;e<256;++e)fe.push((e+256).toString(16).slice(1));const Ta={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gt(e,t,r){if(Ta.randomUUID&&!t&&!e)return Ta.randomUUID();const n=(e=e||{}).random||(e.rng||bf)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(s,i=0){return fe[s[i+0]]+fe[s[i+1]]+fe[s[i+2]]+fe[s[i+3]]+"-"+fe[s[i+4]]+fe[s[i+5]]+"-"+fe[s[i+6]]+fe[s[i+7]]+"-"+fe[s[i+8]]+fe[s[i+9]]+"-"+fe[s[i+10]]+fe[s[i+11]]+fe[s[i+12]]+fe[s[i+13]]+fe[s[i+14]]+fe[s[i+15]]}(n)}const N=new class{constructor(){pe(this,"breadcrumbs",[])}getTimeStamp(){return new Date().toISOString()}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>300&&this.breadcrumbs.shift()}debug(e,t="debug"){this.addBreadcrumb({category:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"debug"})}error(e,t={}){this.addBreadcrumb({category:"error",data:t,level:"error",message:e,timestamp:this.getTimeStamp(),type:"error"})}http(e,t){this.addBreadcrumb({category:"xhr",data:t,message:e,timestamp:this.getTimeStamp(),type:"http"})}info(e,t={}){this.addBreadcrumb({category:"info",data:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"info"})}navigation(e,t){this.addBreadcrumb({category:"navigation",data:t,message:e,timestamp:this.getTimeStamp(),type:"navigation"})}},Pa=()=>{try{return window.parent.Intercom}catch{return null}},_a=[Object.freeze(Object.defineProperty({__proto__:null,disable:()=>{const e=Pa();e&&(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},enable:()=>{const e=Pa();e&&(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)}},Symbol.toStringTag,{value:"Module"}))];class Gc{static disable(){_a.forEach(t=>t.disable())}static enable(){_a.forEach(t=>t.enable())}}var Sf=class extends Error{constructor(e,t,r){super(`Possible EventEmitter memory leak detected. ${r} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=t,this.count=r,this.name="MaxListenersExceededWarning"}},Hc=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=Hc.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}_emitInternalEvent(e,t,r){this.emit(e,t,r)}_getListeners(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}_removeListener(e,t){const r=e.indexOf(t);return r>-1&&e.splice(r,1),[]}_wrapOnceListener(e,t){const r=(...n)=>(this.removeListener(e,r),t.apply(this,n));return Object.defineProperty(r,"name",{value:t.name}),r}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e,...t){const r=this._getListeners(e);return r.forEach(n=>{n.apply(this,t)}),r.length>0}addListener(e,t){this._emitInternalEvent("newListener",e,t);const r=this._getListeners(e).concat(t);if(this.events.set(e,r),this.maxListeners>0&&this.listenerCount(e)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const n=new Sf(this,e,this.listenerCount(e));console.warn(n)}return this}on(e,t){return this.addListener(e,t)}once(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}prependListener(e,t){const r=this._getListeners(e);if(r.length>0){const n=[t].concat(r);this.events.set(e,n)}else this.events.set(e,r.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const r=this._getListeners(e);return r.length>0&&(this._removeListener(r,t),this.events.set(e,r),this._emitInternalEvent("removeListener",e,t)),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){return e?this.events.delete(e):this.events.clear(),this}listeners(e){return Array.from(this._getListeners(e))}listenerCount(e){return this._getListeners(e).length}rawListeners(e){return this.listeners(e)}},$c=Hc;$c.defaultMaxListeners=10;const z=new $c,wn=async e=>{await new Promise(t=>{setTimeout(t,e)})},qi=({"userleap-platform":e})=>{var t;return((t=window.UserLeap)==null?void 0:t.forceDirectEmbed)||e!=="web"};class Yc{constructor(t){pe(this,"storage");pe(this,"tempStorage",{});pe(this,"isStorageAvailable");try{this.storage=window[t];const r="__storage_test__";this.storage.setItem(r,r),this.storage.removeItem(r),this.isStorageAvailable=!0}catch{this.isStorageAvailable=!1}}setItem(t,r){this.isStorageAvailable&&this.storage?this.storage.setItem(t,r):this.tempStorage[t]=r}setItemObject(t,r){try{this.setItem(t,JSON.stringify(r))}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to save to local storage",n))}}getItem(t){return this.isStorageAvailable&&this.storage?this.storage.getItem(t):this.tempStorage[t]}getItemObject(t){const r=this.getItem(t);if(r)try{return JSON.parse(r)}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to parse local storage",n))}return{}}removeItem(t){this.isStorageAvailable&&this.storage?this.storage.removeItem(t):delete this.tempStorage[t]}clear(){this.isStorageAvailable&&this.storage?this.storage.clear():this.tempStorage={}}}const me=new Yc("sessionStorage"),Ce=new Yc("localStorage");class If{constructor(t){pe(this,"payload");pe(this,"promise");pe(this,"reject",()=>{});pe(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((r,n)=>{this.reject=n,this.resolve=r})}resolveRequest(t){this.resolve(t)}}const le={replay:null},Cf=()=>{const e=[];return le.replay&&e.push("replay"),e.join(",")},kf=10;let Jc=!1,qc="",Gr=!1,Xc=!1,ln=[];const Ef=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?"web-gtm":e._segment?"web-segment":"web-snippet",Na=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(Xc=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`))},ii=(e="")=>{Jc=!0,qc=e};function Me(e={}){const t={"Content-Type":"application/json","userleap-platform":"web","x-ul-sdk-version":"2.33.1","x-ul-installation-method":Ef(e),"sprig-modules":Cf(),"x-ul-package-version":"1.1.7"};if(e.envId&&(t["x-ul-environment-id"]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t["x-ul-user-id"]=e.userId),e.visitorId&&(t["x-ul-visitor-id"]=e.visitorId),e.partnerAnonymousId&&(t["x-ul-anonymous-id"]=e.partnerAnonymousId),e.mobileHeadersJSON){const r=JSON.parse(e.mobileHeadersJSON);Object.assign(t,r)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t["x-ul-preview-mode"]="1"),t}const Fa=async({shouldDropOnRateLimit:e,...t})=>{if(e)return{status:429};{const r=new If(t);return ln.push(r),r.promise}},He=async(e,t)=>{const{retries:r=0,shouldDropOnRateLimit:n=!1,shouldRetryRequest:s=!1,...i}=t,a={url:e,options:i,retries:r,shouldDropOnRateLimit:n};if(Gr&&!s)return Fa(a);const o={ok:!1,reportError:!1};if(Jc)return console.info(`UserLeap - ${qc}`),o;try{const l=await fetch(e,i);if(l.status===429){if(!Gr&&!n||s){Gr=!0;const c=l.headers.has("ratelimit-reset")?Number(l.headers.get("ratelimit-reset")):kf;return await wn(1e3*c),He(e,{...i,shouldDropOnRateLimit:n,shouldRetryRequest:!0})}return Fa(a)}if(Gr=!1,ln.length&&(ln.map(c=>{const u=c.payload;He(u.url,{...u.options,retries:u.retries,shouldDropOnRateLimit:u.shouldDropOnRateLimit}).then(p=>{c.resolveRequest(p)})}),ln=[]),l.ok){if(l.status===249)return ii(),o;const c=await l.text();try{return c&&c!=="OK"&&(l.json=JSON.parse(c)),l}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${c}`)}}}return l}catch(l){const c=r+1;return c>5||Xc?{ok:!1,reportError:!1,error:l}:(await wn(1e3*Math.pow(2,r)),He(e,{...i,retries:c}))}},Ba="ul-view-sdk-script",xf=["ios","android"],nt="visitors",st="environments";async function Be(e,t){var i,a,o;const{shouldDropOnRateLimit:r,...n}=t;n.headers=Object.assign(Me(window.UserLeap),n.headers);const s=await He(e,{...n,shouldDropOnRateLimit:r});if(s.ok){const l=(i=s.headers)==null?void 0:i.get("Authorization"),c=l?l.split(" "):void 0,u=c&&c.length===2?c[1]:void 0,p=(a=s.headers)==null?void 0:a.get("x-ul-visitor-id");if(window.UserLeap.userId&&p===window.UserLeap.visitorId){const d=Ce.getItemObject("sprig.anon.env.vid.map");d&&d[window.UserLeap.envId]===p&&(delete d[window.UserLeap.envId],Ce.setItemObject("sprig.anon.env.vid.map",d))}u&&p&&(p!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(Ie("token",u),Ie("vid",p),z.emit(F.VisitorIDUpdated,{visitorId:p}),window.UserLeap.token=u,window.UserLeap.visitorId=p)}return(o=s.json)!=null&&o.logMessage&&console.warn(`[Sprig] ${s.json.logMessage}`),s}function Ie(e,t){const r=Ce.getItemObject("userleap.ids");let n=r[window.UserLeap.envId];n?n[e]=t:n={[e]:t},r[window.UserLeap.envId]=n,Ce.setItemObject("userleap.ids",r)}function Xi(){return window.previewMode?"0":window.UserLeap.visitorId??""}function Oe(e,t,r){const n=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(s=>{n.push(s),s===st?n.push(window.UserLeap.envId):s===nt&&n.push(Xi())}),r&&n.push(r),n.join("/")}const Kt=async(e,t)=>{var B,j,R;const{context:r,delay:n,forceBrandedLogo:s,endCard:i,isFeedback:a=!1,heatmap:o,locale:l,previewMode:c,productConfig:u,questions:p,responseGroupUid:d,surveyId:f,uuid:w,vid:h,sessionReplay:U,studyType:m}=e,g=Me(window.UserLeap),b=dr(g),S=Vn(g);if(U)if(b)z.emit(F.ReplayCapture,{responseGroupUid:d,hasQuestions:!!(p!=null&&p.length),surveyId:f,uploadId:U.uploadId,replayType:U.replayDurationType??"before",seconds:U.replayDurationSeconds,generateVideoUploadUrlPayload:{mediaRecordingUid:gt(),mediaType:"screen",questionId:1,responseGroupUid:d,surveyId:f,updatedAt:new Date().toISOString(),visitorId:window.UserLeap.visitorId,isReplay:!0}});else{if(!le.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};le.replay.scheduleOrCaptureReplay({responseGroupId:d,surveyId:f,visitorId:h,replayParams:U,completeUploadHeaders:g,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:p.length===0})}if(o){if(!le.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};const{eventId:O,replayParams:J,responseGroupUid:Y,surveyId:ue}=o;await le.replay.initializeReplay({maxReplayDurationSeconds:300,maxInflightRequests:window.UserLeap.maxInflightReplayRequests,teardownAfter:!0,apiUrl:window.UserLeap._API_URL}),le.replay.tryReplayAction(()=>{var Te;return(Te=le.replay)==null?void 0:Te.scheduleCapture({apiUrl:window.UserLeap._API_URL,completeUploadHeaders:g,eventId:O,isHeatmap:!0,replayParams:J,responseGroupId:Y,surveyId:ue,triggerTimestamp:Date.now(),visitorId:h})},"Error in scheduling/capturing replay")}if(h==null||!(p!=null&&p.length))return N.info("CannotDisplaySurvey",{vid:h}),{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(Rf(p))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:"no survey"};if(window.UserLeap.container){N.info("AlreadyDisplayingSurvey");const O="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(O),{success:!1,message:O,surveyState:"no survey"}}if(h!==window.UserLeap.visitorId&&w!==window.UserLeap.visitorId&&!window.previewMode){const O="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(O)),{success:!1,message:O,surveyState:"no survey"}}N.info("ShowingSurvey",{surveyId:f}),(B=le.replay)==null||B.RecordSurveyShown({id:f,userAgent:window.navigator.userAgent}),Gc.disable(),z.emit(F.SurveyWillPresent,{name:F.SurveyWillPresent,"survey.id":f});let M,C,A,D,k=document.createElement("div");const L=O=>{const{"view.version":J}=O;J!==g["x-ul-sdk-version"]&&Kc(),z.removeListener("verify.view.version",L)};z.on("verify.view.version",L),window.UserLeap.useMobileStyling=S,qi(g)?(M="ul-direct-embeded-frame",C=document.head,A=window,D=!1,(()=>{const O=Me(window.UserLeap),J=dr(O),Y=window.UserLeap.forceDirectEmbed,ue=O["userleap-platform"]==="web";return J||Y&&ue})()&&(Zc(f,a),k.id=M,window.UserLeap.container.appendChild(k),Qc(),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":f}))):{frameId:M,contentWinDocHead:C,contentWindow:A,hasOverlay:D,iframe:k}=Of({productConfig:u,useMobileStyling:S,surveyId:f,isFeedback:a}),window.UserLeap.frameId=M;const E={apiURL:window.UserLeap._API_URL,cards:p,configureExitOnOverlayClick:O=>{z.once(F.CloseSurveyOnOverlayClick,O)},context:r,endCard:i,envId:window.UserLeap.envId,eventEmitFn:z.emit.bind(z),fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,forceBrandedLogo:s,frame:k,headers:g,locale:l,mobileSDKVersion:window.UserLeap.mobileSDKVersion,previewKey:Ce.getItem("sprig.previewKey"),previewMode:c,productConfig:{framePosition:u==null?void 0:u.framePosition,desktopDisplay:u==null?void 0:u.desktopDisplay,placement:u==null?void 0:u.placement},responseGroupUid:d,startingQuestionIdx:(j=window.UserLeap.config)==null?void 0:j.startingQuestionIdx,studyType:m,styleNonce:window.UserLeap.styleNonce,surveyId:f,tabTitle:document.title,trackPageViewUrl:t,ulEvents:ur,upchunkLibraryURL:window.UserLeap.upchunkLibraryURL,useMobileStyling:S,userId:w,viewDocument:A==null?void 0:A.document,viewWindow:A,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},...window.UserLeap._config};(R=window.UserLeap._config)!=null&&R.startingQuestionIdx&&(window.UserLeap._config={...window.UserLeap._config,startingQuestionIdx:null});const I=(a?window.UserLeap.feedbackCustomStyles:window.UserLeap.customStyles)??u.customStyles;E.customStyles=I,A&&(A.__cfg=E);const P=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:E.path,_=document.getElementById(Ba);_&&_.remove();const v=function(){const O=document.createElement("script");return window.UserLeap.nonce&&O.setAttribute("nonce",window.UserLeap.nonce),O.id=Ba,O}(),y=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};if(E.installationMethod==="web-npm"||E.installationMethod==="web-npm-bundled"){const{default:O}=await Promise.resolve().then(()=>require("./view-CDCFNST3.cjs"));O.configure(E),D&&window.UserLeap.container&&y()}else P&&(v.src=P,D&&v.addEventListener("load",()=>{window.UserLeap.container&&y()}),A==null||A.addEventListener("error",O=>{O.target instanceof HTMLScriptElement&&O.target.src===P&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0}));C==null||C.appendChild(v);const T={success:!0,surveyState:"ready",surveyId:f,responseGroupUid:d};return window.UserLeap.isMobileSDK&&n&&(T.delay=n),T};function Vn(e){var r;if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=((r=window.UserLeap.windowDimensions)==null?void 0:r.width)??document.body.clientWidth;return dr(e)||t>10&&t<500}function dr(e){return xf.includes(e["userleap-platform"])}const Rf=e=>e.some(t=>t.type==="videovoice"),Zi="ul-frame";window.UserLeap&&window.Sprig&&(window.Sprig._gtm?window.Sprig=window.UserLeap:window.UserLeap=window.Sprig),window.UserLeap||(window.UserLeap=window.Sprig),window.Sprig||(window.Sprig=window.UserLeap);const ds="0px",Zc=(e,t,r)=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container"+(t?" ul-container-feedback":""),e&&(window.UserLeap.container.dataset.studyId=e.toString());const n=nu();r&&n&&!window.UserLeap.useMobileStyling?n.appendChild(window.UserLeap.container):document.body.appendChild(window.UserLeap.container)},Kc=(e,t)=>{var n;Mf();const r=window.UserLeap.container;if(r)try{(n=r.parentNode)==null||n.removeChild(r),window.UserLeap.container=null,Ie("trackStartUrl",null),z.emit(F.SurveyLifeCycle,{state:"dismissed"}),z.emit(F.SurveyClosed,{name:F.SurveyClosed,initiator:e,"survey.id":parseInt(r.dataset.studyId),...t&&{studyType:t}})}catch(s){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+r),s instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",s)}},Qc=()=>{z.once(F.SurveyWillClose,({initiator:e,studyType:t})=>{z.removeAllListeners(F.CloseSurveyOnOverlayClick),Kc(e,t)})},Lf=(e,t,r,n)=>{var u,p;const s={position:"fixed",bottom:"0px",right:ds,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646,transition:"height 0.2s ease-in-out",maxWidth:"100%"},i=Object.assign({},t,window.UserLeap),{desktopDisplay:a}=t||{},o=a==="center-modal";let l;o&&(i.framePosition="center");let c=!1;if(r)(u=window.UserLeap.windowDimensions)!=null&&u.width?s.width=`${window.UserLeap.windowDimensions.width}px`:s.width="100%",(p=window.UserLeap.windowDimensions)!=null&&p.height?s.maxHeight=window.UserLeap.windowDimensions.height-20+"px":window.UserLeap.maxHeight?s.maxHeight=window.UserLeap.maxHeight:s.maxHeight=document.body.clientHeight-20+"px",["light","dark"].includes(i.overlayStyleMobile)&&(c=!0);else{s.width="360px",s.maxHeight=window.UserLeap.maxHeight||"66vh";const d=()=>{c=!0,l={margin:"auto",position:"static"}};if(n)o?d():l={position:"relative",height:"300px"};else switch(i.framePosition){case"bottomLeft":l={left:ds};break;case"topLeft":l={left:ds,top:0};break;case"topRight":l={top:0};break;case"center":d()}}return c&&((d,f)=>{const w={position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646},h=f?d.overlayStyleMobile:d.overlayStyle;w["background-color"]=h==="light"?"rgba(255,255,255, 0.95)":"rgba(0,0,0,0.9)",f||(w.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,w)})(i,r),Object.assign(e.style,s,l),c},Of=({productConfig:e,useMobileStyling:t,surveyId:r,isFeedback:n})=>{var d,f;const s=Zi,i=n&&e.desktopDisplay==="slider";Zc(r,n,i),Af();const a=document.createElement("iframe");a.id=s,a.setAttribute("title","Sprig User Feedback Dialog");const o=Lf(a,e,t,n);Qc();let l=!1;a.setHeight=w=>{parseInt(a.style.height)==w&&l||(l=!0,a.style.height=`${w}px`,z.emit(F.SurveyHeight,{name:F.SurveyHeight,contentFrameHeight:w,"survey.id":r}))};let c=!1;a.setWidth=w=>{parseInt(a.style.width)==w&&c||(c=!0,a.style.width=`${w}px`,z.emit(F.SurveyWidth,{name:F.SurveyWidth,contentFrameWidth:w,"survey.id":r}))},(d=window.UserLeap.container)==null||d.appendChild(a),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{z.emit(F.CloseSurveyOnOverlayClick)}),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":r});const u=(f=a.contentWindow)==null?void 0:f.document;if(u&&(u.open("text/html","replace"),u.write("<!doctype html><head></head><body></body></html>"),u.close(),!t)){const w=u.body;w.style.display="flex",w.style.alignItems="center"}const p=u==null?void 0:u.head;return{frameId:s,contentWinDocHead:p,contentWindow:a.contentWindow,hasOverlay:o,iframe:a}},eu={[F.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},Af=()=>{Object.entries(eu).forEach(([e,t])=>{z.on(e,t)})},Mf=()=>{Object.entries(eu).forEach(([e,t])=>{z.off(e,t)})},za=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function Ki(e,t){const{matchType:r,pattern:n}=e,s=r?za[r]:za.legacy;let i=!1;try{i=s(n,t)}catch(a){const o=`[Sprig] (ERR-445) Failed to check url match with pattern ${n}`;a instanceof Error&&(console.warn(o,a),a.stack=JSON.stringify(e),window.UserLeap.reportError(o,a))}return i}const tu=e=>{const{pageUrlEvents:t}=window.UserLeap._config,r=t==null?void 0:t.find(n=>n.id===e);return!!r&&Ki(r,window.location.href)},Fe=e=>!!e&&e.nodeType===Node.ELEMENT_NODE,ja=e=>e instanceof HTMLElement||e instanceof SVGElement,pr=({document:e,elementId:t,styleString:r,nonce:n})=>{const s=e.getElementById(t);if(s)return void(s.textContent=r);const i=e.createElement("style");n&&(i.nonce=n),i.textContent=r,i.id=t,e.head.appendChild(i)},Uf=(e,t)=>{const r=t.querySelector(".sprig-question-body");if(!Fe(r))return e;const n=r.scrollHeight;return n<100?e:e-(n-100)},Wa=(e,t)=>{const r=t.querySelector(e);if(!Fe(r))return 0;const n=getComputedStyle(r);return parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+(parseFloat(n.marginLeft)+parseFloat(n.marginRight))+(parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth))},ru=(e,t,r)=>{const n=e.querySelector(".ul-card__container"),s=e.querySelector(".ul-app");let i=600,a=360,o=0;if(Fe(n)&&Fe(s)){const l=n.querySelector(".ul-card--matrix_grid"),c=!l&&t&&r;try{c&&(s.style.width="360px"),i=n.clientHeight,i+=(d=>{const f=d.querySelector(".sprig-question-body"),w=d.querySelector(".ul-card"),h=d.querySelector(".ul-card-main-content"),U=d.querySelector(".ul-footer"),m=d.querySelector(".sprig-container");let g=0;return Fe(w)&&(g+=w.scrollHeight-w.clientHeight),Fe(h)&&(g+=h.scrollHeight-h.clientHeight),Fe(f)&&(g+=f.scrollHeight-f.clientHeight),Fe(U)&&Fe(m)&&m.clientHeight===0&&(g+=U.clientHeight),g})(e);const u=getComputedStyle(n);o=i;const p=parseFloat(u.marginTop)+parseFloat(u.marginBottom);i+=p+(parseFloat(u.borderTopWidth)+parseFloat(u.borderBottomWidth)),l&&(a=l.scrollWidth,a+=Wa(".ul-card__container",e),a+=Wa(".sprig-question-body",e))}finally{c&&s.style.removeProperty("width")}}return[i+1,a,Uf(o,e)]},nu=()=>K,xt=()=>document.getElementById("sprig-feedback-container"),oi=()=>document.getElementById("sprig-feedback-loading-animation"),su=()=>!!document.getElementById(Zi);let Va=!1,K=null,ze=null,Qi=!1,Qt=null,ct=null;const Df=["bottom-left","bottom-right","center-left","center-right"],vn=()=>{var t;const e=window.UserLeap.container;return((t=e==null?void 0:e.parentElement)==null?void 0:t.id)==="sprig-feedback-loading-container"},iu=()=>document.getElementById("sprig-feedback-error-container"),ou=()=>{if(!K)return 0;const e=K==null?void 0:K.clientWidth,t=window.getComputedStyle(K);return e+parseInt(t.borderRightWidth||"0")+parseInt(t.borderLeftWidth||"0")},bn=e=>{const t=xt();t&&(ct!=null&&ct.endsWith("right")?t.style.right=`${e}px`:ct!=null&&ct.endsWith("left")&&(t.style.left=`${e}px`))},ps=()=>{if(K&&(vn()||iu())){z.off(F.SurveyAppeared,$t),ai();const e=ou();return bn(-e),!0}return!1},$t=()=>{if(!K||!ze)return;const e=oi();e&&e.remove(),K.style.height="auto",K.style.width="auto",ze.disabled=!1,Qi=!1},ai=()=>{if(K&&!oi()){const e=(()=>{if(oi())return;const t=document.createElement("div");return t.className="ul-loading-spinner-container",t.id="sprig-feedback-loading-animation",t.role="progressbar",t.setAttribute("aria-live","polite"),t.setAttribute("aria-busy","true"),t.setAttribute("aria-label","Processing..."),t.innerHTML=`
|
|
56
|
+
<div class="ul-loading-spinner">
|
|
57
|
+
<div class="first"></div>
|
|
58
|
+
<div class="second"></div>
|
|
59
|
+
<div class="third"></div>
|
|
60
|
+
<div class="fourth"></div>
|
|
61
|
+
</div>
|
|
62
|
+
`,t})();e&&(K.style.height="300px",K.style.width="360px",K.appendChild(e))}},Ga=()=>{K&&ze&&(bn(0),ze.disabled=!0,Qi=!0)},au=async(e,t,r)=>{const{buttonTheme:n,customStyles:s,eventId:i,placement:a,desktopDisplay:o,feedbackLabel:l,surveyUuid:c,surveyId:u}=e;window.UserLeap.feedbackCustomStyles=void 0;let p=xt();if(p){if(!t&&i===Qt)return;p.remove(),z.off(ur.SURVEY_FADING_OUT,ps)}Qt=i,pr({document,elementId:"sprig-feedback-style",styleString:'.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}#sprig-feedback-button{border-left:0;border-radius:0 8px 8px 0;display:grid;padding:8px;text-align:center;transition:all ease-in-out 1s;z-index:inherit}#sprig-feedback-button:hover{cursor:pointer}.sprig-feedback-button-label{writing-mode:vertical-lr;text-orientation:sideways}.sprig-feedback-button-right{transform:rotate(180deg)}.sprig-feedback-button-bottom{align-self:flex-end;margin-bottom:20px}.sprig-feedback-button-light{background:#efefee;color:#000;border:1px solid #e2e3e1}.sprig-feedback-button-dark{background:#000;color:#fff;border:1px solid #000000}#sprig-feedback-container{display:flex;align-items:center;position:fixed;transition:right .2s linear,left .2s linear;z-index:2147483646}.sprig-feedback-container-left{flex-flow:row-reverse}.sprig-feedback-container-center{top:50%;transform:translateY(-50%)}.sprig-feedback-container-bottom{bottom:0%;margin-bottom:15px}.sprig-feedback-loading-container{align-items:center;background-color:#fff;border:2px solid var(--feedback-border);display:flex;max-height:90vh;max-width:90vw;min-width:0px}.sprig-feedback-loading-container-left{border-left:none;border-radius:0 8px 8px 0}.sprig-feedback-loading-container-right{border-right:none;border-radius:8px 0 0 8px}#sprig-feedback-error-container{margin:auto;text-align:center;width:360px}.sprig-feedback-error-text{font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}#sprig-feedback-loading-container .ul-container{position:relative;max-height:inherit}#sprig-feedback-loading-animation{position:absolute}.sprig-feedback-loading-container-previews iframe{max-height:inherit!important}',nonce:window.UserLeap.styleNonce}),pr({document,elementId:"ul-custom-style",styleString:s??"",nonce:window.UserLeap.styleNonce}),Va=o==="center-modal",ct=a;const[d,f]=a.split("-");(m=>{if(xt()||!Df.includes(m))return;const[g,b]=m.split("-"),S=document.createElement("div");S.id="sprig-feedback-container",S.classList.add(`sprig-feedback-container-${b}`,`sprig-feedback-container-${g}`),document.body.appendChild(S)})(a),p=xt(),ze=document.createElement("button");const w=document.createElement("div");w.className="sprig-feedback-button-label",w.innerText=l,ze.appendChild(w),ze.id="sprig-feedback-button",ze.classList.add(`sprig-feedback-button-${f}`,`sprig-feedback-button-${d}`,`sprig-feedback-button-${n}`,"fade-in-transition"),z.on(ur.SURVEY_FADING_OUT,ps),ze.addEventListener("click",async()=>{const m=document.getElementById("sprig-feedback-error-container");if(su()||iu()){if(ps()){z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:je.FeedbackClosed,studyType:"feedbackButton","survey.id":u}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:je.FeedbackClosed,studyType:"feedbackButton","survey.id":u});const b=xt();m&&b&&(b.remove(),Qt=null,K=null)}return}if(Vn(Me(window.UserLeap))||Qi||Ga(),t)return K&&K.classList.add("sprig-feedback-loading-container-previews"),await Kt(t),void $t();const g=await(async b=>{const S=await Be(Oe("1",[nt],"startFeedbackStudy"),{body:JSON.stringify({surveyUuid:b}),method:"POST"});return S.ok?S.json:null})(c);if(g)z.once(F.SurveyAppeared,$t),Kt({...g,studyType:"feedbackButton"},r);else if(K){const b=Tf();K.appendChild(b),$t(),K.style.height="300px",K.style.width="360px"}}),p==null||p.appendChild(ze),z.emit(F.FeedbackButtonLoaded,{name:F.FeedbackButtonLoaded,"survey.id":u});const{useMobileStyling:h,_config:{border:U}}=window.UserLeap;if(Va||h)bn(0);else{const m=document.createElement("div");m.id="sprig-feedback-loading-container",m.className=`sprig-feedback-loading-container sprig-feedback-loading-container-${f}`,m.style.setProperty("--feedback-border",U),K=m,ai(),p==null||p.appendChild(m);const g=ou();bn(-g)}window.UserLeap._config.isOnQuestionsTab&&t&&!vn()&&K&&(Ga(),ai(),K&&K.classList.add("sprig-feedback-loading-container-previews"),Kt(t),$t())},Tf=()=>{const e=document.createElement("div");e.id="sprig-feedback-error-container",e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
|
|
63
|
+
<circle cx="20" cy="20" r="14.5" stroke="#B0B5B7" stroke-width="3"/>
|
|
64
|
+
<path d="M20 12L20 21.6" stroke="#B0B5B7" stroke-width="3" stroke-linecap="round"/>
|
|
65
|
+
<circle cx="19.9984" cy="27.6" r="1.6" fill="#B0B5B7"/>
|
|
66
|
+
</svg>`;const t=document.createElement("h3");return t.className="sprig-feedback-error-text",t.innerText="There was an error while loading the survey",e.appendChild(t),e},li=new class{constructor(){pe(this,"_ldData",{})}getAllLaunchDarklyVariations(){return this._ldData}setLDFlagsVariations(e){try{return!(!e||typeof e!="object"||Array.isArray(e))&&(Object.keys(this._ldData).forEach(t=>{delete this._ldData[t]}),Object.keys(e).forEach(t=>this._ldData[`!launch_darkly_${t}`]=(e[t]??0)+1),!0)}catch(t){return t instanceof Error&&window.UserLeap.reportError("setAllLDFlagsVariations",t),console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."),!1}}};Object.freeze(li);const cn=new class{constructor(){pe(this,"_optimizelyData",{})}setOptimizelyExperiment(e,t=!0){if(!e||typeof e!="object")return!1;const{experiments:r}=e;try{return t&&Object.keys(this._optimizelyData).map(n=>{delete this._optimizelyData[n]}),r&&r.map(n=>{const{id:s,variation:i}=n,a=this.transformExperimentId(s);i&&typeof i=="string"&&(this._optimizelyData[a]=i)}),!0}catch(n){return n instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",n),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(e){return this._optimizelyData[this.transformExperimentId(e)]}transformExperimentId(e){return"!optimizely_experiments_"+e}getAndSetWebOptimizelyExperiments(){var e;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const t=(e=window.optimizely.get("state"))==null?void 0:e.getExperimentStates({isActive:!0});if(t){const r=Object.keys(t).map(n=>{var s,i;return(s=t[n].variation)!=null&&s.name?{id:n,variation:(i=t[n].variation)==null?void 0:i.name}:{id:n,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r},!1),!0}return!1}return!1}catch(t){return t instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",t),!1}}};Object.freeze(cn);class Pf{constructor(t,r){pe(this,"paused");pe(this,"queue");pe(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(r)}flush(t){const r=t.length;if(r)for(let n=0;n<r;n++)this.push(t[n])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const r=Array.prototype.slice.call(t,1),n=t[0],s=this.ul[n];s instanceof Function?s.apply(this.ul,r):n&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",n)}}perform(t){if(this.paused){let r=()=>{};const n=new Promise(function(s){r=function(){s(t())}});return this.queue.push(r),n}return t()}empty(){this.queue.length=0}}let lu=!0,ci=!1;const _f=["sdk_event_queue_latency_seconds","sdk_replay_add_event_batch_seconds","sdk_replay_cleanup_seconds","sdk_replay_compression_seconds","sdk_replay_get_events_between_seconds","sdk_replay_snapshot_seconds","sdk_mutations_nodes_added","sdk_mutations_nodes_removed","sdk_mutations_attributes_changed","sdk_mutations_character_data","sdk_dom_nodes_count","sdk_page_html_characters"];let ui,Yt={};class Nf{constructor(t){pe(this,"_values",[]);pe(this,"_isWebMetric");this.name=t,this._isWebMetric=_f.includes(this.name)}report(t){if(lu&&this._values.push({time:Date.now(),value:t}),ci||!this._isWebMetric)return;const r=this.findExceededThreshold(t);r&&ui&&ui(t,r)}collect(){const t=this._values;return this._values=[],t}findExceededThreshold(t){const r=Yt[this.name];if(r)return r.find(n=>this.valueExceedsThreshold(t,n))}valueExceedsThreshold(t,r){return r.type==="max"?t>r.value:r.type==="min"&&t<r.value}}const gr={},Ve=e=>{const t=new Nf(e);return gr[e]=t,t},cu=(e,t)=>{let r=gr[e];return r||(r=Ve(e)),r.report(t)},Ff=({reportingIntervalSeconds:e,postMetrics:t})=>{e?setInterval(()=>{(async r=>{const n=Object.values(gr).map(s=>({name:s.name,values:s.collect()}));if(n.some(s=>s.values.length))try{await r(JSON.stringify(n))}catch(s){s instanceof Error&&N.error("MetricsErr",{error:{message:s.message,name:s.name}})}})(t)},1e3*e):lu=!1};let uu,du;const di=e=>{let t=0,r=e.firstElementChild;for(;r;)t+=di(r),r.shadowRoot&&(t+=di(r.shadowRoot)),r=r.nextElementSibling,t++;return t},Ha=()=>{uu.report(di(document.body)),du.report(document.documentElement.innerHTML.length)},pi=(e,t)=>{const r=performance.now();document.hidden?setTimeout(()=>pi(e,t),e):setTimeout(()=>{const n=performance.now()-r;t.report(n/1e3),setTimeout(()=>pi(e,t),e)},0)};let Sn,In,Cn,kn,$a,ut={};const Hr=(e,t=1)=>{const{name:r}=e;ut[r]=(ut[r]||0)+t},pu=e=>{let t=1;return e.childNodes.forEach(r=>{t+=pu(r)}),t},Ya=e=>{let t=0;return e.forEach(r=>{t+=pu(r)}),t},Bf=e=>{switch(e.type){case"childList":return Hr(Sn,Ya(e.addedNodes)),void Hr(In,Ya(e.removedNodes));case"attributes":return void Hr(Cn);case"characterData":return void Hr(kn)}},zf=e=>e.forEach(Bf),jf=()=>{Sn.report(ut[Sn.name]||0),In.report(ut[In.name]||0),Cn.report(ut[Cn.name]||0),kn.report(ut[kn.name]||0),ut={}},Wf=(e=1e3)=>{Sn=Ve("sdk_mutations_nodes_added"),In=Ve("sdk_mutations_nodes_removed"),Cn=Ve("sdk_mutations_attributes_changed"),kn=Ve("sdk_mutations_character_data"),$a=new MutationObserver(zf),$a.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),setInterval(jf,e)},Vf=({isWeb:e,reportingIntervalSeconds:t,thresholds:r,postMetrics:n})=>{((s,i)=>{Yt={},ci=!1,s==null||s.forEach(a=>{var o;a.metric in Yt||(Yt[a.metric]=[]),(o=Yt[a.metric])==null||o.push(a)}),ui=i})(r,(s,i)=>{var a,o;if((a=le.replay)!=null&&a.isReplayRecording()){const l=`Value: ${s} on ${i.metric} violated threshold of ${i.type} ${i.value}`;(o=le.replay)==null||o.disableRecording("Threshold violated",new Error(l),{reportError:!1}),window.UserLeap.reportError("Sdk Performance Metric threshold violated",new Error("Sdk Performance Metric threshold violated"),{metricName:i.metric,type:i.type,value:i.value},{metricName:i.metric}),ci=!0}}),Ff({reportingIntervalSeconds:t,postMetrics:n}),e&&(((s=1e3)=>{const i=Ve("sdk_event_queue_latency_seconds");pi(s,i)})(),((s=1e4)=>{uu=Ve("sdk_dom_nodes_count"),du=Ve("sdk_page_html_characters"),Ha(),setInterval(Ha,s)})(),Wf())},Gf="test",Hf=["popState","pushState","replaceState"];let er;const En={},zt="!email",hu="pageUrl";let hs=window.location.href;function tr(e){var o,l;const{pageUrlEvents:t,interactiveEvents:r,dismissOnPageChange:n,platform:s}=window.UserLeap._config;if(s&&s!=="web")return;hs!==window.location.href&&N.navigation("LocationChange",{from:hs,to:window.location.href}),hs=window.location.href;const i=gu().trackStartUrl,a=i?String(i):null;t&&wu(window.location.href),r&&(fu(),$f()),nu()&&(()=>{if(vn())return;const c=xt();c&&(tu(Qt)||(c.remove(),Qt=null,K=null))})(),me.getItem("sprig.isCapturingHeatmap")&&((l=(o=le.replay)==null?void 0:o.checkPendingHeatmapsUrl())==null||l.then(c=>{var u;c&&((u=le.replay)==null||u.uploadReadyPendingCaptures(!0))})),!vn()&&n&&a&&a!==window.location.href&&e&&Hf.includes(e.type)&&window.UserLeap("dismissActiveSurvey",je.PageChange)}const mu={capture:!0},$f=()=>{const e=window.UserLeap._config.interactiveEvents.filter(r=>Ki(r,window.location.href)).map(r=>{const{name:n,properties:s}=r,{selector:i,innerText:a}=s;return i?o=>{if(ja(o.target))try{o.target.closest(i)&&window.UserLeap("track",n)}catch{}return!1}:o=>(ja(o.target)&&o.target.innerText===a&&window.UserLeap("track",n),!1)}),t=r=>e.forEach(n=>n(r));window.UserLeap._config.interactiveEventsHandler=t,window.addEventListener("click",t,mu)},fu=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,mu),delete window.UserLeap._config.interactiveEventsHandler};function gu(){const e=Ce.getItemObject("userleap.ids");return e&&e[window.UserLeap.envId]||{}}function yu(){if(window.previewMode)return;const e=Ce.getItemObject("sprig.anon.env.vid.map")||{},t=e[window.UserLeap.envId];window.UserLeap.visitorId=t||gt(),N.info("NewVid",{vid:window.UserLeap.visitorId}),Ie("vid",window.UserLeap.visitorId),t||(e[window.UserLeap.envId]=window.UserLeap.visitorId,Ce.setItemObject("sprig.anon.env.vid.map",e)),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}function wu(e,t,r,n){var s,i;try{if(e.endsWith("mock_snippet.html"))return;N.info("PageView",{url:e});const a=(s=document==null?void 0:document.querySelector('meta[name="description"]'))==null?void 0:s.getAttribute("content");(i=le.replay)==null||i.RecordPageView({...a&&{description:a},url:e,referrer:document.referrer,pageTitle:document.title});const o=window.UserLeap._config.pageUrlEvents;let l=!1;if(o&&o.length)for(let u=0;u<o.length&&(l=Ki(o[u],e),!l);u++);if(!l)return;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const c={url:e};n&&(c.trackPageView=!0),window.UserLeap._queue.push(["track",hu,t,c,r])}catch(a){a instanceof Error&&(a.stack=e,window.UserLeap.reportError("trackPageView",a)),console.warn("[Sprig] (ERR-428) Failed to track page view",a)}}function Yf(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const n=t.apply(this,r),s=new Event("pushState");return window.dispatchEvent(s),tr(s),n})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const n=t.apply(this,r),s=new Event("replaceState");return window.dispatchEvent(s),tr(s),n})(e.replaceState)),["hashchange","popstate"].forEach(t=>window.addEventListener(t,tr,!0))}async function ms(e,t){const r=Xi();e&&!t&&(window.UserLeap._config.mode=Gf);const n=Vn(Me(window.UserLeap)),s=await Be(function(i){const a=new URL(Oe("1",[st],"questions"));return Object.entries(i||{}).forEach(([o,l])=>{l&&a.searchParams.append(o,String(l))}),a.toString()}({desktopDisplay:window.UserLeap._config.desktopDisplay,isMobile:n,previewLanguage:window.UserLeap._config.previewLanguage,surveyid:e==null?void 0:e.surveyId,surveytemplateid:e==null?void 0:e.surveyTemplateId,vid:r}),{shouldDropOnRateLimit:!0});if(!s.ok)return s.reportError&&s.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",s.error),window.UserLeap.reportError("getQuestions",s.error)),{success:!1,surveyState:"no survey"};if(s.json.delay&&await wn(s.json.delay),!s.json.isFeedback)return Kt(s.json,er);{const{feedbackLabel:i,productConfig:a,surveyUuid:o,feedbackCustomStyles:l}=s.json,{buttonTheme:c,placement:u,desktopDisplay:p}=a;au({customStyles:l,buttonTheme:c,desktopDisplay:p,eventId:0,feedbackLabel:i,placement:u,surveyUuid:o,surveyId:e==null?void 0:e.surveyId},s.json)}}function Jf(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:r,dismissOnPageChange:n}=e;t&&function(s){let i=s.length;for(;i;){const a=Math.floor(Math.random()*i);i-=1;const o=s[i];s[i]=s[a],s[a]=o}}(t),(t||r||n)&&(Yf(),tr())}const qf=function(e){if(!window.UserLeap)return;const t=async(s={})=>{var m,g,b,S,M;const{userId:i,anonymousId:a,metadata:o={},properties:l,showSurveyCallback:c}=s;let{eventName:u}=s;if(window.UserLeap.debugMode&&u!==hu&&console.info("[DEBUG] Sprig track",s),e.mode==="test")return;const p=Ce.getItem("sprig.previewKey")??void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const C="[Sprig] - Skipping tracking without userId";return console.warn(C),{success:!1,message:C,surveyState:"no survey"}}if(!u||u.trim().length===0){u=u?String(u):"";const C="[Sprig] - Invalid event name "+u;return console.warn(C),{success:!1,message:C,surveyState:"no survey"}}const d=er??window.location.href;o.url||(o.url=d),Ie("trackStartUrl",d),(g=(m=window.UserLeap)==null?void 0:m._config)!=null&&g.optimizelyEnabled&&(dr(Me(window.UserLeap))||cn.getAndSetWebOptimizelyExperiments(),o.optimizelyExperiments=Object.assign({},cn.getAllOptimizelyExperiments())),(S=(b=window.UserLeap)==null?void 0:b._config)!=null&&S.launchDarklyEnabled&&(o.launchDarklyFlags=li.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),a&&(window.UserLeap.partnerAnonymousId=a),l&&(o.eventProperties=l),(M=le.replay)==null||M.RecordEvent({name:u,url:o.url}),N.info("TrackEvent",{eventName:u});const f=window.UserLeap.delayingSurvey||su()?await Be(Oe("1",[nt],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:o}],previewKey:p}),method:"POST",shouldDropOnRateLimit:!0}):await Be(Oe("1",[nt],"events"),{body:JSON.stringify({event:u,metadata:o,previewKey:p}),method:"POST",shouldDropOnRateLimit:!0});if(!f.ok){const C="[Sprig] (ERR-421) Failed to track event";return f.reportError&&(console.warn(C,f.error),f.error&&window.UserLeap.reportError("track",f.error)),{success:!1,message:C,error:f.error,surveyState:"no survey"}}i&&Ie("uid",i),a&&Ie("aid",a);const w=f.json;w.invalidPreviewKey&&Ce.removeItem("sprig.previewKey");const h=o.trackPageView?o.url:void 0;return w!=null&&w.feedbackButton&&au(w.feedbackButton,void 0,h),await async function(C,A){var k,L;let D=!0;return!(A&&((k=C==null?void 0:C.json)!=null&&k.surveyId)&&(window.UserLeap.delayingSurvey=!0,D=await A(C.json.surveyId),window.UserLeap.delayingSurvey=!1,!D))&&((L=C==null?void 0:C.json)!=null&&L.delay&&!window.UserLeap.isMobileSDK&&(window.UserLeap.delayingSurvey=!0,await wn(C.json.delay),window.UserLeap.delayingSurvey=!1),D)}(f,c)?function(C){if(!window.UserLeap._config.dismissOnPageChange)return!0;const A=new URL(C),D=new URL(er??window.location.href);return A.hostname===D.hostname&&A.pathname===D.pathname}(d)?Kt(w,h):{success:!1,message:"Study should not be displayed after page navigation",surveyState:"no survey"}:{success:!1,message:"[Sprig] Callback returned false, aborting rendering of survey",surveyState:"no survey"}},r=(s,i)=>{var o;const a=(o=s==null?void 0:s.querySelector(`[id="${Zi}"]`))==null?void 0:o.contentDocument;a&&pr({document:a,elementId:"ul-custom-style",styleString:i})},n={displaySurvey:async s=>(console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",je.Override),ms({surveyId:s},!0)),_previewSurvey(s){window.UserLeap("dismissActiveSurvey",je.Override),ms({surveyTemplateId:s},!1)},_reviewSurvey(s){window.UserLeap("dismissActiveSurvey",je.Override),ms({surveyId:s},!1)},previewSurvey(s){n._previewSurvey(s)},reviewSurvey(s){n._reviewSurvey(s)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(s=je.API){window.UserLeap.container&&(z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},async setAttribute(s,i){if(!s||!i&&i!==0&&i!==!1){const a="[Sprig] - Disregarding empty attribute / value provided";return console.warn(a),{success:!1,message:a}}return this.setAttributes({[s]:i})},async setAttributes(s){if(s==null||Object.keys(s).length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}return this.identifyAndSetAttributes({attributes:s})},async identifyAndSetAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",s),e.mode==="test")return;if(s===null||typeof s!="object"||!(s.userId||s.anonymousId||s.attributes)){const u="[Sprig] - Disregarding empty payload provided";return console.warn(u),{success:!1,message:u}}const{userId:i,anonymousId:a,attributes:o}=s;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const u="[Sprig] - Skipping tracking without userId";return console.warn(u),{success:!1,message:u}}if(o){o.email&&!o[zt]&&(o[zt]=o.email,delete o.email);const u=Object.keys(o);for(const p of u)o[p]===En[p]&&delete o[p]}if(!(o&&Object.keys(o).length!==0||i&&window.UserLeap.userId!==i||a&&window.UserLeap.partnerAnonymousId!==a))return{success:!0};const l={};let c;return i&&(l.userId=window.UserLeap.userId=i),a&&(l.partnerAnonymousId=window.UserLeap.partnerAnonymousId=a),o&&Object.keys(o).length>0?(c=await Be(Oe("1",[st,nt],"attributes"),{body:JSON.stringify(o),method:"PUT"}),c.ok?Object.assign(En,o):c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await Be(Oe("1",[st,nt]),{body:JSON.stringify(l),method:"PUT"}),o&&o[zt]&&(window.UserLeap.email=o[zt]),c.ok&&(i&&Ie("uid",i),a&&Ie("aid",a)),{success:!!c.ok}},async removeAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",s),e.mode==="test")return;if(s==null||s.length===0){const a="[Sprig] - Disregarding empty attributes provided";return console.warn(a),{success:!1,message:a}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const a="[Sprig] - Skipping tracking without userId";return console.warn(a),{success:!1,message:a}}const i=await Be(Oe("1",[st,nt],"attributes"),{body:JSON.stringify({delete:s}),method:"DELETE"});return!i.ok&&i.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",i.error),i.error&&window.UserLeap.reportError("removeAttributes",i.error)),{success:!!i.ok}},async addSurveyListener(s){z.on(F.SurveyLifeCycle,s)},async removeSurveyListener(s){z.removeListener(F.SurveyLifeCycle,s)},async addListener(s,i){z.on(s,i)},async removeListener(s,i){z.removeListener(s,i)},async removeAllListeners(){z.removeAllListeners()},setPreviewKey(s){s&&typeof s=="string"&&Ce.isStorageAvailable&&s&&Ce.setItem("sprig.previewKey",s)},async setUserId(s){var o;if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",s),s==null){const l=`[Sprig] - Invalid userId ${s}`;return console.warn(l),{success:!1,message:l}}if(e.mode==="test"||s===window.UserLeap.userId)return;window.UserLeap.userId=s;const i=window.UserLeap.visitorId,a=await Be(Oe("1",[st,nt]),{body:JSON.stringify({userId:s}),method:"PUT"});a.ok?(i!==window.UserLeap.visitorId&&((o=le.replay)==null||o.clearUserReplayData()),Ie("uid",s)):a.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",a.error),a.error&&window.UserLeap.reportError("setUserId",a.error))},async setPartnerAnonymousId(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",s),s==null){const i=`[Sprig] - Invalid partnerAnonymousId ${s}`;return console.warn(i),{success:!1,message:i}}return window.UserLeap.partnerAnonymousId=s,Ie("aid",s),{success:!0}},track:async(s,i,a={},o=void 0)=>t({eventName:s,properties:i,metadata:a,showSurveyCallback:o}),identifyAndTrack:async s=>await t(s),trackPageView(s,i=void 0,a=void 0,o=!0){er=s,wu(s,i,a,o)},applyFeedbackStyles({button:s="",view:i=""}){window.UserLeap.feedbackCustomStyles=i,document.getElementById("sprig-feedback-style")&&pr({document,elementId:"ul-custom-style",styleString:s,nonce:window.UserLeap.styleNonce}),r(document.querySelector(".ul-container-feedback"),i)},applyStyles(s){window.UserLeap.customStyles=s,r(window.UserLeap.container,s)},setWindowDimensions(s,i){var d,f;const a=typeof s=="string"?parseInt(s,10):s,o=typeof i=="string"?parseInt(i,10):i;isNaN(a)||isNaN(o)||(window.UserLeap.windowDimensions={width:a,height:o});const l=Me(window.UserLeap),c=Vn(l),u=l["userleap-platform"]==="web";if(!window.UserLeap.frameId)return;const p=document.getElementById(window.UserLeap.frameId);p&&(window.UserLeap.useMobileStyling&&((d=window.UserLeap.windowDimensions)!=null&&d.width&&(p.style.width=`${window.UserLeap.windowDimensions.width}px`),(f=window.UserLeap.windowDimensions)!=null&&f.height&&(p.style.maxHeight=window.UserLeap.windowDimensions.height-20+"px"),p.contentDocument&&(p.style.height=String(ru(p.contentDocument,u&&!c,qi(l))[0])+"px")),z.emit(F.SurveyDimensions,{name:F.SurveyDimensions,contentFrameWidth:p.clientWidth,contentFrameHeight:p.clientHeight,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},logoutUser(){var s;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),N.info("LogOut",{vid:window.UserLeap.visitorId,userId:window.UserLeap.userId}),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,Ce.removeItem("userleap.ids"),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),yu(),(s=le.replay)==null||s.clearUserReplayData(),window.UserLeap._queue.unpause()},teardown(){["hashchange","popstate"].forEach(s=>window.removeEventListener(s,tr,!0)),window.UserLeap._config.interactiveEvents&&fu(),window.UserLeap("dismissActiveSurvey",je.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(s,i=!0){var a,o;if((o=(a=window.UserLeap)==null?void 0:a._config)!=null&&o.optimizelyEnabled)try{const l=typeof s=="string"?JSON.parse(s):s;cn.setOptimizelyExperiment(l,i)}catch(l){console.warn("[Sprig] Error with integrating Optimizely data"),l instanceof Error&&window.UserLeap.reportError("integrateOptimizely",l)}else console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.")},integrateOptimizelyClient(s){var i,a;if(!((a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.optimizelyEnabled))return void console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");s.notificationCenter.addNotificationListener("ACTIVATE:experiment, user_id,attributes, variation, event",({experiment:o,variation:l})=>{const c={experiments:[{id:o.id,variation:l.key}]};window.UserLeap("integrateOptimizely",c,!1)})},importLaunchDarklyData(s){var i,a;(a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.launchDarklyEnabled?li.setLDFlagsVariations(s):console.warn("[SPRIG] LaunchDarkly integration is currently not enabled for your product.")},setVisitorAttribute:(s,i)=>(console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(s,i)),setEmail:async s=>n.setAttribute(zt,s),setVisitorEmail:async s=>(console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(s)),_generateVideoUploadUrl:async s=>async function(i){var o;if(!i)return;const a=`${window.UserLeap._API_URL}/2/environments/integrations/upload`;try{const l=await fetch(a,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(l.ok){const c=await l.json();return(o=c==null?void 0:c.upload)==null?void 0:o.url}return null}catch(l){console.warn("[Sprig] Error with generating video upload url"),l instanceof Error&&window.UserLeap.reportError("generateVideoUploadUrl",l)}}(s),_reportMetric(s,i){cu(s,i)},_completeSessionReplay:async({surveyId:s,responseGroupUuid:i,eventDigest:a})=>{var o;return le.replay?(o=le.replay)==null?void 0:o._completeSessionReplay({surveyId:s,responseGroupUuid:i,eventDigest:a,headers:Me(window.UserLeap)}):(window.UserLeap.reportError("_completeSessionReplay",new Error("Replay module not registered")),!1)}};Object.assign(window.UserLeap,n)};async function Xf(e,t,r={},n={}){const s=window.__cfg&&window.__cfg.mode,i=Xi(),a=window.UserLeap.envId,o=window.document.documentElement,l={mode:s,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:o.clientWidth,clientHeight:o.clientHeight,location:er??window.location.href,language:window.navigator.language,...r},c={action:e,breadcrumbs:N.breadcrumbs,err:{message:`${t==null?void 0:t.name} - ${t==null?void 0:t.message}`,stack:t==null?void 0:t.stack},meta:l,vid:i,envId:a,...n};(await Be(Oe("1",null,"errors"),{method:"POST",headers:{"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c),shouldDropOnRateLimit:!0})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function Zf(e={}){var n;(n=window.SprigLoggerCallback)==null||n.call(window,"Initializing Sprig");const t=new URLSearchParams(window.location.search).get("sprigPreviewKey")??"";async function r(){var d,f,w,h,U;if(window.UserLeap.loaded)return;if((d=window.SprigLoggerCallback)==null||d.call(window,"Loading Sprig"),window.UserLeap.reportError=Xf,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const m in window.UserLeap._config)window.UserLeap[m]=window.UserLeap._config[m];if(!window.UserLeap.envId){if(!window.UserLeap.appId)throw new Error("Missing Environment id");window.UserLeap.envId=window.UserLeap.appId}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const s=gu(),i=window.UserLeap.sampleRate;let a=s.sampled;if(i){if(a===null&&(a=Math.random()<i,Ie("sampled",a)),!a)return}else a!==null&&Ie("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new Pf(window.UserLeap,[]),window.UserLeap._queue.pause();for(let m=0;m<o.length;m++)window.UserLeap._queue.push(o[m]);const l=s.token;l?(window.UserLeap.token=l,window.UserLeap.visitorId=s.vid??null,window.UserLeap.userId=s.uid??null,window.UserLeap.partnerAnonymousId=s.aid??null):yu();const c=dr(Me(window.UserLeap));(f=window.SprigLoggerCallback)==null||f.call(window,"Sprig fetching config");const u=await async function(m){var M,C;const g=Me(window.UserLeap);document.addEventListener("securitypolicyviolation",Na);const b=await He(Oe("1",[st],"config"),{headers:g});if(document.removeEventListener("securitypolicyviolation",Na),!b.ok)return(M=window.SprigLoggerCallback)==null||M.call(window,"Sprig config fetch failed"),b.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",b.error),b.error&&window.UserLeap.reportError("applyRemoteConfig",b.error)),ii("Disabled: failed to fetch configuration"),m;const S=b.json;return S!=null&&S.disabled?((C=window.SprigLoggerCallback)==null||C.call(window,"Sprig config fetch disabled"),ii(`Disabled: ${S.disabled}`),{disabled:S.disabled}):Object.assign({},S,m)}(e);(w=window.SprigLoggerCallback)==null||w.call(window,"Sprig fetched config"),Vf({isWeb:!c,reportingIntervalSeconds:u.metricsReportingEnabled||u.mobileMetricsReportingEnabled?u.metricsReportingIntervalSeconds:0,thresholds:u.metricThresholds,postMetrics:async m=>{var g;await Be(Oe("1",[st],"metrics"),{body:m,method:"POST",headers:{"x-ul-replay-enabled":`${!!((g=le.replay)!=null&&g.isReplayRecording())}`},shouldDropOnRateLimit:!0})}});const p=u.alwaysOnReplay?{userAgent:window.navigator.userAgent,surveyId:u.alwaysOnReplay.surveyId,responseGroupUuid:u.alwaysOnReplay.responseGroupUuid,sdkVersion:"2.33.1",maxDurationSeconds:u.alwaysOnReplay.maxDurationSeconds}:void 0;await((h=le.replay)==null?void 0:h.initializeReplay({maxReplayDurationSeconds:u.maxReplayDurationSeconds,maxInflightRequests:window.UserLeap.maxInflightReplayRequests??2,replaySettings:u.replaySettings,apiUrl:window.UserLeap._API_URL,alwaysOnConfig:p})),qf(u),await Jf(u),window.UserLeap._queue.unpause(),(U=window.SprigLoggerCallback)==null||U.call(window,"SdkReady"),z.emit(F.SDKReady,{mobileMetricsReportingEnabled:!!u.mobileMetricsReportingEnabled,metricsReportingInterval:u.metricsReportingIntervalSeconds||0,metricsThresholds:u.metricThresholds||[],maxMobileReplayDurationSeconds:u.maxMobileReplayDurationSeconds,mobileReplaySettings:u.mobileReplaySettings}),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}),z.on(F.VisitorIDUpdated,()=>{for(const m in En)delete En[m]})}window.UserLeap.UPDATES=ur,window.UserLeap("setPreviewKey",t),document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",()=>{r()},!1)}class hi{constructor(){pe(this,"UPDATES",ur)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,r){window.Sprig("setAttribute",t,r)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,r){window.Sprig("addListener",t,r)}removeListener(t,r){window.Sprig("removeListener",t,r)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,r={},n={}){window.Sprig("track",t,r,n)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}trackPageView(t,r,n){window.Sprig("trackPageView",t,r,n)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,r){window.Sprig("setWindowDimensions",t,r)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}}const Kf={configure:e=>{if(!e.envId&&!e.environmentId)throw new Error("Initialization Error: Sprig configure requires an environmentId");if(e.envId||(e.envId=e.environmentId??""),e.installationMethod="web-npm-bundled",window.Sprig)return window.Sprig;window.Sprig=function(){window.Sprig._queue.push(arguments)},Object.getOwnPropertyNames(hi.prototype).map(r=>{r!=="constructor"&&(window.Sprig[r]=hi.prototype[r])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,Zf(e),window.Sprig}};var it=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(it||{}),Je=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Je||{});const mi=(e,t)=>t.some(r=>e instanceof r);let Ja,qa;const fi=new WeakMap,fs=new WeakMap,xn=new WeakMap;let gi={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return fi.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ot(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&(t==="done"||t==="store")||t in e};function vu(e){gi=e(gi)}function Qf(e){return(qa||(qa=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(yi(this),t),ot(this.request)}:function(...t){return ot(e.apply(yi(this),t))}}function eg(e){return typeof e=="function"?Qf(e):(e instanceof IDBTransaction&&function(t){if(fi.has(t))return;const r=new Promise((n,s)=>{const i=()=>{s(t.error||new DOMException("AbortError","AbortError"))};t.oncomplete=()=>{n()},t.onerror=i,t.onabort=i});fi.set(t,r)}(e),mi(e,Ja||(Ja=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,gi):e)}function ot(e){if(e instanceof IDBRequest)return function(r){const n=new Promise((s,i)=>{r.onsuccess=()=>{s(ot(r.result))},r.onerror=()=>{i(r.error)}});return xn.set(n,r),n}(e);if(fs.has(e))return fs.get(e);const t=eg(e);return t!==e&&(fs.set(e,t),xn.set(t,e)),t}const yi=e=>xn.get(e);function wi(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);return t&&(r.onblocked=n=>t(n.oldVersion,n)),ot(r).then(()=>{})}const tg=["get","getKey","getAll","getAllKeys","count"],rg=["put","add","delete","clear"],gs=new Map;function Xa(e,t){if(!(e instanceof IDBDatabase)||t in e||typeof t!="string")return;if(gs.get(t))return gs.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=rg.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!tg.includes(r))return;const i=async function(a,...o){const l=this.transaction(a,s?"readwrite":"readonly");let c=l.store;return n&&(c=c.index(o.shift())),(await Promise.all([c[r](...o),s&&l.done]))[0]};return gs.set(t,i),i}vu(e=>({...e,get:(t,r,n)=>Xa(t,r)||e.get(t,r,n),has:(t,r)=>!!Xa(t,r)||e.has(t,r)}));const ng=["continue","continuePrimaryKey","advance"],Za={},vi=new WeakMap,bu=new WeakMap,sg={get(e,t){if(!ng.includes(t))return e[t];let r=Za[t];return r||(r=Za[t]=function(...n){vi.set(this,bu.get(this)[t](...n))}),r}};async function*ig(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,sg);for(bu.set(r,t),xn.set(r,yi(t));t;)yield r,t=await(vi.get(r)||t.continue()),vi.delete(r)}function Ka(e,t){return t===Symbol.asyncIterator&&mi(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&mi(e,[IDBIndex,IDBObjectStore])}vu(e=>({...e,get:(t,r,n)=>Ka(t,r)?ig:e.get(t,r,n),has:(t,r)=>Ka(t,r)||e.has(t,r)}));const Su=new class{constructor(e){pe(this,"awaitingResolvers",[]);pe(this,"activeCount",0);this.capacity=e}async acquire(){if(!(this.activeCount<this.capacity))return new Promise(e=>{this.awaitingResolvers.push(e)});this.activeCount++}release(){const e=this.awaitingResolvers.shift();e&&this.activeCount<=this.capacity?e():this.activeCount--}async execute(e){try{return await this.acquire(),await e()}finally{this.release()}}setLimit(e){this.capacity=e}}(2),Iu=async({apiUrl:e,surveyId:t,uploadId:r,etags:n,headers:s,responseGroupUuid:i,replayDuration:a,eventDigest:o},l=!1)=>{var u;if(!l&&!r&&!n)return void N.error("UploadErr",{isMobile:l,uploadId:r,etags:n});N.info("MarkUploadComplete",{surveyId:t});const c=await He(`${e}/sdk/1/completeSessionReplay`,{method:"POST",body:JSON.stringify({etags:n,uploadId:r,responseGroupUuid:i,surveyId:t,replayDuration:a,eventDigest:o,userAgent:(u=window==null?void 0:window.navigator)==null?void 0:u.userAgent}),headers:s,shouldRetryRequest:!0});return N.info("MarkUploadDone",{surveyId:t}),c},og=e=>{if(e instanceof Attr)return null;let t=1;for(let r=e.previousSibling;r;r=r.previousSibling)r.nodeName===e.nodeName&&++t;return t},Cu=e=>{if(e===null)return"";const t=[];if(e instanceof Document)return"/";for(let r=e;r&&!(r instanceof Document)&&r!==null;r=r instanceof Attr?r.ownerElement:r.parentElement){const n=t[t.length]={name:void 0,position:null};switch(r.nodeType){case Node.TEXT_NODE:n.name="text()";break;case Node.ATTRIBUTE_NODE:n.name="@"+r.nodeName;break;case Node.PROCESSING_INSTRUCTION_NODE:n.name="processing-instruction()";break;case Node.COMMENT_NODE:n.name="comment()";break;case Node.ELEMENT_NODE:n.name=r.nodeName}n.position=og(r)}return"/"+t.reverse().map(r=>r.position!==null?`/${r.name}[${r.position}]`:`/${r.name}`).join("")},We={capture:!0,passive:!0},ag=["a","button","input","option","li","link"],lg=["Escape","Enter","Backspace","F5","Tab"];let Rn=!1;const cg=["label","type","role","title","placeholder","errormessage","valuetext","href"],ug="aria-",Qa=e=>{var n;if(((n=e.tagName)==null?void 0:n.toLowerCase())==="html")return{element:"html"};const t=e.textContent,r=t?{text:t}:{};r.element=(s=>{if(!s.tagName)return"No tagName";const i=s.getAttribute("type");return i?`${i} ${s.tagName.toLowerCase()}`:s.tagName.toLowerCase()})(e);for(const s of e.attributes){let i=s.name;const a=s.value;i.startsWith(ug)&&(i=i.substring(5)),cg.includes(i)&&(r[i]=a)}return r},dg=e=>{var n;if(!e)return{};const t={...Qa(e)},r=e.parentElement;if(r&&ag.includes((n=r.tagName)==null?void 0:n.toLowerCase())){const s=Qa(r);Object.assign(t,s)}return t},ku=(e,t)=>{var n;let r=t.target;t.target===((n=window.document)==null?void 0:n.body)&&window.Sprig.pointerDownTarget&&(r=window.Sprig.pointerDownTarget),hg({x:t.x,y:t.y,type:e,elementAttributes:dg(r),windowHeight:window.innerHeight,windowWidth:window.innerWidth,...r instanceof HTMLElement?{rect:r==null?void 0:r.getBoundingClientRect(),xPath:Cu(r)}:{}})},Eu=e=>{lg.includes(e.key)&&gg({key:e.key})},xu=((e,t)=>{let r;return n=>{clearTimeout(r),r=window.setTimeout(()=>e(n),t)}})(e=>{if(!(e.target instanceof HTMLElement||e.target instanceof Document))return;let t=e.target;"scrollTop"in t||(t=t.documentElement),yg({xPath:Cu(t),x:t.scrollLeft,y:t.scrollTop,elementAttributes:{targetScrollWidth:t.scrollWidth,targetClientWidth:t.clientWidth,targetScrollHeight:t.scrollHeight,targetClientHeight:t.clientHeight}})},750),Ru=(el="left_click",e=>ku(el,e));var el;const Lu=e=>{e.button===2&&ku("right_click",e)},Ou=e=>{window.Sprig&&(window.Sprig.pointerDownTarget=e.target)},pg=()=>{Rn||(window.addEventListener("click",Ru,We),window.addEventListener("pointerdown",Ou,We),window.addEventListener("mousedown",Lu,We),window.addEventListener("keydown",Eu,We),window.addEventListener("scroll",xu,We),Rn=!0,window.performance.getEntriesByType("navigation").map(e=>e.type).includes("reload")&&mg({url:window.location.href,currentPageTitle:document.title}),window.performance.getEntriesByType("navigation").map(e=>e.type).includes("back_forward")&&fg({curUrl:window.location.href,fromUrl:document.referrer,currentPageTitle:document.title}))},ce={isRecording:!1,scrollEventUuids:{},stopRecording:()=>{}},Au=()=>window.indexedDB&&window.IDBKeyRange&&window.CompressionStream,we=(()=>{const e=me.getItem("sprig.sessionId");if(e)return N.info("SessionIDFound",{savedSessionId:e}),me.removeItem("sprig.sessionId"),e;const t=gt();return N.info("GeneratedSessionID",{uuid:t}),t})(),bi=()=>{me.setItem("sprig.disableReplayRecording","disabled")},$e=()=>!!me.getItem("sprig.disableReplayRecording");window.addEventListener("beforeunload",()=>{N.info("BeforeUnload",{sessionId:we}),me.setItem("sprig.sessionId",we)});const eo=e=>e&&e.trim().substring(0,500).replace(/\s\s+/g," ").replace(/\r?\n|\r/g," ").substring(0,250),Ge=(e,t)=>{var r,n;if(!$e()&&ce.isRecording)try{(n=(r=window.rrwebRecord)==null?void 0:r.addCustomEvent)==null||n.call(r,e,t)}catch(s){Gn("Error recording custom event",s)}},hg=e=>{var t;(t=e==null?void 0:e.elementAttributes)!=null&&t.text&&(e.elementAttributes.text=eo(e.elementAttributes.text)),Ge("Sprig_Click",e)},mg=e=>{Ge("Sprig_Refresh",e)},fg=e=>{e.currentPageTitle&&(e.currentPageTitle=eo(e.currentPageTitle)),Ge("Sprig_BackForward",e)},gg=e=>{Ge("Sprig_Keystroke",e)},yg=async e=>{const{x:t,xPath:r,y:n}=e,s=ce.scrollEventUuids[r];if(s)return ke(async()=>{var o,l,c,u;const i=await Q.openDB(),a=await i.get("events",s);if(a!=null&&a.event){const p=JSON.parse(a.event),d=t>((l=(o=p.data)==null?void 0:o.payload)==null?void 0:l.x),f=n>((u=(c=p.data)==null?void 0:c.payload)==null?void 0:u.y);if(!d&&!f)return null;d&&(p.data.payload.x=t),f&&(p.data.payload.y=n),p.data.payload.elementAttributes=e.elementAttributes,a.event=JSON.stringify(p),await i.put("events",a)}else Ge("Sprig_Scroll",e)},"Error updating scroll event");Ge("Sprig_Scroll",e)},Mu=()=>{ce.stopRecording&&(ce.stopRecording(),ce.stopRecording=void 0),ce.isRecording=!1,["cleanupInterval","inactivityInterval","pendingCheckInterval"].forEach(e=>{ce[e]&&(clearInterval(ce[e]),ce[e]=void 0)}),Rn&&(window.removeEventListener("click",Ru,We),window.removeEventListener("pointerdown",Ou,We),window.removeEventListener("mousedown",Lu,We),window.removeEventListener("keydown",Eu,We),window.removeEventListener("scroll",xu,We),Rn=!1)},wg=["did not allow mutations","called in an invalid security context"],vg=(e,t,{reportError:r=!0,extraInfo:n={}})=>{if(!$e()&&t instanceof Error){if(bi(),t.name==="VersionError")return N.error("VersionErr",{message:e}),Q.deleteDB();(s=>{if(!s)return!0;for(const i of wg)if(s.toLowerCase().includes(i))return!1;return!0})(t==null?void 0:t.message)&&(r&&window.UserLeap.reportError(e,t,n),Q.clearAll())}},Gn=(e,t,{reportError:r}={reportError:!0})=>{Mu(),N.error("ReplayErr",{code:t.code,name:t.name}),vg(e,t,{reportError:r})},ke=async(e,t)=>{try{return await e()}catch(r){Gn(t,r)}};Au()&&(wi("replayStorage").catch(console.error),wi("sprig.replay").catch(console.error));const Q=new class{openDB(){return function(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const a=indexedDB.open(e,t),o=ot(a);return n&&(a.onupgradeneeded=l=>{n(ot(a.result),l.oldVersion,l.newVersion,ot(a.transaction),l)}),r&&(a.onblocked=l=>r(l.oldVersion,l.newVersion,l)),o.then(l=>{i&&(l.onclose=()=>i()),s&&(l.onversionchange=c=>s(c.oldVersion,c.newVersion,c))}).catch(()=>{}),o}("sprigReplay",1,{upgrade:(e,t,r)=>{if(r===0&&me.setItem("sprig.pendingCount","0"),!e.objectStoreNames.contains("events")){const n=e.createObjectStore("events",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+timestamp]",["sessionId","timestamp"])}if(!e.objectStoreNames.contains("chunkUploads")){const n=e.createObjectStore("chunkUploads",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+status]",["sessionId","status"]),n.createIndex("[uploadId+status]",["uploadId","status"]),n.createIndex("[sessionId+status+uploadId]",["sessionId","status","uploadId"])}if(!e.objectStoreNames.contains("pendingCaptures")){const n=e.createObjectStore("pendingCaptures",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+targetTimestamp]",["sessionId","targetTimestamp"])}}})}deleteDB(){return wi("sprigReplay").catch(console.error)}async bulkAdd(e,t){const r=(await this.openDB()).transaction(e,"readwrite");return Promise.all([...t.map(n=>r.store.add(n)),r.done])}async clearAll(){const e=(await this.openDB()).transaction(["events","chunkUploads","pendingCaptures"],"readwrite");return Promise.all([e.objectStore("events").clear(),e.objectStore("chunkUploads").clear(),e.objectStore("pendingCaptures").clear()])}async deleteBySessionId(e,t){const r=IDBKeyRange.only(t),n=(await this.openDB()).transaction(e,"readwrite"),s=n.store.index("sessionId");for await(const i of s.iterate(r))await i.delete();await n.done}async updatePartial(e,t,r){const n=(await this.openDB()).transaction(e,"readwrite"),s=await n.store.get(t);s&&await n.store.put({...s,...r}),await n.done}async deleteRowsBefore(e,t,r=()=>!0){const n=IDBKeyRange.upperBound(t,!0),s=(await this.openDB()).transaction(e,"readwrite"),i=s.store.index("timestamp");for await(const a of i.iterate(n))r(a.value)&&await a.delete();await s.done}async getEventsBetween(e,t=Date.now()){if(e>=t)return Promise.resolve([]);const r=IDBKeyRange.bound([we,e],[we,t],!1,!0);return(await this.openDB()).getAllFromIndex("events","[sessionId+timestamp]",r)}async updateEventsExpiredAt(e,t,r=30){const n=new Date,s=n.setMinutes(n.getMinutes()+(r??30)),i=(await this.openDB()).transaction("events","readwrite"),a=i.store.index("[sessionId+timestamp]"),o=IDBKeyRange.bound([we,e],[we,t],!1,!0);for await(const l of a.iterate(o))await l.update({...l.value,expiredAt:s});await i.done}async deleteChunkUploads(e,t){const r=IDBKeyRange.only([t,e]),n=(await this.openDB()).transaction("chunkUploads","readwrite");let i=await n.store.index("[uploadId+status]").openCursor(r);for(;i;)i.delete(),i=await i.continue();await n.done}async getChunkUploadsByStatus({sessionId:e,status:t,uploadId:r}){const n=(await this.openDB()).transaction("chunkUploads","readonly"),s=r?n.store.index("[uploadId+status]"):n.store.index("[sessionId+status]"),i=r?IDBKeyRange.only([r,t]):IDBKeyRange.only([e,t]);return s.getAll(i)}async getPendingCaptures(e={}){return(await(await this.openDB()).getAllFromIndex("pendingCaptures","sessionId",we)).filter(r=>!e.beforePresent||r.targetTimestamp<Date.now()).filter(r=>!e.isBeforeType||r.captureParams.replayParams.replayDurationType==="before").filter(r=>!e.isHeatmap||(r.captureParams.isHeatmap??!1))}async markPendingCaptureToCanUpload(e){const t=(await this.openDB()).transaction("pendingCaptures","readwrite"),r=t.store.index("sessionId");for await(const n of r.iterate(we)){const s=n.value;s.captureParams.responseGroupId===e&&await n.update({...s,canUpload:!0})}await t.done}async markPendingHeatmapsReady(e){if(parseInt(me.getItem("sprig.pendingCount")??"0")===0)return null;const t=Date.now(),r=(await this.openDB()).transaction("pendingCaptures","readwrite"),n=r.store.index("sessionId");for await(const s of n.iterate(we)){const i=s.value;!i.captureParams.isHeatmap||e&&!e.includes(i.uuid)||await s.update({...i,targetTimestamp:t,captureParams:{...i.captureParams,triggerTimestamp:t,replayParams:{...i.captureParams.replayParams,replayDurationSeconds:Math.floor((t-i.timestamp)/1e3)}}})}await r.done}},Ke=[];let yr,Uu,Ln,Du,un,Tu,ht=[],Mt=!1,At=0,dn=!1,Pu=!1,to=[],ys=!1;const Ut=()=>dn&&!Mt&&Date.now()<=Ln,bg=({apiUrl:e,config:t,triggerSnapshot:r,forceInit:n=!1})=>{dn&&!n||(me.isStorageAvailable?(ht=[],to.splice(0),Ke.splice(0),At=0,un=r,Uu=e,yr={responseGroupUuid:t.responseGroupUuid,surveyId:t.surveyId,userAgent:t.userAgent,sdkVersion:t.sdkVersion},Du=t.maxDurationSeconds,kg(),dn||(Tu=window.setInterval(Cg,500)),dn=!0):Mt=!0)},Sg=[Je.Drag,Je.Input,Je.MediaInteraction,Je.MouseInteraction,Je.MouseMove,Je.Scroll,Je.Selection,Je.TouchMove],Ig=e=>e.type===it.Custom||e.type===it.IncrementalSnapshot&&Sg.includes(e.data.source),ro=e=>e.some(Ig),Cg=async()=>{if(!Ut())return void window.clearInterval(Tu);if(_u(),!ro(Ke))return;const e=Ke[0].timestamp;Date.now()-e>35e3&&(un==null||un())},_u=async()=>{if(ht.length||ys)return;ys=!0;const e=await xg();if(!e)return void(Mt=!0);to.splice(0,e.length).forEach(t=>t(e.shift())),e.forEach(t=>ht.push(t)),ys=!1},kg=()=>{const e=me.getItem("sprig.alwayson.info");if(e){N.info("Read stored session state",e);const t=JSON.parse(e);Mt=t.disabled,yr=t.metadata,ht=t.uploadUrls,At=t.currentIndex,Ln=t.expirationTimestamp,t.pendingEventTimestamp&&(N.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`),Eg(t.pendingEventTimestamp))}else Ln=1e3*Du+Date.now()},Eg=async e=>{const t=Date.now(),r=(await Q.getEventsBetween(e,t)).map(s=>JSON.parse(s.event));if(!ro(r))return;zu(r);const n=await Bu();n&&await Fu(n,r)},Nu=async(e,t)=>{try{const r=await e();if(!r.ok)throw new Error(`Error ${t}`);return r}catch{Mt=!0}},Fu=async(e,t)=>{if(!Ut()||!e)return;const r=await(async n=>{const s=new TextEncoder,i=new CompressionStream("gzip"),a=i.writable.getWriter(),o=s.encode(JSON.stringify(n));return a.write(o),a.close(),new Uint8Array(await new Response(i.readable).arrayBuffer())})(t);N.info("Uploading always-on events with presigned url"),await Nu(()=>He(e,{body:r,method:"PUT"}),"uploading always-on with presigned url")},xg=async()=>{if(!Ut())return;const{surveyId:e,responseGroupUuid:t}=yr,r={responseGroupUuid:t,surveyId:e,index:At+1};N.info("Fetching always-on upload urls",r);const n=await Nu(()=>He(`${Uu}/sdk/1/replayUrls`,{method:"POST",body:JSON.stringify(r),headers:Me(window.UserLeap)}),"fetching always-on signed urls");if(!n)return;const s=n.json.signedUrls;return N.info("Fetched more always-on upload urls",{body:r,urls:s}),s},Bu=async()=>{if(ht.length)return ht.shift();const e=new Promise(t=>{to.push(t)});return _u(),e},zu=e=>{var s,i,a;const t=e.length?e[e.length-1].timestamp:Date.now(),r=At,n=((i=(s=window.UserLeap)==null?void 0:s.config)==null?void 0:i.customMetadata)??((a=window.__cfg)==null?void 0:a.customMetadata);At++,e.push({timestamp:t,type:it.Custom,data:{tag:"Sprig_Meta",payload:{...yr,index:r,visitorId:window.UserLeap.visitorId??"",timestamp:t,customMetadata:n}}})},Rg=(e,t)=>{Ut()&&!Pu&&(e||Ke.length)&&(e&&Ke.length&&(async()=>{const r=Ke.splice(0);if(!ro(r))return;N.info("Capturing always-on event array to upload"),zu(r);const n=await Bu();n&&await Fu(n,r)})(),Ke.push(t))};window.addEventListener("beforeunload",async()=>{Pu=!0,Ut()&&(N.info("Always On handle page unload"),(()=>{let e;Ke.length&&(e=Ke[0].timestamp);const t={disabled:Mt,metadata:yr,uploadUrls:ht,currentIndex:At,pendingEventTimestamp:e,expirationTimestamp:Ln};N.info("Storing session state on unload",t),me.setItem("sprig.alwayson.info",JSON.stringify(t))})())});const ju=async(e,t)=>{const r=performance.now();let n;try{n=await e()}finally{const s=performance.now()-r;let i=gr[t];i||(i=Ve(t)),i.report(s/1e3)}return n},Wu=(e,t)=>{const r=performance.now();try{e()}finally{const n=performance.now()-r;let s=gr[t];s||(s=Ve(t)),s.report(n/1e3)}};let Vu=5e3,Si=6e4,Ii=0,at,Ci=!1,ki=[];const Lg=e=>{var t,r,n,s;if((t=e.event)!=null&&t.includes("Sprig_Scroll")){const i=(s=(n=(r=JSON.parse(e.event))==null?void 0:r.data)==null?void 0:n.payload)==null?void 0:s.xPath;if(!i)return;ce.scrollEventUuids[i]=e.uuid}ki.push(e),Ci||Og()},Og=()=>{Ci=!0,setTimeout(async()=>{if($e())return;const e=ki;ki=[],Ci=!1,Wu(async()=>{await(async t=>{const r=t.map(n=>({...n,sessionId:n.sessionId??we}));if(r.length!==0)return ke(()=>Q.bulkAdd("events",r),"Error storing replay events")})(e)},"sdk_replay_add_event_batch_seconds")},500)},Ag=(e,t,r)=>{ce.cleanupInterval=window.setInterval(()=>{const n=Date.now();ju(()=>ke(async()=>{$e()||await Promise.all([Q.deleteRowsBefore("events",n-1e3*e,s=>s.expiredAt===void 0||s.expiredAt<n-1e3*e),Q.deleteRowsBefore("chunkUploads",n-1e3*t),Q.deleteRowsBefore("pendingCaptures",n-1e3*r,s=>!s.canUpload)])},"Error deleting table rows"),"sdk_replay_cleanup_seconds"),N.debug("CleanupComplete")},3e4)},Mg=()=>{ce.pendingCheckInterval=window.setInterval(async()=>{ke(async()=>{await Ei()},"Error initiating pending captures")},5e3)};let ws=!1;const Ei=async(e=!1)=>{if(!ws)try{ws=!0;const t=parseInt(at??"0");if(t===0)return;const r=await Q.getPendingCaptures({beforePresent:!0,isBeforeType:e}),n=await Q.openDB();await Promise.all(r.map(async s=>(await n.delete("pendingCaptures",s.uuid),$u(s.captureParams,s.canUpload)))),at=(t-r.length).toString(),me.setItem("sprig.pendingCount",at)}finally{ws=!1}},Ug=async(e,t,r,n,s)=>{const i=Math.min(e+s,r),a=await ju(()=>Q.getEventsBetween(e,i),"sdk_replay_get_events_between_seconds");if(!(a!=null&&a.length))return N.debug("NoEventsFound"),{validStartFound:n,events:[]};if(!n){N.debug("ValidStartSearch");let o=-1;return a==null||a.forEach((l,c)=>{if(!l.isValidStart)return;const u=l.timestamp<=t;(o<0||u)&&(o=c)}),o<0?(N.debug("ValidStartNotFound"),{validStartFound:n,events:[]}):{validStartFound:!0,events:a==null?void 0:a.slice(o)}}return{validStartFound:n,events:a}},Gu=e=>Promise.all(e.map(async t=>{const r=await(async n=>Su.execute(async()=>{var a;N.info("UploadChunkStart",{chunkIndex:n.chunkIndex,surveyId:n.surveyId});const s=await He(n.uploadUrl,{body:n.data,method:"PUT"});N.http("UploadChunkEnd",{url:n.uploadUrl,method:"PUT",status_code:s.status,reason:s.statusText??"OK",chunkIndex:n.chunkIndex,surveyId:n.surveyId});const i=(a=s.headers)==null?void 0:a.get("ETag");if(!i)throw new Error(`Upload response did not include etag for upload ${n.uploadId}, part ${n.chunkIndex}`);return i}))(t);return await Q.updatePartial("chunkUploads",t.uuid,{data:null,etag:r,status:"UploadComplete"}),t.uploadId})),Hu=async e=>{const t=await Q.getChunkUploadsByStatus({status:"UploadComplete",uploadId:e});if(!(t!=null&&t.length))return void N.info("NoChunksForUpload",{uploadId:e});const r=t.reduce((i,a)=>(i.find(o=>o.chunkIndex===a.chunkIndex)||i.push(a),i),[]);r.sort((i,a)=>i.chunkIndex-a.chunkIndex);const n=r.map(i=>({ETag:i.etag,PartNumber:i.chunkIndex})).filter(i=>i.ETag!==null),s=r[0];await Iu({apiUrl:s.apiUrl,surveyId:s.surveyId,uploadId:e,responseGroupUuid:s.responseGroupId,etags:n,headers:s.completeUploadHeaders,replayDuration:s.replayDuration}),await Q.deleteChunkUploads("UploadComplete",e)},Dg=()=>{ke(async()=>{const e=await Q.getChunkUploadsByStatus({sessionId:we,status:"ReadyForUpload"});if(!(e!=null&&e.length))return;const t=await Gu(e);t!=null&&t.length&&await Promise.all(t.map(r=>{if(r)return Hu(r)}))},"Error uploading unfinished chunks")},Tg=async(e,t)=>{const r=t??Date.now();return(async(n,s)=>{const i=new TextEncoder;let a=null;const o=new CompressionStream("gzip"),l=o.writable.getWriter();let c=!1,u=!1,[p,d]=[0,0],f=[];for(let h=n-35e3;h<s;h+=Si){if({validStartFound:u,events:f}=await Ug(h,n,s,u,Si),!(f!=null&&f.length)){N.debug("NoEventsFound");continue}p===0&&(p=f[0].timestamp),d=f[f.length-1].timestamp;const U=f.map(b=>b.event);U.push(`{"timestamp":${s}}`);const m=`${c?",":"["}${U}`,g=i.encode(m);Wu(()=>{l.write(g)},"sdk_replay_compression_seconds"),c=!0}if(d-p<Vu)return N.debug("ReplayTooShort"),null;const w=i.encode("]");return l.write(w),l.close(),a=new Uint8Array(await new Response(o.readable).arrayBuffer()),a})(r-e,r)},tl=async e=>{const{surveyId:t,responseGroupId:r,visitorId:n,apiUrl:s,completeUploadHeaders:i,replayParams:a,triggerTimestamp:o}=e,l=await Tg(1e3*a.replayDurationSeconds,o);if(!(l!=null&&l.length))return void N.info("FileDataEmpty",{surveyId:t});const c=((p,d,f)=>{const w=p.length,h=1024*d*1024,U=Math.ceil(w/f),m=Math.max(h,U),g=[];let b=0;for(;b<w;)g.push(p.slice(b,b+m)),b+=m;return g})(l,a.minimumChunkSizeMb,a.signedUrls.length),u=await Promise.all(c.map(async(p,d)=>{const f=gt(),w={apiUrl:s,chunkIndex:d+1,completeUploadHeaders:i,etag:null,responseGroupId:r,status:"ReadyForUpload",surveyId:t,timestamp:o,totalChunks:c.length,data:p,uploadId:a.uploadId,uploadUrl:a.signedUrls[d].url,uuid:f,visitorId:n};return await(await Q.openDB()).add("chunkUploads",{...w,sessionId:w.sessionId??we}),w}));await(async(p,d)=>{await Gu(d),await Promise.all(p.map(f=>Hu(f)))})([a.uploadId],u)},$u=async(e,t)=>{if($e())return N.debug("ReplayDisabled-ScheduleOrCapture");const{isHeatmap:r,isStandalone:n,replayParams:s,triggerTimestamp:i,responseGroupId:a}=e,o=async()=>{setTimeout(()=>z.removeListener(F.QuestionAnswered,o),0),ke(async()=>{s.replayDurationType==="before"?await tl(e):await Q.markPendingCaptureToCanUpload(a)},"Error in schedule/capture callback")};ke(async()=>{if(s.replayDurationType==="after"||s.replayDurationType==="beforeAndAfter")return!n&&!r&&z.on(F.QuestionAnswered,o),void await Ju(e);if(n||r||t)await tl(e),r&&Pg();else{const l=35+s.replayDurationSeconds,c=i-1e3*l,u=i;await Q.updateEventsExpiredAt(c,u,s.expirationTimeLimitMinutes),z.on(F.QuestionAnswered,o)}},"Error in scheduling/capturing replay")},Pg=async()=>{parseInt(at??"0")||me.removeItem("sprig.isCapturingHeatmap"),me.getItem("sprig.teardownAfterCapture")&&(Mu(),Yu(),me.removeItem("sprig.teardownAfterCapture"))},Yu=async()=>$e()?N.debug("ReplayDisabled-ClearData"):Promise.all([Q.deleteBySessionId("events",we),Q.deleteBySessionId("pendingCaptures",we)]).catch(e=>{Gn("Error clearing user replay data",e)}),Ju=async e=>{if($e())return;const{isHeatmap:t,surveyId:r}=e,n=await Q.getPendingCaptures(),s=n==null?void 0:n.filter(l=>l.captureParams.surveyId===r);if(s!=null&&s.length)return void N.info("PendingCaptureExists",{surveyId:r});t&&(ce.isRecording&&ke(()=>{var l,c;return(c=(l=window.rrwebRecord)==null?void 0:l.takeFullSnapshot)==null?void 0:c.call(l,!0)},"Error recording full snapshot"),me.setItem("sprig.isCapturingHeatmap","true"),Ii=Date.now(),ce.inactivityInterval||(ce.inactivityInterval=window.setInterval(()=>{var l;l=Ii,Date.now()-l>=3e4&&ke(()=>Q.markPendingHeatmapsReady(),"Error in heatmap inactivity")},1e3)));const i={...e,replayParams:{...e.replayParams}};e.replayParams.replayDurationType==="beforeAndAfter"&&(i.replayParams.replayDurationSeconds*=2),i.replayParams.replayDurationType="before";const a=e.triggerTimestamp+1e3*e.replayParams.replayDurationSeconds;i.triggerTimestamp=a,at=(parseInt(at??"0")+1).toString(),me.setItem("sprig.pendingCount",at),await(await Q.openDB()).add("pendingCaptures",{canUpload:!1,captureParams:i,sessionId:we,targetTimestamp:a,timestamp:Date.now(),uuid:gt()})},_g=Object.freeze(Object.defineProperty({__proto__:null,RecordEvent:e=>{Ge("Sprig_TrackEvent",e)},RecordPageView:e=>{e.description&&(e.description=eo(e.description)),Ge("Sprig_PageView",e)},RecordSurveyShown:e=>{Ge("Sprig_ShowSurvey",e)},_completeSessionReplay:async({surveyId:e,responseGroupUuid:t,eventDigest:r,headers:n})=>{if(!e||!t)return!1;const s=window.UserLeap._API_URL,i=await Iu({surveyId:e,responseGroupUuid:t,eventDigest:r,apiUrl:s,headers:n},!0);return!(i!=null&&i.error)},checkPendingHeatmapsUrl:()=>$e()?N.debug("ReplayDisabled-PendingHeatmaps"):ke(async()=>{const e=(await Q.getPendingCaptures({isHeatmap:!0})).map(t=>({eventId:t.captureParams.eventId,uuid:t.uuid})).filter(({eventId:t})=>!tu(t)).map(({uuid:t})=>t);return N.info("PendingHeatmapsToComplete",{count:e.length}),e.length&&(await Q.markPendingHeatmapsReady(e),N.info("MarkedPendingHeatmapsReady")),e.length},"Error marking pending heatmaps ready"),clearUserReplayData:Yu,disableRecording:Gn,initializeReplay:async({maxReplayDurationSeconds:e,maxInflightRequests:t=2,replaySettings:r,teardownAfter:n=!1,apiUrl:s,alwaysOnConfig:i})=>{if(i&&bg({apiUrl:s,config:i,triggerSnapshot:()=>{var l;return(l=window.rrwebRecord)==null?void 0:l.takeFullSnapshot(!0)}}),at=me.getItem("sprig.pendingCount"),ce.isRecording)return;if(n&&me.setItem("sprig.teardownAfterCapture","true"),$e())return N.debug("ReplayDisabled");if(await(async()=>{var l;if(!Au())return!0;if((l=window.navigator.storage)!=null&&l.estimate)try{const{quota:c=0,usage:u=0}=await window.navigator.storage.estimate(),p=(c-u)/1024**3;return N.info("Storage",{availableGb:p}),p<.5}catch{return!0}return!1})())return N.debug("IDBNotSupported"),bi();try{const l=await Q.openDB();N.info("DBVersion",{version:l.version})}catch(l){return N.error("ReplayOpenErr",{name:l.name}),l.name==="VersionError"&&Q.deleteDB(),bi()}ke(async()=>{await Ei(!0)},"Error uploading ready pending captures");const a=Ut()?30:0,o=Math.max(e??0,a);if(!o)return N.debug("MissingDuration");N.debug("ReplayInit"),await ke(async()=>{var l;r!=null&&r.minDuration&&(Vu=r.minDuration),r!=null&&r.batchDuration&&(Si=r.batchDuration),l=t,Su.setLimit(l),Dg(),Ag(o+35,1800,o+35),Mg();const c=window.rrwebRecord;if(!c)return N.error("RecordScriptFailed");let u=!0,p=0;ce.stopRecording=c({checkoutEveryNms:3e4,sampling:{input:"last",scroll:250,media:800},emit:(d,f)=>{if(d.type===it.Custom&&(Ii=Date.now()),$e())return;if(f&&d.type===it.Meta)p=performance.now();else if(f&&p&&d.type===it.FullSnapshot){const h=performance.now()-p;cu("sdk_replay_snapshot_seconds",h/1e3)}const w=u||!!f&&d.type===it.Meta;u=!1,Rg(w,d),Lg({uuid:gt(),event:JSON.stringify(d),isValidStart:w,timestamp:Date.now()})},...r}),ce.isRecording=!!ce.stopRecording,ce.isRecording&&(z.on("survey.complete",d=>{var f;f={id:d,userAgent:window.navigator.userAgent},Ge("Sprig_SubmitSurvey",f)}),pg())},"Error initializing replay")},isReplayRecording:()=>ce.isRecording,scheduleCapture:Ju,scheduleOrCaptureReplay:$u,tryReplayAction:ke,uploadReadyPendingCaptures:Ei},Symbol.toStringTag,{value:"Module"}));(e=>{le.replay=e})(_g),window.UpChunk={createUpload:Td},window.rrwebRecord=Ht,exports.APP_ID="ul-app",exports.ConflictingWidgets=Gc,exports.DEFAULT_BORDER_COLOR="#e6e6e6",exports.DEFAULT_WIDTH_PX=360,exports.DismissReason=je,exports.EMBED_MOBILE_MAX_WIDTH=1030,exports.ERROR_BORDER_COLOR="#bd282a",exports.SprigAPI=hi,exports.SprigEvent=F,exports.breadcrumbsLogger=N,exports.calculateFrameDimensions=ru,exports.eventEmitter=z,exports.isHTMLElement=Fe,exports.resetScrollPosition=e=>{const t=e.querySelector(".ul-card__container");t&&(t.scrollTop=0)},exports.setSurveyStyles=pr,exports.shouldDirectEmbed=qi,exports.sprig=Kf,exports.sprigFetch=He,exports.v4=gt;
|