@taprootio/espalier 7.5.0 → 7.6.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/CHANGELOG.md +18 -0
- package/custom-elements.json +1190 -1084
- package/dist/box/esp-box.d.ts +4 -2
- package/dist/box/esp-box.js +6 -6
- package/dist/button/esp-button-group.js +8 -3
- package/dist/button/esp-button.d.ts +3 -0
- package/dist/button/esp-button.js +47 -13
- package/dist/footer/esp-footer.d.ts +2 -0
- package/dist/footer/esp-footer.js +14 -1
- package/dist/footer/paint-registration.js +1 -1
- package/dist/menu/paint-registration.js +1 -1
- package/dist/root/esp-root.d.ts +13 -0
- package/dist/root/esp-root.js +36 -7
- package/dist/section/esp-section.d.ts +5 -4
- package/dist/section/esp-section.js +1 -1
- package/dist/shared/blockquote-styles.d.ts +5 -1
- package/dist/shared/blockquote-styles.js +8 -4
- package/dist/shared/component-property-compiler.js +1 -1
- package/dist/shared/component-property-diagnostics.js +1 -1
- package/dist/shared/component-property-normalizer.js +1 -1
- package/dist/shared/paint-types.d.ts +9 -0
- package/dist/shared/public-token-catalog.generated.js +1 -1
- package/dist/shared/scale-engine.js +1 -1
- package/dist/shared/semantic-color-names.js +1 -1
- package/dist/shared/settable-component-properties.js +1 -1
- package/dist/testing/observe-paint.iife.js +2 -2
- package/dist/testing/observe-paint.js +3 -3
- package/espalier.css-data.json +92 -4
- package/espalier.token-manifest.json +849 -60
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var dn=Object.defineProperty,pn=(t,e)=>{for(var n in e)dn(t,n,{get:e[n],enumerable:!0})},Jt={};pn(Jt,{PAINT_CATALOG:()=>_e,auditPaintCoverage:()=>Sr,enabledPaintEntries:()=>wr,observePaint:()=>so});function et(t){return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}function L(t){if(t.assignedSlot)return t.assignedSlot;if(t.parentElement)return t.parentElement;const e=t.parentNode;return e&&et(e)?e.host:null}function S(t,e){for(let n=t;n;n=L(n))if(n.matches(e))return n;return null}function ft(t){const e=S(t,"nav.drawer");return e?e.classList.contains("full-screen")?"full-screen":"panel":S(t,".is-horizontal > .group-items")?"inline-panel":"inline"}function M(t,e){return t==="inline"?e:`${t}-${e}`}function dt(t){switch(t){case"inline":case"inline-panel":return["inlineNav"];case"panel":case"full-screen":return[`drawer:${t}`]}}var V=["rest","hover","focus","hover-focus"],Y=t=>t==="hover"||t==="hover-focus",G=t=>t==="focus"||t==="hover-focus";function Rt(t,e){return t.ownerDocument.defaultView?.getComputedStyle(t).getPropertyValue(e).trim()||void 0}var Zt=Object.freeze({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}),Qt=Math.PI/180,q=1e-4,hn=50,pt="[+-]?(?:\\d+|\\d*\\.\\d+)(?:[eE][+-]?\\d+)?",$="[\\t\\n\\f\\r ]",gn=new RegExp($+"*,"+$+"*"),mn=new RegExp($+"+");function ht(t){return t.replace(/\/\*[\s\S]*?(?:\*\/|$)/g," ").replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g,"")}var te={"":1,deg:1,grad:.9,rad:180/Math.PI,turn:360},bn=.4,vn=new RegExp("^oklch\\("+$+"*("+pt+")(%?)"+$+"+("+pt+")(%?)"+$+"+("+pt+")(deg|grad|rad|turn)?"+$+"*\\)$","i");function yn(t){const e=t.h*Qt;return{L:t.l,a:t.c*Math.cos(e),b:t.c*Math.sin(e)}}function wn(t){const e=t.L+.3963377774*t.a+.2158037573*t.b,n=t.L-.1055613458*t.a-.0638541728*t.b,r=t.L-.0894841775*t.a-1.291485548*t.b,o=e*e*e,a=n*n*n,i=r*r*r;return{r:4.0767416621*o-3.3077115913*a+.2309699292*i,g:-1.2684380046*o+2.6097574011*a-.3413193965*i,b:-.0041960863*o-.7034186147*a+1.707614701*i}}function Ct(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function kn(t){return{r:Ct(t.r),g:Ct(t.g),b:Ct(t.b)}}function xn(t){return t.r>=-q&&t.r<=1+q&&t.g>=-q&&t.g<=1+q&&t.b>=-q&&t.b<=1+q}function F(t){return Math.max(0,Math.min(1,t))}function Sn(t){const e=ht(t).match(vn);if(!e)return null;let n=parseFloat(e[1]);e[2]==="%"&&(n/=100);let r=parseFloat(e[3]);e[4]==="%"&&(r=r/100*bn);const o=parseFloat(e[5])*te[(e[6]??"").toLowerCase()];return!isFinite(n)||!isFinite(r)||!isFinite(o)?null:{l:Math.max(0,Math.min(1,n)),c:Math.max(0,r),h:(o%360+360)%360}}function Tt(t){return kn(wn(yn(t)))}function ee(t){return xn(Tt(t))}function ne(t){if(t.c<=q||ee(t))return{...t};let e=0,n=t.c,r={...t};for(let o=0;o<hn;o++){const a=(e+n)/2;if(r={l:t.l,c:a,h:t.h},ee(r)?e=a:n=a,n-e<q)break}return{l:t.l,c:e,h:t.h}}function J(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function En(t){return{r:J(t.r),g:J(t.g),b:J(t.b)}}function Rn({r:t,g:e,b:n}){const r=Math.cbrt(.4122214708*t+.5363325363*e+.0514459929*n),o=Math.cbrt(.2119034982*t+.6806995451*e+.1073969566*n),a=Math.cbrt(.0883024619*t+.2817188376*e+.6299787005*n);return{L:.2104542553*r+.793617785*o-.0040720468*a,a:1.9779984951*r-2.428592205*o+.4505937099*a,b:.0259040371*r+.7827717662*o-.808675766*a}}function Cn(t){return Rn(En(t))}function re(t){const e=Math.sqrt(t.a*t.a+t.b*t.b),n=e<1e-12?0:(Math.atan2(t.b,t.a)/Qt%360+360)%360;return{l:t.L,c:e,h:n}}function oe(t,e){const n=t.slice(1),r=n.length;if(!/^[0-9a-f]+$/i.test(n)||r!==3&&r!==6&&!(e&&(r===4||r===8)))return null;const o=r<=4?1:2,a=i=>{const s=n.slice(i*o,(i+1)*o);return parseInt(o===1?s.repeat(2):s,16)/255};return{space:"srgb",color:{r:a(0),g:a(1),b:a(2)},alpha:r===4||r===8?a(3):1}}function nt(t,e,n){const r=t.match(new RegExp("^"+e+"\\("+$+"*([^)]*?)"+$+"*\\)$","i"));if(!r)return null;const o=r[1],a=o.includes(","),i=o.split("/");if(i.length>2||i.length===2&&(a||!n))return null;const l=ht(i[0]).split(a?gn:mn),c=a&&l.length===4&&n?l.pop():i[1];if(l.length!==3||l.some(f=>f.length===0))return null;const u=c===void 0?1:ae(ht(c));return u===null?null:{args:l,legacy:a,alpha:u}}var Tn=new RegExp("^("+pt+")([a-z%]*)$","i");function gt(t){const e=t.match(Tn);if(!e)return null;const n=parseFloat(e[1]);return isFinite(n)?{value:n,unit:e[2].toLowerCase()}:null}function ae(t){if(t.toLowerCase()==="none")return 0;const e=gt(t);return!e||e.unit!==""&&e.unit!=="%"?null:F(e.unit==="%"?e.value/100:e.value)}function Mn(t){if(t.unit!==""&&t.unit!=="%")return null;const e=t.unit==="%"?t.value/100:t.value/255;return Math.max(0,Math.min(1,e))}function On(t){const e=te[t.unit];return e===void 0?null:t.value*e}function ie(t){return t.unit!==""&&t.unit!=="%"?null:Math.max(0,Math.min(1,t.value/100))}function An(t,e,n){const r=(t%360+360)%360,o=a=>{const i=(a+r/30)%12,s=e*Math.min(n,1-n);return n-s*Math.max(-1,Math.min(i-3,9-i,1))};return{r:o(0),g:o(8),b:o(4)}}function se(t,e){const n=ht(t);if(n.startsWith("#"))return oe(n,e);if(/^oklch\(/i.test(n)){const r=e?nt(n,"oklch",!0):null;if(e&&(!r||r.legacy))return null;const o=Sn(r?`oklch(${r.args.map(a=>a.toLowerCase()==="none"?"0":a).join(" ")})`:n);return o?{space:"oklch",color:o,alpha:r?.alpha??1}:null}if(/^rgba?\(/i.test(n)){const r=nt(n,"rgba?",e);if(!r)return null;const o=r.args.map(gt);if(o.some(u=>u===null))return null;const a=o;if(r.legacy&&new Set(a.map(u=>u.unit)).size>1)return null;const i=a.map(Mn);if(i.some(u=>u===null))return null;const[s,l,c]=i;return{space:"srgb",color:{r:s,g:l,b:c},alpha:r.alpha}}if(/^hsla?\(/i.test(n)){const r=nt(n,"hsla?",e);if(!r)return null;const o=r.args.map(gt);if(o.some(f=>f===null))return null;const[a,i,s]=o;if(r.legacy&&(i.unit!=="%"||s.unit!=="%"))return null;const l=On(a),c=ie(i),u=ie(s);return l===null||c===null||u===null?null:{space:"srgb",color:An(l,c,u),alpha:r.alpha}}if(e){if(/^oklab\(/i.test(n)){const a=nt(n,"oklab",!0);if(!a||a.legacy)return null;const i=a.args.map(u=>gt(u.toLowerCase()==="none"?"0":u));if(i.some(u=>!u||u.unit!==""&&u.unit!=="%"))return null;const[s,l,c]=i.map((u,f)=>{const d=u;return d.unit!=="%"?d.value:d.value/100*(f===0?1:.4)});return{space:"oklch",color:re({L:F(s),a:l,b:c}),alpha:a.alpha}}const r=n.toLowerCase();if(Object.prototype.hasOwnProperty.call(Zt,r))return oe(Zt[r],e);if(r==="transparent")return{space:"srgb",color:{r:0,g:0,b:0},alpha:0};const o=n.match(new RegExp("^color\\("+$+"*srgb"+$+"+","i"));if(o){const a=nt(`color(${n.slice(o[0].length)}`,"color",!0);if(!a||a.legacy)return null;const i=a.args.map(ae);if(i.some(u=>u===null))return null;const[s,l,c]=i;return{space:"srgb",color:{r:s,g:l,b:c},alpha:a.alpha}}}return null}var Pn=4.5,In=3;function ce({r:t,g:e,b:n}){return .2126*J(t)+.7152*J(e)+.0722*J(n)}function Nn(t,e){const n=ce(t),r=ce(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function W(t){const e=se(t,!0);if(!e)return null;const n=e.space==="oklch"?Tt(ne(e.color)):e.color;return{r:F(n.r),g:F(n.g),b:F(n.b),alpha:e.alpha}}function le(t,e){const n=t&&se(t,!0);if(!n)return null;const r=n.space==="oklch"?n.color:re(Cn(n.color)),o=Tt(ne({...r,l:F(e(r.l))}));return{r:F(o.r),g:F(o.g),b:F(o.b),alpha:n.alpha}}function ue(t,e){if(t.alpha===0)return e;if(t.alpha===1||e.alpha===0)return t;const n=e.alpha*(1-t.alpha),r=t.alpha+n;return{r:(t.r*t.alpha+e.r*n)/r,g:(t.g*t.alpha+e.g*n)/r,b:(t.b*t.alpha+e.b*n)/r,alpha:r}}var fe=3,_n=4,de=.1,mt=4;function pe(t){return t>=fe&&t<=_n}var he=1/Math.sqrt(2*Math.PI),Ln=he*Math.exp(-(mt**2)/2)/mt,Dn=.5-de/(fe/2)*he-3*Ln-.05;function ge(t){if(t.blur===0)return t.alpha;if(!pe(t.blur))throw new RangeError(`Unsupported shadow indicator blur ${t.blur}px. Expected 3\u20134px.`);return t.alpha*Dn}function $n(t){return t==="text"?Pn:In}var Mt={text:{bg:"background",targetLc:75},typeOverline:{bg:"background",targetLc:90},typeLabel:{bg:"background",targetLc:75},typeLead:{bg:"background",targetLc:75},typeCaption:{bg:"background",targetLc:90},dangerText:{bg:"background",targetLc:75},headings:{bg:"background",targetLc:60},headingsHover:{bg:"background",targetLc:60},link:{bg:"background",targetLc:75},linkHover:{bg:"linkHoverBg",targetLc:75},actionText:{bg:"actionBackground",targetLc:75},inputCaret:{bg:"layer2",targetLc:60},inputSelection:{bg:"inputSelectionBg",targetLc:60}},Bn=.88,bt="action-interaction-fill",Ot="button-focus-shadow",me=Mt.actionText.bg,be=({element:t,source:e})=>{const n=e==="fill"||e==="stroke";if(e!=="text"&&e!=="shadow"&&!n)return;const r=S(t,"[part=wrapper].esp-field:not(.incognito)"),o=r&&S(r,"esp-button"),a=r?.querySelector(":scope > [part=control]");if(!r||!o||!a||e==="shadow"&&t!==r||e==="text"&&!S(t,"[part=label]"))return;const i=S(o,"esp-menu-item"),s=!i&&S(o,"esp-footer");if(!(i&&S(o,"esp-header"))&&!s)return;const l=i?ft(o):"inline",c=a.matches("[aria-current=page]"),u=a.matches("button:disabled"),f=!u&&r.matches(":hover"),d=!u&&r.matches(":focus-within"),p=f||d,v=c?f?"current-hover":"current":d?f?"hover-focus":"focus":f?"hover":"rest",g=s?"footer-action-button":"nav-button";return{element:n?`${g}-icon`:g,owner:a,state:()=>M(l,v),...e==="shadow"?{foregroundDerivations:[Ot],foregroundAliases:["shadow"]}:p?{backgroundDerivations:[bt]}:{}}};function ve(t,e=!1){const n=e?["footerActionButton"]:dt(t),r=e?void 0:{kind:"button",...t==="inline"?{depth:"top-level"}:t==="inline-panel"?{depth:"nested"}:{}},o=e?"footer-action-button":"nav-button",a=e?[...n,"footerActionIcon"]:n,i=t==="inline"?"layer2":"layer1",s=V.flatMap(l=>{const c=M(t,l),u={element:o,foreground:"actionText",background:l==="rest"?me:bt,state:c,kind:"text",flags:n,...r?{navigation:r}:{}},f={...u,element:`${o}-icon`,kind:"graphic",flags:a,...r?{navigation:{...r,icon:!0}}:{}};return G(l)?[u,f,{...u,foreground:Ot,background:i,kind:"ring",indicator:"blurred-shadow"}]:[u,f]});if(r)for(const l of["current","current-hover"]){const c={element:o,foreground:"actionText",background:l==="current"?me:bt,state:M(t,l),kind:"text",flags:n,navigation:{...r,canBeCurrent:!0}};s.push(c,{...c,element:`${o}-icon`,kind:"graphic",navigation:{...r,canBeCurrent:!0,icon:!0}})}return s}var Gn={entriesByRole:{header:["inline","inline-panel","panel","full-screen"].flatMap(t=>ve(t)),footer:ve("inline",!0)},targets:{header:[be],footer:[be]},derivations:{[bt]:t=>le(t.readColor("actionBackground"),e=>e*Bn),[Ot]:t=>{const e=t.readProperty("--esp-field-focus-shadow");if(e)return W(e);if(t.scheme==="light")return W(t.readColor("shadow")??"");const n=t.readProperty("--_esp-context-shadow");if(n)return W(n);const r=t.readProperty("--esp-l-ink")?.trim(),o=r?.endsWith("%")?Number(r.slice(0,-1))/100:Number(r);return r&&Number.isFinite(o)?le(t.readColor("primary"),()=>o):null}}},ye={headings:"--_esp-footer-fitted-heading-color",link:"--_esp-footer-fitted-link-color"},we="--_esp-footer-ink-mode",vt="footer-heading-ink",yt="footer-link-ink",ke={foregroundDerivations:[vt],foregroundAliases:["headings"]},xe={foregroundDerivations:[yt],foregroundAliases:["link"]},Fn=({element:t,source:e})=>{const n=S(t,".brand .configured-brand");if(!(!n||!S(n,"esp-footer"))){if(e==="outline"&&t===n&&n.matches("a[href]"))return{element:"brand-link",owner:n,...xe};if(e==="text"&&S(t,".brand-text"))return{element:"brand-text",owner:n,...n.matches("a[href]")?{}:{state:()=>"rest"},...n.matches("a[href]:hover")?{}:{brandColor:Rt(n,"--_esp-footer-brand-color"),...ke}}}};function Un(t){const e=t.ownerDocument,n=e.createTreeWalker(t,NodeFilter.SHOW_TEXT),r=e.createRange();for(let o=n.nextNode();o;o=n.nextNode()){const a=o.parentElement;if(!(!a||!o.textContent?.trim()||a.closest("svg, [hidden], .sr-only"))&&e.defaultView?.getComputedStyle(a).visibility==="visible"&&(r.selectNodeContents(o),Array.from(r.getClientRects()).some(({width:i,height:s})=>i>0&&s>0)))return!0}return!1}var Hn=({element:t,source:e})=>{if(!S(t,"esp-footer")||S(t,"esp-button"))return;const n=S(t,"a[href]");if(n&&!n.classList.contains("configured-brand")&&(e==="text"||e==="outline"&&t===n&&Un(n)))return{element:"footer-link",owner:n,...e==="outline"||!n.matches(":hover")?xe:{}};if(e!=="text")return;const r=S(t,"h1, h2, h3, h4, h5, h6");if(r)return{element:"footer-heading",owner:r,state:()=>"rest",...ke};if(S(t,".aside, .bottom, esp-footer-link-group"))return{element:"footer-body",owner:t,state:()=>"rest"}},Vn=Mt.linkHover.bg,qn={derivations:{[vt]:({readProperty:t,readColor:e})=>W(t("--esp-footer-heading-color")??(t(we)==="semantic"?void 0:t(ye.headings))??e("headings")??""),[yt]:({readProperty:t,readColor:e})=>W(t("--esp-footer-link-color")??(t(we)==="semantic"?void 0:t(ye.link))??e("link")??"")},entriesByRole:{footer:[{element:"footer-heading",foreground:vt,background:"layer2",state:"rest",kind:"text",flags:["footerHeadings"]},{element:"footer-body",foreground:"text",background:"layer2",state:"rest",kind:"text",flags:["footerBody"]},...V.flatMap(t=>{const e=Y(t),n=G(t),r={foreground:e?"linkHover":yt,background:e?Vn:"layer2",state:t,kind:"text"},o=[{...r,element:"footer-link",flags:["footerLinks"]},{...r,element:"brand-text",foreground:e?"linkHover":"brand-color",flags:t==="rest"?["brandText"]:["brandText","brandLink"]}];if(n)for(const[a,i]of[["footer-link","footerLinks"],["brand-link","brandLink"]])o.push({element:a,foreground:yt,background:"layer2",state:t,kind:"ring",flags:[i]});return o})]},targets:{footer:[Fn,Hn]}},jn=({element:t,source:e})=>{const n=S(t,"section.brand .configured-brand");if(!(!n||!S(n,"esp-header"))){if(e==="outline"&&t===n&&n.matches("a[href]"))return{element:"brand-link",owner:n};if(e==="text"&&S(t,".brand-text"))return{element:"brand-text",owner:n,...n.matches(":hover")?{}:{brandColor:Rt(n,"--_esp-header-brand-color")}}}},Wn=({element:t,source:e})=>{if(e!=="fill"&&e!=="stroke"&&e!=="outline")return;const n=S(t,"esp-header-button");if(!n||!S(n,"esp-header"))return;const r=n.shadowRoot?.querySelector("button");if(!r||e==="outline"&&t!==r)return;if(n.classList.contains("theme-toggle"))return{element:"theme-toggle",owner:r};if(n.classList.contains("menu-toggle")){const a=n.matches(":popover-open")?"full-screen":r.getAttribute("aria-expanded")==="true"?"panel":"inline";return{element:"burger",owner:r,state:i=>M(a,i)}}const o=n.shadowRoot?.querySelector("use[href$='#search']")??n.querySelector("use[href$='#search']");if(n.getAttribute("icon")==="search"||o)return{element:"search-button",owner:r}};function rt(t,e,n,r="inline"){return V.flatMap(o=>{const a={element:t,foreground:"text",background:n==="tall"?"layer2":Y(o)?"layer4":"layer3",state:M(r,o),flags:e},i={...a,kind:"graphic"};return G(o)?[i,{...a,kind:"ring"}]:[i]})}var zn={entriesByRole:{header:[...V.flatMap(t=>{const e={element:"brand-text",foreground:Y(t)?"headingsHover":"brand-color",background:"layer2",state:t,kind:"text",flags:G(t)?["brandText","brandLink"]:["brandText"]};return G(t)?[e,{element:"brand-link",foreground:"link",background:"layer2",state:t,kind:"ring",flags:["brandLink"]}]:[e]}),...["standard","tall"].flatMap(t=>{const e=`headerPaint:${t}`;return[...rt("search-button",["searchButton",e],t),...rt("theme-toggle",["themeToggle",e],t),...rt("burger",["burger",e],t),...rt("burger",["burger","drawer:panel",e],t,"panel")]}),...rt("burger",["burger","drawer:full-screen"],"standard","full-screen")]},targets:{header:[jn,Wn]}},Se=Mt.linkHover.bg,Ee="headingsHover",Kn=["inline","inline-panel","panel","full-screen"];function wt(t,e){switch(t){case"inline":return{...e,depth:"top-level"};case"inline-panel":return{...e,depth:"nested"};default:return e}}var Xn=({element:t,source:e})=>{const n=S(t,".item:not(.button-appearance)"),r=n&&S(n,"esp-menu-item");if(!n||!r||!S(r,"esp-header"))return;const o=n.querySelector(":scope > :is(a, button, [aria-current=page])");if(!o)return;const a=o.matches("[aria-current=page]"),i=ft(n),s=i!=="inline"&&n.matches(":hover,:focus-within"),l=c=>a?M(i,s?"current-hover":"current"):M(i,s&&c==="rest"?"row-active":c);if(e==="shadow")return a&&t===n?{element:"nav-current-indicator",owner:o,state:l}:!a&&t===o?{element:"nav-hover-indicator",owner:o,state:l}:void 0;if((e==="fill"||e==="stroke")&&S(t,".icon-area"))return{element:"nav-item-icon",owner:o,state:l};if(e==="outline"&&t===o||e==="text"&&S(t,'[part="menu-text"]'))return{element:o.matches("button")?"nav-item":"nav-link",owner:o,state:l}},Yn=({element:t,source:e})=>{const n=S(t,".group-header"),r=n&&S(n,"esp-menu-group");if(!n||!r||!S(r,"esp-header"))return;const o=ft(n),a=(e==="fill"||e==="stroke")&&S(t,".group-icon");if(a){const u=n.querySelector(".group-toggle");return u?{element:"nav-group-icon",owner:u,state:f=>M(o,a.matches(":hover")?G(f)?"hover-focus":"hover":f)}:void 0}const i=S(t,".group-link, .group-toggle, [aria-current=page]");if(!i)return;const s=i.matches("[aria-current=page]"),l=(o==="panel"||o==="inline-panel")&&n.matches(":hover,:focus-within"),c=u=>s?M(o,l?"current-row-active":"current"):M(o,l&&u==="rest"?"row-active":u);if(e==="shape"&&t.matches(".indicator"))return{element:"nav-group-disclosure",owner:i,state:c};if(e==="text"&&S(t,".group-label-text"))return{element:"nav-group-label",owner:i,state:c};if(e==="outline"&&t===i)return{element:"nav-group-control",owner:i,state:c}},Jn=({element:t,source:e})=>{const n=S(t,".drawer-brand .configured-brand");if(!n||!S(n,"esp-header"))return;const r=ft(n),o=n.matches("a[href]"),a=i=>M(r,o?i:"rest");if(e==="outline"&&t===n&&o)return{element:"drawer-brand-link",owner:n,state:a};if(e==="text"&&S(t,".brand-text"))return{element:"drawer-brand-text",owner:n,state:a,brandColor:Rt(n,"--_esp-menu-drawer-brand-color")}};function Zn(t){const e=dt(t),n=t==="inline",r=t==="full-screen",o=n?"layer2":"layer1",a=wt(t,{kind:"plain",anchor:!0}),i=wt(t,{kind:"plain",anchor:!1}),s=[!0,!1].flatMap(u=>{const f=u?"nav-link":"nav-item",d=u?a:i;return(n?V:[...V,"row-active"]).flatMap(v=>{const g=v==="row-active",x=!g&&Y(v),k=!g&&G(v),A=x||k||g,y=u&&x?"linkHover":!n&&A?"headingsHover":"text",w=u&&x&&!n&&!r?Se:!r&&A?"layer2":o,m=M(t,v),h={element:f,foreground:y,background:w,state:m,kind:"text",flags:e,navigation:d},E={...h,element:"nav-item-icon",kind:"graphic",background:"layer2",navigation:{...d,icon:!0}};if(!k)return[h,E];const R={...h,foreground:"link",kind:"ring"};return n&&x?[h,E,R,{...R,background:Ee}]:[h,E,R]})}),l={element:"nav-link",foreground:"link",background:r?"layer1":"layer2",state:M(t,"current"),kind:"text",flags:e,navigation:wt(t,{kind:"plain",canBeCurrent:!0})},c={...l,element:"nav-item-icon",kind:"graphic",background:"layer2",navigation:{...l.navigation,icon:!0}};return s.push(l,c),n?s.push({element:"nav-hover-indicator",foreground:Ee,background:"layer2",state:"hover",kind:"graphic",flags:e,navigation:{kind:"plain",depth:"top-level"}},{...l,element:"nav-current-indicator",kind:"graphic",flags:[...e,"headerPaint:standard"]}):s.push({...l,foreground:"headingsHover",state:M(t,"current-hover")},{...c,foreground:"headingsHover",state:M(t,"current-hover")}),s}function Qn(t){const e=dt(t),n=wt(t,{kind:"group"}),r=i=>t==="full-screen"?"layer1":t==="inline"||i?"layer2":"layer1",o={element:"nav-group-label",foreground:"link",background:r(!1),state:M(t,"current"),kind:"text",flags:e,navigation:{...n,canBeCurrent:!0}},a=V.flatMap(i=>{const s=G(i),l=r(s||Y(i)),c=M(t,i),u={foreground:"text",background:l,state:c,flags:e,navigation:n},f=[{...u,element:"nav-group-label",kind:"text"},{...u,element:"nav-group-disclosure",kind:"graphic"},{...u,element:"nav-group-icon",kind:"graphic",background:"layer2",navigation:{...n,icon:!0}}];return s&&f.push({...u,element:"nav-group-control",foreground:"link",kind:"ring"}),f});if(a.push(o),t==="inline-panel"||t==="panel"){const i=r(!0),s={foreground:"text",background:i,state:M(t,"row-active"),flags:e,navigation:n};a.push({...s,element:"nav-group-label",kind:"text"},{...s,element:"nav-group-disclosure",kind:"graphic"},{...o,background:i,state:M(t,"current-row-active")})}return a}var tr={entriesByRole:{header:[...Kn.flatMap(t=>[...Zn(t),...Qn(t)]),...V.flatMap(t=>{const e=M("full-screen",t),n=dt("full-screen"),r=G(t),o=Y(t),a={element:"drawer-brand-text",foreground:"brand-color",background:o?Se:"layer1",state:e,kind:"text",flags:[...n,"brandText",...o||r?["brandLink"]:[]]};return r?[a,{element:"drawer-brand-link",foreground:"link",background:"layer1",state:e,kind:"ring",flags:[...n,"brandLink"]}]:[a]})]},targets:{header:[Xn,Yn,Jn]}};function er(t,e){return t?.trim()||e?.trim()||""}var At={series1:"#000000",series2:"#E69F00",series3:"#56B4E9",series4:"#009E73",series5:"#F0E442",series6:"#0072B2",series7:"#D55E00",series8:"#CC79A7"},Re=["background","layer1","layer2","layer3","layer4","actionBackground","actionText","border","shadow","text","typeOverline","typeLabel","typeLead","typeCaption","dangerText","headings","headingsHover","link","linkHover","linkHoverBg","inputCaret","inputSelection","inputSelectionBg"];function nr(t){return`--esp-color-${t.replace(/([A-Z])/g,"-$1").replace(/(\d)/g,"-$1").toLowerCase()}`}var rr=["primary","analogous-left","analogous-right","complementary","split-complementary-left","split-complementary-right","triadic-left","triadic-right","danger","success","warning","info"];function Pt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var or={surface:.99,raised1:.97,raised2:.9,raised3:.8,raised4:.72,accent:.5,muted:.45,text:.35,border:.3,ink:.25,shadow:.2},ar={surface:.15,raised1:.2,raised2:.3,raised3:.4,raised4:.36,accent:.6,muted:.75,text:.85,border:.7,ink:.95,shadow:.6},Ce={background:{source:"primary",lightness:"surface"},layer1:{source:"primary",lightness:"raised1"},layer2:{source:"primary",lightness:"raised2"},layer3:{source:"primary",lightness:"raised3"},layer4:{source:"primary",lightness:"raised4"},actionBackground:{source:"primary",lightness:"muted"},actionText:{source:"primary",lightness:"ink"},border:{source:"primary",lightness:"border"},shadow:{source:"primary",lightness:"shadow"},text:{source:"primary",lightness:"text"},typeOverline:{source:"primary",lightness:"text"},typeLabel:{source:"primary",lightness:"text"},typeLead:{source:"primary",lightness:"text"},typeCaption:{source:"primary",lightness:"text"},dangerText:{source:"danger",lightness:"text"},headings:{source:"primary",lightness:"muted"},headingsHover:{source:"primary",lightness:"text"},link:{source:"complementary",lightness:"accent"},linkHover:{source:"complementary",lightness:"text"},linkHoverBg:{source:"triadic-left",lightness:"raised2"},inputCaret:{source:"triadic-right",lightness:"ink"},inputSelection:{source:"complementary",lightness:"text"},inputSelectionBg:{source:"triadic-left",lightness:"raised2"}},ir={light:"muted",dark:"raised3"};function Te(t){return{...Ce,actionBackground:{source:"primary",lightness:ir[t]}}}var sr=.4;function It(){const t={};for(const e of Re)t[e]={min:0,max:sr};return t}var cr="system-ui, sans-serif",lr="monospace",Me={seedColor:"oklch(0.7 0.125 216)",fontBody:cr,fontHeadings:"",fontBrand:"",fontMenu:"",fontMonospace:lr,fontWeightBody:"normal",fontWeightHeadings:"bold",fontWeightBrand:"bold",fontWeightMenu:"bold",fontWeightMonospace:"normal",stylesheets:[],rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200,angles:{analogous:30,complementary:180,splitComplementary:30,triadic:120},semanticHues:{danger:27,success:150,warning:90,info:244},variantChroma:{},intents:{},tones:{},chroma:It(),semanticMappings:{...Ce},explicitMappingTokens:[],anchors:{},roles:{},contexts:{},dataPalette:{...At},dataRamps:{}},ur={...Me,chroma:It(),semanticMappings:Te("light"),anchors:{},roles:{},contexts:{},tones:{},dataPalette:{...At},dataRamps:{},lightness:{...or}},fr={...Me,chroma:It(),semanticMappings:Te("dark"),anchors:{},roles:{},contexts:{},tones:{},dataPalette:{...At},dataRamps:{},lightness:{...ar}},Oe=new WeakMap;Oe.set(ur,new Set),Oe.set(fr,new Set);var kt=new Map([...Re.map(t=>[t,nr(t)]),...rr.map(t=>[t,`--esp-color-${t}`])]),Ae=Object.freeze([...kt.keys()]),z="brand-color";function ot(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Pe(t){return kt.get(t)}function j(t){return typeof t=="string"&&t.trim()!==""}function Ie(t){return j(t)&&t===t.trim()}function dr(t){return t==="text"||t==="graphic"||t==="ring"}function pr(t){return Array.isArray(t)&&Array.from(t).every(j)}var Ne={depth:t=>t==="top-level"||t==="nested",kind:t=>t==="button"||t==="plain"||t==="group",anchor:t=>typeof t=="boolean",canBeCurrent:t=>typeof t=="boolean",icon:t=>t===void 0||typeof t=="boolean"},hr={element:!0,foreground:!0,background:!0,state:!0,kind:!0,flags:!0,navigation:!0,indicator:!0,paintOpacity:!0};function gr(t){return Pt(t)&&Object.entries(t).every(([e,n])=>ot(Ne,e)&&Ne[e](n))}function mr(t,e,n){if(!Pt(t)||!Object.keys(t).every(r=>ot(hr,r))||!j(t.element)||!j(t.state)||!dr(t.kind)||!pr(t.flags))throw new TypeError(`${e} is not a paint entry.`);for(const r of["foreground","background"]){const o=t[r];if(!j(o)||!(kt.has(o)||ot(n,o)||r==="foreground"&&o===z))throw new TypeError(`${e} has an unknown ${r} paint identifier "${String(o)}".`)}if(t.paintOpacity!==void 0&&(typeof t.paintOpacity!="number"||!Number.isFinite(t.paintOpacity)||t.paintOpacity<0||t.paintOpacity>1))throw new TypeError(`${e} has an invalid paint opacity.`);if(t.navigation!==void 0&&!gr(t.navigation))throw new TypeError(`${e} has an invalid navigation predicate.`);if(t.indicator!==void 0&&(t.indicator!=="blurred-shadow"||t.kind==="text"))throw new TypeError(`${e} has an invalid indicator.`)}function br(t,e=Le){if(!Pt(t))throw new TypeError("Paint entries must be grouped by role.");for(const[n,r]of Object.entries(t)){if(!Ie(n)||!Array.isArray(r))throw new TypeError(`Paint entries for role "${n}" must be an array on a nonempty role without outer whitespace.`);for(let o=0;o<r.length;o+=1)mr(r[o],`Paint entry for "${n}" at index ${o}`,e)}}function vr(t){const e=Object.create(null),n=Object.create(null),r=Object.create(null);for(const o of t)for(const[a,i]of Object.entries(o.derivations??{})){if(!j(a)||a===z||kt.has(a)||a in r)throw new TypeError(`Paint derivation "${a}" must have a unique identifier.`);r[a]=i}for(const o of t){br(o.entriesByRole,r);for(const[a,i]of Object.entries(o.entriesByRole))(e[a]??=[]).push(...i);for(const[a,i]of Object.entries(o.targets))(n[a]??=[]).push(...i)}for(const o of Object.values(e))Object.freeze(o);for(const o of Object.values(n))Object.freeze(o);return{entriesByRole:Object.freeze(e),targets:Object.freeze(n),derivations:Object.freeze(r)}}var Nt=vr([zn,qn,tr,Gn]),_e=Nt.entriesByRole,yr=Nt.targets,Le=Nt.derivations;function wr(t,e,n=_e,{brandColor:r}={}){const o=ot(n,t)?n[t]:[],a=new Set(e.flags),i=o.filter(s=>{if(!s.flags.every(c=>a.has(c)))return!1;if(s.navigation===void 0)return!0;const l=Object.entries(s.navigation);return e.navigation.some(c=>l.every(([u,f])=>c[u]===f))});return er(r)?i:i.map(s=>s.foreground===z?{...s,foreground:t==="footer"?vt:"headings"}:s)}function kr(t,e,n=Le){if(ot(n,t))return n[t](e);const r=e.readColor(t);return r?W(r):null}function xr(t){return JSON.stringify([t.role,t.element,t.state,t.kind,t.foreground,t.background,t.indicator,t.paintOpacity??1])}function De(t){const e=new Map;for(const n of t){const r=xr(n);e.has(r)||e.set(r,n)}return e}function Sr(t,e){const n=Object.entries(e).flatMap(([a,i])=>i.map(s=>({role:a,...s}))),r=De(n),o=De(t);return{unlisted:[...o].filter(([a])=>!r.has(a)).map(([,a])=>a),unobserved:[...r].filter(([a])=>!o.has(a)).map(([,a])=>a)}}var P="http://www.w3.org/2000/svg",$e={r:0,g:0,b:0,alpha:0},_t={r:1,g:1,b:1,alpha:1};function Er(t){const e=[],n=[];function r(o){if(o.nodeType===Node.TEXT_NODE){o.textContent?.trim()&&n.push(o);return}if(o.nodeType===Node.ELEMENT_NODE){const a=o;if(a.matches("style, script, template, defs, symbol"))return;if(e.push(a),a.shadowRoot){r(a.shadowRoot);return}if(a.localName==="slot"&&a.namespaceURI!==P){const i=a.assignedNodes();if(i.length){i.forEach(r);return}}}o.childNodes.forEach(r)}return r(t),{elements:e,text:n}}function D(t,e){const n=[];for(let o=t;o;o=L(o)){const a=o.localName;if(n.unshift(o.id?`${a}#${o.id}`:a+[...o.classList].slice(0,2).map(i=>`.${i}`).join("")),o.id)break}const r=e?.data.trim().slice(0,70);return n.join(" > ")+(r?` "${r}"`:"")}function Rr(t){const e=[t];for(const n of e)for(const r of n.querySelectorAll("*"))r.shadowRoot&&e.push(r.shadowRoot);return e}function Cr(t,e){const n=new CSSStyleSheet;n.replaceSync("* { pointer-events: auto !important; }");const r=new CSSStyleSheet;r.replaceSync(":host, *, ::slotted(*) { pointer-events: auto !important; }");const o=[];try{for(const a of t){const i=[...a.adoptedStyleSheets];a.adoptedStyleSheets=[...i,et(a)?r:n],o.push([a,i])}return e()}finally{for(const[a,i]of o)a.adoptedStyleSheets=i}}function K(t){return t.width<=0||t.height<=0?[]:[.5,.25,.75].flatMap(e=>[.5,.25,.75].map(n=>({x:t.left+e*t.width,y:t.top+n*t.height})))}function Tr(t){const e=t.ownerDocument.createRange();return e.selectNodeContents(t),[...e.getClientRects()].flatMap(K)}function Mr(t,e){for(let n=t;n&&n!==e.host;n=L(n))if(n.getRootNode()===e)return!0;return!1}function Be(t,{x:e,y:n}){const r=[],o=new Set,a=i=>{if(o.has(i))return;o.add(i);const s=i.shadowRoot;s&&s.elementsFromPoint(e,n).filter(l=>Mr(l,s)).forEach(a),r.push(i)};return t.elementsFromPoint(e,n).forEach(a),r}function xt(t,e){return Math.abs(t.alpha-e.alpha)<=.001&&Math.abs(t.r-e.r)<=.001&&Math.abs(t.g-e.g)<=.001&&Math.abs(t.b-e.b)<=.001}function Ge(t,e){return{...t,alpha:t.alpha*e}}function U(t){return t.trim().toLowerCase()==="transparent"?$e:W(t)}function Z(t,e){if(U(e))return e;const n=t.ownerDocument,r=t.namespaceURI===P?n.createElementNS(P,"g"):n.createElement("span");if(r.style.cssText="display:none!important;visibility:hidden!important",r.style.setProperty("color",e,"important"),!r.style.color)return e;(t.shadowRoot??t).append(r);try{const o=O(r).color;return U(o)?o:(r.style.setProperty("color",`oklch(from ${o} l c h / alpha)`,"important"),O(r).color)}finally{r.remove()}}function O(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function Lt(t){const e=O(t);return e.display!=="none"&&e.visibility==="visible"&&Or(t)>0}function Or(t){return Fe(t).reduce((e,n)=>e*n.opacity,1)}function Dt(t,e){for(let n=e;n;n=L(n))if(n===t)return!0;return!1}function Ar(t){let e=t;for(let n=L(e);n&&O(e).display==="contents";n=L(e))e=n;return e}function Pr(t,e){for(let n=t,r=L(n);r&&!n.matches(":popover-open, dialog:modal");n=r,r=L(n)){const{overflowX:o,overflowY:a}=O(r);if(o==="visible"&&a==="visible")continue;const i=r.getBoundingClientRect();if(o!=="visible"&&(e.x<i.left||e.x>=i.right)||a!=="visible"&&(e.y<i.top||e.y>=i.bottom))return!0}return!1}function Ir(t,e){function n(g,x){t.style.setProperty("left",`${g}px`,"important"),t.style.setProperty("top",`${x}px`,"important");const k=t.getBoundingClientRect();return{x:(k.left+k.right)/2,y:(k.top+k.bottom)/2}}const r=e.x-.5,o=e.y-.5,a=n(r,o);if(Math.abs(a.x-e.x)<.05&&Math.abs(a.y-e.y)<.05)return;const i=n(r+1,o),s=n(r,o+1),l=i.x-a.x,c=i.y-a.y,u=s.x-a.x,f=s.y-a.y,d=l*f-c*u;if(Math.abs(d)<1e-6)return;const p=e.x-a.x,v=e.y-a.y;n(r+(f*p-u*v)/d,o+(l*v-c*p)/d)}function Nr(t,e){const n=t.ownerDocument,r=n.createElement("span");r.style.cssText=["all:initial!important","display:block!important","width:1px!important","height:1px!important","position:fixed!important","z-index:auto!important","opacity:0!important","pointer-events:auto!important","visibility:visible!important"].join(";"),r.setAttribute("aria-hidden","true"),(t.shadowRoot??t).append(r);try{Ir(r,e);const o=Be(n,e),a=o.indexOf(r);return a<0?void 0:{above:o.slice(0,a),below:o.slice(a+1).filter(i=>i!==t)}}finally{r.remove()}}function Fe(t){const e=[];for(let n=t;n;n=L(n)){const r=Number(O(n).opacity);r<1&&e.unshift({element:n,opacity:r})}return e}function Ue(t,e,n){const r=U(Z(t,e));if(!r)throw new Error(`Cannot resolve ${n} "${e}" on ${D(t)}`);return r}function _r(t,e){const n=O(t);if(n.visibility!=="visible"||e.some(o=>o.opacity===0))return null;const r=Ue(t,n.backgroundColor,"background paint");return r.alpha===0?null:{element:t,color:r,sourceColor:r,groups:e}}function Lr(t,e,n){if("uncertainty"in e)throw new Error(e.uncertainty);const r=Ue(t,e.rawColor,"overlapping paint");return{element:t,color:Ge(r,e.opacity),sourceColor:r,groups:[...n,...e.groups??[]]}}function Dr(t,e){return t.length===e.length&&t.every((n,r)=>n.element===e[r].element)}function $t(t,e,n=0){let r=e;for(let o=t.length-1;o>=0;o--){const a=t[o],i=a.groups[n];if(!i){r=ue(a.color,r);continue}let s=o;for(;t[s-1]?.groups[n]?.element===i.element;)s--;const l=$t(t.slice(s,o+1),$e,n+1);r=ue(Ge(l,i.opacity),r),o=s}return r}function $r(t,e){const n=new Map,r=new WeakMap,o=new WeakMap;function a(l){const c=`${l.x},${l.y}`;let u=n.get(c);return u||(u=Be(t,l),n.set(c,u)),u}function i(l){let c=o.get(l);return c||(c=Fe(l),o.set(l,c)),c}function s(l){return r.has(l)||r.set(l,_r(l,i(l))),r.get(l)??null}return function(c,u,f){const d=a(u);if(d.length===0)return;let p;function v(b){return b===u.svgRoot||b.namespaceURI!==P||b.localName!=="svg"?[]:(p??=new Set(d),e(b,u,p))}const g=Ar(c),x=d.includes(g)?g:u.retarget&&d.includes(u.retarget)?u.retarget:void 0;if(u.svgRoot&&!x)return;const k=u.svgRoot??x??g,A=d.indexOf(k);let y,w;if(u.inside){if(Pr(c,u))return;const b=a(u.inside),C=b.indexOf(k);if(C<0)return;const St=Nr(k,u);if(St)({above:y,below:w}=St);else{const Kt=new Set(b),Et=d.find(N=>!Kt.has(N)&&(s(N)||v(N).length));if(Et)throw new Error(`Cannot order outward paint against ${D(Et)}`);const tt=new Set(b.slice(0,C));y=d.filter(N=>tt.has(N)),w=d.filter(N=>N!==k&&!tt.has(N))}}else{if(A<0)return;y=d.slice(0,A),w=d.slice(A+(f?0:1))}const m=i(c),h=u.local,E=[...m,...h?.groups??[]],R=new Set(E.map(b=>b.element)),_=[];function I(b){return!b||b.color.alpha===0?!0:b.color.alpha===1&&b.groups.every(C=>R.has(C.element))?!1:(_.push(b),!0)}function T(b){const C=b.element??c;return b.requiresHit&&!d.includes(C)&&(!b.retarget||!d.includes(b.retarget))?null:Lr(C,b,i(C))}for(const b of y)if(!(Dt(b,k)||Dt(k,b)&&(u.svgRoot||f&&u.inside))){for(const C of v(b))if(!I(T(C)))return;if(!I(s(b)))return}for(const b of h?.above??[])if(!I(T(b)))return;const H=[];function X(b){return!b||b.color.alpha===0?!0:(H.push(b),b.color.alpha<1||b.groups.length>0)}let ct=!0,lt=!!h?.opaqueInk;for(const b of h?.below??[]){const C=T(b);if(!(!C||C.color.alpha===0)&&!(lt&&h?.opaqueInk&&C.color.alpha===1&&xt(h.opaqueInk,C.color)&&Dr(E,C.groups))&&(lt=!1,ct=X(C),!ct))break}if(ct){for(const b of w)if(!(u.svgRoot&&b!==k&&Dt(k,b))&&(v(b).some(C=>!X(T(C)))||!X(s(b))))break}const B=H[0];return{color:$t([..._,...H],_t),sourceColor:B?.sourceColor??_t,sourceElement:B?.element,paintForeground:b=>{const C={element:c,color:b,sourceColor:b,groups:E};return $t([..._,C,...H],_t)}}}}function He(t,e){let n=0,r=0;const o=[];for(let a=0;a<t.length;a++){const i=t[a];i==="("&&n++,i===")"&&n--,n===0&&e.test(i)&&(a>r&&o.push(t.slice(r,a).trim()),r=a+1)}return r<t.length&&o.push(t.slice(r).trim()),o}function Bt(t){const e=parseFloat(t.outlineWidth),n=t.outlineStyle==="none"||t.outlineStyle==="hidden"||!(e>0)?void 0:{color:t.outlineColor,style:t.outlineStyle,width:e,offset:parseFloat(t.outlineOffset)},r=He(t.boxShadow,/,/).flatMap(o=>{const a=He(o,/\s/),i=a.filter(d=>/^[-+.\d]+px$/.test(d)),[s,l,c=0,u=0]=i.map(parseFloat),f=a.find(d=>d!=="inset"&&!i.includes(d));return f&&s!==void 0&&l!==void 0?[{color:f,x:s,y:l,blur:c,spread:u,value:o,inset:a.includes("inset")}]:[]});return{outline:n,shadow:r}}var Br=/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\\.|:(?:focus-visible|focus-within|focus|hover)(?![\w-])/g;function Gt(t,e){return t.replace(Br,n=>!n.startsWith(":")||e&&n===":hover"?n:`:not(:where(*)):is(${n})`)}function Gr(t){const e=[],n=new Set;function r(a){for(const i of a){if("selectorText"in i&&typeof i.selectorText=="string"){const s=i.selectorText;Gt(s,!1)!==s&&e.push([i,s])}if("cssRules"in i&&r(i.cssRules),"styleSheet"in i){const s=i.styleSheet;s&&o(s)}}}function o(a){if(n.has(a))return;n.add(a);let i;try{i=a.cssRules}catch{return}r(i)}for(const a of t)for(const i of[...a.styleSheets,...a.adoptedStyleSheets])o(i);return e}function Ft(t,e){return e?.color===t.color&&e.style===t.style&&e.width===t.width&&e.offset===t.offset}var Ve=new WeakMap,Fr=Ae.map(Pe).filter(t=>t!==void 0);function qe(t,e,n){let r=null,o=null;for(let a=t;a&&!(r&&o);a=L(a))r??=a.getAttribute("scheme")||null,o??=a.getAttribute("context")||null;return JSON.stringify([n,e.colorScheme,r,o,...Fr.map(a=>e.getPropertyValue(a))])}function Ur(t,e){const n=t[0]?.ownerDocument.defaultView,r=[n?.matchMedia("(prefers-color-scheme: dark)").matches,n?.matchMedia("(forced-colors: active)").matches].join(":"),o=t.flatMap(c=>{const u=O(c),f=Bt(u),d=c.matches(":focus-within, :focus-visible"),p=c.matches(":hover"),v=p?"hover":"rest";let g=Ve.get(c);if(d||(g||(g={},Ve.set(c,g)),g[v]={bands:f,environment:qe(c,u,r)}),!f.outline&&f.shadow.length===0)return[];const x=d?g?.[v]:void 0,k=x&&x.environment===qe(c,u,r)?x.bands:void 0;return[{element:c,bands:f,focus:d,hover:p,realNoFocus:k}]}),a=new Map,i=new Map,s=o.some(({focus:c})=>c),l=o.some(({hover:c})=>c);if(s||l){const c=Gr(e),u=[],f=new CSSStyleSheet;f.replaceSync("* { transition: none !important; }");try{for(const d of e){const p=[...d.adoptedStyleSheets];d.adoptedStyleSheets=[...p,f],u.push([d,p])}if(s){for(const[d,p]of c){const v=Gt(p,!0);v!==p&&(d.selectorText=v)}for(const{element:d,focus:p}of o)p&&i.set(d,Bt(O(d)))}if(l){for(const[d,p]of c)d.selectorText=Gt(p,!1);for(const{element:d,hover:p}of o)p&&a.set(d,Bt(O(d)))}}finally{for(const[d,p]of c)d.selectorText!==p&&(d.selectorText=p);for(const{element:d}of o)O(d).boxShadow;for(const[d,p]of u)d.adoptedStyleSheets=p}}return new Map(o.map(({element:c,bands:u,hover:f,focus:d,realNoFocus:p})=>{const v=a.get(c)??i.get(c),g=i.get(c),x=[...c.getClientRects()],k=u.outline,A=u.shadow.map(m=>({source:"shadow",shadow:m}));k&&A.unshift({source:"outline",outline:k});const y=[],w=k&&d&&(!Ft(k,g?.outline)||(p?!Ft(k,p.outline):k.style==="auto"&&c.matches(":focus-visible")));k&&(w||f&&!Ft(k,v?.outline))&&y.push({source:"outline",kind:w?"ring":"graphic",color:k.color,blur:0,points:x.flatMap(m=>tn(c,m,A,0))});for(const[m,h]of u.shadow.entries()){const E=d&&(!g?.shadow.some(({value:T})=>T===h.value)||p&&!p.shadow.some(({value:T})=>T===h.value)),R=f&&!v?.shadow.some(({value:T})=>T===h.value);if(!E&&!R&&!(h.inset&&h.blur===0))continue;const _=k?m+1:m,I=x.flatMap(T=>tn(c,T,A,_));y.push({source:"shadow",kind:E?"ring":"graphic",color:h.color,blur:h.blur,points:I})}return[c,y]}))}var je=["top","bottom","left","right"];function We(t,e,n,r){const o=t.left+r*t.width,a=t.top+r*t.height;switch(e){case"top":return{x:o,y:t.top-n};case"bottom":return{x:o,y:t.bottom+n};case"left":return{x:t.left-n,y:a};case"right":return{x:t.right+n,y:a}}}function Ut(t,e,n){return(e-t[n])*(n==="right"||n==="bottom"?1:-1)}function Hr(t,e){const n=O(t),r=i=>parseFloat(n.getPropertyValue(`border-${i}-width`)),o=r("left"),a=r("top");return new DOMRect(e.left+o,e.top+a,e.width-o-r("right"),e.height-a-r("bottom"))}function Ht(t,e){const n=e.inset?-e.spread:e.spread;return new DOMRect(t.left+e.x-n,t.top+e.y-n,Math.max(0,t.width+2*n),Math.max(0,t.height+2*n))}function ze(t,e,n,r){if(t.source==="outline"){const{offset:f,width:d}=t.outline;return[f,f+d]}const{shadow:o}=t;if(o.blur>0)return;const a=o.inset?n:e,i=Ht(a,o),s=Ut(e,i[r],r);if(!o.inset)return s>0?[0,s]:void 0;const l=Ut(e,a[r],r),c=r==="top"||r==="bottom"?a.height:a.width,u=i.width&&i.height?Math.max(s,l-c):l-c;return u<l?[u,l]:void 0}function Vr(t,e,n,r,o){const a=ze(t[e],n,r,o);if(!a)return[];const[i,s]=a,l=[0,...t.flatMap(u=>ze(u,n,r,o)??[])].filter(u=>u>i&&u<s),c=[...new Set([i,...l,s])].sort((u,f)=>u-f);return c.slice(1).map((u,f)=>(c[f]+u)/2)}function at(t,e,n=0){return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ke(t,e,n,r){const o=O(t),a=(d,p)=>/^[-+.\d]+(?:px|%)?$/.test(d)?parseFloat(d)*(d.endsWith("%")?p/100:1):NaN,[i,s,l,c]=[o.borderTopLeftRadius,o.borderTopRightRadius,o.borderBottomRightRadius,o.borderBottomLeftRadius].map(d=>{const[p,v=p]=d.split(/\s+/);return[a(p,e.width),a(v,e.height)]}),u=Math.min(1,e.width/(i[0]+s[0]),e.width/(c[0]+l[0]),e.height/(i[1]+c[1]),e.height/(s[1]+l[1])),f=[i,s,l,c];return{clip:n,spread:Ht(n,r),cornerX:u*Math.max(...f.map(([d])=>d)),cornerY:u*Math.max(...f.map(([,d])=>d))}}function Xe(t,e,n,r){return Ut(t,n.spread[r],r)+de*(e.inset?-1:1)}function Ye(t,e,n,r){if(at(e.clip,r)!==t.inset)return!1;const o=t.blur/2*mt,{spread:a,cornerX:i,cornerY:s}=e,l=n==="top"||n==="bottom",c=l?r.x:r.y,u=l?a.left:a.top,f=l?a.right:a.bottom,d=l?i:s;return(l?a.height:a.width)>=o&&c-u>=o+d&&f-c>=o+d}function Je(t){return t.spread===0&&pe(t.blur)}function Ze(t){for(let e=t;e;e=L(e)){const{transform:n,rotate:r,scale:o}=O(e);if(r&&r!=="none"||o&&o!=="none")return!1;if(n==="none")continue;const a=new DOMMatrixReadOnly(n);if(a.m11!==1||a.m22!==1||a.m33!==1||a.m44!==1||a.m12||a.m13||a.m14||a.m21||a.m23||a.m24||a.m31||a.m32||a.m34||a.m43)return!1}return!0}function qr(t,e,n,r,o,a,i){if(e.source==="outline"){const{color:x,offset:k,width:A,style:y}=e.outline;return i<=k||i>=k+A||U(x)?.alpha===0?void 0:y!=="solid"?{ambiguous:"non-solid outline"}:{paint:{rawColor:x,opacity:1},opaque:U(x)?.alpha===1}}const{shadow:s}=e,{color:l,blur:c,inset:u}=s,f=u?r:n;if(at(f,o)!==u)return;const d=U(l)?.alpha;if(d===0)return;if(c===0)return at(Ht(f,s),o)===u?void 0:{paint:{rawColor:l,opacity:1},opaque:d===1};const p=Ke(t,n,f,s),v=Xe(n,s,p,a);if(Je(s)&&Math.abs(i-v)<1e-6&&Ye(s,p,a,o)&&Ze(t))return{paint:{rawColor:l,opacity:ge({alpha:1,blur:c})},opaque:!1};const g=c/2*mt*(u?-1:1);if(at(p.spread,o,g)!==u)return{ambiguous:"blurred shadow away from its spread boundary"}}function Qe(t,e,n,r,o,a,i,s){return[.5,.3,.7].flatMap(l=>{const c={...We(e,a,i,l),inside:i>=0?We(e,a,-.5,l):void 0};if(s&&!s(c))return[];if(r.length===1)return[c];const u=g=>qr(t,g,e,n,c,a,i),f=r.slice(0,o).map(u);if(f.some(g=>g&&"opaque"in g&&g.opaque))return[];const d=[],p=[];function v(g,x){if(!x)return!0;if("ambiguous"in x)throw new Error(`Cannot resolve overlapping indicator paint at ${D(t)}: ${x.ambiguous}`);return g.push(x.paint),!x.opaque}for(const g of f)v(d,g);for(const g of r.slice(o+1))if(!v(p,u(g)))break;return[{...c,local:{above:d,below:p}}]})}function tn(t,e,n,r){if(e.width<=0||e.height<=0)return[];const o=n[r],a=n.some(f=>f.source==="shadow"&&f.shadow.inset)?Hr(t,e):e;if(o.source!=="shadow"||o.shadow.blur===0){const f=o.source==="shadow"&&o.shadow.inset?d=>at(a,d):void 0;return je.flatMap(d=>Vr(n,r,e,a,d).flatMap(p=>Qe(t,e,a,n,r,d,p,f)))}const{shadow:i}=o,s=D(t);if(!Je(i))throw new Error(`Unsupported shadow indicator geometry at ${s}: ${i.blur}px blur, ${i.spread}px spread. Expected 3\u20134px blur with zero spread.`);if(!Ze(t))throw new Error(`Unsupported shadow indicator geometry at ${s}: transformed spread edge.`);const l=Ke(t,e,i.inset?a:e,i);let c=!1;const u=je.flatMap(f=>Qe(t,e,a,n,r,f,Xe(e,i,l,f),d=>{const p=Ye(i,l,f,d);return c||=p,p}));if(!c)throw new Error(`Unsupported shadow indicator geometry at ${s}: no straight spread edge with enough clearance.`);return u}var Vt=new Set(["path","circle","ellipse","rect","line","polygon","polyline"]),jr=new Set([...Vt,"symbol","g","svg","defs","use"]),en=["color","fill","fill-opacity","stroke","stroke-opacity","stroke-width","visibility"],nn=new Set([...en,"display","opacity","d","x","y","x1","x2","y1","y2","points","width","height","cx","cy","r","rx","ry","viewBox","preserveAspectRatio","transform","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","fill-rule","paint-order","vector-effect","overflow"]),rn=new WeakMap;function qt(t){return t.href.baseVal||null}function on(t){const e=qt(t)?.trim();if(!e||e.startsWith("#"))return;const n=new URL(e,t.baseURI);if(!n.hash)return;const r=decodeURIComponent(n.hash.slice(1));return n.hash="",{url:n,id:r}}function it(t){return t.namespaceURI===P&&t.localName==="use"}async function Wr(t){const e=new Map;for(const r of t){if(!it(r))continue;let o;try{o=on(r)}catch{continue}if(!o||e.has(o.url.href)||o.url.origin!==r.ownerDocument.location?.origin)continue;const{url:a}=o;if(jt(a,r.ownerDocument))continue;let i=rn.get(r.ownerDocument);i||(i=new Map,rn.set(r.ownerDocument,i));let s=i.get(a.href);if(!s){const l=i;s=zr(a).then(c=>(c instanceof Error&&l.delete(a.href),c)),l.set(a.href,s)}e.set(a.href,s)}const n=await Promise.all([...e].map(async([r,o])=>[r,await o]));return new Map(n)}function jt(t,e){const n=new URL(e.URL);return n.hash="",t.href===n.href}async function zr(t){try{const e=await fetch(t,{mode:"same-origin"});if(!e.ok)throw new Error(`SVG sprite returned HTTP ${e.status}`);const n=new DOMParser().parseFromString(await e.text(),"image/svg+xml");if(n.documentElement.namespaceURI!==P)throw new Error("Response is not an SVG sprite");return n}catch(e){return e instanceof Error?e:new Error(String(e))}}function Kr(t,e){const n=t.getBoundingClientRect();if(n.width===0&&n.height===0)return[];const r=new DOMRect(n.x-(n.width?0:e/2),n.y-(n.height?0:e/2),n.width||e,n.height||e),o=K(r);if("getTotalLength"in t&&"getScreenCTM"in t){const a=t,i=a.getScreenCTM();if(i){const s=a.getTotalLength();for(let l=0;l<=16;l++){const c=a.getPointAtLength(s*l/16),u=new DOMPoint(c.x,c.y).matrixTransform(i);o.push({x:u.x,y:u.y})}}}return o}function Xr(t,e,n){const r=[];if(t.visibility!=="visible"||t.display==="none")return r;t.fill!=="none"&&n!=="line"&&r.push({source:"fill",color:t.fill,opacity:Number(t.fillOpacity),points:e}),t.stroke!=="none"&&parseFloat(t.strokeWidth)>0&&r.push({source:"stroke",color:t.stroke,opacity:Number(t.strokeOpacity),points:e});const a=[...t.getPropertyValue("paint-order").split(/\s+/),"fill","stroke"];return r.sort((i,s)=>a.indexOf(i.source)-a.indexOf(s.source))}function Yr(t,e){const n=t.getScreenCTM()?.inverse();return n?({x:r,y:o})=>{const a=new DOMPoint(r,o).matrixTransform(n);return e==="fill"?t.isPointInFill(a):t.isPointInStroke(a)}:()=>!1}function Jr(t,e){const n=qt(t)?.trim();if(!n)throw new Error("SVG use has no href");let r,o;const a=on(t);if(n.startsWith("#")||a&&jt(a.url,t.ownerDocument)){const s=t.getRootNode();r=et(s)?s:t.ownerDocument,o=a?.id??decodeURIComponent(n.slice(1))}else{if(!a)throw new Error("SVG use does not identify a sprite fragment");const s=e.get(a.url.href);if(s instanceof Error)throw s;if(!s)throw new Error("SVG use requires a readable same-origin sprite");if(s.querySelector("style"))throw new Error("External SVG sprite styles cannot be inspected in its rendered instance");r=s,o=a.id}const i=r.getElementById(o);if(!i||i.namespaceURI!==P)throw new Error(`SVG paint target #${o} was not found`);return{target:i,scope:r}}function Q(t,e){return(t.ownerDocument.defaultView&&O(t).getPropertyValue(e)||t.style.getPropertyValue(e)||t.getAttribute(e)||"").trim()}function st(t,e){const n=Q(t,e);return n==="none"?"":n}function an(t){if(st(t,"mask-image")||st(t,"mask"))throw new Error(`Unsupported SVG sprite mask at ${D(t)}`)}function sn(t,e){const n=st(t,"clip-path");if(!n)return;const r=n.match(/^url\((?:"([^"]+)"|'([^']+)'|([^)]*))\)$/),o=(r?.[1]??r?.[2]??r?.[3])?.trim();let a;if(o?.startsWith("#"))a=o.slice(1);else if(o){const d=new URL(o,t.baseURI),p=d.hash.slice(1);d.hash="",jt(d,t.ownerDocument)&&(a=p)}const i=a&&e.getElementById(decodeURIComponent(a)),s=i&&i.firstElementChild,l=i&&i.getAttribute("clipPathUnits"),c=()=>new Error(`Unsupported SVG sprite clip-path "${n}" at ${D(t)}`);if(!i||i.namespaceURI!==P||i.localName!=="clipPath"||l!==null&&l!=="userSpaceOnUse"||i.children.length!==1||!s||s.namespaceURI!==P||s.localName!=="rect")throw c();const u=s;for(const d of[i,u])if(["transform","translate","rotate","scale","clip-path","mask-image","mask"].some(p=>st(d,p))||Q(d,"display")==="none"||Q(d,"visibility")==="hidden")throw c();function f(d){const p=Q(u,d);if(!p||p==="auto")return 0;if(!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:px)?$/.test(p))throw c();return parseFloat(p)}if(f("rx")!==0||f("ry")!==0)throw c();return{x:f("x"),y:f("y"),width:f("width"),height:f("height")}}function cn(t,e){if(!t)return{bounds:new DOMRect,contains:()=>!1};const n=t.inverse(),r=[[e.x,e.y],[e.x+e.width,e.y],[e.x,e.y+e.height],[e.x+e.width,e.y+e.height]].map(([l,c])=>new DOMPoint(l,c).matrixTransform(t)),o=Math.min(...r.map(({x:l})=>l)),a=Math.min(...r.map(({y:l})=>l)),i=Math.max(...r.map(({x:l})=>l)),s=Math.max(...r.map(({y:l})=>l));return{bounds:new DOMRect(o,a,i-o,s-a),contains(l){const{x:c,y:u}=new DOMPoint(l.x,l.y).matrixTransform(n);return c>=e.x&&c<e.x+e.width&&u>=e.y&&u<e.y+e.height}}}function ln(t,e,n=0,r=0){const o=Math.max(t.left-n,...e.map(({bounds:l})=>l.left)),a=Math.max(t.top-r,...e.map(({bounds:l})=>l.top)),i=Math.min(t.right+n,...e.map(({bounds:l})=>l.right)),s=Math.min(t.bottom+r,...e.map(({bounds:l})=>l.bottom));return i<=o||s<=a?[]:K(new DOMRect(o,a,i-o,s-a))}function Zr(t,e,n,r){if(!e.length)return[];const o=n&&!r?t.getScreenCTM():null,a=n/2,i=a*(o?Math.hypot(o.a,o.c):1),s=a*(o?Math.hypot(o.b,o.d):1);return ln(t.getBoundingClientRect(),e,i,s)}function Qr(t){const e=t.getRootNode(),n=sn(t,et(e)?e:t.ownerDocument);if(!n)return;function r(o){const a=Q(t,o);if(!a||a==="auto")return 0;if(!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:px)?$/.test(a))throw new Error(`Unsupported SVG use clip with ${o}="${a}" at ${D(t)}`);return parseFloat(a)}return cn(t.getScreenCTM()?.translate(r("x"),r("y"))??null,n)}function Wt(t,e,n,r,o){if(t.namespaceURI!==P||!jr.has(t.localName))return;if(r.has(t))throw new Error("Circular SVG use reference");const a=t.localName==="symbol"?"svg":t.localName==="use"?"g":t.localName,i=n.createElementNS(P,a);if(t.localName!=="defs"){an(t);const l=sn(t,e);l&&o.set(i,l)}for(const l of["id","class",...nn]){const c=t.getAttribute(l);c!==null&&i.setAttribute(l,c)}const s=t.style;for(const l of nn){const c=s.getPropertyValue(l);c&&i.style.setProperty(l,c,s.getPropertyPriority(l))}if(t.localName==="use"){const l=qt(t),c=l?.startsWith("#")?e.getElementById(decodeURIComponent(l.slice(1))):null;if(!c)throw new Error("Nested SVG use requires a local sprite fragment");const u=Wt(c,e,n,new Set([...r,t]),o);return u&&(un(i,u,f=>s.getPropertyValue(f)||t.getAttribute(f)),u.parentElement||i.append(u)),i}for(const l of t.children){const c=Wt(l,e,n,r,o);c&&i.append(c)}return i}function un(t,e,n){const r=(i,s)=>{const l=n(i)?.trim();return!l||l==="auto"?s:Number.isFinite(Number(l))?`${l}px`:l},o=r("x","0px"),a=r("y","0px");if(e.localName==="svg"){e.style.setProperty("x",o),e.style.setProperty("y",a);for(const i of["width","height"]){const s=e.getAttribute(i)||"100%";e.style.setProperty(i,r(i,s))}}else{const i=t.ownerDocument.createElementNS(P,"g");i.style.translate=`${o} ${a}`,t.append(i),i.append(e)}}function to(t,e){const n=t.ownerSVGElement;if(!n||!t.parentElement||!K(n.getBoundingClientRect()).length)return;const{target:r,scope:o}=Jr(t,e),a=new WeakMap,i=Wt(r,o,t.ownerDocument,new Set,a);if(!i)return;const s=O(t),l=t.ownerDocument.createElementNS(P,"g");l.style.cssText="opacity:0!important;pointer-events:none!important";for(const f of[...en,"transform","transform-origin","transform-box"])l.style.setProperty(f,s.getPropertyValue(f));un(l,i,f=>s.getPropertyValue(f)),i.parentElement||l.append(i);const c=t.getBoundingClientRect(),u={root:i,wrapper:l,retarget:c.width||c.height?n:void 0,clips:a};u.expandingEffect=!!st(t,"filter");try{if(u.liveClip=Qr(t),an(t),u.expandingEffect||!["","normal"].includes(Q(t,"mix-blend-mode")))throw new Error(`Unsupported SVG use filter or blend at ${D(t)}`)}catch(f){u.uncertainty=f instanceof Error?f.message:String(f)}return u}function eo(t,e){const n=new Map,r=new Map,o=new Map,a=new Map,i=new Set;for(const c of t.querySelectorAll("use"))if(!(!it(c)||c.closest("defs, symbol, foreignObject")||!Lt(c)))try{const u=to(c,e);if(!u)continue;a.set(c,u),i.add(u.wrapper)}catch(u){o.set(c,u instanceof Error?u.message:String(u))}const s=[];function l(c,u,f,d,p=[]){if(i.has(c)||c.namespaceURI!==P||c.matches("defs, symbol, foreignObject"))return;const v=O(c),g=Number(v.opacity);if(v.display==="none"||g===0)return;if(it(c)&&!f){const w=c,m=a.get(w),h=o.get(w)??(m?.expandingEffect?m.uncertainty:void 0);if(h){const E=m?.expandingEffect&&w.ownerSVGElement?w.ownerSVGElement.getBoundingClientRect():w.getBoundingClientRect(),R=w.ownerSVGElement??void 0,_=m?.liveClip;s.push({points:_?ln(E,[_]):K(E),layer:{element:w,uncertainty:`${D(w)}: ${h}`,requiresHit:!0,retarget:R},retarget:R,hit:I=>I.x>=E.left&&I.x<E.right&&I.y>=E.top&&I.y<E.bottom&&(!_||_.contains(I))})}else m&&l(m.root,[],w,m.retarget,m.liveClip?[m.liveClip]:[]);return}const x=f&&a.get(f),k=x&&x.clips.get(c),A=k?[...p,cn(c.getScreenCTM(),k)]:p,y=f&&g<1?[...u,{element:c,opacity:g}]:u;if(Vt.has(c.localName)){const w=c,m=parseFloat(v.strokeWidth)||0,h=[...Kr(w,m),...Zr(w,A,v.stroke==="none"?0:m,v.getPropertyValue("vector-effect")==="non-scaling-stroke")];for(const E of Xr(v,h,c.localName)){const R=U(Z(c,E.color));if(E.opacity===0||R?.alpha===0)continue;const _=Yr(w,E.source),I=x&&x.uncertainty;s.push({paint:I?void 0:E,points:h,layer:{element:f??c,...I?{uncertainty:I}:{rawColor:E.color,opacity:E.opacity},groups:y,requiresHit:!0,retarget:d},opaqueInk:!I&&E.opacity===1&&R?.alpha===1?R:void 0,retarget:d,projectedOwner:f,hit:T=>A.every(H=>H.contains(T))&&_(T)})}}for(const w of c.children)l(w,y,f,d,A)}try{for(const[c,{wrapper:u}]of a)c.after(u);l(t,[]);for(const[c,{paint:u,layer:f,hit:d,points:p,retarget:v,opaqueInk:g}]of s.entries()){const x=f.element,k=p.filter(d).map(m=>{const h=[],E=[];for(let R=s.length-1;R>=0;R--)R===c||!s[R].hit(m)||(R>c?h.push(s[R].layer):u&&E.push(s[R].layer));return{...m,retarget:v,svgRoot:t,local:{above:h,below:E,groups:f.groups,opaqueInk:g}}});if("uncertainty"in f){const m=r.get(x)??[];m.push({message:f.uncertainty,points:k}),r.set(x,m);continue}if(!u)continue;const A=(f.groups??[]).reduce((m,h)=>m*h.opacity,u.opacity),y=n.get(x),w={...u,opacity:A,primitiveOpacity:u.opacity,points:k};Array.isArray(y)?y.push(w):n.set(x,[w])}return{samples:n,refusals:r,layersAt(c,u){const f=s.filter(({layer:p})=>u.has(p.element)||!!(p.retarget&&u.has(p.retarget))),d=new Set(f.flatMap(({projectedOwner:p})=>p?[p]:[]));try{for(const p of d)p.after(a.get(p).wrapper);return f.reverse().flatMap(({hit:p,layer:v})=>p(c)?[v]:[])}finally{for(const p of d)a.get(p).wrapper.remove()}}}}finally{for(const{wrapper:c}of a.values())c.remove()}}function zt(t){let e;for(let n=t.parentElement;n?.namespaceURI===P&&n.localName!=="foreignObject";n=n.parentElement)n.localName==="svg"&&(e=n);return e}function no(t){const e=new WeakMap;function n(r){let o=e.get(r);return o||(o=eo(r,t),e.set(r,o)),o}return{paints(r){if(r.namespaceURI!==P||!it(r)&&!Vt.has(r.localName))return[];const o=zt(r);return o?n(o).samples.get(r)??[]:[]},refusals(r){if(!it(r))return[];const o=zt(r);return o?n(o).refusals.get(r)??[]:[]},layersAt(r,o,a){return r.namespaceURI!==P||r.localName!=="svg"||zt(r)?[]:n(r).layersAt(o,a)}}}function ro(t){const e=t.matches(":hover"),n=t.matches(":focus-visible");return e?n?"hover-focus":"hover":n?"focus":"rest"}function oo(t,e){const n=e.flatMap(i=>{const s=i(t);return s?[s]:[]});if(n.length===0)throw new Error(`Missing ${t.kind} target for ${t.source}`);if(n.length>1)throw new Error(`Ambiguous ${t.kind} target: ${n.map(({element:i})=>i).join(", ")}`);const[r]=n;if(!j(r.element)||!r.owner?.isConnected)throw new Error("Paint target requires an element identifier and an attached interaction owner");const o=ro(r.owner),a=r.state?.(o)??o;if(!j(a))throw new Error("Paint target returned an empty state");return{attribution:r,state:a}}function ao(t,e){const n=O(t);let r,o=null;for(let i=t;i;i=L(i)){o??=i.getAttribute("context")?.trim()||null;const s=i.getAttribute("scheme");if((s==="light"||s==="dark")&&(r??=s),o&&r)break}const a=i=>{const s=n.getPropertyValue(i).trim();if(s)return CSS.supports("color",s)?Z(t,s):s};return{scheme:r??(n.colorScheme==="dark"?"dark":"light"),context:o,readProperty:a,readColor(i){if(i===z)return e&&Z(t,e);const s=Pe(i);return s?a(s):void 0}}}function fn(t,e,n,r,o){const a=n==="foreground",i=a?r.foregroundAliases:r.backgroundAliases,s=a?r.foregroundDerivations:r.backgroundDerivations,l=a?r.brandColor:void 0;let c=o.get(e);c||(c=new Map,o.set(e,c));const u=ao(e,l),f=g=>{const x=g===z?`${g}:${l}`:g;c.has(x)||c.set(x,kr(g,u));const k=c.get(x);return k!=null&&xt(k,t)};if(l&&f(z))return z;const p=[...new Set([...Ae,...s??[]])].filter(g=>!i?.includes(g)&&f(g));if(p.length===1)return p[0];const v=JSON.stringify(t);throw new Error(p.length===0?`Unmatched ${n} ${v}`:`Ambiguous ${n} ${v}: ${p.join(", ")}`)}function io(t,e){return t.namespaceURI===P||t.textContent?.trim()||e.clipPath==="none"&&e.maskImage==="none"?!1:U(Z(t,e.backgroundColor))?.alpha!==0}async function so(t,e){if(!Ie(e?.role))throw new TypeError("observePaint requires a nonempty role without surrounding whitespace.");if(!t.isConnected||!t.ownerDocument.defaultView)throw new TypeError("observePaint requires an attached browser surface.");const{role:n}=e,r=[...yr[n]??[],...e.extraTargets??[]],{elements:o,text:a}=Er(t),i=Rr(t.ownerDocument),s=(et(t)?t.host:t).getBoundingClientRect(),l=new Set(o),c=i.flatMap(y=>[...y.querySelectorAll('svg use[href]:not([href^="#"])')].filter(w=>{if(l.has(w))return!1;const m=w.getBoundingClientRect();return m.right>s.left&&m.left<s.right&&m.bottom>s.top&&m.top<s.bottom})),u=no(await Wr([...o,...c])),f=o.filter(Lt),d=Ur(f,i),p=new Set,v=[],g=[];for(const y of a){const w=L(y);if(!w||!Lt(w))continue;const m=Tr(y);if(!m.length)continue;const h=O(w),E=h.getPropertyValue("-webkit-text-fill-color")||h.color;v.push({candidate:{element:w,text:y,kind:"text",source:"text"},rawColor:E,coverage:1,points:m})}for(const y of f){const w=O(y),m=io(y,w);m&&w.maskImage!=="none"?p.add(`Unsupported CSS shape mask at ${D(y)}`):m&&v.push({candidate:{element:y,kind:"graphic",source:"shape"},rawColor:w.backgroundColor,coverage:1,points:[...y.getClientRects()].flatMap(K)});for(const h of d.get(y)??[])v.push({candidate:{element:y,kind:h.kind,source:h.source,indicator:h.blur>0?"blurred-shadow":void 0},rawColor:h.color,coverage:1,blur:h.blur,points:h.points});try{for(const h of u.refusals(y))g.push({element:y,...h});for(const h of u.paints(y))v.push({candidate:{element:y,kind:"graphic",source:h.source},rawColor:h.color,coverage:h.opacity,primitiveOpacity:h.primitiveOpacity,points:h.points})}catch(h){g.push({element:y,message:h instanceof Error?h.message:String(h),points:[...y.getClientRects()].flatMap(K)})}}const x=v.map(y=>{try{return{sample:y,match:oo(y.candidate,r)}}catch(w){return{sample:y,error:w}}}),k=new WeakMap,A=Cr(i,()=>{const y=[],w=$r(t.ownerDocument,u.layersAt);for(const{element:m,message:h,points:E}of g)try{E.some(R=>w(m,R,!0))&&p.add(`${D(m)}: ${h}`)}catch(R){p.add(`${D(m)}: ${R instanceof Error?R.message:String(R)}`)}for(const{sample:m,match:h,error:E}of x){const{candidate:R,rawColor:_,points:I}=m,{element:T,kind:H,source:X,indicator:ct}=R,lt=D(T,R.text);try{const B=[];for(const N of I){const ut=w(T,N,X!=="shape");ut&&B.push(ut)}if(!B.length)continue;const b=U(Z(T,_));if(!b)throw new Error(`Cannot resolve ${X} paint "${_}"`);if(!h)throw E;const{attribution:C,state:St}=h,Kt=fn(b,T,"foreground",C,k),Et=ge({alpha:b.alpha*(m.primitiveOpacity??m.coverage),blur:m.blur??0}),tt=[];for(const N of B){const ut=fn(N.sourceColor,N.sourceElement??T,"background",C,k),Xt=N.paintForeground({...b,alpha:Et});tt.some(Yt=>Yt.background===ut&&xt(Yt.backgroundColor,N.color)&&xt(Yt.foregroundColor,Xt))||tt.push({role:n,element:C.element,state:St,kind:H,source:X,indicator:ct,paintOpacity:m.coverage===1?void 0:m.coverage,foreground:Kt,background:ut,foregroundColor:Xt,backgroundColor:N.color,ratio:Nn(Xt,N.color),required:$n(H),location:lt})}y.push(...tt)}catch(B){p.add(`${lt}: ${B instanceof Error?B.message:String(B)}`)}}return y});if(p.size)throw new Error(`Paint observation failed for "${n}":
|
|
1
|
+
(()=>{var yn=Object.defineProperty,wn=(t,e)=>{for(var n in e)yn(t,n,{get:e[n],enumerable:!0})},oe={};wn(oe,{PAINT_CATALOG:()=>Ue,auditPaintCoverage:()=>Ar,enabledPaintEntries:()=>Cr,observePaint:()=>ho});function nt(t){return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}function _(t){if(t.assignedSlot)return t.assignedSlot;if(t.parentElement)return t.parentElement;const e=t.parentNode;return e&&nt(e)?e.host:null}function S(t,e){for(let n=t;n;n=_(n))if(n.matches(e))return n;return null}function ht(t){const e=S(t,"nav.drawer");return e?e.classList.contains("full-screen")?"full-screen":"panel":S(t,".is-horizontal > .group-items")?"inline-panel":"inline"}function A(t,e){return t==="inline"?e:`${t}-${e}`}function gt(t){switch(t){case"inline":case"inline-panel":return["inlineNav"];case"panel":case"full-screen":return[`drawer:${t}`]}}var j=["rest","hover","focus","hover-focus"],Z=t=>t==="hover"||t==="hover-focus",H=t=>t==="focus"||t==="hover-focus";function Mt(t,e){return t.ownerDocument.defaultView?.getComputedStyle(t).getPropertyValue(e).trim()||void 0}var ae=Object.freeze({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}),ie=Math.PI/180,W=1e-4,kn=50,mt="[+-]?(?:\\d+|\\d*\\.\\d+)(?:[eE][+-]?\\d+)?",D="[\\t\\n\\f\\r ]",xn=new RegExp(D+"*,"+D+"*"),Sn=new RegExp(D+"+");function bt(t){return t.replace(/\/\*[\s\S]*?(?:\*\/|$)/g," ").replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g,"")}var se={"":1,deg:1,grad:.9,rad:180/Math.PI,turn:360},En=.4,Rn=new RegExp("^oklch\\("+D+"*("+mt+")(%?)"+D+"+("+mt+")(%?)"+D+"+("+mt+")(deg|grad|rad|turn)?"+D+"*\\)$","i");function Cn(t){const e=t.h*ie;return{L:t.l,a:t.c*Math.cos(e),b:t.c*Math.sin(e)}}function Tn(t){const e=t.L+.3963377774*t.a+.2158037573*t.b,n=t.L-.1055613458*t.a-.0638541728*t.b,r=t.L-.0894841775*t.a-1.291485548*t.b,o=e*e*e,a=n*n*n,i=r*r*r;return{r:4.0767416621*o-3.3077115913*a+.2309699292*i,g:-1.2684380046*o+2.6097574011*a-.3413193965*i,b:-.0041960863*o-.7034186147*a+1.707614701*i}}function At(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function Mn(t){return{r:At(t.r),g:At(t.g),b:At(t.b)}}function An(t){return t.r>=-W&&t.r<=1+W&&t.g>=-W&&t.g<=1+W&&t.b>=-W&&t.b<=1+W}function U(t){return Math.max(0,Math.min(1,t))}function On(t){const e=bt(t).match(Rn);if(!e)return null;let n=parseFloat(e[1]);e[2]==="%"&&(n/=100);let r=parseFloat(e[3]);e[4]==="%"&&(r=r/100*En);const o=parseFloat(e[5])*se[(e[6]??"").toLowerCase()];return!isFinite(n)||!isFinite(r)||!isFinite(o)?null:{l:Math.max(0,Math.min(1,n)),c:Math.max(0,r),h:(o%360+360)%360}}function Ot(t){return Mn(Tn(Cn(t)))}function ce(t){return An(Ot(t))}function le(t){if(t.c<=W||ce(t))return{...t};let e=0,n=t.c,r={...t};for(let o=0;o<kn;o++){const a=(e+n)/2;if(r={l:t.l,c:a,h:t.h},ce(r)?e=a:n=a,n-e<W)break}return{l:t.l,c:e,h:t.h}}function Q(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Pn(t){return{r:Q(t.r),g:Q(t.g),b:Q(t.b)}}function In({r:t,g:e,b:n}){const r=Math.cbrt(.4122214708*t+.5363325363*e+.0514459929*n),o=Math.cbrt(.2119034982*t+.6806995451*e+.1073969566*n),a=Math.cbrt(.0883024619*t+.2817188376*e+.6299787005*n);return{L:.2104542553*r+.793617785*o-.0040720468*a,a:1.9779984951*r-2.428592205*o+.4505937099*a,b:.0259040371*r+.7827717662*o-.808675766*a}}function Nn(t){return In(Pn(t))}function ue(t){const e=Math.sqrt(t.a*t.a+t.b*t.b),n=e<1e-12?0:(Math.atan2(t.b,t.a)/ie%360+360)%360;return{l:t.L,c:e,h:n}}function fe(t,e){const n=t.slice(1),r=n.length;if(!/^[0-9a-f]+$/i.test(n)||r!==3&&r!==6&&!(e&&(r===4||r===8)))return null;const o=r<=4?1:2,a=i=>{const s=n.slice(i*o,(i+1)*o);return parseInt(o===1?s.repeat(2):s,16)/255};return{space:"srgb",color:{r:a(0),g:a(1),b:a(2)},alpha:r===4||r===8?a(3):1}}function rt(t,e,n){const r=t.match(new RegExp("^"+e+"\\("+D+"*([^)]*?)"+D+"*\\)$","i"));if(!r)return null;const o=r[1],a=o.includes(","),i=o.split("/");if(i.length>2||i.length===2&&(a||!n))return null;const l=bt(i[0]).split(a?xn:Sn),c=a&&l.length===4&&n?l.pop():i[1];if(l.length!==3||l.some(f=>f.length===0))return null;const u=c===void 0?1:de(bt(c));return u===null?null:{args:l,legacy:a,alpha:u}}var _n=new RegExp("^("+mt+")([a-z%]*)$","i");function vt(t){const e=t.match(_n);if(!e)return null;const n=parseFloat(e[1]);return isFinite(n)?{value:n,unit:e[2].toLowerCase()}:null}function de(t){if(t.toLowerCase()==="none")return 0;const e=vt(t);return!e||e.unit!==""&&e.unit!=="%"?null:U(e.unit==="%"?e.value/100:e.value)}function Ln(t){if(t.unit!==""&&t.unit!=="%")return null;const e=t.unit==="%"?t.value/100:t.value/255;return Math.max(0,Math.min(1,e))}function Dn(t){const e=se[t.unit];return e===void 0?null:t.value*e}function pe(t){return t.unit!==""&&t.unit!=="%"?null:Math.max(0,Math.min(1,t.value/100))}function Bn(t,e,n){const r=(t%360+360)%360,o=a=>{const i=(a+r/30)%12,s=e*Math.min(n,1-n);return n-s*Math.max(-1,Math.min(i-3,9-i,1))};return{r:o(0),g:o(8),b:o(4)}}function he(t,e){const n=bt(t);if(n.startsWith("#"))return fe(n,e);if(/^oklch\(/i.test(n)){const r=e?rt(n,"oklch",!0):null;if(e&&(!r||r.legacy))return null;const o=On(r?`oklch(${r.args.map(a=>a.toLowerCase()==="none"?"0":a).join(" ")})`:n);return o?{space:"oklch",color:o,alpha:r?.alpha??1}:null}if(/^rgba?\(/i.test(n)){const r=rt(n,"rgba?",e);if(!r)return null;const o=r.args.map(vt);if(o.some(u=>u===null))return null;const a=o;if(r.legacy&&new Set(a.map(u=>u.unit)).size>1)return null;const i=a.map(Ln);if(i.some(u=>u===null))return null;const[s,l,c]=i;return{space:"srgb",color:{r:s,g:l,b:c},alpha:r.alpha}}if(/^hsla?\(/i.test(n)){const r=rt(n,"hsla?",e);if(!r)return null;const o=r.args.map(vt);if(o.some(f=>f===null))return null;const[a,i,s]=o;if(r.legacy&&(i.unit!=="%"||s.unit!=="%"))return null;const l=Dn(a),c=pe(i),u=pe(s);return l===null||c===null||u===null?null:{space:"srgb",color:Bn(l,c,u),alpha:r.alpha}}if(e){if(/^oklab\(/i.test(n)){const a=rt(n,"oklab",!0);if(!a||a.legacy)return null;const i=a.args.map(u=>vt(u.toLowerCase()==="none"?"0":u));if(i.some(u=>!u||u.unit!==""&&u.unit!=="%"))return null;const[s,l,c]=i.map((u,f)=>{const d=u;return d.unit!=="%"?d.value:d.value/100*(f===0?1:.4)});return{space:"oklch",color:ue({L:U(s),a:l,b:c}),alpha:a.alpha}}const r=n.toLowerCase();if(Object.prototype.hasOwnProperty.call(ae,r))return fe(ae[r],e);if(r==="transparent")return{space:"srgb",color:{r:0,g:0,b:0},alpha:0};const o=n.match(new RegExp("^color\\("+D+"*srgb"+D+"+","i"));if(o){const a=rt(`color(${n.slice(o[0].length)}`,"color",!0);if(!a||a.legacy)return null;const i=a.args.map(de);if(i.some(u=>u===null))return null;const[s,l,c]=i;return{space:"srgb",color:{r:s,g:l,b:c},alpha:a.alpha}}}return null}var $n=4.5,Gn=3;function ge({r:t,g:e,b:n}){return .2126*Q(t)+.7152*Q(e)+.0722*Q(n)}function Hn(t,e){const n=ge(t),r=ge(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function B(t){const e=he(t,!0);if(!e)return null;const n=e.space==="oklch"?Ot(le(e.color)):e.color;return{r:U(n.r),g:U(n.g),b:U(n.b),alpha:e.alpha}}function me(t,e){const n=t&&he(t,!0);if(!n)return null;const r=n.space==="oklch"?n.color:ue(Nn(n.color)),o=Ot(le({...r,l:U(e(r.l))}));return{r:U(o.r),g:U(o.g),b:U(o.b),alpha:n.alpha}}function be(t,e){if(t.alpha===0)return e;if(t.alpha===1||e.alpha===0)return t;const n=e.alpha*(1-t.alpha),r=t.alpha+n;return{r:(t.r*t.alpha+e.r*n)/r,g:(t.g*t.alpha+e.g*n)/r,b:(t.b*t.alpha+e.b*n)/r,alpha:r}}var ve=3,Un=4,ye=.1,yt=4;function we(t){return t>=ve&&t<=Un}var ke=1/Math.sqrt(2*Math.PI),Fn=ke*Math.exp(-(yt**2)/2)/yt,Vn=.5-ye/(ve/2)*ke-3*Fn-.05;function xe(t){if(t.blur===0)return t.alpha;if(!we(t.blur))throw new RangeError(`Unsupported shadow indicator blur ${t.blur}px. Expected 3\u20134px.`);return t.alpha*Vn}function qn(t){return t==="text"?$n:Gn}var ot={text:{bg:"background",targetLc:75},typeOverline:{bg:"background",targetLc:90},typeLabel:{bg:"background",targetLc:75},typeLead:{bg:"background",targetLc:75},typeCaption:{bg:"background",targetLc:90},dangerText:{bg:"background",targetLc:75},headings:{bg:"background",targetLc:60},headingsHover:{bg:"background",targetLc:60},link:{bg:"background",targetLc:75},linkHover:{bg:"linkHoverBg",targetLc:75},actionText:{bg:"actionBackground",targetLc:75},inputCaret:{bg:"layer2",targetLc:60},inputSelection:{bg:"inputSelectionBg",targetLc:60}},jn=.88,wt="action-interaction-fill",Pt="button-focus-shadow",Se=ot.actionText.bg,Ee=({element:t,source:e})=>{const n=e==="fill"||e==="stroke";if(e!=="text"&&e!=="shadow"&&!n)return;const r=S(t,"[part=wrapper].esp-field:not(.incognito)"),o=r&&S(r,"esp-button"),a=r?.querySelector(":scope > [part=control]");if(!r||!o||!a||e==="shadow"&&t!==r||e==="text"&&!S(t,"[part=label]"))return;const i=S(o,"esp-menu-item"),s=!i&&S(o,"esp-footer");if(!(i&&S(o,"esp-header"))&&!s)return;const l=i?ht(o):"inline",c=a.matches("[aria-current=page]"),u=a.matches("button:disabled"),f=!u&&r.matches(":hover"),d=!u&&r.matches(":focus-within"),p=f||d,m=c?f?"current-hover":"current":d?f?"hover-focus":"focus":f?"hover":"rest",v=s?"footer-action-button":"nav-button";return{element:n?`${v}-icon`:v,owner:a,state:()=>A(l,m),...e==="shadow"?{foregroundDerivations:[Pt],foregroundAliases:["shadow"]}:p?{backgroundDerivations:[wt]}:{}}};function Re(t,e=!1){const n=e?["footerActionButton"]:gt(t),r=e?void 0:{kind:"button",...t==="inline"?{depth:"top-level"}:t==="inline-panel"?{depth:"nested"}:{}},o=e?"footer-action-button":"nav-button",a=e?[...n,"footerActionIcon"]:n,i=t==="inline"?"layer2":"layer1",s=j.flatMap(l=>{const c=A(t,l),u={element:o,foreground:"actionText",background:l==="rest"?Se:wt,state:c,kind:"text",flags:n,...r?{navigation:r}:{}},f={...u,element:`${o}-icon`,kind:"graphic",flags:a,...r?{navigation:{...r,icon:!0}}:{}};return H(l)?[u,f,{...u,foreground:Pt,background:i,kind:"ring",indicator:"blurred-shadow"}]:[u,f]});if(r)for(const l of["current","current-hover"]){const c={element:o,foreground:"actionText",background:l==="current"?Se:wt,state:A(t,l),kind:"text",flags:n,navigation:{...r,canBeCurrent:!0}};s.push(c,{...c,element:`${o}-icon`,kind:"graphic",navigation:{...r,canBeCurrent:!0,icon:!0}})}return s}var Wn={entriesByRole:{header:["inline","inline-panel","panel","full-screen"].flatMap(t=>Re(t)),footer:Re("inline",!0)},targets:{header:[Ee],footer:[Ee]},derivations:{[wt]:t=>me(t.readColor("actionBackground"),e=>e*jn),[Pt]:t=>{const e=t.readProperty("--esp-field-focus-shadow");if(e)return B(e);if(t.scheme==="light")return B(t.readColor("shadow")??"");const n=t.readProperty("--_esp-context-shadow");if(n)return B(n);const r=t.readProperty("--esp-l-ink")?.trim(),o=r?.endsWith("%")?Number(r.slice(0,-1))/100:Number(r);return r&&Number.isFinite(o)?me(t.readColor("primary"),()=>o):null}}},Ce={headings:"--_esp-footer-fitted-heading-color",link:"--_esp-footer-fitted-link-color"},Te="--_esp-footer-ink-mode",kt="footer-heading-ink",xt="footer-link-ink",Me={foregroundDerivations:[kt],foregroundAliases:["headings"]},Ae={foregroundDerivations:[xt],foregroundAliases:["link"]},zn=({element:t,source:e})=>{const n=S(t,".brand .configured-brand");if(!(!n||!S(n,"esp-footer"))){if(e==="outline"&&t===n&&n.matches("a[href]"))return{element:"brand-link",owner:n,...Ae};if(e==="text"&&S(t,".brand-text"))return{element:"brand-text",owner:n,...n.matches("a[href]")?{}:{state:()=>"rest"},...n.matches("a[href]:hover")?Oe(Nt):{},...n.matches("a[href]:hover")?{}:{brandColor:Mt(n,"--_esp-footer-brand-color"),...Me}}}};function Kn(t){const e=t.ownerDocument,n=e.createTreeWalker(t,NodeFilter.SHOW_TEXT),r=e.createRange();for(let o=n.nextNode();o;o=n.nextNode()){const a=o.parentElement;if(!(!a||!o.textContent?.trim()||a.closest("svg, [hidden], .sr-only"))&&e.defaultView?.getComputedStyle(a).visibility==="visible"&&(r.selectNodeContents(o),Array.from(r.getClientRects()).some(({width:i,height:s})=>i>0&&s>0)))return!0}return!1}var Xn=({element:t,source:e})=>{if(!S(t,"esp-footer")||S(t,"esp-button"))return;const n=S(t,"a[href]");if(n&&!n.classList.contains("configured-brand")&&(e==="text"||e==="outline"&&t===n&&Kn(n)))return{element:"footer-link",owner:n,...e==="outline"||!n.matches(":hover")?Ae:{},...e==="text"&&n.matches(":hover")?Oe(It):{}};if(e!=="text")return;const r=S(t,"h1, h2, h3, h4, h5, h6");if(r)return{element:"footer-heading",owner:r,state:()=>"rest",...Me};if(S(t,".aside, .bottom, esp-footer-link-group"))return{element:"footer-body",owner:t,state:()=>"rest"}},It="footer-link-hover-background",Nt="footer-brand-hover-background",Oe=t=>({backgroundDerivations:[t],backgroundAliases:[ot.linkHover.bg]}),Yn={derivations:{[It]:({readProperty:t,readColor:e})=>B(t("--esp-footer-link-hover-bg")??e(ot.linkHover.bg)??""),[Nt]:({readProperty:t,readColor:e})=>B(t("--esp-footer-brand-hover-background")??t("--esp-footer-link-hover-bg")??e(ot.linkHover.bg)??""),[kt]:({readProperty:t,readColor:e})=>B(t("--esp-footer-heading-color")??(t(Te)==="semantic"?void 0:t(Ce.headings))??e("headings")??""),[xt]:({readProperty:t,readColor:e})=>B(t("--esp-footer-link-color")??(t(Te)==="semantic"?void 0:t(Ce.link))??e("link")??"")},entriesByRole:{footer:[{element:"footer-heading",foreground:kt,background:"layer2",state:"rest",kind:"text",flags:["footerHeadings"]},{element:"footer-body",foreground:"text",background:"layer2",state:"rest",kind:"text",flags:["footerBody"]},...j.flatMap(t=>{const e=Z(t),n=H(t),r={foreground:e?"linkHover":xt,background:e?It:"layer2",state:t,kind:"text"},o=[{...r,element:"footer-link",flags:["footerLinks"]},{...r,element:"brand-text",foreground:e?"linkHover":"brand-color",background:e?Nt:"layer2",flags:t==="rest"?["brandText"]:["brandText","brandLink"]}];if(n)for(const[a,i]of[["footer-link","footerLinks"],["brand-link","brandLink"]])o.push({element:a,foreground:xt,background:"layer2",state:t,kind:"ring",flags:[i]});return o})]},targets:{footer:[zn,Xn]}},Jn=({element:t,source:e})=>{const n=S(t,"section.brand .configured-brand");if(!(!n||!S(n,"esp-header"))){if(e==="outline"&&t===n&&n.matches("a[href]"))return{element:"brand-link",owner:n};if(e==="text"&&S(t,".brand-text"))return{element:"brand-text",owner:n,...n.matches(":hover")?{}:{brandColor:Mt(n,"--_esp-header-brand-color")}}}},Zn=({element:t,source:e})=>{if(e!=="fill"&&e!=="stroke"&&e!=="outline")return;const n=S(t,"esp-header-button");if(!n||!S(n,"esp-header"))return;const r=n.shadowRoot?.querySelector("button");if(!r||e==="outline"&&t!==r)return;if(n.classList.contains("theme-toggle"))return{element:"theme-toggle",owner:r};if(n.classList.contains("menu-toggle")){const a=n.matches(":popover-open")?"full-screen":r.getAttribute("aria-expanded")==="true"?"panel":"inline";return{element:"burger",owner:r,state:i=>A(a,i)}}const o=n.shadowRoot?.querySelector("use[href$='#search']")??n.querySelector("use[href$='#search']");if(n.getAttribute("icon")==="search"||o)return{element:"search-button",owner:r}};function at(t,e,n,r="inline"){return j.flatMap(o=>{const a={element:t,foreground:"text",background:n==="tall"?"layer2":Z(o)?"layer4":"layer3",state:A(r,o),flags:e},i={...a,kind:"graphic"};return H(o)?[i,{...a,kind:"ring"}]:[i]})}var Qn={entriesByRole:{header:[...j.flatMap(t=>{const e={element:"brand-text",foreground:Z(t)?"headingsHover":"brand-color",background:"layer2",state:t,kind:"text",flags:H(t)?["brandText","brandLink"]:["brandText"]};return H(t)?[e,{element:"brand-link",foreground:"link",background:"layer2",state:t,kind:"ring",flags:["brandLink"]}]:[e]}),...["standard","tall"].flatMap(t=>{const e=`headerPaint:${t}`;return[...at("search-button",["searchButton",e],t),...at("theme-toggle",["themeToggle",e],t),...at("burger",["burger",e],t),...at("burger",["burger","drawer:panel",e],t,"panel")]}),...at("burger",["burger","drawer:full-screen"],"standard","full-screen")]},targets:{header:[Jn,Zn]}},Pe=ot.linkHover.bg,_t="nav-hover-indicator-ink",Lt="nav-active-indicator-ink",tr=["inline","inline-panel","panel","full-screen"];function St(t,e){switch(t){case"inline":return{...e,depth:"top-level"};case"inline-panel":return{...e,depth:"nested"};default:return e}}var er=({element:t,source:e})=>{const n=S(t,".item:not(.button-appearance)"),r=n&&S(n,"esp-menu-item");if(!n||!r||!S(r,"esp-header"))return;const o=n.querySelector(":scope > :is(a, button, [aria-current=page])");if(!o)return;const a=o.matches("[aria-current=page]"),i=ht(n),s=i!=="inline"&&n.matches(":hover,:focus-within"),l=c=>a?A(i,s?"current-hover":"current"):A(i,s&&c==="rest"?"row-active":c);if(e==="shadow")return a&&t===n?{element:"nav-current-indicator",owner:o,state:l,foregroundDerivations:[Lt],foregroundAliases:["link"]}:!a&&t===o?{element:"nav-hover-indicator",owner:o,state:l,foregroundDerivations:[_t],foregroundAliases:["headingsHover"]}:void 0;if((e==="fill"||e==="stroke")&&S(t,".icon-area"))return{element:"nav-item-icon",owner:o,state:l};if(e==="outline"&&t===o||e==="text"&&S(t,'[part="menu-text"]'))return{element:o.matches("button")?"nav-item":"nav-link",owner:o,state:l,...e==="outline"&&i==="inline"&&o.matches(":hover")?{excludeBackdropEdge:{edge:"bottom",depth:2}}:{}}},nr=({element:t,source:e})=>{const n=S(t,".group-header"),r=n&&S(n,"esp-menu-group");if(!n||!r||!S(r,"esp-header"))return;const o=ht(n),a=(e==="fill"||e==="stroke")&&S(t,".group-icon");if(a){const u=n.querySelector(".group-toggle");return u?{element:"nav-group-icon",owner:u,state:f=>A(o,a.matches(":hover")?H(f)?"hover-focus":"hover":f)}:void 0}const i=S(t,".group-link, .group-toggle, [aria-current=page]");if(!i)return;const s=i.matches("[aria-current=page]"),l=(o==="panel"||o==="inline-panel")&&n.matches(":hover,:focus-within"),c=u=>s?A(o,l?"current-row-active":"current"):A(o,l&&u==="rest"?"row-active":u);if(e==="shape"&&t.matches(".indicator"))return{element:"nav-group-disclosure",owner:i,state:c};if(e==="text"&&S(t,".group-label-text"))return{element:"nav-group-label",owner:i,state:c};if(e==="outline"&&t===i)return{element:"nav-group-control",owner:i,state:c}},rr=({element:t,source:e})=>{const n=S(t,".drawer-brand .configured-brand");if(!n||!S(n,"esp-header"))return;const r=ht(n),o=n.matches("a[href]"),a=i=>A(r,o?i:"rest");if(e==="outline"&&t===n&&o)return{element:"drawer-brand-link",owner:n,state:a};if(e==="text"&&S(t,".brand-text"))return{element:"drawer-brand-text",owner:n,state:a,brandColor:Mt(n,"--_esp-menu-drawer-brand-color")}};function or(t){const e=gt(t),n=t==="inline",r=t==="full-screen",o=n?"layer2":"layer1",a=St(t,{kind:"plain",anchor:!0}),i=St(t,{kind:"plain",anchor:!1}),s=[!0,!1].flatMap(u=>{const f=u?"nav-link":"nav-item",d=u?a:i;return(n?j:[...j,"row-active"]).flatMap(m=>{const v=m==="row-active",y=!v&&Z(m),w=!v&&H(m),T=y||w||v,k=u&&y?"linkHover":!n&&T?"headingsHover":"text",x=u&&y&&!n&&!r?Pe:!r&&T?"layer2":o,g=A(t,m),h={element:f,foreground:k,background:x,state:g,kind:"text",flags:e,navigation:d},E={...h,element:"nav-item-icon",kind:"graphic",background:"layer2",navigation:{...d,icon:!0}};if(!w)return[h,E];const R={...h,foreground:"link",kind:"ring"};return[h,E,R]})}),l={element:"nav-link",foreground:"link",background:r?"layer1":"layer2",state:A(t,"current"),kind:"text",flags:e,navigation:St(t,{kind:"plain",canBeCurrent:!0})},c={...l,element:"nav-item-icon",kind:"graphic",background:"layer2",navigation:{...l.navigation,icon:!0}};return s.push(l,c),n?s.push({element:"nav-hover-indicator",foreground:_t,background:"layer2",state:"hover",kind:"graphic",flags:e,navigation:{kind:"plain",depth:"top-level"}},{...l,element:"nav-current-indicator",kind:"graphic",foreground:Lt,flags:[...e,"headerPaint:standard"]}):s.push({...l,foreground:"headingsHover",state:A(t,"current-hover")},{...c,foreground:"headingsHover",state:A(t,"current-hover")}),s}function ar(t){const e=gt(t),n=St(t,{kind:"group"}),r=i=>t==="full-screen"?"layer1":t==="inline"||i?"layer2":"layer1",o={element:"nav-group-label",foreground:"link",background:r(!1),state:A(t,"current"),kind:"text",flags:e,navigation:{...n,canBeCurrent:!0}},a=j.flatMap(i=>{const s=H(i),l=r(s||Z(i)),c=A(t,i),u={foreground:"text",background:l,state:c,flags:e,navigation:n},f=[{...u,element:"nav-group-label",kind:"text"},{...u,element:"nav-group-disclosure",kind:"graphic"},{...u,element:"nav-group-icon",kind:"graphic",background:"layer2",navigation:{...n,icon:!0}}];return s&&f.push({...u,element:"nav-group-control",foreground:"link",kind:"ring"}),f});if(a.push(o),t==="inline-panel"||t==="panel"){const i=r(!0),s={foreground:"text",background:i,state:A(t,"row-active"),flags:e,navigation:n};a.push({...s,element:"nav-group-label",kind:"text"},{...s,element:"nav-group-disclosure",kind:"graphic"},{...o,background:i,state:A(t,"current-row-active")})}return a}var ir={derivations:{[_t]:({readProperty:t,readColor:e})=>B(t("--esp-menu-item-hover-indicator-color")??t("--esp-menu-item-hover-color")??e("headingsHover")??""),[Lt]:({readProperty:t,readColor:e})=>B(t("--esp-menu-item-active-indicator-color")??t("--esp-menu-item-active-color")??e("link")??"")},entriesByRole:{header:[...tr.flatMap(t=>[...or(t),...ar(t)]),...j.flatMap(t=>{const e=A("full-screen",t),n=gt("full-screen"),r=H(t),o=Z(t),a={element:"drawer-brand-text",foreground:"brand-color",background:o?Pe:"layer1",state:e,kind:"text",flags:[...n,"brandText",...o||r?["brandLink"]:[]]};return r?[a,{element:"drawer-brand-link",foreground:"link",background:"layer1",state:e,kind:"ring",flags:[...n,"brandLink"]}]:[a]})]},targets:{header:[er,nr,rr]}};function sr(t,e){return t?.trim()||e?.trim()||""}var Dt={series1:"#000000",series2:"#E69F00",series3:"#56B4E9",series4:"#009E73",series5:"#F0E442",series6:"#0072B2",series7:"#D55E00",series8:"#CC79A7"},Bt=["background","layer1","layer2","layer3","layer4","actionBackground","actionText","border","shadow","text","typeOverline","typeLabel","typeLead","typeCaption","dangerText","headings","headingsHover","link","linkHover","linkHoverBg","inputCaret","inputSelection","inputSelectionBg"];function Ie(t){return`--esp-color-${t.replace(/([A-Z])/g,"-$1").replace(/(\d)/g,"-$1").toLowerCase()}`}var cr=["--esp-color-danger","--esp-color-warning","--esp-color-success","--esp-color-info"],go=[...Bt.map(Ie),...cr],lr=["primary","analogous-left","analogous-right","complementary","split-complementary-left","split-complementary-right","triadic-left","triadic-right","danger","success","warning","info"];function $t(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var ur={surface:.99,raised1:.97,raised2:.9,raised3:.8,raised4:.72,accent:.5,muted:.45,text:.35,border:.3,ink:.25,shadow:.2},fr={surface:.15,raised1:.2,raised2:.3,raised3:.4,raised4:.36,accent:.6,muted:.75,text:.85,border:.7,ink:.95,shadow:.6},Ne={background:{source:"primary",lightness:"surface"},layer1:{source:"primary",lightness:"raised1"},layer2:{source:"primary",lightness:"raised2"},layer3:{source:"primary",lightness:"raised3"},layer4:{source:"primary",lightness:"raised4"},actionBackground:{source:"primary",lightness:"muted"},actionText:{source:"primary",lightness:"ink"},border:{source:"primary",lightness:"border"},shadow:{source:"primary",lightness:"shadow"},text:{source:"primary",lightness:"text"},typeOverline:{source:"primary",lightness:"text"},typeLabel:{source:"primary",lightness:"text"},typeLead:{source:"primary",lightness:"text"},typeCaption:{source:"primary",lightness:"text"},dangerText:{source:"danger",lightness:"text"},headings:{source:"primary",lightness:"muted"},headingsHover:{source:"primary",lightness:"text"},link:{source:"complementary",lightness:"accent"},linkHover:{source:"complementary",lightness:"text"},linkHoverBg:{source:"triadic-left",lightness:"raised2"},inputCaret:{source:"triadic-right",lightness:"ink"},inputSelection:{source:"complementary",lightness:"text"},inputSelectionBg:{source:"triadic-left",lightness:"raised2"}},dr={light:"muted",dark:"raised3"};function _e(t){return{...Ne,actionBackground:{source:"primary",lightness:dr[t]}}}var pr=.4;function Gt(){const t={};for(const e of Bt)t[e]={min:0,max:pr};return t}var hr="system-ui, sans-serif",gr="monospace",Le={seedColor:"oklch(0.7 0.125 216)",fontBody:hr,fontHeadings:"",fontBrand:"",fontMenu:"",fontMonospace:gr,fontWeightBody:"normal",fontWeightHeadings:"bold",fontWeightBrand:"bold",fontWeightMenu:"bold",fontWeightMonospace:"normal",stylesheets:[],rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200,angles:{analogous:30,complementary:180,splitComplementary:30,triadic:120},semanticHues:{danger:27,success:150,warning:90,info:244},variantChroma:{},intents:{},tones:{},chroma:Gt(),semanticMappings:{...Ne},explicitMappingTokens:[],anchors:{},roles:{},contexts:{},dataPalette:{...Dt},dataRamps:{}},mr={...Le,chroma:Gt(),semanticMappings:_e("light"),anchors:{},roles:{},contexts:{},tones:{},dataPalette:{...Dt},dataRamps:{},lightness:{...ur}},br={...Le,chroma:Gt(),semanticMappings:_e("dark"),anchors:{},roles:{},contexts:{},tones:{},dataPalette:{...Dt},dataRamps:{},lightness:{...fr}},De=new WeakMap;De.set(mr,new Set),De.set(br,new Set);var Et=new Map([...Bt.map(t=>[t,Ie(t)]),...lr.map(t=>[t,`--esp-color-${t}`])]),Be=Object.freeze([...Et.keys()]),K="brand-color";function it(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function $e(t){return Et.get(t)}function z(t){return typeof t=="string"&&t.trim()!==""}function Ge(t){return z(t)&&t===t.trim()}function vr(t){return t==="text"||t==="graphic"||t==="ring"}function yr(t){return Array.isArray(t)&&Array.from(t).every(z)}var He={depth:t=>t==="top-level"||t==="nested",kind:t=>t==="button"||t==="plain"||t==="group",anchor:t=>typeof t=="boolean",canBeCurrent:t=>typeof t=="boolean",icon:t=>t===void 0||typeof t=="boolean"},wr={element:!0,foreground:!0,background:!0,state:!0,kind:!0,flags:!0,navigation:!0,indicator:!0,paintOpacity:!0};function kr(t){return $t(t)&&Object.entries(t).every(([e,n])=>it(He,e)&&He[e](n))}function xr(t,e,n){if(!$t(t)||!Object.keys(t).every(r=>it(wr,r))||!z(t.element)||!z(t.state)||!vr(t.kind)||!yr(t.flags))throw new TypeError(`${e} is not a paint entry.`);for(const r of["foreground","background"]){const o=t[r];if(!z(o)||!(Et.has(o)||it(n,o)||r==="foreground"&&o===K))throw new TypeError(`${e} has an unknown ${r} paint identifier "${String(o)}".`)}if(t.paintOpacity!==void 0&&(typeof t.paintOpacity!="number"||!Number.isFinite(t.paintOpacity)||t.paintOpacity<0||t.paintOpacity>1))throw new TypeError(`${e} has an invalid paint opacity.`);if(t.navigation!==void 0&&!kr(t.navigation))throw new TypeError(`${e} has an invalid navigation predicate.`);if(t.indicator!==void 0&&(t.indicator!=="blurred-shadow"||t.kind==="text"))throw new TypeError(`${e} has an invalid indicator.`)}function Sr(t,e=Fe){if(!$t(t))throw new TypeError("Paint entries must be grouped by role.");for(const[n,r]of Object.entries(t)){if(!Ge(n)||!Array.isArray(r))throw new TypeError(`Paint entries for role "${n}" must be an array on a nonempty role without outer whitespace.`);for(let o=0;o<r.length;o+=1)xr(r[o],`Paint entry for "${n}" at index ${o}`,e)}}function Er(t){const e=Object.create(null),n=Object.create(null),r=Object.create(null);for(const o of t)for(const[a,i]of Object.entries(o.derivations??{})){if(!z(a)||a===K||Et.has(a)||a in r)throw new TypeError(`Paint derivation "${a}" must have a unique identifier.`);r[a]=i}for(const o of t){Sr(o.entriesByRole,r);for(const[a,i]of Object.entries(o.entriesByRole))(e[a]??=[]).push(...i);for(const[a,i]of Object.entries(o.targets))(n[a]??=[]).push(...i)}for(const o of Object.values(e))Object.freeze(o);for(const o of Object.values(n))Object.freeze(o);return{entriesByRole:Object.freeze(e),targets:Object.freeze(n),derivations:Object.freeze(r)}}var Ht=Er([Qn,Yn,ir,Wn]),Ue=Ht.entriesByRole,Rr=Ht.targets,Fe=Ht.derivations;function Cr(t,e,n=Ue,{brandColor:r}={}){const o=it(n,t)?n[t]:[],a=new Set(e.flags),i=o.filter(s=>{if(!s.flags.every(c=>a.has(c)))return!1;if(s.navigation===void 0)return!0;const l=Object.entries(s.navigation);return e.navigation.some(c=>l.every(([u,f])=>c[u]===f))});return sr(r)?i:i.map(s=>s.foreground===K?{...s,foreground:t==="footer"?kt:"headings"}:s)}function Tr(t,e,n=Fe){if(it(n,t))return n[t](e);const r=e.readColor(t);return r?B(r):null}function Mr(t){return JSON.stringify([t.role,t.element,t.state,t.kind,t.foreground,t.background,t.indicator,t.paintOpacity??1])}function Ve(t){const e=new Map;for(const n of t){const r=Mr(n);e.has(r)||e.set(r,n)}return e}function Ar(t,e){const n=Object.entries(e).flatMap(([a,i])=>i.map(s=>({role:a,...s}))),r=Ve(n),o=Ve(t);return{unlisted:[...o].filter(([a])=>!r.has(a)).map(([,a])=>a),unobserved:[...r].filter(([a])=>!o.has(a)).map(([,a])=>a)}}var P="http://www.w3.org/2000/svg",qe={r:0,g:0,b:0,alpha:0},Ut={r:1,g:1,b:1,alpha:1};function Or(t){const e=[],n=[];function r(o){if(o.nodeType===Node.TEXT_NODE){o.textContent?.trim()&&n.push(o);return}if(o.nodeType===Node.ELEMENT_NODE){const a=o;if(a.matches("style, script, template, defs, symbol"))return;if(e.push(a),a.shadowRoot){r(a.shadowRoot);return}if(a.localName==="slot"&&a.namespaceURI!==P){const i=a.assignedNodes();if(i.length){i.forEach(r);return}}}o.childNodes.forEach(r)}return r(t),{elements:e,text:n}}function L(t,e){const n=[];for(let o=t;o;o=_(o)){const a=o.localName;if(n.unshift(o.id?`${a}#${o.id}`:a+[...o.classList].slice(0,2).map(i=>`.${i}`).join("")),o.id)break}const r=e?.data.trim().slice(0,70);return n.join(" > ")+(r?` "${r}"`:"")}function Pr(t){const e=[t];for(const n of e)for(const r of n.querySelectorAll("*"))r.shadowRoot&&e.push(r.shadowRoot);return e}function Ir(t,e){const n=new CSSStyleSheet;n.replaceSync("* { pointer-events: auto !important; }");const r=new CSSStyleSheet;r.replaceSync(":host, *, ::slotted(*) { pointer-events: auto !important; }");const o=[];try{for(const a of t){const i=[...a.adoptedStyleSheets];a.adoptedStyleSheets=[...i,nt(a)?r:n],o.push([a,i])}return e()}finally{for(const[a,i]of o)a.adoptedStyleSheets=i}}function X(t){return t.width<=0||t.height<=0?[]:[.5,.25,.75].flatMap(e=>[.5,.25,.75].map(n=>({x:t.left+e*t.width,y:t.top+n*t.height})))}function Nr(t){const e=t.ownerDocument.createRange();return e.selectNodeContents(t),[...e.getClientRects()].flatMap(X)}function _r(t,e){for(let n=t;n&&n!==e.host;n=_(n))if(n.getRootNode()===e)return!0;return!1}function je(t,{x:e,y:n}){const r=[],o=new Set,a=i=>{if(o.has(i))return;o.add(i);const s=i.shadowRoot;s&&s.elementsFromPoint(e,n).filter(l=>_r(l,s)).forEach(a),r.push(i)};return t.elementsFromPoint(e,n).forEach(a),r}function Rt(t,e){return Math.abs(t.alpha-e.alpha)<=.001&&Math.abs(t.r-e.r)<=.001&&Math.abs(t.g-e.g)<=.001&&Math.abs(t.b-e.b)<=.001}function We(t,e){return{...t,alpha:t.alpha*e}}function F(t){return t.trim().toLowerCase()==="transparent"?qe:B(t)}function tt(t,e){if(F(e))return e;const n=t.ownerDocument,r=t.namespaceURI===P?n.createElementNS(P,"g"):n.createElement("span");if(r.style.cssText="display:none!important;visibility:hidden!important",r.style.setProperty("color",e,"important"),!r.style.color)return e;(t.shadowRoot??t).append(r);try{const o=O(r).color;return F(o)?o:(r.style.setProperty("color",`oklch(from ${o} l c h / alpha)`,"important"),O(r).color)}finally{r.remove()}}function O(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function Ft(t){const e=O(t);return e.display!=="none"&&e.visibility==="visible"&&Lr(t)>0}function Lr(t){return ze(t).reduce((e,n)=>e*n.opacity,1)}function Vt(t,e){for(let n=e;n;n=_(n))if(n===t)return!0;return!1}function Dr(t){let e=t;for(let n=_(e);n&&O(e).display==="contents";n=_(e))e=n;return e}function Br(t,e){for(let n=t,r=_(n);r&&!n.matches(":popover-open, dialog:modal");n=r,r=_(n)){const{overflowX:o,overflowY:a}=O(r);if(o==="visible"&&a==="visible")continue;const i=r.getBoundingClientRect();if(o!=="visible"&&(e.x<i.left||e.x>=i.right)||a!=="visible"&&(e.y<i.top||e.y>=i.bottom))return!0}return!1}function $r(t,e){function n(v,y){t.style.setProperty("left",`${v}px`,"important"),t.style.setProperty("top",`${y}px`,"important");const w=t.getBoundingClientRect();return{x:(w.left+w.right)/2,y:(w.top+w.bottom)/2}}const r=e.x-.5,o=e.y-.5,a=n(r,o);if(Math.abs(a.x-e.x)<.05&&Math.abs(a.y-e.y)<.05)return;const i=n(r+1,o),s=n(r,o+1),l=i.x-a.x,c=i.y-a.y,u=s.x-a.x,f=s.y-a.y,d=l*f-c*u;if(Math.abs(d)<1e-6)return;const p=e.x-a.x,m=e.y-a.y;n(r+(f*p-u*m)/d,o+(l*m-c*p)/d)}function Gr(t,e){const n=t.ownerDocument,r=n.createElement("span");r.style.cssText=["all:initial!important","display:block!important","width:1px!important","height:1px!important","position:fixed!important","z-index:auto!important","opacity:0!important","pointer-events:auto!important","visibility:visible!important"].join(";"),r.setAttribute("aria-hidden","true"),(t.shadowRoot??t).append(r);try{$r(r,e);const o=je(n,e),a=o.indexOf(r);return a<0?void 0:{above:o.slice(0,a),below:o.slice(a+1).filter(i=>i!==t)}}finally{r.remove()}}function ze(t){const e=[];for(let n=t;n;n=_(n)){const r=Number(O(n).opacity);r<1&&e.unshift({element:n,opacity:r})}return e}function Ke(t,e,n){const r=F(tt(t,e));if(!r)throw new Error(`Cannot resolve ${n} "${e}" on ${L(t)}`);return r}function Hr(t,e){const n=O(t);if(n.visibility!=="visible"||e.some(o=>o.opacity===0))return null;const r=Ke(t,n.backgroundColor,"background paint");return r.alpha===0?null:{element:t,color:r,sourceColor:r,groups:e}}function Ur(t,e,n){if("uncertainty"in e)throw new Error(e.uncertainty);const r=Ke(t,e.rawColor,"overlapping paint");return{element:t,color:We(r,e.opacity),sourceColor:r,groups:[...n,...e.groups??[]]}}function Fr(t,e){return t.length===e.length&&t.every((n,r)=>n.element===e[r].element)}function qt(t,e,n=0){let r=e;for(let o=t.length-1;o>=0;o--){const a=t[o],i=a.groups[n];if(!i){r=be(a.color,r);continue}let s=o;for(;t[s-1]?.groups[n]?.element===i.element;)s--;const l=qt(t.slice(s,o+1),qe,n+1);r=be(We(l,i.opacity),r),o=s}return r}function Vr(t,e){const n=new Map,r=new WeakMap,o=new WeakMap;function a(l){const c=`${l.x},${l.y}`;let u=n.get(c);return u||(u=je(t,l),n.set(c,u)),u}function i(l){let c=o.get(l);return c||(c=ze(l),o.set(l,c)),c}function s(l){return r.has(l)||r.set(l,Hr(l,i(l))),r.get(l)??null}return function(c,u,f){const d=a(u);if(d.length===0)return;let p;function m(b){return b===u.svgRoot||b.namespaceURI!==P||b.localName!=="svg"?[]:(p??=new Set(d),e(b,u,p))}const v=Dr(c),y=d.includes(v)?v:u.retarget&&d.includes(u.retarget)?u.retarget:void 0;if(u.svgRoot&&!y)return;const w=u.svgRoot??y??v,T=d.indexOf(w);let k,x;if(u.inside){if(Br(c,u))return;const b=a(u.inside),C=b.indexOf(w);if(C<0)return;const J=Gr(w,u);if(J)({above:k,below:x}=J);else{const dt=new Set(b),Ct=d.find(G=>!dt.has(G)&&(s(G)||m(G).length));if(Ct)throw new Error(`Cannot order outward paint against ${L(Ct)}`);const Tt=new Set(b.slice(0,C));k=d.filter(G=>Tt.has(G)),x=d.filter(G=>G!==w&&!Tt.has(G))}}else{if(T<0)return;k=d.slice(0,T),x=d.slice(T+(f?0:1))}const g=i(c),h=u.local,E=[...g,...h?.groups??[]],R=new Set(E.map(b=>b.element)),N=[];function I(b){return!b||b.color.alpha===0?!0:b.color.alpha===1&&b.groups.every(C=>R.has(C.element))?!1:(N.push(b),!0)}function M(b){const C=b.element??c;return b.requiresHit&&!d.includes(C)&&(!b.retarget||!d.includes(b.retarget))?null:Ur(C,b,i(C))}for(const b of k)if(!(Vt(b,w)||Vt(w,b)&&(u.svgRoot||f&&u.inside))){for(const C of m(b))if(!I(M(C)))return;if(!I(s(b)))return}for(const b of h?.above??[])if(!I(M(b)))return;const V=[];function Y(b){return!b||b.color.alpha===0?!0:(V.push(b),b.color.alpha<1||b.groups.length>0)}let ut=!0,ft=!!h?.opaqueInk;for(const b of h?.below??[]){const C=M(b);if(!(!C||C.color.alpha===0)&&!(ft&&h?.opaqueInk&&C.color.alpha===1&&Rt(h.opaqueInk,C.color)&&Fr(E,C.groups))&&(ft=!1,ut=Y(C),!ut))break}if(ut){for(const b of x)if(!(u.svgRoot&&b!==w&&Vt(w,b))&&(m(b).some(C=>!Y(M(C)))||!Y(s(b))))break}const $=V[0];return{color:qt([...N,...V],Ut),sourceColor:$?.sourceColor??Ut,sourceElement:$?.element,paintForeground:b=>{const C={element:c,color:b,sourceColor:b,groups:E};return qt([...N,C,...V],Ut)}}}}function Xe(t,e){let n=0,r=0;const o=[];for(let a=0;a<t.length;a++){const i=t[a];i==="("&&n++,i===")"&&n--,n===0&&e.test(i)&&(a>r&&o.push(t.slice(r,a).trim()),r=a+1)}return r<t.length&&o.push(t.slice(r).trim()),o}function jt(t){const e=parseFloat(t.outlineWidth),n=t.outlineStyle==="none"||t.outlineStyle==="hidden"||!(e>0)?void 0:{color:t.outlineColor,style:t.outlineStyle,width:e,offset:parseFloat(t.outlineOffset)},r=Xe(t.boxShadow,/,/).flatMap(o=>{const a=Xe(o,/\s/),i=a.filter(d=>/^[-+.\d]+px$/.test(d)),[s,l,c=0,u=0]=i.map(parseFloat),f=a.find(d=>d!=="inset"&&!i.includes(d));return f&&s!==void 0&&l!==void 0?[{color:f,x:s,y:l,blur:c,spread:u,value:o,inset:a.includes("inset")}]:[]});return{outline:n,shadow:r}}var qr=/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\\.|:(?:focus-visible|focus-within|focus|hover)(?![\w-])/g;function Wt(t,e){return t.replace(qr,n=>!n.startsWith(":")||e&&n===":hover"?n:`:not(:where(*)):is(${n})`)}function jr(t){const e=[],n=new Set;function r(a){for(const i of a){if("selectorText"in i&&typeof i.selectorText=="string"){const s=i.selectorText;Wt(s,!1)!==s&&e.push([i,s])}if("cssRules"in i&&r(i.cssRules),"styleSheet"in i){const s=i.styleSheet;s&&o(s)}}}function o(a){if(n.has(a))return;n.add(a);let i;try{i=a.cssRules}catch{return}r(i)}for(const a of t)for(const i of[...a.styleSheets,...a.adoptedStyleSheets])o(i);return e}function zt(t,e){return e?.color===t.color&&e.style===t.style&&e.width===t.width&&e.offset===t.offset}var Ye=new WeakMap,Wr=Be.map($e).filter(t=>t!==void 0);function Je(t,e,n){let r=null,o=null;for(let a=t;a&&!(r&&o);a=_(a))r??=a.getAttribute("scheme")||null,o??=a.getAttribute("context")||null;return JSON.stringify([n,e.colorScheme,r,o,...Wr.map(a=>e.getPropertyValue(a))])}function zr(t,e){const n=t[0]?.ownerDocument.defaultView,r=[n?.matchMedia("(prefers-color-scheme: dark)").matches,n?.matchMedia("(forced-colors: active)").matches].join(":"),o=t.flatMap(c=>{const u=O(c),f=jt(u),d=c.matches(":focus-within, :focus-visible"),p=c.matches(":hover"),m=p?"hover":"rest";let v=Ye.get(c);if(d||(v||(v={},Ye.set(c,v)),v[m]={bands:f,environment:Je(c,u,r)}),!f.outline&&f.shadow.length===0)return[];const y=d?v?.[m]:void 0,w=y&&y.environment===Je(c,u,r)?y.bands:void 0;return[{element:c,bands:f,focus:d,hover:p,realNoFocus:w}]}),a=new Map,i=new Map,s=o.some(({focus:c})=>c),l=o.some(({hover:c})=>c);if(s||l){const c=jr(e),u=[],f=new CSSStyleSheet;f.replaceSync("* { transition: none !important; }");try{for(const d of e){const p=[...d.adoptedStyleSheets];d.adoptedStyleSheets=[...p,f],u.push([d,p])}if(s){for(const[d,p]of c){const m=Wt(p,!0);m!==p&&(d.selectorText=m)}for(const{element:d,focus:p}of o)p&&i.set(d,jt(O(d)))}if(l){for(const[d,p]of c)d.selectorText=Wt(p,!1);for(const{element:d,hover:p}of o)p&&a.set(d,jt(O(d)))}}finally{for(const[d,p]of c)d.selectorText!==p&&(d.selectorText=p);for(const{element:d}of o)O(d).boxShadow;for(const[d,p]of u)d.adoptedStyleSheets=p}}return new Map(o.map(({element:c,bands:u,hover:f,focus:d,realNoFocus:p})=>{const m=a.get(c)??i.get(c),v=i.get(c),y=[...c.getClientRects()],w=u.outline,T=u.shadow.map(g=>({source:"shadow",shadow:g}));w&&T.unshift({source:"outline",outline:w});const k=[],x=w&&d&&(!zt(w,v?.outline)||(p?!zt(w,p.outline):w.style==="auto"&&c.matches(":focus-visible")));w&&(x||f&&!zt(w,m?.outline))&&k.push({source:"outline",kind:x?"ring":"graphic",color:w.color,blur:0,points:y.flatMap(g=>cn(c,g,T,0))});for(const[g,h]of u.shadow.entries()){const E=d&&(!v?.shadow.some(({value:M})=>M===h.value)||p&&!p.shadow.some(({value:M})=>M===h.value)),R=f&&!m?.shadow.some(({value:M})=>M===h.value);if(!E&&!R&&!(h.inset&&h.blur===0))continue;const N=w?g+1:g,I=y.flatMap(M=>cn(c,M,T,N));k.push({source:"shadow",kind:E?"ring":"graphic",color:h.color,blur:h.blur,points:I})}return[c,k]}))}var Ze=["top","bottom","left","right"];function Qe(t,e,n,r){const o=t.left+r*t.width,a=t.top+r*t.height;switch(e){case"top":return{x:o,y:t.top-n};case"bottom":return{x:o,y:t.bottom+n};case"left":return{x:t.left-n,y:a};case"right":return{x:t.right+n,y:a}}}function Kt(t,e,n){return(e-t[n])*(n==="right"||n==="bottom"?1:-1)}function Kr(t,e){const n=O(t),r=i=>parseFloat(n.getPropertyValue(`border-${i}-width`)),o=r("left"),a=r("top");return new DOMRect(e.left+o,e.top+a,e.width-o-r("right"),e.height-a-r("bottom"))}function Xt(t,e){const n=e.inset?-e.spread:e.spread;return new DOMRect(t.left+e.x-n,t.top+e.y-n,Math.max(0,t.width+2*n),Math.max(0,t.height+2*n))}function tn(t,e,n,r){if(t.source==="outline"){const{offset:f,width:d}=t.outline;return[f,f+d]}const{shadow:o}=t;if(o.blur>0)return;const a=o.inset?n:e,i=Xt(a,o),s=Kt(e,i[r],r);if(!o.inset)return s>0?[0,s]:void 0;const l=Kt(e,a[r],r),c=r==="top"||r==="bottom"?a.height:a.width,u=i.width&&i.height?Math.max(s,l-c):l-c;return u<l?[u,l]:void 0}function Xr(t,e,n,r,o){const a=tn(t[e],n,r,o);if(!a)return[];const[i,s]=a,l=[0,...t.flatMap(u=>tn(u,n,r,o)??[])].filter(u=>u>i&&u<s),c=[...new Set([i,...l,s])].sort((u,f)=>u-f);return c.slice(1).map((u,f)=>(c[f]+u)/2)}function st(t,e,n=0){return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function en(t,e,n,r){const o=O(t),a=(d,p)=>/^[-+.\d]+(?:px|%)?$/.test(d)?parseFloat(d)*(d.endsWith("%")?p/100:1):NaN,[i,s,l,c]=[o.borderTopLeftRadius,o.borderTopRightRadius,o.borderBottomRightRadius,o.borderBottomLeftRadius].map(d=>{const[p,m=p]=d.split(/\s+/);return[a(p,e.width),a(m,e.height)]}),u=Math.min(1,e.width/(i[0]+s[0]),e.width/(c[0]+l[0]),e.height/(i[1]+c[1]),e.height/(s[1]+l[1])),f=[i,s,l,c];return{clip:n,spread:Xt(n,r),cornerX:u*Math.max(...f.map(([d])=>d)),cornerY:u*Math.max(...f.map(([,d])=>d))}}function nn(t,e,n,r){return Kt(t,n.spread[r],r)+ye*(e.inset?-1:1)}function rn(t,e,n,r){if(st(e.clip,r)!==t.inset)return!1;const o=t.blur/2*yt,{spread:a,cornerX:i,cornerY:s}=e,l=n==="top"||n==="bottom",c=l?r.x:r.y,u=l?a.left:a.top,f=l?a.right:a.bottom,d=l?i:s;return(l?a.height:a.width)>=o&&c-u>=o+d&&f-c>=o+d}function on(t){return t.spread===0&&we(t.blur)}function an(t){for(let e=t;e;e=_(e)){const{transform:n,rotate:r,scale:o}=O(e);if(r&&r!=="none"||o&&o!=="none")return!1;if(n==="none")continue;const a=new DOMMatrixReadOnly(n);if(a.m11!==1||a.m22!==1||a.m33!==1||a.m44!==1||a.m12||a.m13||a.m14||a.m21||a.m23||a.m24||a.m31||a.m32||a.m34||a.m43)return!1}return!0}function Yr(t,e,n,r,o,a,i){if(e.source==="outline"){const{color:y,offset:w,width:T,style:k}=e.outline;return i<=w||i>=w+T||F(y)?.alpha===0?void 0:k!=="solid"?{ambiguous:"non-solid outline"}:{paint:{rawColor:y,opacity:1},opaque:F(y)?.alpha===1}}const{shadow:s}=e,{color:l,blur:c,inset:u}=s,f=u?r:n;if(st(f,o)!==u)return;const d=F(l)?.alpha;if(d===0)return;if(c===0)return st(Xt(f,s),o)===u?void 0:{paint:{rawColor:l,opacity:1},opaque:d===1};const p=en(t,n,f,s),m=nn(n,s,p,a);if(on(s)&&Math.abs(i-m)<1e-6&&rn(s,p,a,o)&&an(t))return{paint:{rawColor:l,opacity:xe({alpha:1,blur:c})},opaque:!1};const v=c/2*yt*(u?-1:1);if(st(p.spread,o,v)!==u)return{ambiguous:"blurred shadow away from its spread boundary"}}function sn(t,e,n,r,o,a,i,s){return[.5,.3,.7].flatMap(l=>{const c={...Qe(e,a,i,l),inside:i>=0?Qe(e,a,-.5,l):void 0};if(s&&!s(c))return[];if(r.length===1)return[c];const u=v=>Yr(t,v,e,n,c,a,i),f=r.slice(0,o).map(u);if(f.some(v=>v&&"opaque"in v&&v.opaque))return[];const d=[],p=[];function m(v,y){if(!y)return!0;if("ambiguous"in y)throw new Error(`Cannot resolve overlapping indicator paint at ${L(t)}: ${y.ambiguous}`);return v.push(y.paint),!y.opaque}for(const v of f)m(d,v);for(const v of r.slice(o+1))if(!m(p,u(v)))break;return[{...c,local:{above:d,below:p}}]})}function cn(t,e,n,r){if(e.width<=0||e.height<=0)return[];const o=n[r],a=n.some(f=>f.source==="shadow"&&f.shadow.inset)?Kr(t,e):e;if(o.source!=="shadow"||o.shadow.blur===0){const f=o.source==="shadow"&&o.shadow.inset?d=>st(a,d):void 0;return Ze.flatMap(d=>Xr(n,r,e,a,d).flatMap(p=>sn(t,e,a,n,r,d,p,f)))}const{shadow:i}=o,s=L(t);if(!on(i))throw new Error(`Unsupported shadow indicator geometry at ${s}: ${i.blur}px blur, ${i.spread}px spread. Expected 3\u20134px blur with zero spread.`);if(!an(t))throw new Error(`Unsupported shadow indicator geometry at ${s}: transformed spread edge.`);const l=en(t,e,i.inset?a:e,i);let c=!1;const u=Ze.flatMap(f=>sn(t,e,a,n,r,f,nn(e,i,l,f),d=>{const p=rn(i,l,f,d);return c||=p,p}));if(!c)throw new Error(`Unsupported shadow indicator geometry at ${s}: no straight spread edge with enough clearance.`);return u}var Yt=new Set(["path","circle","ellipse","rect","line","polygon","polyline"]),Jr=new Set([...Yt,"symbol","g","svg","defs","use"]),ln=["color","fill","fill-opacity","stroke","stroke-opacity","stroke-width","visibility"],un=new Set([...ln,"display","opacity","d","x","y","x1","x2","y1","y2","points","width","height","cx","cy","r","rx","ry","viewBox","preserveAspectRatio","transform","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","fill-rule","paint-order","vector-effect","overflow"]),fn=new WeakMap;function Jt(t){return t.href.baseVal||null}function dn(t){const e=Jt(t)?.trim();if(!e||e.startsWith("#"))return;const n=new URL(e,t.baseURI);if(!n.hash)return;const r=decodeURIComponent(n.hash.slice(1));return n.hash="",{url:n,id:r}}function ct(t){return t.namespaceURI===P&&t.localName==="use"}async function Zr(t){const e=new Map;for(const r of t){if(!ct(r))continue;let o;try{o=dn(r)}catch{continue}if(!o||e.has(o.url.href)||o.url.origin!==r.ownerDocument.location?.origin)continue;const{url:a}=o;if(Zt(a,r.ownerDocument))continue;let i=fn.get(r.ownerDocument);i||(i=new Map,fn.set(r.ownerDocument,i));let s=i.get(a.href);if(!s){const l=i;s=Qr(a).then(c=>(c instanceof Error&&l.delete(a.href),c)),l.set(a.href,s)}e.set(a.href,s)}const n=await Promise.all([...e].map(async([r,o])=>[r,await o]));return new Map(n)}function Zt(t,e){const n=new URL(e.URL);return n.hash="",t.href===n.href}async function Qr(t){try{const e=await fetch(t,{mode:"same-origin"});if(!e.ok)throw new Error(`SVG sprite returned HTTP ${e.status}`);const n=new DOMParser().parseFromString(await e.text(),"image/svg+xml");if(n.documentElement.namespaceURI!==P)throw new Error("Response is not an SVG sprite");return n}catch(e){return e instanceof Error?e:new Error(String(e))}}function to(t,e){const n=t.getBoundingClientRect();if(n.width===0&&n.height===0)return[];const r=new DOMRect(n.x-(n.width?0:e/2),n.y-(n.height?0:e/2),n.width||e,n.height||e),o=X(r);if("getTotalLength"in t&&"getScreenCTM"in t){const a=t,i=a.getScreenCTM();if(i){const s=a.getTotalLength();for(let l=0;l<=16;l++){const c=a.getPointAtLength(s*l/16),u=new DOMPoint(c.x,c.y).matrixTransform(i);o.push({x:u.x,y:u.y})}}}return o}function eo(t,e,n){const r=[];if(t.visibility!=="visible"||t.display==="none")return r;t.fill!=="none"&&n!=="line"&&r.push({source:"fill",color:t.fill,opacity:Number(t.fillOpacity),points:e}),t.stroke!=="none"&&parseFloat(t.strokeWidth)>0&&r.push({source:"stroke",color:t.stroke,opacity:Number(t.strokeOpacity),points:e});const a=[...t.getPropertyValue("paint-order").split(/\s+/),"fill","stroke"];return r.sort((i,s)=>a.indexOf(i.source)-a.indexOf(s.source))}function no(t,e){const n=t.getScreenCTM()?.inverse();return n?({x:r,y:o})=>{const a=new DOMPoint(r,o).matrixTransform(n);return e==="fill"?t.isPointInFill(a):t.isPointInStroke(a)}:()=>!1}function ro(t,e){const n=Jt(t)?.trim();if(!n)throw new Error("SVG use has no href");let r,o;const a=dn(t);if(n.startsWith("#")||a&&Zt(a.url,t.ownerDocument)){const s=t.getRootNode();r=nt(s)?s:t.ownerDocument,o=a?.id??decodeURIComponent(n.slice(1))}else{if(!a)throw new Error("SVG use does not identify a sprite fragment");const s=e.get(a.url.href);if(s instanceof Error)throw s;if(!s)throw new Error("SVG use requires a readable same-origin sprite");if(s.querySelector("style"))throw new Error("External SVG sprite styles cannot be inspected in its rendered instance");r=s,o=a.id}const i=r.getElementById(o);if(!i||i.namespaceURI!==P)throw new Error(`SVG paint target #${o} was not found`);return{target:i,scope:r}}function et(t,e){return(t.ownerDocument.defaultView&&O(t).getPropertyValue(e)||t.style.getPropertyValue(e)||t.getAttribute(e)||"").trim()}function lt(t,e){const n=et(t,e);return n==="none"?"":n}function pn(t){if(lt(t,"mask-image")||lt(t,"mask"))throw new Error(`Unsupported SVG sprite mask at ${L(t)}`)}function hn(t,e){const n=lt(t,"clip-path");if(!n)return;const r=n.match(/^url\((?:"([^"]+)"|'([^']+)'|([^)]*))\)$/),o=(r?.[1]??r?.[2]??r?.[3])?.trim();let a;if(o?.startsWith("#"))a=o.slice(1);else if(o){const d=new URL(o,t.baseURI),p=d.hash.slice(1);d.hash="",Zt(d,t.ownerDocument)&&(a=p)}const i=a&&e.getElementById(decodeURIComponent(a)),s=i&&i.firstElementChild,l=i&&i.getAttribute("clipPathUnits"),c=()=>new Error(`Unsupported SVG sprite clip-path "${n}" at ${L(t)}`);if(!i||i.namespaceURI!==P||i.localName!=="clipPath"||l!==null&&l!=="userSpaceOnUse"||i.children.length!==1||!s||s.namespaceURI!==P||s.localName!=="rect")throw c();const u=s;for(const d of[i,u])if(["transform","translate","rotate","scale","clip-path","mask-image","mask"].some(p=>lt(d,p))||et(d,"display")==="none"||et(d,"visibility")==="hidden")throw c();function f(d){const p=et(u,d);if(!p||p==="auto")return 0;if(!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:px)?$/.test(p))throw c();return parseFloat(p)}if(f("rx")!==0||f("ry")!==0)throw c();return{x:f("x"),y:f("y"),width:f("width"),height:f("height")}}function gn(t,e){if(!t)return{bounds:new DOMRect,contains:()=>!1};const n=t.inverse(),r=[[e.x,e.y],[e.x+e.width,e.y],[e.x,e.y+e.height],[e.x+e.width,e.y+e.height]].map(([l,c])=>new DOMPoint(l,c).matrixTransform(t)),o=Math.min(...r.map(({x:l})=>l)),a=Math.min(...r.map(({y:l})=>l)),i=Math.max(...r.map(({x:l})=>l)),s=Math.max(...r.map(({y:l})=>l));return{bounds:new DOMRect(o,a,i-o,s-a),contains(l){const{x:c,y:u}=new DOMPoint(l.x,l.y).matrixTransform(n);return c>=e.x&&c<e.x+e.width&&u>=e.y&&u<e.y+e.height}}}function mn(t,e,n=0,r=0){const o=Math.max(t.left-n,...e.map(({bounds:l})=>l.left)),a=Math.max(t.top-r,...e.map(({bounds:l})=>l.top)),i=Math.min(t.right+n,...e.map(({bounds:l})=>l.right)),s=Math.min(t.bottom+r,...e.map(({bounds:l})=>l.bottom));return i<=o||s<=a?[]:X(new DOMRect(o,a,i-o,s-a))}function oo(t,e,n,r){if(!e.length)return[];const o=n&&!r?t.getScreenCTM():null,a=n/2,i=a*(o?Math.hypot(o.a,o.c):1),s=a*(o?Math.hypot(o.b,o.d):1);return mn(t.getBoundingClientRect(),e,i,s)}function ao(t){const e=t.getRootNode(),n=hn(t,nt(e)?e:t.ownerDocument);if(!n)return;function r(o){const a=et(t,o);if(!a||a==="auto")return 0;if(!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:px)?$/.test(a))throw new Error(`Unsupported SVG use clip with ${o}="${a}" at ${L(t)}`);return parseFloat(a)}return gn(t.getScreenCTM()?.translate(r("x"),r("y"))??null,n)}function Qt(t,e,n,r,o){if(t.namespaceURI!==P||!Jr.has(t.localName))return;if(r.has(t))throw new Error("Circular SVG use reference");const a=t.localName==="symbol"?"svg":t.localName==="use"?"g":t.localName,i=n.createElementNS(P,a);if(t.localName!=="defs"){pn(t);const l=hn(t,e);l&&o.set(i,l)}for(const l of["id","class",...un]){const c=t.getAttribute(l);c!==null&&i.setAttribute(l,c)}const s=t.style;for(const l of un){const c=s.getPropertyValue(l);c&&i.style.setProperty(l,c,s.getPropertyPriority(l))}if(t.localName==="use"){const l=Jt(t),c=l?.startsWith("#")?e.getElementById(decodeURIComponent(l.slice(1))):null;if(!c)throw new Error("Nested SVG use requires a local sprite fragment");const u=Qt(c,e,n,new Set([...r,t]),o);return u&&(bn(i,u,f=>s.getPropertyValue(f)||t.getAttribute(f)),u.parentElement||i.append(u)),i}for(const l of t.children){const c=Qt(l,e,n,r,o);c&&i.append(c)}return i}function bn(t,e,n){const r=(i,s)=>{const l=n(i)?.trim();return!l||l==="auto"?s:Number.isFinite(Number(l))?`${l}px`:l},o=r("x","0px"),a=r("y","0px");if(e.localName==="svg"){e.style.setProperty("x",o),e.style.setProperty("y",a);for(const i of["width","height"]){const s=e.getAttribute(i)||"100%";e.style.setProperty(i,r(i,s))}}else{const i=t.ownerDocument.createElementNS(P,"g");i.style.translate=`${o} ${a}`,t.append(i),i.append(e)}}function io(t,e){const n=t.ownerSVGElement;if(!n||!t.parentElement||!X(n.getBoundingClientRect()).length)return;const{target:r,scope:o}=ro(t,e),a=new WeakMap,i=Qt(r,o,t.ownerDocument,new Set,a);if(!i)return;const s=O(t),l=t.ownerDocument.createElementNS(P,"g");l.style.cssText="opacity:0!important;pointer-events:none!important";for(const f of[...ln,"transform","transform-origin","transform-box"])l.style.setProperty(f,s.getPropertyValue(f));bn(l,i,f=>s.getPropertyValue(f)),i.parentElement||l.append(i);const c=t.getBoundingClientRect(),u={root:i,wrapper:l,retarget:c.width||c.height?n:void 0,clips:a};u.expandingEffect=!!lt(t,"filter");try{if(u.liveClip=ao(t),pn(t),u.expandingEffect||!["","normal"].includes(et(t,"mix-blend-mode")))throw new Error(`Unsupported SVG use filter or blend at ${L(t)}`)}catch(f){u.uncertainty=f instanceof Error?f.message:String(f)}return u}function so(t,e){const n=new Map,r=new Map,o=new Map,a=new Map,i=new Set;for(const c of t.querySelectorAll("use"))if(!(!ct(c)||c.closest("defs, symbol, foreignObject")||!Ft(c)))try{const u=io(c,e);if(!u)continue;a.set(c,u),i.add(u.wrapper)}catch(u){o.set(c,u instanceof Error?u.message:String(u))}const s=[];function l(c,u,f,d,p=[]){if(i.has(c)||c.namespaceURI!==P||c.matches("defs, symbol, foreignObject"))return;const m=O(c),v=Number(m.opacity);if(m.display==="none"||v===0)return;if(ct(c)&&!f){const x=c,g=a.get(x),h=o.get(x)??(g?.expandingEffect?g.uncertainty:void 0);if(h){const E=g?.expandingEffect&&x.ownerSVGElement?x.ownerSVGElement.getBoundingClientRect():x.getBoundingClientRect(),R=x.ownerSVGElement??void 0,N=g?.liveClip;s.push({points:N?mn(E,[N]):X(E),layer:{element:x,uncertainty:`${L(x)}: ${h}`,requiresHit:!0,retarget:R},retarget:R,hit:I=>I.x>=E.left&&I.x<E.right&&I.y>=E.top&&I.y<E.bottom&&(!N||N.contains(I))})}else g&&l(g.root,[],x,g.retarget,g.liveClip?[g.liveClip]:[]);return}const y=f&&a.get(f),w=y&&y.clips.get(c),T=w?[...p,gn(c.getScreenCTM(),w)]:p,k=f&&v<1?[...u,{element:c,opacity:v}]:u;if(Yt.has(c.localName)){const x=c,g=parseFloat(m.strokeWidth)||0,h=[...to(x,g),...oo(x,T,m.stroke==="none"?0:g,m.getPropertyValue("vector-effect")==="non-scaling-stroke")];for(const E of eo(m,h,c.localName)){const R=F(tt(c,E.color));if(E.opacity===0||R?.alpha===0)continue;const N=no(x,E.source),I=y&&y.uncertainty;s.push({paint:I?void 0:E,points:h,layer:{element:f??c,...I?{uncertainty:I}:{rawColor:E.color,opacity:E.opacity},groups:k,requiresHit:!0,retarget:d},opaqueInk:!I&&E.opacity===1&&R?.alpha===1?R:void 0,retarget:d,projectedOwner:f,hit:M=>T.every(V=>V.contains(M))&&N(M)})}}for(const x of c.children)l(x,k,f,d,T)}try{for(const[c,{wrapper:u}]of a)c.after(u);l(t,[]);for(const[c,{paint:u,layer:f,hit:d,points:p,retarget:m,opaqueInk:v}]of s.entries()){const y=f.element,w=p.filter(d).map(g=>{const h=[],E=[];for(let R=s.length-1;R>=0;R--)R===c||!s[R].hit(g)||(R>c?h.push(s[R].layer):u&&E.push(s[R].layer));return{...g,retarget:m,svgRoot:t,local:{above:h,below:E,groups:f.groups,opaqueInk:v}}});if("uncertainty"in f){const g=r.get(y)??[];g.push({message:f.uncertainty,points:w}),r.set(y,g);continue}if(!u)continue;const T=(f.groups??[]).reduce((g,h)=>g*h.opacity,u.opacity),k=n.get(y),x={...u,opacity:T,primitiveOpacity:u.opacity,points:w};Array.isArray(k)?k.push(x):n.set(y,[x])}return{samples:n,refusals:r,layersAt(c,u){const f=s.filter(({layer:p})=>u.has(p.element)||!!(p.retarget&&u.has(p.retarget))),d=new Set(f.flatMap(({projectedOwner:p})=>p?[p]:[]));try{for(const p of d)p.after(a.get(p).wrapper);return f.reverse().flatMap(({hit:p,layer:m})=>p(c)?[m]:[])}finally{for(const p of d)a.get(p).wrapper.remove()}}}}finally{for(const{wrapper:c}of a.values())c.remove()}}function te(t){let e;for(let n=t.parentElement;n?.namespaceURI===P&&n.localName!=="foreignObject";n=n.parentElement)n.localName==="svg"&&(e=n);return e}function co(t){const e=new WeakMap;function n(r){let o=e.get(r);return o||(o=so(r,t),e.set(r,o)),o}return{paints(r){if(r.namespaceURI!==P||!ct(r)&&!Yt.has(r.localName))return[];const o=te(r);return o?n(o).samples.get(r)??[]:[]},refusals(r){if(!ct(r))return[];const o=te(r);return o?n(o).refusals.get(r)??[]:[]},layersAt(r,o,a){return r.namespaceURI!==P||r.localName!=="svg"||te(r)?[]:n(r).layersAt(o,a)}}}function lo(t){const e=t.matches(":hover"),n=t.matches(":focus-visible");return e?n?"hover-focus":"hover":n?"focus":"rest"}function uo(t,e){const n=e.flatMap(i=>{const s=i(t);return s?[s]:[]});if(n.length===0)throw new Error(`Missing ${t.kind} target for ${t.source}`);if(n.length>1)throw new Error(`Ambiguous ${t.kind} target: ${n.map(({element:i})=>i).join(", ")}`);const[r]=n;if(!z(r.element)||!r.owner?.isConnected)throw new Error("Paint target requires an element identifier and an attached interaction owner");const o=lo(r.owner),a=r.state?.(o)??o;if(!z(a))throw new Error("Paint target returned an empty state");return{attribution:r,state:a}}function fo(t,e){const n=O(t);let r,o=null;for(let i=t;i;i=_(i)){o??=i.getAttribute("context")?.trim()||null;const s=i.getAttribute("scheme");if((s==="light"||s==="dark")&&(r??=s),o&&r)break}const a=i=>{const s=n.getPropertyValue(i).trim();if(s)return CSS.supports("color",s)?tt(t,s):s};return{scheme:r??(n.colorScheme==="dark"?"dark":"light"),context:o,readProperty:a,readColor(i){if(i===K)return e&&tt(t,e);const s=$e(i);return s?a(s):void 0}}}function vn(t,e,n,r,o){const a=n==="foreground",i=a?r.foregroundAliases:r.backgroundAliases,s=a?r.foregroundDerivations:r.backgroundDerivations,l=a?r.brandColor:void 0;let c=o.get(e);c||(c=new Map,o.set(e,c));const u=fo(e,l),f=y=>{const w=y===K?`${y}:${l}`:y;c.has(w)||c.set(w,Tr(y,u));const T=c.get(w);return T!=null&&Rt(T,t)};if(l&&f(K))return K;const d=(s??[]).filter(f);if(d.length===1)return d[0];const m=[...new Set([...Be,...s??[]])].filter(y=>!i?.includes(y)&&f(y));if(m.length===1)return m[0];const v=JSON.stringify(t);throw new Error(m.length===0?`Unmatched ${n} ${v}`:`Ambiguous ${n} ${v}: ${m.join(", ")}`)}function po(t,e){return t.namespaceURI===P||t.textContent?.trim()||e.clipPath==="none"&&e.maskImage==="none"?!1:F(tt(t,e.backgroundColor))?.alpha!==0}async function ho(t,e){if(!Ge(e?.role))throw new TypeError("observePaint requires a nonempty role without surrounding whitespace.");if(!t.isConnected||!t.ownerDocument.defaultView)throw new TypeError("observePaint requires an attached browser surface.");const{role:n}=e,r=[...Rr[n]??[],...e.extraTargets??[]],{elements:o,text:a}=Or(t),i=Pr(t.ownerDocument),s=(nt(t)?t.host:t).getBoundingClientRect(),l=new Set(o),c=i.flatMap(k=>[...k.querySelectorAll('svg use[href]:not([href^="#"])')].filter(x=>{if(l.has(x))return!1;const g=x.getBoundingClientRect();return g.right>s.left&&g.left<s.right&&g.bottom>s.top&&g.top<s.bottom})),u=co(await Zr([...o,...c])),f=o.filter(Ft),d=zr(f,i),p=new Set,m=[],v=[];for(const k of a){const x=_(k);if(!x||!Ft(x))continue;const g=Nr(k);if(!g.length)continue;const h=O(x),E=h.getPropertyValue("-webkit-text-fill-color")||h.color;m.push({candidate:{element:x,text:k,kind:"text",source:"text"},rawColor:E,coverage:1,points:g})}for(const k of f){const x=O(k),g=po(k,x);g&&x.maskImage!=="none"?p.add(`Unsupported CSS shape mask at ${L(k)}`):g&&m.push({candidate:{element:k,kind:"graphic",source:"shape"},rawColor:x.backgroundColor,coverage:1,points:[...k.getClientRects()].flatMap(X)});for(const h of d.get(k)??[])m.push({candidate:{element:k,kind:h.kind,source:h.source,indicator:h.blur>0?"blurred-shadow":void 0},rawColor:h.color,coverage:1,blur:h.blur,points:h.points});try{for(const h of u.refusals(k))v.push({element:k,...h});for(const h of u.paints(k))m.push({candidate:{element:k,kind:"graphic",source:h.source},rawColor:h.color,coverage:h.opacity,primitiveOpacity:h.primitiveOpacity,points:h.points})}catch(h){v.push({element:k,message:h instanceof Error?h.message:String(h),points:[...k.getClientRects()].flatMap(X)})}}const y=m.map(k=>{try{return{sample:k,match:uo(k.candidate,r)}}catch(x){return{sample:k,error:x}}}),w=new WeakMap,T=Ir(i,()=>{const k=[],x=Vr(t.ownerDocument,u.layersAt);for(const{element:g,message:h,points:E}of v)try{E.some(R=>x(g,R,!0))&&p.add(`${L(g)}: ${h}`)}catch(R){p.add(`${L(g)}: ${R instanceof Error?R.message:String(R)}`)}for(const{sample:g,match:h,error:E}of y){const{candidate:R,rawColor:N,points:I}=g,{element:M,kind:V,source:Y,indicator:ut}=R,ft=L(M,R.text);try{const $=[],b=h?.attribution.excludeBackdropEdge,C=b&&h.attribution.owner.getBoundingClientRect().bottom;for(const q of I){if(b&&C!==void 0&&q.y>=C-b.depth)continue;const pt=x(M,q,Y!=="shape");pt&&$.push(pt)}if(!$.length)continue;const J=F(tt(M,N));if(!J)throw new Error(`Cannot resolve ${Y} paint "${N}"`);if(!h)throw E;const{attribution:dt,state:Ct}=h,Tt=vn(J,M,"foreground",dt,w),G=xe({alpha:J.alpha*(g.primitiveOpacity??g.coverage),blur:g.blur??0}),ee=[];for(const q of $){const pt=vn(q.sourceColor,q.sourceElement??M,"background",dt,w),ne=q.paintForeground({...J,alpha:G});ee.some(re=>re.background===pt&&Rt(re.backgroundColor,q.color)&&Rt(re.foregroundColor,ne))||ee.push({role:n,element:dt.element,state:Ct,kind:V,source:Y,indicator:ut,paintOpacity:g.coverage===1?void 0:g.coverage,foreground:Tt,background:pt,foregroundColor:ne,backgroundColor:q.color,ratio:Hn(ne,q.color),required:qn(V),location:ft})}k.push(...ee)}catch($){p.add(`${ft}: ${$ instanceof Error?$.message:String($)}`)}}return k});if(p.size)throw new Error(`Paint observation failed for "${n}":
|
|
2
2
|
${[...p].join(`
|
|
3
|
-
`)}`);return
|
|
3
|
+
`)}`);return T}globalThis.EspalierPaintTesting=oe})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{composedParent as
|
|
2
|
-
${[...
|
|
3
|
-
`)}`);return
|
|
1
|
+
import{composedParent as H,isShadowRoot as et}from"../shared/composed-dom.js";import{BRAND_PAINT_ID as I,PAINT_TARGETS as rt,PAINT_TOKEN_IDS as nt,isPaintName as J,isPaintRole as st,paintTokenProperty as it,resolvePaintColor as at}from"../shared/paint-catalog.js";import{paintRequiredRatio as ct,shadowIndicatorAlpha as ut}from"../shared/paint-color.js";import{wcagRatio as lt}from"../shared/wcag-contrast.js";import{readIndicators as ft}from"./paint-bands.js";import{SVG_NAMESPACE as dt,browserColor as T,allShadowScopes as pt,createPaintSampler as gt,composedNodes as ht,cssPaintColor as K,equalColor as V,hasVisibleBox as W,locationOf as N,sampleRect as L,styleOf as U,textPoints as mt,withPaintHitTesting as wt}from"./paint-dom.js";import{createSvgPaintSampler as bt,loadSprites as vt}from"./svg-paint.js";function Ct(t){const i=t.matches(":hover"),a=t.matches(":focus-visible");return i?a?"hover-focus":"hover":a?"focus":"rest"}function kt(t,i){const a=i.flatMap(s=>{const r=s(t);return r?[r]:[]});if(a.length===0)throw new Error(`Missing ${t.kind} target for ${t.source}`);if(a.length>1)throw new Error(`Ambiguous ${t.kind} target: ${a.map(({element:s})=>s).join(", ")}`);const[c]=a;if(!J(c.element)||!c.owner?.isConnected)throw new Error("Paint target requires an element identifier and an attached interaction owner");const l=Ct(c.owner),f=c.state?.(l)??l;if(!J(f))throw new Error("Paint target returned an empty state");return{attribution:c,state:f}}function St(t,i){const a=U(t);let c,l=null;for(let s=t;s;s=H(s)){l??=s.getAttribute("context")?.trim()||null;const r=s.getAttribute("scheme");if((r==="light"||r==="dark")&&(c??=r),l&&c)break}const f=s=>{const r=a.getPropertyValue(s).trim();if(r)return CSS.supports("color",r)?T(t,r):r};return{scheme:c??(a.colorScheme==="dark"?"dark":"light"),context:l,readProperty:f,readColor(s){if(s===I)return i&&T(t,i);const r=it(s);return r?f(r):void 0}}}function Q(t,i,a,c,l){const f=a==="foreground",s=f?c.foregroundAliases:c.backgroundAliases,r=f?c.foregroundDerivations:c.backgroundDerivations,S=f?c.brandColor:void 0;let h=l.get(i);h||(h=new Map,l.set(i,h));const y=St(i,S),v=p=>{const k=p===I?`${p}:${S}`:p;h.has(k)||h.set(k,at(p,y));const x=h.get(k);return x!=null&&V(x,t)};if(S&&v(I))return I;const A=(r??[]).filter(v);if(A.length===1)return A[0];const d=[...new Set([...nt,...r??[]])].filter(p=>!s?.includes(p)&&v(p));if(d.length===1)return d[0];const C=JSON.stringify(t);throw new Error(d.length===0?`Unmatched ${a} ${C}`:`Ambiguous ${a} ${C}: ${d.join(", ")}`)}function yt(t,i){return t.namespaceURI===dt||t.textContent?.trim()||i.clipPath==="none"&&i.maskImage==="none"?!1:K(T(t,i.backgroundColor))?.alpha!==0}async function Tt(t,i){if(!st(i?.role))throw new TypeError("observePaint requires a nonempty role without surrounding whitespace.");if(!t.isConnected||!t.ownerDocument.defaultView)throw new TypeError("observePaint requires an attached browser surface.");const{role:a}=i,c=[...rt[a]??[],...i.extraTargets??[]],{elements:l,text:f}=ht(t),s=pt(t.ownerDocument),r=(et(t)?t.host:t).getBoundingClientRect(),S=new Set(l),h=s.flatMap(e=>[...e.querySelectorAll('svg use[href]:not([href^="#"])')].filter(u=>{if(S.has(u))return!1;const n=u.getBoundingClientRect();return n.right>r.left&&n.left<r.right&&n.bottom>r.top&&n.top<r.bottom})),y=bt(await vt([...l,...h])),v=l.filter(W),A=ft(v,s),w=new Set,d=[],C=[];for(const e of f){const u=H(e);if(!u||!W(u))continue;const n=mt(e);if(!n.length)continue;const o=U(u),P=o.getPropertyValue("-webkit-text-fill-color")||o.color;d.push({candidate:{element:u,text:e,kind:"text",source:"text"},rawColor:P,coverage:1,points:n})}for(const e of v){const u=U(e),n=yt(e,u);n&&u.maskImage!=="none"?w.add(`Unsupported CSS shape mask at ${N(e)}`):n&&d.push({candidate:{element:e,kind:"graphic",source:"shape"},rawColor:u.backgroundColor,coverage:1,points:[...e.getClientRects()].flatMap(L)});for(const o of A.get(e)??[])d.push({candidate:{element:e,kind:o.kind,source:o.source,indicator:o.blur>0?"blurred-shadow":void 0},rawColor:o.color,coverage:1,blur:o.blur,points:o.points});try{for(const o of y.refusals(e))C.push({element:e,...o});for(const o of y.paints(e))d.push({candidate:{element:e,kind:"graphic",source:o.source},rawColor:o.color,coverage:o.opacity,primitiveOpacity:o.primitiveOpacity,points:o.points})}catch(o){C.push({element:e,message:o instanceof Error?o.message:String(o),points:[...e.getClientRects()].flatMap(L)})}}const p=d.map(e=>{try{return{sample:e,match:kt(e.candidate,c)}}catch(u){return{sample:e,error:u}}}),k=new WeakMap,x=wt(s,()=>{const e=[],u=gt(t.ownerDocument,y.layersAt);for(const{element:n,message:o,points:P}of C)try{P.some(m=>u(n,m,!0))&&w.add(`${N(n)}: ${o}`)}catch(m){w.add(`${N(n)}: ${m instanceof Error?m.message:String(m)}`)}for(const{sample:n,match:o,error:P}of p){const{candidate:m,rawColor:j,points:X}=n,{element:$,kind:F,source:O,indicator:Y}=m,G=N($,m.text);try{const b=[],B=o?.attribution.excludeBackdropEdge,z=B&&o.attribution.owner.getBoundingClientRect().bottom;for(const g of X){if(B&&z!==void 0&&g.y>=z-B.depth)continue;const E=u($,g,O!=="shape");E&&b.push(E)}if(!b.length)continue;const R=K(T($,j));if(!R)throw new Error(`Cannot resolve ${O} paint "${j}"`);if(!o)throw P;const{attribution:D,state:Z}=o,tt=Q(R,$,"foreground",D,k),ot=ut({alpha:R.alpha*(n.primitiveOpacity??n.coverage),blur:n.blur??0}),M=[];for(const g of b){const E=Q(g.sourceColor,g.sourceElement??$,"background",D,k),q=g.paintForeground({...R,alpha:ot});M.some(_=>_.background===E&&V(_.backgroundColor,g.color)&&V(_.foregroundColor,q))||M.push({role:a,element:D.element,state:Z,kind:F,source:O,indicator:Y,paintOpacity:n.coverage===1?void 0:n.coverage,foreground:tt,background:E,foregroundColor:q,backgroundColor:g.color,ratio:lt(q,g.color),required:ct(F),location:G})}e.push(...M)}catch(b){w.add(`${G}: ${b instanceof Error?b.message:String(b)}`)}}return e});if(w.size)throw new Error(`Paint observation failed for "${a}":
|
|
2
|
+
${[...w].join(`
|
|
3
|
+
`)}`);return x}export{Tt as observePaint};
|
package/espalier.css-data.json
CHANGED
|
@@ -113,29 +113,41 @@
|
|
|
113
113
|
"name": "--esp-blockquote-bar-color",
|
|
114
114
|
"description": "Color of the quote's inline-start border. Defaults to `var(--esp-color-border)`."
|
|
115
115
|
},
|
|
116
|
+
{
|
|
117
|
+
"name": "--esp-blockquote-bar-width",
|
|
118
|
+
"description": "Width of the quote's inline-start border, from `0` to `1em`. Defaults to `0.3em`."
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "--esp-blockquote-font-family",
|
|
122
|
+
"description": "The quote's font family: `body`, `heading` or `monospace`. Unset by default, so the quote keeps the surrounding text's family. Takes effect only through a theme's `componentProperties`, which maps the keyword; a raw CSS declaration alone does nothing."
|
|
123
|
+
},
|
|
116
124
|
{
|
|
117
125
|
"name": "--esp-blockquote-glyph-color",
|
|
118
126
|
"description": "Ink of the opening quote mark. Defaults to `var(--esp-blockquote-bar-color, var(--esp-color-border))`."
|
|
119
127
|
},
|
|
128
|
+
{
|
|
129
|
+
"name": "--esp-blockquote-shadow",
|
|
130
|
+
"description": "The quote's shadow: `none`, `1`, `2` or `3` as a theme elevation step. Defaults to `none`."
|
|
131
|
+
},
|
|
120
132
|
{
|
|
121
133
|
"name": "--esp-box-background",
|
|
122
134
|
"description": "Adds a layer in the background of the box. Intended for background images or gradients."
|
|
123
135
|
},
|
|
124
136
|
{
|
|
125
137
|
"name": "--esp-box-background-image",
|
|
126
|
-
"description": ""
|
|
138
|
+
"description": "The theme's box background image, painted when `--esp-box-background` is unset. Defaults to `none`."
|
|
127
139
|
},
|
|
128
140
|
{
|
|
129
141
|
"name": "--esp-box-background-image-opacity",
|
|
130
|
-
"description": ""
|
|
142
|
+
"description": "The theme's opacity for that image. Defaults to `1`."
|
|
131
143
|
},
|
|
132
144
|
{
|
|
133
145
|
"name": "--esp-box-background-opacity",
|
|
134
|
-
"description": "The opacity of the background layer."
|
|
146
|
+
"description": "The opacity of the background layer. Defaults to `--esp-box-background-image-opacity`, then `1`."
|
|
135
147
|
},
|
|
136
148
|
{
|
|
137
149
|
"name": "--esp-box-shadow",
|
|
138
|
-
"description": "The box's drop shadow
|
|
150
|
+
"description": "The box's drop shadow: `none`, `1`, `2` or `3` as a theme elevation step. Defaults to `1`."
|
|
139
151
|
},
|
|
140
152
|
{
|
|
141
153
|
"name": "--esp-breadcrumb-color",
|
|
@@ -165,6 +177,10 @@
|
|
|
165
177
|
"name": "--esp-breadcrumb-separator-stroke-width",
|
|
166
178
|
"description": "Built-in line mark weight, from 0.5 to 6 in SVG units. Defaults to `2`."
|
|
167
179
|
},
|
|
180
|
+
{
|
|
181
|
+
"name": "--esp-button-border-width",
|
|
182
|
+
"description": "The button's border width, from `0` to `0.5rem`. Defaults to `--esp-field-border-width`, then `1px`."
|
|
183
|
+
},
|
|
168
184
|
{
|
|
169
185
|
"name": "--esp-button-group-divider",
|
|
170
186
|
"description": "The border style between grouped buttons. Defaults to `1px dotted var(--esp-color-border)`."
|
|
@@ -177,6 +193,14 @@
|
|
|
177
193
|
"name": "--esp-button-padding",
|
|
178
194
|
"description": "The padding inside the button label and icon areas."
|
|
179
195
|
},
|
|
196
|
+
{
|
|
197
|
+
"name": "--esp-button-press-offset",
|
|
198
|
+
"description": "How far the button moves down and right while pressed, from `0` to `0.5rem`, with its shadow dropped. Reduced motion skips the move. Defaults to `0`."
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "--esp-button-shadow",
|
|
202
|
+
"description": "The button's resting shadow, drawn as a drop shadow. Set `none`, `1`, `2` or `3` in `componentProperties`, or raw CSS: `none` or `<x> <y> <blur> <color>` with no spread. Defaults to `none`."
|
|
203
|
+
},
|
|
180
204
|
{
|
|
181
205
|
"name": "--esp-card-min",
|
|
182
206
|
"description": ""
|
|
@@ -193,6 +217,18 @@
|
|
|
193
217
|
"name": "--esp-checkbox-size",
|
|
194
218
|
"description": "The width and height of the checkbox icon. Defaults to `var(--esp-size-normal-to-medium)`."
|
|
195
219
|
},
|
|
220
|
+
{
|
|
221
|
+
"name": "--esp-code-background",
|
|
222
|
+
"description": "Background of inline code. Defaults to `var(--esp-color-layer-1)`."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "--esp-code-border-color",
|
|
226
|
+
"description": "Border color of inline code and `pre` blocks. Defaults to `var(--esp-color-border)`."
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "--esp-code-border-style",
|
|
230
|
+
"description": "Border style of inline code and `pre` blocks: `dotted`, `dashed`, `solid` or `none`. Defaults to `dotted`."
|
|
231
|
+
},
|
|
196
232
|
{
|
|
197
233
|
"name": "--esp-color-action-background",
|
|
198
234
|
"description": ""
|
|
@@ -709,6 +745,14 @@
|
|
|
709
745
|
"name": "--esp-footer-border",
|
|
710
746
|
"description": "Block-start footer border. Defaults to `1px solid var(--esp-color-border)`."
|
|
711
747
|
},
|
|
748
|
+
{
|
|
749
|
+
"name": "--esp-footer-brand-hover-background",
|
|
750
|
+
"description": "Hovered configured-brand background. Defaults to `--esp-footer-link-hover-bg`, so other footer links are unaffected."
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"name": "--esp-footer-brand-hover-transform",
|
|
754
|
+
"description": "Hovered configured-brand transform, animated like the header brand and dropped under reduced motion. Defaults to `none`. A hook, not a settable property: Taproot drives it from its footer `brandHoverGrow` setting, like the header hook."
|
|
755
|
+
},
|
|
712
756
|
{
|
|
713
757
|
"name": "--esp-footer-brand-logo-aspect-ratio",
|
|
714
758
|
"description": "The ratio the configured logo's box is reserved at while the image is still loading or has failed, so alt text never decides the brand region's width. A logo that loads is always laid out at its own ratio, whatever this is set to. Defaults to `3 / 1`."
|
|
@@ -1145,18 +1189,38 @@
|
|
|
1145
1189
|
"name": "--esp-heading-1-color",
|
|
1146
1190
|
"description": "Color of native light-DOM h1 headings. Defaults to `var(--esp-color-headings)`."
|
|
1147
1191
|
},
|
|
1192
|
+
{
|
|
1193
|
+
"name": "--esp-heading-1-mark-color",
|
|
1194
|
+
"description": "Color of a text-decoration mark beneath native light-DOM h1 headings. Unset by default, which paints no mark. Takes effect only through a theme's `componentProperties`, which sets the enable toggle; a raw CSS declaration alone paints nothing."
|
|
1195
|
+
},
|
|
1148
1196
|
{
|
|
1149
1197
|
"name": "--esp-heading-2-color",
|
|
1150
1198
|
"description": "Color of native light-DOM h2 headings. Defaults to `var(--esp-color-headings)`."
|
|
1151
1199
|
},
|
|
1200
|
+
{
|
|
1201
|
+
"name": "--esp-heading-2-mark-color",
|
|
1202
|
+
"description": "Color of a text-decoration mark beneath native light-DOM h2 headings. Unset by default. Theme `componentProperties` only; a raw CSS declaration paints nothing."
|
|
1203
|
+
},
|
|
1152
1204
|
{
|
|
1153
1205
|
"name": "--esp-heading-3-color",
|
|
1154
1206
|
"description": "Color of native light-DOM h3 headings. Defaults to `var(--esp-color-headings)`."
|
|
1155
1207
|
},
|
|
1208
|
+
{
|
|
1209
|
+
"name": "--esp-heading-3-mark-color",
|
|
1210
|
+
"description": "Color of a text-decoration mark beneath native light-DOM h3 headings. Unset by default. Theme `componentProperties` only; a raw CSS declaration paints nothing."
|
|
1211
|
+
},
|
|
1156
1212
|
{
|
|
1157
1213
|
"name": "--esp-heading-4-color",
|
|
1158
1214
|
"description": "Color of native light-DOM h4 headings. Defaults to `var(--esp-color-headings)`."
|
|
1159
1215
|
},
|
|
1216
|
+
{
|
|
1217
|
+
"name": "--esp-heading-4-mark-color",
|
|
1218
|
+
"description": "Color of a text-decoration mark beneath native light-DOM h4 headings. Unset by default. Theme `componentProperties` only; a raw CSS declaration paints nothing."
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"name": "--esp-heading-mark-height",
|
|
1222
|
+
"description": "Thickness of the heading mark, from `0` (no visible mark) through thin underlines to `0.6em` (a highlighter). Defaults to `0.35em`."
|
|
1223
|
+
},
|
|
1160
1224
|
{
|
|
1161
1225
|
"name": "--esp-image-banner-block-size",
|
|
1162
1226
|
"description": "A soft height target for a banner: it replaces the ratio as the banner height (viewport-fill banners), and copy that would not fit grows the banner past it. In the compact band it sizes only the image box. Unlike `block-size`, it never clips copy. Defaults to none."
|
|
@@ -1365,6 +1429,10 @@
|
|
|
1365
1429
|
"name": "--esp-lightbox-bg-opacity",
|
|
1366
1430
|
"description": "The opacity of the overlay background (falls through to --esp-vellum-opacity, default: 0.85)."
|
|
1367
1431
|
},
|
|
1432
|
+
{
|
|
1433
|
+
"name": "--esp-list-marker-color",
|
|
1434
|
+
"description": "Color of list bullets and numbers. Defaults to the list item's text color."
|
|
1435
|
+
},
|
|
1368
1436
|
{
|
|
1369
1437
|
"name": "--esp-measure",
|
|
1370
1438
|
"description": ""
|
|
@@ -1549,6 +1617,10 @@
|
|
|
1549
1617
|
"name": "--esp-menu-top-offset",
|
|
1550
1618
|
"description": "Top offset for drawers below fixed headers."
|
|
1551
1619
|
},
|
|
1620
|
+
{
|
|
1621
|
+
"name": "--esp-ordered-list-marker-style",
|
|
1622
|
+
"description": "Numbering style of native light-DOM ordered lists: `decimal`, `decimal-leading-zero`, `lower-alpha`, `upper-alpha`, `lower-roman` or `upper-roman`. Defaults to `decimal`."
|
|
1623
|
+
},
|
|
1552
1624
|
{
|
|
1553
1625
|
"name": "--esp-page-background",
|
|
1554
1626
|
"description": "The background color of the page. Fills both the surface and the canvas gutters; the canvas tokens paint over it in the gutters only. Defaults to `var(--esp-color-background)`."
|
|
@@ -1833,6 +1905,10 @@
|
|
|
1833
1905
|
"name": "--esp-section-decoration-position",
|
|
1834
1906
|
"description": "Mask position, including responsive or bleeding values. Defaults to `center`."
|
|
1835
1907
|
},
|
|
1908
|
+
{
|
|
1909
|
+
"name": "--esp-section-decoration-repeat",
|
|
1910
|
+
"description": "Mask repeat: `no-repeat`, `repeat`, `repeat-x` or `repeat-y`. Defaults to `no-repeat`; the others tile a pattern mask across the band."
|
|
1911
|
+
},
|
|
1836
1912
|
{
|
|
1837
1913
|
"name": "--esp-section-decoration-size",
|
|
1838
1914
|
"description": "Mask size. Defaults to `contain`."
|
|
@@ -1857,14 +1933,26 @@
|
|
|
1857
1933
|
"name": "--esp-shadow-1",
|
|
1858
1934
|
"description": ""
|
|
1859
1935
|
},
|
|
1936
|
+
{
|
|
1937
|
+
"name": "--esp-shadow-1-geometry",
|
|
1938
|
+
"description": "Offsets and optional blur of the first elevation step, as `<inline> <block> [<blur>]` in `px`, `rem` or `em`. Defaults to `1px 1px 4px`."
|
|
1939
|
+
},
|
|
1860
1940
|
{
|
|
1861
1941
|
"name": "--esp-shadow-2",
|
|
1862
1942
|
"description": ""
|
|
1863
1943
|
},
|
|
1944
|
+
{
|
|
1945
|
+
"name": "--esp-shadow-2-geometry",
|
|
1946
|
+
"description": "Offsets and optional blur of the second elevation step. Defaults to `0 2px 8px`."
|
|
1947
|
+
},
|
|
1864
1948
|
{
|
|
1865
1949
|
"name": "--esp-shadow-3",
|
|
1866
1950
|
"description": ""
|
|
1867
1951
|
},
|
|
1952
|
+
{
|
|
1953
|
+
"name": "--esp-shadow-3-geometry",
|
|
1954
|
+
"description": "Offsets and optional blur of the third elevation step. Defaults to `0 6px 20px`."
|
|
1955
|
+
},
|
|
1868
1956
|
{
|
|
1869
1957
|
"name": "--esp-size-big",
|
|
1870
1958
|
"description": ""
|