basecoat-css 0.1.1 → 0.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ var go=Object.defineProperty,mo=Object.defineProperties,ko=Object.getOwnPropertyDescriptors,Tn=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,vn=(t,e,n)=>e in t?go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,W=(t,e)=>{for(var n in e||(e={}))So.call(e,n)&&vn(t,n,e[n]);if(Tn)for(var n of Tn(e))yo.call(e,n)&&vn(t,n,e[n]);return t},q=(t,e)=>mo(t,ko(e)),bo=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),R=(t,e,n)=>new Promise(((i,r)=>{var o=t=>{try{l(n.next(t))}catch(t){r(t)}},s=t=>{try{l(n.throw(t))}catch(t){r(t)}},l=t=>t.done?i(t.value):Promise.resolve(t.value).then(o,s);l((n=n.apply(t,e)).next())})),Hp=bo((t=>{const e=Math.min,n=Math.max,i=Math.round,r=Math.floor,o=t=>({x:t,y:t});function s(t){return"number"!=typeof t?function(t){return W({top:0,right:0,bottom:0,left:0},t)}(t):{top:t,right:t,bottom:t,left:t}}function l(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function a(){return"undefined"!=typeof window}function c(t){return f(t)?(t.nodeName||"").toLowerCase():"#document"}function u(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function h(t){var e;return null==(e=(f(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function f(t){return!!a()&&(t instanceof Node||t instanceof u(t).Node)}function d(t){return!!a()&&(t instanceof Element||t instanceof u(t).Element)}function p(t){return!!a()&&(t instanceof HTMLElement||t instanceof u(t).HTMLElement)}function m(t){return!(!a()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof u(t).ShadowRoot)}function k(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function y(t){return["table","td","th"].includes(c(t))}function g(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function b(t){const e=S(),n=d(t)?C(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function S(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function v(t){return["html","body","#document"].includes(c(t))}function C(t){return u(t).getComputedStyle(t)}function x(t){return d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function w(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||m(t)&&t.host||h(t);return m(e)?e.host:e}function L(t){const e=w(t);return v(e)?t.ownerDocument?t.ownerDocument.body:t.body:p(e)&&k(e)?e:L(e)}function T(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=L(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),s=u(r);if(o){const t=O(s);return e.concat(s,s.visualViewport||[],k(r)?r:[],t&&n?T(t):[])}return e.concat(r,T(r,[],n))}function O(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function A(t){const e=C(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=p(t),s=o?t.offsetWidth:n,l=o?t.offsetHeight:r,a=i(n)!==s||i(r)!==l;return a&&(n=s,r=l),{width:n,height:r,$:a}}function _(t){return d(t)?t:t.contextElement}function P(t){const e=_(t);if(!p(e))return o(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:l}=A(e);let a=(l?i(n.width):n.width)/r,c=(l?i(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const E=o(0);function j(t){const e=u(t);return S()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:E}function D(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),s=_(t);let a=o(1);e&&(i?d(i)&&(a=P(i)):a=P(t));const c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==u(t))&&e}(s,n,i)?j(s):o(0);let h=(r.left+c.x)/a.x,f=(r.top+c.y)/a.y,p=r.width/a.x,m=r.height/a.y;if(s){const t=u(s),e=i&&d(i)?u(i):i;let n=t,r=O(n);for(;r&&i&&e!==n;){const t=P(r),e=r.getBoundingClientRect(),i=C(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;h*=t.x,f*=t.y,p*=t.x,m*=t.y,h+=o,f+=s,n=u(r),r=O(n)}}return l({width:p,height:m,x:h,y:f})}function I(t,e){const n=x(t).scrollLeft;return e?e.left+n:D(h(t)).left+n}function N(t,e,n){void 0===n&&(n=!1);const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(n?0:I(t,i)),y:i.top+e.scrollTop}}function F(t,e,i){let r;if("viewport"===e)r=function(t,e){const n=u(t),i=h(t),r=n.visualViewport;let o=i.clientWidth,s=i.clientHeight,l=0,a=0;if(r){o=r.width,s=r.height;const t=S();(!t||t&&"fixed"===e)&&(l=r.offsetLeft,a=r.offsetTop)}return{width:o,height:s,x:l,y:a}}(t,i);else if("document"===e)r=function(t){const e=h(t),i=x(t),r=t.ownerDocument.body,o=n(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=n(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-i.scrollLeft+I(t);const a=-i.scrollTop;return"rtl"===C(r).direction&&(l+=n(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:l,y:a}}(h(t));else if(d(e))r=function(t,e){const n=D(t,!0,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=p(t)?P(t):o(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:r*s.x,y:i*s.y}}(e,i);else{const n=j(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return l(r)}function M(t,e){const n=w(t);return!(n===e||!d(n)||v(n))&&("fixed"===C(n).position||M(n,e))}function z(t,e){const n=e.get(t);if(n)return n;let i=T(t,[],!1).filter((t=>d(t)&&"body"!==c(t))),r=null;const o="fixed"===C(t).position;let s=o?w(t):t;for(;d(s)&&!v(s);){const e=C(s),n=b(s);!n&&"fixed"===e.position&&(r=null),(o?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||k(s)&&!n&&M(t,s))?i=i.filter((t=>t!==s)):r=e,s=w(s)}return e.set(t,i),i}function $(t,e,n){const i=p(e),r=h(e),s="fixed"===n,l=D(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const u=o(0);if(i||!i&&!s)if(("body"!==c(e)||k(r))&&(a=x(e)),i){const t=D(e,!0,s,e);u.x=t.x+e.clientLeft,u.y=t.y+e.clientTop}else r&&(u.x=I(r));const f=!r||i||s?o(0):N(r,a);return{x:l.left+a.scrollLeft-u.x-f.x,y:l.top+a.scrollTop-u.y-f.y,width:l.width,height:l.height}}function U(t){return"static"===C(t).position}function B(t,e){if(!p(t)||"fixed"===C(t).position)return null;if(e)return e(t);let n=t.offsetParent;return h(t)===n&&(n=n.ownerDocument.body),n}function V(t,e){const n=u(t);if(g(t))return n;if(!p(t)){let e=w(t);for(;e&&!v(e);){if(d(e)&&!U(e))return e;e=w(e)}return n}let i=B(t,e);for(;i&&y(i)&&U(i);)i=B(i,e);return i&&v(i)&&U(i)&&!b(i)?n:i||function(t){let e=w(t);for(;p(e)&&!v(e);){if(b(e))return e;if(g(e))return null;e=w(e)}return null}(t)||n}const H={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s="fixed"===r,l=h(i),a=!!e&&g(e.floating);if(i===l||a&&s)return n;let u={scrollLeft:0,scrollTop:0},f=o(1);const d=o(0),m=p(i);if((m||!m&&!s)&&(("body"!==c(i)||k(l))&&(u=x(i)),p(i))){const t=D(i);f=P(i),d.x=t.x+i.clientLeft,d.y=t.y+i.clientTop}const y=!l||m||s?o(0):N(l,u,!0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+d.x+y.x,y:n.y*f.y-u.scrollTop*f.y+d.y+y.y}},getDocumentElement:h,getClippingRect:function(t){let{element:i,boundary:r,rootBoundary:o,strategy:s}=t;const l=[..."clippingAncestors"===r?g(i)?[]:z(i,this._c):[].concat(r),o],a=l[0],c=l.reduce(((t,r)=>{const o=F(i,r,s);return t.top=n(o.top,t.top),t.right=e(o.right,t.right),t.bottom=e(o.bottom,t.bottom),t.left=n(o.left,t.left),t}),F(i,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:V,getElementRects:function(t){return R(this,null,(function*(){const e=this.getOffsetParent||V,n=this.getDimensions,i=yield n(t.floating);return{reference:$(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}}))},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=A(t);return{width:e,height:n}},getScale:P,isElement:d,isRTL:function(t){return"rtl"===C(t).direction}};function Q(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function G(t,i,o,s){void 0===s&&(s={});const{ancestorScroll:l=!0,ancestorResize:a=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:f=!1}=s,d=_(t),p=l||a?[...d?T(d):[],...T(i)]:[];p.forEach((t=>{l&&t.addEventListener("scroll",o,{passive:!0}),a&&t.addEventListener("resize",o)}));const m=d&&u?function(t,i){let o,s=null;const l=h(t);function a(){var t;clearTimeout(o),null==(t=s)||t.disconnect(),s=null}return function c(u,h){void 0===u&&(u=!1),void 0===h&&(h=1),a();const f=t.getBoundingClientRect(),{left:d,top:p,width:m,height:k}=f;if(u||i(),!m||!k)return;const y={rootMargin:-r(p)+"px "+-r(l.clientWidth-(d+m))+"px "+-r(l.clientHeight-(p+k))+"px "+-r(d)+"px",threshold:n(0,e(1,h))||1};let g=!0;function b(e){const n=e[0].intersectionRatio;if(n!==h){if(!g)return c();n?c(!1,n):o=setTimeout((()=>{c(!1,1e-7)}),1e3)}1===n&&!Q(f,t.getBoundingClientRect())&&c(),g=!1}try{s=new IntersectionObserver(b,q(W({},y),{root:l.ownerDocument}))}catch(t){s=new IntersectionObserver(b,y)}s.observe(t)}(!0),a}(d,o):null;let k=-1,y=null;c&&(y=new ResizeObserver((t=>{let[e]=t;e&&e.target===d&&y&&(y.unobserve(i),cancelAnimationFrame(k),k=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(i)}))),o()})),d&&!f&&y.observe(d),y.observe(i));let g,b=f?D(t):null;return f&&function e(){const n=D(t);b&&!Q(b,n)&&o(),b=n,g=requestAnimationFrame(e)}(),o(),()=>{var t;p.forEach((t=>{l&&t.removeEventListener("scroll",o),a&&t.removeEventListener("resize",o)})),null==m||m(),null==(t=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(g)}}const X=function(t,e){return R(this,null,(function*(){var n;void 0===e&&(e={});const{x:i,y:r,platform:o,rects:a,elements:c,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=function(t,e){return"function"==typeof t?t(e):t}(e,t),k=s(m),y=c[p?"floating"===d?"reference":"floating":d],g=l(yield o.getClippingRect({element:null==(n=yield null==o.isElement?void 0:o.isElement(y))||n?y:y.contextElement||(yield null==o.getDocumentElement?void 0:o.getDocumentElement(c.floating)),boundary:h,rootBoundary:f,strategy:u})),b="floating"===d?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,S=yield null==o.getOffsetParent?void 0:o.getOffsetParent(c.floating),v=(yield null==o.isElement?void 0:o.isElement(S))&&(yield null==o.getScale?void 0:o.getScale(S))||{x:1,y:1},C=l(o.convertOffsetParentRelativeRectToViewportRelativeRect?yield o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:S,strategy:u}):b);return{top:(g.top-C.top+k.top)/v.y,bottom:(C.bottom-g.bottom+k.bottom)/v.y,left:(g.left-C.left+k.left)/v.x,right:(C.right-g.right+k.right)/v.x}}))},{hasOwnProperty:Y}=Object.prototype,J=function(){};function K(t){return"function"==typeof t?t:J}function Z(t,e){return function(n,i,r){n.type===e&&t.call(this,n,i,r)}}function tt(t,e){const n=e.structure,i=[];for(const t in n){if(!1===Y.call(n,t))continue;let e=n[t];const r={name:t,type:!1,nullable:!1};Array.isArray(e)||(e=[e]);for(const t of e)null===t?r.nullable=!0:"string"==typeof t?r.type="node":Array.isArray(t)&&(r.type="list");r.type&&i.push(r)}return i.length?{context:e.walkContext,fields:i}:null}function et(t,e){const n=t.fields.slice(),i=t.context,r="string"==typeof i;return e&&n.reverse(),function(t,o,s,l){let a;r&&(a=o[i],o[i]=t);for(const i of n){const n=t[i.name];if(!i.nullable||n)if("list"===i.type){if(e?n.reduceRight(l,!1):n.reduce(l,!1))return!0}else if(s(n))return!0}r&&(o[i]=a)}}function nt({StyleSheet:t,Atrule:e,Rule:n,Block:i,DeclarationList:r}){return{Atrule:{StyleSheet:t,Atrule:e,Rule:n,Block:i},Rule:{StyleSheet:t,Atrule:e,Rule:n,Block:i},Declaration:{StyleSheet:t,Atrule:e,Rule:n,Block:i,DeclarationList:r}}}const it=10,rt=11,ot=12,st=13,lt=15,at=16,ct=17,ut=18,ht=19,ft=21,dt=22,pt=23,mt=24,kt=25;function yt(t){return t>=48&&t<=57}function gt(t){return yt(t)||t>=65&&t<=70||t>=97&&t<=102}function bt(t){return t>=65&&t<=90}function St(t){return function(t){return bt(t)||function(t){return t>=97&&t<=122}(t)}(t)||function(t){return t>=128}(t)||95===t}function vt(t){return St(t)||yt(t)||45===t}function Ct(t){return t>=0&&t<=8||11===t||t>=14&&t<=31||127===t}function xt(t){return 10===t||13===t||12===t}function wt(t){return xt(t)||32===t||9===t}function Lt(t,e){return!(92!==t||xt(e)||0===e)}function Tt(t,e,n){return 45===t?St(e)||45===e||Lt(e,n):!!St(t)||92===t&&Lt(t,e)}function Ot(t,e,n){return 43===t||45===t?yt(e)?2:46===e&&yt(n)?3:0:46===t?yt(e)?2:0:yt(t)?1:0}function At(t){return 65279===t||65534===t?1:0}const _t=new Array(128),Pt=130;for(let t=0;t<_t.length;t++)_t[t]=(wt(t)?Pt:yt(t)&&131)||St(t)&&132||Ct(t)&&133||t||128;function Et(t){return t<128?_t[t]:132}function Rt(t,e){return e<t.length?t.charCodeAt(e):0}function jt(t,e,n){return 13===n&&10===Rt(t,e+1)?2:1}function Dt(t,e,n){let i=t.charCodeAt(e);return bt(i)&&(i|=32),i===n}function It(t,e,n,i){if(n-e!==i.length||e<0||n>t.length)return!1;for(let r=e;r<n;r++){const n=i.charCodeAt(r-e);let o=t.charCodeAt(r);if(bt(o)&&(o|=32),o!==n)return!1}return!0}function Nt(t,e){for(;e<t.length&&wt(t.charCodeAt(e));e++);return e}function Ft(t,e){for(;e<t.length&&yt(t.charCodeAt(e));e++);return e}function Mt(t,e){if(gt(Rt(t,(e+=2)-1))){for(const n=Math.min(t.length,e+5);e<n&&gt(Rt(t,e));e++);const n=Rt(t,e);wt(n)&&(e+=jt(t,e,n))}return e}function zt(t,e){for(;e<t.length;e++){const n=t.charCodeAt(e);if(!vt(n)){if(Lt(n,Rt(t,e+1))){e=Mt(t,e)-1;continue}break}}return e}function $t(t,e){let n=t.charCodeAt(e);if((43===n||45===n)&&(n=t.charCodeAt(e+=1)),yt(n)&&(e=Ft(t,e+1),n=t.charCodeAt(e)),46===n&&yt(t.charCodeAt(e+1))&&(e=Ft(t,e+=2)),Dt(t,e,101)){let i=0;n=t.charCodeAt(e+1),(45===n||43===n)&&(i=1,n=t.charCodeAt(e+2)),yt(n)&&(e=Ft(t,e+1+i+1))}return e}function Wt(t,e){for(;e<t.length;e++){const n=t.charCodeAt(e);if(41===n){e++;break}Lt(n,Rt(t,e+1))&&(e=Mt(t,e))}return e}function Ut(t){if(1===t.length&&!gt(t.charCodeAt(0)))return t[0];let e=parseInt(t,16);return(0===e||e>=55296&&e<=57343||e>1114111)&&(e=65533),String.fromCodePoint(e)}const Bt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Vt(t=null,e){return null===t||t.length<e?new Uint32Array(Math.max(e+1024,16384)):t}function qt(t){const e=t.source,n=e.length,i=e.length>0?At(e.charCodeAt(0)):0,r=Vt(t.lines,n),o=Vt(t.columns,n);let s=t.startLine,l=t.startColumn;for(let t=i;t<n;t++){const i=e.charCodeAt(t);r[t]=s,o[t]=l++,(10===i||13===i||12===i)&&(13===i&&t+1<n&&10===e.charCodeAt(t+1)&&(t++,r[t]=s,o[t]=l),s++,l=1)}r[n]=s,o[n]=l,t.lines=r,t.columns=o,t.computed=!0}class Ht{constructor(t,e,n,i){this.setSource(t,e,n,i),this.lines=null,this.columns=null}setSource(t="",e=0,n=1,i=1){this.source=t,this.startOffset=e,this.startLine=n,this.startColumn=i,this.computed=!1}getLocation(t,e){return this.computed||qt(this),{source:e,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,e,n){return this.computed||qt(this),{source:n,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}}}const Qt=16777215,Gt=24,Xt=new Uint8Array(32);function Yt(t){return 0!==Xt[t]}Xt[2]=dt,Xt[ft]=dt,Xt[ht]=20,Xt[pt]=mt;class Jt{constructor(t,e){this.setSource(t,e)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",e=()=>{}){const n=(t=String(t||"")).length,i=Vt(this.offsetAndType,t.length+1),r=Vt(this.balance,t.length+1);let o=0,s=-1,l=0,a=t.length;this.offsetAndType=null,this.balance=null,r.fill(0),e(t,((t,e,n)=>{const c=o++;if(i[c]=t<<Gt|n,-1===s&&(s=e),r[c]=a,t===l){const t=r[a];r[a]=c,a=t,l=Xt[i[t]>>Gt]}else Yt(t)&&(a=c,l=Xt[t])})),i[o]=0|n,r[o]=o;for(let t=0;t<o;t++){const e=r[t];if(e<=t){const n=r[e];n!==t&&(r[t]=n)}else e>o&&(r[t]=o)}this.source=t,this.firstCharOffset=-1===s?0:s,this.tokenCount=o,this.offsetAndType=i,this.balance=r,this.reset(),this.next()}lookupType(t){return(t+=this.tokenIndex)<this.tokenCount?this.offsetAndType[t]>>Gt:0}lookupTypeNonSC(t){for(let e=this.tokenIndex;e<this.tokenCount;e++){const n=this.offsetAndType[e]>>Gt;if(n!==st&&n!==kt&&0===t--)return n}return 0}lookupOffset(t){return(t+=this.tokenIndex)<this.tokenCount?this.offsetAndType[t-1]&Qt:this.source.length}lookupOffsetNonSC(t){for(let e=this.tokenIndex;e<this.tokenCount;e++){const n=this.offsetAndType[e]>>Gt;if(n!==st&&n!==kt&&0===t--)return e-this.tokenIndex}return 0}lookupValue(t,e){return(t+=this.tokenIndex)<this.tokenCount&&It(this.source,this.offsetAndType[t-1]&Qt,this.offsetAndType[t]&Qt,e)}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&Qt:this.offsetAndType[this.tokenCount]&Qt:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,e){return e?9===this.lookupType(e)&&this.source.charCodeAt(this.lookupOffset(e))===t:9===this.tokenType&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let e=this.tokenIndex+t;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.offsetAndType[e-1]&Qt,e=this.offsetAndType[e],this.tokenType=e>>Gt,this.tokenEnd=e&Qt):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>Gt,this.tokenEnd=t&Qt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===st||this.tokenType===kt;)this.next()}skipUntilBalanced(t,e){let n=t,i=0,r=0;t:for(;n<this.tokenCount&&(i=this.balance[n],!(i<t));n++)switch(r=n>0?this.offsetAndType[n-1]&Qt:this.firstCharOffset,e(this.source.charCodeAt(r))){case 1:break t;case 2:n++;break t;default:Yt(this.offsetAndType[n]>>Gt)&&(n=i)}this.skip(n-this.tokenIndex)}forEachToken(t){for(let e=0,n=this.firstCharOffset;e<this.tokenCount;e++){const i=n,r=this.offsetAndType[e],o=r&Qt;n=o,t(r>>Gt,i,o,e)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken(((e,n,i,r)=>{t[r]={idx:r,type:Bt[e],chunk:this.source.substring(n,i),balance:this.balance[r]}})),t}}function Kt(t,e){function n(e){return e<s?t.charCodeAt(e):0}function i(){return c=$t(t,c),Tt(n(c),n(c+1),n(c+2))?(l=ot,void(c=zt(t,c))):37===n(c)?(l=rt,void c++):void(l=it)}function r(){const e=c;return c=zt(t,c),It(t,e,c,"url")&&40===n(c)?(c=Nt(t,c+1),34===n(c)||39===n(c)?(l=2,void(c=e+4)):void function(){for(l=7,c=Nt(t,c);c<t.length;c++){const e=t.charCodeAt(c);switch(Et(e)){case 41:return void c++;case Pt:return c=Nt(t,c),41===n(c)||c>=t.length?void(c<t.length&&c++):(c=Wt(t,c),void(l=8));case 34:case 39:case 40:case 133:return c=Wt(t,c),void(l=8);case 92:if(Lt(e,n(c+1))){c=Mt(t,c)-1;break}return c=Wt(t,c),void(l=8)}}}()):40===n(c)?(l=2,void c++):void(l=1)}function o(e){for(e||(e=n(c++)),l=5;c<t.length;c++){const i=t.charCodeAt(c);switch(Et(i)){case e:return void c++;case Pt:if(xt(i))return c+=jt(t,c,i),void(l=6);break;case 92:if(c===t.length-1)break;const r=n(c+1);xt(r)?c+=jt(t,c+1,r):Lt(i,r)&&(c=Mt(t,c)-1)}}}const s=(t=String(t||"")).length;let l,a=At(n(0)),c=a;for(;c<s;){const s=t.charCodeAt(c);switch(Et(s)){case Pt:l=st,c=Nt(t,c+1);break;case 34:o();break;case 35:vt(n(c+1))||Lt(n(c+1),n(c+2))?(l=4,c=zt(t,c+1)):(l=9,c++);break;case 39:o();break;case 40:l=ft,c++;break;case 41:l=dt,c++;break;case 43:Ot(s,n(c+1),n(c+2))?i():(l=9,c++);break;case 44:l=ut,c++;break;case 45:Ot(s,n(c+1),n(c+2))?i():45===n(c+1)&&62===n(c+2)?(l=lt,c+=3):Tt(s,n(c+1),n(c+2))?r():(l=9,c++);break;case 46:Ot(s,n(c+1),n(c+2))?i():(l=9,c++);break;case 47:42===n(c+1)?(l=kt,c=t.indexOf("*/",c+2),c=-1===c?t.length:c+2):(l=9,c++);break;case 58:l=at,c++;break;case 59:l=ct,c++;break;case 60:33===n(c+1)&&45===n(c+2)&&45===n(c+3)?(l=14,c+=4):(l=9,c++);break;case 64:Tt(n(c+1),n(c+2),n(c+3))?(l=3,c=zt(t,c+1)):(l=9,c++);break;case 91:l=ht,c++;break;case 92:Lt(s,n(c+1))?r():(l=9,c++);break;case 93:l=20,c++;break;case 123:l=pt,c++;break;case 125:l=mt,c++;break;case 131:i();break;case 132:r();break;default:l=9,c++}e(l,a,a=c)}}const Zt=43,te=45,ee=110,ne=!0;function ie(t,e){let n=this.tokenStart+t;const i=this.charCodeAt(n);for((i===Zt||i===te)&&(e&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)yt(this.charCodeAt(n))||this.error("Integer is expected",n)}function re(t){return ie.call(this,0,t)}function oe(t,e){if(!this.cmpChar(this.tokenStart+t,e)){let n="";switch(e){case ee:n="N is expected";break;case te:n="HyphenMinus is expected"}this.error(n,this.tokenStart+t)}}function se(){let t=0,e=0,n=this.tokenType;for(;n===st||n===kt;)n=this.lookupType(++t);if(n!==it){if(!this.isDelim(Zt,t)&&!this.isDelim(te,t))return null;e=this.isDelim(Zt,t)?Zt:te;do{n=this.lookupType(++t)}while(n===st||n===kt);n!==it&&(this.skip(t),re.call(this,ne))}return t>0&&this.skip(t),0===e&&(n=this.charCodeAt(this.tokenStart),n!==Zt&&n!==te&&this.error("Number sign is expected")),re.call(this,0!==e),e===te?"-"+this.consume(it):this.consume(it)}const le={a:[String,null],b:[String,null]};function ae(){const t=this.tokenStart;let e=null,n=null;if(this.tokenType===it)re.call(this,false),n=this.consume(it);else if(1===this.tokenType&&this.cmpChar(this.tokenStart,te))switch(e="-1",oe.call(this,1,ee),this.tokenEnd-this.tokenStart){case 2:this.next(),n=se.call(this);break;case 3:oe.call(this,2,te),this.next(),this.skipSC(),re.call(this,ne),n="-"+this.consume(it);break;default:oe.call(this,2,te),ie.call(this,3,ne),this.next(),n=this.substrToCursor(t+2)}else if(1===this.tokenType||this.isDelim(Zt)&&1===this.lookupType(1)){let i=0;switch(e="1",this.isDelim(Zt)&&(i=1,this.next()),oe.call(this,0,ee),this.tokenEnd-this.tokenStart){case 1:this.next(),n=se.call(this);break;case 2:oe.call(this,1,te),this.next(),this.skipSC(),re.call(this,ne),n="-"+this.consume(it);break;default:oe.call(this,1,te),ie.call(this,2,ne),this.next(),n=this.substrToCursor(t+i+1)}}else if(this.tokenType===ot){const i=this.charCodeAt(this.tokenStart),r=i===Zt||i===te;let o=this.tokenStart+r;for(;o<this.tokenEnd&&yt(this.charCodeAt(o));o++);o===this.tokenStart+r&&this.error("Integer is expected",this.tokenStart+r),oe.call(this,o-this.tokenStart,ee),e=this.substring(t,o),o+1===this.tokenEnd?(this.next(),n=se.call(this)):(oe.call(this,o-this.tokenStart+1,te),o+2===this.tokenEnd?(this.next(),this.skipSC(),re.call(this,ne),n="-"+this.consume(it)):(ie.call(this,o-this.tokenStart+2,ne),this.next(),n=this.substrToCursor(o+1)))}else this.error();return null!==e&&e.charCodeAt(0)===Zt&&(e=e.substr(1)),null!==n&&n.charCodeAt(0)===Zt&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(t,this.tokenStart),a:e,b:n}}function ce(t){if(t.a){const e=("+1"===t.a||"1"===t.a?"n":"-1"===t.a&&"-n")||t.a+"n";if(t.b){const n="-"===t.b[0]||"+"===t.b[0]?t.b:"+"+t.b;this.tokenize(e+n)}else this.tokenize(e)}else this.tokenize(t.b)}const ue=Object.freeze(Object.defineProperty({__proto__:null,generate:ce,name:"AnPlusB",parse:ae,structure:le},Symbol.toStringTag,{value:"Module"}));function he(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function fe(){for(let t,e=1;t=this.lookupType(e);e++){if(t===mt)return!0;if(t===pt||3===t)return!1}return!1}const de={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function pe(t=!1){const e=this.tokenStart;let n,i,r=null,o=null;switch(this.eat(3),n=this.substrToCursor(e+1),i=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==pt&&this.tokenType!==ct&&(r=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,t),he):he.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case ct:this.next();break;case pt:o=hasOwnProperty.call(this.atrule,i)&&"function"==typeof this.atrule[i].block?this.atrule[i].block.call(this,t):this.Block(fe.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:n,prelude:r,block:o}}function me(t){this.token(3,"@"+t.name),null!==t.prelude&&this.node(t.prelude),t.block?this.node(t.block):this.token(ct,";")}const ke=Object.freeze(Object.defineProperty({__proto__:null,generate:me,name:"Atrule",parse:pe,structure:de,walkContext:"atrule"},Symbol.toStringTag,{value:"Module"}));function ye(t){let e=null;return null!==t&&(t=t.toLowerCase()),this.skipSC(),e=hasOwnProperty.call(this.atrule,t)&&"function"==typeof this.atrule[t].prelude?this.atrule[t].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&this.tokenType!==pt&&this.tokenType!==ct&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(e),children:e}}function ge(t){this.children(t)}const be=Object.freeze(Object.defineProperty({__proto__:null,generate:ge,name:"AtrulePrelude",parse:ye,structure:{children:[[]]},walkContext:"atrulePrelude"},Symbol.toStringTag,{value:"Module"}));function Se(){this.eof&&this.error("Unexpected end of input");const t=this.tokenStart;let e=!1;return this.isDelim(42)?(e=!0,this.next()):this.isDelim(124)||this.eat(1),this.isDelim(124)?61!==this.charCodeAt(this.tokenStart+1)?(this.next(),this.eat(1)):e&&this.error("Identifier is expected",this.tokenEnd):e&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function ve(){const t=this.tokenStart,e=this.charCodeAt(t);return 61!==e&&126!==e&&94!==e&&36!==e&&42!==e&&124!==e&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),61!==e&&(this.isDelim(61)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(t)}const Ce={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function xe(){const t=this.tokenStart;let e,n=null,i=null,r=null;return this.eat(ht),this.skipSC(),e=Se.call(this),this.skipSC(),20!==this.tokenType&&(1!==this.tokenType&&(n=ve.call(this),this.skipSC(),i=5===this.tokenType?this.String():this.Identifier(),this.skipSC()),1===this.tokenType&&(r=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(t,this.tokenStart),name:e,matcher:n,value:i,flags:r}}function we(t){this.token(9,"["),this.node(t.name),null!==t.matcher&&(this.tokenize(t.matcher),this.node(t.value)),null!==t.flags&&this.token(1,t.flags),this.token(9,"]")}const Le=Object.freeze(Object.defineProperty({__proto__:null,generate:we,name:"AttributeSelector",parse:xe,structure:Ce},Symbol.toStringTag,{value:"Module"}));function Te(){return this.Raw(null,!0)}function Oe(){return this.parseWithFallback(this.Rule,Te)}function Ae(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function _e(){if(this.tokenType===ct)return Ae.call(this,this.tokenIndex);const t=this.parseWithFallback(this.Declaration,Ae);return this.tokenType===ct&&this.next(),t}function Pe(t){const e=t?_e:Oe,n=this.tokenStart;let i=this.createList();this.eat(pt);t:for(;!this.eof;)switch(this.tokenType){case mt:break t;case st:case kt:this.next();break;case 3:i.push(this.parseWithFallback(this.Atrule.bind(this,t),Te));break;default:t&&this.isDelim(38)?i.push(Oe.call(this)):i.push(e.call(this))}return this.eof||this.eat(mt),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function Ee(t){this.token(pt,"{"),this.children(t,(t=>{"Declaration"===t.type&&this.token(ct,";")})),this.token(mt,"}")}const Re=Object.freeze(Object.defineProperty({__proto__:null,generate:Ee,name:"Block",parse:Pe,structure:{children:[["Atrule","Rule","Declaration"]]},walkContext:"block"},Symbol.toStringTag,{value:"Module"}));function je(t,e){const n=this.tokenStart;let i=null;return this.eat(ht),i=t.call(this,e),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:i}}function De(t){this.token(9,"["),this.children(t),this.token(9,"]")}const Ie=Object.freeze(Object.defineProperty({__proto__:null,generate:De,name:"Brackets",parse:je,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"}));function Ne(){const t=this.tokenStart;return this.eat(lt),{type:"CDC",loc:this.getLocation(t,this.tokenStart)}}function Fe(){this.token(lt,"--\x3e")}const Me=Object.freeze(Object.defineProperty({__proto__:null,generate:Fe,name:"CDC",parse:Ne,structure:[]},Symbol.toStringTag,{value:"Module"}));function ze(){const t=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(t,this.tokenStart)}}function $e(){this.token(14,"\x3c!--")}const We=Object.freeze(Object.defineProperty({__proto__:null,generate:$e,name:"CDO",parse:ze,structure:[]},Symbol.toStringTag,{value:"Module"})),Ue={name:String};function Be(){return this.eatDelim(46),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Ve(t){this.token(9,"."),this.token(1,t.name)}const qe=Object.freeze(Object.defineProperty({__proto__:null,generate:Ve,name:"ClassSelector",parse:Be,structure:Ue},Symbol.toStringTag,{value:"Module"})),He={name:String};function Qe(){const t=this.tokenStart;let e;switch(this.tokenType){case st:e=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent("deep"),this.eatDelim(47);break;default:this.error("Combinator is expected")}e=this.substrToCursor(t)}return{type:"Combinator",loc:this.getLocation(t,this.tokenStart),name:e}}function Ge(t){this.tokenize(t.name)}const Xe=Object.freeze(Object.defineProperty({__proto__:null,generate:Ge,name:"Combinator",parse:Qe,structure:He},Symbol.toStringTag,{value:"Module"})),Ye={value:String};function Je(){const t=this.tokenStart;let e=this.tokenEnd;return this.eat(kt),e-t+2>=2&&42===this.charCodeAt(e-2)&&47===this.charCodeAt(e-1)&&(e-=2),{type:"Comment",loc:this.getLocation(t,this.tokenStart),value:this.substring(t+2,e)}}function Ke(t){this.token(kt,"/*"+t.value+"*/")}const Ze=Object.freeze(Object.defineProperty({__proto__:null,generate:Ke,name:"Comment",parse:Je,structure:Ye},Symbol.toStringTag,{value:"Module"})),tn=new Set([at,dt,0]),en={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function nn(t){return 1===this.lookupTypeNonSC(1)&&tn.has(this.lookupTypeNonSC(2))?this.Feature(t):this.FeatureRange(t)}const rn={media:nn,container:nn,supports(){return this.SupportsDeclaration()}};function on(t="media"){const e=this.createList();t:for(;!this.eof;)switch(this.tokenType){case kt:case st:this.next();continue;case 1:e.push(this.Identifier());break;case ft:{let n=this.parseWithFallback((()=>rn[t].call(this,t)),(()=>null));n||(n=this.parseWithFallback((()=>{this.eat(ft);const e=this.Condition(t);return this.eat(dt),e}),(()=>this.GeneralEnclosed(t)))),e.push(n);break}case 2:{let n=this.parseWithFallback((()=>this.FeatureFunction(t)),(()=>null));n||(n=this.GeneralEnclosed(t)),e.push(n);break}default:break t}return e.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(e),kind:t,children:e}}function sn(t){t.children.forEach((t=>{"Condition"===t.type?(this.token(ft,"("),this.node(t),this.token(dt,")")):this.node(t)}))}const ln=Object.freeze(Object.defineProperty({__proto__:null,generate:sn,name:"Condition",parse:on,structure:en},Symbol.toStringTag,{value:"Module"}));function an(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function cn(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function un(){const t=this.tokenIndex,e=this.Value();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==ct&&!1===this.isDelim(33)&&!1===this.isBalanceEdge(t)&&this.error(),e}const hn={important:[Boolean,String],property:String,value:["Value","Raw"]};function fn(){const t=this.tokenStart,e=this.tokenIndex,n=pn.call(this),i=function(t,e){return e=e||0,t.length-e>=2&&45===t.charCodeAt(e)&&45===t.charCodeAt(e+1)}(n),r=i?this.parseCustomProperty:this.parseValue,o=i?cn:an;let s,l=!1;this.skipSC(),this.eat(at);const a=this.tokenIndex;if(i||this.skipSC(),s=r?this.parseWithFallback(un,o):o.call(this,this.tokenIndex),i&&"Value"===s.type&&s.children.isEmpty)for(let t=a-this.tokenIndex;t<=0;t++)if(this.lookupType(t)===st){s.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(33)&&(l=mn.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==ct&&!1===this.isBalanceEdge(e)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.tokenStart),important:l,property:n,value:s}}function dn(t){this.token(1,t.property),this.token(at,":"),this.node(t.value),t.important&&(this.token(9,"!"),this.token(1,!0===t.important?"important":t.important))}function pn(){const t=this.tokenStart;if(9===this.tokenType)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return 4===this.tokenType?this.eat(4):this.eat(1),this.substrToCursor(t)}function mn(){this.eat(9),this.skipSC();const t=this.consume(1);return"important"===t||t}const kn=Object.freeze(Object.defineProperty({__proto__:null,generate:dn,name:"Declaration",parse:fn,structure:hn,walkContext:"declaration"},Symbol.toStringTag,{value:"Module"}));function yn(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function gn(){const t=this.createList();for(;!this.eof;)switch(this.tokenType){case st:case kt:case ct:this.next();break;case 3:t.push(this.parseWithFallback(this.Atrule.bind(this,!0),yn));break;default:this.isDelim(38)?t.push(this.parseWithFallback(this.Rule,yn)):t.push(this.parseWithFallback(this.Declaration,yn))}return{type:"DeclarationList",loc:this.getLocationFromList(t),children:t}}function bn(t){this.children(t,(t=>{"Declaration"===t.type&&this.token(ct,";")}))}const Sn=Object.freeze(Object.defineProperty({__proto__:null,generate:bn,name:"DeclarationList",parse:gn,structure:{children:[["Declaration","Atrule","Rule"]]}},Symbol.toStringTag,{value:"Module"})),vn={value:String,unit:String};function Cn(){const t=this.tokenStart,e=this.consumeNumber(ot);return{type:"Dimension",loc:this.getLocation(t,this.tokenStart),value:e,unit:this.substring(t+e.length,this.tokenStart)}}function xn(t){this.token(ot,t.value+t.unit)}const wn=Object.freeze(Object.defineProperty({__proto__:null,generate:xn,name:"Dimension",parse:Cn,structure:vn},Symbol.toStringTag,{value:"Module"})),Ln={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function Tn(t){const e=this.tokenStart;let n,i=null;if(this.eat(ft),this.skipSC(),n=this.consume(1),this.skipSC(),this.tokenType!==dt){switch(this.eat(at),this.skipSC(),this.tokenType){case it:i=9===this.lookupNonWSType(1)?this.Ratio():this.Number();break;case ot:i=this.Dimension();break;case 1:i=this.Identifier();break;case 2:i=this.parseWithFallback((()=>{const t=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),t}),(()=>this.Ratio()));break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(dt),{type:"Feature",loc:this.getLocation(e,this.tokenStart),kind:t,name:n,value:i}}function On(t){this.token(ft,"("),this.token(1,t.name),null!==t.value&&(this.token(at,":"),this.node(t.value)),this.token(dt,")")}const An=Object.freeze(Object.defineProperty({__proto__:null,generate:On,name:"Feature",parse:Tn,structure:Ln},Symbol.toStringTag,{value:"Module"})),_n={kind:String,feature:String,value:["Declaration","Selector"]};function Pn(t,e){const n=(this.features[t]||{})[e];return"function"!=typeof n&&this.error(`Unknown feature ${e}()`),n}function En(t="unknown"){const e=this.tokenStart,n=this.consumeFunctionName(),i=Pn.call(this,t,n.toLowerCase());this.skipSC();const r=this.parseWithFallback((()=>{const t=this.tokenIndex,e=i.call(this);return!1===this.eof&&!1===this.isBalanceEdge(t)&&this.error(),e}),(()=>this.Raw(null,!1)));return this.eof||this.eat(dt),{type:"FeatureFunction",loc:this.getLocation(e,this.tokenStart),kind:t,feature:n,value:r}}function Rn(t){this.token(2,t.feature+"("),this.node(t.value),this.token(dt,")")}const jn=Object.freeze(Object.defineProperty({__proto__:null,generate:Rn,name:"FeatureFunction",parse:En,structure:_n},Symbol.toStringTag,{value:"Module"})),Dn={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function In(){switch(this.skipSC(),this.tokenType){case it:return this.isDelim(47,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case ot:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback((()=>{const t=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),t}),(()=>this.Ratio()));default:this.error("Number, dimension, ratio or identifier is expected")}}function Nn(t){if(this.skipSC(),this.isDelim(60)||this.isDelim(62)){const t=this.source[this.tokenStart];return this.next(),this.isDelim(61)?(this.next(),t+"="):t}if(this.isDelim(61))return"=";this.error(`Expected ${t?'":", ':""}"<", ">", "=" or ")"`)}function Fn(t="unknown"){const e=this.tokenStart;this.skipSC(),this.eat(ft);const n=In.call(this),i=Nn.call(this,"Identifier"===n.type),r=In.call(this);let o=null,s=null;return this.lookupNonWSType(0)!==dt&&(o=Nn.call(this),s=In.call(this)),this.skipSC(),this.eat(dt),{type:"FeatureRange",loc:this.getLocation(e,this.tokenStart),kind:t,left:n,leftComparison:i,middle:r,rightComparison:o,right:s}}function Mn(t){this.token(ft,"("),this.node(t.left),this.tokenize(t.leftComparison),this.node(t.middle),t.right&&(this.tokenize(t.rightComparison),this.node(t.right)),this.token(dt,")")}const zn=Object.freeze(Object.defineProperty({__proto__:null,generate:Mn,name:"FeatureRange",parse:Fn,structure:Dn},Symbol.toStringTag,{value:"Module"})),$n={name:String,children:[[]]};function Wn(t,e){const n=this.tokenStart,i=this.consumeFunctionName(),r=i.toLowerCase();let o;return o=e.hasOwnProperty(r)?e[r].call(this,e):t.call(this,e),this.eof||this.eat(dt),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:i,children:o}}function Un(t){this.token(2,t.name+"("),this.children(t),this.token(dt,")")}const Bn=Object.freeze(Object.defineProperty({__proto__:null,generate:Un,name:"Function",parse:Wn,structure:$n,walkContext:"function"},Symbol.toStringTag,{value:"Module"})),Vn={kind:String,function:[String,null],children:[[]]};function qn(t){const e=this.tokenStart;let n=null;2===this.tokenType?n=this.consumeFunctionName():this.eat(ft);const i=this.parseWithFallback((()=>{const t=this.tokenIndex,e=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(t)&&this.error(),e}),(()=>this.createSingleNodeList(this.Raw(null,!1))));return this.eof||this.eat(dt),{type:"GeneralEnclosed",loc:this.getLocation(e,this.tokenStart),kind:t,function:n,children:i}}function Hn(t){t.function?this.token(2,t.function+"("):this.token(ft,"("),this.children(t),this.token(dt,")")}const Qn=Object.freeze(Object.defineProperty({__proto__:null,generate:Hn,name:"GeneralEnclosed",parse:qn,structure:Vn},Symbol.toStringTag,{value:"Module"})),Gn={value:String};function Xn(){const t=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t+1)}}function Yn(t){this.token(4,"#"+t.value)}const Jn=Object.freeze(Object.defineProperty({__proto__:null,generate:Yn,name:"Hash",parse:Xn,structure:Gn,xxx:"XXX"},Symbol.toStringTag,{value:"Module"})),Kn={name:String};function Zn(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function ti(t){this.token(1,t.name)}const ei=Object.freeze(Object.defineProperty({__proto__:null,generate:ti,name:"Identifier",parse:Zn,structure:Kn},Symbol.toStringTag,{value:"Module"})),ni={name:String};function ii(){const t=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t+1)}}function ri(t){this.token(9,"#"+t.name)}const oi=Object.freeze(Object.defineProperty({__proto__:null,generate:ri,name:"IdSelector",parse:ii,structure:ni},Symbol.toStringTag,{value:"Module"})),si={name:String};function li(){let t=this.tokenStart,e=this.consume(1);for(;this.isDelim(46);)this.eat(9),e+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(t,this.tokenStart),name:e}}function ai(t){this.tokenize(t.name)}const ci=Object.freeze(Object.defineProperty({__proto__:null,generate:ai,name:"Layer",parse:li,structure:si},Symbol.toStringTag,{value:"Module"}));function ui(){const t=this.createList();for(this.skipSC();!this.eof&&(t.push(this.Layer()),this.lookupTypeNonSC(0)===ut);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(t),children:t}}function hi(t){this.children(t,(()=>this.token(ut,",")))}const fi=Object.freeze(Object.defineProperty({__proto__:null,generate:hi,name:"LayerList",parse:ui,structure:{children:[["Layer"]]}},Symbol.toStringTag,{value:"Module"})),di={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function pi(){const t=this.tokenStart;let e=null,n=null,i=null;if(this.skipSC(),1===this.tokenType&&this.lookupTypeNonSC(1)!==ft){const t=this.consume(1),r=t.toLowerCase();switch("not"===r||"only"===r?(this.skipSC(),e=r,n=this.consume(1)):n=t,this.lookupTypeNonSC(0)){case 1:this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break;case pt:case ct:case ut:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case ft:case 2:i=this.Condition("media");break;case pt:case ct:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(t,this.tokenStart),modifier:e,mediaType:n,condition:i}}function mi(t){t.mediaType?(t.modifier&&this.token(1,t.modifier),this.token(1,t.mediaType),t.condition&&(this.token(1,"and"),this.node(t.condition))):t.condition&&this.node(t.condition)}const ki=Object.freeze(Object.defineProperty({__proto__:null,generate:mi,name:"MediaQuery",parse:pi,structure:di},Symbol.toStringTag,{value:"Module"}));function yi(){const t=this.createList();for(this.skipSC();!this.eof&&(t.push(this.MediaQuery()),this.tokenType===ut);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}}function gi(t){this.children(t,(()=>this.token(ut,",")))}const bi=Object.freeze(Object.defineProperty({__proto__:null,generate:gi,name:"MediaQueryList",parse:yi,structure:{children:[["MediaQuery"]]}},Symbol.toStringTag,{value:"Module"}));function Si(){const t=this.tokenStart;return this.eatDelim(38),{type:"NestingSelector",loc:this.getLocation(t,this.tokenStart)}}function vi(){this.token(9,"&")}const Ci=Object.freeze(Object.defineProperty({__proto__:null,generate:vi,name:"NestingSelector",parse:Si,structure:{}},Symbol.toStringTag,{value:"Module"}));function xi(){this.skipSC();const t=this.tokenStart;let e,n=t,i=null;return e=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),i=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(t,n),nth:e,selector:i}}function wi(t){this.node(t.nth),null!==t.selector&&(this.token(1,"of"),this.node(t.selector))}const Li=Object.freeze(Object.defineProperty({__proto__:null,generate:wi,name:"Nth",parse:xi,structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}},Symbol.toStringTag,{value:"Module"})),Ti={value:String};function Oi(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(it)}}function Ai(t){this.token(it,t.value)}const _i=Object.freeze(Object.defineProperty({__proto__:null,generate:Ai,name:"Number",parse:Oi,structure:Ti},Symbol.toStringTag,{value:"Module"})),Pi={value:String};function Ei(){const t=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t)}}function Ri(t){this.tokenize(t.value)}const ji=Object.freeze(Object.defineProperty({__proto__:null,generate:Ri,name:"Operator",parse:Ei,structure:Pi},Symbol.toStringTag,{value:"Module"}));function Di(t,e){const n=this.tokenStart;let i=null;return this.eat(ft),i=t.call(this,e),this.eof||this.eat(dt),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:i}}function Ii(t){this.token(ft,"("),this.children(t),this.token(dt,")")}const Ni=Object.freeze(Object.defineProperty({__proto__:null,generate:Ii,name:"Parentheses",parse:Di,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"})),Fi={value:String};function Mi(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(rt)}}function zi(t){this.token(rt,t.value+"%")}const $i=Object.freeze(Object.defineProperty({__proto__:null,generate:zi,name:"Percentage",parse:Mi,structure:Fi},Symbol.toStringTag,{value:"Module"})),Wi={name:String,children:[["Raw"],null]};function Ui(){const t=this.tokenStart;let e,n,i=null;return this.eat(at),2===this.tokenType?(e=this.consumeFunctionName(),n=e.toLowerCase(),this.lookupNonWSType(0)==dt?i=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),i=this.pseudo[n].call(this),this.skipSC()):(i=this.createList(),i.push(this.Raw(null,!1))),this.eat(dt)):e=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(t,this.tokenStart),name:e,children:i}}function Bi(t){this.token(at,":"),null===t.children?this.token(1,t.name):(this.token(2,t.name+"("),this.children(t),this.token(dt,")"))}const Vi=Object.freeze(Object.defineProperty({__proto__:null,generate:Bi,name:"PseudoClassSelector",parse:Ui,structure:Wi,walkContext:"function"},Symbol.toStringTag,{value:"Module"})),qi={name:String,children:[["Raw"],null]};function Hi(){const t=this.tokenStart;let e,n,i=null;return this.eat(at),this.eat(at),2===this.tokenType?(e=this.consumeFunctionName(),n=e.toLowerCase(),this.lookupNonWSType(0)==dt?i=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),i=this.pseudo[n].call(this),this.skipSC()):(i=this.createList(),i.push(this.Raw(null,!1))),this.eat(dt)):e=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(t,this.tokenStart),name:e,children:i}}function Qi(t){this.token(at,":"),this.token(at,":"),null===t.children?this.token(1,t.name):(this.token(2,t.name+"("),this.children(t),this.token(dt,")"))}const Gi=Object.freeze(Object.defineProperty({__proto__:null,generate:Qi,name:"PseudoElementSelector",parse:Hi,structure:qi,walkContext:"function"},Symbol.toStringTag,{value:"Module"}));function Xi(){switch(this.skipSC(),this.tokenType){case it:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}function Yi(){const t=this.tokenStart,e=Xi.call(this);let n=null;return this.skipSC(),this.isDelim(47)&&(this.eatDelim(47),n=Xi.call(this)),{type:"Ratio",loc:this.getLocation(t,this.tokenStart),left:e,right:n}}function Ji(t){this.node(t.left),this.token(9,"/"),t.right?this.node(t.right):this.node(it,1)}const Ki=Object.freeze(Object.defineProperty({__proto__:null,generate:Ji,name:"Ratio",parse:Yi,structure:{left:["Number","Function"],right:["Number","Function",null]}},Symbol.toStringTag,{value:"Module"}));function Zi(){return this.tokenIndex>0&&this.lookupType(-1)===st?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const tr={value:String};function er(t,e){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,t||this.consumeUntilBalanceEnd),i=e&&this.tokenStart>n?Zi.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function nr(t){this.tokenize(t.value)}const ir=Object.freeze(Object.defineProperty({__proto__:null,generate:nr,name:"Raw",parse:er,structure:tr},Symbol.toStringTag,{value:"Module"}));function rr(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function or(){const t=this.SelectorList();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==pt&&this.error(),t}function sr(){const t=this.tokenIndex,e=this.tokenStart;let n,i;return n=this.parseRulePrelude?this.parseWithFallback(or,rr):rr.call(this,t),i=this.Block(!0),{type:"Rule",loc:this.getLocation(e,this.tokenStart),prelude:n,block:i}}function lr(t){this.node(t.prelude),this.node(t.block)}const ar=Object.freeze(Object.defineProperty({__proto__:null,generate:lr,name:"Rule",parse:sr,structure:{prelude:["SelectorList","Raw"],block:["Block"]},walkContext:"rule"},Symbol.toStringTag,{value:"Module"}));function cr(){let t=null,e=null;this.skipSC();const n=this.tokenStart;return this.tokenType===ft&&(this.next(),this.skipSC(),t=this.parseWithFallback(this.SelectorList,(()=>this.Raw(!1,!0))),this.skipSC(),this.eat(dt)),1===this.lookupNonWSType(0)&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(ft),this.skipSC(),e=this.parseWithFallback(this.SelectorList,(()=>this.Raw(!1,!0))),this.skipSC(),this.eat(dt)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:t,limit:e}}function ur(t){t.root&&(this.token(ft,"("),this.node(t.root),this.token(dt,")")),t.limit&&(this.token(1,"to"),this.token(ft,"("),this.node(t.limit),this.token(dt,")"))}const hr=Object.freeze(Object.defineProperty({__proto__:null,generate:ur,name:"Scope",parse:cr,structure:{root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}},Symbol.toStringTag,{value:"Module"}));function fr(){const t=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(t)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(t),children:t}}function dr(t){this.children(t)}const pr=Object.freeze(Object.defineProperty({__proto__:null,generate:dr,name:"Selector",parse:fr,structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}},Symbol.toStringTag,{value:"Module"}));function mr(){const t=this.createList();for(;!this.eof&&(t.push(this.Selector()),this.tokenType===ut);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(t),children:t}}function kr(t){this.children(t,(()=>this.token(ut,",")))}const yr=Object.freeze(Object.defineProperty({__proto__:null,generate:kr,name:"SelectorList",parse:mr,structure:{children:[["Selector","Raw"]]},walkContext:"selector"},Symbol.toStringTag,{value:"Module"}));function gr(t){const e=t.length,n=t.charCodeAt(0),i=34===n||39===n?1:0,r=1===i&&e>1&&t.charCodeAt(e-1)===n?e-2:e-1;let o="";for(let n=i;n<=r;n++){let i=t.charCodeAt(n);if(92===i){if(n===r){n!==e-1&&(o=t.substr(n+1));break}if(i=t.charCodeAt(++n),Lt(92,i)){const e=n-1,i=Mt(t,e);n=i-1,o+=Ut(t.substring(e+1,i))}else 13===i&&10===t.charCodeAt(n+1)&&n++}else o+=t[n]}return o}const br={value:String};function Sr(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:gr(this.consume(5))}}function vr(t){this.token(5,function(t){let e="",n=!1;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);0!==r?r<=31||127===r?(e+="\\"+r.toString(16),n=!0):34===r||92===r?(e+="\\"+t.charAt(i),n=!1):(n&&(gt(r)||wt(r))&&(e+=" "),e+=t.charAt(i),n=!1):e+="�"}return'"'+e+'"'}(t.value))}const Cr=Object.freeze(Object.defineProperty({__proto__:null,generate:vr,name:"String",parse:Sr,structure:br},Symbol.toStringTag,{value:"Module"}));function xr(){return this.Raw(null,!1)}function wr(){const t=this.tokenStart,e=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case st:this.next();continue;case kt:if(33!==this.charCodeAt(this.tokenStart+2)){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case lt:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,xr);break;default:n=this.parseWithFallback(this.Rule,xr)}e.push(n)}return{type:"StyleSheet",loc:this.getLocation(t,this.tokenStart),children:e}}function Lr(t){this.children(t)}const Tr=Object.freeze(Object.defineProperty({__proto__:null,generate:Lr,name:"StyleSheet",parse:wr,structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},walkContext:"stylesheet"},Symbol.toStringTag,{value:"Module"}));function Or(){const t=this.tokenStart;this.eat(ft),this.skipSC();const e=this.Declaration();return this.eof||this.eat(dt),{type:"SupportsDeclaration",loc:this.getLocation(t,this.tokenStart),declaration:e}}function Ar(t){this.token(ft,"("),this.node(t.declaration),this.token(dt,")")}const _r=Object.freeze(Object.defineProperty({__proto__:null,generate:Ar,name:"SupportsDeclaration",parse:Or,structure:{declaration:"Declaration"}},Symbol.toStringTag,{value:"Module"}));function Pr(){1!==this.tokenType&&!1===this.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.next()}const Er={name:String};function Rr(){const t=this.tokenStart;return this.isDelim(124)?(this.next(),Pr.call(this)):(Pr.call(this),this.isDelim(124)&&(this.next(),Pr.call(this))),{type:"TypeSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function jr(t){this.tokenize(t.name)}const Dr=Object.freeze(Object.defineProperty({__proto__:null,generate:jr,name:"TypeSelector",parse:Rr,structure:Er},Symbol.toStringTag,{value:"Module"}));function Ir(t,e){let n=0;for(let i=this.tokenStart+t;i<this.tokenEnd;i++){const r=this.charCodeAt(i);if(45===r&&e&&0!==n)return Ir.call(this,t+n+1,!1),-1;gt(r)||this.error(e&&0!==n?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",i),++n>6&&this.error("Too many hex digits",i)}return this.next(),n}function Nr(t){let e=0;for(;this.isDelim(63);)++e>t&&this.error("Too many question marks"),this.next()}function Fr(t){this.charCodeAt(this.tokenStart)!==t&&this.error((43===t?"Plus sign":"Hyphen minus")+" is expected")}function Mr(){let t=0;switch(this.tokenType){case it:if(t=Ir.call(this,1,!0),this.isDelim(63)){Nr.call(this,6-t);break}if(this.tokenType===ot||this.tokenType===it){Fr.call(this,45),Ir.call(this,1,!1);break}break;case ot:t=Ir.call(this,1,!0),t>0&&Nr.call(this,6-t);break;default:if(this.eatDelim(43),1===this.tokenType){t=Ir.call(this,0,!0),t>0&&Nr.call(this,6-t);break}if(this.isDelim(63)){this.next(),Nr.call(this,5);break}this.error("Hex digit or question mark is expected")}}const zr={value:String};function $r(){const t=this.tokenStart;return this.eatIdent("u"),Mr.call(this),{type:"UnicodeRange",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t)}}function Wr(t){this.tokenize(t.value)}const Ur=Object.freeze(Object.defineProperty({__proto__:null,generate:Wr,name:"UnicodeRange",parse:$r,structure:zr},Symbol.toStringTag,{value:"Module"}));const Br={value:String};function Vr(){const t=this.tokenStart;let e;switch(this.tokenType){case 7:e=function(t){const e=t.length;let n=4,i=41===t.charCodeAt(e-1)?e-2:e-1,r="";for(;n<i&&wt(t.charCodeAt(n));)n++;for(;n<i&&wt(t.charCodeAt(i));)i--;for(let o=n;o<=i;o++){let n=t.charCodeAt(o);if(92===n){if(o===i){o!==e-1&&(r=t.substr(o+1));break}if(n=t.charCodeAt(++o),Lt(92,n)){const e=o-1,n=Mt(t,e);o=n-1,r+=Ut(t.substring(e+1,n))}else 13===n&&10===t.charCodeAt(o+1)&&o++}else r+=t[o]}return r}(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),e=gr(this.consume(5)),this.skipSC(),this.eof||this.eat(dt);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(t,this.tokenStart),value:e}}function qr(t){this.token(7,function(t){let e="",n=!1;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);0!==r?r<=31||127===r?(e+="\\"+r.toString(16),n=!0):32===r||92===r||34===r||39===r||40===r||41===r?(e+="\\"+t.charAt(i),n=!1):(n&&gt(r)&&(e+=" "),e+=t.charAt(i),n=!1):e+="�"}return"url("+e+")"}(t.value))}const Hr=Object.freeze(Object.defineProperty({__proto__:null,generate:qr,name:"Url",parse:Vr,structure:Br},Symbol.toStringTag,{value:"Module"}));function Qr(){const t=this.tokenStart,e=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(t,this.tokenStart),children:e}}function Gr(t){this.children(t)}const Xr=Object.freeze(Object.defineProperty({__proto__:null,generate:Gr,name:"Value",parse:Qr,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"})),Yr=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Jr={value:String};function Kr(){return this.eat(st),Yr}function Zr(t){this.token(st,t.value)}const to=Object.freeze(Object.defineProperty({__proto__:null,generate:Zr,name:"WhiteSpace",parse:Kr,structure:Jr},Symbol.toStringTag,{value:"Module"})),eo=function(t){const e=function(t){const e={};for(const n in t.node)if(Y.call(t.node,n)){const i=t.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");e[n]=tt(0,i)}return e}(t),n={},i={},r=Symbol("break-walk"),o=Symbol("skip-node");for(const t in e)Y.call(e,t)&&null!==e[t]&&(n[t]=et(e[t],!1),i[t]=et(e[t],!0));const s=nt(n),l=nt(i),a=function(t,a){function c(t,e,n){const i=u.call(p,t,e,n);return i===r||i!==o&&!!(f.hasOwnProperty(t.type)&&f[t.type](t,p,c,d)||h.call(p,t,e,n)===r)}let u=J,h=J,f=n,d=(t,e,n,i)=>t||c(e,n,i);const p={break:r,skip:o,root:t,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof a)u=a;else if(a&&(u=K(a.enter),h=K(a.leave),a.reverse&&(f=i),a.visit)){if(s.hasOwnProperty(a.visit))f=a.reverse?l[a.visit]:s[a.visit];else if(!e.hasOwnProperty(a.visit))throw new Error("Bad value `"+a.visit+"` for `visit` option (should be: "+Object.keys(e).sort().join(", ")+")");u=Z(u,a.visit),h=Z(h,a.visit)}if(u===J&&h===J)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(t)};return a.break=r,a.skip=o,a.find=function(t,e){let n=null;return a(t,(function(t,i,o){if(e.call(this,t,i,o))return n=t,r})),n},a.findLast=function(t,e){let n=null;return a(t,{reverse:!0,enter(t,i,o){if(e.call(this,t,i,o))return n=t,r}}),n},a.findAll=function(t,e){const n=[];return a(t,(function(t,i,r){e.call(this,t,i,r)&&n.push(t)})),n},a}({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ue,Atrule:ke,AtrulePrelude:be,AttributeSelector:Le,Block:Re,Brackets:Ie,CDC:Me,CDO:We,ClassSelector:qe,Combinator:Xe,Comment:Ze,Condition:ln,Declaration:kn,DeclarationList:Sn,Dimension:wn,Feature:An,FeatureFunction:jn,FeatureRange:zn,Function:Bn,GeneralEnclosed:Qn,Hash:Jn,IdSelector:oi,Identifier:ei,Layer:ci,LayerList:fi,MediaQuery:ki,MediaQueryList:bi,NestingSelector:Ci,Nth:Li,Number:_i,Operator:ji,Parentheses:Ni,Percentage:$i,PseudoClassSelector:Vi,PseudoElementSelector:Gi,Ratio:Ki,Raw:ir,Rule:ar,Scope:hr,Selector:pr,SelectorList:yr,String:Cr,StyleSheet:Tr,SupportsDeclaration:_r,TypeSelector:Dr,UnicodeRange:Ur,Url:Hr,Value:Xr,WhiteSpace:to},Symbol.toStringTag,{value:"Module"}))}),no=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function io(t){return no.includes(t)}const ro=["margin-block-start","margin-block-end","margin-block","margin-inline-start","margin-inline-end","margin-inline","margin-bottom","margin-left","margin-right","margin-top","margin"];const oo=["width","height","min-width","min-height","max-width","max-height","block-size","inline-size","min-block-size","min-inline-size","max-block-size","max-inline-size"];function so(t){return oo.includes(t)}const lo=["justify-self","align-self","place-self"];const ao=[...no,...ro,...oo,...lo,"position-anchor","position-area"],co=[...oo,...no,...ro];function uo(t){return co.includes(t)}const ho=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function fo(t){return ho.includes(t)}const po=["width","height","block","inline","self-block","self-inline"];const mo=new Set(["Atrule","Selector","Declaration"]);const ko=(t,e)=>{if(9===t&&(t=e),"string"==typeof t){const e=t.charCodeAt(0);return e>127?32768:e<<8}return t},yo=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,it],[1,rt],[1,ot],[1,lt],[1,ft],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,it],[3,rt],[3,ot],[3,lt],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,it],[4,rt],[4,ot],[4,lt],[ot,1],[ot,2],[ot,7],[ot,8],[ot,"-"],[ot,it],[ot,rt],[ot,ot],[ot,lt],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",it],["#",rt],["#",ot],["#",lt],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",it],["-",rt],["-",ot],["-",lt],[it,1],[it,2],[it,7],[it,8],[it,it],[it,rt],[it,ot],[it,"%"],[it,lt],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",lt],[".",it],[".",rt],[".",ot],["+",it],["+",rt],["+",ot],["/","*"]],go=yo.concat([[1,4],[ot,4],[4,4],[3,ft],[3,5],[3,at],[rt,rt],[rt,ot],[rt,2],[rt,"-"],[dt,1],[dt,2],[dt,rt],[dt,ot],[dt,4],[dt,"-"]]);function bo(t){const e=new Set(t.map((([t,e])=>ko(t)<<16|ko(e))));return function(t,n,i){const r=ko(n,i),o=i.charCodeAt(0);return(45===o&&1!==n&&2!==n&&n!==lt||43===o?e.has(t<<16|o<<8):e.has(t<<16|r))&&this.emit(" ",st,!0),r}}const So=bo(yo),vo=bo(go),Co=Object.freeze(Object.defineProperty({__proto__:null,safe:vo,spec:So},Symbol.toStringTag,{value:"Module"}));function xo(t,e){if("function"!=typeof e)t.children.forEach(this.node,this);else{let n=null;t.children.forEach((t=>{null!==n&&e.call(this,n),this.node(t),n=t}))}}function wo(t){Kt(t,((e,n,i)=>{this.token(e,t.slice(n,i))}))}const Lo=function(t){const e=new Map;for(let[n,i]of Object.entries(t.node))"function"==typeof(i.generate||i)&&e.set(n,i.generate||i);return function(t,n){let i="",r=0,o={node(t){if(!e.has(t.type))throw new Error("Unknown node type: "+t.type);e.get(t.type).call(s,t)},tokenBefore:vo,token(t,e){r=this.tokenBefore(r,t,e),this.emit(e,t,!1),9===t&&92===e.charCodeAt(0)&&this.emit("\n",st,!0)},emit(t){i+=t},result:()=>i};n&&("function"==typeof n.decorator&&(o=n.decorator(o)),n.sourceMap&&(o=function(t){const e=new SourceMapGenerator,n={line:1,column:0},i={line:0,column:0},r={line:1,column:0},o={generated:r};let s=1,l=0,a=!1;const c=t.node;t.node=function(t){if(t.loc&&t.loc.start&&mo.has(t.type)){const c=t.loc.start.line,u=t.loc.start.column-1;(i.line!==c||i.column!==u)&&(i.line=c,i.column=u,n.line=s,n.column=l,a&&(a=!1,(n.line!==r.line||n.column!==r.column)&&e.addMapping(o)),a=!0,e.addMapping({source:t.loc.source,original:i,generated:n}))}c.call(this,t),a&&mo.has(t.type)&&(r.line=s,r.column=l)};const u=t.emit;t.emit=function(t,e,n){for(let e=0;e<t.length;e++)10===t.charCodeAt(e)?(s++,l=0):l++;u(t,e,n)};const h=t.result;return t.result=function(){return a&&e.addMapping(o),{css:h(),map:e}},t}(o)),n.mode in Co&&(o.tokenBefore=Co[n.mode]));const s={node:t=>o.node(t),children:xo,token:(t,e)=>o.token(t,e),tokenize:wo};return o.node(t),o.result()}}({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ce,Atrule:me,AtrulePrelude:ge,AttributeSelector:we,Block:Ee,Brackets:De,CDC:Fe,CDO:$e,ClassSelector:Ve,Combinator:Ge,Comment:Ke,Condition:sn,Declaration:dn,DeclarationList:bn,Dimension:xn,Feature:On,FeatureFunction:Rn,FeatureRange:Mn,Function:Un,GeneralEnclosed:Hn,Hash:Yn,IdSelector:ri,Identifier:ti,Layer:ai,LayerList:hi,MediaQuery:mi,MediaQueryList:gi,NestingSelector:vi,Nth:wi,Number:Ai,Operator:Ri,Parentheses:Ii,Percentage:zi,PseudoClassSelector:Bi,PseudoElementSelector:Qi,Ratio:Ji,Raw:nr,Rule:lr,Scope:ur,Selector:dr,SelectorList:kr,String:vr,StyleSheet:Lr,SupportsDeclaration:Ar,TypeSelector:jr,UnicodeRange:Wr,Url:qr,Value:Gr,WhiteSpace:Zr},Symbol.toStringTag,{value:"Module"}))});let To=null;class Oo{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return Oo.createItem(t)}allocateCursor(t,e){let n;return null!==To?(n=To,To=To.cursor,n.prev=t,n.next=e,n.cursor=this.cursor):n={prev:t,next:e,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=To,To=t}updateCursors(t,e,n,i){let{cursor:r}=this;for(;null!==r;)r.prev===t&&(r.prev=e),r.next===n&&(r.next=i),r=r.cursor}*[Symbol.iterator](){for(let t=this.head;null!==t;t=t.next)yield t.data}get size(){let t=0;for(let e=this.head;null!==e;e=e.next)t++;return t}get isEmpty(){return null===this.head}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let e=null;this.head=null;for(let n of t){const t=Oo.createItem(n);null!==e?e.next=t:this.head=t,t.prev=e,e=t}return this.tail=e,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,e=this){const n=this.allocateCursor(null,this.head);for(;null!==n.next;){const i=n.next;n.next=i.next,t.call(e,i.data,i,this)}this.releaseCursor()}forEachRight(t,e=this){const n=this.allocateCursor(this.tail,null);for(;null!==n.prev;){const i=n.prev;n.prev=i.prev,t.call(e,i.data,i,this)}this.releaseCursor()}reduce(t,e,n=this){let i,r=this.allocateCursor(null,this.head),o=e;for(;null!==r.next;)i=r.next,r.next=i.next,o=t.call(n,o,i.data,i,this);return this.releaseCursor(),o}reduceRight(t,e,n=this){let i,r=this.allocateCursor(this.tail,null),o=e;for(;null!==r.prev;)i=r.prev,r.prev=i.prev,o=t.call(n,o,i.data,i,this);return this.releaseCursor(),o}some(t,e=this){for(let n=this.head;null!==n;n=n.next)if(t.call(e,n.data,n,this))return!0;return!1}map(t,e=this){const n=new Oo;for(let i=this.head;null!==i;i=i.next)n.appendData(t.call(e,i.data,i,this));return n}filter(t,e=this){const n=new Oo;for(let i=this.head;null!==i;i=i.next)t.call(e,i.data,i,this)&&n.appendData(i.data);return n}nextUntil(t,e,n=this){if(null===t)return;const i=this.allocateCursor(null,t);for(;null!==i.next;){const t=i.next;if(i.next=t.next,e.call(n,t.data,t,this))break}this.releaseCursor()}prevUntil(t,e,n=this){if(null===t)return;const i=this.allocateCursor(t,null);for(;null!==i.prev;){const t=i.prev;if(i.prev=t.prev,e.call(n,t.data,t,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new Oo;for(let e of this)t.appendData(e);return t}prepend(t){return this.updateCursors(null,t,this.head,t),null!==this.head?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(Oo.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(Oo.createItem(t))}insert(t,e=null){if(null!==e)if(this.updateCursors(e.prev,t,e,t),null===e.prev){if(this.head!==e)throw new Error("before doesn't belong to list");this.head=t,e.prev=t,t.next=e,this.updateCursors(null,t)}else e.prev.next=t,t.prev=e.prev,e.prev=t,t.next=e;else this.updateCursors(this.tail,t,null,t),null!==this.tail?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,e){return this.insert(Oo.createItem(t),e)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),null!==t.prev)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(null!==t.next)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(Oo.createItem(t))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(t){this.prepend(Oo.createItem(t))}shift(){return null!==this.head?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,e){return null===t.head||(null!=e?(this.updateCursors(e.prev,t.tail,e,t.head),null!==e.prev?(e.prev.next=t.head,t.head.prev=e.prev):this.head=t.head,e.prev=t.tail,t.tail.next=e):(this.updateCursors(this.tail,t.tail,null,t.head),null!==this.tail?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null),this}replace(t,e){"head"in e?this.insertList(e,t):this.insert(e,t),this.remove(t)}}const Ao=" ";function _o({source:t,line:e,column:n,baseLine:i,baseColumn:r},o){function s(t,e){return l.slice(t,e).map(((e,n)=>String(t+n+1).padStart(u)+" |"+e)).join("\n")}const l=("\n".repeat(Math.max(i-1,0))+" ".repeat(Math.max(r-1,0))+t).split(/\r\n?|\n|\f/),a=Math.max(1,e-o)-1,c=Math.min(e+o,l.length+1),u=Math.max(4,String(c).length)+1;let h=0;(n+=3*(l[e-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(h=n-60+3,n=58);for(let t=a;t<=c;t++)t>=0&&t<l.length&&(l[t]=l[t].replace(/\t/g,Ao),l[t]=(h>0&&l[t].length>h?"…":"")+l[t].substr(h,98)+(l[t].length>h+100-1?"…":""));return[s(a,e),new Array(n+u+2).join("-")+"^",s(e,c)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Po(t,e,n,i,r,o=1,s=1){return Object.assign(function(t,e){const n=Object.create(SyntaxError.prototype),i=new Error;return Object.assign(n,{name:t,message:e,get stack(){return(i.stack||"").replace(/^(.+\n){1,3}/,`${t}: ${e}\n`)}})}("SyntaxError",t),{source:e,offset:n,line:i,column:r,sourceFragment:t=>_o({source:e,line:i,column:r,baseLine:o,baseColumn:s},isNaN(t)?0:t),get formattedMessage(){return`Parse error: ${t}\n`+_o({source:e,line:i,column:r,baseLine:o,baseColumn:s},2)}})}function Eo(t){const e=this.createList();let n=!1;const i={recognizer:t};for(;!this.eof;){switch(this.tokenType){case kt:this.next();continue;case st:n=!0,this.next();continue}let r=t.getNode.call(this,i);if(void 0===r)break;n&&(t.onWhiteSpace&&t.onWhiteSpace.call(this,r,e,i),n=!1),e.push(r)}return n&&t.onWhiteSpace&&t.onWhiteSpace.call(this,null,e,i),e}const Ro=()=>{};function jo(t){return function(){return this[t]()}}function Do(t){const e=Object.create(null);for(const n of Object.keys(t)){const i=t[n],r=i.parse||i;r&&(e[n]=r)}return e}function Io(t){switch(this.tokenType){case 4:return this.Hash();case ut:return this.Operator();case ft:return this.Parentheses(this.readSequence,t.recognizer);case ht:return this.Brackets(this.readSequence,t.recognizer);case 5:return this.String();case ot:return this.Dimension();case rt:return this.Percentage();case it:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,t.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(47===t||42===t||43===t||45===t)return this.Operator();35===t&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const No={getNode:Io};const Fo={onWhiteSpace:function(t,e){null!==e.last&&"Combinator"!==e.last.type&&null!==t&&"Combinator"!==t.type&&e.push({type:"Combinator",loc:null,name:" "})},getNode:function(){switch(this.tokenType){case ht:return this.AttributeSelector();case 4:return this.IdSelector();case at:return this.lookupType(1)===at?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case it:case rt:return this.Percentage();case ot:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case 43:case 62:case 126:case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector();case 38:return this.NestingSelector()}}}};function Mo(t){return null!==t&&"Operator"===t.type&&("-"===t.value[t.value.length-1]||"+"===t.value[t.value.length-1])}const zo={getNode:Io,onWhiteSpace(t,e){Mo(t)&&(t.value=" "+t.value),Mo(e.last)&&(e.last.value+=" ")},expression:function(){return this.createSingleNodeList(this.Raw(null,!1))},var:function(){const t=this.createList();if(this.skipSC(),t.push(this.Identifier()),this.skipSC(),this.tokenType===ut){t.push(this.Operator());const e=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty)for(let t=e-this.tokenIndex;t<=0;t++)if(this.lookupType(t)===st){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}t.push(n)}return t}},$o=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:No,Selector:Fo,Value:zo},Symbol.toStringTag,{value:"Module"})),Wo=new Set(["none","and","not","or"]),Uo={parse:{prelude(){const t=this.createList();if(1===this.tokenType){const e=this.substring(this.tokenStart,this.tokenEnd);Wo.has(e.toLowerCase())||t.push(this.Identifier())}return t.push(this.Condition("container")),t},block(t=!1){return this.Block(t)}}},Bo={parse:{prelude:null,block(){return this.Block(!0)}}};function Vo(t,e){return this.parseWithFallback((()=>{try{return t.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==dt&&this.error()}}),e||(()=>this.Raw(null,!0)))}const qo={layer(){this.skipSC();const t=this.createList(),e=Vo.call(this,this.Layer);return("Raw"!==e.type||""!==e.value)&&t.push(e),t},supports(){this.skipSC();const t=this.createList(),e=Vo.call(this,this.Declaration,(()=>Vo.call(this,(()=>this.Condition("supports")))));return("Raw"!==e.type||""!==e.value)&&t.push(e),t}},Ho={container:Uo,"font-face":Bo,import:{parse:{prelude(){const t=this.createList();switch(this.tokenType){case 5:t.push(this.String());break;case 7:case 2:t.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),1===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?t.push(this.Identifier()):2===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&t.push(this.Function(null,qo)),this.skipSC(),2===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&t.push(this.Function(null,qo)),(1===this.lookupNonWSType(0)||this.lookupNonWSType(0)===ft)&&t.push(this.MediaQueryList()),t},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(t=!1){return this.Block(t)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(t=!1){return this.Block(t)}}},"starting-style":{parse:{prelude:null,block(t=!1){return this.Block(t)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(t=!1){return this.Block(t)}}}};const Qo={parse(){return this.createSingleNodeList(this.SelectorList())}},Go={parse(){return this.createSingleNodeList(this.Selector())}},Xo={parse(){return this.createSingleNodeList(this.Identifier())}},Yo={parse:function(){const t=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case 1:t.push(this.Identifier());break;case 5:t.push(this.String());break;case ut:t.push(this.Operator());break;case dt:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return t}},Jo={parse(){return this.createSingleNodeList(this.Nth())}},Ko={dir:Xo,has:Qo,lang:Yo,matches:Qo,is:Qo,"-moz-any":Qo,"-webkit-any":Qo,where:Qo,not:Qo,"nth-child":Jo,"nth-last-child":Jo,"nth-last-of-type":Jo,"nth-of-type":Jo,slotted:Go,host:Go,"host-context":Go},Zo=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ae,Atrule:pe,AtrulePrelude:ye,AttributeSelector:xe,Block:Pe,Brackets:je,CDC:Ne,CDO:ze,ClassSelector:Be,Combinator:Qe,Comment:Je,Condition:on,Declaration:fn,DeclarationList:gn,Dimension:Cn,Feature:Tn,FeatureFunction:En,FeatureRange:Fn,Function:Wn,GeneralEnclosed:qn,Hash:Xn,IdSelector:ii,Identifier:Zn,Layer:li,LayerList:ui,MediaQuery:pi,MediaQueryList:yi,NestingSelector:Si,Nth:xi,Number:Oi,Operator:Ei,Parentheses:Di,Percentage:Mi,PseudoClassSelector:Ui,PseudoElementSelector:Hi,Ratio:Yi,Raw:er,Rule:sr,Scope:cr,Selector:fr,SelectorList:mr,String:Sr,StyleSheet:wr,SupportsDeclaration:Or,TypeSelector:Rr,UnicodeRange:$r,Url:Vr,Value:Qr,WhiteSpace:Kr},Symbol.toStringTag,{value:"Module"})),ts=function(t){let e="",n="<unknown>",i=!1,r=Ro,o=!1;const s=new Ht,l=Object.assign(new Jt,function(t){const e={context:Object.create(null),features:Object.assign(Object.create(null),t.features),scope:Object.assign(Object.create(null),t.scope),atrule:Do(t.atrule),pseudo:Do(t.pseudo),node:Do(t.node)};for(const[n,i]of Object.entries(t.parseContext))switch(typeof i){case"function":e.context[n]=i;break;case"string":e.context[n]=jo(i)}return W(W({config:e},e),e.node)}(t||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Eo,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:t=>123===t?1:0,consumeUntilLeftCurlyBracketOrSemicolon:t=>123===t||59===t?1:0,consumeUntilExclamationMarkOrSemicolon:t=>33===t||59===t?1:0,consumeUntilSemicolonIncluded:t=>59===t?2:0,createList:()=>new Oo,createSingleNodeList:t=>(new Oo).appendData(t),getFirstListNode:t=>t&&t.first,getLastListNode:t=>t&&t.last,parseWithFallback(t,e){const n=this.tokenIndex;try{return t.call(this)}catch(t){if(o)throw t;this.skip(n-this.tokenIndex);const i=e.call(this);return o=!0,r(t,i),o=!1,i}},lookupNonWSType(t){let e;do{if(e=this.lookupType(t++),e!==st&&e!==kt)return e}while(0!==e);return 0},charCodeAt:t=>t>=0&&t<e.length?e.charCodeAt(t):0,substring:(t,n)=>e.substring(t,n),substrToCursor(t){return this.source.substring(t,this.tokenStart)},cmpChar:(t,n)=>Dt(e,t,n),cmpStr:(t,n,i)=>It(e,t,n,i),consume(t){const e=this.tokenStart;return this.eat(t),this.substrToCursor(e)},consumeFunctionName(){const t=e.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),t},consumeNumber(t){const n=e.substring(this.tokenStart,$t(e,this.tokenStart));return this.eat(t),n},eat(t){if(this.tokenType!==t){const e=Bt[t].slice(0,-6).replace(/-/g," ").replace(/^./,(t=>t.toUpperCase()));let n=`${/[[\](){}]/.test(e)?`"${e}"`:e} is expected`,i=this.tokenStart;switch(t){case 1:2===this.tokenType||7===this.tokenType?(i=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case 4:this.isDelim(35)&&(this.next(),i++,n="Name is expected");break;case rt:this.tokenType===it&&(i=this.tokenEnd,n="Percent sign is expected")}this.error(n,i)}this.next()},eatIdent(t){(1!==this.tokenType||!1===this.lookupValue(0,t))&&this.error(`Identifier "${t}" is expected`),this.next()},eatDelim(t){this.isDelim(t)||this.error(`Delim "${String.fromCharCode(t)}" is expected`),this.next()},getLocation:(t,e)=>i?s.getLocationRange(t,e,n):null,getLocationFromList(t){if(i){const e=this.getFirstListNode(t),i=this.getLastListNode(t);return s.getLocationRange(null!==e?e.loc.start.offset-s.startOffset:this.tokenStart,null!==i?i.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(t,n){const i=void 0!==n&&n<e.length?s.getLocation(n):this.eof?s.getLocation(function(t,e){for(;e>=0&&wt(t.charCodeAt(e));e--);return e+1}(e,e.length-1)):s.getLocation(this.tokenStart);throw new Po(t||"Unexpected input",e,i.offset,i.line,i.column,s.startLine,s.startColumn)}});return Object.assign((function(t,a){e=t,a=a||{},l.setSource(e,Kt),s.setSource(e,a.offset,a.line,a.column),n=a.filename||"<unknown>",i=!!a.positions,r="function"==typeof a.onParseError?a.onParseError:Ro,o=!1,l.parseAtrulePrelude=!("parseAtrulePrelude"in a)||!!a.parseAtrulePrelude,l.parseRulePrelude=!("parseRulePrelude"in a)||!!a.parseRulePrelude,l.parseValue=!("parseValue"in a)||!!a.parseValue,l.parseCustomProperty="parseCustomProperty"in a&&!!a.parseCustomProperty;const{context:c="default",onComment:u}=a;if(!(c in l.context))throw new Error("Unknown context `"+c+"`");"function"==typeof u&&l.forEachToken(((t,n,i)=>{if(t===kt){const t=l.getLocation(n,i),r=It(e,i-2,i,"*/")?e.slice(n+2,i-2):e.slice(n+2,i);u(r,t)}}));const h=l.context[c].call(l,a);return l.eof||l.error(),h}),{SyntaxError:Po,config:l.config})}({parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(t){return this.AtrulePrelude(t.atrule?String(t.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(t){return this.Condition(t.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:$o,atrule:Ho,pseudo:Ko,node:Zo});function es(t){const e={};for(const n of Object.keys(t)){let i=t[n];i&&(Array.isArray(i)||i instanceof Oo?i=i.map(es):i.constructor===Object&&(i=es(i))),e[n]=i}return e}let ns=(t=21)=>{let e="",n=0|t;for(;n--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e};const is=ns();function rs(t){return!(!t||"Function"!==t.type||"anchor"!==t.name)}function os(t){return ts(t,{parseAtrulePrelude:!1,parseCustomProperty:!0})}function ss(t){return Lo(t,{mode:"spec"})}function ls(t){return t?t.children.map((t=>{var e;let n;"PseudoElementSelector"===(null==(e=t.children.last)?void 0:e.type)&&(n=ss((t=es(t)).children.last),t.children.pop());const i=ss(t);return{selector:i+(null!=n?n:""),elementPart:i,pseudoElementPart:n}})).toArray():[]}const as=[...ao,"anchor-scope","anchor-name"].reduce(((t,e)=>(t[e]=`--${e}-${is}`,t)),{});function cs(t,e){return function(t){return"Declaration"===t.type}(t)&&as[t.property]&&e?(e.children.appendData(q(W({},t),{property:as[t.property]})),{updated:!0}):{}}var us=(t=>(t.All="all",t.None="none",t))(us||{});function hs(t,e){var n;return e=null!=(n=as[e])?n:e,(t instanceof HTMLElement?getComputedStyle(t):t.computedStyle).getPropertyValue(e).trim()}function fs(t,e,n){return hs(t,e)===n}function ds(t,{selector:e,pseudoElementPart:n}){const i=getComputedStyle(t,n),r=document.createElement("div"),o=document.createElement("style");r.id=`fake-pseudo-element-${ns()}`;for(const t of Array.from(i)){const e=i.getPropertyValue(t);r.style.setProperty(t,e)}o.textContent+=`#${r.id}${n} { content: ${i.content}; }`,o.textContent+=`${e} { display: none !important; }`,document.head.append(o);const s="::before"===n?"afterbegin":"beforeend";return t.insertAdjacentElement(s,r),{fakePseudoElement:r,sheet:o,computedStyle:i}}function ps(t){let e=function(t){let e=t;for(;e;){if(fs(e,"overflow","scroll"))return e;e=e.parentElement}return e}(t);return e===document.documentElement&&(e=null),null!=e?e:{scrollTop:0,scrollLeft:0}}function ms(t){const{elementPart:e,pseudoElementPart:n}=t,i=[];if(n&&"::before"!==n&&"::after"!==n)return i;const r=Array.from(document.querySelectorAll(e));if(!n)return i.push(...r),i;for(const e of r){const{fakePseudoElement:n,sheet:r,computedStyle:o}=ds(e,t),s=n.getBoundingClientRect(),{scrollY:l,scrollX:a}=globalThis,c=ps(e);i.push({fakePseudoElement:n,computedStyle:o,removeFakePseudoElement(){n.remove(),r.remove()},contextElement:e,getBoundingClientRect(){const{scrollY:t,scrollX:e}=globalThis,{scrollTop:n,scrollLeft:i}=c;return DOMRect.fromRect({y:s.y+(l-t)+(c.scrollTop-n),x:s.x+(a-e)+(c.scrollLeft-i),width:s.width,height:s.height})}})}return i}function ks(t,e){const n=hs(t,"anchor-scope");return n===e||"all"===n}const ys=e=>R(t,null,(function*(){var t,n,i;let r=yield null==(t=H.getOffsetParent)?void 0:t.call(H,e);return(yield null==(n=H.isElement)?void 0:n.call(H,r))||(r=(yield null==(i=H.getDocumentElement)?void 0:i.call(H,e))||window.document.documentElement),r})),gs="InvalidMimeType";const bs='[style*="anchor"]',Ss='[style*="position-area"]';function vs(t,e){return R(this,null,(function*(){const n=null!=t?t:Array.from(document.querySelectorAll("link, style")),i=[];n.filter((t=>t instanceof HTMLElement)).forEach((t=>{if("link"===t.tagName.toLowerCase()){const e=function(t){const e=new URL(t.href,document.baseURI);if(function(t){return!("text/css"!==t.type&&"stylesheet"!==t.rel||!t.href)}(t)&&e.origin===location.origin)return e}(t);e&&i.push({el:t,url:e})}"style"===t.tagName.toLowerCase()&&i.push({el:t,css:t.innerHTML})}));const r=function(t){const e=t?t.filter((t=>t instanceof HTMLElement&&(t.matches(bs)||t.matches(Ss)))):Array.from(document.querySelectorAll([bs,Ss].join(","))),n=[];return e.filter((t=>t instanceof HTMLElement)).forEach((t=>{const e=ns(12),i="data-has-inline-styles";t.setAttribute(i,e);const r=`[${i}="${e}"] { ${t.getAttribute("style")} }`;n.push({el:t,css:r})})),n}(e?null!=t?t:[]:void 0);return yield function(t){return R(this,null,(function*(){return(yield Promise.all(t.map((t=>R(this,null,(function*(){var e;if(!t.url)return t;if(null!=(e=t.el)&&e.disabled)return null;try{const e=yield fetch(t.url.toString()),n=e.headers.get("content-type");if(null==n||!n.startsWith("text/css")){const e=new Error(`Error loading ${t.url}: expected content-type "text/css", got "${n}".`);throw e.name=gs,e}const i=yield e.text();return q(W({},t),{css:i})}catch(t){if(t instanceof Error&&t.name===gs)return console.warn(t),null;throw t}})))))).filter((t=>null!==t))}))}([...i,...r])}))}let Cs=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e};const xs="--pa-cascade-property",ws="data-anchor-position-wrapper",Ls="data-pa-wrapper-for-",Ts="POLYFILL-POSITION-AREA",Os=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","block-start","block-end","span-block-start","span-block-end","inline-start","inline-end","span-inline-start","span-inline-end","self-block-start","self-block-end","span-self-block-start","span-self-block-end","self-inline-start","self-inline-end","span-self-inline-start","span-self-inline-end","start","end","span-start","span-end","self-start","self-end","span-self-start","span-self-end"];function As(t){return Os.includes(t)}const _s={left:[0,1,"Irrelevant"],center:[1,2,"Irrelevant"],right:[2,3,"Irrelevant"],"span-left":[0,2,"Irrelevant"],"span-right":[1,3,"Irrelevant"],"x-start":[0,1,"Physical"],"x-end":[2,3,"Physical"],"span-x-start":[0,2,"Physical"],"span-x-end":[1,3,"Physical"],"x-self-start":[0,1,"PhysicalSelf"],"x-self-end":[2,3,"PhysicalSelf"],"span-x-self-start":[0,2,"PhysicalSelf"],"span-x-self-end":[1,3,"PhysicalSelf"],"span-all":[0,3,"Irrelevant"],top:[0,1,"Irrelevant"],bottom:[2,3,"Irrelevant"],"span-top":[0,2,"Irrelevant"],"span-bottom":[1,3,"Irrelevant"],"y-start":[0,1,"Physical"],"y-end":[2,3,"Physical"],"span-y-start":[0,2,"Physical"],"span-y-end":[1,3,"Physical"],"y-self-start":[0,1,"PhysicalSelf"],"y-self-end":[2,3,"PhysicalSelf"],"span-y-self-start":[0,2,"PhysicalSelf"],"span-y-self-end":[1,3,"PhysicalSelf"],"block-start":[0,1,"Logical"],"block-end":[2,3,"Logical"],"span-block-start":[0,2,"Logical"],"span-block-end":[1,3,"Logical"],"inline-start":[0,1,"Logical"],"inline-end":[2,3,"Logical"],"span-inline-start":[0,2,"Logical"],"span-inline-end":[1,3,"Logical"],"self-block-start":[0,1,"LogicalSelf"],"self-block-end":[2,3,"LogicalSelf"],"span-self-block-start":[0,2,"LogicalSelf"],"span-self-block-end":[1,3,"LogicalSelf"],"self-inline-start":[0,1,"LogicalSelf"],"self-inline-end":[2,3,"LogicalSelf"],"span-self-inline-start":[0,2,"LogicalSelf"],"span-self-inline-end":[1,3,"LogicalSelf"],start:[0,1,"Logical"],end:[2,3,"Logical"],"span-start":[0,2,"Logical"],"span-end":[1,3,"Logical"],"self-start":[0,1,"LogicalSelf"],"self-end":[2,3,"LogicalSelf"],"span-self-start":[0,2,"LogicalSelf"],"span-self-end":[1,3,"LogicalSelf"]},Ps=["start","center","end","span-start","span-end","span-all"],Es=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Rs=["block","top","bottom","y"],js=["inline","left","right","x"];function Ds(t){const e=t.split("-");for(const t of e){if(Rs.includes(t))return"block";if(js.includes(t))return"inline"}return"ambiguous"}function Is(t,e){return e[0].includes(t[0])&&e[1].includes(t[1])||e[0].includes(t[1])&&e[1].includes(t[0])}const Ns=[[["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all"],["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","span-all"]],[["block-start","center","block-end","span-block-start","span-block-end","span-all"],["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"]],[["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"]],[Ps,Ps],[Es,Es]];const Fs=t=>{const e=getComputedStyle(t);return{writingMode:e.writingMode,direction:e.direction}},Ms=t=>t.reverse().map((t=>3-t)),zs=(t,e)=>"Irrelevant"===t?e:t,$s=(e,n)=>R(t,[e,n],(function*({block:e,inline:n},i){const r=zs(e[2],n[2]),o=yield((e,n)=>R(t,null,(function*(){const t=yield ys(e);switch(n){case"Logical":case"Physical":return Fs(t);case"LogicalSelf":case"PhysicalSelf":return Fs(e);default:return null}})))(i,r),s={block:[e[0],e[1]],inline:[n[0],n[1]]};if(o){if("rtl"===o.direction&&(s.inline=Ms(s.inline)),o.writingMode.startsWith("vertical")){const t=s.block;s.block=s.inline,s.inline=t}if(o.writingMode.startsWith("sideways")){const t=s.block;s.block=s.inline,s.inline=t,o.writingMode.endsWith("lr")&&(s.block=Ms(s.block))}o.writingMode.endsWith("rl")&&(s.inline=Ms(s.inline))}return s}));function Ws([t,e]){return 0===t&&3===e?"center":0===t?"end":3===e?"start":"center"}function Us(t){if(!function(t){return"Declaration"===t.type&&"position-area"===t.property}(t))return;const e=function(t){const e=t.value.children.toArray().map((({name:t})=>t));return 1===e.length&&("ambiguous"===Ds(e[0])?e.push(e[0]):e.push("span-all")),e}(t);if(!function(t){for(const e of Ns)if(Is(t,e))return!0;return!1}(e))return;const n={};switch(Ds(e[0])){case"block":n.block=e[0],n.inline=e[1];break;case"inline":n.inline=e[0],n.block=e[1];break;case"ambiguous":"block"==Ds(e[1])?(n.block=e[1],n.inline=e[0]):(n.inline=e[1],n.block=e[0])}return{values:n,grid:{block:_s[n.block],inline:_s[n.inline]},selectorUUID:`--pa-declaration-${Cs(12)}`}}function Bs(t,e){["justify-self","align-self"].forEach((t=>{e.children.appendData({type:"Declaration",property:t,value:{type:"Raw",value:`var(--pa-value-${t})`},important:!1})})),e.children.appendData({type:"Declaration",property:xs,value:{type:"Raw",value:t.selectorUUID},important:!1})}function Vs(t,e){var n,i;let r;if((null==(n=t.parentElement)?void 0:n.tagName)===Ts)r=t.parentElement;else{r=document.createElement(Ts),r.style.display="grid",r.style.position="absolute";const e=getComputedStyle(t).pointerEvents;r.style.pointerEvents="none",t.style.pointerEvents=e,["top","left","right","bottom"].forEach((t=>{r.style.setProperty(t,`var(--pa-value-${t})`)})),null==(i=t.parentElement)||i.insertBefore(r,t),r.appendChild(t)}return r.setAttribute(`${Ls}${e}`,""),r}function qs(t,e,n){return R(this,null,(function*(){const i=`--pa-target-${Cs(12)}`,r=yield $s(e.grid,t),o=(({block:t,inline:e})=>{const n=[0,"top","bottom",0],i=[0,"left","right",0];return{block:[n[t[0]],n[t[1]]],inline:[i[e[0]],i[e[1]]]}})(r),s=zs(e.grid.block[2],e.grid.inline[2]),l=["LogicalSelf","PhysicalSelf"].includes(s)?r:e.grid;return{insets:o,alignments:{block:Ws([l.block[0],l.block[1]]),inline:Ws([l.inline[0],l.inline[1]])},targetUUID:i,targetEl:t,anchorEl:n,wrapperEl:Vs(t,i),values:e.values,grid:e.grid,selectorUUID:e.selectorUUID}}))}function Hs(t,e){return`\n [${ws}="${e}"][${Ls}${t}] {\n --pa-value-top: var(${t}-top);\n --pa-value-left: var(${t}-left);\n --pa-value-right: var(${t}-right);\n --pa-value-bottom: var(${t}-bottom);\n --pa-value-justify-self: var(${t}-justify-self);\n --pa-value-align-self: var(${t}-align-self);\n }\n `.replaceAll("\n","")}const Qs=["normal","most-width","most-height","most-block-size","most-inline-size"],Gs=["flip-block","flip-inline","flip-start"];function Xs(t,e){const n=document.querySelector(t);if(n){let t=function(t){const e={};return ao.forEach((n=>{const i=hs(t,`--${n}-${is}`);i&&(e[n]=i)})),e}(n);return e.forEach((e=>{t=el(t,e)})),t}}function Ys(t,e){let n=t.declarations;return e.forEach((t=>{n=el(n,t)})),n}const Js={"flip-block":{top:"bottom",bottom:"top","inset-block-start":"inset-block-end","inset-block-end":"inset-block-start","margin-top":"margin-bottom","margin-bottom":"margin-top"},"flip-inline":{left:"right",right:"left","inset-inline-start":"inset-inline-end","inset-inline-end":"inset-inline-start","margin-left":"margin-right","margin-right":"margin-left"},"flip-start":{left:"top",right:"bottom",top:"left",bottom:"right","inset-block-start":"inset-block-end","inset-block-end":"inset-block-start","inset-inline-start":"inset-inline-end","inset-inline-end":"inset-inline-start","inset-block":"inset-inline","inset-inline":"inset-block"}},Ks={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start","self-end":"self-start","self-start":"self-end"},"flip-inline":{left:"right",right:"left",start:"end",end:"start","self-end":"self-start","self-start":"self-end"},"flip-start":{top:"left",left:"top",right:"bottom",bottom:"right"}},Zs={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};const tl=(t,e)=>{var n;return(null==(n=os(`#id{${t}: ${e};}`).children.first)?void 0:n.block.children.first).value};function el(t,e){const n={};return Object.entries(t).forEach((([t,i])=>{const r=t,o=tl(r,i),s=function(t,e){return Js[e][t]||t}(r,e);s!==r&&(null!=n[r]||(n[r]="revert")),eo(o,{visit:"Function",enter(t){rs(t)&&t.children.forEach((t=>{gl(t)&&fo(t.name)&&(t.name=function(t,e){return Ks[e][t]||t}(t.name,e))}))}}),"position-area"===r&&o.children.forEach((t=>{gl(t)&&As(t.name)&&(t.name=function(t,e){if("flip-start"===e)return t;{const n=Zs[e];return t.split("-").map((t=>n[t]||t)).join("-")}}(t.name,e))})),r.startsWith("margin")&&function(t,e,n){if("margin"===t){const[t,i,r,o]=e.children.toArray();"flip-block"===n?o?e.children.fromArray([r,i,t,o]):r&&e.children.fromArray([r,i,t]):"flip-inline"===n&&o&&e.children.fromArray([t,o,r,i])}else if("margin-block"===t){const[t,i]=e.children.toArray();"flip-block"===n&&i&&e.children.fromArray([i,t])}else if("margin-inline"===t){const[t,i]=e.children.toArray();"flip-inline"===n&&i&&e.children.fromArray([i,t])}}(r,o,e),n[s]=ss(o)})),n}function nl(t){const e=function(t){return t.toArray().reduce(((t,e)=>"Operator"===e.type&&","===e.value?(t.push([]),t):("Identifier"===e.type&&t[t.length-1].push(e),t)),[[]])}(t),n=[];return e.forEach((t=>{const e={atRules:[],tactics:[],positionAreas:[]};t.forEach((t=>{!function(t){return Gs.includes(t)}(t.name)?t.name.startsWith("--")?e.atRules.push(t.name):As(t.name)&&e.positionAreas.push(t.name):e.tactics.push(t.name)})),e.positionAreas.length?n.push({positionArea:e.positionAreas[0],type:"position-area"}):e.atRules.length&&e.tactics.length?n.push({tactics:e.tactics,atRule:e.atRules[0],type:"at-rule-with-try-tactic"}):e.atRules.length?n.push({atRule:e.atRules[0],type:"at-rule"}):e.tactics.length&&n.push({tactics:e.tactics,type:"try-tactic"})})),n}function il(t){if(function(t){return"Declaration"===t.type&&"position-try"===t.property}(t)&&t.value.children.first){const e=es(t);let n;const i=e.value.children.first.name;i&&function(t){return Qs.includes(t)}(i)&&(n=i,e.value.children.shift());return{order:n,options:nl(e.value.children)}}return{}}function rl(t){const{order:e,options:n}=il(t);if(e||n)return{order:e,options:n};const{order:i}=function(t){return function(t){return"Declaration"===t.type&&"position-try-order"===t.property}(t)&&t.value.children.first?{order:t.value.children.first.name}:{}}(t),r=function(t){return function(t){return"Declaration"===t.type&&"position-try-fallbacks"===t.property}(t)&&t.value.children.first?nl(t.value.children):[]}(t);return i||r?{order:i,options:r}:{}}function ol(t){return io(t.property)||function(t){return ro.includes(t)}(t.property)||so(t.property)||function(t){return lo.includes(t)}(t.property)||["position-anchor","position-area"].includes(t.property)}function sl(t){var e,n;if(function(t){return"Atrule"===t.type&&"position-try"===t.name}(t)&&null!=(e=t.prelude)&&e.value&&null!=(n=t.block)&&n.children){const e=t.prelude.value,n=t.block.children.filter((t=>function(t){return"Declaration"===t.type}(t)&&ol(t)));return{name:e,tryBlock:{uuid:`${e}-try-${ns(12)}`,declarations:Object.fromEntries(n.map((t=>[t.property,ss(t.value)])))}}}return{}}function ll(t){return!(!t||t!==t.window)}function al(t){return!(!t||!function(t){return fs(t,"position","fixed")}(t)&&!fs(t,"position","absolute"))}function cl(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING}function ul(t){return R(this,null,(function*(){if(!["absolute","fixed"].includes(hs(t,"position")))return yield function(t){return R(this,null,(function*(){return yield H.getOffsetParent(t)}))}(t);let e=t.parentElement;for(;e;){if(!fs(e,"position","static")&&fs(e,"display","block"))return e;e=e.parentElement}return window}))}function hl(t,e,n,i){return R(this,null,(function*(){const r=yield ul(t),o=yield ul(n);if(!function(t,e){return!(!t||t===e)&&(ll(t)?t.document.contains(e):t.contains(e))}(o,t)&&!ll(o)||r===o&&al(t)&&!cl(t,n))return!1;if(r!==o){let t;const e=[];for(t=r;t&&t!==o&&t!==window;)e.push(t),t=yield ul(t);const i=e[e.length-1];if(i instanceof HTMLElement&&al(i)&&!cl(i,n))return!1}{let e=t.parentElement;for(;e;){if(fs(e,"content-visibility","hidden"))return!1;e=e.parentElement}}return!(e&&i&&fl(t,e,i)!==fl(n,e,i))}))}function fl(t,e,n){for(;!t.matches(n)||!ks(t,e);){if(!t.parentElement)return null;t=t.parentElement}return t}function dl(t,e,n,i){return R(this,null,(function*(){if(!(t instanceof HTMLElement&&n.length&&al(t)))return null;const r=n.flatMap(ms).filter((t=>function(t,e){const n=hs(t,"anchor-name");return e?n.split(",").map((t=>t.trim())).includes(e):!n}(t,e))),o=i.map((t=>t.selector)).join(",")||null;for(let n=r.length-1;n>=0;n--){const i=r[n],s="fakePseudoElement"in i;if(yield hl(s?i.fakePseudoElement:i,e,t,o))return s&&i.removeFakePseudoElement(),i}return null}))}function pl(t){return"Declaration"===t.type&&"anchor-name"===t.property}function ml(t){return"Declaration"===t.type&&"anchor-scope"===t.property}function kl(t){return!(!t||"Function"!==t.type||"anchor-size"!==t.name)}function yl(t){return!(!t||"Function"!==t.type||"var"!==t.name)}function gl(t){return!("Identifier"!==t.type||!t.name)}function bl(t,e){let n,i,r,o,s="",l=!1;const a=[];t.children.toArray().forEach((t=>{l?s=`${s}${ss(t)}`:"Operator"!==t.type||","!==t.value?a.push(t):l=!0}));let[c,u]=a;if(u||(u=c,c=void 0),c&&(gl(c)&&c.name.startsWith("--")?n=c.name:yl(c)&&c.children.first&&(o=c.children.first.name)),u)if(rs(t)){if(gl(u)&&fo(u.name))i=u.name;else if(function(t){return!("Percentage"!==t.type||!t.value)}(u)){const t=Number(u.value);i=Number.isNaN(t)?void 0:t}}else kl(t)&&gl(u)&&function(t){return po.includes(t)}(u.name)&&(r=u.name);const h=`--anchor-${ns(12)}`;return Object.assign(t,{type:"Raw",value:`var(${h})`,children:null}),Reflect.deleteProperty(t,"name"),{anchorName:n,anchorSide:i,anchorSize:r,fallbackValue:s||"0px",customPropName:o,uuid:h}}function Sl(t){return t.value.children.map((({name:t})=>t))}let vl={},Cl={},xl={},wl={},Ll={};function Tl(t,e){var n;if((rs(t)||kl(t))&&e){if(e.property.startsWith("--")){const i=ss(e.value),r=bl(t);return wl[r.uuid]=i,xl[e.property]=[...null!=(n=xl[e.property])?n:[],r],{changed:!0}}if(rs(t)&&io(e.property)||kl(t)&&uo(e.property)){const n=bl(t);return{prop:e.property,data:n,changed:!0}}}return{}}function Ol(t,e){return R(this,null,(function*(){let n=null==e?void 0:e.anchorName;const i=null==e?void 0:e.customPropName;if(t&&!n){const e=hs(t,"position-anchor");e?n=e:i&&(n=hs(t,i))}const r=n&&vl[n]||[],o=n&&Cl[us.All]||[],s=n&&Cl[n]||[];return yield dl(t,n||null,r,[...o,...s])}))}function Al(t){return R(this,null,(function*(){var e,n,i,r,o,s,l,a,c,u,h;const f={},d={};vl={},Cl={},xl={},wl={},Ll={};const{fallbackTargets:p,validPositions:m}=function(t){const e={},n={},i={};for(const n of t){const t=os(n.css);eo(t,{visit:"Atrule",enter(t){const{name:n,tryBlock:i}=sl(t);n&&i&&(e[n]=i)}})}for(const r of t){let t=!1;const o=new Set,s=os(r.css);eo(s,{visit:"Declaration",enter(r){var s;const l=ls(null==(s=this.rule)?void 0:s.prelude);if(!l.length)return;const{order:a,options:c}=rl(r),u={};a&&(u.order=a),l.forEach((({selector:r})=>{var s;null==c||c.forEach((i=>{var s;let l;if("at-rule"===i.type)l=i.atRule;else if("try-tactic"===i.type){l=`${r}-${i.tactics.join("-")}`;const t=Xs(r,i.tactics);t&&(e[l]={uuid:`${r}-${i.tactics.join("-")}-try-${ns(12)}`,declarations:t})}else if("at-rule-with-try-tactic"===i.type){l=`${r}-${i.atRule}-${i.tactics.join("-")}`;const t=Ys(e[i.atRule],i.tactics);t&&(e[l]={uuid:`${r}-${i.atRule}-${i.tactics.join("-")}-try-${ns(12)}`,declarations:t})}if(l&&e[l]){const i=`[data-anchor-polyfill="${e[l].uuid}"]`;null!=n[i]||(n[i]=[]),n[i].push(r),o.has(l)||(null!=u.fallbacks||(u.fallbacks=[]),u.fallbacks.push(e[l]),o.add(l),null==(s=this.stylesheet)||s.children.prependData({type:"Rule",prelude:{type:"Raw",value:i},block:{type:"Block",children:(new Oo).fromArray(Object.entries(e[l].declarations).map((([t,e])=>({type:"Declaration",important:!0,property:t,value:{type:"Raw",value:e}}))))}}),t=!0)}})),Object.keys(u).length>0&&(i[r]?(u.order&&(i[r].order=u.order),u.fallbacks&&(null!=(s=i[r]).fallbacks||(s.fallbacks=[]),i[r].fallbacks.push(...u.fallbacks))):i[r]=u)}))}}),t&&(r.css=ss(s),r.changed=!0)}return{fallbackTargets:n,validPositions:i}}(t);for(const e of t){let t=!1;const n=os(e.css);eo(n,(function(e){var n,i,r,o;const s=ls(null==(n=this.rule)?void 0:n.prelude);if(pl(e)&&s.length)for(const t of Sl(e))null!=vl[t]||(vl[t]=[]),vl[t].push(...s);if(ml(e)&&s.length)for(const t of Sl(e))null!=Cl[t]||(Cl[t]=[]),Cl[t].push(...s);const{prop:l,data:a,changed:c}=Tl(e,this.declaration);if(l&&a&&s.length)for(const{selector:t}of s)f[t]=q(W({},f[t]),{[l]:[...null!=(r=null==(i=f[t])?void 0:i[l])?r:[],a]});let u;if(this.block&&(u=Us(e),u)){Bs(u,this.block);for(const{selector:t}of s)d[t]=[...null!=(o=d[t])?o:[],u]}(c||u)&&(t=!0)})),t&&(e.css=ss(n),e.changed=!0)}const k=new Set(Object.keys(xl)),y={},g=t=>{var e,n,i,r,o;const s=[],l=new Set(null!=(n=null==(e=y[t])?void 0:e.names)?n:[]);for(;l.size>0;)for(const t of l)s.push(...null!=(i=xl[t])?i:[]),l.delete(t),null!=(o=null==(r=y[t])?void 0:r.names)&&o.length&&y[t].names.forEach((t=>l.add(t)));return s};for(;k.size>0;){const e=[];for(const n of t){let t=!1;const i=os(n.css);eo(i,{visit:"Function",enter(n){var i,r;const o=null==(i=this.rule)?void 0:i.prelude,s=this.declaration,l=null==s?void 0:s.property;if(!1===(null==o?void 0:o.children.isEmpty)&&yl(n)&&s&&l&&n.children.first&&k.has(n.children.first.name)&&l.startsWith("--")){const i=n.children.first,o=null!=(r=xl[i.name])?r:[],a=g(i.name);if(!o.length&&!a.length)return;const c=`${i.name}-anchor-${ns(12)}`,u=ss(s.value);wl[c]=u,y[l]||(y[l]={names:[],uuids:[]});const h=y[l];h.names.includes(i.name)||h.names.push(i.name),h.uuids.push(c),e.push(l),i.name=c,t=!0}}}),t&&(n.css=ss(i),n.changed=!0)}k.clear(),e.forEach((t=>k.add(t)))}for(const e of t){let t=!1;const n=os(e.css);eo(n,{visit:"Function",enter(e){var n,i,r,o,s,l,a;const c=null==(n=this.rule)?void 0:n.prelude,u=this.declaration,h=null==u?void 0:u.property;if(!1===(null==c?void 0:c.children.isEmpty)&&yl(e)&&u&&h&&e.children.first&&(io(h)||so(h))){const n=e.children.first,u=null!=(i=xl[n.name])?i:[],d=g(n.name);if(!u.length&&!d.length)return;const p=`${h}-${ns(12)}`;if(d.length){const t=new Set([n.name]);for(;t.size>0;)for(const e of t){const n=y[e];if(null!=(r=null==n?void 0:n.names)&&r.length&&null!=(o=null==n?void 0:n.uuids)&&o.length)for(const t of n.names)for(const e of n.uuids)Ll[e]=q(W({},Ll[e]),{[p]:`${t}-${p}`});t.delete(e),null!=(s=null==n?void 0:n.names)&&s.length&&n.names.forEach((e=>t.add(e)))}}const m=ls(c);for(const t of[...u,...d]){const e=W({},t),n=`--anchor-${ns(12)}-${h}`,i=e.uuid;e.uuid=n;for(const{selector:t}of m)f[t]=q(W({},f[t]),{[h]:[...null!=(a=null==(l=f[t])?void 0:l[h])?a:[],e]});Ll[i]=q(W({},Ll[i]),{[p]:n})}n.name=`${n.name}-${p}`,t=!0}}}),t&&(e.css=ss(n),e.changed=!0)}if(Object.keys(Ll).length>0)for(const e of t){let t=!1;const n=os(e.css);eo(n,{visit:"Function",enter(e){var n,i,r,o;if(yl(e)&&null!=(i=null==(n=e.children.first)?void 0:n.name)&&i.startsWith("--")&&null!=(o=null==(r=this.declaration)?void 0:r.property)&&o.startsWith("--")&&this.block){const n=e.children.first,i=Ll[n.name];if(i)for(const[e,r]of Object.entries(i))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${e}`,value:{type:"Raw",value:ss(this.declaration.value).replace(`var(${n.name})`,`var(${r})`)}}),t=!0;wl[n.name]&&(this.declaration.value={type:"Raw",value:wl[n.name]},t=!0)}}}),t&&(e.css=ss(n),e.changed=!0)}const b=new Map;for(const[t,a]of Object.entries(f)){let c;c=t.startsWith("[data-anchor-polyfill=")&&null!=(e=p[t])&&e.length?document.querySelectorAll(p[t].join(",")):document.querySelectorAll(t);for(const[e,u]of Object.entries(a))for(const a of u)for(const u of c){const c=yield Ol(u,a),h=`--anchor-${ns(12)}`;b.set(u,q(W({},null!=(n=b.get(u))?n:{}),{[a.uuid]:h})),u.setAttribute("style",`${a.uuid}: var(${h}); ${null!=(i=u.getAttribute("style"))?i:""}`),m[t]=q(W({},m[t]),{declarations:q(W({},null==(r=m[t])?void 0:r.declarations),{[e]:[...null!=(l=null==(s=null==(o=m[t])?void 0:o.declarations)?void 0:s[e])?l:[],q(W({},a),{anchorEl:c,targetEl:u,uuid:h})]})})}}const S={el:document.createElement("link"),changed:!1,created:!0,css:""};t.push(S);for(const[t,e]of Object.entries(d)){const n=document.querySelectorAll(t);for(const i of n){const n=yield Ol(i);for(const r of e){const e=yield qs(i,r,n);S.css+=Hs(e.targetUUID,r.selectorUUID),S.changed=!0,m[t]=q(W({},m[t]),{declarations:q(W({},null==(a=m[t])?void 0:a.declarations),{"position-area":[...null!=(h=null==(u=null==(c=m[t])?void 0:c.declarations)?void 0:u["position-area"])?h:[],e]})})}}}return{rules:m,inlineStyles:b,anchorScopes:Cl}}))}const _l=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function Pl(t,e,n=!1){const i=[];for(const{el:r,css:o,changed:s,created:l=!1}of t){const t={el:r,css:o,changed:!1};if(s)if("style"===r.tagName.toLowerCase())r.innerHTML=o;else if(r instanceof HTMLLinkElement){const e=document.createElement("style");e.textContent=o;for(const t of r.getAttributeNames())if(!t.startsWith("on")&&!_l.includes(t)){const n=r.getAttribute(t);null!==n&&e.setAttribute(t,n)}r.hasAttribute("href")&&e.setAttribute("data-original-href",r.getAttribute("href")),l?(e.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",e)):(r.insertAdjacentElement("beforebegin",e),r.remove()),t.el=e}else if(r.hasAttribute("data-has-inline-styles")){const t=r.getAttribute("data-has-inline-styles");if(t){const n=`[data-has-inline-styles="${t}"]{`;let i=o.slice(n.length,-1);const s=null==e?void 0:e.get(r);if(s)for(const[t,e]of Object.entries(s))i=`${t}: var(${e}); ${i}`;r.setAttribute("style",i)}}n&&r.hasAttribute("data-has-inline-styles")&&r.removeAttribute("data-has-inline-styles"),i.push(t)}return i}const El=q(W({},H),{_c:new Map}),Rl=t=>{switch(t){case"top":case"bottom":return"y";case"left":case"right":return"x"}return null},jl=t=>"inline"===hs(t,"display"),Dl=(t,e)=>("x"===e?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce(((e,n)=>e+parseInt(hs(t,n),10)),0)||0,Il=(t,e)=>parseInt(hs(t,`margin-${e}`),10)||0,Nl=t=>({top:Il(t,"top"),right:Il(t,"right"),bottom:Il(t,"bottom"),left:Il(t,"left")}),Fl=e=>R(t,[e],(function*({targetEl:t,targetProperty:e,anchorRect:n,anchorSide:i,anchorSize:r,fallback:o=null}){var s;if(!r&&void 0===i||!t||!n)return o;if(r){if(!uo(e))return o;let i;switch(r){case"width":case"height":i=r;break;default:{let e=!1;const n=hs(t,"writing-mode");e=n.startsWith("vertical-")||n.startsWith("sideways-"),i=((t,e)=>{let n;switch(t){case"block":case"self-block":n=e?"width":"height";break;case"inline":case"self-inline":n=e?"height":"width"}return n})(r,e)}}return i?`${n[i]}px`:o}if(void 0!==i){let r,l;const a=Rl(e);if(!io(e)||!a||io(i)&&a!==Rl(i))return o;const c=["top","left"];switch(i){case"left":case"top":r=0;break;case"right":case"bottom":r=100;break;case"center":r=50;break;case"inside":r=c.includes(e)?0:100;break;case"outside":r=c.includes(e)?100:0;break;default:if(t){r=((t,e)=>{let n;switch(t){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:"number"==typeof t&&!Number.isNaN(t)&&(n=t)}if(void 0!==n)return e?100-n:n})(i,(yield null==(s=H.isRTL)?void 0:s.call(H,t))||!1)}}const u="number"==typeof r&&!Number.isNaN(r),h=(t=>{switch(t){case"x":return"width";case"y":return"height"}return null})(a);if(u&&h){("bottom"===e||"right"===e)&&(l=yield ys(t));let i=n[a]+n[h]*(r/100);switch(e){case"bottom":{if(!l)break;let t=l.clientHeight;if(0===t&&jl(l)){const e=Dl(l,a);t=l.offsetHeight-e}i=t-i;break}case"right":{if(!l)break;let t=l.clientWidth;if(0===t&&jl(l)){const e=Dl(l,a);t=l.offsetWidth-e}i=t-i;break}}return`${i}px`}}return o})),Ml=t=>"wrapperEl"in t,zl=t=>"uuid"in t;function $l(t,e=!1){return R(this,null,(function*(){const n=document.documentElement;for(const[i,r]of Object.entries(t))for(const t of r){const r=t.anchorEl,o=t.targetEl;if(r&&o)if(Ml(t)){const i=t.wrapperEl,s=(t,e,n)=>R(this,null,(function*(){return 0===t?"0px":yield Fl({targetEl:i,targetProperty:e,anchorRect:n,anchorSide:t})}));G(r,i,(()=>R(this,null,(function*(){const e=hs(o,xs);i.setAttribute(ws,e);const l=yield H.getElementRects({reference:r,floating:i,strategy:"absolute"}),a=t.insets,c=yield s(a.block[0],"top",l.reference),u=yield s(a.block[1],"bottom",l.reference),h=yield s(a.inline[0],"left",l.reference),f=yield s(a.inline[1],"right",l.reference);n.style.setProperty(`${t.targetUUID}-top`,c||null),n.style.setProperty(`${t.targetUUID}-left`,h||null),n.style.setProperty(`${t.targetUUID}-right`,f||null),n.style.setProperty(`${t.targetUUID}-bottom`,u||null),n.style.setProperty(`${t.targetUUID}-justify-self`,t.alignments.inline),n.style.setProperty(`${t.targetUUID}-align-self`,t.alignments.block)}))),{animationFrame:e})}else G(r,o,(()=>R(this,null,(function*(){const e=yield H.getElementRects({reference:r,floating:o,strategy:"absolute"}),s=yield Fl({targetEl:o,targetProperty:i,anchorRect:e.reference,anchorSide:t.anchorSide,anchorSize:t.anchorSize,fallback:t.fallbackValue});n.style.setProperty(t.uuid,s)}))),{animationFrame:e});else if(zl(t)){const e=yield Fl({targetProperty:i,anchorSide:t.anchorSide,anchorSize:t.anchorSize,fallback:t.fallbackValue});n.style.setProperty(t.uuid,e)}}}))}function Wl(t,e){return R(this,null,(function*(){const n=yield H.getElementRects({reference:t,floating:t,strategy:"absolute"});return yield X({x:t.offsetLeft,y:t.offsetTop,platform:El,rects:n,elements:{floating:t,reference:e},strategy:"absolute"},{padding:Nl(t)})}))}function Ul(t,e,n=!1){return R(this,null,(function*(){if(!e.length)return;const i=document.querySelectorAll(t);for(const t of i){let i=!1;const r=yield ys(t);G({},t,(()=>R(this,null,(function*(){if(i)return;i=!0,t.removeAttribute("data-anchor-polyfill");const n=yield Wl(t,r);if(Object.values(n).every((t=>t<=0)))return t.removeAttribute("data-anchor-polyfill-last-successful"),void(i=!1);for(const[n,{uuid:o}]of e.entries()){t.setAttribute("data-anchor-polyfill",o);const s=yield Wl(t,r);if(Object.values(s).every((t=>t<=0))){t.setAttribute("data-anchor-polyfill-last-successful",o),i=!1;break}if(n===e.length-1){const e=t.getAttribute("data-anchor-polyfill-last-successful");e?t.setAttribute("data-anchor-polyfill",e):t.removeAttribute("data-anchor-polyfill"),i=!1;break}}}))),{animationFrame:n,layoutShift:!1})}}))}function Bl(t){return R(this,null,(function*(){const t=function(t={}){const e="boolean"==typeof t?{useAnimationFrame:t}:t,n=void 0===e.useAnimationFrame?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:e.useAnimationFrame;return Array.isArray(e.elements)||(e.elements=void 0),Object.assign(e,{useAnimationFrame:n})}(window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let e=yield vs(t.elements,t.excludeInlineStyles);(function(t){for(const e of t){let t=!1;const n=os(e.css);eo(n,{visit:"Declaration",enter(e){var n;const i=null==(n=this.rule)?void 0:n.block,{updated:r}=cs(e,i);r&&(t=!0)}}),t&&(e.css=ss(n),e.changed=!0)}return t.some((t=>!0===t.changed))})(e)&&(e=Pl(e));const{rules:n,inlineStyles:i}=yield Al(e);return Object.values(n).length&&(Pl(e,i,!0),yield function(t,e=!1){return R(this,null,(function*(){var n,i;for(const i of Object.values(t))yield $l(null!=(n=i.declarations)?n:{},e);for(const[n,r]of Object.entries(t))yield Ul(n,null!=(i=r.fallbacks)?i:[],e)}))}(n,t.useAnimationFrame)),n}))}"complete"!==document.readyState?window.addEventListener("load",(()=>{Bl()})):Bl()}));export default Hp();
@@ -0,0 +1,10 @@
1
+ (() => {
2
+ document.body.addEventListener('click', (event) => {
3
+ const toggleButton = event.target.closest('[data-action="toggle-dark-mode"]');
4
+
5
+ if (!toggleButton) return;
6
+
7
+ const isDark = document.documentElement.classList.toggle('dark');
8
+ localStorage.setItem('darkMode', isDark ? 'dark' : 'light');
9
+ });
10
+ })();
@@ -0,0 +1 @@
1
+ document.body.addEventListener("click",(t=>{if(!t.target.closest('[data-action="toggle-dark-mode"]'))return;const e=document.documentElement.classList.toggle("dark");localStorage.setItem("darkMode",e?"dark":"light")}));
@@ -0,0 +1,121 @@
1
+ (() => {
2
+ const initDropdownMenu = (dropdownMenuComponent) => {
3
+ const trigger = dropdownMenuComponent.querySelector('[popovertarget]');
4
+ const popover = dropdownMenuComponent.querySelector('[popover]');
5
+ const menu = popover?.querySelector('[role="menu"]');
6
+ if (!trigger || !popover || !menu) return;
7
+
8
+ let menuItems = [];
9
+ let activeIndex = -1;
10
+
11
+ const setActiveItem = (index) => {
12
+ if (activeIndex > -1 && menuItems[activeIndex]) {
13
+ menuItems[activeIndex].classList.remove('active');
14
+ }
15
+ activeIndex = index;
16
+ if (activeIndex > -1 && menuItems[activeIndex]) {
17
+ const activeItem = menuItems[activeIndex];
18
+ activeItem.classList.add('active');
19
+ trigger.setAttribute('aria-activedescendant', activeItem.id);
20
+ activeItem.scrollIntoView({ block: 'nearest' });
21
+ } else {
22
+ trigger.removeAttribute('aria-activedescendant');
23
+ }
24
+ };
25
+
26
+ const handleKeyDown = (e) => {
27
+ if (!popover.matches(':popover-open')) {
28
+ if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(e.key)) {
29
+ e.preventDefault();
30
+ trigger.click();
31
+ }
32
+ return;
33
+ }
34
+
35
+ let nextIndex = activeIndex;
36
+ if (menuItems.length === 0) return;
37
+
38
+ switch (e.key) {
39
+ case 'ArrowDown':
40
+ e.preventDefault();
41
+ if (activeIndex < menuItems.length - 1) {
42
+ nextIndex = activeIndex + 1;
43
+ }
44
+ break;
45
+ case 'ArrowUp':
46
+ e.preventDefault();
47
+ if (activeIndex > 0) {
48
+ nextIndex = activeIndex - 1;
49
+ }
50
+ break;
51
+ case 'Home':
52
+ e.preventDefault();
53
+ nextIndex = 0;
54
+ break;
55
+ case 'End':
56
+ e.preventDefault();
57
+ nextIndex = menuItems.length - 1;
58
+ break;
59
+ case 'Enter':
60
+ case ' ':
61
+ e.preventDefault();
62
+ menuItems[activeIndex]?.click();
63
+ break;
64
+ }
65
+
66
+ if (nextIndex !== activeIndex) {
67
+ setActiveItem(nextIndex);
68
+ }
69
+ };
70
+
71
+ trigger.addEventListener('keydown', handleKeyDown);
72
+
73
+ popover.addEventListener('toggle', (e) => {
74
+ trigger.setAttribute('aria-expanded', e.newState === 'open');
75
+ if (e.newState === 'open') {
76
+ menuItems = Array.from(menu.querySelectorAll('[role^="menuitem"]:not([disabled])'));
77
+ menuItems.forEach((item, index) => {
78
+ if (!item.id) item.id = `${menu.id}-item-${index}`;
79
+ });
80
+ setActiveItem(0);
81
+ } else {
82
+ setActiveItem(-1);
83
+ }
84
+ });
85
+
86
+ menu.addEventListener('click', (e) => {
87
+ if (e.target.closest('[role^="menuitem"]')) {
88
+ popover.hidePopover();
89
+ }
90
+ });
91
+
92
+ menu.addEventListener('mouseover', (e) => {
93
+ const item = e.target.closest('[role^="menuitem"]:not([disabled])');
94
+ if (item) {
95
+ const index = menuItems.indexOf(item);
96
+ if (index > -1 && index !== activeIndex) {
97
+ setActiveItem(index);
98
+ }
99
+ }
100
+ });
101
+
102
+ dropdownMenuComponent.dataset.dropdownMenuInitialized = true;
103
+ };
104
+
105
+ document.querySelectorAll('.dropdown-menu:not([data-dropdown-menu-initialized])').forEach(initDropdownMenu);
106
+
107
+ const observer = new MutationObserver((mutations) => {
108
+ mutations.forEach((mutation) => {
109
+ mutation.addedNodes.forEach((node) => {
110
+ if (node.nodeType === Node.ELEMENT_NODE) {
111
+ if (node.matches('.dropdown-menu:not([data-dropdown-menu-initialized])')) {
112
+ initDropdownMenu(node);
113
+ }
114
+ node.querySelectorAll('.dropdown-menu:not([data-dropdown-menu-initialized])').forEach(initDropdownMenu);
115
+ }
116
+ });
117
+ });
118
+ });
119
+
120
+ observer.observe(document.body, { childList: true, subtree: true });
121
+ })();
@@ -0,0 +1 @@
1
+ (()=>{const e=e=>{const t=e.querySelector("[popovertarget]"),r=e.querySelector("[popover]"),o=r?.querySelector('[role="menu"]');if(!t||!r||!o)return;let n=[],a=-1;const d=e=>{if(a>-1&&n[a]&&n[a].classList.remove("active"),a=e,a>-1&&n[a]){const e=n[a];e.classList.add("active"),t.setAttribute("aria-activedescendant",e.id),e.scrollIntoView({block:"nearest"})}else t.removeAttribute("aria-activedescendant")};t.addEventListener("keydown",(e=>{if(!r.matches(":popover-open"))return void(["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),t.click()));let o=a;if(0!==n.length){switch(e.key){case"ArrowDown":e.preventDefault(),a<n.length-1&&(o=a+1);break;case"ArrowUp":e.preventDefault(),a>0&&(o=a-1);break;case"Home":e.preventDefault(),o=0;break;case"End":e.preventDefault(),o=n.length-1;break;case"Enter":case" ":e.preventDefault(),n[a]?.click()}o!==a&&d(o)}})),r.addEventListener("toggle",(e=>{t.setAttribute("aria-expanded","open"===e.newState),"open"===e.newState?(n=Array.from(o.querySelectorAll('[role^="menuitem"]:not([disabled])')),n.forEach(((e,t)=>{e.id||(e.id=`${o.id}-item-${t}`)})),d(0)):d(-1)})),o.addEventListener("click",(e=>{e.target.closest('[role^="menuitem"]')&&r.hidePopover()})),o.addEventListener("mouseover",(e=>{const t=e.target.closest('[role^="menuitem"]:not([disabled])');if(t){const e=n.indexOf(t);e>-1&&e!==a&&d(e)}})),e.dataset.dropdownMenuInitialized=!0};document.querySelectorAll(".dropdown-menu:not([data-dropdown-menu-initialized])").forEach(e);new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&(t.matches(".dropdown-menu:not([data-dropdown-menu-initialized])")&&e(t),t.querySelectorAll(".dropdown-menu:not([data-dropdown-menu-initialized])").forEach(e))}))}))})).observe(document.body,{childList:!0,subtree:!0})})();