@rcarls/rc-common 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -3
- package/dist/rc-common.js +493 -152
- package/dist/rc-common.umd.cjs +13 -13
- package/dist/types/ItemsCollectionController.d.ts +100 -0
- package/dist/types/KeyboardInteractionDirective.d.ts +32 -0
- package/dist/types/KeyboardInteractionDirective.test.d.ts +1 -0
- package/dist/types/KeyboardNavigationDirective.d.ts +3 -10
- package/dist/types/MutationObserverController.d.ts +30 -0
- package/dist/types/MutationObserverController.test.d.ts +1 -0
- package/dist/types/RafScheduler.d.ts +16 -0
- package/dist/types/RafScheduler.test.d.ts +1 -0
- package/dist/types/TypeaheadController.d.ts +31 -0
- package/dist/types/TypeaheadController.test.d.ts +1 -0
- package/dist/types/findNearestScrollAncestor.d.ts +9 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/nativeChild.d.ts +54 -0
- package/dist/types/nativeChild.test.d.ts +1 -0
- package/package.json +6 -8
package/dist/rc-common.umd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(z,$t){typeof exports=="object"&&typeof module<"u"?$t(exports,require("lit"),require("lit/directive.js"),require("lit/async-directive.js"),require("lit/decorators.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/directive.js","lit/async-directive.js","lit/decorators.js"],$t):(z=typeof globalThis<"u"?globalThis:z||self,$t(z["rc-common"]={},z.lit,z.directive_js,z.asyncDirective_js,z.decorators_js))})(this,(function(z,$t,Dn,de,Ls){"use strict";let As=0;class Ps{constructor(t,n){this._activeItem=null,this._activeIndex=-1,this._itemCounter=0,this._opts=n,this._instanceId=`rc-adc-${++As}`,t.addController(this)}hostConnected(){}hostDisconnected(){this.clear()}get activeItem(){return this._activeItem}get activeIndex(){return this._activeIndex}navigate(t){const n=this._opts.items();if(n.length===0)return;const i=this._opts.wrap??!0;let r=this._activeIndex<0?t>0?-1:n.length:this._activeIndex;const o=n.length;let l=0;do if(r+=t,i?r=(r%o+o)%o:r=Math.max(0,Math.min(o-1,r)),l++,!this._isSkipped(n[r]))break;while(l<o);this._setActive(n[r]??null,r)}navigateToFirst(){const t=this._opts.items(),n=t.findIndex(i=>!this._isSkipped(i));n>=0&&this._setActive(t[n],n)}navigateToLast(){const t=this._opts.items();let n=-1;for(let i=t.length-1;i>=0;i--)if(!this._isSkipped(t[i])){n=i;break}n>=0&&this._setActive(t[n],n)}navigateTo(t){const i=this._opts.items()[t];i&&!this._isSkipped(i)&&this._setActive(i,t)}navigateToItem(t){const i=this._opts.items().indexOf(t);i>=0&&!this._isSkipped(t)&&this._setActive(t,i)}clear(){this._activeItem?.removeAttribute("data-active"),this._activeItem=null,this._activeIndex=-1;const t=this._opts.host();t&&t.removeAttribute("aria-activedescendant")}_isSkipped(t){return!t||t.hidden||t.getAttribute("aria-disabled")==="true"?!0:this._opts.isSkipped?.(t)??!1}_setActive(t,n){this._activeItem?.removeAttribute("data-active"),this._activeItem=t,this._activeIndex=n;const i=this._opts.host();if(i){if(!t){i.removeAttribute("aria-activedescendant");return}t.id||(t.id=`${this._instanceId}-${++this._itemCounter}`),i.setAttribute("aria-activedescendant",t.id),t.setAttribute("data-active",""),t.scrollIntoView({block:"nearest"})}}}class Ts extends de.AsyncDirective{constructor(t){if(super(t),this._options={},t.type!==Dn.PartType.ELEMENT)throw new Error("The `keyNavigation` directive must be used on an element.")}get navigationAxis(){if(this._options.navigationAxis)return this._options.navigationAxis;switch(this._element?.deref()?.role){case"slider":case"tablist":case"toolbar":case"menubar":return this._element?.deref()?.ariaOrientation==="vertical"?"vertical":"horizontal";default:return this._element?.deref()?.ariaOrientation==="horizontal"?"horizontal":"vertical"}}_normalizeKey(t){switch(t){case"Up":return"ArrowUp";case"Down":return"ArrowDown";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";default:return t}}_onKeydown(t){const n=this._normalizeKey(t.key),i=this.navigationAxis,r=this._element?.deref(),o=i==="horizontal"&&r!=null&&getComputedStyle(r).direction==="rtl",l=i==="horizontal"?o?"ArrowLeft":"ArrowRight":"ArrowDown",c=i==="horizontal"?o?"ArrowRight":"ArrowLeft":"ArrowUp",a=i==="horizontal"?"ArrowDown":"ArrowRight",s=i==="horizontal"?"ArrowUp":"ArrowLeft";let u;this._options.handleNavAxis!==!1&&(n===l?u="next":n===c?u="prev":n==="Home"?u="start":n==="End"&&(u="end")),!u&&this._options.handleOpenAxis&&(n===a?u="open-to-first":n===s&&(u="open-to-last")),u||(n==="Enter"?u=this._options.handleActivate?"activate":"toggle":n===" "&&this._options.handleActivate?u="activate":n==="Escape"&&this._options.handleEscape?u="escape":n==="Tab"&&this._options.useInteractionModeAttr&&this._element?.deref()?.setAttribute("data-interaction-mode","keyboard")),u!=null&&(this._callback(u),this._options.useInteractionModeAttr&&this._element?.deref()?.setAttribute("data-interaction-mode","keyboard"),t.stopPropagation(),t.preventDefault())}_onMouseClick(t){this._options.useInteractionModeAttr&&this._element?.deref()?.removeAttribute("data-interaction-mode")}_init(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&(this._keyDownHandle=this._onKeydown.bind(this),this._mouseClickHandle=this._onMouseClick.bind(this),t.addEventListener("keydown",this._keyDownHandle),t.addEventListener("click",this._mouseClickHandle))}render(t,n){return $t.nothing}update(t,[n,i]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._callback=n.bind(t.options?.host??t.element),typeof i=="boolean"?this._options={useInteractionModeAttr:i}:this._options={useInteractionModeAttr:!0,...i}}disconnected(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&(t.removeEventListener("keydown",this._keyDownHandle),t.removeEventListener("click",this._mouseClickHandle))}reconnected(){this._init()}}const Es=de.directive(Ts);class Os extends de.AsyncDirective{constructor(t){if(super(t),this._activePointerId=null,t.type!==Dn.PartType.ELEMENT)throw new Error("The `mouseMove` directive must be used on an element.");this._pointerDownHandle=this._onPointerDown.bind(this),this._pointerMoveHandle=this._onPointerMove.bind(this),this._pointerEndHandle=this._onPointerEnd.bind(this)}_onPointerDown(t){if(this._activePointerId!==null)return;t.preventDefault();const n=t.currentTarget;this._activePointerId=t.pointerId,this._capturePointer(n,t.pointerId),n.addEventListener("pointermove",this._pointerMoveHandle),n.addEventListener("pointerup",this._pointerEndHandle),n.addEventListener("pointercancel",this._pointerEndHandle),n.addEventListener("lostpointercapture",this._pointerEndHandle),n.focus()}_onPointerMove(t){t.pointerId===this._activePointerId&&(t.preventDefault(),this._callback(t))}_onPointerEnd(t){if(t.pointerId!==this._activePointerId)return;t.preventDefault();const n=t.currentTarget;this._releasePointer(n,t.pointerId),this._removePointerCycleListeners(n),this._activePointerId=null}_init(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),t.addEventListener("pointerdown",this._pointerDownHandle))}_removePointerCycleListeners(t){t.removeEventListener("pointermove",this._pointerMoveHandle),t.removeEventListener("pointerup",this._pointerEndHandle),t.removeEventListener("pointercancel",this._pointerEndHandle),t.removeEventListener("lostpointercapture",this._pointerEndHandle)}_capturePointer(t,n){try{t.setPointerCapture(n)}catch{}}_releasePointer(t,n){try{t.hasPointerCapture(n)&&t.releasePointerCapture(n)}catch{}}render(t){return $t.nothing}update(t,[n]){if(this._callback=n.bind(t.options?.host??t.element),!this.isConnected||!(t.element instanceof HTMLElement))return;const i=this._element?.deref();i!==t.element&&(i?.removeEventListener("pointerdown",this._pointerDownHandle),i&&this._removePointerCycleListeners(i),this._activePointerId=null,this._element=new WeakRef(t.element),this._init())}disconnected(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),this._removePointerCycleListeners(t),this._activePointerId=null)}reconnected(){this._init()}}const Ds=de.directive(Os);class Ms{constructor(t,n){this._dragging=!1,this._startX=0,this._startY=0,this._startLeft=0,this._startTop=0,this._opts={axis:"both",step:4,disabled:!1,handle:null,bounds:"viewport",...n},this._onPointerDown=this._handlePointerDown.bind(this),this._onPointerMove=this._handlePointerMove.bind(this),this._onPointerUp=this._handlePointerUp.bind(this),this._onPointerCancel=this._cancelDrag.bind(this),this._onLostPointerCapture=this._handleLostPointerCapture.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),t.addController(this)}setOptions(t){const n=this._handle();Object.assign(this._opts,t);const i=this._handle();n!==i&&(this._detachFrom(n),this._attachTo(i))}hostConnected(){this._attachTo(this._handle())}hostDisconnected(){this._detachFrom(this._handle())}_handle(){return this._opts.handle??this._opts.target}_target(){return this._opts.target}_attachTo(t){t.addEventListener("pointerdown",this._onPointerDown),t.addEventListener("keydown",this._onKeyDown),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}_detachFrom(t){t.removeEventListener("pointerdown",this._onPointerDown),t.removeEventListener("keydown",this._onKeyDown),t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointercancel",this._onPointerCancel),t.removeEventListener("lostpointercapture",this._onLostPointerCapture)}_handlePointerDown(t){if(this._opts.disabled||t.target.closest('button, [role="button"], a'))return;const n=this._target(),i=n.getBoundingClientRect();getComputedStyle(n).position==="static"&&(n.style.position="fixed"),n.style.translate="none",n.style.inset="auto",n.style.margin="0",n.style.left=`${i.left}px`,n.style.top=`${i.top}px`,this._startX=t.clientX,this._startY=t.clientY,this._startLeft=i.left,this._startTop=i.top,this._dragging=!0;const r=this._handle();r.setPointerCapture(t.pointerId),r.addEventListener("pointermove",this._onPointerMove),r.addEventListener("pointerup",this._onPointerUp),r.addEventListener("pointercancel",this._onPointerCancel),r.addEventListener("lostpointercapture",this._onLostPointerCapture),t.preventDefault()}_handlePointerMove(t){if(!this._dragging)return;const n=this._target(),{axis:i}=this._opts,[r,o,l,c]=this._boundsRect(),a=i!=="y"?Math.min(Math.max(this._startLeft+t.clientX-this._startX,r),l-n.offsetWidth):parseFloat(n.style.left)||0,s=i!=="x"?Math.min(Math.max(this._startTop+t.clientY-this._startY,o),c-n.offsetHeight):parseFloat(n.style.top)||0;n.style.left=`${a}px`,n.style.top=`${s}px`}_handlePointerUp(t){this._cancelDrag()}_handleLostPointerCapture(t){this._cancelDrag()}_cancelDrag(){if(!this._dragging)return;this._dragging=!1;const t=this._handle();t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointercancel",this._onPointerCancel),t.removeEventListener("lostpointercapture",this._onLostPointerCapture)}_handleKeyDown(t){if(this._opts.disabled||t.currentTarget!==t.target)return;const{axis:n}=this._opts,i=t.shiftKey?this._opts.step*10:this._opts.step;let r=0,o=0;switch(t.key){case"ArrowLeft":if(n==="y")return;r=-i;break;case"ArrowRight":if(n==="y")return;r=i;break;case"ArrowUp":if(n==="x")return;o=-i;break;case"ArrowDown":if(n==="x")return;o=i;break;default:return}const l=this._target();if(getComputedStyle(l).position==="static"){const d=l.getBoundingClientRect();l.style.position="fixed",l.style.translate="none",l.style.left=`${d.left}px`,l.style.top=`${d.top}px`}const[c,a,s,u]=this._boundsRect(),h=parseFloat(l.style.left)||0,f=parseFloat(l.style.top)||0;l.style.left=`${Math.min(Math.max(h+r,c),s-l.offsetWidth)}px`,l.style.top=`${Math.min(Math.max(f+o,a),u-l.offsetHeight)}px`,t.preventDefault(),t.stopPropagation()}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const r=i.getBoundingClientRect();return[r.left,r.top,r.right,r.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}class Is{constructor(t,n){this._resizing=null,this._startX=0,this._startY=0,this._startW=0,this._startH=0,this._startLeft=0,this._startTop=0,this._effectiveMinW=0,this._effectiveMinH=0,this._cornerBtn=null,this._opts={direction:"none",threshold:8,step:4,disabled:!1,minWidth:100,minHeight:60,handle:null,bounds:"viewport",...n},this._onPointerMove=this._handlePointerMove.bind(this),this._onPointerDown=this._handlePointerDown.bind(this),this._onPointerUp=this._handlePointerUp.bind(this),this._onPointerLeave=this._handlePointerLeave.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),t.addController(this)}setOptions(t){Object.assign(this._opts,t)}hostConnected(){if(this._opts.direction==="none")return;const t=this._target();t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerup",this._onPointerUp),t.addEventListener("pointerleave",this._onPointerLeave),this._injectCornerButton()}hostDisconnected(){const t=this._target();t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointerleave",this._onPointerLeave),this._removeCornerButton()}_target(){return this._opts.target}_injectCornerButton(){if(this._opts.handle)return;const t=this._target();getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=document.createElement("button");n.setAttribute("data-rc-resize-corner",""),n.setAttribute("aria-label","Resize"),n.type="button",Object.assign(n.style,{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",padding:"0",border:"none",background:"transparent",cursor:this._cornerCursor(),zIndex:"1"}),n.addEventListener("keydown",this._onKeyDown),t.appendChild(n),this._cornerBtn=n}_removeCornerButton(){this._cornerBtn&&(this._cornerBtn.removeEventListener("keydown",this._onKeyDown),this._cornerBtn.remove(),this._cornerBtn=null)}_cornerCursor(){switch(this._opts.direction){case"both":return"se-resize";case"horizontal":return"ew-resize";case"vertical":return"ns-resize";default:return"default"}}_edgeCursor(t){return{n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"}[t]}_detectEdge(t){const{direction:n,threshold:i}=this._opts;if(n==="none")return null;const r=this._target().getBoundingClientRect(),o=t.clientX,l=t.clientY,c=o>=r.right-i&&o<=r.right+i,a=o>=r.left-i&&o<=r.left+i,s=l>=r.bottom-i&&l<=r.bottom+i,u=l>=r.top-i&&l<=r.top+i,h=o>=r.left&&o<=r.right,f=l>=r.top&&l<=r.bottom;if(n==="both"){if(c&&s)return"se";if(a&&s)return"sw";if(c&&u)return"ne";if(a&&u)return"nw";if(c&&f)return"e";if(a&&f)return"w";if(s&&h)return"s";if(u&&h)return"n"}if(n==="horizontal"){if(c&&f)return"e";if(a&&f)return"w"}if(n==="vertical"){if(s&&h)return"s";if(u&&h)return"n"}return null}_pinPosition(t){const n=t.getBoundingClientRect();return getComputedStyle(t).position==="static"&&(t.style.position="fixed"),t.style.translate="none",t.style.inset="auto",t.style.margin="0",t.style.boxSizing="border-box",t.style.left=`${n.left}px`,t.style.top=`${n.top}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`,n}_handlePointerDown(t){if(this._opts.disabled)return;const n=this._detectEdge(t);if(!n)return;t.stopPropagation();const i=this._target(),r=this._pinPosition(i);this._startX=t.clientX,this._startY=t.clientY,this._startW=r.width,this._startH=r.height,this._startLeft=r.left,this._startTop=r.top,this._resizing=n;const o=getComputedStyle(i);this._effectiveMinW=Math.max(this._opts.minWidth,parseFloat(o.minWidth)||0),this._effectiveMinH=Math.max(this._opts.minHeight,parseFloat(o.minHeight)||0),i.setPointerCapture(t.pointerId),t.preventDefault()}_handlePointerMove(t){if(this._resizing){const r=this._target(),[o,l,c,a]=this._boundsRect(),{maxWidth:s,maxHeight:u}=this._opts,h=this._effectiveMinW,f=this._effectiveMinH,d=t.clientX-this._startX,p=t.clientY-this._startY,m=this._resizing;if(m==="e"||m==="se"||m==="ne"){const y=Math.min(s??1/0,c-this._startLeft);r.style.width=`${Math.min(Math.max(this._startW+d,h),y)}px`}if(m==="w"||m==="sw"||m==="nw"){const y=this._startLeft+this._startW,k=Math.min(Math.max(this._startLeft+d,o,s!==void 0?y-s:-1/0),y-h);r.style.left=`${k}px`,r.style.width=`${y-k}px`}if(m==="s"||m==="se"||m==="sw"){const y=Math.min(u??1/0,a-this._startTop);r.style.height=`${Math.min(Math.max(this._startH+p,f),y)}px`}if(m==="n"||m==="ne"||m==="nw"){const y=this._startTop+this._startH,k=Math.min(Math.max(this._startTop+p,l,u!==void 0?y-u:-1/0),y-f);r.style.top=`${k}px`,r.style.height=`${y-k}px`}return}if(this._opts.handle)return;const n=this._detectEdge(t),i=this._target();i.style.cursor=n?this._edgeCursor(n):""}_handlePointerUp(t){this._resizing=null}_handlePointerLeave(t){this._resizing||(this._target().style.cursor="")}_handleKeyDown(t){if(this._opts.disabled)return;const{direction:n}=this._opts,i=t.key==="ArrowRight"||t.key==="ArrowLeft",r=t.key==="ArrowDown"||t.key==="ArrowUp";if(i&&n==="vertical"||r&&n==="horizontal"||!i&&!r)return;t.preventDefault(),t.stopPropagation();const o=this._target(),l=this._pinPosition(o),c=t.shiftKey?this._opts.step*10:this._opts.step,[,,a,s]=this._boundsRect(),{maxWidth:u,maxHeight:h}=this._opts,f=getComputedStyle(o),d=Math.max(this._opts.minWidth,parseFloat(f.minWidth)||0),p=Math.max(this._opts.minHeight,parseFloat(f.minHeight)||0);if(t.key==="ArrowRight"){const m=Math.min(u??1/0,a-l.left);o.style.width=`${Math.min(Math.max(o.offsetWidth+c,d),m)}px`}if(t.key==="ArrowLeft"&&(o.style.width=`${Math.max(o.offsetWidth-c,d)}px`),t.key==="ArrowDown"){const m=Math.min(h??1/0,s-l.top);o.style.height=`${Math.min(Math.max(o.offsetHeight+c,p),m)}px`}t.key==="ArrowUp"&&(o.style.height=`${Math.max(o.offsetHeight-c,p)}px`)}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const r=i.getBoundingClientRect();return[r.left,r.top,r.right,r.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}function pe(e,t){const n=`${t}px`;switch(e){case"top":return`position-area: top; margin-bottom: ${n};`;case"top-start":return`bottom: anchor(top); top: auto; left: anchor(left); right: auto; margin-bottom: ${n};`;case"top-end":return`bottom: anchor(top); top: auto; left: auto; right: anchor(right); margin-bottom: ${n};`;case"bottom":return`position-area: bottom; margin-top: ${n};`;case"bottom-start":return`top: anchor(bottom); bottom: auto; left: anchor(left); right: auto; margin-top: ${n};`;case"bottom-end":return`top: anchor(bottom); bottom: auto; left: auto; right: anchor(right); margin-top: ${n};`;case"left":return`position-area: left; margin-right: ${n};`;case"left-start":return`top: anchor(top); bottom: auto; right: anchor(left); left: auto; margin-right: ${n};`;case"left-end":return`top: auto; bottom: anchor(bottom); right: anchor(left); left: auto; margin-right: ${n};`;case"right":return`position-area: right; margin-left: ${n};`;case"right-start":return`top: anchor(top); bottom: auto; left: anchor(right); right: auto; margin-left: ${n};`;case"right-end":return`top: auto; bottom: anchor(bottom); left: anchor(right); right: auto; margin-left: ${n};`}}const Mn={top:"bottom","top-start":"bottom-start","top-end":"bottom-end",bottom:"top","bottom-start":"top-start","bottom-end":"top-end",left:"right","left-start":"right-start","left-end":"right-end",right:"left","right-start":"left-start","right-end":"left-end"},Rs={top:"top","top-start":"top-end","top-end":"top-start",bottom:"bottom","bottom-start":"bottom-end","bottom-end":"bottom-start",left:"left","left-start":"left-end","left-end":"left-start",right:"right","right-start":"right-end","right-end":"right-start"},In=CSS.supports("position-try-fallbacks: flip-block");let Rn=null,Ne=null;function js(){return In?Promise.resolve(null):(Ne||(Ne=Promise.resolve().then(()=>Ep).then(e=>(Rn=e.default,Rn)).catch(()=>null)),Ne)}let Fs=0;class $s{constructor(t,n){this._styleEl=null,this._adoptedSheet=null,this._opts=n,this._uid=`rc-anchor-${++Fs}`,t.addController(this)}setOptions(t){Object.assign(this._opts,t),this._applyAndPolyfill()}update(){this._applyAndPolyfill()}hostConnected(){this._applyAndPolyfill()}hostDisconnected(){this._cleanup()}_anchor(){const{anchor:t}=this._opts;return typeof t=="function"?t():t}_floating(){const{floating:t}=this._opts;return typeof t=="function"?t():t}_shadowHost(){const{shadowHost:t}=this._opts;return typeof t=="function"?t():t??null}_applyAndPolyfill(){this._apply(),In||this._applyPolyfillOrFallback()}async _applyPolyfillOrFallback(){const t=await js(),n=this._shadowHost();t?await t({roots:n?[n]:void 0,useAnimationFrame:!1}):this._positionFallback()}_apply(){if(this._opts.disabled){this._cleanup();return}const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",r=this._opts.offset??4,o=this._opts.flip??!0,l=`--${this._uid}`,c=this._uid;t.style.setProperty("anchor-name",l),n.setAttribute("data-rc-anchor",c);const a=Mn[i],s=Rs[i],u=Mn[s],h=o?`
|
|
2
|
-
@position-try --${c}-end { ${pe(
|
|
1
|
+
(function(L,Et){typeof exports=="object"&&typeof module<"u"?Et(exports,require("lit"),require("lit/directive.js"),require("lit/async-directive.js"),require("lit/decorators.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/directive.js","lit/async-directive.js","lit/decorators.js"],Et):(L=typeof globalThis<"u"?globalThis:L||self,Et(L["rc-common"]={},L.lit,L.directive_js,L.asyncDirective_js,L.decorators_js))})(this,(function(L,Et,ze,Nt,To){"use strict";let Eo=0;class Po{constructor(t,n){this._activeItem=null,this._activeIndex=-1,this._itemCounter=0,this._opts=n,this._instanceId=`rc-adc-${++Eo}`,t.addController(this)}hostConnected(){}hostDisconnected(){this.clear()}get activeItem(){return this._activeItem}get activeIndex(){return this._activeIndex}navigate(t){const n=this._opts.items();if(n.length===0)return;const i=this._opts.wrap??!0;let r=this._activeIndex<0?t>0?-1:n.length:this._activeIndex;const s=n.length;let l=0;do if(r+=t,i?r=(r%s+s)%s:r=Math.max(0,Math.min(s-1,r)),l++,!this._isSkipped(n[r]))break;while(l<s);this._setActive(n[r]??null,r)}navigateToFirst(){const t=this._opts.items(),n=t.findIndex(i=>!this._isSkipped(i));n>=0&&this._setActive(t[n],n)}navigateToLast(){const t=this._opts.items();let n=-1;for(let i=t.length-1;i>=0;i--)if(!this._isSkipped(t[i])){n=i;break}n>=0&&this._setActive(t[n],n)}navigateTo(t){const i=this._opts.items()[t];i&&!this._isSkipped(i)&&this._setActive(i,t)}navigateToItem(t){const i=this._opts.items().indexOf(t);i>=0&&!this._isSkipped(t)&&this._setActive(t,i)}clear(){this._activeItem?.removeAttribute("data-active"),this._activeItem=null,this._activeIndex=-1;const t=this._opts.host();t&&t.removeAttribute("aria-activedescendant")}_isSkipped(t){return!t||t.hidden||t.getAttribute("aria-disabled")==="true"?!0:this._opts.isSkipped?.(t)??!1}_setActive(t,n){this._activeItem?.removeAttribute("data-active"),this._activeItem=t,this._activeIndex=n;const i=this._opts.host();if(i){if(!t){i.removeAttribute("aria-activedescendant");return}t.id||(t.id=`${this._instanceId}-${++this._itemCounter}`),i.setAttribute("aria-activedescendant",t.id),t.setAttribute("data-active",""),t.scrollIntoView({block:"nearest"})}}}class Oo{constructor(t,n){this._ul=null,this._options=[],this._liElements=[],this._createLi=null,this._createOption=null,this._selectedValues=new Set,this._filterText="",this._filterStrategy="contains",this._checkmark=!1,this._optionsInitialized=!1,this._onPointerDown=i=>{const r=i.target;if(!r)return;const s=r.closest("li[data-value]");if(!s||s.getAttribute("role")!=="option"||s.parentElement!==this._ul)return;i.preventDefault();const l=this.optionForElement(s);l&&this._onActivate(l)},this._host=t,this._idPrefix=n.idPrefix,this._onInitFromDom=n.onInitFromDom,this._onActivate=n.onActivate,t.addController(this)}hostConnected(){this._host.addEventListener("pointerdown",this._onPointerDown),this._optionsInitialized||this._bootstrapFromDom()}hostDisconnected(){this._host.removeEventListener("pointerdown",this._onPointerDown)}get allOptions(){return this._options}get selectedValues(){return[...this._selectedValues]}get filterText(){return this._filterText}isSelected(t){return this._selectedValues.has(t)}optionForElement(t){if(t===this._createLi)return this._createOption;const n=this._liElements.indexOf(t);return n===-1?null:this._options[n]??null}get navigableItems(){const t=[];for(let n=0;n<this._liElements.length;n++){const i=this._liElements[n];this._options[n]?.disabled||i.hidden||t.push(i)}return this._createLi!==null&&t.push(this._createLi),t}set checkmark(t){this._checkmark!==t&&(this._checkmark=t,this._syncCheckmarks())}setOptions(t){this._optionsInitialized=!0,this._options=[...t],this._ensureContainer(),this._syncOptionsToDom()}appendOption(t){this._optionsInitialized=!0,this._options=[...this._options,t],this._ensureContainer();const n=this._createLiElement(t,this._options.length-1);this._liElements.push(n),this._createLi?this._ul.insertBefore(n,this._createLi):this._ul.appendChild(n),this._applyFilterToLi(n,t)}setSelectedValues(t){const n=new Set(this._options.filter(i=>i.kind==="action").map(i=>i.value));this._createOption&&n.add(this._createOption.value),this._selectedValues=new Set(t.filter(i=>!n.has(i))),this._syncSelectedToDom()}filterOptions(t,n="contains"){this._filterText=t,this._filterStrategy=n,this._syncFilterToDom()}clearFilter(){this._filterText="",this._syncFilterToDom()}setCreateOption(t){if(t===null){this._createLi?.remove(),this._createLi=null,this._createOption=null;return}const n=t.trim();if(this._createOption={kind:"action",action:"create",value:`create:${n}`,label:`Create "${n}"`,data:{text:n}},!this._createLi){this._ensureContainer();const i=document.createElement("li");i.setAttribute("id",`${this._idPrefix}-create`),i.setAttribute("role","option"),i.setAttribute("aria-selected","false"),i.setAttribute("part","option create-option"),this._checkmark&&this._ensureCheckmark(i),this._ul.appendChild(i),this._createLi=i}this._createLi.setAttribute("data-value",this._createOption.value),this._createLi.setAttribute("data-kind","action"),this._createLi.setAttribute("data-action",this._createOption.action),this._setLabelText(this._createLi,this._createOption.label)}_ensureContainer(){if(this._ul)return this._ul;let t=this._host.querySelector(":scope > ul");return t||(t=document.createElement("ul"),this._host.appendChild(t)),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),this._ul=t,t}_bootstrapFromDom(){const t=this._host.querySelector(":scope > ul");if(!t)return;this._ul=t,t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");const n=Array.from(t.querySelectorAll(":scope > li"));if(n.length===0)return;const i=[];for(let r=0;r<n.length;r++){const s=n[r],l=s.getAttribute("data-value")??s.getAttribute("value")??s.textContent?.trim()??"",c=s.textContent?.trim()??"",a=s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true";i.push({value:l,label:c,disabled:a}),s.setAttribute("role","option"),s.setAttribute("id",`${this._idPrefix}-${r}`),s.setAttribute("part","option"),s.setAttribute("data-value",l),s.setAttribute("aria-selected",this._selectedValues.has(l)?"true":"false"),s.setAttribute("aria-disabled",a?"true":"false"),this._checkmark&&this._ensureCheckmark(s)}this._options=i,this._liElements=n,this._onInitFromDom?.(i)}_syncOptionsToDom(){const t=this._ensureContainer();for(const n of this._liElements)n.remove();this._liElements=[];for(let n=0;n<this._options.length;n++){const i=this._createLiElement(this._options[n],n);this._liElements.push(i),t.appendChild(i)}this._createLi&&t.appendChild(this._createLi),this._syncFilterToDom()}_createLiElement(t,n){const i=document.createElement("li");return i.setAttribute("role","option"),i.setAttribute("id",`${this._idPrefix}-${n}`),i.setAttribute("part","option"),i.setAttribute("data-value",t.value),i.setAttribute("data-kind",t.kind??"option"),t.kind==="action"?i.setAttribute("data-action",t.action):i.removeAttribute("data-action"),i.setAttribute("aria-selected",this._selectedValues.has(t.value)?"true":"false"),i.setAttribute("aria-disabled",t.disabled?"true":"false"),this._checkmark&&this._ensureCheckmark(i),this._setLabelText(i,t.label),i}_setLabelText(t,n){for(const i of t.childNodes)if(i.nodeType===Node.TEXT_NODE){i.textContent=n;return}t.appendChild(document.createTextNode(n))}_ensureCheckmark(t){if(t.querySelector('[part="option-checkmark"]'))return;const n=document.createElement("span");n.setAttribute("part","option-checkmark"),n.setAttribute("aria-hidden","true"),n.textContent="✓",t.insertBefore(n,t.firstChild)}_removeCheckmark(t){t.querySelector('[part="option-checkmark"]')?.remove()}_syncCheckmarks(){const t=this._createLi?[...this._liElements,this._createLi]:[...this._liElements];for(const n of t)this._checkmark?this._ensureCheckmark(n):this._removeCheckmark(n)}_syncSelectedToDom(){for(let t=0;t<this._liElements.length;t++){const n=this._options[t];n&&this._liElements[t].setAttribute("aria-selected",this._selectedValues.has(n.value)?"true":"false")}}_syncFilterToDom(){for(let t=0;t<this._liElements.length;t++){const n=this._options[t];n&&this._applyFilterToLi(this._liElements[t],n)}}_applyFilterToLi(t,n){t.hidden=!this._isVisible(n)}_isVisible(t){if(!this._filterText)return!0;const n=t.label.toLowerCase(),i=this._filterText.toLowerCase();return typeof this._filterStrategy=="function"?this._filterStrategy(n,i):this._filterStrategy==="contains"?n.includes(i):n.startsWith(i)}}class Do extends Nt.AsyncDirective{constructor(t){if(super(t),this._options={},this._isPointerFocus=!1,this._onPointerdown=()=>{this._isPointerFocus=!0,this._target?.removeAttribute("data-interaction-mode")},this._onFocusin=()=>{this._isPointerFocus?this._isPointerFocus=!1:this._target?.setAttribute("data-interaction-mode","keyboard")},this._onKeydown=()=>{this._target?.setAttribute("data-interaction-mode","keyboard")},t.type!==ze.PartType.ELEMENT)throw new Error("The `keyInteraction` directive must be used on an element.")}get _target(){return this._options.attributeTarget??this._element?.deref()}_init(){const t=this._element?.deref();t instanceof HTMLElement&&(t.addEventListener("pointerdown",this._onPointerdown,{capture:!0}),t.addEventListener("focusin",this._onFocusin),t.addEventListener("keydown",this._onKeydown))}render(t){return Et.nothing}update(t,[n]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._options=n??{}}disconnected(){const t=this._element?.deref();t instanceof HTMLElement&&(t.removeEventListener("pointerdown",this._onPointerdown,{capture:!0}),t.removeEventListener("focusin",this._onFocusin),t.removeEventListener("keydown",this._onKeydown))}reconnected(){this._init()}}const Mo=Nt.directive(Do);class Io extends Nt.AsyncDirective{constructor(t){if(super(t),this._options={},t.type!==ze.PartType.ELEMENT)throw new Error("The `keyNavigation` directive must be used on an element.")}get navigationAxis(){if(this._options.navigationAxis)return this._options.navigationAxis;switch(this._element?.deref()?.role){case"slider":case"tablist":case"toolbar":case"menubar":return this._element?.deref()?.ariaOrientation==="vertical"?"vertical":"horizontal";case"separator":return this._element?.deref()?.ariaOrientation==="vertical"?"horizontal":"vertical";default:return this._element?.deref()?.ariaOrientation==="horizontal"?"horizontal":"vertical"}}_normalizeKey(t){switch(t){case"Up":return"ArrowUp";case"Down":return"ArrowDown";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";default:return t}}_onKeydown(t){const n=this._normalizeKey(t.key),i=this.navigationAxis,r=this._element?.deref(),s=i==="horizontal"&&r!=null&&getComputedStyle(r).direction==="rtl",l=i==="horizontal"?s?"ArrowLeft":"ArrowRight":"ArrowDown",c=i==="horizontal"?s?"ArrowRight":"ArrowLeft":"ArrowUp",a=i==="horizontal"?"ArrowDown":"ArrowRight",o=i==="horizontal"?"ArrowUp":"ArrowLeft";let h;this._options.handleNavAxis!==!1&&(n===l?h=t.shiftKey?"next-large":"next":n===c?h=t.shiftKey?"prev-large":"prev":n==="Home"?h="start":n==="End"&&(h="end")),!h&&this._options.handleOpenAxis&&(n===a?h="open-to-first":n===o&&(h="open-to-last")),h||(n==="Enter"?h=this._options.handleActivate?"activate":"toggle":n===" "&&this._options.handleActivate?h="activate":n==="Escape"&&this._options.handleEscape&&(h="escape")),h!=null&&(this._callback(h),t.stopPropagation(),t.preventDefault())}_init(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&(this._keyDownHandle=this._onKeydown.bind(this),t.addEventListener("keydown",this._keyDownHandle))}render(t,n){return Et.nothing}update(t,[n,i]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._callback=n.bind(t.options?.host??t.element),typeof i=="boolean"?this._options={}:this._options={...i}}disconnected(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&t.removeEventListener("keydown",this._keyDownHandle)}reconnected(){this._init()}}const Ro=Nt.directive(Io);class jo extends Nt.AsyncDirective{constructor(t){if(super(t),this._activePointerId=null,t.type!==ze.PartType.ELEMENT)throw new Error("The `mouseMove` directive must be used on an element.");this._pointerDownHandle=this._onPointerDown.bind(this),this._pointerMoveHandle=this._onPointerMove.bind(this),this._pointerEndHandle=this._onPointerEnd.bind(this)}_onPointerDown(t){if(this._activePointerId!==null)return;t.preventDefault();const n=t.currentTarget;this._activePointerId=t.pointerId,this._capturePointer(n,t.pointerId),n.addEventListener("pointermove",this._pointerMoveHandle),n.addEventListener("pointerup",this._pointerEndHandle),n.addEventListener("pointercancel",this._pointerEndHandle),n.addEventListener("lostpointercapture",this._pointerEndHandle),n.focus()}_onPointerMove(t){t.pointerId===this._activePointerId&&(t.preventDefault(),this._callback(t))}_onPointerEnd(t){if(t.pointerId!==this._activePointerId)return;t.preventDefault();const n=t.currentTarget;this._releasePointer(n,t.pointerId),this._removePointerCycleListeners(n),this._activePointerId=null}_init(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),t.addEventListener("pointerdown",this._pointerDownHandle))}_removePointerCycleListeners(t){t.removeEventListener("pointermove",this._pointerMoveHandle),t.removeEventListener("pointerup",this._pointerEndHandle),t.removeEventListener("pointercancel",this._pointerEndHandle),t.removeEventListener("lostpointercapture",this._pointerEndHandle)}_capturePointer(t,n){try{t.setPointerCapture(n)}catch{}}_releasePointer(t,n){try{t.hasPointerCapture(n)&&t.releasePointerCapture(n)}catch{}}render(t){return Et.nothing}update(t,[n]){if(this._callback=n.bind(t.options?.host??t.element),!this.isConnected||!(t.element instanceof HTMLElement))return;const i=this._element?.deref();i!==t.element&&(i?.removeEventListener("pointerdown",this._pointerDownHandle),i&&this._removePointerCycleListeners(i),this._activePointerId=null,this._element=new WeakRef(t.element),this._init())}disconnected(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),this._removePointerCycleListeners(t),this._activePointerId=null)}reconnected(){this._init()}}const Fo=Nt.directive(jo);class $o{constructor(t,n){this._dragging=!1,this._startX=0,this._startY=0,this._startLeft=0,this._startTop=0,this._opts={axis:"both",step:4,disabled:!1,handle:null,bounds:"viewport",...n},this._onPointerDown=this._handlePointerDown.bind(this),this._onPointerMove=this._handlePointerMove.bind(this),this._onPointerUp=this._handlePointerUp.bind(this),this._onPointerCancel=this._cancelDrag.bind(this),this._onLostPointerCapture=this._handleLostPointerCapture.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),t.addController(this)}setOptions(t){const n=this._handle();Object.assign(this._opts,t);const i=this._handle();n!==i&&(this._detachFrom(n),this._attachTo(i))}hostConnected(){this._attachTo(this._handle())}hostDisconnected(){this._detachFrom(this._handle())}_handle(){return this._opts.handle??this._opts.target}_target(){return this._opts.target}_attachTo(t){t.addEventListener("pointerdown",this._onPointerDown),t.addEventListener("keydown",this._onKeyDown),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}_detachFrom(t){t.removeEventListener("pointerdown",this._onPointerDown),t.removeEventListener("keydown",this._onKeyDown),t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointercancel",this._onPointerCancel),t.removeEventListener("lostpointercapture",this._onLostPointerCapture)}_handlePointerDown(t){if(this._opts.disabled||t.target.closest('button, [role="button"], a'))return;const n=this._target(),i=n.getBoundingClientRect();getComputedStyle(n).position==="static"&&(n.style.position="fixed"),n.style.translate="none",n.style.inset="auto",n.style.margin="0",n.style.left=`${i.left}px`,n.style.top=`${i.top}px`,this._startX=t.clientX,this._startY=t.clientY,this._startLeft=i.left,this._startTop=i.top,this._dragging=!0;const r=this._handle();r.setPointerCapture(t.pointerId),r.addEventListener("pointermove",this._onPointerMove),r.addEventListener("pointerup",this._onPointerUp),r.addEventListener("pointercancel",this._onPointerCancel),r.addEventListener("lostpointercapture",this._onLostPointerCapture),t.preventDefault()}_handlePointerMove(t){if(!this._dragging)return;const n=this._target(),{axis:i}=this._opts,[r,s,l,c]=this._boundsRect(),a=i!=="y"?Math.min(Math.max(this._startLeft+t.clientX-this._startX,r),l-n.offsetWidth):parseFloat(n.style.left)||0,o=i!=="x"?Math.min(Math.max(this._startTop+t.clientY-this._startY,s),c-n.offsetHeight):parseFloat(n.style.top)||0;n.style.left=`${a}px`,n.style.top=`${o}px`}_handlePointerUp(t){this._cancelDrag()}_handleLostPointerCapture(t){this._cancelDrag()}_cancelDrag(){if(!this._dragging)return;this._dragging=!1;const t=this._handle();t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointercancel",this._onPointerCancel),t.removeEventListener("lostpointercapture",this._onLostPointerCapture)}_handleKeyDown(t){if(this._opts.disabled||t.currentTarget!==t.target)return;const{axis:n}=this._opts,i=t.shiftKey?this._opts.step*10:this._opts.step;let r=0,s=0;switch(t.key){case"ArrowLeft":if(n==="y")return;r=-i;break;case"ArrowRight":if(n==="y")return;r=i;break;case"ArrowUp":if(n==="x")return;s=-i;break;case"ArrowDown":if(n==="x")return;s=i;break;default:return}const l=this._target();if(getComputedStyle(l).position==="static"){const d=l.getBoundingClientRect();l.style.position="fixed",l.style.translate="none",l.style.left=`${d.left}px`,l.style.top=`${d.top}px`}const[c,a,o,h]=this._boundsRect(),u=parseFloat(l.style.left)||0,f=parseFloat(l.style.top)||0;l.style.left=`${Math.min(Math.max(u+r,c),o-l.offsetWidth)}px`,l.style.top=`${Math.min(Math.max(f+s,a),h-l.offsetHeight)}px`,t.preventDefault(),t.stopPropagation()}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const r=i.getBoundingClientRect();return[r.left,r.top,r.right,r.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}class No{constructor(t,n){this._resizing=null,this._startX=0,this._startY=0,this._startW=0,this._startH=0,this._startLeft=0,this._startTop=0,this._effectiveMinW=0,this._effectiveMinH=0,this._cornerBtn=null,this._opts={direction:"none",threshold:8,step:4,disabled:!1,minWidth:100,minHeight:60,handle:null,bounds:"viewport",...n},this._onPointerMove=this._handlePointerMove.bind(this),this._onPointerDown=this._handlePointerDown.bind(this),this._onPointerUp=this._handlePointerUp.bind(this),this._onPointerLeave=this._handlePointerLeave.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),t.addController(this)}setOptions(t){Object.assign(this._opts,t)}hostConnected(){if(this._opts.direction==="none")return;const t=this._target();t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerup",this._onPointerUp),t.addEventListener("pointerleave",this._onPointerLeave),this._injectCornerButton()}hostDisconnected(){const t=this._target();t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointerleave",this._onPointerLeave),this._removeCornerButton()}_target(){return this._opts.target}_injectCornerButton(){if(this._opts.handle)return;const t=this._target();getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=document.createElement("button");n.setAttribute("data-rc-resize-corner",""),n.setAttribute("aria-label","Resize"),n.type="button",Object.assign(n.style,{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",padding:"0",border:"none",background:"transparent",cursor:this._cornerCursor(),zIndex:"1"}),n.addEventListener("keydown",this._onKeyDown),t.appendChild(n),this._cornerBtn=n}_removeCornerButton(){this._cornerBtn&&(this._cornerBtn.removeEventListener("keydown",this._onKeyDown),this._cornerBtn.remove(),this._cornerBtn=null)}_cornerCursor(){switch(this._opts.direction){case"both":return"se-resize";case"horizontal":return"ew-resize";case"vertical":return"ns-resize";default:return"default"}}_edgeCursor(t){return{n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"}[t]}_detectEdge(t){const{direction:n,threshold:i}=this._opts;if(n==="none")return null;const r=this._target().getBoundingClientRect(),s=t.clientX,l=t.clientY,c=s>=r.right-i&&s<=r.right+i,a=s>=r.left-i&&s<=r.left+i,o=l>=r.bottom-i&&l<=r.bottom+i,h=l>=r.top-i&&l<=r.top+i,u=s>=r.left&&s<=r.right,f=l>=r.top&&l<=r.bottom;if(n==="both"){if(c&&o)return"se";if(a&&o)return"sw";if(c&&h)return"ne";if(a&&h)return"nw";if(c&&f)return"e";if(a&&f)return"w";if(o&&u)return"s";if(h&&u)return"n"}if(n==="horizontal"){if(c&&f)return"e";if(a&&f)return"w"}if(n==="vertical"){if(o&&u)return"s";if(h&&u)return"n"}return null}_pinPosition(t){const n=t.getBoundingClientRect();return getComputedStyle(t).position==="static"&&(t.style.position="fixed"),t.style.translate="none",t.style.inset="auto",t.style.margin="0",t.style.boxSizing="border-box",t.style.left=`${n.left}px`,t.style.top=`${n.top}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`,n}_handlePointerDown(t){if(this._opts.disabled)return;const n=this._detectEdge(t);if(!n)return;t.stopPropagation();const i=this._target(),r=this._pinPosition(i);this._startX=t.clientX,this._startY=t.clientY,this._startW=r.width,this._startH=r.height,this._startLeft=r.left,this._startTop=r.top,this._resizing=n;const s=getComputedStyle(i);this._effectiveMinW=Math.max(this._opts.minWidth,parseFloat(s.minWidth)||0),this._effectiveMinH=Math.max(this._opts.minHeight,parseFloat(s.minHeight)||0),i.setPointerCapture(t.pointerId),t.preventDefault()}_handlePointerMove(t){if(this._resizing){const r=this._target(),[s,l,c,a]=this._boundsRect(),{maxWidth:o,maxHeight:h}=this._opts,u=this._effectiveMinW,f=this._effectiveMinH,d=t.clientX-this._startX,p=t.clientY-this._startY,m=this._resizing;if(m==="e"||m==="se"||m==="ne"){const y=Math.min(o??1/0,c-this._startLeft);r.style.width=`${Math.min(Math.max(this._startW+d,u),y)}px`}if(m==="w"||m==="sw"||m==="nw"){const y=this._startLeft+this._startW,b=Math.min(Math.max(this._startLeft+d,s,o!==void 0?y-o:-1/0),y-u);r.style.left=`${b}px`,r.style.width=`${y-b}px`}if(m==="s"||m==="se"||m==="sw"){const y=Math.min(h??1/0,a-this._startTop);r.style.height=`${Math.min(Math.max(this._startH+p,f),y)}px`}if(m==="n"||m==="ne"||m==="nw"){const y=this._startTop+this._startH,b=Math.min(Math.max(this._startTop+p,l,h!==void 0?y-h:-1/0),y-f);r.style.top=`${b}px`,r.style.height=`${y-b}px`}return}if(this._opts.handle)return;const n=this._detectEdge(t),i=this._target();i.style.cursor=n?this._edgeCursor(n):""}_handlePointerUp(t){this._resizing=null}_handlePointerLeave(t){this._resizing||(this._target().style.cursor="")}_handleKeyDown(t){if(this._opts.disabled)return;const{direction:n}=this._opts,i=t.key==="ArrowRight"||t.key==="ArrowLeft",r=t.key==="ArrowDown"||t.key==="ArrowUp";if(i&&n==="vertical"||r&&n==="horizontal"||!i&&!r)return;t.preventDefault(),t.stopPropagation();const s=this._target(),l=this._pinPosition(s),c=t.shiftKey?this._opts.step*10:this._opts.step,[,,a,o]=this._boundsRect(),{maxWidth:h,maxHeight:u}=this._opts,f=getComputedStyle(s),d=Math.max(this._opts.minWidth,parseFloat(f.minWidth)||0),p=Math.max(this._opts.minHeight,parseFloat(f.minHeight)||0);if(t.key==="ArrowRight"){const m=Math.min(h??1/0,a-l.left);s.style.width=`${Math.min(Math.max(s.offsetWidth+c,d),m)}px`}if(t.key==="ArrowLeft"&&(s.style.width=`${Math.max(s.offsetWidth-c,d)}px`),t.key==="ArrowDown"){const m=Math.min(u??1/0,o-l.top);s.style.height=`${Math.min(Math.max(s.offsetHeight+c,p),m)}px`}t.key==="ArrowUp"&&(s.style.height=`${Math.max(s.offsetHeight-c,p)}px`)}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const r=i.getBoundingClientRect();return[r.left,r.top,r.right,r.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}function pe(e,t){const n=`${t}px`;switch(e){case"top":return`position-area: top; margin-bottom: ${n};`;case"top-start":return`bottom: anchor(top); top: auto; left: anchor(left); right: auto; margin-bottom: ${n};`;case"top-end":return`bottom: anchor(top); top: auto; left: auto; right: anchor(right); margin-bottom: ${n};`;case"bottom":return`position-area: bottom; margin-top: ${n};`;case"bottom-start":return`top: anchor(bottom); bottom: auto; left: anchor(left); right: auto; margin-top: ${n};`;case"bottom-end":return`top: anchor(bottom); bottom: auto; left: auto; right: anchor(right); margin-top: ${n};`;case"left":return`position-area: left; margin-right: ${n};`;case"left-start":return`top: anchor(top); bottom: auto; right: anchor(left); left: auto; margin-right: ${n};`;case"left-end":return`top: auto; bottom: anchor(bottom); right: anchor(left); left: auto; margin-right: ${n};`;case"right":return`position-area: right; margin-left: ${n};`;case"right-start":return`top: anchor(top); bottom: auto; left: anchor(right); right: auto; margin-left: ${n};`;case"right-end":return`top: auto; bottom: anchor(bottom); left: anchor(right); right: auto; margin-left: ${n};`}}const Mn={top:"bottom","top-start":"bottom-start","top-end":"bottom-end",bottom:"top","bottom-start":"top-start","bottom-end":"top-end",left:"right","left-start":"right-start","left-end":"right-end",right:"left","right-start":"left-start","right-end":"left-end"},zo={top:"top","top-start":"top-end","top-end":"top-start",bottom:"bottom","bottom-start":"bottom-end","bottom-end":"bottom-start",left:"left","left-start":"left-end","left-end":"left-start",right:"right","right-start":"right-end","right-end":"right-start"},In=CSS.supports("position-try-fallbacks: flip-block")&&CSS.supports("min-width: anchor-size(width)");let Rn=null,We=null;function Wo(){return In?Promise.resolve(null):(We||(We=Promise.resolve().then(()=>Wp).then(e=>(Rn=e.default,Rn)).catch(()=>null)),We)}let Bo=0;class Ho{constructor(t,n){this._styleEl=null,this._adoptedSheet=null,this._opts=n,this._uid=`rc-anchor-${++Bo}`,t.addController(this)}setOptions(t){Object.assign(this._opts,t),this._applyAndPolyfill()}update(){this._applyAndPolyfill()}hostConnected(){this._applyAndPolyfill()}hostDisconnected(){this._cleanup()}_anchor(){const{anchor:t}=this._opts;return typeof t=="function"?t():t}_floating(){const{floating:t}=this._opts;return typeof t=="function"?t():t}_shadowHost(){const{shadowHost:t}=this._opts;return typeof t=="function"?t():t??null}_applyAndPolyfill(){this._apply(),In||this._applyPolyfillOrFallback()}async _applyPolyfillOrFallback(){const t=await Wo(),n=this._shadowHost();t?await t({roots:n?[n]:void 0,useAnimationFrame:!1}):this._positionFallback()}_apply(){if(this._opts.disabled){this._cleanup();return}const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",r=this._opts.offset??4,s=this._opts.flip??!0,l=`--${this._uid}`,c=this._uid;t.style.setProperty("anchor-name",l),n.setAttribute("data-rc-anchor",c);const a=Mn[i],o=zo[i],h=Mn[o],u=s?`
|
|
2
|
+
@position-try --${c}-end { ${pe(o,r)} }
|
|
3
3
|
@position-try --${c}-flip { ${pe(a,r)} }
|
|
4
|
-
@position-try --${c}-both { ${pe(
|
|
5
|
-
`:"",f=
|
|
6
|
-
${
|
|
4
|
+
@position-try --${c}-both { ${pe(h,r)} }
|
|
5
|
+
`:"",f=s?`position-try-fallbacks: --${c}-end, --${c}-flip, --${c}-both;`:"",d=`
|
|
6
|
+
${u}
|
|
7
7
|
[data-rc-anchor="${c}"] {
|
|
8
8
|
position: fixed;
|
|
9
9
|
position-anchor: ${l};
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
${pe(i,r)}
|
|
13
13
|
${f}
|
|
14
14
|
}
|
|
15
|
-
`;this._injectStyles(d)}_injectStyles(t){const n=this._shadowHost();n?.shadowRoot?(this._adoptedSheet||(this._adoptedSheet=new CSSStyleSheet,n.shadowRoot.adoptedStyleSheets=[...n.shadowRoot.adoptedStyleSheets,this._adoptedSheet]),this._adoptedSheet.replaceSync(t)):(this._styleEl?.remove(),this._styleEl=document.createElement("style"),this._styleEl.setAttribute("data-rc-anchor-style",this._uid),this._styleEl.textContent=t,document.head.appendChild(this._styleEl))}_positionFallback(){const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",r=this._opts.offset??4,o=t.getBoundingClientRect(),l=window.innerWidth,c=window.innerHeight;n.style.position="fixed",n.style.boxSizing="border-box",n.style.minWidth=`${o.width}px`;const a=i.startsWith("bottom")||i==="bottom",s=c-o.bottom;a&&s<120&&o.top>s?(n.style.top="",n.style.bottom=`${c-o.top+r}px`):(n.style.bottom="",n.style.top=`${o.bottom+r}px`);const h=i.endsWith("-end"),f=n.offsetWidth||parseFloat(getComputedStyle(n).minWidth)||0;let d=h?o.right-f:o.left;d+f>l-4&&(d=o.right-f),d=Math.max(4,Math.min(d,l-f-4)),n.style.left=`${d}px`}_cleanup(){const t=this._anchor(),n=this._floating();t&&t.style.removeProperty("anchor-name"),n&&n.removeAttribute("data-rc-anchor"),this._styleEl?.remove(),this._styleEl=null;const i=this._shadowHost();i?.shadowRoot&&this._adoptedSheet&&(i.shadowRoot.adoptedStyleSheets=i.shadowRoot.adoptedStyleSheets.filter(r=>r!==this._adoptedSheet),this._adoptedSheet=null)}}class zs{constructor(t,n){this._attached=null,this._scrolled=!1,this._onScroll=()=>this._evaluate(),this._host=t,this._opts=n,t.addController(this)}get scrolled(){return this._scrolled}setOptions(t){this._detach(),Object.assign(this._opts,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._opts;return typeof t=="function"?t():t??null}_attach(){if(this._opts.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._attached=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._evaluate())}_detach(){this._attached?.removeEventListener("scroll",this._onScroll),this._attached=null,this._lastScrollTop=void 0}_scrollTop(){const t=this._attached;return t instanceof Element?t.scrollTop:t instanceof Document?t.scrollingElement?.scrollTop??0:t?.scrollY??0}_evaluate(){if(!this._attached)return;const t=this._scrollTop(),n=t-(this._lastScrollTop??t);this._lastScrollTop=t,this._opts.onScroll?.(t,n);const i=t>(this._opts.threshold??4);i!==this._scrolled&&(this._scrolled=i,this._opts.onChange?.(i,t),this._host.requestUpdate())}}function jn(e){return e==null||e.hasAttribute("disabled")?!1:!!((e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e.hasAttribute("tabindex")||e.shadowRoot?.delegatesFocus===!0)}var Ns=Object.defineProperty,Ws=(e,t,n,i)=>{for(var r=void 0,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=l(t,n,r)||r);return r&&Ns(t,n,r),r};function Hs(e){class t extends e{constructor(){super(...arguments),this._items=[]}get items(){return this._items.map(i=>i.deref()).filter(i=>jn(i))}get firstItem(){return this.items.at(0)}get lastItem(){return this.items.at(-1)}get nextItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i+1)%this.items.length)}get previousItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i-1)%this.items.length)}focusItem(i){i?.focus()}focusItemAt(i){this.focusItem(this.items.at(i))}focusFirst(){this.focusItem(this.firstItem)}focusLast(){this.focusItem(this.lastItem)}_collectItems(i){return i.assignedElements()}_handleItemFocus(i){const r=i.composedPath().find(o=>this.items.includes(o));r!=null&&(this._lastFocused=r,this.items.forEach(o=>o.setAttribute("tabindex","-1")),r.setAttribute("tabindex","0"))}_onSlotChange(i){const r=this._items;this._items=this._collectItems(i.currentTarget).map(o=>new WeakRef(o)),queueMicrotask(()=>{this.isConnected&&(r.forEach(o=>o.deref()?.removeAttribute("tabindex")),this._initItems())})}_initItems(){this._items.forEach(r=>r.deref()?.setAttribute("tabindex","-1"));const i=this.items[0];i&&i.setAttribute("tabindex","0")}}return Ws([Ls.state()],t.prototype,"_lastFocused"),t}function Bs(e,t,n,i){const r=Math.min(Math.max(e,t),n);if(i<=0)return r;const o=Math.round((r-t)/i)*i+t;return Math.min(Math.max(o,t),n)}function Us(e,t,n){return n===t?0:Math.min(Math.max((e-t)/(n-t),0),1)}var Vs=Object.defineProperty,qs=Object.defineProperties,Qs=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertySymbols,Xs=Object.prototype.hasOwnProperty,Ys=Object.prototype.propertyIsEnumerable,$n=(e,t,n)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))Xs.call(t,n)&&$n(e,n,t[n]);if(Fn)for(var n of Fn(t))Ys.call(t,n)&&$n(e,n,t[n]);return e},J=(e,t)=>qs(e,Qs(t)),T=(e,t,n)=>new Promise((i,r)=>{var o=a=>{try{c(n.next(a))}catch(s){r(s)}},l=a=>{try{c(n.throw(a))}catch(s){r(s)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,l);c((n=n.apply(e,t)).next())});const We=Math.min,zt=Math.max,me=Math.round,ge=Math.floor,mt=e=>({x:e,y:e});function Gs(e,t){return typeof e=="function"?e(t):e}function Ks(e){return U({top:0,right:0,bottom:0,left:0},e)}function Js(e){return typeof e!="number"?Ks(e):{top:e,right:e,bottom:e,left:e}}function ye(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function Zs(e,t){return T(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:r,platform:o,rects:l,elements:c,strategy:a}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:f=!1,padding:d=0}=Gs(t,e),p=Js(d),m=c[f?h==="floating"?"reference":"floating":h],y=ye(yield o.getClippingRect({element:(n=yield o.isElement==null?void 0:o.isElement(m))==null||n?m:m.contextElement||(yield o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:s,rootBoundary:u,strategy:a})),k=h==="floating"?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,x=yield o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating),w=(yield o.isElement==null?void 0:o.isElement(x))?(yield o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},A=ye(o.convertOffsetParentRelativeRectToViewportRelativeRect?yield o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:x,strategy:a}):k);return{top:(y.top-A.top+p.top)/w.y,bottom:(A.bottom-y.bottom+p.bottom)/w.y,left:(y.left-A.left+p.left)/w.x,right:(A.right-y.right+p.right)/w.x}})}function ke(){return typeof window<"u"}function Nt(e){return zn(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(zn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zn(e){return ke()?e instanceof Node||e instanceof et(e).Node:!1}function at(e){return ke()?e instanceof Element||e instanceof et(e).Element:!1}function yt(e){return ke()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Nn(e){return!ke()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const tl=new Set(["inline","contents"]);function ne(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!tl.has(r)}const el=new Set(["table","td","th"]);function nl(e){return el.has(Nt(e))}const il=[":popover-open",":modal"];function be(e){return il.some(t=>{try{return e.matches(t)}catch{return!1}})}const rl=["transform","translate","scale","rotate","perspective"],ol=["transform","translate","scale","rotate","perspective","filter"],sl=["paint","layout","strict","content"];function He(e){const t=Be(),n=at(e)?ct(e):e;return rl.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ol.some(i=>(n.willChange||"").includes(i))||sl.some(i=>(n.contain||"").includes(i))}function ll(e){let t=Ct(e);for(;yt(t)&&!Wt(t);){if(He(t))return t;if(be(t))return null;t=Ct(t)}return null}function Be(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const al=new Set(["html","body","#document"]);function Wt(e){return al.has(Nt(e))}function ct(e){return et(e).getComputedStyle(e)}function Se(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(Nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nn(e)&&e.host||gt(e);return Nn(t)?t.host:t}function Wn(e){const t=Ct(e);return Wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:yt(t)&&ne(t)?t:Wn(t)}function ie(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Wn(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),l=et(r);if(o){const c=Ue(l);return t.concat(l,l.visualViewport||[],ne(r)?r:[],c&&n?ie(c):[])}return t.concat(r,ie(r,[],n))}function Ue(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hn(e){const t=ct(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=yt(e),o=r?e.offsetWidth:n,l=r?e.offsetHeight:i,c=me(n)!==o||me(i)!==l;return c&&(n=o,i=l),{width:n,height:i,$:c}}function Ve(e){return at(e)?e:e.contextElement}function Ht(e){const t=Ve(e);if(!yt(t))return mt(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Hn(t);let l=(o?me(n.width):n.width)/i,c=(o?me(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const cl=mt(0);function Bn(e){const t=et(e);return!Be()||!t.visualViewport?cl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ul(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function Tt(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=Ve(e);let l=mt(1);t&&(i?at(i)&&(l=Ht(i)):l=Ht(e));const c=ul(o,n,i)?Bn(o):mt(0);let a=(r.left+c.x)/l.x,s=(r.top+c.y)/l.y,u=r.width/l.x,h=r.height/l.y;if(o){const f=et(o),d=i&&at(i)?et(i):i;let p=f,m=Ue(p);for(;m&&i&&d!==p;){const y=Ht(m),k=m.getBoundingClientRect(),x=ct(m),w=k.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,A=k.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;a*=y.x,s*=y.y,u*=y.x,h*=y.y,a+=w,s+=A,p=et(m),m=Ue(p)}}return ye({width:u,height:h,x:a,y:s})}function _e(e,t){const n=Se(e).scrollLeft;return t?t.left+n:Tt(gt(e)).left+n}function Un(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-_e(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function hl(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const o=r==="fixed",l=gt(i),c=t?be(t.floating):!1;if(i===l||c&&o)return n;let a={scrollLeft:0,scrollTop:0},s=mt(1);const u=mt(0),h=yt(i);if((h||!h&&!o)&&((Nt(i)!=="body"||ne(l))&&(a=Se(i)),yt(i))){const d=Tt(i);s=Ht(i),u.x=d.x+i.clientLeft,u.y=d.y+i.clientTop}const f=l&&!h&&!o?Un(l,a):mt(0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-a.scrollLeft*s.x+u.x+f.x,y:n.y*s.y-a.scrollTop*s.y+u.y+f.y}}function fl(e){return Array.from(e.getClientRects())}function dl(e){const t=gt(e),n=Se(e),i=e.ownerDocument.body,r=zt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=zt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+_e(e);const c=-n.scrollTop;return ct(i).direction==="rtl"&&(l+=zt(t.clientWidth,i.clientWidth)-r),{width:r,height:o,x:l,y:c}}const Vn=25;function pl(e,t){const n=et(e),i=gt(e),r=n.visualViewport;let o=i.clientWidth,l=i.clientHeight,c=0,a=0;if(r){o=r.width,l=r.height;const u=Be();(!u||u&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const s=_e(i);if(s<=0){const u=i.ownerDocument,h=u.body,f=getComputedStyle(h),d=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(i.clientWidth-h.clientWidth-d);p<=Vn&&(o-=p)}else s<=Vn&&(o+=s);return{width:o,height:l,x:c,y:a}}const ml=new Set(["absolute","fixed"]);function gl(e,t){const n=Tt(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,o=yt(e)?Ht(e):mt(1),l=e.clientWidth*o.x,c=e.clientHeight*o.y,a=r*o.x,s=i*o.y;return{width:l,height:c,x:a,y:s}}function qn(e,t,n){let i;if(t==="viewport")i=pl(e,n);else if(t==="document")i=dl(gt(e));else if(at(t))i=gl(t,n);else{const r=Bn(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ye(i)}function Qn(e,t){const n=Ct(e);return n===t||!at(n)||Wt(n)?!1:ct(n).position==="fixed"||Qn(n,t)}function yl(e,t){const n=t.get(e);if(n)return n;let i=ie(e,[],!1).filter(c=>at(c)&&Nt(c)!=="body"),r=null;const o=ct(e).position==="fixed";let l=o?Ct(e):e;for(;at(l)&&!Wt(l);){const c=ct(l),a=He(l);!a&&c.position==="fixed"&&(r=null),(o?!a&&!r:!a&&c.position==="static"&&r&&ml.has(r.position)||ne(l)&&!a&&Qn(e,l))?i=i.filter(s=>s!==l):r=c,l=Ct(l)}return t.set(e,i),i}function kl(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?be(t)?[]:yl(t,this._c):[].concat(n),i],l=o[0],c=o.reduce((a,s)=>{const u=qn(t,s,r);return a.top=zt(u.top,a.top),a.right=We(u.right,a.right),a.bottom=We(u.bottom,a.bottom),a.left=zt(u.left,a.left),a},qn(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function bl(e){const{width:t,height:n}=Hn(e);return{width:t,height:n}}function Sl(e,t,n){const i=yt(t),r=gt(t),o=n==="fixed",l=Tt(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const a=mt(0);function s(){a.x=_e(r)}if(i||!i&&!o)if((Nt(t)!=="body"||ne(r))&&(c=Se(t)),i){const d=Tt(t,!0,o,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else r&&s();o&&!i&&r&&s();const u=r&&!i&&!o?Un(r,c):mt(0),h=l.left+c.scrollLeft-a.x-u.x,f=l.top+c.scrollTop-a.y-u.y;return{x:h,y:f,width:l.width,height:l.height}}function qe(e){return ct(e).position==="static"}function Xn(e,t){if(!yt(e)||ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function Yn(e,t){const n=et(e);if(be(e))return n;if(!yt(e)){let r=Ct(e);for(;r&&!Wt(r);){if(at(r)&&!qe(r))return r;r=Ct(r)}return n}let i=Xn(e,t);for(;i&&nl(i)&&qe(i);)i=Xn(i,t);return i&&Wt(i)&&qe(i)&&!He(i)?n:i||ll(e)||n}const _l=function(e){return T(this,null,function*(){const t=this.getOffsetParent||Yn,n=this.getDimensions,i=yield n(e.floating);return{reference:Sl(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function vl(e){return ct(e).direction==="rtl"}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:hl,getDocumentElement:gt,getClippingRect:kl,getOffsetParent:Yn,getElementRects:_l,getClientRects:fl,getDimensions:bl,getScale:Ht,isElement:at,isRTL:vl};function Gn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wl(e,t){let n=null,i;const r=gt(e);function o(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function l(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),o();const s=e.getBoundingClientRect(),{left:u,top:h,width:f,height:d}=s;if(c||t(),!f||!d)return;const p=ge(h),m=ge(r.clientWidth-(u+f)),y=ge(r.clientHeight-(h+d)),k=ge(u),x={rootMargin:-p+"px "+-m+"px "+-y+"px "+-k+"px",threshold:zt(0,We(1,a))||1};let w=!0;function A(pt){const _=pt[0].intersectionRatio;if(_!==a){if(!w)return l();_?l(!1,_):i=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Gn(s,e.getBoundingClientRect())&&l(),w=!1}try{n=new IntersectionObserver(A,J(U({},x),{root:r.ownerDocument}))}catch{n=new IntersectionObserver(A,x)}n.observe(e)}return l(!0),o}function Qe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,s=Ve(e),u=r||o?[...s?ie(s):[],...ie(t)]:[];u.forEach(k=>{r&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=s&&c?wl(s,n):null;let f=-1,d=null;l&&(d=new ResizeObserver(k=>{let[x]=k;x&&x.target===s&&d&&(d.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),s&&!a&&d.observe(s),d.observe(t));let p,m=a?Tt(e):null;a&&y();function y(){const k=Tt(e);m&&!Gn(m,k)&&n(),m=k,p=requestAnimationFrame(y)}return n(),()=>{var k;u.forEach(x=>{r&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),h?.(),(k=d)==null||k.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const Cl=Zs,{hasOwnProperty:Xe}=Object.prototype,re=function(){};function Kn(e){return typeof e=="function"?e:re}function Jn(e,t){return function(n,i,r){n.type===t&&e.call(this,n,i,r)}}function xl(e,t){const n=t.structure,i=[];for(const r in n){if(Xe.call(n,r)===!1)continue;let o=n[r];const l={name:r,type:!1,nullable:!1};Array.isArray(o)||(o=[o]);for(const c of o)c===null?l.nullable=!0:typeof c=="string"?l.type="node":Array.isArray(c)&&(l.type="list");l.type&&i.push(l)}return i.length?{context:t.walkContext,fields:i}:null}function Ll(e){const t={};for(const n in e.node)if(Xe.call(e.node,n)){const i=e.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=xl(n,i)}return t}function Zn(e,t){const n=e.fields.slice(),i=e.context,r=typeof i=="string";return t&&n.reverse(),function(o,l,c,a){let s;r&&(s=l[i],l[i]=o);for(const u of n){const h=o[u.name];if(!u.nullable||h){if(u.type==="list"){if(t?h.reduceRight(a,!1):h.reduce(a,!1))return!0}else if(c(h))return!0}}r&&(l[i]=s)}}function ti({StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:r}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:r}}}function Al(e){const t=Ll(e),n={},i={},r=Symbol("break-walk"),o=Symbol("skip-node");for(const s in t)Xe.call(t,s)&&t[s]!==null&&(n[s]=Zn(t[s],!1),i[s]=Zn(t[s],!0));const l=ti(n),c=ti(i),a=function(s,u){function h(k,x,w){const A=f.call(y,k,x,w);return A===r?!0:A===o?!1:!!(p.hasOwnProperty(k.type)&&p[k.type](k,y,h,m)||d.call(y,k,x,w)===r)}let f=re,d=re,p=n,m=(k,x,w,A)=>k||h(x,w,A);const y={break:r,skip:o,root:s,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof u=="function")f=u;else if(u&&(f=Kn(u.enter),d=Kn(u.leave),u.reverse&&(p=i),u.visit)){if(l.hasOwnProperty(u.visit))p=u.reverse?c[u.visit]:l[u.visit];else if(!t.hasOwnProperty(u.visit))throw new Error("Bad value `"+u.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=Jn(f,u.visit),d=Jn(d,u.visit)}if(f===re&&d===re)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");h(s)};return a.break=r,a.skip=o,a.find=function(s,u){let h=null;return a(s,function(f,d,p){if(u.call(this,f,d,p))return h=f,r}),h},a.findLast=function(s,u){let h=null;return a(s,{reverse:!0,enter(f,d,p){if(u.call(this,f,d,p))return h=f,r}}),h},a.findAll=function(s,u){const h=[];return a(s,function(f,d,p){u.call(this,f,d,p)&&h.push(f)}),h},a}const xt=0,g=1,v=2,B=3,D=4,wt=5,Pl=6,Q=7,ut=8,L=9,S=10,$=11,C=12,N=13,ve=14,it=15,X=16,Z=17,ht=18,Bt=19,oe=20,E=21,b=22,ft=23,Ut=24,Y=25,Tl=0;function rt(e){return e>=48&&e<=57}function Vt(e){return rt(e)||e>=65&&e<=70||e>=97&&e<=102}function Ye(e){return e>=65&&e<=90}function El(e){return e>=97&&e<=122}function Ol(e){return Ye(e)||El(e)}function Dl(e){return e>=128}function we(e){return Ol(e)||Dl(e)||e===95}function ei(e){return we(e)||rt(e)||e===45}function Ml(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ce(e){return e===10||e===13||e===12}function Et(e){return Ce(e)||e===32||e===9}function kt(e,t){return!(e!==92||Ce(t)||t===Tl)}function Ge(e,t,n){return e===45?we(t)||t===45||kt(t,n):we(e)?!0:e===92?kt(e,t):!1}function Ke(e,t,n){return e===43||e===45?rt(t)?2:t===46&&rt(n)?3:0:e===46?rt(t)?2:0:rt(e)?1:0}function ni(e){return e===65279||e===65534?1:0}const Je=new Array(128),Il=128,xe=130,ii=131,Ze=132,ri=133;for(let e=0;e<Je.length;e++)Je[e]=Et(e)&&xe||rt(e)&&ii||we(e)&&Ze||Ml(e)&&ri||e||Il;function tn(e){return e<128?Je[e]:Ze}function qt(e,t){return t<e.length?e.charCodeAt(t):0}function en(e,t,n){return n===13&&qt(e,t+1)===10?2:1}function oi(e,t,n){let i=e.charCodeAt(t);return Ye(i)&&(i=i|32),i===n}function Le(e,t,n,i){if(n-t!==i.length||t<0||n>e.length)return!1;for(let r=t;r<n;r++){const o=i.charCodeAt(r-t);let l=e.charCodeAt(r);if(Ye(l)&&(l=l|32),l!==o)return!1}return!0}function Rl(e,t){for(;t>=0&&Et(e.charCodeAt(t));t--);return t+1}function Ae(e,t){for(;t<e.length&&Et(e.charCodeAt(t));t++);return t}function nn(e,t){for(;t<e.length&&rt(e.charCodeAt(t));t++);return t}function Qt(e,t){if(t+=2,Vt(qt(e,t-1))){for(const i=Math.min(e.length,t+5);t<i&&Vt(qt(e,t));t++);const n=qt(e,t);Et(n)&&(t+=en(e,t,n))}return t}function Pe(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!ei(n)){if(kt(n,qt(e,t+1))){t=Qt(e,t)-1;continue}break}}return t}function si(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),rt(n)&&(t=nn(e,t+1),n=e.charCodeAt(t)),n===46&&rt(e.charCodeAt(t+1))&&(t+=2,t=nn(e,t)),oi(e,t,101)){let i=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(i=1,n=e.charCodeAt(t+2)),rt(n)&&(t=nn(e,t+1+i+1))}return t}function rn(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}kt(n,qt(e,t+1))&&(t=Qt(e,t))}return t}function li(e){if(e.length===1&&!Vt(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const ai=["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"],jl=16*1024;function Te(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,jl)):e}const ci=10,Fl=12,ui=13;function hi(e){const t=e.source,n=t.length,i=t.length>0?ni(t.charCodeAt(0)):0,r=Te(e.lines,n),o=Te(e.columns,n);let l=e.startLine,c=e.startColumn;for(let a=i;a<n;a++){const s=t.charCodeAt(a);r[a]=l,o[a]=c++,(s===ci||s===ui||s===Fl)&&(s===ui&&a+1<n&&t.charCodeAt(a+1)===ci&&(a++,r[a]=l,o[a]=c),l++,c=1)}r[n]=l,o[n]=c,e.lines=r,e.columns=o,e.computed=!0}class $l{constructor(t,n,i,r){this.setSource(t,n,i,r),this.lines=null,this.columns=null}setSource(t="",n=0,i=1,r=1){this.source=t,this.startOffset=n,this.startLine=i,this.startColumn=r,this.computed=!1}getLocation(t,n){return this.computed||hi(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,i){return this.computed||hi(this),{source:i,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const bt=16777215,St=24,Ot=new Uint8Array(32);Ot[v]=b,Ot[E]=b,Ot[Bt]=oe,Ot[ft]=Ut;function fi(e){return Ot[e]!==0}class zl{constructor(t,n){this.setSource(t,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",n=()=>{}){t=String(t||"");const i=t.length,r=Te(this.offsetAndType,t.length+1),o=Te(this.balance,t.length+1);let l=0,c=-1,a=0,s=t.length;this.offsetAndType=null,this.balance=null,o.fill(0),n(t,(u,h,f)=>{const d=l++;if(r[d]=u<<St|f,c===-1&&(c=h),o[d]=s,u===a){const p=o[s];o[s]=d,s=p,a=Ot[r[p]>>St]}else fi(u)&&(s=d,a=Ot[u])}),r[l]=xt<<St|i,o[l]=l;for(let u=0;u<l;u++){const h=o[u];if(h<=u){const f=o[h];f!==u&&(o[u]=f)}else h>l&&(o[u]=l)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=l,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>St:xt}lookupTypeNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>St;if(i!==N&&i!==Y&&t--===0)return i}return xt}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&bt:this.source.length}lookupOffsetNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>St;if(i!==N&&i!==Y&&t--===0)return n-this.tokenIndex}return xt}lookupValue(t,n){return t+=this.tokenIndex,t<this.tokenCount?Le(this.source,this.offsetAndType[t-1]&bt,this.offsetAndType[t]&bt,n):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&bt:this.offsetAndType[this.tokenCount]&bt:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,n){return n?this.lookupType(n)===L&&this.source.charCodeAt(this.lookupOffset(n))===t:this.tokenType===L&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let n=this.tokenIndex+t;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&bt,n=this.offsetAndType[n],this.tokenType=n>>St,this.tokenEnd=n&bt):(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>>St,this.tokenEnd=t&bt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=xt,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===N||this.tokenType===Y;)this.next()}skipUntilBalanced(t,n){let i=t,r=0,o=0;t:for(;i<this.tokenCount;i++){if(r=this.balance[i],r<t)break t;switch(o=i>0?this.offsetAndType[i-1]&bt:this.firstCharOffset,n(this.source.charCodeAt(o))){case 1:break t;case 2:i++;break t;default:fi(this.offsetAndType[i]>>St)&&(i=r)}}this.skip(i-this.tokenIndex)}forEachToken(t){for(let n=0,i=this.firstCharOffset;n<this.tokenCount;n++){const r=i,o=this.offsetAndType[n],l=o&bt,c=o>>St;i=l,t(c,r,l,n)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken((n,i,r,o)=>{t[o]={idx:o,type:ai[n],chunk:this.source.substring(i,r),balance:this.balance[o]}}),t}}function di(e,t){function n(h){return h<c?e.charCodeAt(h):0}function i(){if(s=si(e,s),Ge(n(s),n(s+1),n(s+2))){u=C,s=Pe(e,s);return}if(n(s)===37){u=$,s++;return}u=S}function r(){const h=s;if(s=Pe(e,s),Le(e,h,s,"url")&&n(s)===40){if(s=Ae(e,s+1),n(s)===34||n(s)===39){u=v,s=h+4;return}l();return}if(n(s)===40){u=v,s++;return}u=g}function o(h){for(h||(h=n(s++)),u=wt;s<e.length;s++){const f=e.charCodeAt(s);switch(tn(f)){case h:s++;return;case xe:if(Ce(f)){s+=en(e,s,f),u=Pl;return}break;case 92:if(s===e.length-1)break;const d=n(s+1);Ce(d)?s+=en(e,s+1,d):kt(f,d)&&(s=Qt(e,s)-1);break}}}function l(){for(u=Q,s=Ae(e,s);s<e.length;s++){const h=e.charCodeAt(s);switch(tn(h)){case 41:s++;return;case xe:if(s=Ae(e,s),n(s)===41||s>=e.length){s<e.length&&s++;return}s=rn(e,s),u=ut;return;case 34:case 39:case 40:case ri:s=rn(e,s),u=ut;return;case 92:if(kt(h,n(s+1))){s=Qt(e,s)-1;break}s=rn(e,s),u=ut;return}}}e=String(e||"");const c=e.length;let a=ni(n(0)),s=a,u;for(;s<c;){const h=e.charCodeAt(s);switch(tn(h)){case xe:u=N,s=Ae(e,s+1);break;case 34:o();break;case 35:ei(n(s+1))||kt(n(s+1),n(s+2))?(u=D,s=Pe(e,s+1)):(u=L,s++);break;case 39:o();break;case 40:u=E,s++;break;case 41:u=b,s++;break;case 43:Ke(h,n(s+1),n(s+2))?i():(u=L,s++);break;case 44:u=ht,s++;break;case 45:Ke(h,n(s+1),n(s+2))?i():n(s+1)===45&&n(s+2)===62?(u=it,s=s+3):Ge(h,n(s+1),n(s+2))?r():(u=L,s++);break;case 46:Ke(h,n(s+1),n(s+2))?i():(u=L,s++);break;case 47:n(s+1)===42?(u=Y,s=e.indexOf("*/",s+2),s=s===-1?e.length:s+2):(u=L,s++);break;case 58:u=X,s++;break;case 59:u=Z,s++;break;case 60:n(s+1)===33&&n(s+2)===45&&n(s+3)===45?(u=ve,s=s+4):(u=L,s++);break;case 64:Ge(n(s+1),n(s+2),n(s+3))?(u=B,s=Pe(e,s+1)):(u=L,s++);break;case 91:u=Bt,s++;break;case 92:kt(h,n(s+1))?r():(u=L,s++);break;case 93:u=oe,s++;break;case 123:u=ft,s++;break;case 125:u=Ut,s++;break;case ii:i();break;case Ze:r();break;default:u=L,s++}t(u,a,a=s)}}const _t=43,ot=45,Ee=110,Dt=!0,Nl=!1;function Oe(e,t){let n=this.tokenStart+e;const i=this.charCodeAt(n);for((i===_t||i===ot)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)rt(this.charCodeAt(n))||this.error("Integer is expected",n)}function Xt(e){return Oe.call(this,0,e)}function Lt(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Ee:n="N is expected";break;case ot:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+e)}}function on(){let e=0,t=0,n=this.tokenType;for(;n===N||n===Y;)n=this.lookupType(++e);if(n!==S)if(this.isDelim(_t,e)||this.isDelim(ot,e)){t=this.isDelim(_t,e)?_t:ot;do n=this.lookupType(++e);while(n===N||n===Y);n!==S&&(this.skip(e),Xt.call(this,Dt))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==_t&&n!==ot&&this.error("Number sign is expected")),Xt.call(this,t!==0),t===ot?"-"+this.consume(S):this.consume(S)}const Wl="AnPlusB",Hl={a:[String,null],b:[String,null]};function pi(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===S)Xt.call(this,Nl),n=this.consume(S);else if(this.tokenType===g&&this.cmpChar(this.tokenStart,ot))switch(t="-1",Lt.call(this,1,Ee),this.tokenEnd-this.tokenStart){case 2:this.next(),n=on.call(this);break;case 3:Lt.call(this,2,ot),this.next(),this.skipSC(),Xt.call(this,Dt),n="-"+this.consume(S);break;default:Lt.call(this,2,ot),Oe.call(this,3,Dt),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===g||this.isDelim(_t)&&this.lookupType(1)===g){let i=0;switch(t="1",this.isDelim(_t)&&(i=1,this.next()),Lt.call(this,0,Ee),this.tokenEnd-this.tokenStart){case 1:this.next(),n=on.call(this);break;case 2:Lt.call(this,1,ot),this.next(),this.skipSC(),Xt.call(this,Dt),n="-"+this.consume(S);break;default:Lt.call(this,1,ot),Oe.call(this,2,Dt),this.next(),n=this.substrToCursor(e+i+1)}}else if(this.tokenType===C){const i=this.charCodeAt(this.tokenStart),r=i===_t||i===ot;let o=this.tokenStart+r;for(;o<this.tokenEnd&&rt(this.charCodeAt(o));o++);o===this.tokenStart+r&&this.error("Integer is expected",this.tokenStart+r),Lt.call(this,o-this.tokenStart,Ee),t=this.substring(e,o),o+1===this.tokenEnd?(this.next(),n=on.call(this)):(Lt.call(this,o-this.tokenStart+1,ot),o+2===this.tokenEnd?(this.next(),this.skipSC(),Xt.call(this,Dt),n="-"+this.consume(S)):(Oe.call(this,o-this.tokenStart+2,Dt),this.next(),n=this.substrToCursor(o+1)))}else this.error();return t!==null&&t.charCodeAt(0)===_t&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===_t&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function mi(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){const n=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}const Bl=Object.freeze(Object.defineProperty({__proto__:null,generate:mi,name:Wl,parse:pi,structure:Hl},Symbol.toStringTag,{value:"Module"}));function gi(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Ul(){for(let e=1,t;t=this.lookupType(e);e++){if(t===Ut)return!0;if(t===ft||t===B)return!1}return!1}const Vl="Atrule",ql="atrule",Ql={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function yi(e=!1){const t=this.tokenStart;let n,i,r=null,o=null;switch(this.eat(B),n=this.substrToCursor(t+1),i=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==ft&&this.tokenType!==Z&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),gi):r=gi.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Z:this.next();break;case ft:hasOwnProperty.call(this.atrule,i)&&typeof this.atrule[i].block=="function"?o=this.atrule[i].block.call(this,e):o=this.Block(Ul.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:r,block:o}}function ki(e){this.token(B,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(Z,";")}const Xl=Object.freeze(Object.defineProperty({__proto__:null,generate:ki,name:Vl,parse:yi,structure:Ql,walkContext:ql},Symbol.toStringTag,{value:"Module"})),Yl="AtrulePrelude",Gl="atrulePrelude",Kl={children:[[]]};function bi(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==ft&&this.tokenType!==Z&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Si(e){this.children(e)}const Jl=Object.freeze(Object.defineProperty({__proto__:null,generate:Si,name:Yl,parse:bi,structure:Kl,walkContext:Gl},Symbol.toStringTag,{value:"Module"})),Zl=36,_i=42,De=61,ta=94,sn=124,ea=126;function na(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(_i)?(t=!0,this.next()):this.isDelim(sn)||this.eat(g),this.isDelim(sn)?this.charCodeAt(this.tokenStart+1)!==De?(this.next(),this.eat(g)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function ia(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==De&&t!==ea&&t!==ta&&t!==Zl&&t!==_i&&t!==sn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==De&&(this.isDelim(De)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const ra="AttributeSelector",oa={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function vi(){const e=this.tokenStart;let t,n=null,i=null,r=null;return this.eat(Bt),this.skipSC(),t=na.call(this),this.skipSC(),this.tokenType!==oe&&(this.tokenType!==g&&(n=ia.call(this),this.skipSC(),i=this.tokenType===wt?this.String():this.Identifier(),this.skipSC()),this.tokenType===g&&(r=this.consume(g),this.skipSC())),this.eat(oe),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:i,flags:r}}function wi(e){this.token(L,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(g,e.flags),this.token(L,"]")}const sa=Object.freeze(Object.defineProperty({__proto__:null,generate:wi,name:ra,parse:vi,structure:oa},Symbol.toStringTag,{value:"Module"})),la=38;function Ci(){return this.Raw(null,!0)}function xi(){return this.parseWithFallback(this.Rule,Ci)}function Li(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function aa(){if(this.tokenType===Z)return Li.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Li);return this.tokenType===Z&&this.next(),e}const ca="Block",ua="block",ha={children:[["Atrule","Rule","Declaration"]]};function Ai(e){const t=e?aa:xi,n=this.tokenStart;let i=this.createList();this.eat(ft);t:for(;!this.eof;)switch(this.tokenType){case Ut:break t;case N:case Y:this.next();break;case B:i.push(this.parseWithFallback(this.Atrule.bind(this,e),Ci));break;default:e&&this.isDelim(la)?i.push(xi.call(this)):i.push(t.call(this))}return this.eof||this.eat(Ut),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function Pi(e){this.token(ft,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")}),this.token(Ut,"}")}const fa=Object.freeze(Object.defineProperty({__proto__:null,generate:Pi,name:ca,parse:Ai,structure:ha,walkContext:ua},Symbol.toStringTag,{value:"Module"})),da="Brackets",pa={children:[[]]};function Ti(e,t){const n=this.tokenStart;let i=null;return this.eat(Bt),i=e.call(this,t),this.eof||this.eat(oe),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:i}}function Ei(e){this.token(L,"["),this.children(e),this.token(L,"]")}const ma=Object.freeze(Object.defineProperty({__proto__:null,generate:Ei,name:da,parse:Ti,structure:pa},Symbol.toStringTag,{value:"Module"})),ga="CDC",ya=[];function Oi(){const e=this.tokenStart;return this.eat(it),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Di(){this.token(it,"-->")}const ka=Object.freeze(Object.defineProperty({__proto__:null,generate:Di,name:ga,parse:Oi,structure:ya},Symbol.toStringTag,{value:"Module"})),ba="CDO",Sa=[];function Mi(){const e=this.tokenStart;return this.eat(ve),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Ii(){this.token(ve,"<!--")}const _a=Object.freeze(Object.defineProperty({__proto__:null,generate:Ii,name:ba,parse:Mi,structure:Sa},Symbol.toStringTag,{value:"Module"})),va=46,wa="ClassSelector",Ca={name:String};function Ri(){return this.eatDelim(va),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(g)}}function ji(e){this.token(L,"."),this.token(g,e.name)}const xa=Object.freeze(Object.defineProperty({__proto__:null,generate:ji,name:wa,parse:Ri,structure:Ca},Symbol.toStringTag,{value:"Module"})),La=43,Fi=47,Aa=62,Pa=126,Ta="Combinator",Ea={name:String};function $i(){const e=this.tokenStart;let t;switch(this.tokenType){case N:t=" ";break;case L:switch(this.charCodeAt(this.tokenStart)){case Aa:case La:case Pa:this.next();break;case Fi:this.next(),this.eatIdent("deep"),this.eatDelim(Fi);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function zi(e){this.tokenize(e.name)}const Oa=Object.freeze(Object.defineProperty({__proto__:null,generate:zi,name:Ta,parse:$i,structure:Ea},Symbol.toStringTag,{value:"Module"})),Da=42,Ma=47,Ia="Comment",Ra={value:String};function Ni(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(Y),t-e+2>=2&&this.charCodeAt(t-2)===Da&&this.charCodeAt(t-1)===Ma&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Wi(e){this.token(Y,"/*"+e.value+"*/")}const ja=Object.freeze(Object.defineProperty({__proto__:null,generate:Wi,name:Ia,parse:Ni,structure:Ra},Symbol.toStringTag,{value:"Module"})),Fa=new Set([X,b,xt]),$a="Condition",za={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function Hi(e){return this.lookupTypeNonSC(1)===g&&Fa.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const Na={media:Hi,container:Hi,supports(){return this.SupportsDeclaration()}};function Bi(e="media"){const t=this.createList();t:for(;!this.eof;)switch(this.tokenType){case Y:case N:this.next();continue;case g:t.push(this.Identifier());break;case E:{let n=this.parseWithFallback(()=>Na[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(E);const i=this.Condition(e);return this.eat(b),i},()=>this.GeneralEnclosed(e))),t.push(n);break}case v:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break t}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function Ui(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(E,"("),this.node(t),this.token(b,")")):this.node(t)})}const Wa=Object.freeze(Object.defineProperty({__proto__:null,generate:Ui,name:$a,parse:Bi,structure:za},Symbol.toStringTag,{value:"Module"})),Vi=45;function Ha(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Vi&&e.charCodeAt(t+1)===Vi}const qi=33,Ba=35,Ua=36,Va=38,qa=42,Qa=43,Qi=47;function Xa(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Ya(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Ga(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Z&&this.isDelim(qi)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const Ka="Declaration",Ja="declaration",Za={important:[Boolean,String],property:String,value:["Value","Raw"]};function Xi(){const e=this.tokenStart,t=this.tokenIndex,n=tc.call(this),i=Ha(n),r=i?this.parseCustomProperty:this.parseValue,o=i?Ya:Xa;let l=!1,c;this.skipSC(),this.eat(X);const a=this.tokenIndex;if(i||this.skipSC(),r?c=this.parseWithFallback(Ga,o):c=o.call(this,this.tokenIndex),i&&c.type==="Value"&&c.children.isEmpty){for(let s=a-this.tokenIndex;s<=0;s++)if(this.lookupType(s)===N){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(qi)&&(l=ec.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==Z&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:c}}function Yi(e){this.token(g,e.property),this.token(X,":"),this.node(e.value),e.important&&(this.token(L,"!"),this.token(g,e.important===!0?"important":e.important))}function tc(){const e=this.tokenStart;if(this.tokenType===L)switch(this.charCodeAt(this.tokenStart)){case qa:case Ua:case Qa:case Ba:case Va:this.next();break;case Qi:this.next(),this.isDelim(Qi)&&this.next();break}return this.tokenType===D?this.eat(D):this.eat(g),this.substrToCursor(e)}function ec(){this.eat(L),this.skipSC();const e=this.consume(g);return e==="important"?!0:e}const nc=Object.freeze(Object.defineProperty({__proto__:null,generate:Yi,name:Ka,parse:Xi,structure:Za,walkContext:Ja},Symbol.toStringTag,{value:"Module"})),ic=38;function ln(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const rc="DeclarationList",oc={children:[["Declaration","Atrule","Rule"]]};function Gi(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case N:case Y:case Z:this.next();break;case B:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),ln));break;default:this.isDelim(ic)?e.push(this.parseWithFallback(this.Rule,ln)):e.push(this.parseWithFallback(this.Declaration,ln))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Ki(e){this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")})}const sc=Object.freeze(Object.defineProperty({__proto__:null,generate:Ki,name:rc,parse:Gi,structure:oc},Symbol.toStringTag,{value:"Module"})),lc="Dimension",ac={value:String,unit:String};function Ji(){const e=this.tokenStart,t=this.consumeNumber(C);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function Zi(e){this.token(C,e.value+e.unit)}const cc=Object.freeze(Object.defineProperty({__proto__:null,generate:Zi,name:lc,parse:Ji,structure:ac},Symbol.toStringTag,{value:"Module"})),uc=47,hc="Feature",fc={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function tr(e){const t=this.tokenStart;let n,i=null;if(this.eat(E),this.skipSC(),n=this.consume(g),this.skipSC(),this.tokenType!==b){switch(this.eat(X),this.skipSC(),this.tokenType){case S:this.lookupNonWSType(1)===L?i=this.Ratio():i=this.Number();break;case C:i=this.Dimension();break;case g:i=this.Identifier();break;case v:i=this.parseWithFallback(()=>{const r=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(uc)&&this.error(),r},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(b),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:i}}function er(e){this.token(E,"("),this.token(g,e.name),e.value!==null&&(this.token(X,":"),this.node(e.value)),this.token(b,")")}const dc=Object.freeze(Object.defineProperty({__proto__:null,generate:er,name:hc,parse:tr,structure:fc},Symbol.toStringTag,{value:"Module"})),pc="FeatureFunction",mc={kind:String,feature:String,value:["Declaration","Selector"]};function gc(e,t){const n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function nr(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),i=gc.call(this,e,n.toLowerCase());this.skipSC();const r=this.parseWithFallback(()=>{const o=this.tokenIndex,l=i.call(this);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),l},()=>this.Raw(null,!1));return this.eof||this.eat(b),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:r}}function ir(e){this.token(v,e.feature+"("),this.node(e.value),this.token(b,")")}const yc=Object.freeze(Object.defineProperty({__proto__:null,generate:ir,name:pc,parse:nr,structure:mc},Symbol.toStringTag,{value:"Module"})),rr=47,kc=60,or=61,bc=62,Sc="FeatureRange",_c={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 an(){switch(this.skipSC(),this.tokenType){case S:return this.isDelim(rr,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case C:return this.Dimension();case g:return this.Identifier();case v:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(rr)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function sr(e){if(this.skipSC(),this.isDelim(kc)||this.isDelim(bc)){const t=this.source[this.tokenStart];return this.next(),this.isDelim(or)?(this.next(),t+"="):t}if(this.isDelim(or))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function lr(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(E);const n=an.call(this),i=sr.call(this,n.type==="Identifier"),r=an.call(this);let o=null,l=null;return this.lookupNonWSType(0)!==b&&(o=sr.call(this),l=an.call(this)),this.skipSC(),this.eat(b),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:i,middle:r,rightComparison:o,right:l}}function ar(e){this.token(E,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(b,")")}const vc=Object.freeze(Object.defineProperty({__proto__:null,generate:ar,name:Sc,parse:lr,structure:_c},Symbol.toStringTag,{value:"Module"})),wc="Function",Cc="function",xc={name:String,children:[[]]};function cr(e,t){const n=this.tokenStart,i=this.consumeFunctionName(),r=i.toLowerCase();let o;return o=t.hasOwnProperty(r)?t[r].call(this,t):e.call(this,t),this.eof||this.eat(b),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:i,children:o}}function ur(e){this.token(v,e.name+"("),this.children(e),this.token(b,")")}const Lc=Object.freeze(Object.defineProperty({__proto__:null,generate:ur,name:wc,parse:cr,structure:xc,walkContext:Cc},Symbol.toStringTag,{value:"Module"})),Ac="GeneralEnclosed",Pc={kind:String,function:[String,null],children:[[]]};function hr(e){const t=this.tokenStart;let n=null;this.tokenType===v?n=this.consumeFunctionName():this.eat(E);const i=this.parseWithFallback(()=>{const r=this.tokenIndex,o=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(r)===!1&&this.error(),o},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(b),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:i}}function fr(e){e.function?this.token(v,e.function+"("):this.token(E,"("),this.children(e),this.token(b,")")}const Tc=Object.freeze(Object.defineProperty({__proto__:null,generate:fr,name:Ac,parse:hr,structure:Pc},Symbol.toStringTag,{value:"Module"})),Ec="XXX",Oc="Hash",Dc={value:String};function dr(){const e=this.tokenStart;return this.eat(D),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function pr(e){this.token(D,"#"+e.value)}const Mc=Object.freeze(Object.defineProperty({__proto__:null,generate:pr,name:Oc,parse:dr,structure:Dc,xxx:Ec},Symbol.toStringTag,{value:"Module"})),Ic="Identifier",Rc={name:String};function mr(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(g)}}function gr(e){this.token(g,e.name)}const jc=Object.freeze(Object.defineProperty({__proto__:null,generate:gr,name:Ic,parse:mr,structure:Rc},Symbol.toStringTag,{value:"Module"})),Fc="IdSelector",$c={name:String};function yr(){const e=this.tokenStart;return this.eat(D),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function kr(e){this.token(L,"#"+e.name)}const zc=Object.freeze(Object.defineProperty({__proto__:null,generate:kr,name:Fc,parse:yr,structure:$c},Symbol.toStringTag,{value:"Module"})),Nc=46,Wc="Layer",Hc={name:String};function br(){let e=this.tokenStart,t=this.consume(g);for(;this.isDelim(Nc);)this.eat(L),t+="."+this.consume(g);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Sr(e){this.tokenize(e.name)}const Bc=Object.freeze(Object.defineProperty({__proto__:null,generate:Sr,name:Wc,parse:br,structure:Hc},Symbol.toStringTag,{value:"Module"})),Uc="LayerList",Vc={children:[["Layer"]]};function _r(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===ht);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function vr(e){this.children(e,()=>this.token(ht,","))}const qc=Object.freeze(Object.defineProperty({__proto__:null,generate:vr,name:Uc,parse:_r,structure:Vc},Symbol.toStringTag,{value:"Module"})),Qc="MediaQuery",Xc={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function wr(){const e=this.tokenStart;let t=null,n=null,i=null;if(this.skipSC(),this.tokenType===g&&this.lookupTypeNonSC(1)!==E){const r=this.consume(g),o=r.toLowerCase();switch(o==="not"||o==="only"?(this.skipSC(),t=o,n=this.consume(g)):n=r,this.lookupTypeNonSC(0)){case g:{this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break}case ft:case Z:case ht:case xt:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case g:case E:case v:{i=this.Condition("media");break}case ft:case Z:case xt:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:i}}function Cr(e){e.mediaType?(e.modifier&&this.token(g,e.modifier),this.token(g,e.mediaType),e.condition&&(this.token(g,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const Yc=Object.freeze(Object.defineProperty({__proto__:null,generate:Cr,name:Qc,parse:wr,structure:Xc},Symbol.toStringTag,{value:"Module"})),Gc="MediaQueryList",Kc={children:[["MediaQuery"]]};function xr(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===ht);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Lr(e){this.children(e,()=>this.token(ht,","))}const Jc=Object.freeze(Object.defineProperty({__proto__:null,generate:Lr,name:Gc,parse:xr,structure:Kc},Symbol.toStringTag,{value:"Module"})),Zc=38,tu="NestingSelector",eu={};function Ar(){const e=this.tokenStart;return this.eatDelim(Zc),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Pr(){this.token(L,"&")}const nu=Object.freeze(Object.defineProperty({__proto__:null,generate:Pr,name:tu,parse:Ar,structure:eu},Symbol.toStringTag,{value:"Module"})),iu="Nth",ru={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Tr(){this.skipSC();const e=this.tokenStart;let t=e,n=null,i;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?i=this.Identifier():i=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:i,selector:n}}function Er(e){this.node(e.nth),e.selector!==null&&(this.token(g,"of"),this.node(e.selector))}const ou=Object.freeze(Object.defineProperty({__proto__:null,generate:Er,name:iu,parse:Tr,structure:ru},Symbol.toStringTag,{value:"Module"})),su="Number",lu={value:String};function Or(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(S)}}function Dr(e){this.token(S,e.value)}const au=Object.freeze(Object.defineProperty({__proto__:null,generate:Dr,name:su,parse:Or,structure:lu},Symbol.toStringTag,{value:"Module"})),cu="Operator",uu={value:String};function Mr(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ir(e){this.tokenize(e.value)}const hu=Object.freeze(Object.defineProperty({__proto__:null,generate:Ir,name:cu,parse:Mr,structure:uu},Symbol.toStringTag,{value:"Module"})),fu="Parentheses",du={children:[[]]};function Rr(e,t){const n=this.tokenStart;let i=null;return this.eat(E),i=e.call(this,t),this.eof||this.eat(b),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:i}}function jr(e){this.token(E,"("),this.children(e),this.token(b,")")}const pu=Object.freeze(Object.defineProperty({__proto__:null,generate:jr,name:fu,parse:Rr,structure:du},Symbol.toStringTag,{value:"Module"})),mu="Percentage",gu={value:String};function Fr(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber($)}}function $r(e){this.token($,e.value+"%")}const yu=Object.freeze(Object.defineProperty({__proto__:null,generate:$r,name:mu,parse:Fr,structure:gu},Symbol.toStringTag,{value:"Module"})),ku="PseudoClassSelector",bu="function",Su={name:String,children:[["Raw"],null]};function zr(){const e=this.tokenStart;let t=null,n,i;return this.eat(X),this.tokenType===v?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==b?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(b)):n=this.consume(g),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Nr(e){this.token(X,":"),e.children===null?this.token(g,e.name):(this.token(v,e.name+"("),this.children(e),this.token(b,")"))}const _u=Object.freeze(Object.defineProperty({__proto__:null,generate:Nr,name:ku,parse:zr,structure:Su,walkContext:bu},Symbol.toStringTag,{value:"Module"})),vu="PseudoElementSelector",wu="function",Cu={name:String,children:[["Raw"],null]};function Wr(){const e=this.tokenStart;let t=null,n,i;return this.eat(X),this.eat(X),this.tokenType===v?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==b?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(b)):n=this.consume(g),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Hr(e){this.token(X,":"),this.token(X,":"),e.children===null?this.token(g,e.name):(this.token(v,e.name+"("),this.children(e),this.token(b,")"))}const xu=Object.freeze(Object.defineProperty({__proto__:null,generate:Hr,name:vu,parse:Wr,structure:Cu,walkContext:wu},Symbol.toStringTag,{value:"Module"})),Br=47;function Ur(){switch(this.skipSC(),this.tokenType){case S:return this.Number();case v:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const Lu="Ratio",Au={left:["Number","Function"],right:["Number","Function",null]};function Vr(){const e=this.tokenStart,t=Ur.call(this);let n=null;return this.skipSC(),this.isDelim(Br)&&(this.eatDelim(Br),n=Ur.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function qr(e){this.node(e.left),this.token(L,"/"),e.right?this.node(e.right):this.node(S,1)}const Pu=Object.freeze(Object.defineProperty({__proto__:null,generate:qr,name:Lu,parse:Vr,structure:Au},Symbol.toStringTag,{value:"Module"}));function Tu(){return this.tokenIndex>0&&this.lookupType(-1)===N?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Eu="Raw",Ou={value:String};function Qr(e,t){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?i=Tu.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function Xr(e){this.tokenize(e.value)}const Du=Object.freeze(Object.defineProperty({__proto__:null,generate:Xr,name:Eu,parse:Qr,structure:Ou},Symbol.toStringTag,{value:"Module"}));function Yr(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Mu(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==ft&&this.error(),e}const Iu="Rule",Ru="rule",ju={prelude:["SelectorList","Raw"],block:["Block"]};function Gr(){const e=this.tokenIndex,t=this.tokenStart;let n,i;return this.parseRulePrelude?n=this.parseWithFallback(Mu,Yr):n=Yr.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:i}}function Kr(e){this.node(e.prelude),this.node(e.block)}const Fu=Object.freeze(Object.defineProperty({__proto__:null,generate:Kr,name:Iu,parse:Gr,structure:ju,walkContext:Ru},Symbol.toStringTag,{value:"Module"})),$u="Scope",zu={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function Jr(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===E&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(b)),this.lookupNonWSType(0)===g&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(E),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(b)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function Zr(e){e.root&&(this.token(E,"("),this.node(e.root),this.token(b,")")),e.limit&&(this.token(g,"to"),this.token(E,"("),this.node(e.limit),this.token(b,")"))}const Nu=Object.freeze(Object.defineProperty({__proto__:null,generate:Zr,name:$u,parse:Jr,structure:zu},Symbol.toStringTag,{value:"Module"})),Wu="Selector",Hu={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function to(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function eo(e){this.children(e)}const Bu=Object.freeze(Object.defineProperty({__proto__:null,generate:eo,name:Wu,parse:to,structure:Hu},Symbol.toStringTag,{value:"Module"})),Uu="SelectorList",Vu="selector",qu={children:[["Selector","Raw"]]};function no(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===ht){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function io(e){this.children(e,()=>this.token(ht,","))}const Qu=Object.freeze(Object.defineProperty({__proto__:null,generate:io,name:Uu,parse:no,structure:qu,walkContext:Vu},Symbol.toStringTag,{value:"Module"})),cn=92,ro=34,Xu=39;function oo(e){const t=e.length,n=e.charCodeAt(0),i=n===ro||n===Xu?1:0,r=i===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let o="";for(let l=i;l<=r;l++){let c=e.charCodeAt(l);if(c===cn){if(l===r){l!==t-1&&(o=e.substr(l+1));break}if(c=e.charCodeAt(++l),kt(cn,c)){const a=l-1,s=Qt(e,a);l=s-1,o+=li(e.substring(a+1,s))}else c===13&&e.charCodeAt(l+1)===10&&l++}else o+=e[l]}return o}function Yu(e,t){const n=ro;let i="",r=!1;for(let o=0;o<e.length;o++){const l=e.charCodeAt(o);if(l===0){i+="�";continue}if(l<=31||l===127){i+="\\"+l.toString(16),r=!0;continue}l===n||l===cn?(i+="\\"+e.charAt(o),r=!1):(r&&(Vt(l)||Et(l))&&(i+=" "),i+=e.charAt(o),r=!1)}return'"'+i+'"'}const Gu="String",Ku={value:String};function so(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:oo(this.consume(wt))}}function lo(e){this.token(wt,Yu(e.value))}const Ju=Object.freeze(Object.defineProperty({__proto__:null,generate:lo,name:Gu,parse:so,structure:Ku},Symbol.toStringTag,{value:"Module"})),Zu=33;function ao(){return this.Raw(null,!1)}const th="StyleSheet",eh="stylesheet",nh={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function co(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case N:this.next();continue;case Y:if(this.charCodeAt(this.tokenStart+2)!==Zu){this.next();continue}n=this.Comment();break;case ve:n=this.CDO();break;case it:n=this.CDC();break;case B:n=this.parseWithFallback(this.Atrule,ao);break;default:n=this.parseWithFallback(this.Rule,ao)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function uo(e){this.children(e)}const ih=Object.freeze(Object.defineProperty({__proto__:null,generate:uo,name:th,parse:co,structure:nh,walkContext:eh},Symbol.toStringTag,{value:"Module"})),rh="SupportsDeclaration",oh={declaration:"Declaration"};function ho(){const e=this.tokenStart;this.eat(E),this.skipSC();const t=this.Declaration();return this.eof||this.eat(b),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function fo(e){this.token(E,"("),this.node(e.declaration),this.token(b,")")}const sh=Object.freeze(Object.defineProperty({__proto__:null,generate:fo,name:rh,parse:ho,structure:oh},Symbol.toStringTag,{value:"Module"})),lh=42,po=124;function un(){this.tokenType!==g&&this.isDelim(lh)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const ah="TypeSelector",ch={name:String};function mo(){const e=this.tokenStart;return this.isDelim(po)?(this.next(),un.call(this)):(un.call(this),this.isDelim(po)&&(this.next(),un.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function go(e){this.tokenize(e.name)}const uh=Object.freeze(Object.defineProperty({__proto__:null,generate:go,name:ah,parse:mo,structure:ch},Symbol.toStringTag,{value:"Module"})),yo=43,ko=45,hn=63;function se(e,t){let n=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){const r=this.charCodeAt(i);if(r===ko&&t&&n!==0)return se.call(this,e+n+1,!1),-1;Vt(r)||this.error(t&&n!==0?"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 Me(e){let t=0;for(;this.isDelim(hn);)++t>e&&this.error("Too many question marks"),this.next()}function hh(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===yo?"Plus sign":"Hyphen minus")+" is expected")}function fh(){let e=0;switch(this.tokenType){case S:if(e=se.call(this,1,!0),this.isDelim(hn)){Me.call(this,6-e);break}if(this.tokenType===C||this.tokenType===S){hh.call(this,ko),se.call(this,1,!1);break}break;case C:e=se.call(this,1,!0),e>0&&Me.call(this,6-e);break;default:if(this.eatDelim(yo),this.tokenType===g){e=se.call(this,0,!0),e>0&&Me.call(this,6-e);break}if(this.isDelim(hn)){this.next(),Me.call(this,5);break}this.error("Hex digit or question mark is expected")}}const dh="UnicodeRange",ph={value:String};function bo(){const e=this.tokenStart;return this.eatIdent("u"),fh.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function So(e){this.tokenize(e.value)}const mh=Object.freeze(Object.defineProperty({__proto__:null,generate:So,name:dh,parse:bo,structure:ph},Symbol.toStringTag,{value:"Module"})),gh=32,fn=92,yh=34,kh=39,bh=40,_o=41;function Sh(e){const t=e.length;let n=4,i=e.charCodeAt(t-1)===_o?t-2:t-1,r="";for(;n<i&&Et(e.charCodeAt(n));)n++;for(;n<i&&Et(e.charCodeAt(i));)i--;for(let o=n;o<=i;o++){let l=e.charCodeAt(o);if(l===fn){if(o===i){o!==t-1&&(r=e.substr(o+1));break}if(l=e.charCodeAt(++o),kt(fn,l)){const c=o-1,a=Qt(e,c);o=a-1,r+=li(e.substring(c+1,a))}else l===13&&e.charCodeAt(o+1)===10&&o++}else r+=e[o]}return r}function _h(e){let t="",n=!1;for(let i=0;i<e.length;i++){const r=e.charCodeAt(i);if(r===0){t+="�";continue}if(r<=31||r===127){t+="\\"+r.toString(16),n=!0;continue}r===gh||r===fn||r===yh||r===kh||r===bh||r===_o?(t+="\\"+e.charAt(i),n=!1):(n&&Vt(r)&&(t+=" "),t+=e.charAt(i),n=!1)}return"url("+t+")"}const vh="Url",wh={value:String};function vo(){const e=this.tokenStart;let t;switch(this.tokenType){case Q:t=Sh(this.consume(Q));break;case v:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(v),this.skipSC(),t=oo(this.consume(wt)),this.skipSC(),this.eof||this.eat(b);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function wo(e){this.token(Q,_h(e.value))}const Ch=Object.freeze(Object.defineProperty({__proto__:null,generate:wo,name:vh,parse:vo,structure:wh},Symbol.toStringTag,{value:"Module"})),xh="Value",Lh={children:[[]]};function Co(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function xo(e){this.children(e)}const Ah=Object.freeze(Object.defineProperty({__proto__:null,generate:xo,name:xh,parse:Co,structure:Lh},Symbol.toStringTag,{value:"Module"})),Ph=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Th="WhiteSpace",Eh={value:String};function Lo(){return this.eat(N),Ph}function Ao(e){this.token(N,e.value)}const Oh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ao,name:Th,parse:Lo,structure:Eh},Symbol.toStringTag,{value:"Module"})),Dh=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:Bl,Atrule:Xl,AtrulePrelude:Jl,AttributeSelector:sa,Block:fa,Brackets:ma,CDC:ka,CDO:_a,ClassSelector:xa,Combinator:Oa,Comment:ja,Condition:Wa,Declaration:nc,DeclarationList:sc,Dimension:cc,Feature:dc,FeatureFunction:yc,FeatureRange:vc,Function:Lc,GeneralEnclosed:Tc,Hash:Mc,IdSelector:zc,Identifier:jc,Layer:Bc,LayerList:qc,MediaQuery:Yc,MediaQueryList:Jc,NestingSelector:nu,Nth:ou,Number:au,Operator:hu,Parentheses:pu,Percentage:yu,PseudoClassSelector:_u,PseudoElementSelector:xu,Ratio:Pu,Raw:Du,Rule:Fu,Scope:Nu,Selector:Bu,SelectorList:Qu,String:Ju,StyleSheet:ih,SupportsDeclaration:sh,TypeSelector:uh,UnicodeRange:mh,Url:Ch,Value:Ah,WhiteSpace:Oh},Symbol.toStringTag,{value:"Module"})),Mh={node:Dh},At=Al(Mh),dn=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function le(e){return dn.includes(e)}const pn=["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"];function Ih(e){return pn.includes(e)}const mn=["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 Po(e){return mn.includes(e)}const To=["justify-self","align-self","place-self"];function Rh(e){return To.includes(e)}const Eo=[...dn,...pn,...mn,...To,"position-anchor","position-area"],jh=[...mn,...dn,...pn];function Oo(e){return jh.includes(e)}const Fh=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function Do(e){return Fh.includes(e)}const $h=["width","height","block","inline","self-block","self-inline"];function zh(e){return $h.includes(e)}const Mo=new Set(["Atrule","Selector","Declaration"]);function Nh(e){const t=new SourceMapGenerator,n={line:1,column:0},i={line:0,column:0},r={line:1,column:0},o={generated:r};let l=1,c=0,a=!1;const s=e.node;e.node=function(f){if(f.loc&&f.loc.start&&Mo.has(f.type)){const d=f.loc.start.line,p=f.loc.start.column-1;(i.line!==d||i.column!==p)&&(i.line=d,i.column=p,n.line=l,n.column=c,a&&(a=!1,(n.line!==r.line||n.column!==r.column)&&t.addMapping(o)),a=!0,t.addMapping({source:f.loc.source,original:i,generated:n}))}s.call(this,f),a&&Mo.has(f.type)&&(r.line=l,r.column=c)};const u=e.emit;e.emit=function(f,d,p){for(let m=0;m<f.length;m++)f.charCodeAt(m)===10?(l++,c=0):c++;u(f,d,p)};const h=e.result;return e.result=function(){return a&&t.addMapping(o),{css:h(),map:t}},e}const Wh=43,Hh=45,gn=(e,t)=>{if(e===L&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},Io=[[g,g],[g,v],[g,Q],[g,ut],[g,"-"],[g,S],[g,$],[g,C],[g,it],[g,E],[B,g],[B,v],[B,Q],[B,ut],[B,"-"],[B,S],[B,$],[B,C],[B,it],[D,g],[D,v],[D,Q],[D,ut],[D,"-"],[D,S],[D,$],[D,C],[D,it],[C,g],[C,v],[C,Q],[C,ut],[C,"-"],[C,S],[C,$],[C,C],[C,it],["#",g],["#",v],["#",Q],["#",ut],["#","-"],["#",S],["#",$],["#",C],["#",it],["-",g],["-",v],["-",Q],["-",ut],["-","-"],["-",S],["-",$],["-",C],["-",it],[S,g],[S,v],[S,Q],[S,ut],[S,S],[S,$],[S,C],[S,"%"],[S,it],["@",g],["@",v],["@",Q],["@",ut],["@","-"],["@",it],[".",S],[".",$],[".",C],["+",S],["+",$],["+",C],["/","*"]],Bh=Io.concat([[g,D],[C,D],[D,D],[B,E],[B,wt],[B,X],[$,$],[$,C],[$,v],[$,"-"],[b,g],[b,v],[b,$],[b,C],[b,D],[b,"-"]]);function Ro(e){const t=new Set(e.map(([n,i])=>gn(n)<<16|gn(i)));return function(n,i,r){const o=gn(i,r),l=r.charCodeAt(0);return(l===Hh&&i!==g&&i!==v&&i!==it||l===Wh?t.has(n<<16|l<<8):t.has(n<<16|o))&&this.emit(" ",N,!0),o}}const Uh=Ro(Io),jo=Ro(Bh),Fo=Object.freeze(Object.defineProperty({__proto__:null,safe:jo,spec:Uh},Symbol.toStringTag,{value:"Module"})),Vh=92;function qh(e,t){if(typeof t=="function"){let n=null;e.children.forEach(i=>{n!==null&&t.call(this,n),this.node(i),n=i});return}e.children.forEach(this.node,this)}function Qh(e){di(e,(t,n,i)=>{this.token(t,e.slice(n,i))})}function Xh(e){const t=new Map;for(let[n,i]of Object.entries(e.node))typeof(i.generate||i)=="function"&&t.set(n,i.generate||i);return function(n,i){let r="",o=0,l={node(a){if(t.has(a.type))t.get(a.type).call(c,a);else throw new Error("Unknown node type: "+a.type)},tokenBefore:jo,token(a,s){o=this.tokenBefore(o,a,s),this.emit(s,a,!1),a===L&&s.charCodeAt(0)===Vh&&this.emit(`
|
|
16
|
-
`,
|
|
17
|
-
`)}})}const
|
|
15
|
+
`;this._injectStyles(d)}_injectStyles(t){const n=this._shadowHost();n?.shadowRoot?(this._adoptedSheet||(this._adoptedSheet=new CSSStyleSheet,n.shadowRoot.adoptedStyleSheets=[...n.shadowRoot.adoptedStyleSheets,this._adoptedSheet]),this._adoptedSheet.replaceSync(t)):(this._styleEl?.remove(),this._styleEl=document.createElement("style"),this._styleEl.setAttribute("data-rc-anchor-style",this._uid),this._styleEl.textContent=t,document.head.appendChild(this._styleEl))}_positionFallback(){const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",r=this._opts.offset??4,s=t.getBoundingClientRect(),l=window.innerWidth,c=window.innerHeight;n.style.position="fixed",n.style.boxSizing="border-box",n.style.minWidth=`${s.width}px`;const a=i.startsWith("bottom")||i==="bottom",o=c-s.bottom;a&&o<120&&s.top>o?(n.style.top="",n.style.bottom=`${c-s.top+r}px`):(n.style.bottom="",n.style.top=`${s.bottom+r}px`);const u=i.endsWith("-end"),f=n.offsetWidth||parseFloat(getComputedStyle(n).minWidth)||0;let d=u?s.right-f:s.left;d+f>l-4&&(d=s.right-f),d=Math.max(4,Math.min(d,l-f-4)),n.style.left=`${d}px`}_cleanup(){const t=this._anchor(),n=this._floating();t&&t.style.removeProperty("anchor-name"),n&&n.removeAttribute("data-rc-anchor"),this._styleEl?.remove(),this._styleEl=null;const i=this._shadowHost();i?.shadowRoot&&this._adoptedSheet&&(i.shadowRoot.adoptedStyleSheets=i.shadowRoot.adoptedStyleSheets.filter(r=>r!==this._adoptedSheet),this._adoptedSheet=null)}}class Uo{constructor(t,n){this._attached=null,this._scrolled=!1,this._onScroll=()=>this._evaluate(),this._host=t,this._opts=n,t.addController(this)}get scrolled(){return this._scrolled}setOptions(t){this._detach(),Object.assign(this._opts,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._opts;return typeof t=="function"?t():t??null}_attach(){if(this._opts.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._attached=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._evaluate())}_detach(){this._attached?.removeEventListener("scroll",this._onScroll),this._attached=null,this._lastScrollTop=void 0}_scrollTop(){const t=this._attached;return t instanceof Element?t.scrollTop:t instanceof Document?t.scrollingElement?.scrollTop??0:t?.scrollY??0}_evaluate(){if(!this._attached)return;const t=this._scrollTop(),n=t-(this._lastScrollTop??t);this._lastScrollTop=t,this._opts.onScroll?.(t,n);const i=t>(this._opts.threshold??4);i!==this._scrolled&&(this._scrolled=i,this._opts.onChange?.(i,t),this._host.requestUpdate())}}class Vo{constructor(t,n){this._attached=null,this._observer=null,this._options=n,t.addController(this)}setOptions(t){this._detach(),Object.assign(this._options,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._options;return typeof t=="function"?t():t??null}_attach(){if(this._options.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._observer??=new MutationObserver(this._options.callback),this._observer.observe(t,this._options.observerOptions??{childList:!0}),this._attached=t)}_detach(){this._observer?.disconnect(),this._attached=null}}class qo{constructor(t){this._callback=null,this._frame=0,t?.addController(this)}get pending(){return this._frame!==0}schedule(t){this._callback=t,!this._frame&&(this._frame=requestAnimationFrame(n=>{const i=this._callback;this._frame=0,this._callback=null,i?.(n)}))}cancel(){this._frame&&(cancelAnimationFrame(this._frame),this._frame=0,this._callback=null)}hostDisconnected(){this.cancel()}}class Xo{constructor(t){this._buffer="",this._timer=0,this._options=t}get buffer(){return this._buffer}reset(){this._buffer="",this._clearTimer()}handleKeydown(t){return t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey?!1:(this.search(t.key),t.preventDefault(),!0)}search(t){this._buffer+=t.toLocaleLowerCase(),this._scheduleReset();const n=this._options.items();if(!n.length)return null;const i=this._options.startIndex?.()??0,r=n.length;for(let s=1;s<=r;s+=1){const l=(i+s)%r,c=n[l];if(this._options.text(c).trim().toLocaleLowerCase().startsWith(this._buffer))return this._options.onMatch(c,l),c}return null}_scheduleReset(){this._clearTimer(),this._timer=window.setTimeout(()=>this.reset(),this._options.timeout??500)}_clearTimer(){this._timer&&(window.clearTimeout(this._timer),this._timer=0)}}function Yo(e){let t=e.parentElement;for(;t&&t!==document.documentElement;){const{overflow:n,overflowY:i}=getComputedStyle(t);if(/auto|scroll/.test(i)||/auto|scroll/.test(n))return t;t=t.parentElement}return document.scrollingElement??document.documentElement}function jn(e){return e==null||e.hasAttribute("disabled")?!1:!!((e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e.hasAttribute("tabindex")||e.shadowRoot?.delegatesFocus===!0)}function Fn(e,t){return e.querySelector(t)}function $n(e,t){return Array.from(e.querySelectorAll(t))}function Qo(e,t){if($n(e,t.selector).length>=(t.minimum??1))return!1;const n=t.hostName??e.localName,i=t.childDescription??t.selector.replace(":scope > ",""),r=t.message??`[${n}] No direct child ${i} found. Place ${i} inside <${n}>.`;return console.warn(r,e),!0}class Ko{constructor(t,n){this._observer=null,this._child=null,this._host=t,this._options=n,t.addController(this)}get child(){return this._child}hostConnected(){if(this.sync(),!this._options.observe)return;this._observer??=new MutationObserver(()=>this.sync());const t=this._options.observe===!0?{childList:!0}:this._options.observe;this._observer.observe(this._host,t)}hostDisconnected(){this._observer?.disconnect(),this._child=null}sync(){const t=this._child,n=Fn(this._host,this._options.selector);return this._child=n,n||this._options.onMissing?.(this._host),n!==t&&this._options.onChange?.(n,t),n}}var Go=Object.defineProperty,Jo=(e,t,n,i)=>{for(var r=void 0,s=e.length-1,l;s>=0;s--)(l=e[s])&&(r=l(t,n,r)||r);return r&&Go(t,n,r),r};function Zo(e){class t extends e{constructor(){super(...arguments),this._items=[]}get items(){return this._items.map(i=>i.deref()).filter(i=>jn(i))}get firstItem(){return this.items.at(0)}get lastItem(){return this.items.at(-1)}get nextItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i+1)%this.items.length)}get previousItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i-1)%this.items.length)}focusItem(i){i?.focus()}focusItemAt(i){this.focusItem(this.items.at(i))}focusFirst(){this.focusItem(this.firstItem)}focusLast(){this.focusItem(this.lastItem)}_collectItems(i){return i.assignedElements()}_handleItemFocus(i){const r=i.composedPath().find(s=>this.items.includes(s));r!=null&&(this._lastFocused=r,this.items.forEach(s=>s.setAttribute("tabindex","-1")),r.setAttribute("tabindex","0"))}_onSlotChange(i){const r=this._items;this._items=this._collectItems(i.currentTarget).map(s=>new WeakRef(s)),queueMicrotask(()=>{this.isConnected&&(r.forEach(s=>s.deref()?.removeAttribute("tabindex")),this._initItems())})}_initItems(){this._items.forEach(r=>r.deref()?.setAttribute("tabindex","-1"));const i=this.items[0];i&&i.setAttribute("tabindex","0")}}return Jo([To.state()],t.prototype,"_lastFocused"),t}function tl(e,t,n,i){const r=Math.min(Math.max(e,t),n);if(i<=0)return r;const s=Math.round((r-t)/i)*i+t;return Math.min(Math.max(s,t),n)}function el(e,t,n){return n===t?0:Math.min(Math.max((e-t)/(n-t),0),1)}var nl=Object.defineProperty,il=Object.defineProperties,rl=Object.getOwnPropertyDescriptors,Nn=Object.getOwnPropertySymbols,sl=Object.prototype.hasOwnProperty,ol=Object.prototype.propertyIsEnumerable,zn=(e,t,n)=>t in e?nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))sl.call(t,n)&&zn(e,n,t[n]);if(Nn)for(var n of Nn(t))ol.call(t,n)&&zn(e,n,t[n]);return e},J=(e,t)=>il(e,rl(t)),P=(e,t,n)=>new Promise((i,r)=>{var s=a=>{try{c(n.next(a))}catch(o){r(o)}},l=a=>{try{c(n.throw(a))}catch(o){r(o)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,l);c((n=n.apply(e,t)).next())});const Be=Math.min,zt=Math.max,me=Math.round,ge=Math.floor,mt=e=>({x:e,y:e});function ll(e,t){return typeof e=="function"?e(t):e}function al(e){return U({top:0,right:0,bottom:0,left:0},e)}function cl(e){return typeof e!="number"?al(e):{top:e,right:e,bottom:e,left:e}}function ye(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function hl(e,t){return P(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:l,elements:c,strategy:a}=e,{boundary:o="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:d=0}=ll(t,e),p=cl(d),m=c[f?u==="floating"?"reference":"floating":u],y=ye(yield s.getClippingRect({element:(n=yield s.isElement==null?void 0:s.isElement(m))==null||n?m:m.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:o,rootBoundary:h,strategy:a})),b=u==="floating"?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,x=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),w=(yield s.isElement==null?void 0:s.isElement(x))?(yield s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},T=ye(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:x,strategy:a}):b);return{top:(y.top-T.top+p.top)/w.y,bottom:(T.bottom-y.bottom+p.bottom)/w.y,left:(y.left-T.left+p.left)/w.x,right:(T.right-y.right+p.right)/w.x}})}function be(){return typeof window<"u"}function Wt(e){return Wn(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Wn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wn(e){return be()?e instanceof Node||e instanceof et(e).Node:!1}function at(e){return be()?e instanceof Element||e instanceof et(e).Element:!1}function yt(e){return be()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Bn(e){return!be()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const ul=new Set(["inline","contents"]);function ie(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!ul.has(r)}const fl=new Set(["table","td","th"]);function dl(e){return fl.has(Wt(e))}const pl=[":popover-open",":modal"];function ke(e){return pl.some(t=>{try{return e.matches(t)}catch{return!1}})}const ml=["transform","translate","scale","rotate","perspective"],gl=["transform","translate","scale","rotate","perspective","filter"],yl=["paint","layout","strict","content"];function He(e){const t=Ue(),n=at(e)?ct(e):e;return ml.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||gl.some(i=>(n.willChange||"").includes(i))||yl.some(i=>(n.contain||"").includes(i))}function bl(e){let t=Ct(e);for(;yt(t)&&!Bt(t);){if(He(t))return t;if(ke(t))return null;t=Ct(t)}return null}function Ue(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const kl=new Set(["html","body","#document"]);function Bt(e){return kl.has(Wt(e))}function ct(e){return et(e).getComputedStyle(e)}function _e(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(Wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bn(e)&&e.host||gt(e);return Bn(t)?t.host:t}function Hn(e){const t=Ct(e);return Bt(t)?e.ownerDocument?e.ownerDocument.body:e.body:yt(t)&&ie(t)?t:Hn(t)}function re(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Hn(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),l=et(r);if(s){const c=Ve(l);return t.concat(l,l.visualViewport||[],ie(r)?r:[],c&&n?re(c):[])}return t.concat(r,re(r,[],n))}function Ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Un(e){const t=ct(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=yt(e),s=r?e.offsetWidth:n,l=r?e.offsetHeight:i,c=me(n)!==s||me(i)!==l;return c&&(n=s,i=l),{width:n,height:i,$:c}}function qe(e){return at(e)?e:e.contextElement}function Ht(e){const t=qe(e);if(!yt(t))return mt(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=Un(t);let l=(s?me(n.width):n.width)/i,c=(s?me(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const _l=mt(0);function Vn(e){const t=et(e);return!Ue()||!t.visualViewport?_l:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function Pt(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=qe(e);let l=mt(1);t&&(i?at(i)&&(l=Ht(i)):l=Ht(e));const c=Sl(s,n,i)?Vn(s):mt(0);let a=(r.left+c.x)/l.x,o=(r.top+c.y)/l.y,h=r.width/l.x,u=r.height/l.y;if(s){const f=et(s),d=i&&at(i)?et(i):i;let p=f,m=Ve(p);for(;m&&i&&d!==p;){const y=Ht(m),b=m.getBoundingClientRect(),x=ct(m),w=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,T=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;a*=y.x,o*=y.y,h*=y.x,u*=y.y,a+=w,o+=T,p=et(m),m=Ve(p)}}return ye({width:h,height:u,x:a,y:o})}function Se(e,t){const n=_e(e).scrollLeft;return t?t.left+n:Pt(gt(e)).left+n}function qn(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Se(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function vl(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",l=gt(i),c=t?ke(t.floating):!1;if(i===l||c&&s)return n;let a={scrollLeft:0,scrollTop:0},o=mt(1);const h=mt(0),u=yt(i);if((u||!u&&!s)&&((Wt(i)!=="body"||ie(l))&&(a=_e(i)),yt(i))){const d=Pt(i);o=Ht(i),h.x=d.x+i.clientLeft,h.y=d.y+i.clientTop}const f=l&&!u&&!s?qn(l,a):mt(0);return{width:n.width*o.x,height:n.height*o.y,x:n.x*o.x-a.scrollLeft*o.x+h.x+f.x,y:n.y*o.y-a.scrollTop*o.y+h.y+f.y}}function wl(e){return Array.from(e.getClientRects())}function Cl(e){const t=gt(e),n=_e(e),i=e.ownerDocument.body,r=zt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=zt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+Se(e);const c=-n.scrollTop;return ct(i).direction==="rtl"&&(l+=zt(t.clientWidth,i.clientWidth)-r),{width:r,height:s,x:l,y:c}}const Xn=25;function xl(e,t){const n=et(e),i=gt(e),r=n.visualViewport;let s=i.clientWidth,l=i.clientHeight,c=0,a=0;if(r){s=r.width,l=r.height;const h=Ue();(!h||h&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const o=Se(i);if(o<=0){const h=i.ownerDocument,u=h.body,f=getComputedStyle(u),d=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(i.clientWidth-u.clientWidth-d);p<=Xn&&(s-=p)}else o<=Xn&&(s+=o);return{width:s,height:l,x:c,y:a}}const Ll=new Set(["absolute","fixed"]);function Al(e,t){const n=Pt(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=yt(e)?Ht(e):mt(1),l=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,o=i*s.y;return{width:l,height:c,x:a,y:o}}function Yn(e,t,n){let i;if(t==="viewport")i=xl(e,n);else if(t==="document")i=Cl(gt(e));else if(at(t))i=Al(t,n);else{const r=Vn(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ye(i)}function Qn(e,t){const n=Ct(e);return n===t||!at(n)||Bt(n)?!1:ct(n).position==="fixed"||Qn(n,t)}function Tl(e,t){const n=t.get(e);if(n)return n;let i=re(e,[],!1).filter(c=>at(c)&&Wt(c)!=="body"),r=null;const s=ct(e).position==="fixed";let l=s?Ct(e):e;for(;at(l)&&!Bt(l);){const c=ct(l),a=He(l);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&r&&Ll.has(r.position)||ie(l)&&!a&&Qn(e,l))?i=i.filter(o=>o!==l):r=c,l=Ct(l)}return t.set(e,i),i}function El(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const s=[...n==="clippingAncestors"?ke(t)?[]:Tl(t,this._c):[].concat(n),i],l=s[0],c=s.reduce((a,o)=>{const h=Yn(t,o,r);return a.top=zt(h.top,a.top),a.right=Be(h.right,a.right),a.bottom=Be(h.bottom,a.bottom),a.left=zt(h.left,a.left),a},Yn(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Pl(e){const{width:t,height:n}=Un(e);return{width:t,height:n}}function Ol(e,t,n){const i=yt(t),r=gt(t),s=n==="fixed",l=Pt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=mt(0);function o(){a.x=Se(r)}if(i||!i&&!s)if((Wt(t)!=="body"||ie(r))&&(c=_e(t)),i){const d=Pt(t,!0,s,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else r&&o();s&&!i&&r&&o();const h=r&&!i&&!s?qn(r,c):mt(0),u=l.left+c.scrollLeft-a.x-h.x,f=l.top+c.scrollTop-a.y-h.y;return{x:u,y:f,width:l.width,height:l.height}}function Xe(e){return ct(e).position==="static"}function Kn(e,t){if(!yt(e)||ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function Gn(e,t){const n=et(e);if(ke(e))return n;if(!yt(e)){let r=Ct(e);for(;r&&!Bt(r);){if(at(r)&&!Xe(r))return r;r=Ct(r)}return n}let i=Kn(e,t);for(;i&&dl(i)&&Xe(i);)i=Kn(i,t);return i&&Bt(i)&&Xe(i)&&!He(i)?n:i||bl(e)||n}const Dl=function(e){return P(this,null,function*(){const t=this.getOffsetParent||Gn,n=this.getDimensions,i=yield n(e.floating);return{reference:Ol(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Ml(e){return ct(e).direction==="rtl"}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:vl,getDocumentElement:gt,getClippingRect:El,getOffsetParent:Gn,getElementRects:Dl,getClientRects:wl,getDimensions:Pl,getScale:Ht,isElement:at,isRTL:Ml};function Jn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Il(e,t){let n=null,i;const r=gt(e);function s(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function l(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const o=e.getBoundingClientRect(),{left:h,top:u,width:f,height:d}=o;if(c||t(),!f||!d)return;const p=ge(u),m=ge(r.clientWidth-(h+f)),y=ge(r.clientHeight-(u+d)),b=ge(h),x={rootMargin:-p+"px "+-m+"px "+-y+"px "+-b+"px",threshold:zt(0,Be(1,a))||1};let w=!0;function T(pt){const S=pt[0].intersectionRatio;if(S!==a){if(!w)return l();S?l(!1,S):i=setTimeout(()=>{l(!1,1e-7)},1e3)}S===1&&!Jn(o,e.getBoundingClientRect())&&l(),w=!1}try{n=new IntersectionObserver(T,J(U({},x),{root:r.ownerDocument}))}catch{n=new IntersectionObserver(T,x)}n.observe(e)}return l(!0),s}function Ye(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,o=qe(e),h=r||s?[...o?re(o):[],...re(t)]:[];h.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const u=o&&c?Il(o,n):null;let f=-1,d=null;l&&(d=new ResizeObserver(b=>{let[x]=b;x&&x.target===o&&d&&(d.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),o&&!a&&d.observe(o),d.observe(t));let p,m=a?Pt(e):null;a&&y();function y(){const b=Pt(e);m&&!Jn(m,b)&&n(),m=b,p=requestAnimationFrame(y)}return n(),()=>{var b;h.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u?.(),(b=d)==null||b.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const Rl=hl,{hasOwnProperty:Qe}=Object.prototype,se=function(){};function Zn(e){return typeof e=="function"?e:se}function ti(e,t){return function(n,i,r){n.type===t&&e.call(this,n,i,r)}}function jl(e,t){const n=t.structure,i=[];for(const r in n){if(Qe.call(n,r)===!1)continue;let s=n[r];const l={name:r,type:!1,nullable:!1};Array.isArray(s)||(s=[s]);for(const c of s)c===null?l.nullable=!0:typeof c=="string"?l.type="node":Array.isArray(c)&&(l.type="list");l.type&&i.push(l)}return i.length?{context:t.walkContext,fields:i}:null}function Fl(e){const t={};for(const n in e.node)if(Qe.call(e.node,n)){const i=e.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=jl(n,i)}return t}function ei(e,t){const n=e.fields.slice(),i=e.context,r=typeof i=="string";return t&&n.reverse(),function(s,l,c,a){let o;r&&(o=l[i],l[i]=s);for(const h of n){const u=s[h.name];if(!h.nullable||u){if(h.type==="list"){if(t?u.reduceRight(a,!1):u.reduce(a,!1))return!0}else if(c(u))return!0}}r&&(l[i]=o)}}function ni({StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:r}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:r}}}function $l(e){const t=Fl(e),n={},i={},r=Symbol("break-walk"),s=Symbol("skip-node");for(const o in t)Qe.call(t,o)&&t[o]!==null&&(n[o]=ei(t[o],!1),i[o]=ei(t[o],!0));const l=ni(n),c=ni(i),a=function(o,h){function u(b,x,w){const T=f.call(y,b,x,w);return T===r?!0:T===s?!1:!!(p.hasOwnProperty(b.type)&&p[b.type](b,y,u,m)||d.call(y,b,x,w)===r)}let f=se,d=se,p=n,m=(b,x,w,T)=>b||u(x,w,T);const y={break:r,skip:s,root:o,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof h=="function")f=h;else if(h&&(f=Zn(h.enter),d=Zn(h.leave),h.reverse&&(p=i),h.visit)){if(l.hasOwnProperty(h.visit))p=h.reverse?c[h.visit]:l[h.visit];else if(!t.hasOwnProperty(h.visit))throw new Error("Bad value `"+h.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=ti(f,h.visit),d=ti(d,h.visit)}if(f===se&&d===se)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");u(o)};return a.break=r,a.skip=s,a.find=function(o,h){let u=null;return a(o,function(f,d,p){if(h.call(this,f,d,p))return u=f,r}),u},a.findLast=function(o,h){let u=null;return a(o,{reverse:!0,enter(f,d,p){if(h.call(this,f,d,p))return u=f,r}}),u},a.findAll=function(o,h){const u=[];return a(o,function(f,d,p){h.call(this,f,d,p)&&u.push(f)}),u},a}const xt=0,g=1,v=2,H=3,M=4,wt=5,Nl=6,X=7,ht=8,A=9,_=10,N=11,C=12,z=13,ve=14,it=15,Y=16,Z=17,ut=18,Ut=19,oe=20,O=21,k=22,ft=23,Vt=24,Q=25,zl=0;function rt(e){return e>=48&&e<=57}function qt(e){return rt(e)||e>=65&&e<=70||e>=97&&e<=102}function Ke(e){return e>=65&&e<=90}function Wl(e){return e>=97&&e<=122}function Bl(e){return Ke(e)||Wl(e)}function Hl(e){return e>=128}function we(e){return Bl(e)||Hl(e)||e===95}function ii(e){return we(e)||rt(e)||e===45}function Ul(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ce(e){return e===10||e===13||e===12}function Ot(e){return Ce(e)||e===32||e===9}function bt(e,t){return!(e!==92||Ce(t)||t===zl)}function Ge(e,t,n){return e===45?we(t)||t===45||bt(t,n):we(e)?!0:e===92?bt(e,t):!1}function Je(e,t,n){return e===43||e===45?rt(t)?2:t===46&&rt(n)?3:0:e===46?rt(t)?2:0:rt(e)?1:0}function ri(e){return e===65279||e===65534?1:0}const Ze=new Array(128),Vl=128,xe=130,si=131,tn=132,oi=133;for(let e=0;e<Ze.length;e++)Ze[e]=Ot(e)&&xe||rt(e)&&si||we(e)&&tn||Ul(e)&&oi||e||Vl;function en(e){return e<128?Ze[e]:tn}function Xt(e,t){return t<e.length?e.charCodeAt(t):0}function nn(e,t,n){return n===13&&Xt(e,t+1)===10?2:1}function li(e,t,n){let i=e.charCodeAt(t);return Ke(i)&&(i=i|32),i===n}function Le(e,t,n,i){if(n-t!==i.length||t<0||n>e.length)return!1;for(let r=t;r<n;r++){const s=i.charCodeAt(r-t);let l=e.charCodeAt(r);if(Ke(l)&&(l=l|32),l!==s)return!1}return!0}function ql(e,t){for(;t>=0&&Ot(e.charCodeAt(t));t--);return t+1}function Ae(e,t){for(;t<e.length&&Ot(e.charCodeAt(t));t++);return t}function rn(e,t){for(;t<e.length&&rt(e.charCodeAt(t));t++);return t}function Yt(e,t){if(t+=2,qt(Xt(e,t-1))){for(const i=Math.min(e.length,t+5);t<i&&qt(Xt(e,t));t++);const n=Xt(e,t);Ot(n)&&(t+=nn(e,t,n))}return t}function Te(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!ii(n)){if(bt(n,Xt(e,t+1))){t=Yt(e,t)-1;continue}break}}return t}function ai(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),rt(n)&&(t=rn(e,t+1),n=e.charCodeAt(t)),n===46&&rt(e.charCodeAt(t+1))&&(t+=2,t=rn(e,t)),li(e,t,101)){let i=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(i=1,n=e.charCodeAt(t+2)),rt(n)&&(t=rn(e,t+1+i+1))}return t}function sn(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}bt(n,Xt(e,t+1))&&(t=Yt(e,t))}return t}function ci(e){if(e.length===1&&!qt(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const hi=["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"],Xl=16*1024;function Ee(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,Xl)):e}const ui=10,Yl=12,fi=13;function di(e){const t=e.source,n=t.length,i=t.length>0?ri(t.charCodeAt(0)):0,r=Ee(e.lines,n),s=Ee(e.columns,n);let l=e.startLine,c=e.startColumn;for(let a=i;a<n;a++){const o=t.charCodeAt(a);r[a]=l,s[a]=c++,(o===ui||o===fi||o===Yl)&&(o===fi&&a+1<n&&t.charCodeAt(a+1)===ui&&(a++,r[a]=l,s[a]=c),l++,c=1)}r[n]=l,s[n]=c,e.lines=r,e.columns=s,e.computed=!0}class Ql{constructor(t,n,i,r){this.setSource(t,n,i,r),this.lines=null,this.columns=null}setSource(t="",n=0,i=1,r=1){this.source=t,this.startOffset=n,this.startLine=i,this.startColumn=r,this.computed=!1}getLocation(t,n){return this.computed||di(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,i){return this.computed||di(this),{source:i,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const kt=16777215,_t=24,Dt=new Uint8Array(32);Dt[v]=k,Dt[O]=k,Dt[Ut]=oe,Dt[ft]=Vt;function pi(e){return Dt[e]!==0}class Kl{constructor(t,n){this.setSource(t,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",n=()=>{}){t=String(t||"");const i=t.length,r=Ee(this.offsetAndType,t.length+1),s=Ee(this.balance,t.length+1);let l=0,c=-1,a=0,o=t.length;this.offsetAndType=null,this.balance=null,s.fill(0),n(t,(h,u,f)=>{const d=l++;if(r[d]=h<<_t|f,c===-1&&(c=u),s[d]=o,h===a){const p=s[o];s[o]=d,o=p,a=Dt[r[p]>>_t]}else pi(h)&&(o=d,a=Dt[h])}),r[l]=xt<<_t|i,s[l]=l;for(let h=0;h<l;h++){const u=s[h];if(u<=h){const f=s[u];f!==h&&(s[h]=f)}else u>l&&(s[h]=l)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=l,this.offsetAndType=r,this.balance=s,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>_t:xt}lookupTypeNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>_t;if(i!==z&&i!==Q&&t--===0)return i}return xt}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&kt:this.source.length}lookupOffsetNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>_t;if(i!==z&&i!==Q&&t--===0)return n-this.tokenIndex}return xt}lookupValue(t,n){return t+=this.tokenIndex,t<this.tokenCount?Le(this.source,this.offsetAndType[t-1]&kt,this.offsetAndType[t]&kt,n):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&kt:this.offsetAndType[this.tokenCount]&kt:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,n){return n?this.lookupType(n)===A&&this.source.charCodeAt(this.lookupOffset(n))===t:this.tokenType===A&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let n=this.tokenIndex+t;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&kt,n=this.offsetAndType[n],this.tokenType=n>>_t,this.tokenEnd=n&kt):(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>>_t,this.tokenEnd=t&kt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=xt,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===z||this.tokenType===Q;)this.next()}skipUntilBalanced(t,n){let i=t,r=0,s=0;t:for(;i<this.tokenCount;i++){if(r=this.balance[i],r<t)break t;switch(s=i>0?this.offsetAndType[i-1]&kt:this.firstCharOffset,n(this.source.charCodeAt(s))){case 1:break t;case 2:i++;break t;default:pi(this.offsetAndType[i]>>_t)&&(i=r)}}this.skip(i-this.tokenIndex)}forEachToken(t){for(let n=0,i=this.firstCharOffset;n<this.tokenCount;n++){const r=i,s=this.offsetAndType[n],l=s&kt,c=s>>_t;i=l,t(c,r,l,n)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken((n,i,r,s)=>{t[s]={idx:s,type:hi[n],chunk:this.source.substring(i,r),balance:this.balance[s]}}),t}}function mi(e,t){function n(u){return u<c?e.charCodeAt(u):0}function i(){if(o=ai(e,o),Ge(n(o),n(o+1),n(o+2))){h=C,o=Te(e,o);return}if(n(o)===37){h=N,o++;return}h=_}function r(){const u=o;if(o=Te(e,o),Le(e,u,o,"url")&&n(o)===40){if(o=Ae(e,o+1),n(o)===34||n(o)===39){h=v,o=u+4;return}l();return}if(n(o)===40){h=v,o++;return}h=g}function s(u){for(u||(u=n(o++)),h=wt;o<e.length;o++){const f=e.charCodeAt(o);switch(en(f)){case u:o++;return;case xe:if(Ce(f)){o+=nn(e,o,f),h=Nl;return}break;case 92:if(o===e.length-1)break;const d=n(o+1);Ce(d)?o+=nn(e,o+1,d):bt(f,d)&&(o=Yt(e,o)-1);break}}}function l(){for(h=X,o=Ae(e,o);o<e.length;o++){const u=e.charCodeAt(o);switch(en(u)){case 41:o++;return;case xe:if(o=Ae(e,o),n(o)===41||o>=e.length){o<e.length&&o++;return}o=sn(e,o),h=ht;return;case 34:case 39:case 40:case oi:o=sn(e,o),h=ht;return;case 92:if(bt(u,n(o+1))){o=Yt(e,o)-1;break}o=sn(e,o),h=ht;return}}}e=String(e||"");const c=e.length;let a=ri(n(0)),o=a,h;for(;o<c;){const u=e.charCodeAt(o);switch(en(u)){case xe:h=z,o=Ae(e,o+1);break;case 34:s();break;case 35:ii(n(o+1))||bt(n(o+1),n(o+2))?(h=M,o=Te(e,o+1)):(h=A,o++);break;case 39:s();break;case 40:h=O,o++;break;case 41:h=k,o++;break;case 43:Je(u,n(o+1),n(o+2))?i():(h=A,o++);break;case 44:h=ut,o++;break;case 45:Je(u,n(o+1),n(o+2))?i():n(o+1)===45&&n(o+2)===62?(h=it,o=o+3):Ge(u,n(o+1),n(o+2))?r():(h=A,o++);break;case 46:Je(u,n(o+1),n(o+2))?i():(h=A,o++);break;case 47:n(o+1)===42?(h=Q,o=e.indexOf("*/",o+2),o=o===-1?e.length:o+2):(h=A,o++);break;case 58:h=Y,o++;break;case 59:h=Z,o++;break;case 60:n(o+1)===33&&n(o+2)===45&&n(o+3)===45?(h=ve,o=o+4):(h=A,o++);break;case 64:Ge(n(o+1),n(o+2),n(o+3))?(h=H,o=Te(e,o+1)):(h=A,o++);break;case 91:h=Ut,o++;break;case 92:bt(u,n(o+1))?r():(h=A,o++);break;case 93:h=oe,o++;break;case 123:h=ft,o++;break;case 125:h=Vt,o++;break;case si:i();break;case tn:r();break;default:h=A,o++}t(h,a,a=o)}}const St=43,st=45,Pe=110,Mt=!0,Gl=!1;function Oe(e,t){let n=this.tokenStart+e;const i=this.charCodeAt(n);for((i===St||i===st)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)rt(this.charCodeAt(n))||this.error("Integer is expected",n)}function Qt(e){return Oe.call(this,0,e)}function Lt(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pe:n="N is expected";break;case st:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+e)}}function on(){let e=0,t=0,n=this.tokenType;for(;n===z||n===Q;)n=this.lookupType(++e);if(n!==_)if(this.isDelim(St,e)||this.isDelim(st,e)){t=this.isDelim(St,e)?St:st;do n=this.lookupType(++e);while(n===z||n===Q);n!==_&&(this.skip(e),Qt.call(this,Mt))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==St&&n!==st&&this.error("Number sign is expected")),Qt.call(this,t!==0),t===st?"-"+this.consume(_):this.consume(_)}const Jl="AnPlusB",Zl={a:[String,null],b:[String,null]};function gi(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===_)Qt.call(this,Gl),n=this.consume(_);else if(this.tokenType===g&&this.cmpChar(this.tokenStart,st))switch(t="-1",Lt.call(this,1,Pe),this.tokenEnd-this.tokenStart){case 2:this.next(),n=on.call(this);break;case 3:Lt.call(this,2,st),this.next(),this.skipSC(),Qt.call(this,Mt),n="-"+this.consume(_);break;default:Lt.call(this,2,st),Oe.call(this,3,Mt),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===g||this.isDelim(St)&&this.lookupType(1)===g){let i=0;switch(t="1",this.isDelim(St)&&(i=1,this.next()),Lt.call(this,0,Pe),this.tokenEnd-this.tokenStart){case 1:this.next(),n=on.call(this);break;case 2:Lt.call(this,1,st),this.next(),this.skipSC(),Qt.call(this,Mt),n="-"+this.consume(_);break;default:Lt.call(this,1,st),Oe.call(this,2,Mt),this.next(),n=this.substrToCursor(e+i+1)}}else if(this.tokenType===C){const i=this.charCodeAt(this.tokenStart),r=i===St||i===st;let s=this.tokenStart+r;for(;s<this.tokenEnd&&rt(this.charCodeAt(s));s++);s===this.tokenStart+r&&this.error("Integer is expected",this.tokenStart+r),Lt.call(this,s-this.tokenStart,Pe),t=this.substring(e,s),s+1===this.tokenEnd?(this.next(),n=on.call(this)):(Lt.call(this,s-this.tokenStart+1,st),s+2===this.tokenEnd?(this.next(),this.skipSC(),Qt.call(this,Mt),n="-"+this.consume(_)):(Oe.call(this,s-this.tokenStart+2,Mt),this.next(),n=this.substrToCursor(s+1)))}else this.error();return t!==null&&t.charCodeAt(0)===St&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===St&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function yi(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){const n=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}const ta=Object.freeze(Object.defineProperty({__proto__:null,generate:yi,name:Jl,parse:gi,structure:Zl},Symbol.toStringTag,{value:"Module"}));function bi(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function ea(){for(let e=1,t;t=this.lookupType(e);e++){if(t===Vt)return!0;if(t===ft||t===H)return!1}return!1}const na="Atrule",ia="atrule",ra={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function ki(e=!1){const t=this.tokenStart;let n,i,r=null,s=null;switch(this.eat(H),n=this.substrToCursor(t+1),i=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==ft&&this.tokenType!==Z&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),bi):r=bi.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Z:this.next();break;case ft:hasOwnProperty.call(this.atrule,i)&&typeof this.atrule[i].block=="function"?s=this.atrule[i].block.call(this,e):s=this.Block(ea.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:r,block:s}}function _i(e){this.token(H,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(Z,";")}const sa=Object.freeze(Object.defineProperty({__proto__:null,generate:_i,name:na,parse:ki,structure:ra,walkContext:ia},Symbol.toStringTag,{value:"Module"})),oa="AtrulePrelude",la="atrulePrelude",aa={children:[[]]};function Si(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==ft&&this.tokenType!==Z&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function vi(e){this.children(e)}const ca=Object.freeze(Object.defineProperty({__proto__:null,generate:vi,name:oa,parse:Si,structure:aa,walkContext:la},Symbol.toStringTag,{value:"Module"})),ha=36,wi=42,De=61,ua=94,ln=124,fa=126;function da(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(wi)?(t=!0,this.next()):this.isDelim(ln)||this.eat(g),this.isDelim(ln)?this.charCodeAt(this.tokenStart+1)!==De?(this.next(),this.eat(g)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function pa(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==De&&t!==fa&&t!==ua&&t!==ha&&t!==wi&&t!==ln&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==De&&(this.isDelim(De)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const ma="AttributeSelector",ga={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Ci(){const e=this.tokenStart;let t,n=null,i=null,r=null;return this.eat(Ut),this.skipSC(),t=da.call(this),this.skipSC(),this.tokenType!==oe&&(this.tokenType!==g&&(n=pa.call(this),this.skipSC(),i=this.tokenType===wt?this.String():this.Identifier(),this.skipSC()),this.tokenType===g&&(r=this.consume(g),this.skipSC())),this.eat(oe),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:i,flags:r}}function xi(e){this.token(A,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(g,e.flags),this.token(A,"]")}const ya=Object.freeze(Object.defineProperty({__proto__:null,generate:xi,name:ma,parse:Ci,structure:ga},Symbol.toStringTag,{value:"Module"})),ba=38;function Li(){return this.Raw(null,!0)}function Ai(){return this.parseWithFallback(this.Rule,Li)}function Ti(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function ka(){if(this.tokenType===Z)return Ti.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Ti);return this.tokenType===Z&&this.next(),e}const _a="Block",Sa="block",va={children:[["Atrule","Rule","Declaration"]]};function Ei(e){const t=e?ka:Ai,n=this.tokenStart;let i=this.createList();this.eat(ft);t:for(;!this.eof;)switch(this.tokenType){case Vt:break t;case z:case Q:this.next();break;case H:i.push(this.parseWithFallback(this.Atrule.bind(this,e),Li));break;default:e&&this.isDelim(ba)?i.push(Ai.call(this)):i.push(t.call(this))}return this.eof||this.eat(Vt),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function Pi(e){this.token(ft,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")}),this.token(Vt,"}")}const wa=Object.freeze(Object.defineProperty({__proto__:null,generate:Pi,name:_a,parse:Ei,structure:va,walkContext:Sa},Symbol.toStringTag,{value:"Module"})),Ca="Brackets",xa={children:[[]]};function Oi(e,t){const n=this.tokenStart;let i=null;return this.eat(Ut),i=e.call(this,t),this.eof||this.eat(oe),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:i}}function Di(e){this.token(A,"["),this.children(e),this.token(A,"]")}const La=Object.freeze(Object.defineProperty({__proto__:null,generate:Di,name:Ca,parse:Oi,structure:xa},Symbol.toStringTag,{value:"Module"})),Aa="CDC",Ta=[];function Mi(){const e=this.tokenStart;return this.eat(it),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Ii(){this.token(it,"-->")}const Ea=Object.freeze(Object.defineProperty({__proto__:null,generate:Ii,name:Aa,parse:Mi,structure:Ta},Symbol.toStringTag,{value:"Module"})),Pa="CDO",Oa=[];function Ri(){const e=this.tokenStart;return this.eat(ve),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function ji(){this.token(ve,"<!--")}const Da=Object.freeze(Object.defineProperty({__proto__:null,generate:ji,name:Pa,parse:Ri,structure:Oa},Symbol.toStringTag,{value:"Module"})),Ma=46,Ia="ClassSelector",Ra={name:String};function Fi(){return this.eatDelim(Ma),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(g)}}function $i(e){this.token(A,"."),this.token(g,e.name)}const ja=Object.freeze(Object.defineProperty({__proto__:null,generate:$i,name:Ia,parse:Fi,structure:Ra},Symbol.toStringTag,{value:"Module"})),Fa=43,Ni=47,$a=62,Na=126,za="Combinator",Wa={name:String};function zi(){const e=this.tokenStart;let t;switch(this.tokenType){case z:t=" ";break;case A:switch(this.charCodeAt(this.tokenStart)){case $a:case Fa:case Na:this.next();break;case Ni:this.next(),this.eatIdent("deep"),this.eatDelim(Ni);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function Wi(e){this.tokenize(e.name)}const Ba=Object.freeze(Object.defineProperty({__proto__:null,generate:Wi,name:za,parse:zi,structure:Wa},Symbol.toStringTag,{value:"Module"})),Ha=42,Ua=47,Va="Comment",qa={value:String};function Bi(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(Q),t-e+2>=2&&this.charCodeAt(t-2)===Ha&&this.charCodeAt(t-1)===Ua&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Hi(e){this.token(Q,"/*"+e.value+"*/")}const Xa=Object.freeze(Object.defineProperty({__proto__:null,generate:Hi,name:Va,parse:Bi,structure:qa},Symbol.toStringTag,{value:"Module"})),Ya=new Set([Y,k,xt]),Qa="Condition",Ka={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function Ui(e){return this.lookupTypeNonSC(1)===g&&Ya.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const Ga={media:Ui,container:Ui,supports(){return this.SupportsDeclaration()}};function Vi(e="media"){const t=this.createList();t:for(;!this.eof;)switch(this.tokenType){case Q:case z:this.next();continue;case g:t.push(this.Identifier());break;case O:{let n=this.parseWithFallback(()=>Ga[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(O);const i=this.Condition(e);return this.eat(k),i},()=>this.GeneralEnclosed(e))),t.push(n);break}case v:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break t}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function qi(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(O,"("),this.node(t),this.token(k,")")):this.node(t)})}const Ja=Object.freeze(Object.defineProperty({__proto__:null,generate:qi,name:Qa,parse:Vi,structure:Ka},Symbol.toStringTag,{value:"Module"})),Xi=45;function Za(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Xi&&e.charCodeAt(t+1)===Xi}const Yi=33,tc=35,ec=36,nc=38,ic=42,rc=43,Qi=47;function sc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function oc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function lc(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Z&&this.isDelim(Yi)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const ac="Declaration",cc="declaration",hc={important:[Boolean,String],property:String,value:["Value","Raw"]};function Ki(){const e=this.tokenStart,t=this.tokenIndex,n=uc.call(this),i=Za(n),r=i?this.parseCustomProperty:this.parseValue,s=i?oc:sc;let l=!1,c;this.skipSC(),this.eat(Y);const a=this.tokenIndex;if(i||this.skipSC(),r?c=this.parseWithFallback(lc,s):c=s.call(this,this.tokenIndex),i&&c.type==="Value"&&c.children.isEmpty){for(let o=a-this.tokenIndex;o<=0;o++)if(this.lookupType(o)===z){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(Yi)&&(l=fc.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==Z&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:c}}function Gi(e){this.token(g,e.property),this.token(Y,":"),this.node(e.value),e.important&&(this.token(A,"!"),this.token(g,e.important===!0?"important":e.important))}function uc(){const e=this.tokenStart;if(this.tokenType===A)switch(this.charCodeAt(this.tokenStart)){case ic:case ec:case rc:case tc:case nc:this.next();break;case Qi:this.next(),this.isDelim(Qi)&&this.next();break}return this.tokenType===M?this.eat(M):this.eat(g),this.substrToCursor(e)}function fc(){this.eat(A),this.skipSC();const e=this.consume(g);return e==="important"?!0:e}const dc=Object.freeze(Object.defineProperty({__proto__:null,generate:Gi,name:ac,parse:Ki,structure:hc,walkContext:cc},Symbol.toStringTag,{value:"Module"})),pc=38;function an(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const mc="DeclarationList",gc={children:[["Declaration","Atrule","Rule"]]};function Ji(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case z:case Q:case Z:this.next();break;case H:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),an));break;default:this.isDelim(pc)?e.push(this.parseWithFallback(this.Rule,an)):e.push(this.parseWithFallback(this.Declaration,an))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Zi(e){this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")})}const yc=Object.freeze(Object.defineProperty({__proto__:null,generate:Zi,name:mc,parse:Ji,structure:gc},Symbol.toStringTag,{value:"Module"})),bc="Dimension",kc={value:String,unit:String};function tr(){const e=this.tokenStart,t=this.consumeNumber(C);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function er(e){this.token(C,e.value+e.unit)}const _c=Object.freeze(Object.defineProperty({__proto__:null,generate:er,name:bc,parse:tr,structure:kc},Symbol.toStringTag,{value:"Module"})),Sc=47,vc="Feature",wc={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function nr(e){const t=this.tokenStart;let n,i=null;if(this.eat(O),this.skipSC(),n=this.consume(g),this.skipSC(),this.tokenType!==k){switch(this.eat(Y),this.skipSC(),this.tokenType){case _:this.lookupNonWSType(1)===A?i=this.Ratio():i=this.Number();break;case C:i=this.Dimension();break;case g:i=this.Identifier();break;case v:i=this.parseWithFallback(()=>{const r=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(Sc)&&this.error(),r},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(k),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:i}}function ir(e){this.token(O,"("),this.token(g,e.name),e.value!==null&&(this.token(Y,":"),this.node(e.value)),this.token(k,")")}const Cc=Object.freeze(Object.defineProperty({__proto__:null,generate:ir,name:vc,parse:nr,structure:wc},Symbol.toStringTag,{value:"Module"})),xc="FeatureFunction",Lc={kind:String,feature:String,value:["Declaration","Selector"]};function Ac(e,t){const n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function rr(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),i=Ac.call(this,e,n.toLowerCase());this.skipSC();const r=this.parseWithFallback(()=>{const s=this.tokenIndex,l=i.call(this);return this.eof===!1&&this.isBalanceEdge(s)===!1&&this.error(),l},()=>this.Raw(null,!1));return this.eof||this.eat(k),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:r}}function sr(e){this.token(v,e.feature+"("),this.node(e.value),this.token(k,")")}const Tc=Object.freeze(Object.defineProperty({__proto__:null,generate:sr,name:xc,parse:rr,structure:Lc},Symbol.toStringTag,{value:"Module"})),or=47,Ec=60,lr=61,Pc=62,Oc="FeatureRange",Dc={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 cn(){switch(this.skipSC(),this.tokenType){case _:return this.isDelim(or,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case C:return this.Dimension();case g:return this.Identifier();case v:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(or)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function ar(e){if(this.skipSC(),this.isDelim(Ec)||this.isDelim(Pc)){const t=this.source[this.tokenStart];return this.next(),this.isDelim(lr)?(this.next(),t+"="):t}if(this.isDelim(lr))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function cr(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(O);const n=cn.call(this),i=ar.call(this,n.type==="Identifier"),r=cn.call(this);let s=null,l=null;return this.lookupNonWSType(0)!==k&&(s=ar.call(this),l=cn.call(this)),this.skipSC(),this.eat(k),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:i,middle:r,rightComparison:s,right:l}}function hr(e){this.token(O,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(k,")")}const Mc=Object.freeze(Object.defineProperty({__proto__:null,generate:hr,name:Oc,parse:cr,structure:Dc},Symbol.toStringTag,{value:"Module"})),Ic="Function",Rc="function",jc={name:String,children:[[]]};function ur(e,t){const n=this.tokenStart,i=this.consumeFunctionName(),r=i.toLowerCase();let s;return s=t.hasOwnProperty(r)?t[r].call(this,t):e.call(this,t),this.eof||this.eat(k),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:i,children:s}}function fr(e){this.token(v,e.name+"("),this.children(e),this.token(k,")")}const Fc=Object.freeze(Object.defineProperty({__proto__:null,generate:fr,name:Ic,parse:ur,structure:jc,walkContext:Rc},Symbol.toStringTag,{value:"Module"})),$c="GeneralEnclosed",Nc={kind:String,function:[String,null],children:[[]]};function dr(e){const t=this.tokenStart;let n=null;this.tokenType===v?n=this.consumeFunctionName():this.eat(O);const i=this.parseWithFallback(()=>{const r=this.tokenIndex,s=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(r)===!1&&this.error(),s},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(k),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:i}}function pr(e){e.function?this.token(v,e.function+"("):this.token(O,"("),this.children(e),this.token(k,")")}const zc=Object.freeze(Object.defineProperty({__proto__:null,generate:pr,name:$c,parse:dr,structure:Nc},Symbol.toStringTag,{value:"Module"})),Wc="XXX",Bc="Hash",Hc={value:String};function mr(){const e=this.tokenStart;return this.eat(M),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function gr(e){this.token(M,"#"+e.value)}const Uc=Object.freeze(Object.defineProperty({__proto__:null,generate:gr,name:Bc,parse:mr,structure:Hc,xxx:Wc},Symbol.toStringTag,{value:"Module"})),Vc="Identifier",qc={name:String};function yr(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(g)}}function br(e){this.token(g,e.name)}const Xc=Object.freeze(Object.defineProperty({__proto__:null,generate:br,name:Vc,parse:yr,structure:qc},Symbol.toStringTag,{value:"Module"})),Yc="IdSelector",Qc={name:String};function kr(){const e=this.tokenStart;return this.eat(M),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function _r(e){this.token(A,"#"+e.name)}const Kc=Object.freeze(Object.defineProperty({__proto__:null,generate:_r,name:Yc,parse:kr,structure:Qc},Symbol.toStringTag,{value:"Module"})),Gc=46,Jc="Layer",Zc={name:String};function Sr(){let e=this.tokenStart,t=this.consume(g);for(;this.isDelim(Gc);)this.eat(A),t+="."+this.consume(g);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function vr(e){this.tokenize(e.name)}const th=Object.freeze(Object.defineProperty({__proto__:null,generate:vr,name:Jc,parse:Sr,structure:Zc},Symbol.toStringTag,{value:"Module"})),eh="LayerList",nh={children:[["Layer"]]};function wr(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===ut);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Cr(e){this.children(e,()=>this.token(ut,","))}const ih=Object.freeze(Object.defineProperty({__proto__:null,generate:Cr,name:eh,parse:wr,structure:nh},Symbol.toStringTag,{value:"Module"})),rh="MediaQuery",sh={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function xr(){const e=this.tokenStart;let t=null,n=null,i=null;if(this.skipSC(),this.tokenType===g&&this.lookupTypeNonSC(1)!==O){const r=this.consume(g),s=r.toLowerCase();switch(s==="not"||s==="only"?(this.skipSC(),t=s,n=this.consume(g)):n=r,this.lookupTypeNonSC(0)){case g:{this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break}case ft:case Z:case ut:case xt:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case g:case O:case v:{i=this.Condition("media");break}case ft:case Z:case xt:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:i}}function Lr(e){e.mediaType?(e.modifier&&this.token(g,e.modifier),this.token(g,e.mediaType),e.condition&&(this.token(g,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const oh=Object.freeze(Object.defineProperty({__proto__:null,generate:Lr,name:rh,parse:xr,structure:sh},Symbol.toStringTag,{value:"Module"})),lh="MediaQueryList",ah={children:[["MediaQuery"]]};function Ar(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===ut);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Tr(e){this.children(e,()=>this.token(ut,","))}const ch=Object.freeze(Object.defineProperty({__proto__:null,generate:Tr,name:lh,parse:Ar,structure:ah},Symbol.toStringTag,{value:"Module"})),hh=38,uh="NestingSelector",fh={};function Er(){const e=this.tokenStart;return this.eatDelim(hh),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Pr(){this.token(A,"&")}const dh=Object.freeze(Object.defineProperty({__proto__:null,generate:Pr,name:uh,parse:Er,structure:fh},Symbol.toStringTag,{value:"Module"})),ph="Nth",mh={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Or(){this.skipSC();const e=this.tokenStart;let t=e,n=null,i;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?i=this.Identifier():i=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:i,selector:n}}function Dr(e){this.node(e.nth),e.selector!==null&&(this.token(g,"of"),this.node(e.selector))}const gh=Object.freeze(Object.defineProperty({__proto__:null,generate:Dr,name:ph,parse:Or,structure:mh},Symbol.toStringTag,{value:"Module"})),yh="Number",bh={value:String};function Mr(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(_)}}function Ir(e){this.token(_,e.value)}const kh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ir,name:yh,parse:Mr,structure:bh},Symbol.toStringTag,{value:"Module"})),_h="Operator",Sh={value:String};function Rr(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function jr(e){this.tokenize(e.value)}const vh=Object.freeze(Object.defineProperty({__proto__:null,generate:jr,name:_h,parse:Rr,structure:Sh},Symbol.toStringTag,{value:"Module"})),wh="Parentheses",Ch={children:[[]]};function Fr(e,t){const n=this.tokenStart;let i=null;return this.eat(O),i=e.call(this,t),this.eof||this.eat(k),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:i}}function $r(e){this.token(O,"("),this.children(e),this.token(k,")")}const xh=Object.freeze(Object.defineProperty({__proto__:null,generate:$r,name:wh,parse:Fr,structure:Ch},Symbol.toStringTag,{value:"Module"})),Lh="Percentage",Ah={value:String};function Nr(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(N)}}function zr(e){this.token(N,e.value+"%")}const Th=Object.freeze(Object.defineProperty({__proto__:null,generate:zr,name:Lh,parse:Nr,structure:Ah},Symbol.toStringTag,{value:"Module"})),Eh="PseudoClassSelector",Ph="function",Oh={name:String,children:[["Raw"],null]};function Wr(){const e=this.tokenStart;let t=null,n,i;return this.eat(Y),this.tokenType===v?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==k?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(k)):n=this.consume(g),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Br(e){this.token(Y,":"),e.children===null?this.token(g,e.name):(this.token(v,e.name+"("),this.children(e),this.token(k,")"))}const Dh=Object.freeze(Object.defineProperty({__proto__:null,generate:Br,name:Eh,parse:Wr,structure:Oh,walkContext:Ph},Symbol.toStringTag,{value:"Module"})),Mh="PseudoElementSelector",Ih="function",Rh={name:String,children:[["Raw"],null]};function Hr(){const e=this.tokenStart;let t=null,n,i;return this.eat(Y),this.eat(Y),this.tokenType===v?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==k?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(k)):n=this.consume(g),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Ur(e){this.token(Y,":"),this.token(Y,":"),e.children===null?this.token(g,e.name):(this.token(v,e.name+"("),this.children(e),this.token(k,")"))}const jh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ur,name:Mh,parse:Hr,structure:Rh,walkContext:Ih},Symbol.toStringTag,{value:"Module"})),Vr=47;function qr(){switch(this.skipSC(),this.tokenType){case _:return this.Number();case v:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const Fh="Ratio",$h={left:["Number","Function"],right:["Number","Function",null]};function Xr(){const e=this.tokenStart,t=qr.call(this);let n=null;return this.skipSC(),this.isDelim(Vr)&&(this.eatDelim(Vr),n=qr.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function Yr(e){this.node(e.left),this.token(A,"/"),e.right?this.node(e.right):this.node(_,1)}const Nh=Object.freeze(Object.defineProperty({__proto__:null,generate:Yr,name:Fh,parse:Xr,structure:$h},Symbol.toStringTag,{value:"Module"}));function zh(){return this.tokenIndex>0&&this.lookupType(-1)===z?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Wh="Raw",Bh={value:String};function Qr(e,t){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?i=zh.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function Kr(e){this.tokenize(e.value)}const Hh=Object.freeze(Object.defineProperty({__proto__:null,generate:Kr,name:Wh,parse:Qr,structure:Bh},Symbol.toStringTag,{value:"Module"}));function Gr(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Uh(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==ft&&this.error(),e}const Vh="Rule",qh="rule",Xh={prelude:["SelectorList","Raw"],block:["Block"]};function Jr(){const e=this.tokenIndex,t=this.tokenStart;let n,i;return this.parseRulePrelude?n=this.parseWithFallback(Uh,Gr):n=Gr.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:i}}function Zr(e){this.node(e.prelude),this.node(e.block)}const Yh=Object.freeze(Object.defineProperty({__proto__:null,generate:Zr,name:Vh,parse:Jr,structure:Xh,walkContext:qh},Symbol.toStringTag,{value:"Module"})),Qh="Scope",Kh={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function ts(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===O&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(k)),this.lookupNonWSType(0)===g&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(O),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(k)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function es(e){e.root&&(this.token(O,"("),this.node(e.root),this.token(k,")")),e.limit&&(this.token(g,"to"),this.token(O,"("),this.node(e.limit),this.token(k,")"))}const Gh=Object.freeze(Object.defineProperty({__proto__:null,generate:es,name:Qh,parse:ts,structure:Kh},Symbol.toStringTag,{value:"Module"})),Jh="Selector",Zh={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function ns(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function is(e){this.children(e)}const tu=Object.freeze(Object.defineProperty({__proto__:null,generate:is,name:Jh,parse:ns,structure:Zh},Symbol.toStringTag,{value:"Module"})),eu="SelectorList",nu="selector",iu={children:[["Selector","Raw"]]};function rs(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===ut){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function ss(e){this.children(e,()=>this.token(ut,","))}const ru=Object.freeze(Object.defineProperty({__proto__:null,generate:ss,name:eu,parse:rs,structure:iu,walkContext:nu},Symbol.toStringTag,{value:"Module"})),hn=92,os=34,su=39;function ls(e){const t=e.length,n=e.charCodeAt(0),i=n===os||n===su?1:0,r=i===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let s="";for(let l=i;l<=r;l++){let c=e.charCodeAt(l);if(c===hn){if(l===r){l!==t-1&&(s=e.substr(l+1));break}if(c=e.charCodeAt(++l),bt(hn,c)){const a=l-1,o=Yt(e,a);l=o-1,s+=ci(e.substring(a+1,o))}else c===13&&e.charCodeAt(l+1)===10&&l++}else s+=e[l]}return s}function ou(e,t){const n=os;let i="",r=!1;for(let s=0;s<e.length;s++){const l=e.charCodeAt(s);if(l===0){i+="�";continue}if(l<=31||l===127){i+="\\"+l.toString(16),r=!0;continue}l===n||l===hn?(i+="\\"+e.charAt(s),r=!1):(r&&(qt(l)||Ot(l))&&(i+=" "),i+=e.charAt(s),r=!1)}return'"'+i+'"'}const lu="String",au={value:String};function as(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:ls(this.consume(wt))}}function cs(e){this.token(wt,ou(e.value))}const cu=Object.freeze(Object.defineProperty({__proto__:null,generate:cs,name:lu,parse:as,structure:au},Symbol.toStringTag,{value:"Module"})),hu=33;function hs(){return this.Raw(null,!1)}const uu="StyleSheet",fu="stylesheet",du={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function us(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case z:this.next();continue;case Q:if(this.charCodeAt(this.tokenStart+2)!==hu){this.next();continue}n=this.Comment();break;case ve:n=this.CDO();break;case it:n=this.CDC();break;case H:n=this.parseWithFallback(this.Atrule,hs);break;default:n=this.parseWithFallback(this.Rule,hs)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function fs(e){this.children(e)}const pu=Object.freeze(Object.defineProperty({__proto__:null,generate:fs,name:uu,parse:us,structure:du,walkContext:fu},Symbol.toStringTag,{value:"Module"})),mu="SupportsDeclaration",gu={declaration:"Declaration"};function ds(){const e=this.tokenStart;this.eat(O),this.skipSC();const t=this.Declaration();return this.eof||this.eat(k),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function ps(e){this.token(O,"("),this.node(e.declaration),this.token(k,")")}const yu=Object.freeze(Object.defineProperty({__proto__:null,generate:ps,name:mu,parse:ds,structure:gu},Symbol.toStringTag,{value:"Module"})),bu=42,ms=124;function un(){this.tokenType!==g&&this.isDelim(bu)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const ku="TypeSelector",_u={name:String};function gs(){const e=this.tokenStart;return this.isDelim(ms)?(this.next(),un.call(this)):(un.call(this),this.isDelim(ms)&&(this.next(),un.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function ys(e){this.tokenize(e.name)}const Su=Object.freeze(Object.defineProperty({__proto__:null,generate:ys,name:ku,parse:gs,structure:_u},Symbol.toStringTag,{value:"Module"})),bs=43,ks=45,fn=63;function le(e,t){let n=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){const r=this.charCodeAt(i);if(r===ks&&t&&n!==0)return le.call(this,e+n+1,!1),-1;qt(r)||this.error(t&&n!==0?"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 Me(e){let t=0;for(;this.isDelim(fn);)++t>e&&this.error("Too many question marks"),this.next()}function vu(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===bs?"Plus sign":"Hyphen minus")+" is expected")}function wu(){let e=0;switch(this.tokenType){case _:if(e=le.call(this,1,!0),this.isDelim(fn)){Me.call(this,6-e);break}if(this.tokenType===C||this.tokenType===_){vu.call(this,ks),le.call(this,1,!1);break}break;case C:e=le.call(this,1,!0),e>0&&Me.call(this,6-e);break;default:if(this.eatDelim(bs),this.tokenType===g){e=le.call(this,0,!0),e>0&&Me.call(this,6-e);break}if(this.isDelim(fn)){this.next(),Me.call(this,5);break}this.error("Hex digit or question mark is expected")}}const Cu="UnicodeRange",xu={value:String};function _s(){const e=this.tokenStart;return this.eatIdent("u"),wu.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ss(e){this.tokenize(e.value)}const Lu=Object.freeze(Object.defineProperty({__proto__:null,generate:Ss,name:Cu,parse:_s,structure:xu},Symbol.toStringTag,{value:"Module"})),Au=32,dn=92,Tu=34,Eu=39,Pu=40,vs=41;function Ou(e){const t=e.length;let n=4,i=e.charCodeAt(t-1)===vs?t-2:t-1,r="";for(;n<i&&Ot(e.charCodeAt(n));)n++;for(;n<i&&Ot(e.charCodeAt(i));)i--;for(let s=n;s<=i;s++){let l=e.charCodeAt(s);if(l===dn){if(s===i){s!==t-1&&(r=e.substr(s+1));break}if(l=e.charCodeAt(++s),bt(dn,l)){const c=s-1,a=Yt(e,c);s=a-1,r+=ci(e.substring(c+1,a))}else l===13&&e.charCodeAt(s+1)===10&&s++}else r+=e[s]}return r}function Du(e){let t="",n=!1;for(let i=0;i<e.length;i++){const r=e.charCodeAt(i);if(r===0){t+="�";continue}if(r<=31||r===127){t+="\\"+r.toString(16),n=!0;continue}r===Au||r===dn||r===Tu||r===Eu||r===Pu||r===vs?(t+="\\"+e.charAt(i),n=!1):(n&&qt(r)&&(t+=" "),t+=e.charAt(i),n=!1)}return"url("+t+")"}const Mu="Url",Iu={value:String};function ws(){const e=this.tokenStart;let t;switch(this.tokenType){case X:t=Ou(this.consume(X));break;case v:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(v),this.skipSC(),t=ls(this.consume(wt)),this.skipSC(),this.eof||this.eat(k);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Cs(e){this.token(X,Du(e.value))}const Ru=Object.freeze(Object.defineProperty({__proto__:null,generate:Cs,name:Mu,parse:ws,structure:Iu},Symbol.toStringTag,{value:"Module"})),ju="Value",Fu={children:[[]]};function xs(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Ls(e){this.children(e)}const $u=Object.freeze(Object.defineProperty({__proto__:null,generate:Ls,name:ju,parse:xs,structure:Fu},Symbol.toStringTag,{value:"Module"})),Nu=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),zu="WhiteSpace",Wu={value:String};function As(){return this.eat(z),Nu}function Ts(e){this.token(z,e.value)}const Bu=Object.freeze(Object.defineProperty({__proto__:null,generate:Ts,name:zu,parse:As,structure:Wu},Symbol.toStringTag,{value:"Module"})),Hu=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ta,Atrule:sa,AtrulePrelude:ca,AttributeSelector:ya,Block:wa,Brackets:La,CDC:Ea,CDO:Da,ClassSelector:ja,Combinator:Ba,Comment:Xa,Condition:Ja,Declaration:dc,DeclarationList:yc,Dimension:_c,Feature:Cc,FeatureFunction:Tc,FeatureRange:Mc,Function:Fc,GeneralEnclosed:zc,Hash:Uc,IdSelector:Kc,Identifier:Xc,Layer:th,LayerList:ih,MediaQuery:oh,MediaQueryList:ch,NestingSelector:dh,Nth:gh,Number:kh,Operator:vh,Parentheses:xh,Percentage:Th,PseudoClassSelector:Dh,PseudoElementSelector:jh,Ratio:Nh,Raw:Hh,Rule:Yh,Scope:Gh,Selector:tu,SelectorList:ru,String:cu,StyleSheet:pu,SupportsDeclaration:yu,TypeSelector:Su,UnicodeRange:Lu,Url:Ru,Value:$u,WhiteSpace:Bu},Symbol.toStringTag,{value:"Module"})),Uu={node:Hu},At=$l(Uu),pn=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function ae(e){return pn.includes(e)}const mn=["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"];function Vu(e){return mn.includes(e)}const gn=["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 Es(e){return gn.includes(e)}const Ps=["justify-self","align-self","place-self"];function qu(e){return Ps.includes(e)}const Os=[...pn,...mn,...gn,...Ps,"position-anchor","position-area"],Xu=[...gn,...pn,...mn];function Ds(e){return Xu.includes(e)}const Yu=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function Ms(e){return Yu.includes(e)}const Qu=["width","height","block","inline","self-block","self-inline"];function Ku(e){return Qu.includes(e)}const Is=new Set(["Atrule","Selector","Declaration"]);function Gu(e){const t=new SourceMapGenerator,n={line:1,column:0},i={line:0,column:0},r={line:1,column:0},s={generated:r};let l=1,c=0,a=!1;const o=e.node;e.node=function(f){if(f.loc&&f.loc.start&&Is.has(f.type)){const d=f.loc.start.line,p=f.loc.start.column-1;(i.line!==d||i.column!==p)&&(i.line=d,i.column=p,n.line=l,n.column=c,a&&(a=!1,(n.line!==r.line||n.column!==r.column)&&t.addMapping(s)),a=!0,t.addMapping({source:f.loc.source,original:i,generated:n}))}o.call(this,f),a&&Is.has(f.type)&&(r.line=l,r.column=c)};const h=e.emit;e.emit=function(f,d,p){for(let m=0;m<f.length;m++)f.charCodeAt(m)===10?(l++,c=0):c++;h(f,d,p)};const u=e.result;return e.result=function(){return a&&t.addMapping(s),{css:u(),map:t}},e}const Ju=43,Zu=45,yn=(e,t)=>{if(e===A&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},Rs=[[g,g],[g,v],[g,X],[g,ht],[g,"-"],[g,_],[g,N],[g,C],[g,it],[g,O],[H,g],[H,v],[H,X],[H,ht],[H,"-"],[H,_],[H,N],[H,C],[H,it],[M,g],[M,v],[M,X],[M,ht],[M,"-"],[M,_],[M,N],[M,C],[M,it],[C,g],[C,v],[C,X],[C,ht],[C,"-"],[C,_],[C,N],[C,C],[C,it],["#",g],["#",v],["#",X],["#",ht],["#","-"],["#",_],["#",N],["#",C],["#",it],["-",g],["-",v],["-",X],["-",ht],["-","-"],["-",_],["-",N],["-",C],["-",it],[_,g],[_,v],[_,X],[_,ht],[_,_],[_,N],[_,C],[_,"%"],[_,it],["@",g],["@",v],["@",X],["@",ht],["@","-"],["@",it],[".",_],[".",N],[".",C],["+",_],["+",N],["+",C],["/","*"]],tf=Rs.concat([[g,M],[C,M],[M,M],[H,O],[H,wt],[H,Y],[N,N],[N,C],[N,v],[N,"-"],[k,g],[k,v],[k,N],[k,C],[k,M],[k,"-"]]);function js(e){const t=new Set(e.map(([n,i])=>yn(n)<<16|yn(i)));return function(n,i,r){const s=yn(i,r),l=r.charCodeAt(0);return(l===Zu&&i!==g&&i!==v&&i!==it||l===Ju?t.has(n<<16|l<<8):t.has(n<<16|s))&&this.emit(" ",z,!0),s}}const ef=js(Rs),Fs=js(tf),$s=Object.freeze(Object.defineProperty({__proto__:null,safe:Fs,spec:ef},Symbol.toStringTag,{value:"Module"})),nf=92;function rf(e,t){if(typeof t=="function"){let n=null;e.children.forEach(i=>{n!==null&&t.call(this,n),this.node(i),n=i});return}e.children.forEach(this.node,this)}function sf(e){mi(e,(t,n,i)=>{this.token(t,e.slice(n,i))})}function of(e){const t=new Map;for(let[n,i]of Object.entries(e.node))typeof(i.generate||i)=="function"&&t.set(n,i.generate||i);return function(n,i){let r="",s=0,l={node(a){if(t.has(a.type))t.get(a.type).call(c,a);else throw new Error("Unknown node type: "+a.type)},tokenBefore:Fs,token(a,o){s=this.tokenBefore(s,a,o),this.emit(o,a,!1),a===A&&o.charCodeAt(0)===nf&&this.emit(`
|
|
16
|
+
`,z,!0)},emit(a){r+=a},result(){return r}};i&&(typeof i.decorator=="function"&&(l=i.decorator(l)),i.sourceMap&&(l=Gu(l)),i.mode in $s&&(l.tokenBefore=$s[i.mode]));const c={node:a=>l.node(a),children:rf,token:(a,o)=>l.token(a,o),tokenize:sf};return l.node(n),l.result()}}const lf=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:yi,Atrule:_i,AtrulePrelude:vi,AttributeSelector:xi,Block:Pi,Brackets:Di,CDC:Ii,CDO:ji,ClassSelector:$i,Combinator:Wi,Comment:Hi,Condition:qi,Declaration:Gi,DeclarationList:Zi,Dimension:er,Feature:ir,FeatureFunction:sr,FeatureRange:hr,Function:fr,GeneralEnclosed:pr,Hash:gr,IdSelector:_r,Identifier:br,Layer:vr,LayerList:Cr,MediaQuery:Lr,MediaQueryList:Tr,NestingSelector:Pr,Nth:Dr,Number:Ir,Operator:jr,Parentheses:$r,Percentage:zr,PseudoClassSelector:Br,PseudoElementSelector:Ur,Ratio:Yr,Raw:Kr,Rule:Zr,Scope:es,Selector:is,SelectorList:ss,String:cs,StyleSheet:fs,SupportsDeclaration:ps,TypeSelector:ys,UnicodeRange:Ss,Url:Cs,Value:Ls,WhiteSpace:Ts},Symbol.toStringTag,{value:"Module"})),af={node:lf},cf=of(af);let Kt=null;class K{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return K.createItem(t)}allocateCursor(t,n){let i;return Kt!==null?(i=Kt,Kt=Kt.cursor,i.prev=t,i.next=n,i.cursor=this.cursor):i={prev:t,next:n,cursor:this.cursor},this.cursor=i,i}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=Kt,Kt=t}updateCursors(t,n,i,r){let{cursor:s}=this;for(;s!==null;)s.prev===t&&(s.prev=n),s.next===i&&(s.next=r),s=s.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let i of t){const r=K.createItem(i);n!==null?n.next=r:this.head=r,r.prev=n,n=r}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const i=this.allocateCursor(null,this.head);for(;i.next!==null;){const r=i.next;i.next=r.next,t.call(n,r.data,r,this)}this.releaseCursor()}forEachRight(t,n=this){const i=this.allocateCursor(this.tail,null);for(;i.prev!==null;){const r=i.prev;i.prev=r.prev,t.call(n,r.data,r,this)}this.releaseCursor()}reduce(t,n,i=this){let r=this.allocateCursor(null,this.head),s=n,l;for(;r.next!==null;)l=r.next,r.next=l.next,s=t.call(i,s,l.data,l,this);return this.releaseCursor(),s}reduceRight(t,n,i=this){let r=this.allocateCursor(this.tail,null),s=n,l;for(;r.prev!==null;)l=r.prev,r.prev=l.prev,s=t.call(i,s,l.data,l,this);return this.releaseCursor(),s}some(t,n=this){for(let i=this.head;i!==null;i=i.next)if(t.call(n,i.data,i,this))return!0;return!1}map(t,n=this){const i=new K;for(let r=this.head;r!==null;r=r.next)i.appendData(t.call(n,r.data,r,this));return i}filter(t,n=this){const i=new K;for(let r=this.head;r!==null;r=r.next)t.call(n,r.data,r,this)&&i.appendData(r.data);return i}nextUntil(t,n,i=this){if(t===null)return;const r=this.allocateCursor(null,t);for(;r.next!==null;){const s=r.next;if(r.next=s.next,n.call(i,s.data,s,this))break}this.releaseCursor()}prevUntil(t,n,i=this){if(t===null)return;const r=this.allocateCursor(t,null);for(;r.prev!==null;){const s=r.prev;if(r.prev=s.prev,n.call(i,s.data,s,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new K;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(K.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(K.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(K.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)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(K.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(K.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(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,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}}function hf(e,t){const n=Object.create(SyntaxError.prototype),i=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(i.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
|
|
17
|
+
`)}})}const bn=100,Ns=60,zs=" ";function Ws({source:e,line:t,column:n,baseLine:i,baseColumn:r},s){function l(p,m){return o.slice(p,m).map((y,b)=>String(p+b+1).padStart(f)+" |"+y).join(`
|
|
18
18
|
`)}const c=`
|
|
19
|
-
`.repeat(Math.max(i-1,0)),a=" ".repeat(Math.max(r-1,0)),
|
|
20
|
-
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function
|
|
21
|
-
`+No({source:t,line:i,column:r,baseLine:o,baseColumn:l},2)}})}function Zh(e){const t=this.createList();let n=!1;const i={recognizer:e};for(;!this.eof;){switch(this.tokenType){case Y:this.next();continue;case N:n=!0,this.next();continue}let r=e.getNode.call(this,i);if(r===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,r,t,i),n=!1),t.push(r)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,i),t}const Ho=()=>{},tf=33,ef=35,kn=59,Bo=123,Uo=0;function nf(e){return function(){return this[e]()}}function bn(e){const t=Object.create(null);for(const n of Object.keys(e)){const i=e[n],r=i.parse||i;r&&(t[n]=r)}return t}function rf(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:bn(e.atrule),pseudo:bn(e.pseudo),node:bn(e.node)};for(const[n,i]of Object.entries(e.parseContext))switch(typeof i){case"function":t.context[n]=i;break;case"string":t.context[n]=nf(i);break}return U(U({config:t},t),t.node)}function of(e){let t="",n="<unknown>",i=!1,r=Ho,o=!1;const l=new $l,c=Object.assign(new zl,rf(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Zh,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===Bo?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===Bo||a===kn?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===tf||a===kn?1:0},consumeUntilSemicolonIncluded(a){return a===kn?2:0},createList(){return new G},createSingleNodeList(a){return new G().appendData(a)},getFirstListNode(a){return a&&a.first},getLastListNode(a){return a&&a.last},parseWithFallback(a,s){const u=this.tokenIndex;try{return a.call(this)}catch(h){if(o)throw h;this.skip(u-this.tokenIndex);const f=s.call(this);return o=!0,r(h,f),o=!1,f}},lookupNonWSType(a){let s;do if(s=this.lookupType(a++),s!==N&&s!==Y)return s;while(s!==Uo);return Uo},charCodeAt(a){return a>=0&&a<t.length?t.charCodeAt(a):0},substring(a,s){return t.substring(a,s)},substrToCursor(a){return this.source.substring(a,this.tokenStart)},cmpChar(a,s){return oi(t,a,s)},cmpStr(a,s,u){return Le(t,a,s,u)},consume(a){const s=this.tokenStart;return this.eat(a),this.substrToCursor(s)},consumeFunctionName(){const a=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(v),a},consumeNumber(a){const s=t.substring(this.tokenStart,si(t,this.tokenStart));return this.eat(a),s},eat(a){if(this.tokenType!==a){const s=ai[a].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase());let u=`${/[[\](){}]/.test(s)?`"${s}"`:s} is expected`,h=this.tokenStart;switch(a){case g:this.tokenType===v||this.tokenType===Q?(h=this.tokenEnd-1,u="Identifier is expected but function found"):u="Identifier is expected";break;case D:this.isDelim(ef)&&(this.next(),h++,u="Name is expected");break;case $:this.tokenType===S&&(h=this.tokenEnd,u="Percent sign is expected");break}this.error(u,h)}this.next()},eatIdent(a){(this.tokenType!==g||this.lookupValue(0,a)===!1)&&this.error(`Identifier "${a}" is expected`),this.next()},eatDelim(a){this.isDelim(a)||this.error(`Delim "${String.fromCharCode(a)}" is expected`),this.next()},getLocation(a,s){return i?l.getLocationRange(a,s,n):null},getLocationFromList(a){if(i){const s=this.getFirstListNode(a),u=this.getLastListNode(a);return l.getLocationRange(s!==null?s.loc.start.offset-l.startOffset:this.tokenStart,u!==null?u.loc.end.offset-l.startOffset:this.tokenStart,n)}return null},error(a,s){const u=typeof s<"u"&&s<t.length?l.getLocation(s):this.eof?l.getLocation(Rl(t,t.length-1)):l.getLocation(this.tokenStart);throw new Wo(a||"Unexpected input",t,u.offset,u.line,u.column,l.startLine,l.startColumn)}});return Object.assign(function(a,s){t=a,s=s||{},c.setSource(t,di),l.setSource(t,s.offset,s.line,s.column),n=s.filename||"<unknown>",i=!!s.positions,r=typeof s.onParseError=="function"?s.onParseError:Ho,o=!1,c.parseAtrulePrelude="parseAtrulePrelude"in s?!!s.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in s?!!s.parseRulePrelude:!0,c.parseValue="parseValue"in s?!!s.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in s?!!s.parseCustomProperty:!1;const{context:u="default",onComment:h}=s;if(!(u in c.context))throw new Error("Unknown context `"+u+"`");typeof h=="function"&&c.forEachToken((d,p,m)=>{if(d===Y){const y=c.getLocation(p,m),k=Le(t,m-2,m,"*/")?t.slice(p+2,m-2):t.slice(p+2,m);h(k,y)}});const f=c.context[u].call(c,s);return c.eof||c.error(),f},{SyntaxError:Wo,config:c.config})}const sf=35,lf=42,Vo=43,af=45,cf=47,uf=117;function qo(e){switch(this.tokenType){case D:return this.Hash();case ht:return this.Operator();case E:return this.Parentheses(this.readSequence,e.recognizer);case Bt:return this.Brackets(this.readSequence,e.recognizer);case wt:return this.String();case C:return this.Dimension();case $:return this.Percentage();case S:return this.Number();case v:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case Q:return this.Url();case g:return this.cmpChar(this.tokenStart,uf)&&this.cmpChar(this.tokenStart+1,Vo)?this.UnicodeRange():this.Identifier();case L:{const t=this.charCodeAt(this.tokenStart);if(t===cf||t===lf||t===Vo||t===af)return this.Operator();t===sf&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const hf={getNode:qo},ff=35,df=38,pf=42,mf=43,gf=47,Qo=46,yf=62,kf=124,bf=126;function Sf(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function _f(){switch(this.tokenType){case Bt:return this.AttributeSelector();case D:return this.IdSelector();case X:return this.lookupType(1)===X?this.PseudoElementSelector():this.PseudoClassSelector();case g:return this.TypeSelector();case S:case $:return this.Percentage();case C:this.charCodeAt(this.tokenStart)===Qo&&this.error("Identifier is expected",this.tokenStart+1);break;case L:{switch(this.charCodeAt(this.tokenStart)){case mf:case yf:case bf:case gf:return this.Combinator();case Qo:return this.ClassSelector();case pf:case kf:return this.TypeSelector();case ff:return this.IdSelector();case df:return this.NestingSelector()}break}}}const vf={onWhiteSpace:Sf,getNode:_f};function wf(){return this.createSingleNodeList(this.Raw(null,!1))}function Cf(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===ht){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let i=t-this.tokenIndex;i<=0;i++)if(this.lookupType(i)===N){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function Xo(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}const xf={getNode:qo,onWhiteSpace(e,t){Xo(e)&&(e.value=" "+e.value),Xo(t.last)&&(t.last.value+=" ")},expression:wf,var:Cf},Lf=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:hf,Selector:vf,Value:xf},Symbol.toStringTag,{value:"Module"})),Af=new Set(["none","and","not","or"]),Pf={parse:{prelude(){const e=this.createList();if(this.tokenType===g){const t=this.substring(this.tokenStart,this.tokenEnd);Af.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Tf={parse:{prelude:null,block(){return this.Block(!0)}}};function Sn(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==b&&this.error()}},t||(()=>this.Raw(null,!0)))}const Yo={layer(){this.skipSC();const e=this.createList(),t=Sn.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Sn.call(this,this.Declaration,()=>Sn.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Ef={parse:{prelude(){const e=this.createList();switch(this.tokenType){case wt:e.push(this.String());break;case Q:case v:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===g&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===v&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Yo)),this.skipSC(),this.tokenType===v&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Yo)),(this.lookupNonWSType(0)===g||this.lookupNonWSType(0)===E)&&e.push(this.MediaQueryList()),e},block:null}},Of={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},Df={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},Mf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},If={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},Rf={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},jf={parse:{prelude:null,block(e=!1){return this.Block(e)}}},Ff={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}},$f={container:Pf,"font-face":Tf,import:Ef,layer:Of,media:Df,nest:Mf,page:If,scope:Rf,"starting-style":jf,supports:Ff};function zf(){const e=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case g:e.push(this.Identifier());break;case wt:e.push(this.String());break;case ht:e.push(this.Operator());break;case b:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}const Mt={parse(){return this.createSingleNodeList(this.SelectorList())}},_n={parse(){return this.createSingleNodeList(this.Selector())}},Nf={parse(){return this.createSingleNodeList(this.Identifier())}},Wf={parse:zf},Ie={parse(){return this.createSingleNodeList(this.Nth())}},Hf={dir:Nf,has:Mt,lang:Wf,matches:Mt,is:Mt,"-moz-any":Mt,"-webkit-any":Mt,where:Mt,not:Mt,"nth-child":Ie,"nth-last-child":Ie,"nth-last-of-type":Ie,"nth-of-type":Ie,slotted:_n,host:_n,"host-context":_n},Bf=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:pi,Atrule:yi,AtrulePrelude:bi,AttributeSelector:vi,Block:Ai,Brackets:Ti,CDC:Oi,CDO:Mi,ClassSelector:Ri,Combinator:$i,Comment:Ni,Condition:Bi,Declaration:Xi,DeclarationList:Gi,Dimension:Ji,Feature:tr,FeatureFunction:nr,FeatureRange:lr,Function:cr,GeneralEnclosed:hr,Hash:dr,IdSelector:yr,Identifier:mr,Layer:br,LayerList:_r,MediaQuery:wr,MediaQueryList:xr,NestingSelector:Ar,Nth:Tr,Number:Or,Operator:Mr,Parentheses:Rr,Percentage:Fr,PseudoClassSelector:zr,PseudoElementSelector:Wr,Ratio:Vr,Raw:Qr,Rule:Gr,Scope:Jr,Selector:to,SelectorList:no,String:so,StyleSheet:co,SupportsDeclaration:ho,TypeSelector:mo,UnicodeRange:bo,Url:vo,Value:Co,WhiteSpace:Lo},Symbol.toStringTag,{value:"Module"})),Uf={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.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:Lf,atrule:$f,pseudo:Hf,node:Bf},Vf=of(Uf);function Re(e){const t={};for(const n of Object.keys(e)){let i=e[n];i&&(Array.isArray(i)||i instanceof G?i=i.map(Re):i.constructor===Object&&(i=Re(i))),t[n]=i}return t}let qf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dt=(e=21)=>{let t="",n=e|0;for(;n--;)t+=qf[Math.random()*64|0];return t};const Go=dt(),ae=new Set;function je(e){return!!(e&&e.type==="Function"&&e.name==="anchor")}function Pt(e,t=!1){return Vf(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:n=>{t&&ae.add(n)}})}function tt(e){return Kh(e,{mode:"spec"})}function Qf(e){return e.type==="Declaration"}function Xf(e){return e.toArray().reduce((t,n)=>n.type==="Operator"&&n.value===","?(t.push([]),t):(n.type==="Identifier"&&t[t.length-1].push(n),t),[[]])}function vn(e){return e?e.children.map(t=>{var n;let i;((n=t.children.last)==null?void 0:n.type)==="PseudoElementSelector"&&(t=Re(t),i=tt(t.children.last),t.children.pop());const r=tt(t);return{selector:r+(i??""),elementPart:r,pseudoElementPart:i}}).toArray():[]}function Yf(){ae.size>0&&(console.group(`The CSS anchor positioning polyfill was not applied due to ${ae.size===1?"a CSS parse error":"CSS parse errors"}.`),ae.forEach(e=>{console.warn(e.formattedMessage)}),console.groupEnd())}function Gf(){ae.clear()}const wn=[...Eo,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${Go}`,e),{});function Kf(e,t){return Qf(e)&&wn[e.property]&&t?(t.children.appendData(J(U({},e),{property:wn[e.property]})),{updated:!0}):{}}function Jf(e){for(const t of e){let n=!1;const i=Pt(t.css,!0);At(i,{visit:"Declaration",enter(r){var o;const l=(o=this.rule)==null?void 0:o.block,{updated:c}=Kf(r,l);c&&(n=!0)}}),n&&(t.css=tt(i),t.changed=!0)}return e.some(t=>t.changed===!0)}var Ko=(e=>(e.All="all",e.None="none",e))(Ko||{});function st(e,t){var n;return t=(n=wn[t])!=null?n:t,(e instanceof HTMLElement?getComputedStyle(e):e.computedStyle).getPropertyValue(t).trim()}function Gt(e,t,n){return st(e,t)===n}function Zf(e,{selector:t,pseudoElementPart:n}){const i=getComputedStyle(e,n),r=document.createElement("div"),o=document.createElement("style");r.id=`fake-pseudo-element-${dt()}`;for(const c of Array.from(i)){const a=i.getPropertyValue(c);r.style.setProperty(c,a)}o.textContent+=`#${r.id}${n} { content: ${i.content}; }`,o.textContent+=`${t} { display: none !important; }`,document.head.append(o);const l=n==="::before"?"afterbegin":"beforeend";return e.insertAdjacentElement(l,r),{fakePseudoElement:r,sheet:o,computedStyle:i}}function td(e){let t=e;for(;t;){if(Gt(t,"overflow","scroll"))return t;t=t.parentElement}return t}function ed(e){let t=td(e);return t===document.documentElement&&(t=null),t??{scrollTop:0,scrollLeft:0}}function nd(e,t){const{elementPart:n,pseudoElementPart:i}=e,r=[];if(i&&!(i==="::before"||i==="::after"))return r;const o=ce(t.roots,n);if(!i)return r.push(...o),r;for(const l of o){const{fakePseudoElement:c,sheet:a,computedStyle:s}=Zf(l,e),u=c.getBoundingClientRect(),{scrollY:h,scrollX:f}=globalThis,d=ed(l);r.push({fakePseudoElement:c,computedStyle:s,removeFakePseudoElement(){c.remove(),a.remove()},contextElement:l,getBoundingClientRect(){const{scrollY:p,scrollX:m}=globalThis,{scrollTop:y,scrollLeft:k}=d;return DOMRect.fromRect({y:u.y+(h-p)+(d.scrollTop-y),x:u.x+(f-m)+(d.scrollLeft-k),width:u.width,height:u.height})}})}return r}function id(e,t){const n=st(e,"anchor-name");return t?n.split(",").map(i=>i.trim()).includes(t):!n}function rd(e,t){const n=st(e,"anchor-scope");return n===t||n==="all"}const Cn=e=>T(null,null,function*(){var t,n,i;let r=yield(t=nt.getOffsetParent)==null?void 0:t.call(nt,e);return(yield(n=nt.isElement)==null?void 0:n.call(nt,r))||(r=(yield(i=nt.getDocumentElement)==null?void 0:i.call(nt,e))||window.document.documentElement),r}),ce=(e,t)=>e.flatMap(n=>[...n.querySelectorAll(t)]),Jo="InvalidMimeType";function od(e){return!!((e.type==="text/css"||e.rel==="stylesheet")&&e.href)}function sd(e){const t=new URL(e.href,document.baseURI);if(od(e)&&t.origin===location.origin)return t}function ld(e){return T(this,null,function*(){return(yield Promise.all(e.map(t=>T(null,null,function*(){var n;if(!t.url)return t;if((n=t.el)!=null&&n.disabled)return null;try{const i=yield fetch(t.url.toString()),r=i.headers.get("content-type");if(!(r!=null&&r.startsWith("text/css"))){const l=new Error(`Error loading ${t.url}: expected content-type "text/css", got "${r}".`);throw l.name=Jo,l}const o=yield i.text();return J(U({},t),{css:o})}catch(i){if(i instanceof Error&&i.name===Jo)return console.warn(i),null;throw i}})))).filter(t=>t!==null)})}const Zo='[style*="anchor"]',ts='[style*="position-area"]';function ad(e){const t=e?e.filter(i=>i instanceof HTMLElement&&(i.matches(Zo)||i.matches(ts))):Array.from(document.querySelectorAll([Zo,ts].join(","))),n=[];return t.filter(i=>i instanceof HTMLElement).forEach(i=>{const r=dt(12),o="data-has-inline-styles";i.setAttribute(o,r);const l=i.getAttribute("style"),c=`[${o}="${r}"] { ${l} }`;n.push({el:i,css:c})}),n}function cd(e){return T(this,null,function*(){var t,n;const i=(t=e.elements)!=null?t:ce(e.roots,"link, style"),r=[];i.filter(c=>c instanceof HTMLElement).forEach(c=>{if(c.tagName.toLowerCase()==="link"){const a=sd(c);a&&r.push({el:c,url:a})}c.tagName.toLowerCase()==="style"&&r.push({el:c,css:c.innerHTML})});const o=e.excludeInlineStyles?(n=e.elements)!=null?n:[]:void 0,l=ad(o);return yield ld([...r,...l])})}const ud="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let es=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=ud[n[e]&63];return t};const ns="--pa-cascade-property",is="data-anchor-position-wrapper",rs="data-pa-wrapper-for-",os="POLYFILL-POSITION-AREA",hd=["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 ss(e){return hd.includes(e)}const ls={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"]},fd=["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"],dd=["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"],pd=["block-start","center","block-end","span-block-start","span-block-end","span-all"],md=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],gd=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],yd=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],as=["start","center","end","span-start","span-end","span-all"],cs=["self-start","center","self-end","span-self-start","span-self-end","span-all"],kd=["block","top","bottom","y"],bd=["inline","left","right","x"];function xn(e){const t=e.split("-");for(const n of t){if(kd.includes(n))return"block";if(bd.includes(n))return"inline"}return"ambiguous"}function Sd(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const _d=[[fd,dd],[pd,md],[gd,yd],[as,as],[cs,cs]];function vd(e){for(const t of _d)if(Sd(e,t))return!0;return!1}const us=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},wd=(e,t)=>T(null,null,function*(){const n=yield Cn(e);switch(t){case"Logical":case"Physical":return us(n);case"LogicalSelf":case"PhysicalSelf":return us(e);default:return null}}),Ln=e=>e.reverse().map(t=>3-t),hs=(e,t)=>e==="Irrelevant"?t:e,Cd=(e,t)=>T(null,[e,t],function*({block:n,inline:i},r){const o=hs(n[2],i[2]),l=yield wd(r,o),c={block:[n[0],n[1]],inline:[i[0],i[1]]};if(l){if(l.direction==="rtl"&&(c.inline=Ln(c.inline)),l.writingMode.startsWith("vertical")){const a=c.block;c.block=c.inline,c.inline=a}if(l.writingMode.startsWith("sideways")){const a=c.block;c.block=c.inline,c.inline=a,l.writingMode.endsWith("lr")&&(c.block=Ln(c.block))}l.writingMode.endsWith("rl")&&(c.inline=Ln(c.inline))}return c}),xd=({block:e,inline:t})=>{const n=[0,"top","bottom",0],i=[0,"left","right",0];return{block:[n[e[0]],n[e[1]]],inline:[i[t[0]],i[t[1]]]}};function fs([e,t]){return e===0&&t===3?"center":e===0?"end":t===3?"start":"center"}function Ld(e){return e.type==="Declaration"&&e.property==="position-area"}function Ad(e){const t=e.value.children.toArray().map(({name:n})=>n);return t.length===1&&(xn(t[0])==="ambiguous"?t.push(t[0]):t.push("span-all")),t}function Pd(e){if(!Ld(e))return;const t=Ad(e);if(!vd(t))return;const n={};switch(xn(t[0])){case"block":n.block=t[0],n.inline=t[1];break;case"inline":n.inline=t[0],n.block=t[1];break;case"ambiguous":xn(t[1])=="block"?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0]);break}const i={block:ls[n.block],inline:ls[n.inline]},r=`--pa-declaration-${es(12)}`;return{values:n,grid:i,selectorUUID:r}}function Td(e,t){["justify-self","align-self"].forEach(n=>{t.children.appendData({type:"Declaration",property:n,value:{type:"Raw",value:`var(--pa-value-${n})`},important:!1})}),t.children.appendData({type:"Declaration",property:ns,value:{type:"Raw",value:e.selectorUUID},important:!1})}function Ed(e,t){var n,i;let r;if(((n=e.parentElement)==null?void 0:n.tagName)===os)r=e.parentElement;else{r=document.createElement(os),r.style.display="grid",r.style.position="absolute";const o=getComputedStyle(e).pointerEvents;r.style.pointerEvents="none",e.style.pointerEvents=o,["top","left","right","bottom"].forEach(l=>{r.style.setProperty(l,`var(--pa-value-${l})`)}),(i=e.parentElement)==null||i.insertBefore(r,e),r.appendChild(e)}return r.setAttribute(`${rs}${t}`,""),r}function Od(e,t,n){return T(this,null,function*(){const i=`--pa-target-${es(12)}`,r=yield Cd(t.grid,e),o=xd(r),l=hs(t.grid.block[2],t.grid.inline[2]),c=["LogicalSelf","PhysicalSelf"].includes(l)?r:t.grid,a={block:fs([c.block[0],c.block[1]]),inline:fs([c.inline[0],c.inline[1]])};return{insets:o,alignments:a,targetUUID:i,targetEl:e,anchorEl:n,wrapperEl:Ed(e,i),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function Dd(e,t){return`
|
|
22
|
-
[${
|
|
19
|
+
`.repeat(Math.max(i-1,0)),a=" ".repeat(Math.max(r-1,0)),o=(c+a+e).split(/\r\n?|\n|\f/),h=Math.max(1,t-s)-1,u=Math.min(t+s,o.length+1),f=Math.max(4,String(u).length)+1;let d=0;n+=(zs.length-1)*(o[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>bn&&(d=n-Ns+3,n=Ns-2);for(let p=h;p<=u;p++)p>=0&&p<o.length&&(o[p]=o[p].replace(/\t/g,zs),o[p]=(d>0&&o[p].length>d?"…":"")+o[p].substr(d,bn-2)+(o[p].length>d+bn-1?"…":""));return[l(h,t),new Array(n+f+2).join("-")+"^",l(t,u)].filter(Boolean).join(`
|
|
20
|
+
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Bs(e,t,n,i,r,s=1,l=1){return Object.assign(hf("SyntaxError",e),{source:t,offset:n,line:i,column:r,sourceFragment(c){return Ws({source:t,line:i,column:r,baseLine:s,baseColumn:l},isNaN(c)?0:c)},get formattedMessage(){return`Parse error: ${e}
|
|
21
|
+
`+Ws({source:t,line:i,column:r,baseLine:s,baseColumn:l},2)}})}function uf(e){const t=this.createList();let n=!1;const i={recognizer:e};for(;!this.eof;){switch(this.tokenType){case Q:this.next();continue;case z:n=!0,this.next();continue}let r=e.getNode.call(this,i);if(r===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,r,t,i),n=!1),t.push(r)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,i),t}const Hs=()=>{},ff=33,df=35,kn=59,Us=123,Vs=0;function pf(e){return function(){return this[e]()}}function _n(e){const t=Object.create(null);for(const n of Object.keys(e)){const i=e[n],r=i.parse||i;r&&(t[n]=r)}return t}function mf(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:_n(e.atrule),pseudo:_n(e.pseudo),node:_n(e.node)};for(const[n,i]of Object.entries(e.parseContext))switch(typeof i){case"function":t.context[n]=i;break;case"string":t.context[n]=pf(i);break}return U(U({config:t},t),t.node)}function gf(e){let t="",n="<unknown>",i=!1,r=Hs,s=!1;const l=new Ql,c=Object.assign(new Kl,mf(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:uf,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===Us?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===Us||a===kn?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===ff||a===kn?1:0},consumeUntilSemicolonIncluded(a){return a===kn?2:0},createList(){return new K},createSingleNodeList(a){return new K().appendData(a)},getFirstListNode(a){return a&&a.first},getLastListNode(a){return a&&a.last},parseWithFallback(a,o){const h=this.tokenIndex;try{return a.call(this)}catch(u){if(s)throw u;this.skip(h-this.tokenIndex);const f=o.call(this);return s=!0,r(u,f),s=!1,f}},lookupNonWSType(a){let o;do if(o=this.lookupType(a++),o!==z&&o!==Q)return o;while(o!==Vs);return Vs},charCodeAt(a){return a>=0&&a<t.length?t.charCodeAt(a):0},substring(a,o){return t.substring(a,o)},substrToCursor(a){return this.source.substring(a,this.tokenStart)},cmpChar(a,o){return li(t,a,o)},cmpStr(a,o,h){return Le(t,a,o,h)},consume(a){const o=this.tokenStart;return this.eat(a),this.substrToCursor(o)},consumeFunctionName(){const a=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(v),a},consumeNumber(a){const o=t.substring(this.tokenStart,ai(t,this.tokenStart));return this.eat(a),o},eat(a){if(this.tokenType!==a){const o=hi[a].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase());let h=`${/[[\](){}]/.test(o)?`"${o}"`:o} is expected`,u=this.tokenStart;switch(a){case g:this.tokenType===v||this.tokenType===X?(u=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case M:this.isDelim(df)&&(this.next(),u++,h="Name is expected");break;case N:this.tokenType===_&&(u=this.tokenEnd,h="Percent sign is expected");break}this.error(h,u)}this.next()},eatIdent(a){(this.tokenType!==g||this.lookupValue(0,a)===!1)&&this.error(`Identifier "${a}" is expected`),this.next()},eatDelim(a){this.isDelim(a)||this.error(`Delim "${String.fromCharCode(a)}" is expected`),this.next()},getLocation(a,o){return i?l.getLocationRange(a,o,n):null},getLocationFromList(a){if(i){const o=this.getFirstListNode(a),h=this.getLastListNode(a);return l.getLocationRange(o!==null?o.loc.start.offset-l.startOffset:this.tokenStart,h!==null?h.loc.end.offset-l.startOffset:this.tokenStart,n)}return null},error(a,o){const h=typeof o<"u"&&o<t.length?l.getLocation(o):this.eof?l.getLocation(ql(t,t.length-1)):l.getLocation(this.tokenStart);throw new Bs(a||"Unexpected input",t,h.offset,h.line,h.column,l.startLine,l.startColumn)}});return Object.assign(function(a,o){t=a,o=o||{},c.setSource(t,mi),l.setSource(t,o.offset,o.line,o.column),n=o.filename||"<unknown>",i=!!o.positions,r=typeof o.onParseError=="function"?o.onParseError:Hs,s=!1,c.parseAtrulePrelude="parseAtrulePrelude"in o?!!o.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in o?!!o.parseRulePrelude:!0,c.parseValue="parseValue"in o?!!o.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in o?!!o.parseCustomProperty:!1;const{context:h="default",onComment:u}=o;if(!(h in c.context))throw new Error("Unknown context `"+h+"`");typeof u=="function"&&c.forEachToken((d,p,m)=>{if(d===Q){const y=c.getLocation(p,m),b=Le(t,m-2,m,"*/")?t.slice(p+2,m-2):t.slice(p+2,m);u(b,y)}});const f=c.context[h].call(c,o);return c.eof||c.error(),f},{SyntaxError:Bs,config:c.config})}const yf=35,bf=42,qs=43,kf=45,_f=47,Sf=117;function Xs(e){switch(this.tokenType){case M:return this.Hash();case ut:return this.Operator();case O:return this.Parentheses(this.readSequence,e.recognizer);case Ut:return this.Brackets(this.readSequence,e.recognizer);case wt:return this.String();case C:return this.Dimension();case N:return this.Percentage();case _:return this.Number();case v:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case X:return this.Url();case g:return this.cmpChar(this.tokenStart,Sf)&&this.cmpChar(this.tokenStart+1,qs)?this.UnicodeRange():this.Identifier();case A:{const t=this.charCodeAt(this.tokenStart);if(t===_f||t===bf||t===qs||t===kf)return this.Operator();t===yf&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const vf={getNode:Xs},wf=35,Cf=38,xf=42,Lf=43,Af=47,Ys=46,Tf=62,Ef=124,Pf=126;function Of(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function Df(){switch(this.tokenType){case Ut:return this.AttributeSelector();case M:return this.IdSelector();case Y:return this.lookupType(1)===Y?this.PseudoElementSelector():this.PseudoClassSelector();case g:return this.TypeSelector();case _:case N:return this.Percentage();case C:this.charCodeAt(this.tokenStart)===Ys&&this.error("Identifier is expected",this.tokenStart+1);break;case A:{switch(this.charCodeAt(this.tokenStart)){case Lf:case Tf:case Pf:case Af:return this.Combinator();case Ys:return this.ClassSelector();case xf:case Ef:return this.TypeSelector();case wf:return this.IdSelector();case Cf:return this.NestingSelector()}break}}}const Mf={onWhiteSpace:Of,getNode:Df};function If(){return this.createSingleNodeList(this.Raw(null,!1))}function Rf(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===ut){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let i=t-this.tokenIndex;i<=0;i++)if(this.lookupType(i)===z){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function Qs(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}const jf={getNode:Xs,onWhiteSpace(e,t){Qs(e)&&(e.value=" "+e.value),Qs(t.last)&&(t.last.value+=" ")},expression:If,var:Rf},Ff=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:vf,Selector:Mf,Value:jf},Symbol.toStringTag,{value:"Module"})),$f=new Set(["none","and","not","or"]),Nf={parse:{prelude(){const e=this.createList();if(this.tokenType===g){const t=this.substring(this.tokenStart,this.tokenEnd);$f.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},zf={parse:{prelude:null,block(){return this.Block(!0)}}};function Sn(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==k&&this.error()}},t||(()=>this.Raw(null,!0)))}const Ks={layer(){this.skipSC();const e=this.createList(),t=Sn.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Sn.call(this,this.Declaration,()=>Sn.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Wf={parse:{prelude(){const e=this.createList();switch(this.tokenType){case wt:e.push(this.String());break;case X:case v:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===g&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===v&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Ks)),this.skipSC(),this.tokenType===v&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Ks)),(this.lookupNonWSType(0)===g||this.lookupNonWSType(0)===O)&&e.push(this.MediaQueryList()),e},block:null}},Bf={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},Hf={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},Uf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},Vf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},qf={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},Xf={parse:{prelude:null,block(e=!1){return this.Block(e)}}},Yf={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}},Qf={container:Nf,"font-face":zf,import:Wf,layer:Bf,media:Hf,nest:Uf,page:Vf,scope:qf,"starting-style":Xf,supports:Yf};function Kf(){const e=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case g:e.push(this.Identifier());break;case wt:e.push(this.String());break;case ut:e.push(this.Operator());break;case k:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}const It={parse(){return this.createSingleNodeList(this.SelectorList())}},vn={parse(){return this.createSingleNodeList(this.Selector())}},Gf={parse(){return this.createSingleNodeList(this.Identifier())}},Jf={parse:Kf},Ie={parse(){return this.createSingleNodeList(this.Nth())}},Zf={dir:Gf,has:It,lang:Jf,matches:It,is:It,"-moz-any":It,"-webkit-any":It,where:It,not:It,"nth-child":Ie,"nth-last-child":Ie,"nth-last-of-type":Ie,"nth-of-type":Ie,slotted:vn,host:vn,"host-context":vn},td=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:gi,Atrule:ki,AtrulePrelude:Si,AttributeSelector:Ci,Block:Ei,Brackets:Oi,CDC:Mi,CDO:Ri,ClassSelector:Fi,Combinator:zi,Comment:Bi,Condition:Vi,Declaration:Ki,DeclarationList:Ji,Dimension:tr,Feature:nr,FeatureFunction:rr,FeatureRange:cr,Function:ur,GeneralEnclosed:dr,Hash:mr,IdSelector:kr,Identifier:yr,Layer:Sr,LayerList:wr,MediaQuery:xr,MediaQueryList:Ar,NestingSelector:Er,Nth:Or,Number:Mr,Operator:Rr,Parentheses:Fr,Percentage:Nr,PseudoClassSelector:Wr,PseudoElementSelector:Hr,Ratio:Xr,Raw:Qr,Rule:Jr,Scope:ts,Selector:ns,SelectorList:rs,String:as,StyleSheet:us,SupportsDeclaration:ds,TypeSelector:gs,UnicodeRange:_s,Url:ws,Value:xs,WhiteSpace:As},Symbol.toStringTag,{value:"Module"})),ed={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.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:Ff,atrule:Qf,pseudo:Zf,node:td},nd=gf(ed);function Re(e){const t={};for(const n of Object.keys(e)){let i=e[n];i&&(Array.isArray(i)||i instanceof K?i=i.map(Re):i.constructor===Object&&(i=Re(i))),t[n]=i}return t}let id="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dt=(e=21)=>{let t="",n=e|0;for(;n--;)t+=id[Math.random()*64|0];return t};const Gs=dt(),ce=new Set;function je(e){return!!(e&&e.type==="Function"&&e.name==="anchor")}function Tt(e,t=!1){return nd(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:n=>{t&&ce.add(n)}})}function tt(e){return cf(e,{mode:"spec"})}function rd(e){return e.type==="Declaration"}function sd(e){return e.toArray().reduce((t,n)=>n.type==="Operator"&&n.value===","?(t.push([]),t):(n.type==="Identifier"&&t[t.length-1].push(n),t),[[]])}function wn(e){return e?e.children.map(t=>{var n;let i;((n=t.children.last)==null?void 0:n.type)==="PseudoElementSelector"&&(t=Re(t),i=tt(t.children.last),t.children.pop());const r=tt(t);return{selector:r+(i??""),elementPart:r,pseudoElementPart:i}}).toArray():[]}function od(){ce.size>0&&(console.group(`The CSS anchor positioning polyfill was not applied due to ${ce.size===1?"a CSS parse error":"CSS parse errors"}.`),ce.forEach(e=>{console.warn(e.formattedMessage)}),console.groupEnd())}function ld(){ce.clear()}const Cn=[...Os,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${Gs}`,e),{});function ad(e,t){return rd(e)&&Cn[e.property]&&t?(t.children.appendData(J(U({},e),{property:Cn[e.property]})),{updated:!0}):{}}function cd(e){for(const t of e){let n=!1;const i=Tt(t.css,!0);At(i,{visit:"Declaration",enter(r){var s;const l=(s=this.rule)==null?void 0:s.block,{updated:c}=ad(r,l);c&&(n=!0)}}),n&&(t.css=tt(i),t.changed=!0)}return e.some(t=>t.changed===!0)}var Js=(e=>(e.All="all",e.None="none",e))(Js||{});function ot(e,t){var n;return t=(n=Cn[t])!=null?n:t,(e instanceof HTMLElement?getComputedStyle(e):e.computedStyle).getPropertyValue(t).trim()}function Gt(e,t,n){return ot(e,t)===n}function hd(e,{selector:t,pseudoElementPart:n}){const i=getComputedStyle(e,n),r=document.createElement("div"),s=document.createElement("style");r.id=`fake-pseudo-element-${dt()}`;for(const c of Array.from(i)){const a=i.getPropertyValue(c);r.style.setProperty(c,a)}s.textContent+=`#${r.id}${n} { content: ${i.content}; }`,s.textContent+=`${t} { display: none !important; }`,document.head.append(s);const l=n==="::before"?"afterbegin":"beforeend";return e.insertAdjacentElement(l,r),{fakePseudoElement:r,sheet:s,computedStyle:i}}function ud(e){let t=e;for(;t;){if(Gt(t,"overflow","scroll"))return t;t=t.parentElement}return t}function fd(e){let t=ud(e);return t===document.documentElement&&(t=null),t??{scrollTop:0,scrollLeft:0}}function dd(e,t){const{elementPart:n,pseudoElementPart:i}=e,r=[];if(i&&!(i==="::before"||i==="::after"))return r;const s=he(t.roots,n);if(!i)return r.push(...s),r;for(const l of s){const{fakePseudoElement:c,sheet:a,computedStyle:o}=hd(l,e),h=c.getBoundingClientRect(),{scrollY:u,scrollX:f}=globalThis,d=fd(l);r.push({fakePseudoElement:c,computedStyle:o,removeFakePseudoElement(){c.remove(),a.remove()},contextElement:l,getBoundingClientRect(){const{scrollY:p,scrollX:m}=globalThis,{scrollTop:y,scrollLeft:b}=d;return DOMRect.fromRect({y:h.y+(u-p)+(d.scrollTop-y),x:h.x+(f-m)+(d.scrollLeft-b),width:h.width,height:h.height})}})}return r}function pd(e,t){const n=ot(e,"anchor-name");return t?n.split(",").map(i=>i.trim()).includes(t):!n}function md(e,t){const n=ot(e,"anchor-scope");return n===t||n==="all"}const xn=e=>P(null,null,function*(){var t,n,i;let r=yield(t=nt.getOffsetParent)==null?void 0:t.call(nt,e);return(yield(n=nt.isElement)==null?void 0:n.call(nt,r))||(r=(yield(i=nt.getDocumentElement)==null?void 0:i.call(nt,e))||window.document.documentElement),r}),he=(e,t)=>e.flatMap(n=>[...n.querySelectorAll(t)]),Zs="InvalidMimeType";function gd(e){return!!((e.type==="text/css"||e.rel==="stylesheet")&&e.href)}function yd(e){const t=new URL(e.href,document.baseURI);if(gd(e)&&t.origin===location.origin)return t}function bd(e){return P(this,null,function*(){return(yield Promise.all(e.map(t=>P(null,null,function*(){var n;if(!t.url)return t;if((n=t.el)!=null&&n.disabled)return null;try{const i=yield fetch(t.url.toString()),r=i.headers.get("content-type");if(!(r!=null&&r.startsWith("text/css"))){const l=new Error(`Error loading ${t.url}: expected content-type "text/css", got "${r}".`);throw l.name=Zs,l}const s=yield i.text();return J(U({},t),{css:s})}catch(i){if(i instanceof Error&&i.name===Zs)return console.warn(i),null;throw i}})))).filter(t=>t!==null)})}const to='[style*="anchor"]',eo='[style*="position-area"]';function kd(e){const t=e?e.filter(i=>i instanceof HTMLElement&&(i.matches(to)||i.matches(eo))):Array.from(document.querySelectorAll([to,eo].join(","))),n=[];return t.filter(i=>i instanceof HTMLElement).forEach(i=>{const r=dt(12),s="data-has-inline-styles";i.setAttribute(s,r);const l=i.getAttribute("style"),c=`[${s}="${r}"] { ${l} }`;n.push({el:i,css:c})}),n}function _d(e){return P(this,null,function*(){var t,n;const i=(t=e.elements)!=null?t:he(e.roots,"link, style"),r=[];i.filter(c=>c instanceof HTMLElement).forEach(c=>{if(c.tagName.toLowerCase()==="link"){const a=yd(c);a&&r.push({el:c,url:a})}c.tagName.toLowerCase()==="style"&&r.push({el:c,css:c.innerHTML})});const s=e.excludeInlineStyles?(n=e.elements)!=null?n:[]:void 0,l=kd(s);return yield bd([...r,...l])})}const Sd="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let no=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Sd[n[e]&63];return t};const io="--pa-cascade-property",ro="data-anchor-position-wrapper",so="data-pa-wrapper-for-",oo="POLYFILL-POSITION-AREA",vd=["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 lo(e){return vd.includes(e)}const ao={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"]},wd=["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"],Cd=["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"],xd=["block-start","center","block-end","span-block-start","span-block-end","span-all"],Ld=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],Ad=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],Td=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],co=["start","center","end","span-start","span-end","span-all"],ho=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Ed=["block","top","bottom","y"],Pd=["inline","left","right","x"];function Ln(e){const t=e.split("-");for(const n of t){if(Ed.includes(n))return"block";if(Pd.includes(n))return"inline"}return"ambiguous"}function Od(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const Dd=[[wd,Cd],[xd,Ld],[Ad,Td],[co,co],[ho,ho]];function Md(e){for(const t of Dd)if(Od(e,t))return!0;return!1}const uo=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},Id=(e,t)=>P(null,null,function*(){const n=yield xn(e);switch(t){case"Logical":case"Physical":return uo(n);case"LogicalSelf":case"PhysicalSelf":return uo(e);default:return null}}),An=e=>e.reverse().map(t=>3-t),fo=(e,t)=>e==="Irrelevant"?t:e,Rd=(e,t)=>P(null,[e,t],function*({block:n,inline:i},r){const s=fo(n[2],i[2]),l=yield Id(r,s),c={block:[n[0],n[1]],inline:[i[0],i[1]]};if(l){if(l.direction==="rtl"&&(c.inline=An(c.inline)),l.writingMode.startsWith("vertical")){const a=c.block;c.block=c.inline,c.inline=a}if(l.writingMode.startsWith("sideways")){const a=c.block;c.block=c.inline,c.inline=a,l.writingMode.endsWith("lr")&&(c.block=An(c.block))}l.writingMode.endsWith("rl")&&(c.inline=An(c.inline))}return c}),jd=({block:e,inline:t})=>{const n=[0,"top","bottom",0],i=[0,"left","right",0];return{block:[n[e[0]],n[e[1]]],inline:[i[t[0]],i[t[1]]]}};function po([e,t]){return e===0&&t===3?"center":e===0?"end":t===3?"start":"center"}function Fd(e){return e.type==="Declaration"&&e.property==="position-area"}function $d(e){const t=e.value.children.toArray().map(({name:n})=>n);return t.length===1&&(Ln(t[0])==="ambiguous"?t.push(t[0]):t.push("span-all")),t}function Nd(e){if(!Fd(e))return;const t=$d(e);if(!Md(t))return;const n={};switch(Ln(t[0])){case"block":n.block=t[0],n.inline=t[1];break;case"inline":n.inline=t[0],n.block=t[1];break;case"ambiguous":Ln(t[1])=="block"?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0]);break}const i={block:ao[n.block],inline:ao[n.inline]},r=`--pa-declaration-${no(12)}`;return{values:n,grid:i,selectorUUID:r}}function zd(e,t){["justify-self","align-self"].forEach(n=>{t.children.appendData({type:"Declaration",property:n,value:{type:"Raw",value:`var(--pa-value-${n})`},important:!1})}),t.children.appendData({type:"Declaration",property:io,value:{type:"Raw",value:e.selectorUUID},important:!1})}function Wd(e,t){var n,i;let r;if(((n=e.parentElement)==null?void 0:n.tagName)===oo)r=e.parentElement;else{r=document.createElement(oo),r.style.display="grid",r.style.position="absolute";const s=getComputedStyle(e).pointerEvents;r.style.pointerEvents="none",e.style.pointerEvents=s,["top","left","right","bottom"].forEach(l=>{r.style.setProperty(l,`var(--pa-value-${l})`)}),(i=e.parentElement)==null||i.insertBefore(r,e),r.appendChild(e)}return r.setAttribute(`${so}${t}`,""),r}function Bd(e,t,n){return P(this,null,function*(){const i=`--pa-target-${no(12)}`,r=yield Rd(t.grid,e),s=jd(r),l=fo(t.grid.block[2],t.grid.inline[2]),c=["LogicalSelf","PhysicalSelf"].includes(l)?r:t.grid,a={block:po([c.block[0],c.block[1]]),inline:po([c.inline[0],c.inline[1]])};return{insets:s,alignments:a,targetUUID:i,targetEl:e,anchorEl:n,wrapperEl:Wd(e,i),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function Hd(e,t){return`
|
|
22
|
+
[${ro}="${t}"][${so}${e}] {
|
|
23
23
|
--pa-value-top: var(${e}-top);
|
|
24
24
|
--pa-value-left: var(${e}-left);
|
|
25
25
|
--pa-value-right: var(${e}-right);
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
--pa-value-align-self: var(${e}-align-self);
|
|
29
29
|
}
|
|
30
30
|
`.replaceAll(`
|
|
31
|
-
`,"")}const Md=["normal","most-width","most-height","most-block-size","most-inline-size"],Id=["flip-block","flip-inline","flip-start"];function Rd(e){return e.type==="Declaration"}function jd(e){return e.type==="Declaration"&&e.property==="position-try-fallbacks"}function Fd(e){return e.type==="Declaration"&&e.property==="position-try-order"}function $d(e){return e.type==="Declaration"&&e.property==="position-try"}function zd(e){return e.type==="Atrule"&&e.name==="position-try"}function Nd(e){return Id.includes(e)}function Wd(e){return Md.includes(e)}function Hd(e,t){const n=document.querySelector(e);if(n){let i=Ud(n);return t.forEach(r=>{i=ds(i,r)}),i}}function Bd(e,t){let n=e.declarations;return t.forEach(i=>{n=ds(n,i)}),n}function Ud(e){const t={};return Eo.forEach(n=>{const i=st(e,`--${n}-${Go}`);i&&(t[n]=i)}),t}const Vd={"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"}},qd={"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"}},Qd={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};function Xd(e,t){return Vd[t][e]||e}function Yd(e,t){return qd[t][e]||e}function Gd(e,t){if(t==="flip-start")return e;{const n=Qd[t];return e.split("-").map(i=>n[i]||i).join("-")}}function Kd(e,t,n){if(e==="margin"){const[i,r,o,l]=t.children.toArray();n==="flip-block"?l?t.children.fromArray([o,r,i,l]):o&&t.children.fromArray([o,r,i]):n==="flip-inline"&&l&&t.children.fromArray([i,l,o,r])}else if(e==="margin-block"){const[i,r]=t.children.toArray();n==="flip-block"&&r&&t.children.fromArray([r,i])}else if(e==="margin-inline"){const[i,r]=t.children.toArray();n==="flip-inline"&&r&&t.children.fromArray([r,i])}}const Jd=(e,t)=>{var n;return((n=Pt(`#id{${e}: ${t};}`).children.first)==null?void 0:n.block.children.first).value};function ds(e,t){const n={};return Object.entries(e).forEach(([i,r])=>{const o=i,l=Jd(o,r),c=Xd(o,t);c!==o&&(n[o]!=null||(n[o]="revert")),At(l,{visit:"Function",enter(a){je(a)&&a.children.forEach(s=>{ue(s)&&Do(s.name)&&(s.name=Yd(s.name,t))})}}),o==="position-area"&&l.children.forEach(a=>{ue(a)&&ss(a.name)&&(a.name=Gd(a.name,t))}),o.startsWith("margin")&&Kd(o,l,t),n[c]=tt(l)}),n}function ps(e){const t=Xf(e),n=[];return t.forEach(i=>{const r={atRules:[],tactics:[],positionAreas:[]};i.forEach(o=>{Nd(o.name)?r.tactics.push(o.name):o.name.startsWith("--")?r.atRules.push(o.name):ss(o.name)&&r.positionAreas.push(o.name)}),r.positionAreas.length?n.push({positionArea:r.positionAreas[0],type:"position-area"}):r.atRules.length&&r.tactics.length?n.push({tactics:r.tactics,atRule:r.atRules[0],type:"at-rule-with-try-tactic"}):r.atRules.length?n.push({atRule:r.atRules[0],type:"at-rule"}):r.tactics.length&&n.push({tactics:r.tactics,type:"try-tactic"})}),n}function Zd(e){return jd(e)&&e.value.children.first?ps(e.value.children):[]}function tp(e){if($d(e)&&e.value.children.first){const t=Re(e);let n;const i=t.value.children.first.name;i&&Wd(i)&&(n=i,t.value.children.shift());const r=ps(t.value.children);return{order:n,options:r}}return{}}function ep(e){return Fd(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function np(e){const{order:t,options:n}=tp(e);if(t||n)return{order:t,options:n};const{order:i}=ep(e),r=Zd(e);return i||r?{order:i,options:r}:{}}function ip(e){return le(e.property)||Ih(e.property)||Po(e.property)||Rh(e.property)||["position-anchor","position-area"].includes(e.property)}function rp(e){var t,n;if(zd(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){const i=e.prelude.value,r=e.block.children.filter(l=>Rd(l)&&ip(l)),o={uuid:`${i}-try-${dt(12)}`,declarations:Object.fromEntries(r.map(l=>[l.property,tt(l.value)]))};return{name:i,tryBlock:o}}return{}}function op(e){const t={},n={},i={};for(const r of e){const o=Pt(r.css);At(o,{visit:"Atrule",enter(l){const{name:c,tryBlock:a}=rp(l);c&&a&&(t[c]=a)}})}for(const r of e){let o=!1;const l=new Set,c=Pt(r.css);At(c,{visit:"Declaration",enter(a){var s;const u=(s=this.rule)==null?void 0:s.prelude,h=vn(u);if(!h.length)return;const{order:f,options:d}=np(a),p={};f&&(p.order=f),h.forEach(({selector:m})=>{var y;d?.forEach(k=>{var x;let w;if(k.type==="at-rule")w=k.atRule;else if(k.type==="try-tactic"){w=`${m}-${k.tactics.join("-")}`;const A=Hd(m,k.tactics);A&&(t[w]={uuid:`${m}-${k.tactics.join("-")}-try-${dt(12)}`,declarations:A})}else if(k.type==="at-rule-with-try-tactic"){w=`${m}-${k.atRule}-${k.tactics.join("-")}`;const A=t[k.atRule],pt=Bd(A,k.tactics);pt&&(t[w]={uuid:`${m}-${k.atRule}-${k.tactics.join("-")}-try-${dt(12)}`,declarations:pt})}if(w&&t[w]){const A=`[data-anchor-polyfill="${t[w].uuid}"]`;n[A]!=null||(n[A]=[]),n[A].push(m),l.has(w)||(p.fallbacks!=null||(p.fallbacks=[]),p.fallbacks.push(t[w]),l.add(w),(x=this.stylesheet)==null||x.children.prependData({type:"Rule",prelude:{type:"Raw",value:A},block:{type:"Block",children:new G().fromArray(Object.entries(t[w].declarations).map(([pt,_])=>({type:"Declaration",important:!0,property:pt,value:{type:"Raw",value:_}})))}}),o=!0)}}),Object.keys(p).length>0&&(i[m]?(p.order&&(i[m].order=p.order),p.fallbacks&&((y=i[m]).fallbacks!=null||(y.fallbacks=[]),i[m].fallbacks.push(...p.fallbacks))):i[m]=p)})}}),o&&(r.css=tt(c),r.changed=!0)}return{fallbackTargets:n,validPositions:i}}function sp(e,t){return!e||e===t?!1:ms(e)?e.document.contains(t):e.contains(t)}function ms(e){return!!(e&&e===e.window)}function lp(e){return Gt(e,"position","fixed")}function An(e){return!!(e&&(lp(e)||Gt(e,"position","absolute")))}function gs(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function ap(e){return T(this,null,function*(){return yield nt.getOffsetParent(e)})}function Pn(e){return T(this,null,function*(){if(!["absolute","fixed"].includes(st(e,"position")))return yield ap(e);let t=e.parentElement;for(;t;){if(!Gt(t,"position","static")&&Gt(t,"display","block"))return t;t=t.parentElement}return window})}function cp(e,t,n,i){return T(this,null,function*(){const r=yield Pn(e),o=yield Pn(n);if(!(sp(o,e)||ms(o))||r===o&&!(!An(e)||gs(e,n)))return!1;if(r!==o){let l;const c=[];for(l=r;l&&l!==o&&l!==window;)c.push(l),l=yield Pn(l);const a=c[c.length-1];if(a instanceof HTMLElement&&!(!An(a)||gs(a,n)))return!1}{let l=e.parentElement;for(;l;){if(Gt(l,"content-visibility","hidden"))return!1;l=l.parentElement}}return!(t&&i&&ys(e,t,i)!==ys(n,t,i))})}function ys(e,t,n){for(;!(e.matches(n)&&rd(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function up(e,t,n,i,r){return T(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&An(e)))return null;const o=n.flatMap(c=>nd(c,r)).filter(c=>id(c,t)),l=i.map(c=>c.selector).join(",")||null;for(let c=o.length-1;c>=0;c--){const a=o[c],s="fakePseudoElement"in a;if(yield cp(s?a.fakePseudoElement:a,t,e,l))return s&&a.removeFakePseudoElement(),a}return null})}function hp(e){return e.type==="Declaration"&&e.property==="anchor-name"}function fp(e){return e.type==="Declaration"&&e.property==="anchor-scope"}function Tn(e){return!!(e&&e.type==="Function"&&e.name==="anchor-size")}function Fe(e){return!!(e&&e.type==="Function"&&e.name==="var")}function ue(e){return!!(e.type==="Identifier"&&e.name)}function dp(e){return!!(e.type==="Percentage"&&e.value)}function ks(e,t){let n,i,r,o="",l=!1,c;const a=[];e.children.toArray().forEach(f=>{if(l){o=`${o}${tt(f)}`;return}if(f.type==="Operator"&&f.value===","){l=!0;return}a.push(f)});let[s,u]=a;if(u||(u=s,s=void 0),s&&(ue(s)&&s.name.startsWith("--")?n=s.name:Fe(s)&&s.children.first&&(c=s.children.first.name)),u)if(je(e)){if(ue(u)&&Do(u.name))i=u.name;else if(dp(u)){const f=Number(u.value);i=Number.isNaN(f)?void 0:f}}else Tn(e)&&ue(u)&&zh(u.name)&&(r=u.name);const h=`--anchor-${dt(12)}`;return Object.assign(e,{type:"Raw",value:`var(${h})`,children:null}),Reflect.deleteProperty(e,"name"),{anchorName:n,anchorSide:i,anchorSize:r,fallbackValue:o||"0px",customPropName:c,uuid:h}}function bs(e){return e.value.children.map(({name:t})=>t)}let he={},It={},Rt={},fe={},jt={};function pp(){he={},It={},Rt={},fe={},jt={}}function mp(e,t){var n;if((je(e)||Tn(e))&&t){if(t.property.startsWith("--")){const i=tt(t.value),r=ks(e);return fe[r.uuid]=i,Rt[t.property]=[...(n=Rt[t.property])!=null?n:[],r],{changed:!0}}if(je(e)&&le(t.property)||Tn(e)&&Oo(t.property)){const i=ks(e);return{prop:t.property,data:i,changed:!0}}}return{}}function Ss(e,t,n){return T(this,null,function*(){let i=t?.anchorName;const r=t?.customPropName;if(e&&!i){const a=st(e,"position-anchor");a?i=a:r&&(i=st(e,r))}const o=i?he[i]||[]:[],l=i?It[Ko.All]||[]:[],c=i?It[i]||[]:[];return yield up(e,i||null,o,[...l,...c],{roots:n.roots})})}function gp(e,t){return T(this,null,function*(){var n,i,r,o,l,c,a,s,u,h,f;const d={},p={};pp();const{fallbackTargets:m,validPositions:y}=op(e);for(const _ of e){let I=!1;const W=Pt(_.css);At(W,function(P){var H,R,O,V;const M=(H=this.rule)==null?void 0:H.prelude,j=vn(M);if(hp(P)&&j.length)for(const F of bs(P))he[F]!=null||(he[F]=[]),he[F].push(...j);if(fp(P)&&j.length)for(const F of bs(P))It[F]!=null||(It[F]=[]),It[F].push(...j);const{prop:K,data:vt,changed:Ft}=mp(P,this.declaration);if(K&&vt&&j.length)for(const{selector:F}of j)d[F]=J(U({},d[F]),{[K]:[...(O=(R=d[F])==null?void 0:R[K])!=null?O:[],vt]});let q;if(this.block&&(q=Pd(P),q)){Td(q,this.block);for(const{selector:F}of j)p[F]=[...(V=p[F])!=null?V:[],q]}(Ft||q)&&(I=!0)}),I&&(_.css=tt(W),_.changed=!0)}const k=new Set(Object.keys(Rt)),x={},w=_=>{var I,W,P,H,R;const O=[],V=new Set((W=(I=x[_])==null?void 0:I.names)!=null?W:[]);for(;V.size>0;)for(const M of V)O.push(...(P=Rt[M])!=null?P:[]),V.delete(M),(R=(H=x[M])==null?void 0:H.names)!=null&&R.length&&x[M].names.forEach(j=>V.add(j));return O};for(;k.size>0;){const _=[];for(const I of e){let W=!1;const P=Pt(I.css);At(P,{visit:"Function",enter(H){var R,O;const V=(R=this.rule)==null?void 0:R.prelude,M=this.declaration,j=M?.property;if(V?.children.isEmpty===!1&&Fe(H)&&M&&j&&H.children.first&&k.has(H.children.first.name)&&j.startsWith("--")){const K=H.children.first,vt=(O=Rt[K.name])!=null?O:[],Ft=w(K.name);if(!(vt.length||Ft.length))return;const q=`${K.name}-anchor-${dt(12)}`,F=tt(M.value);fe[q]=F,x[j]||(x[j]={names:[],uuids:[]});const Kt=x[j];Kt.names.includes(K.name)||Kt.names.push(K.name),Kt.uuids.push(q),_.push(j),K.name=q,W=!0}}}),W&&(I.css=tt(P),I.changed=!0)}k.clear(),_.forEach(I=>k.add(I))}for(const _ of e){let I=!1;const W=Pt(_.css);At(W,{visit:"Function",enter(P){var H,R,O,V,M,j,K;const vt=(H=this.rule)==null?void 0:H.prelude,Ft=this.declaration,q=Ft?.property;if(vt?.children.isEmpty===!1&&Fe(P)&&Ft&&q&&P.children.first&&(le(q)||Po(q))){const F=P.children.first,Kt=(R=Rt[F.name])!=null?R:[],On=w(F.name);if(!(Kt.length||On.length))return;const ze=`${q}-${dt(12)}`;if(On.length){const Jt=new Set([F.name]);for(;Jt.size>0;)for(const Zt of Jt){const lt=x[Zt];if((O=lt?.names)!=null&&O.length&&(V=lt?.uuids)!=null&&V.length)for(const te of lt.names)for(const ee of lt.uuids)jt[ee]=J(U({},jt[ee]),{[ze]:`${te}-${ze}`});Jt.delete(Zt),(M=lt?.names)!=null&&M.length&<.names.forEach(te=>Jt.add(te))}}const Op=vn(vt);for(const Jt of[...Kt,...On]){const Zt=U({},Jt),lt=`--anchor-${dt(12)}-${q}`,te=Zt.uuid;Zt.uuid=lt;for(const{selector:ee}of Op)d[ee]=J(U({},d[ee]),{[q]:[...(K=(j=d[ee])==null?void 0:j[q])!=null?K:[],Zt]});jt[te]=J(U({},jt[te]),{[ze]:lt})}F.name=`${F.name}-${ze}`,I=!0}}}),I&&(_.css=tt(W),_.changed=!0)}if(Object.keys(jt).length>0)for(const _ of e){let I=!1;const W=Pt(_.css);At(W,{visit:"Function",enter(P){var H,R,O,V;if(Fe(P)&&(R=(H=P.children.first)==null?void 0:H.name)!=null&&R.startsWith("--")&&(V=(O=this.declaration)==null?void 0:O.property)!=null&&V.startsWith("--")&&this.block){const M=P.children.first,j=jt[M.name];if(j)for(const[K,vt]of Object.entries(j))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${K}`,value:{type:"Raw",value:tt(this.declaration.value).replace(`var(${M.name})`,`var(${vt})`)}}),I=!0;fe[M.name]&&(this.declaration.value={type:"Raw",value:fe[M.name]},I=!0)}}}),I&&(_.css=tt(W),_.changed=!0)}const A=new Map;for(const[_,I]of Object.entries(d)){let W;_.startsWith("[data-anchor-polyfill=")&&(n=m[_])!=null&&n.length?W=ce(t.roots,m[_].join(",")):W=ce(t.roots,_);for(const[P,H]of Object.entries(I))for(const R of H)for(const O of W){const V=yield Ss(O,R,{roots:t.roots}),M=`--anchor-${dt(12)}`;A.set(O,J(U({},(i=A.get(O))!=null?i:{}),{[R.uuid]:M})),O.setAttribute("style",`${R.uuid}: var(${M}); ${(r=O.getAttribute("style"))!=null?r:""}`),y[_]=J(U({},y[_]),{declarations:J(U({},(o=y[_])==null?void 0:o.declarations),{[P]:[...(a=(c=(l=y[_])==null?void 0:l.declarations)==null?void 0:c[P])!=null?a:[],J(U({},R),{anchorEl:V,targetEl:O,uuid:M})]})})}}const pt={el:document.createElement("link"),changed:!1,created:!0,css:""};e.push(pt);for(const[_,I]of Object.entries(p)){const W=ce(t.roots,_);for(const P of W){const H=yield Ss(P,null,{roots:t.roots});for(const R of I){const O=yield Od(P,R,H);pt.css+=Dd(O.targetUUID,R.selectorUUID),pt.changed=!0,y[_]=J(U({},y[_]),{declarations:J(U({},(s=y[_])==null?void 0:s.declarations),{"position-area":[...(f=(h=(u=y[_])==null?void 0:u.declarations)==null?void 0:h["position-area"])!=null?f:[],O]})})}}}return{rules:y,inlineStyles:A,anchorScopes:It}})}const yp=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function _s(e,t,n=!1){const i=[];for(const{el:r,css:o,changed:l,created:c=!1}of e){const a={el:r,css:o,changed:!1};if(l){if(r.tagName.toLowerCase()==="style")r.innerHTML=o;else if(r instanceof HTMLLinkElement){const s=document.createElement("style");s.textContent=o;for(const u of r.getAttributeNames())if(!u.startsWith("on")&&!yp.includes(u)){const h=r.getAttribute(u);h!==null&&s.setAttribute(u,h)}r.hasAttribute("href")&&s.setAttribute("data-original-href",r.getAttribute("href")),c?(s.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",s)):(r.insertAdjacentElement("beforebegin",s),r.remove()),a.el=s}else if(r.hasAttribute("data-has-inline-styles")){const s=r.getAttribute("data-has-inline-styles");if(s){const u=`[data-has-inline-styles="${s}"]{`;let h=o.slice(u.length,-1);const f=t?.get(r);if(f)for(const[d,p]of Object.entries(f))h=`${d}: var(${p}); ${h}`;r.setAttribute("style",h)}}}n&&r.hasAttribute("data-has-inline-styles")&&r.removeAttribute("data-has-inline-styles"),i.push(a)}return i}const kp=J(U({},nt),{_c:new Map}),bp=(e,t)=>{let n;switch(e){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:typeof e=="number"&&!Number.isNaN(e)&&(n=e)}if(n!==void 0)return t?100-n:n},Sp=(e,t)=>{let n;switch(e){case"block":case"self-block":n=t?"width":"height";break;case"inline":case"self-inline":n=t?"height":"width";break}return n},vs=e=>{switch(e){case"top":case"bottom":return"y";case"left":case"right":return"x"}return null},_p=e=>{switch(e){case"x":return"width";case"y":return"height"}return null},ws=e=>st(e,"display")==="inline",Cs=(e,t)=>(t==="x"?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce((n,i)=>n+parseInt(st(e,i),10),0)||0,$e=(e,t)=>parseInt(st(e,`margin-${t}`),10)||0,vp=e=>({top:$e(e,"top"),right:$e(e,"right"),bottom:$e(e,"bottom"),left:$e(e,"left")}),En=e=>T(null,[e],function*({targetEl:t,targetProperty:n,anchorRect:i,anchorSide:r,anchorSize:o,fallback:l=null}){var c;if(!((o||r!==void 0)&&t&&i))return l;if(o){if(!Oo(n))return l;let a;switch(o){case"width":case"height":a=o;break;default:{let s=!1;const u=st(t,"writing-mode");s=u.startsWith("vertical-")||u.startsWith("sideways-"),a=Sp(o,s)}}return a?`${i[a]}px`:l}if(r!==void 0){let a,s;const u=vs(n);if(!(le(n)&&u&&(!le(r)||u===vs(r))))return l;const h=["top","left"];switch(r){case"left":case"top":a=0;break;case"right":case"bottom":a=100;break;case"center":a=50;break;case"inside":a=h.includes(n)?0:100;break;case"outside":a=h.includes(n)?100:0;break;default:if(t){const p=(yield(c=nt.isRTL)==null?void 0:c.call(nt,t))||!1;a=bp(r,p)}}const f=typeof a=="number"&&!Number.isNaN(a),d=_p(u);if(f&&d){(n==="bottom"||n==="right")&&(s=yield Cn(t));let p=i[u]+i[d]*(a/100);switch(n){case"bottom":{if(!s)break;let m=s.clientHeight;if(m===0&&ws(s)){const y=Cs(s,u);m=s.offsetHeight-y}p=m-p;break}case"right":{if(!s)break;let m=s.clientWidth;if(m===0&&ws(s)){const y=Cs(s,u);m=s.offsetWidth-y}p=m-p;break}}return`${p}px`}}return l}),wp=e=>"wrapperEl"in e,Cp=e=>"uuid"in e;function xp(e,t=!1){return T(this,null,function*(){const n=document.documentElement;for(const[i,r]of Object.entries(e))for(const o of r){const l=o.anchorEl,c=o.targetEl;if(l&&c)if(wp(o)){const a=o.wrapperEl,s=(u,h,f)=>T(null,null,function*(){return u===0?"0px":yield En({targetEl:a,targetProperty:h,anchorRect:f,anchorSide:u})});Qe(l,a,()=>T(null,null,function*(){const u=st(c,ns);a.setAttribute(is,u);const h=yield nt.getElementRects({reference:l,floating:a,strategy:"absolute"}),f=o.insets,d=yield s(f.block[0],"top",h.reference),p=yield s(f.block[1],"bottom",h.reference),m=yield s(f.inline[0],"left",h.reference),y=yield s(f.inline[1],"right",h.reference);n.style.setProperty(`${o.targetUUID}-top`,d||null),n.style.setProperty(`${o.targetUUID}-left`,m||null),n.style.setProperty(`${o.targetUUID}-right`,y||null),n.style.setProperty(`${o.targetUUID}-bottom`,p||null),n.style.setProperty(`${o.targetUUID}-justify-self`,o.alignments.inline),n.style.setProperty(`${o.targetUUID}-align-self`,o.alignments.block)}),{animationFrame:t})}else Qe(l,c,()=>T(null,null,function*(){const a=yield nt.getElementRects({reference:l,floating:c,strategy:"absolute"}),s=yield En({targetEl:c,targetProperty:i,anchorRect:a.reference,anchorSide:o.anchorSide,anchorSize:o.anchorSize,fallback:o.fallbackValue});n.style.setProperty(o.uuid,s)}),{animationFrame:t});else if(Cp(o)){const a=yield En({targetProperty:i,anchorSide:o.anchorSide,anchorSize:o.anchorSize,fallback:o.fallbackValue});n.style.setProperty(o.uuid,a)}}})}function xs(e,t){return T(this,null,function*(){const n=yield nt.getElementRects({reference:e,floating:e,strategy:"absolute"});return yield Cl({x:e.offsetLeft,y:e.offsetTop,platform:kp,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:vp(e)})})}function Lp(e,t,n=!1){return T(this,null,function*(){if(!t.length)return;const i=document.querySelectorAll(e);for(const r of i){let o=!1;const l=yield Cn(r);Qe({},r,()=>T(null,null,function*(){if(o)return;o=!0,r.removeAttribute("data-anchor-polyfill");const c=yield xs(r,l);if(Object.values(c).every(a=>a<=0)){r.removeAttribute("data-anchor-polyfill-last-successful"),o=!1;return}for(const[a,{uuid:s}]of t.entries()){r.setAttribute("data-anchor-polyfill",s);const u=yield xs(r,l);if(Object.values(u).every(h=>h<=0)){r.setAttribute("data-anchor-polyfill-last-successful",s),o=!1;break}if(a===t.length-1){const h=r.getAttribute("data-anchor-polyfill-last-successful");h?r.setAttribute("data-anchor-polyfill",h):r.removeAttribute("data-anchor-polyfill"),o=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function Ap(e,t=!1){return T(this,null,function*(){var n,i;for(const r of Object.values(e))yield xp((n=r.declarations)!=null?n:{},t);for(const[r,o]of Object.entries(e))yield Lp(r,(i=o.fallbacks)!=null?i:[],t)})}function Pp(e={}){const t=typeof e=="boolean"?{useAnimationFrame:e}:e,n=t.useAnimationFrame===void 0?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||t.roots.length===0)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}function Tp(e){return T(this,null,function*(){const t=Pp(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n=yield cd(t),i={},r;Gf();try{Jf(n)&&(n=_s(n));const o=yield gp(n,{roots:t.roots});i=o.rules,r=o.inlineStyles}catch(o){throw Yf(),o}return Object.values(i).length&&(_s(n,r,!0),yield Ap(i,t.useAnimationFrame)),i})}const Ep=Object.freeze(Object.defineProperty({__proto__:null,default:Tp},Symbol.toStringTag,{value:"Module"}));z.ActiveDescendantController=Ps,z.AnchorController=$s,z.DragController=Ms,z.ResizeController=Is,z.RovingTabIndexMixin=Hs,z.ScrollObserverController=zs,z.isFocusable=jn,z.keyNavigation=Es,z.mouseMove=Ds,z.snapToStep=Bs,z.valueToPercent=Us,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
|
|
31
|
+
`,"")}const Ud=["normal","most-width","most-height","most-block-size","most-inline-size"],Vd=["flip-block","flip-inline","flip-start"];function qd(e){return e.type==="Declaration"}function Xd(e){return e.type==="Declaration"&&e.property==="position-try-fallbacks"}function Yd(e){return e.type==="Declaration"&&e.property==="position-try-order"}function Qd(e){return e.type==="Declaration"&&e.property==="position-try"}function Kd(e){return e.type==="Atrule"&&e.name==="position-try"}function Gd(e){return Vd.includes(e)}function Jd(e){return Ud.includes(e)}function Zd(e,t){const n=document.querySelector(e);if(n){let i=ep(n);return t.forEach(r=>{i=mo(i,r)}),i}}function tp(e,t){let n=e.declarations;return t.forEach(i=>{n=mo(n,i)}),n}function ep(e){const t={};return Os.forEach(n=>{const i=ot(e,`--${n}-${Gs}`);i&&(t[n]=i)}),t}const np={"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"}},ip={"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"}},rp={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};function sp(e,t){return np[t][e]||e}function op(e,t){return ip[t][e]||e}function lp(e,t){if(t==="flip-start")return e;{const n=rp[t];return e.split("-").map(i=>n[i]||i).join("-")}}function ap(e,t,n){if(e==="margin"){const[i,r,s,l]=t.children.toArray();n==="flip-block"?l?t.children.fromArray([s,r,i,l]):s&&t.children.fromArray([s,r,i]):n==="flip-inline"&&l&&t.children.fromArray([i,l,s,r])}else if(e==="margin-block"){const[i,r]=t.children.toArray();n==="flip-block"&&r&&t.children.fromArray([r,i])}else if(e==="margin-inline"){const[i,r]=t.children.toArray();n==="flip-inline"&&r&&t.children.fromArray([r,i])}}const cp=(e,t)=>{var n;return((n=Tt(`#id{${e}: ${t};}`).children.first)==null?void 0:n.block.children.first).value};function mo(e,t){const n={};return Object.entries(e).forEach(([i,r])=>{const s=i,l=cp(s,r),c=sp(s,t);c!==s&&(n[s]!=null||(n[s]="revert")),At(l,{visit:"Function",enter(a){je(a)&&a.children.forEach(o=>{ue(o)&&Ms(o.name)&&(o.name=op(o.name,t))})}}),s==="position-area"&&l.children.forEach(a=>{ue(a)&&lo(a.name)&&(a.name=lp(a.name,t))}),s.startsWith("margin")&&ap(s,l,t),n[c]=tt(l)}),n}function go(e){const t=sd(e),n=[];return t.forEach(i=>{const r={atRules:[],tactics:[],positionAreas:[]};i.forEach(s=>{Gd(s.name)?r.tactics.push(s.name):s.name.startsWith("--")?r.atRules.push(s.name):lo(s.name)&&r.positionAreas.push(s.name)}),r.positionAreas.length?n.push({positionArea:r.positionAreas[0],type:"position-area"}):r.atRules.length&&r.tactics.length?n.push({tactics:r.tactics,atRule:r.atRules[0],type:"at-rule-with-try-tactic"}):r.atRules.length?n.push({atRule:r.atRules[0],type:"at-rule"}):r.tactics.length&&n.push({tactics:r.tactics,type:"try-tactic"})}),n}function hp(e){return Xd(e)&&e.value.children.first?go(e.value.children):[]}function up(e){if(Qd(e)&&e.value.children.first){const t=Re(e);let n;const i=t.value.children.first.name;i&&Jd(i)&&(n=i,t.value.children.shift());const r=go(t.value.children);return{order:n,options:r}}return{}}function fp(e){return Yd(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function dp(e){const{order:t,options:n}=up(e);if(t||n)return{order:t,options:n};const{order:i}=fp(e),r=hp(e);return i||r?{order:i,options:r}:{}}function pp(e){return ae(e.property)||Vu(e.property)||Es(e.property)||qu(e.property)||["position-anchor","position-area"].includes(e.property)}function mp(e){var t,n;if(Kd(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){const i=e.prelude.value,r=e.block.children.filter(l=>qd(l)&&pp(l)),s={uuid:`${i}-try-${dt(12)}`,declarations:Object.fromEntries(r.map(l=>[l.property,tt(l.value)]))};return{name:i,tryBlock:s}}return{}}function gp(e){const t={},n={},i={};for(const r of e){const s=Tt(r.css);At(s,{visit:"Atrule",enter(l){const{name:c,tryBlock:a}=mp(l);c&&a&&(t[c]=a)}})}for(const r of e){let s=!1;const l=new Set,c=Tt(r.css);At(c,{visit:"Declaration",enter(a){var o;const h=(o=this.rule)==null?void 0:o.prelude,u=wn(h);if(!u.length)return;const{order:f,options:d}=dp(a),p={};f&&(p.order=f),u.forEach(({selector:m})=>{var y;d?.forEach(b=>{var x;let w;if(b.type==="at-rule")w=b.atRule;else if(b.type==="try-tactic"){w=`${m}-${b.tactics.join("-")}`;const T=Zd(m,b.tactics);T&&(t[w]={uuid:`${m}-${b.tactics.join("-")}-try-${dt(12)}`,declarations:T})}else if(b.type==="at-rule-with-try-tactic"){w=`${m}-${b.atRule}-${b.tactics.join("-")}`;const T=t[b.atRule],pt=tp(T,b.tactics);pt&&(t[w]={uuid:`${m}-${b.atRule}-${b.tactics.join("-")}-try-${dt(12)}`,declarations:pt})}if(w&&t[w]){const T=`[data-anchor-polyfill="${t[w].uuid}"]`;n[T]!=null||(n[T]=[]),n[T].push(m),l.has(w)||(p.fallbacks!=null||(p.fallbacks=[]),p.fallbacks.push(t[w]),l.add(w),(x=this.stylesheet)==null||x.children.prependData({type:"Rule",prelude:{type:"Raw",value:T},block:{type:"Block",children:new K().fromArray(Object.entries(t[w].declarations).map(([pt,S])=>({type:"Declaration",important:!0,property:pt,value:{type:"Raw",value:S}})))}}),s=!0)}}),Object.keys(p).length>0&&(i[m]?(p.order&&(i[m].order=p.order),p.fallbacks&&((y=i[m]).fallbacks!=null||(y.fallbacks=[]),i[m].fallbacks.push(...p.fallbacks))):i[m]=p)})}}),s&&(r.css=tt(c),r.changed=!0)}return{fallbackTargets:n,validPositions:i}}function yp(e,t){return!e||e===t?!1:yo(e)?e.document.contains(t):e.contains(t)}function yo(e){return!!(e&&e===e.window)}function bp(e){return Gt(e,"position","fixed")}function Tn(e){return!!(e&&(bp(e)||Gt(e,"position","absolute")))}function bo(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function kp(e){return P(this,null,function*(){return yield nt.getOffsetParent(e)})}function En(e){return P(this,null,function*(){if(!["absolute","fixed"].includes(ot(e,"position")))return yield kp(e);let t=e.parentElement;for(;t;){if(!Gt(t,"position","static")&&Gt(t,"display","block"))return t;t=t.parentElement}return window})}function _p(e,t,n,i){return P(this,null,function*(){const r=yield En(e),s=yield En(n);if(!(yp(s,e)||yo(s))||r===s&&!(!Tn(e)||bo(e,n)))return!1;if(r!==s){let l;const c=[];for(l=r;l&&l!==s&&l!==window;)c.push(l),l=yield En(l);const a=c[c.length-1];if(a instanceof HTMLElement&&!(!Tn(a)||bo(a,n)))return!1}{let l=e.parentElement;for(;l;){if(Gt(l,"content-visibility","hidden"))return!1;l=l.parentElement}}return!(t&&i&&ko(e,t,i)!==ko(n,t,i))})}function ko(e,t,n){for(;!(e.matches(n)&&md(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function Sp(e,t,n,i,r){return P(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&Tn(e)))return null;const s=n.flatMap(c=>dd(c,r)).filter(c=>pd(c,t)),l=i.map(c=>c.selector).join(",")||null;for(let c=s.length-1;c>=0;c--){const a=s[c],o="fakePseudoElement"in a;if(yield _p(o?a.fakePseudoElement:a,t,e,l))return o&&a.removeFakePseudoElement(),a}return null})}function vp(e){return e.type==="Declaration"&&e.property==="anchor-name"}function wp(e){return e.type==="Declaration"&&e.property==="anchor-scope"}function Pn(e){return!!(e&&e.type==="Function"&&e.name==="anchor-size")}function Fe(e){return!!(e&&e.type==="Function"&&e.name==="var")}function ue(e){return!!(e.type==="Identifier"&&e.name)}function Cp(e){return!!(e.type==="Percentage"&&e.value)}function _o(e,t){let n,i,r,s="",l=!1,c;const a=[];e.children.toArray().forEach(f=>{if(l){s=`${s}${tt(f)}`;return}if(f.type==="Operator"&&f.value===","){l=!0;return}a.push(f)});let[o,h]=a;if(h||(h=o,o=void 0),o&&(ue(o)&&o.name.startsWith("--")?n=o.name:Fe(o)&&o.children.first&&(c=o.children.first.name)),h)if(je(e)){if(ue(h)&&Ms(h.name))i=h.name;else if(Cp(h)){const f=Number(h.value);i=Number.isNaN(f)?void 0:f}}else Pn(e)&&ue(h)&&Ku(h.name)&&(r=h.name);const u=`--anchor-${dt(12)}`;return Object.assign(e,{type:"Raw",value:`var(${u})`,children:null}),Reflect.deleteProperty(e,"name"),{anchorName:n,anchorSide:i,anchorSize:r,fallbackValue:s||"0px",customPropName:c,uuid:u}}function So(e){return e.value.children.map(({name:t})=>t)}let fe={},Rt={},jt={},de={},Ft={};function xp(){fe={},Rt={},jt={},de={},Ft={}}function Lp(e,t){var n;if((je(e)||Pn(e))&&t){if(t.property.startsWith("--")){const i=tt(t.value),r=_o(e);return de[r.uuid]=i,jt[t.property]=[...(n=jt[t.property])!=null?n:[],r],{changed:!0}}if(je(e)&&ae(t.property)||Pn(e)&&Ds(t.property)){const i=_o(e);return{prop:t.property,data:i,changed:!0}}}return{}}function vo(e,t,n){return P(this,null,function*(){let i=t?.anchorName;const r=t?.customPropName;if(e&&!i){const a=ot(e,"position-anchor");a?i=a:r&&(i=ot(e,r))}const s=i?fe[i]||[]:[],l=i?Rt[Js.All]||[]:[],c=i?Rt[i]||[]:[];return yield Sp(e,i||null,s,[...l,...c],{roots:n.roots})})}function Ap(e,t){return P(this,null,function*(){var n,i,r,s,l,c,a,o,h,u,f;const d={},p={};xp();const{fallbackTargets:m,validPositions:y}=gp(e);for(const S of e){let R=!1;const W=Tt(S.css);At(W,function(E){var B,j,D,V;const I=(B=this.rule)==null?void 0:B.prelude,F=wn(I);if(vp(E)&&F.length)for(const $ of So(E))fe[$]!=null||(fe[$]=[]),fe[$].push(...F);if(wp(E)&&F.length)for(const $ of So(E))Rt[$]!=null||(Rt[$]=[]),Rt[$].push(...F);const{prop:G,data:vt,changed:$t}=Lp(E,this.declaration);if(G&&vt&&F.length)for(const{selector:$}of F)d[$]=J(U({},d[$]),{[G]:[...(D=(j=d[$])==null?void 0:j[G])!=null?D:[],vt]});let q;if(this.block&&(q=Nd(E),q)){zd(q,this.block);for(const{selector:$}of F)p[$]=[...(V=p[$])!=null?V:[],q]}($t||q)&&(R=!0)}),R&&(S.css=tt(W),S.changed=!0)}const b=new Set(Object.keys(jt)),x={},w=S=>{var R,W,E,B,j;const D=[],V=new Set((W=(R=x[S])==null?void 0:R.names)!=null?W:[]);for(;V.size>0;)for(const I of V)D.push(...(E=jt[I])!=null?E:[]),V.delete(I),(j=(B=x[I])==null?void 0:B.names)!=null&&j.length&&x[I].names.forEach(F=>V.add(F));return D};for(;b.size>0;){const S=[];for(const R of e){let W=!1;const E=Tt(R.css);At(E,{visit:"Function",enter(B){var j,D;const V=(j=this.rule)==null?void 0:j.prelude,I=this.declaration,F=I?.property;if(V?.children.isEmpty===!1&&Fe(B)&&I&&F&&B.children.first&&b.has(B.children.first.name)&&F.startsWith("--")){const G=B.children.first,vt=(D=jt[G.name])!=null?D:[],$t=w(G.name);if(!(vt.length||$t.length))return;const q=`${G.name}-anchor-${dt(12)}`,$=tt(I.value);de[q]=$,x[F]||(x[F]={names:[],uuids:[]});const Jt=x[F];Jt.names.includes(G.name)||Jt.names.push(G.name),Jt.uuids.push(q),S.push(F),G.name=q,W=!0}}}),W&&(R.css=tt(E),R.changed=!0)}b.clear(),S.forEach(R=>b.add(R))}for(const S of e){let R=!1;const W=Tt(S.css);At(W,{visit:"Function",enter(E){var B,j,D,V,I,F,G;const vt=(B=this.rule)==null?void 0:B.prelude,$t=this.declaration,q=$t?.property;if(vt?.children.isEmpty===!1&&Fe(E)&&$t&&q&&E.children.first&&(ae(q)||Es(q))){const $=E.children.first,Jt=(j=jt[$.name])!=null?j:[],Dn=w($.name);if(!(Jt.length||Dn.length))return;const Ne=`${q}-${dt(12)}`;if(Dn.length){const Zt=new Set([$.name]);for(;Zt.size>0;)for(const te of Zt){const lt=x[te];if((D=lt?.names)!=null&&D.length&&(V=lt?.uuids)!=null&&V.length)for(const ee of lt.names)for(const ne of lt.uuids)Ft[ne]=J(U({},Ft[ne]),{[Ne]:`${ee}-${Ne}`});Zt.delete(te),(I=lt?.names)!=null&&I.length&<.names.forEach(ee=>Zt.add(ee))}}const Bp=wn(vt);for(const Zt of[...Jt,...Dn]){const te=U({},Zt),lt=`--anchor-${dt(12)}-${q}`,ee=te.uuid;te.uuid=lt;for(const{selector:ne}of Bp)d[ne]=J(U({},d[ne]),{[q]:[...(G=(F=d[ne])==null?void 0:F[q])!=null?G:[],te]});Ft[ee]=J(U({},Ft[ee]),{[Ne]:lt})}$.name=`${$.name}-${Ne}`,R=!0}}}),R&&(S.css=tt(W),S.changed=!0)}if(Object.keys(Ft).length>0)for(const S of e){let R=!1;const W=Tt(S.css);At(W,{visit:"Function",enter(E){var B,j,D,V;if(Fe(E)&&(j=(B=E.children.first)==null?void 0:B.name)!=null&&j.startsWith("--")&&(V=(D=this.declaration)==null?void 0:D.property)!=null&&V.startsWith("--")&&this.block){const I=E.children.first,F=Ft[I.name];if(F)for(const[G,vt]of Object.entries(F))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${G}`,value:{type:"Raw",value:tt(this.declaration.value).replace(`var(${I.name})`,`var(${vt})`)}}),R=!0;de[I.name]&&(this.declaration.value={type:"Raw",value:de[I.name]},R=!0)}}}),R&&(S.css=tt(W),S.changed=!0)}const T=new Map;for(const[S,R]of Object.entries(d)){let W;S.startsWith("[data-anchor-polyfill=")&&(n=m[S])!=null&&n.length?W=he(t.roots,m[S].join(",")):W=he(t.roots,S);for(const[E,B]of Object.entries(R))for(const j of B)for(const D of W){const V=yield vo(D,j,{roots:t.roots}),I=`--anchor-${dt(12)}`;T.set(D,J(U({},(i=T.get(D))!=null?i:{}),{[j.uuid]:I})),D.setAttribute("style",`${j.uuid}: var(${I}); ${(r=D.getAttribute("style"))!=null?r:""}`),y[S]=J(U({},y[S]),{declarations:J(U({},(s=y[S])==null?void 0:s.declarations),{[E]:[...(a=(c=(l=y[S])==null?void 0:l.declarations)==null?void 0:c[E])!=null?a:[],J(U({},j),{anchorEl:V,targetEl:D,uuid:I})]})})}}const pt={el:document.createElement("link"),changed:!1,created:!0,css:""};e.push(pt);for(const[S,R]of Object.entries(p)){const W=he(t.roots,S);for(const E of W){const B=yield vo(E,null,{roots:t.roots});for(const j of R){const D=yield Bd(E,j,B);pt.css+=Hd(D.targetUUID,j.selectorUUID),pt.changed=!0,y[S]=J(U({},y[S]),{declarations:J(U({},(o=y[S])==null?void 0:o.declarations),{"position-area":[...(f=(u=(h=y[S])==null?void 0:h.declarations)==null?void 0:u["position-area"])!=null?f:[],D]})})}}}return{rules:y,inlineStyles:T,anchorScopes:Rt}})}const Tp=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function wo(e,t,n=!1){const i=[];for(const{el:r,css:s,changed:l,created:c=!1}of e){const a={el:r,css:s,changed:!1};if(l){if(r.tagName.toLowerCase()==="style")r.innerHTML=s;else if(r instanceof HTMLLinkElement){const o=document.createElement("style");o.textContent=s;for(const h of r.getAttributeNames())if(!h.startsWith("on")&&!Tp.includes(h)){const u=r.getAttribute(h);u!==null&&o.setAttribute(h,u)}r.hasAttribute("href")&&o.setAttribute("data-original-href",r.getAttribute("href")),c?(o.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",o)):(r.insertAdjacentElement("beforebegin",o),r.remove()),a.el=o}else if(r.hasAttribute("data-has-inline-styles")){const o=r.getAttribute("data-has-inline-styles");if(o){const h=`[data-has-inline-styles="${o}"]{`;let u=s.slice(h.length,-1);const f=t?.get(r);if(f)for(const[d,p]of Object.entries(f))u=`${d}: var(${p}); ${u}`;r.setAttribute("style",u)}}}n&&r.hasAttribute("data-has-inline-styles")&&r.removeAttribute("data-has-inline-styles"),i.push(a)}return i}const Ep=J(U({},nt),{_c:new Map}),Pp=(e,t)=>{let n;switch(e){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:typeof e=="number"&&!Number.isNaN(e)&&(n=e)}if(n!==void 0)return t?100-n:n},Op=(e,t)=>{let n;switch(e){case"block":case"self-block":n=t?"width":"height";break;case"inline":case"self-inline":n=t?"height":"width";break}return n},Co=e=>{switch(e){case"top":case"bottom":return"y";case"left":case"right":return"x"}return null},Dp=e=>{switch(e){case"x":return"width";case"y":return"height"}return null},xo=e=>ot(e,"display")==="inline",Lo=(e,t)=>(t==="x"?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce((n,i)=>n+parseInt(ot(e,i),10),0)||0,$e=(e,t)=>parseInt(ot(e,`margin-${t}`),10)||0,Mp=e=>({top:$e(e,"top"),right:$e(e,"right"),bottom:$e(e,"bottom"),left:$e(e,"left")}),On=e=>P(null,[e],function*({targetEl:t,targetProperty:n,anchorRect:i,anchorSide:r,anchorSize:s,fallback:l=null}){var c;if(!((s||r!==void 0)&&t&&i))return l;if(s){if(!Ds(n))return l;let a;switch(s){case"width":case"height":a=s;break;default:{let o=!1;const h=ot(t,"writing-mode");o=h.startsWith("vertical-")||h.startsWith("sideways-"),a=Op(s,o)}}return a?`${i[a]}px`:l}if(r!==void 0){let a,o;const h=Co(n);if(!(ae(n)&&h&&(!ae(r)||h===Co(r))))return l;const u=["top","left"];switch(r){case"left":case"top":a=0;break;case"right":case"bottom":a=100;break;case"center":a=50;break;case"inside":a=u.includes(n)?0:100;break;case"outside":a=u.includes(n)?100:0;break;default:if(t){const p=(yield(c=nt.isRTL)==null?void 0:c.call(nt,t))||!1;a=Pp(r,p)}}const f=typeof a=="number"&&!Number.isNaN(a),d=Dp(h);if(f&&d){(n==="bottom"||n==="right")&&(o=yield xn(t));let p=i[h]+i[d]*(a/100);switch(n){case"bottom":{if(!o)break;let m=o.clientHeight;if(m===0&&xo(o)){const y=Lo(o,h);m=o.offsetHeight-y}p=m-p;break}case"right":{if(!o)break;let m=o.clientWidth;if(m===0&&xo(o)){const y=Lo(o,h);m=o.offsetWidth-y}p=m-p;break}}return`${p}px`}}return l}),Ip=e=>"wrapperEl"in e,Rp=e=>"uuid"in e;function jp(e,t=!1){return P(this,null,function*(){const n=document.documentElement;for(const[i,r]of Object.entries(e))for(const s of r){const l=s.anchorEl,c=s.targetEl;if(l&&c)if(Ip(s)){const a=s.wrapperEl,o=(h,u,f)=>P(null,null,function*(){return h===0?"0px":yield On({targetEl:a,targetProperty:u,anchorRect:f,anchorSide:h})});Ye(l,a,()=>P(null,null,function*(){const h=ot(c,io);a.setAttribute(ro,h);const u=yield nt.getElementRects({reference:l,floating:a,strategy:"absolute"}),f=s.insets,d=yield o(f.block[0],"top",u.reference),p=yield o(f.block[1],"bottom",u.reference),m=yield o(f.inline[0],"left",u.reference),y=yield o(f.inline[1],"right",u.reference);n.style.setProperty(`${s.targetUUID}-top`,d||null),n.style.setProperty(`${s.targetUUID}-left`,m||null),n.style.setProperty(`${s.targetUUID}-right`,y||null),n.style.setProperty(`${s.targetUUID}-bottom`,p||null),n.style.setProperty(`${s.targetUUID}-justify-self`,s.alignments.inline),n.style.setProperty(`${s.targetUUID}-align-self`,s.alignments.block)}),{animationFrame:t})}else Ye(l,c,()=>P(null,null,function*(){const a=yield nt.getElementRects({reference:l,floating:c,strategy:"absolute"}),o=yield On({targetEl:c,targetProperty:i,anchorRect:a.reference,anchorSide:s.anchorSide,anchorSize:s.anchorSize,fallback:s.fallbackValue});n.style.setProperty(s.uuid,o)}),{animationFrame:t});else if(Rp(s)){const a=yield On({targetProperty:i,anchorSide:s.anchorSide,anchorSize:s.anchorSize,fallback:s.fallbackValue});n.style.setProperty(s.uuid,a)}}})}function Ao(e,t){return P(this,null,function*(){const n=yield nt.getElementRects({reference:e,floating:e,strategy:"absolute"});return yield Rl({x:e.offsetLeft,y:e.offsetTop,platform:Ep,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:Mp(e)})})}function Fp(e,t,n=!1){return P(this,null,function*(){if(!t.length)return;const i=document.querySelectorAll(e);for(const r of i){let s=!1;const l=yield xn(r);Ye({},r,()=>P(null,null,function*(){if(s)return;s=!0,r.removeAttribute("data-anchor-polyfill");const c=yield Ao(r,l);if(Object.values(c).every(a=>a<=0)){r.removeAttribute("data-anchor-polyfill-last-successful"),s=!1;return}for(const[a,{uuid:o}]of t.entries()){r.setAttribute("data-anchor-polyfill",o);const h=yield Ao(r,l);if(Object.values(h).every(u=>u<=0)){r.setAttribute("data-anchor-polyfill-last-successful",o),s=!1;break}if(a===t.length-1){const u=r.getAttribute("data-anchor-polyfill-last-successful");u?r.setAttribute("data-anchor-polyfill",u):r.removeAttribute("data-anchor-polyfill"),s=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function $p(e,t=!1){return P(this,null,function*(){var n,i;for(const r of Object.values(e))yield jp((n=r.declarations)!=null?n:{},t);for(const[r,s]of Object.entries(e))yield Fp(r,(i=s.fallbacks)!=null?i:[],t)})}function Np(e={}){const t=typeof e=="boolean"?{useAnimationFrame:e}:e,n=t.useAnimationFrame===void 0?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||t.roots.length===0)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}function zp(e){return P(this,null,function*(){const t=Np(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n=yield _d(t),i={},r;ld();try{cd(n)&&(n=wo(n));const s=yield Ap(n,{roots:t.roots});i=s.rules,r=s.inlineStyles}catch(s){throw od(),s}return Object.values(i).length&&(wo(n,r,!0),yield $p(i,t.useAnimationFrame)),i})}const Wp=Object.freeze(Object.defineProperty({__proto__:null,default:zp},Symbol.toStringTag,{value:"Module"}));L.ActiveDescendantController=Po,L.AnchorController=Ho,L.DragController=$o,L.ItemsCollectionController=Oo,L.MutationObserverController=Vo,L.NativeChildController=Ko,L.RafScheduler=qo,L.ResizeController=No,L.RovingTabIndexMixin=Zo,L.ScrollObserverController=Uo,L.TypeaheadController=Xo,L.findNearestScrollAncestor=Yo,L.getDirectChild=Fn,L.getDirectChildren=$n,L.isFocusable=jn,L.keyInteraction=Mo,L.keyNavigation=Ro,L.mouseMove=Fo,L.snapToStep=tl,L.valueToPercent=el,L.warnMissingDirectChild=Qo,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})}));
|