monowind 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn.js +5 -6
- package/dist/cdn.js.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/styles.css +12 -4
package/dist/cdn.js
CHANGED
|
@@ -957,7 +957,7 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
957
957
|
`));let t=[];for(let n of r[e]){if(Zn(n)){let e=document.createTextNode(n.text);t.push(e),o.appendChild(e);continue}let e=document.createElement(`span`);Xn(n,e.style),e.textContent=n.text,t.push(e),o.appendChild(e)}s.push(t)}rr.set(t,{nodes:s,segments:r});let c=sr(t,!1);return t.replaceChildren(o),c&&cr(t,c),!0}function or(e,t,n){if(t.length!==n.length)return!1;for(let r=0;r<n.length;r++){let i=t[r],a=n[r];if(i.length!==a.length)return!1;for(let t=0;t<a.length;t++){let n=i[t];if(Zn(a[t])!==(n.nodeType===Node.TEXT_NODE)||n.textContent!==a[t].text||n.parentNode!==e)return!1}}return!0}function sr(e,t){try{let n=e.ownerDocument.getSelection();if(!n)return null;let r=e.getRootNode();if(!(r instanceof ShadowRoot))return null;let i;if(n.getComposedRanges){let e=n.getComposedRanges({shadowRoots:[r]});if(e.length===0)return null;i=e[0]}else{let e=r.getSelection?.();if(!e||e.rangeCount===0)return null;i=e.getRangeAt(0)}let a=lr(e,i.startContainer,i.startOffset),o=lr(e,i.endContainer,i.endOffset);return a===null||o===null||a===o&&!t?null:{start:a,end:o,backward:n.direction===`backward`}}catch{return null}}function cr(e,t){try{let n=ur(e,t.start),r=ur(e,t.end);if(!n||!r)return;let i=e.getRootNode().getSelection?.()??e.ownerDocument.getSelection();t.backward?i?.setBaseAndExtent(r[0],r[1],n[0],n[1]):i?.setBaseAndExtent(n[0],n[1],r[0],r[1])}catch{}}function lr(e,t,n){if(!e.contains(t))return null;let r=e.ownerDocument.createRange();return r.selectNodeContents(e),r.setEnd(t,n),r.toString().length}function ur(e,t){let n=t,r=null;for(let t of dr(e)){if(n<=t.data.length)return[t,n];n-=t.data.length,r=[t,t.data.length]}return r}function*dr(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=t.nextNode();for(;n;)yield n,n=t.nextNode()}function fr(e){let t=[];for(let n of e){for(let e of n)t.push(e.text,e.color??``,e.backgroundColor??``,e.fontWeight??``,e.fontStyle??``,e.textDecorationLine??``,e.opacity??``);t.push(`
|
|
958
958
|
`)}return t.join(``)}function pr(e){let t=new Set;gr(e,!0,t);for(let n of Array.from(e.source.querySelectorAll(`[data-mw-inline-inset]`)))if(!t.has(n)){n.removeAttribute(`data-mw-inline-inset`);let e=n.style;for(let t of[`--mw-it`,`--mw-ir`,`--mw-ib`,`--mw-il`])e.removeProperty(t)}}function Q(e,t,n){e.style.getPropertyValue(t)!==n&&e.style.setProperty(t,n)}function mr(e,t){e.style.getPropertyValue(t)!==``&&e.style.removeProperty(t)}function hr(e,t,n){e.hasAttribute(t)!==n&&(n?e.setAttribute(t,``):e.removeAttribute(t))}function gr(e,t,n){if(e.inlineElements)for(let{element:t,tracking:r,padLeft:i,padRight:a,insets:o}of e.inlineElements){let e=t;Q(e,`--mw-ls`,String(r)),i>0?Q(e,`--mw-ipl`,String(i)):mr(e,`--mw-ipl`),a>0?Q(e,`--mw-ipr`,String(a)):mr(e,`--mw-ipr`),o&&(n.add(t),_r(e,o))}if(t||yr(e),!e.tableHidden)for(let t of pe(e)){let r=t.source;t.style.zIndex!==null&&fe(t,e)&&!t.inlineBox?Q(r,`--mw-z`,String(t.style.zIndex)):mr(r,`--mw-z`),gr(t,!1,n)}}function _r(e,t){hr(e,`data-mw-inline-inset`,!0);let n=(t,n)=>{n===null?mr(e,t):Q(e,t,String(n))};n(`--mw-it`,t.top),n(`--mw-ir`,t.right),n(`--mw-ib`,t.bottom),n(`--mw-il`,t.left)}function vr(e){let t=e.style;if(t.textAlign!==`center`||!e.text||e.inlineBox||e.children.length>0)return!1;let n=e.multicolGeometry,r=e.resolvedPadding,i=e.localRect.width-t.border.left-t.border.right-r.left-r.right,a=n?Math.max(1,n.columnWidth-t.tracking):i,o=n?.spans??On(e,i);return o.length!==0&&o.every((n,r)=>{let i=r===0?t.textIndent:0,o=a-i-B(n.start,n.end,e.advances,t.tracking);return o>0&&o%2==1})}function yr(e){let t=e.source,n=e.localRect,r=e.resolvedPadding,{border:i,textAlignBlocked:a,overflow:o,whiteSpace:s,tracking:c,lineGap:l}=e.style,u=e.multicolFlow,d=e.multicolFlowSpan;hr(t,`data-mw-laid-out`,!e.inlineBox&&!u&&!d),hr(t,`data-mw-inline-box`,!!e.inlineBox),hr(t,`data-mw-multicol-flow`,!!u),hr(t,`data-mw-multicol-flow-span`,!!d);let f=u??d;f?(Q(t,`--mw-mt`,String(f.top??0)),Q(t,`--mw-mr`,String(f.right??0)),Q(t,`--mw-mb`,String(f.bottom??0)),Q(t,`--mw-ml`,String(f.left??0))):(mr(t,`--mw-mt`),mr(t,`--mw-mr`),mr(t,`--mw-mb`),mr(t,`--mw-ml`)),hr(t,`data-mw-vbottom`,!!e.inlineBox&&e.style.verticalAlign===`end`),Q(t,`--mw-ls`,String(c)),Q(t,`--mw-lh`,String(l+1)),Q(t,`--mw-lhs`,String(-l/2)),hr(t,`data-mw-nowrap`,s!==`normal`);let p=u||d?void 0:e.multicolGeometry;hr(t,`data-mw-multicol`,!!p),hr(t,`data-mw-multicol-balance`,!!p?.nativeBalance),p?(Q(t,`--mw-colc`,String(p.columnCount)),Q(t,`--mw-colg`,String(p.gap))):(mr(t,`--mw-colc`),mr(t,`--mw-colg`)),hr(t,`data-mw-pre`,s===`pre`),Q(t,`--mw-x`,String(n.x)),Q(t,`--mw-y`,String(n.y)),Q(t,`--mw-w`,String(n.width)),Q(t,`--mw-h`,String(n.height)),hr(t,`data-mw-clip`,o===`clip`),Q(t,`--mw-pt`,String(r.top)),Q(t,`--mw-pr`,String(r.right)),Q(t,`--mw-pb`,String(r.bottom)),Q(t,`--mw-pl`,String(r.left)),Q(t,`--mw-bt`,String(i.top)),Q(t,`--mw-br`,String(i.right)),Q(t,`--mw-bb`,String(i.bottom)),Q(t,`--mw-bl`,String(i.left)),Q(t,`--mw-ti`,String(e.style.textIndent)),hr(t,`data-mw-text-align-blocked`,a),hr(t,`data-mw-center-nudge`,vr(e)),hr(t,`data-mw-dropped-text`,!!e.droppedText),hr(t,`data-mw-table-hidden`,!!e.tableHidden)}function br(e,t,n){let r=getComputedStyle(e),i=parseFloat(r.fontSize)||t,a=Pr(e)?e.computedStyleMap():null,o=e.getAttribute(`class`)??``,s=e.style;kr(e,o,s);let c=r.display||Er[e.tagName]||``,l=Dr[c]??`none`,u=r.columnCount&&r.columnCount!==`auto`?Math.max(1,Math.floor(Number(r.columnCount)||1)):null,d=r.columnWidth&&r.columnWidth!==`auto`?parseFloat(r.columnWidth):NaN,f=Number.isFinite(d)?Math.max(1,xe(d,t)):null,p=c===`flex`||c===`inline-flex`?`flex`:c===`grid`||c===`inline-grid`?`grid`:c===`table`||c===`inline-table`?`table`:c===`none`||Tr(r)?`none`:u!==null||f!==null?`multicol`:`block`,m={kind:`none`},h={kind:`none`},g=[Ze()],_=[Ze()],v={direction:`row`,dense:!1},y=null;if(p===`grid`){if(a)m=ti(a.get(`grid-template-columns`)?.toString()??``,t),h=ti(a.get(`grid-template-rows`)?.toString()??``,t);else{e.setAttribute(`data-mw-degrid`,``);try{m=ti(r.getPropertyValue(`grid-template-columns`),t),h=ti(r.getPropertyValue(`grid-template-rows`),t)}finally{e.removeAttribute(`data-mw-degrid`)}}g=ai(r.getPropertyValue(`grid-auto-columns`),t),_=ai(r.getPropertyValue(`grid-auto-rows`),t),v=di(r.getPropertyValue(`grid-auto-flow`)),y=ii(r.getPropertyValue(`grid-template-areas`))}let b=`auto`,x=!1,S=0,C=0;if(p===`table`&&(b=r.tableLayout===`fixed`?`fixed`:`auto`,x=r.borderCollapse===`collapse`,!x)){let e=r.borderSpacing.split(` `);S=xe(parseFloat(e[0]??``)||0,t),C=xe(parseFloat(e[1]??e[0]??``)||0,t)}let w={display:p,tableRole:l,tableLayout:b,borderCollapse:x,borderSpacingX:S,borderSpacingY:C,captionSide:r.captionSide===`bottom`?`bottom`:`top`,verticalAlign:l===`cell`||c.startsWith(`inline-`)?Or(e,r):`start`,flexDirection:r.flexDirection.startsWith(`column`)?`column`:`row`,flexReverse:r.flexDirection.endsWith(`-reverse`),flexWrap:r.flexWrap.startsWith(`wrap`)?`wrap`:`nowrap`,wrapReverse:r.flexWrap===`wrap-reverse`,flexGrow:Number(r.flexGrow)||0,flexShrink:r.flexShrink===``?1:Number(r.flexShrink)||0,flexBasis:$r(r.flexBasis,t),order:Number(r.order)||0,justifyContent:Fr(r.justifyContent),alignContent:Fr(r.alignContent),alignItems:Ir(r.alignItems),alignSelf:Lr(r.alignSelf),justifyItems:Ir(r.justifyItems),justifySelf:Lr(r.justifySelf),gridTemplateColumns:m,gridTemplateRows:h,gridAutoColumns:g,gridAutoRows:_,gridAutoFlow:v,gridTemplateAreas:y,gridColumnStart:ui(r.getPropertyValue(`grid-column-start`)),gridColumnEnd:ui(r.getPropertyValue(`grid-column-end`)),gridRowStart:ui(r.getPropertyValue(`grid-row-start`)),gridRowEnd:ui(r.getPropertyValue(`grid-row-end`)),width:Jr(a,r.width,`width`,t,o,s,n),height:Jr(a,r.height,`height`,t,o,s,n),minWidth:Qr(a,`min-width`,r.minWidth,o,`min-w`,s,n,t)??Wr(r.minWidth,t)??`auto`,minHeight:Qr(a,`min-height`,r.minHeight,o,`min-h`,s,n,t)??Wr(r.minHeight,t)??`auto`,maxWidth:Qr(a,`max-width`,r.maxWidth,o,`max-w`,s,n,t)??Wr(r.maxWidth,t),maxHeight:Qr(a,`max-height`,r.maxHeight,o,`max-h`,s,n,t)??Wr(r.maxHeight,t),padding:pi(r,t),margin:Rr(r,a,o,s,t),position:Vr(r.position),insets:Hr(r,a,o,s,t),gapX:Gr(r.columnGap===`normal`||r.columnGap===``?p===`multicol`?`${i}px`:`0px`:r.columnGap,t),gapY:Gr(r.rowGap===`normal`?`0px`:r.rowGap,t),border:mi(r),borderStyle:{top:Ur(r.borderTopStyle),right:Ur(r.borderRightStyle),bottom:Ur(r.borderBottomStyle),left:Ur(r.borderLeftStyle)},overflow:wr(r.overflow)||wr(r.overflowX)||wr(r.overflowY)?`clip`:`visible`,whiteSpace:r.whiteSpace===`pre`?`pre`:r.whiteSpace===`nowrap`?`nowrap`:`normal`,tabSize:Math.max(1,Math.floor(parseFloat(r.tabSize))||8),lineGap:Br(r.lineHeight,i),tracking:zr(r.letterSpacing,i,n?.letterSpacing??0),textOverflow:r.textOverflow===`ellipsis`?`ellipsis`:`clip`,color:r.color,fontWeight:r.fontWeight,fontStyle:r.fontStyle,textDecorationLine:r.textDecorationLine,backgroundColor:Cr(e,r.backgroundColor,r),backgroundClear:r.getPropertyValue(`--mw-bg-clear`).trim()===`1`,borderColor:{top:r.borderTopColor,right:r.borderRightColor,bottom:r.borderBottomColor,left:r.borderLeftColor},textAlignBlocked:Mr(e,r),textAlign:Nr(e,r),textIndent:qr(r,t),opacity:Kr(r.opacity),glyphSet:r.getPropertyValue(`--mw-border-glyphs`).trim()||null,zIndex:r.zIndex===`auto`||r.zIndex===``?null:Number(r.zIndex)||0,latticeBorder:null,ruleX:p===`flex`||p===`grid`||p===`multicol`?jr(r,`x`):null,ruleY:p===`flex`||p===`grid`?jr(r,`y`):null,ruleBreak:Ar(r,`--mw-rule-break`,[`none`,`intersection`],`normal`),ruleInset:r.getPropertyValue(`--mw-rule-inset`).trim()===`overlap-join`?`overlap-join`:Math.max(0,be(parseFloat(r.getPropertyValue(`--mw-rule-inset`))||0)),ruleVisibilityItems:Ar(r,`--mw-rule-visibility-items`,[`all`,`around`,`between`],`normal`),columnCount:u,columnWidth:f,columnFill:r.columnFill===`auto`?`auto`:`balance`,columnSpan:r.columnSpan===`all`,breakBeforeColumn:r.breakBefore===`column`,breakAfterColumn:r.breakAfter===`column`,breakInsideAvoid:r.breakInside===`avoid`||r.breakInside===`avoid-column`};return xr(w,r),w}function xr(e,t){t.borderCollapse===`collapse`&&(e.display===`table`||e.tableRole===`cell`||e.tableRole===`row`||e.tableRole===`row-group`||e.tableRole===`header-group`||e.tableRole===`footer-group`)&&(e.latticeBorder={width:e.border,style:e.borderStyle,color:e.borderColor,hidden:{top:t.borderTopStyle===`hidden`,right:t.borderRightStyle===`hidden`,bottom:t.borderBottomStyle===`hidden`,left:t.borderLeftStyle===`hidden`}},e.border=Xe(),e.display===`table`&&(e.padding=Xe()))}function Sr(e){if(!e)return!0;let t=e.trim().toLowerCase();return t===``||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`currentcolor`}function Cr(e,t,n){let r=m(e,Sr(t)?``:t,n);return r===``?void 0:r}function wr(e){return e===`hidden`||e===`clip`}function Tr(e){if(e.position!==`absolute`&&e.position!==`fixed`)return!1;let t=e.clip.replace(/\s/g,``);return t===`rect(0px,0px,0px,0px)`||t===`rect(0,0,0,0)`||(wr(e.overflow)||wr(e.overflowX))&&parseFloat(e.width)<=1&&parseFloat(e.height)<=1}var Er={TABLE:`table`,THEAD:`table-header-group`,TBODY:`table-row-group`,TFOOT:`table-footer-group`,TR:`table-row`,TD:`table-cell`,TH:`table-cell`,CAPTION:`table-caption`,COL:`table-column`,COLGROUP:`table-column-group`},Dr={"table-header-group":`header-group`,"table-row-group":`row-group`,"table-footer-group":`footer-group`,"table-row":`row`,"table-cell":`cell`,"table-caption":`caption`,"table-column":`column`,"table-column-group":`column-group`};function Or(e,t){let n=t.verticalAlign||e.getAttribute(`valign`)?.toLowerCase()||(e.tagName===`TD`||e.tagName===`TH`?`middle`:`baseline`);return n===`top`?`start`:n===`middle`?`center`:n===`bottom`?`end`:`start`}function kr(e,n,r){(/(?:^|[\s:.[!])text-(?:xs|sm|base|lg|[2-9]?xl)(?![\w-])/.test(n)||/(?:^|[\s:.[!])text-\[(?:(?:length|size):|[\d.])/.test(n)||r.fontSize!==``)&&t(e,`font-size inside <mono-wind> is ignored — all text shares the host's cell size. Size the <mono-wind> element itself instead.`)}function Ar(e,t,n,r){let i=e.getPropertyValue(t).trim();return n.includes(i)?i:r}function jr(e,t){let n=be(parseFloat(e.getPropertyValue(`--mw-rule-${t}-width`))||0);if(n<=0)return null;let r=e.getPropertyValue(`--mw-rule-${t}-color`).trim();return{width:n,style:Ur(e.getPropertyValue(`--mw-rule-${t}-style`).trim()),color:r&&r!==`currentcolor`&&r!==`currentColor`?r:e.color}}function Mr(e,t){return t.textAlign===`justify`||e.getAttribute(`align`)?.toLowerCase()===`justify`}function Nr(e,t){let n=t.textAlign||e.getAttribute(`align`)?.toLowerCase()||``;return n===`right`||n===`end`?`end`:n===`center`||n.endsWith(`-center`)?`center`:`start`}function Pr(e){return typeof e.computedStyleMap==`function`}function Fr(e){switch(e){case`center`:return`center`;case`flex-end`:case`end`:case`right`:return`end`;case`space-between`:return`space-between`;case`space-around`:return`space-around`;case`space-evenly`:return`space-evenly`;case`normal`:case`stretch`:case``:return`stretch`;default:return`start`}}function Ir(e){switch(e){case`center`:return`center`;case`flex-end`:case`end`:return`end`;case`stretch`:case`normal`:case``:return`stretch`;default:return`start`}}function Lr(e){return e===`auto`||e===``||e===`normal`?`auto`:Ir(e)}function Rr(e,t,n,r,i){let a=(a,o,s)=>{if(t){let e=t.get(a)?.toString().trim();if(e===`auto`||t.get(o)?.toString().trim()===`auto`)return null;if(e?.endsWith(`%`)){let t=parseFloat(e);if(Number.isFinite(t)&&t!==0)return{percent:t}}}else if(s.test(n)||r.getPropertyValue(a)===`auto`)return null;let c=e.getPropertyValue(a);if(c===`auto`)return null;let l=Gr(c,i);if(l!==0)return l;let u=e.getPropertyValue(o);return u===`auto`?null:Gr(u,i)};return{top:a(`margin-top`,`margin-block-start`,/(?:^|[\s:.[!])(?:m|my|mt)-auto\b/),right:a(`margin-right`,`margin-inline-end`,/(?:^|[\s:.[!])(?:m|mx|mr|me)-auto\b/),bottom:a(`margin-bottom`,`margin-block-end`,/(?:^|[\s:.[!])(?:m|my|mb)-auto\b/),left:a(`margin-left`,`margin-inline-start`,/(?:^|[\s:.[!])(?:m|mx|ml|ms)-auto\b/)}}function zr(e,t,n){let r=(e===`normal`?0:parseFloat(e)||0)-n;return r<=0?0:Math.floor(r/(.025*t)+1e-6)}function Br(e,t){if(!e||e===`normal`||t<=0)return 0;let n=parseFloat(e);return Number.isFinite(n)?Math.max(0,Math.floor(n/t+1e-6)-1):0}function Vr(e){switch(e){case`relative`:case`absolute`:case`fixed`:case`sticky`:return e;default:return`static`}}function Hr(e,t,n,r,i){let a=(a,o)=>{if(t){let e=t.get(a)?.toString().trim();return!e||e===`auto`?null:Gr(e,i)}let s=r[a];if(s)return s===`auto`?null:Gr(s,i);if(!o.test(n))return null;let c=e.getPropertyValue(a);return!c||c===`auto`?null:Gr(c,i)};return{top:a(`top`,/(?:^|[\s:.[!])-?(?:top|inset|inset-y)-/),right:a(`right`,/(?:^|[\s:.[!])-?(?:right|end|inset|inset-x)-/),bottom:a(`bottom`,/(?:^|[\s:.[!])-?(?:bottom|inset|inset-y)-/),left:a(`left`,/(?:^|[\s:.[!])-?(?:left|start|inset|inset-x)-/)}}function Ur(e){switch(e){case`double`:return`double`;case`dashed`:return`dashed`;case`dotted`:return`dotted`;default:return`solid`}}function Wr(e,t){if(!e||e===`none`||e===`auto`)return;if(e===`min-content`||e===`max-content`||e===`fit-content`)return e;if(e.endsWith(`%`)){let t=parseFloat(e);return Number.isFinite(t)?{percent:t}:void 0}let n=parseFloat(e);return Number.isFinite(n)?xe(n,t):void 0}function Gr(e,t){if(!e||e===`auto`||e===`none`)return 0;if(e.endsWith(`%`)){let t=parseFloat(e);return Number.isFinite(t)&&t!==0?{percent:t}:0}let n=parseFloat(e);return Number.isFinite(n)?xe(n,t):0}function Kr(e){let t=parseFloat(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):1}function qr(e,t){let n=e.textIndent;if(!n||n.endsWith(`%`))return 0;let r=parseFloat(n);return Number.isFinite(r)?Math.max(0,xe(r,t)):0}function Jr(e,t,n,r,i,a,o){let s=Yr(n===`width`?a.width:a.height);if(s!==null)return{kind:`cells`,value:Zr(s,n,o,r)};let c=Xr(i,n===`width`?`w`:`h`);if(c!==null){let i=parseFloat(e?String(e.get(n)??``):t),a=Number.isFinite(i)&&Math.abs(i-c)<=c*.3;if(a||!Number.isFinite(i))return{kind:`cells`,value:Zr(a?i:c,n,o,r)}}if(e){let t=e.get(n);if(t==null)return;let i=t.toString().trim();if(i===`auto`)return{kind:`auto`};let a=ei(i);if(a)return a;if(i.endsWith(`%`))return{kind:`percent`,value:parseFloat(i)};if(i.endsWith(`px`))return{kind:`cells`,value:xe(parseFloat(i),r)};if(i.endsWith(`rem`))return{kind:`cells`,value:be(parseFloat(i)/.25)};let s=Yr(i);if(s!==null)return{kind:`cells`,value:Zr(s,n,o,r)}}let l=n===`width`?a.width:a.height;if(l){if(l===`auto`)return{kind:`auto`};let e=ei(l);if(e)return e;if(l.endsWith(`%`))return{kind:`percent`,value:parseFloat(l)};let t=parseFloat(l);if(Number.isFinite(t))return{kind:`cells`,value:xe(t,r)}}let u=n===`width`?`w`:`h`;if(RegExp(`(?:^|[\\s:.[!])${u}-min\\b`).test(i))return{kind:`min-content`};if(RegExp(`(?:^|[\\s:.[!])${u}-max\\b`).test(i))return{kind:`max-content`};if(RegExp(`(?:^|[\\s:.[!])${u}-fit\\b`).test(i))return{kind:`fit-content`};let d=RegExp(`(?:^|[\\s:.[!])${u}-(\\d+)/(\\d+)(?![\\w./])`).exec(i);if(d)return{kind:`percent`,value:100*Number(d[1])/Number(d[2])};if(RegExp(`(?:^|[\\s:.[!])${u}-full(?![\\w-])`).test(i))return{kind:`percent`,value:100};let f=RegExp(`(?:^|[\\s:.[!])${u}-\\[(\\d+(?:\\.\\d+)?)%\\]`).exec(i);if(f)return{kind:`percent`,value:Number(f[1])};let p=RegExp(`(?:^|[\\s:.[!])${u}-(\\d+(?:\\.\\d+)?)(?![\\w-/])`).exec(i);if(p)return{kind:`cells`,value:be(Number(p[1]))};if(!fi(i,u)||t===`auto`)return{kind:`auto`};if(t.endsWith(`%`))return{kind:`percent`,value:parseFloat(t)};let m=parseFloat(t);if(Number.isFinite(m))return{kind:`cells`,value:xe(m,r)}}function Yr(e){let t=/^(-?[\d.]+)((?:[dsl]?v)(?:h|w|min|max)|vi|vb)$/.exec(e.trim());if(!t||typeof window>`u`)return null;let n=parseFloat(t[1]);if(!Number.isFinite(n))return null;let r=t[2],i=window.innerHeight,a=window.innerWidth,o=r.endsWith(`h`)?i:r.endsWith(`min`)?Math.min(a,i):r.endsWith(`max`)?Math.max(a,i):r===`vb`?i:a;return n/100*o}function Xr(e,t){if(typeof window>`u`)return null;let n=RegExp(`(?:^|[\\s:.[!])${t}-(screen|[dsl]v[hw])(?![\\w-])`).exec(e);if(n){let e=n[1];return e===`screen`?t.includes(`h`)?window.innerHeight:window.innerWidth:e.endsWith(`h`)?window.innerHeight:window.innerWidth}let r=RegExp(`(?:^|[\\s:.[!])${t}-\\[(-?[\\d.]+(?:[dsl]?v(?:h|w|min|max)|vi|vb))\\]`).exec(e);return r?Yr(r[1]):null}function Zr(e,t,n,r){let i=t===`width`?n?.width:n?.height;return i&&i>0?Math.max(0,Math.floor(e/i)):xe(e,r)}function Qr(e,t,n,r,i,a,o,s){let c=t.endsWith(`width`)?`width`:`height`,l=Yr(a.getPropertyValue(t))??Yr(e?.get(t)?.toString().trim()??``);if(l!==null)return Zr(l,c,o,s);let u=Xr(r,i);if(u===null)return;let d=parseFloat(e?String(e.get(t)??``):n),f=Number.isFinite(d)&&Math.abs(d-u)<=u*.3;if(!(!f&&Number.isFinite(d)))return Zr(f?d:u,c,o,s)}function $r(e,t){if(!e||e===`auto`||e===`content`)return;let n=ei(e);if(n)return n;if(e.endsWith(`%`)){let t=parseFloat(e);return Number.isFinite(t)?{kind:`percent`,value:t}:void 0}let r=parseFloat(e);return Number.isFinite(r)?{kind:`cells`,value:xe(r,t)}:void 0}function ei(e){if(e===`min-content`)return{kind:`min-content`};if(e===`max-content`)return{kind:`max-content`};if(e===`fit-content`)return{kind:`fit-content`}}function ti(e,t){let n=e.trim();if(!n||n===`none`)return{kind:`none`};if(n===`subgrid`||n.startsWith(`subgrid `))return{kind:`subgrid`};let r=[],i=[],a=[],o=e=>{i.push(a),a=[],r.push(e)},s;for(let e of li(n)){let n=ri(e);if(n){a.push(...n);continue}let i=e.match(/^repeat\(\s*([^,]+?)\s*,(.*)\)$/s);if(i){let e=ni(i[2].trim(),t);if(e.tracks.length===0)continue;let n=i[1];if(n===`auto-fill`||n===`auto-fit`){s||(s={index:r.length,tracks:e.tracks,mode:n},e.lineNames.some(e=>e.length>0)&&(s.lineNames=e.lineNames),a.length>0&&(s.leadingNames=a),a=[]);continue}let c=Math.max(0,Math.floor(Number(n)||0));for(let t=0;t<c;t++){a.push(...e.lineNames[0]);for(let t=0;t<e.tracks.length;t++)o(e.tracks[t]),a.push(...e.lineNames[t+1])}continue}o(oi(e,t))}if(i.push(a),r.length===0&&!s)return{kind:`none`};let c={kind:`tracks`,tracks:r};return i.some(e=>e.length>0)&&(c.lineNames=i),s&&(c.autoRepeat=s),c}function ni(e,t){let n=[],r=[],i=[];for(let a of li(e)){let e=ri(a);if(e){i.push(...e);continue}r.push(i),i=[],n.push(oi(a,t))}return r.push(i),{tracks:n,lineNames:r}}function ri(e){let t=e.match(/^\[(.*)\]$/s);return t?t[1].split(/\s+/).filter(e=>e!==``):null}function ii(e){let t=[];for(let n of e.matchAll(/"([^"]*)"|'([^']*)'/g)){let e=(n[1]??n[2]??``).trim().split(/\s+/).filter(e=>e!==``);if(e.length===0)return null;t.push(e)}if(t.length===0)return null;let n=t[0].length;if(t.some(e=>e.length!==n))return null;let r=new Map;t.forEach((e,t)=>{e.forEach((e,n)=>{if(/^\.+$/.test(e))return;let i=r.get(e);i?(i.colStart=Math.min(i.colStart,n),i.colEnd=Math.max(i.colEnd,n+1),i.rowStart=Math.min(i.rowStart,t),i.rowEnd=Math.max(i.rowEnd,t+1)):r.set(e,{colStart:n,colEnd:n+1,rowStart:t,rowEnd:t+1})})});for(let[e,n]of r)for(let r=n.rowStart;r<n.rowEnd;r++)for(let i=n.colStart;i<n.colEnd;i++)if(t[r][i]!==e)return null;return{columns:n,rows:t.length,areas:r}}function ai(e,t){let n=li(e.trim()).filter(e=>e!==``&&!e.startsWith(`[`)).map(e=>oi(e,t));return n.length>0?n:[Ze()]}function oi(e,t){let n=e.match(/^minmax\((.*)\)$/s);if(n){let e=ci(n[1]).map(e=>e.trim());return e.length===2?{min:si(e[0],t),max:si(e[1],t)}:{min:{kind:`auto`},max:{kind:`auto`}}}let r=si(e,t);return r.kind===`fr`?{min:{kind:`auto`},max:r}:{min:r,max:r}}function si(e,t){if(e===`auto`||e.startsWith(`fit-content`))return{kind:`auto`};if(e===`min-content`)return{kind:`min-content`};if(e===`max-content`)return{kind:`max-content`};let n=e.match(/^(min|max)\((.*)\)$/s);if(n){let e=ci(n[2]).map(e=>si(e.trim(),t)),r=e.every(e=>e.kind===`cells`||e.kind===`percent`||e.kind===`math`);return e.length>0&&r?{kind:`math`,fn:n[1],args:e}:{kind:`auto`}}if(e.endsWith(`fr`)){let t=parseFloat(e);return Number.isFinite(t)&&t>=0?{kind:`fr`,value:t}:{kind:`auto`}}if(e.endsWith(`%`)){let t=parseFloat(e);return Number.isFinite(t)?{kind:`percent`,value:t}:{kind:`auto`}}let r=parseFloat(e);return Number.isFinite(r)?{kind:`cells`,value:e.endsWith(`rem`)?be(r/.25):xe(r,t)}:{kind:`auto`}}function ci(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t.filter(e=>e.trim()!==``)}function li(e){let t=[],n=0,r=-1;for(let i=0;i<e.length;i++){let a=e[i];a===`(`||a===`[`?n++:(a===`)`||a===`]`)&&n--,/\s/.test(a)&&n===0?(r!==-1&&t.push(e.slice(r,i)),r=-1):r===-1&&(r=i)}return r!==-1&&t.push(e.slice(r)),t}function ui(e){let t=e.trim();if(!t||t===`auto`)return{kind:`auto`};let n=!1,r,i;for(let e of t.split(/\s+/))e===`span`?n=!0:/^-?\d+$/.test(e)?r=Number(e):i=e;if(n){let e=r??1;return e<1?{kind:`auto`}:i===void 0?{kind:`span`,value:e}:{kind:`span`,value:e,name:i}}return i===void 0?r!==void 0&&r!==0?{kind:`line`,value:r}:{kind:`auto`}:r===0?{kind:`auto`}:r===void 0?{kind:`name`,name:i}:{kind:`name`,name:i,nth:r}}function di(e){return{direction:e.includes(`column`)?`column`:`row`,dense:e.includes(`dense`)}}function fi(e,t){return(t===`w`?/(?:^|[\s:.[!])w-/:/(?:^|[\s:.[!])h-/).test(e)}function pi(e,t){return{top:Gr(e.getPropertyValue(`padding-top`),t),right:Gr(e.getPropertyValue(`padding-right`),t),bottom:Gr(e.getPropertyValue(`padding-bottom`),t),left:Gr(e.getPropertyValue(`padding-left`),t)}}function mi(e){let t=(t,n)=>e.getPropertyValue(n)===`none`?0:be(parseFloat(e.getPropertyValue(t))||0);return{top:t(`border-top-width`,`border-top-style`),right:t(`border-right-width`,`border-right-style`),bottom:t(`border-bottom-width`,`border-bottom-style`),left:t(`border-left-width`,`border-left-style`)}}function hi(e,t,n,r){let i=br(e,t,n);if(i.display===`none`)return null;let a=o(e.tagName);if(a)return gi(e,i,a);let s=Array.from(e.children),c=s.map(bi),l=e.tagName,u=ji(l);if(!c.includes(`block`)||u){let a=xi(e,i.tracking,{rootFontSizePx:t,rootLetterSpacingPx:n?.letterSpacing??0,cellMetrics:n,textareaWidths:r,preserve:i.whiteSpace===`pre`,tabSize:i.tabSize}),o=a.chars.join(``);if(a.boxes.length>0){let e=Sn();De(a.chars,(t,n)=>{a.advances[t]=Math.max(1,Vn(a.boxes[n],e))})}let d=Ei(o,a.advances,i.tracking);if(u&&d===0){if(l===`INPUT`)d=Number(e.size)||20;else if(l===`TEXTAREA`)d=Number(e.cols)||20;else{let t=e,n=e=>e?.label||e?.textContent||``,r=getComputedStyle(e).getPropertyValue(`field-sizing`)===`content`?[n(t.selectedOptions[0])]:Array.from(t.options,n);d=Math.max(1,...r.map(e=>e.trim().length))}}let f=o.length>0?Di(o):0,p;if(l===`TEXTAREA`){let t=e,n=t.value??``,a=r?.get(t),o=+!!n.endsWith(`
|
|
959
959
|
`),s=a!==void 0&&a>0?L(n,a)+o:n===``?0:n.split(/\r\n?|\n/).length,c=getComputedStyle(e).getPropertyValue(`field-sizing`)===`content`?1:Number(t.rows)||2,l=Math.max(c,s);p=l+Math.max(0,l-1)*i.lineGap}else p=u?Math.max(1,f):f;let m=new Map,h=[];for(let t of a.boxes)t.source.parentElement===e?m.set(t.source,t):h.push(t);let g=[];for(let e=0;e<s.length;e++){let i=s[e],a=m.get(i);if(a)g.push(a);else if(c[e]===`out-of-flow`){let e=hi(i,t,n,r);e&&g.push(e)}}g.push(...h);let _={source:e,style:i,children:g,text:o,intrinsicWidth:d,intrinsicHeight:p,localRect:{x:0,y:0,width:d,height:p},unclampedHeight:0,resolvedPadding:Xe()};return(a.advances.some(e=>e!==1)||a.boxes.length>0)&&(_.advances=a.advances),a.inlineElements.length>0&&(_.inlineElements=a.inlineElements,_.charInline=a.chars.map((e,t)=>a.inlineIndex[t]??-1)),_}let d=[];for(let e=0;e<s.length;e++){if(c[e]===`none`)continue;let i=hi(s[e],t,n,r);i&&d.push(i)}let f={source:e,style:i,children:d,text:``,intrinsicWidth:0,intrinsicHeight:0,localRect:{x:0,y:0,width:0,height:0},unclampedHeight:0,resolvedPadding:Xe()};return Mi(e,f),f}function gi(e,t,n){let r=l(n,e),i=r?.lines??[],a=i.join(`
|
|
960
|
-
`);t.whiteSpace=`pre`,(t.width===void 0||t.width.kind===`auto`)&&(t.width={kind:`max-content`});let o=
|
|
960
|
+
`);t.whiteSpace=`pre`,(t.width===void 0||t.width.kind===`auto`)&&(t.width={kind:`max-content`});let o=Array.from({length:a.length},()=>1+t.tracking),s=Ei(a,o,t.tracking),c=i.length,u={source:e,style:t,children:[],text:a,intrinsicWidth:s,intrinsicHeight:c,localRect:{x:0,y:0,width:s,height:c},unclampedHeight:0,resolvedPadding:Xe()};t.tracking>0&&(u.advances=o);let d=r?.runs??[];if(d.length>0&&a.length>0){let t=[0];for(let e of i)t.push(t[t.length-1]+e.length+1);let n=Array.from({length:a.length},()=>-1);u.inlineElements=d.map(t=>({element:e,tracking:0,padLeft:0,padRight:0,insets:null,color:t.paint.color,backgroundColor:t.paint.backgroundColor,fontWeight:t.paint.fontWeight??``,fontStyle:t.paint.fontStyle??``,textDecorationLine:t.paint.textDecorationLine??``})),d.forEach((e,r)=>{let a=i[e.line];if(a===void 0)return;let o=Math.max(0,e.start),s=Math.min(a.length,e.end);for(let i=o;i<s;i++)n[t[e.line]+i]=r}),u.charInline=n}return u}var _i=new Set(`A.ABBR.B.BDI.BDO.BR.CITE.CODE.DATA.DFN.EM.I.KBD.MARK.Q.S.SAMP.SMALL.SPAN.STRONG.SUB.SUP.TIME.U.VAR.WBR`.split(`.`));function vi(e,t){return t||(_i.has(e.tagName)?`inline`:`block`)}function yi(e,t){let n=vi(e,t);return n===`inline`||n===`contents`}function $(e,t){let n=vi(e,t);return n.startsWith(`inline`)&&n!==`inline`}function bi(e){let t=getComputedStyle(e);return t.display===`none`?`none`:t.position===`absolute`||t.position===`fixed`?`out-of-flow`:o(e.tagName)?`block`:yi(e,t.display)||$(e,t.display)?`inline`:`block`}function xi(e,t,n){let r={chars:[],advances:[],inlineIndex:[],inlineElements:[],boxes:[]};return Si(e,t,n,r),n.preserve?r:Ti(r)}function Si(e,t,n,r){let i=()=>{let e=0;for(let t=r.chars.length-1;t>=0&&r.chars[t]!==`
|
|
961
961
|
`;t--)e+=r.advances[t];return e};if(!ji(e.tagName)){for(let a of Array.from(e.childNodes))if(a.nodeType===Node.TEXT_NODE){if(n.preserve)for(let e of(a.textContent??``).replace(/\r\n?/g,`
|
|
962
962
|
`))if(e===`
|
|
963
963
|
`)r.chars.push(`
|
|
@@ -984,14 +984,13 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
984
984
|
#grid { position: absolute; inset: 0; margin: 0; font: inherit; line-height: inherit; letter-spacing: inherit; white-space: pre; pointer-events: none; user-select: none; -webkit-user-select: none; }
|
|
985
985
|
:host([select="grid"]) #grid { pointer-events: auto; user-select: text; -webkit-user-select: text; }
|
|
986
986
|
:host([select="grid"]) slot { pointer-events: none; user-select: none; -webkit-user-select: none; }
|
|
987
|
-
/*
|
|
988
|
-
*
|
|
989
|
-
|
|
990
|
-
::selection { color: var(--mw-bg, canvas); background: var(--mw-fg, canvastext); }
|
|
987
|
+
/* Selection invert — mirror of the canonical rule in styles.css
|
|
988
|
+
* (which explains the field choices); update together. */
|
|
989
|
+
::selection { color: var(--mw-bg, canvas); text-shadow: 0 0 0 var(--mw-bg, canvas); background: var(--mw-fg, canvastext); }
|
|
991
990
|
</style>
|
|
992
991
|
<div id="viewport">
|
|
993
992
|
<pre id="grid" aria-hidden="true"></pre>
|
|
994
993
|
<slot></slot>
|
|
995
994
|
</div>
|
|
996
|
-
`,Pi=`grid`,Fi=[`pointerover`,`pointerleave`,`pointerdown`,`pointerup`,`pointercancel`,`keydown`,`keyup`,`focusin`,`focusout`,`input`,`change`],Ii=/^(color|opacity|border-(top|right|bottom|left)-color|border-color)$/,Li=3e4,Ri=typeof HTMLElement>`u`?class{}:HTMLElement,zi=class e extends Ri{static observedAttributes=[`select`];static#e=new Set;static#t=null;static#n=()=>{for(let t of e.#e)t.#G()};static#r(t){t instanceof HTMLLinkElement&&t.rel===`stylesheet`&&!t.sheet&&t.addEventListener(`load`,e.#n,{once:!0})}static#i(t){if(e.#e.add(t),e.#t)return;for(let t of document.querySelectorAll(`link[rel=stylesheet]`))e.#r(t);let n=new MutationObserver(t=>{for(let n of t)for(let t of n.addedNodes)e.#r(t);e.#n()});n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),e.#t=n}static#a(t){e.#e.delete(t),e.#e.size===0&&(e.#t?.disconnect(),e.#t=null)}#o;#s;#c;#l=null;#u=null;#d=!1;#f=null;#p=null;#m=null;#h=null;#g(){this.#u?.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`style`,`colspan`,`rowspan`,`span`,...s()]})}constructor(){super(),this.#o=this.attachShadow({mode:`open`}),this.#o.innerHTML=Ni,this.#s=this.#o.getElementById(`grid`),this.#c=document.createElement(`span`),this.#c.setAttribute(`aria-hidden`,`true`),this.#c.setAttribute(`data-mw-probe`,``),this.#c.style.cssText=`position:absolute!important;top:0!important;left:0!important;visibility:hidden!important;pointer-events:none!important;user-select:none!important;white-space:pre!important;overflow-wrap:normal!important;padding:0!important;margin:0!important;border:0!important;`,this.#c.textContent=`M`.repeat(100)}connectedCallback(){this.hasAttribute(`select`)||this.setAttribute(`select`,Pi),this.#c.parentNode!==this&&this.appendChild(this.#c),this.#l=new ResizeObserver(()=>this.#G()),this.#l.observe(this),this.#l.observe(this.#c),window.addEventListener(`resize`,this.#V),this.#u=new MutationObserver(()=>this.#G()),this.#g(),this.#m=c(()=>{this.#g(),this.#G()}),this.#h=j(()=>this.#G()),document.fonts?.ready.then(this.#H).catch(e=>{console.warn(`[monowind] document.fonts.ready failed:`,e)}),document.fonts?.addEventListener(`loadingdone`,this.#H);for(let e of Fi)this.addEventListener(e,this.#B);this.addEventListener(`transitionrun`,this.#L),this.addEventListener(`transitionend`,this.#R),this.addEventListener(`transitioncancel`,this.#R),this.addEventListener(`pointermove`,this.#D),this.addEventListener(`pointerleave`,this.#O),this.addEventListener(`pointerdown`,this.#k),window.addEventListener(`pointerup`,this.#A),window.addEventListener(`pointercancel`,this.#A),document.addEventListener(`scroll`,this.#j,{capture:!0,passive:!0}),e.#i(this),this.#G()}disconnectedCallback(){window.removeEventListener(`resize`,this.#V),this.#l?.disconnect(),this.#u?.disconnect(),this.#l=null,this.#u=null,this.#m?.(),this.#m=null,this.#h?.(),this.#h=null,document.fonts?.removeEventListener(`loadingdone`,this.#H);for(let e of Fi)this.removeEventListener(e,this.#B);this.removeEventListener(`transitionrun`,this.#L),this.removeEventListener(`transitionend`,this.#R),this.removeEventListener(`transitioncancel`,this.#R),this.#P=0,this.removeEventListener(`pointermove`,this.#D),this.removeEventListener(`pointerleave`,this.#O),this.removeEventListener(`pointerdown`,this.#k),window.removeEventListener(`pointerup`,this.#A),window.removeEventListener(`pointercancel`,this.#A),document.removeEventListener(`scroll`,this.#j,{capture:!0}),this.#S=null,this.#y=null,this.#b=!1,this.#x=!1,this.#M(),e.#a(this)}#_=new Set;#v=new Set;#y=null;#b=!1;#x=!1;#S=null;#C=NaN;#w=NaN;#T=null;static#E=typeof matchMedia>`u`?null:matchMedia(`(hover: hover)`);#D=e=>{let{clientX:t,clientY:n}=e;this.#S={x:t,y:n};let r=this.#T,i=this.#f;if(r&&i){let e=Math.floor((t-r.left)/i.width),a=Math.floor((n-r.top)/i.height);if(e===this.#C&&a===this.#w)return}this.#M()};#O=()=>{this.#S=null,this.#M()};#k=e=>{let t=e;!t.isPrimary||t.button!==0||(this.#S={x:t.clientX,y:t.clientY},this.#b=!0,this.#M(!0))};#A=e=>{e.isPrimary&&(!this.#b&&!this.#y||(this.#b=!1,this.#y=null,this.#M(),this.#x&&this.#G()))};#j=()=>{this.#S&&(this.#T=null,this.#M())};#M(t=!1){let n=this.#p,r=this.#f,i=[];if(this.#S&&n&&r&&this.isConnected&&this.getAttribute(`select`)===`grid`&&(this.#b||e.#E?.matches)){if(!this.#T){let e=this.#s.getBoundingClientRect();this.#T={left:e.left,top:e.top}}this.#C=Math.floor((this.#S.x-this.#T.left)/r.width),this.#w=Math.floor((this.#S.y-this.#T.top)/r.height),i=ye(n,this.#C,this.#w)}else this.#C=NaN,this.#w=NaN;let a=i.at(-1)??null;t&&(this.#y=a);let o=e.#E?.matches?i:[],s=this.#y?i.indexOf(this.#y):-1,c=s>=0?i.slice(0,s+1):[],l=this.#N(`data-mw-hover`,this.#_,o);l=this.#N(`data-mw-active`,this.#v,c)||l;let u=a?getComputedStyle(a).cursor:``;this.#s.style.cursor=u===`auto`?``:u,l&&this.isConnected&&this.#G()}#N(e,t,n){let r=!1,i=new Set(n);for(let n of t)i.has(n)||(n.removeAttribute(e),r=!0);for(let n of i)t.has(n)||(n.setAttribute(e,``),r=!0);t.clear();for(let e of i)t.add(e);return r}#P=0;#F=!1;#I=0;#L=e=>{Ii.test(e.propertyName)&&(this.#P++,this.#I=performance.now(),this.#z())};#R=e=>{Ii.test(e.propertyName)&&(this.#P=Math.max(0,this.#P-1))};#z(){if(this.#F)return;this.#F=!0;let e=()=>{if(!this.isConnected||this.#P===0&&!g()||performance.now()-this.#I>Li){this.#F=!1,this.#P=0,this.#G();return}this.#W(),requestAnimationFrame(e)};requestAnimationFrame(e)}#B=e=>{if((e.type===`focusin`||e.type===`focusout`)&&e.target instanceof HTMLSelectElement){this.#W();return}this.#G()};attributeChangedCallback(e,t,n){if(e===`select`&&n!==`text`&&n!==`grid`){n!==null&&console.warn(`[monowind] Ignoring unrecognized select="${n}". Expected "grid" (default) or "text".`,this),this.setAttribute(`select`,Pi);return}e===`select`&&this.#M(),this.#G()}toPlainText(){return this.#d&&this.#K(),this.#p?Kn(this.#p):``}#V=()=>{this.#G()};#H=()=>{requestAnimationFrame(()=>this.#G())};#U(){let e=document.activeElement;if(!(e instanceof HTMLSelectElement)||!this.contains(e))return!1;try{return e.matches(`:open`)}catch{return!1}}#W(){try{this.#K()}catch(e){console.error(`[monowind] layout failed:`,e)}}#G(){this.#d||(this.#d=!0,requestAnimationFrame(()=>{if(this.#d=!1,this.#U()){this.#G();return}this.#W()}))}#K(){if(!this.isConnected)return;let e=new Map,t=getComputedStyle(this).getPropertyValue(`--mw-cw`).trim(),n=parseFloat(t);if(Number.isFinite(n)&&n>0)for(let t of this.querySelectorAll(`textarea`)){let r=getComputedStyle(t),i=t.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0);e.set(t,Math.max(0,Math.round(i/n)))}this.setAttribute(`measuring`,``);try{this.#c.parentNode!==this&&this.appendChild(this.#c);let t=F(this,this.#c),n=this.#f;(n===null||n.width!==t.width||n.height!==t.height||n.letterSpacing!==t.letterSpacing||n.inkOverhang!==t.inkOverhang)&&(this.style.setProperty(`--mw-cw`,`${t.width}px`),this.style.setProperty(`--mw-ch`,`${t.height}px`),this.style.setProperty(`--mw-rls`,`${t.letterSpacing}px`),this.style.setProperty(`--mw-ink`,`${t.inkOverhang??0}px`)),this.#f=t;let r=getComputedStyle(this),i=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0),a=Math.max(0,Math.floor((this.clientWidth-i)/t.width));if(a===0)return;let o=I(),s=[];for(let n of Array.from(this.children)){if(n===this.#c)continue;let r=hi(n,o,t,e);r&&s.push(r)}if(ki(this)?(this.hasAttribute(`data-mw-dropped-text`)||console.warn(`[monowind] ${Ai}`,this),this.setAttribute(`data-mw-dropped-text`,``)):this.removeAttribute(`data-mw-dropped-text`),s.length===0){this.#s.replaceChildren(),this.#p=null,this.setAttribute(`data-mw-ready`,``);return}let c={source:this,style:Ye(),children:s,text:``,intrinsicWidth:0,intrinsicHeight:0,localRect:{x:0,y:0,width:0,height:0},unclampedHeight:0,resolvedPadding:Xe()},{height:l}=bn(c,a);pr(c),this.#x=!ar(c,this.#s,this.#b),this.#p=c;let u=r.boxSizing===`border-box`?(parseFloat(r.paddingTop)||0)+(parseFloat(r.paddingBottom)||0)+(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0):0,d=`${l*t.height+u}px`;this.style.height!==d&&(this.style.height=d),this.hasAttribute(`data-mw-ready`)||this.setAttribute(`data-mw-ready`,``)}finally{this.setAttribute(`settling`,``),this.removeAttribute(`measuring`),getComputedStyle(this).transitionProperty,this.removeAttribute(`settling`),this.#u?.takeRecords(),h(this)&&(g()?(this.#I=performance.now(),this.#z()):this.#G()),this.#T=null,this.#S&&this.#M()}}};function Bi(){typeof customElements>`u`||customElements.get(`mono-wind`)||customElements.define(`mono-wind`,zi)}var Vi=`@property --mw-rule-x-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-y-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-x-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-y-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-x-color{syntax:"*";inherits:false}@property --mw-rule-y-color{syntax:"*";inherits:false}@utility rule-x-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([*], --default(1px)); column-rule-width: var(--mw-rule-x-width);}@utility rule-y-*{--mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([*], --default(1px)); row-rule-width: var(--mw-rule-y-width);}@utility rule-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([length], --default(1px)); --mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([length], --default(1px)); column-rule-width: var(--mw-rule-x-width); row-rule-width: var(--mw-rule-y-width); --mw-rule-x-color: --value(--color-*, [color]); --mw-rule-y-color: --value(--color-*, [color]); column-rule-color: var(--mw-rule-x-color); row-rule-color: var(--mw-rule-y-color);}@utility rule-solid{column-rule-style: solid; row-rule-style: solid; --mw-rule-x-style: solid; --mw-rule-y-style: solid;}@utility rule-dashed{column-rule-style: dashed; row-rule-style: dashed; --mw-rule-x-style: dashed; --mw-rule-y-style: dashed;}@utility rule-dotted{column-rule-style: dotted; row-rule-style: dotted; --mw-rule-x-style: dotted; --mw-rule-y-style: dotted;}@utility rule-double{column-rule-style: double; row-rule-style: double; --mw-rule-x-style: double; --mw-rule-y-style: double;}@property --mw-rule-break{syntax:"none|normal|intersection";inherits:false;initial-value:normal}@property --mw-rule-inset{syntax:"<length>|overlap-join";inherits:false;initial-value:0}@property --mw-rule-visibility-items{syntax:"normal|all|around|between";inherits:false;initial-value:normal}@utility rule-break-none{rule-break: none; --mw-rule-break: none;}@utility rule-break-normal{rule-break: normal; --mw-rule-break: normal;}@utility rule-break-intersection{rule-break: intersection; --mw-rule-break: intersection;}@utility rule-inset-*{--mw-rule-inset: calc(--value("0", "1", "2", "3", "4", integer) * 1px); --mw-rule-inset: --value([*]); rule-inset: var(--mw-rule-inset);}@utility rule-inset-overlap-join{rule-inset: overlap-join; --mw-rule-inset: overlap-join;}@utility rule-visibility-all{rule-visibility-items: all; --mw-rule-visibility-items: all;}@utility rule-visibility-around{rule-visibility-items: around; --mw-rule-visibility-items: around;}@utility rule-visibility-between{rule-visibility-items: between; --mw-rule-visibility-items: between;}@utility bg-clear{background-color: transparent; --mw-bg-clear: 1;}@property --mw-bg-clear{syntax:"<integer>";inherits:false;initial-value:0}@utility borders-default{--mw-border-glyphs: default;}@utility borders-rounded{--mw-border-glyphs: rounded;}@utility borders-ascii{--mw-border-glyphs: ascii;}@utility borders-single{--mw-border-glyphs: single;}@utility borders-blocks{--mw-border-glyphs: blocks;}@utility borders-cp437{--mw-border-glyphs: cp437;}`,Hi=`@property --mw-rule-x-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-y-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-x-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-y-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-x-color{syntax:"*";inherits:false}@property --mw-rule-y-color{syntax:"*";inherits:false}@utility rule-x-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([*], --default(1px)); column-rule-width: var(--mw-rule-x-width);}@utility rule-y-*{--mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([*], --default(1px)); row-rule-width: var(--mw-rule-y-width);}@utility rule-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([length], --default(1px)); --mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([length], --default(1px)); column-rule-width: var(--mw-rule-x-width); row-rule-width: var(--mw-rule-y-width); --mw-rule-x-color: --value(--color-*, [color]); --mw-rule-y-color: --value(--color-*, [color]); column-rule-color: var(--mw-rule-x-color); row-rule-color: var(--mw-rule-y-color);}@utility rule-solid{column-rule-style: solid; row-rule-style: solid; --mw-rule-x-style: solid; --mw-rule-y-style: solid;}@utility rule-dashed{column-rule-style: dashed; row-rule-style: dashed; --mw-rule-x-style: dashed; --mw-rule-y-style: dashed;}@utility rule-dotted{column-rule-style: dotted; row-rule-style: dotted; --mw-rule-x-style: dotted; --mw-rule-y-style: dotted;}@utility rule-double{column-rule-style: double; row-rule-style: double; --mw-rule-x-style: double; --mw-rule-y-style: double;}@property --mw-rule-break{syntax:"none|normal|intersection";inherits:false;initial-value:normal}@property --mw-rule-inset{syntax:"<length>|overlap-join";inherits:false;initial-value:0}@property --mw-rule-visibility-items{syntax:"normal|all|around|between";inherits:false;initial-value:normal}@utility rule-break-none{rule-break: none; --mw-rule-break: none;}@utility rule-break-normal{rule-break: normal; --mw-rule-break: normal;}@utility rule-break-intersection{rule-break: intersection; --mw-rule-break: intersection;}@utility rule-inset-*{--mw-rule-inset: calc(--value("0", "1", "2", "3", "4", integer) * 1px); --mw-rule-inset: --value([*]); rule-inset: var(--mw-rule-inset);}@utility rule-inset-overlap-join{rule-inset: overlap-join; --mw-rule-inset: overlap-join;}@utility rule-visibility-all{rule-visibility-items: all; --mw-rule-visibility-items: all;}@utility rule-visibility-around{rule-visibility-items: around; --mw-rule-visibility-items: around;}@utility rule-visibility-between{rule-visibility-items: between; --mw-rule-visibility-items: between;}@utility bg-clear{background-color: transparent; --mw-bg-clear: 1;}@property --mw-bg-clear{syntax:"<integer>";inherits:false;initial-value:0}@utility borders-default{--mw-border-glyphs: default;}@utility borders-rounded{--mw-border-glyphs: rounded;}@utility borders-ascii{--mw-border-glyphs: ascii;}@utility borders-single{--mw-border-glyphs: single;}@utility borders-blocks{--mw-border-glyphs: blocks;}@utility borders-cp437{--mw-border-glyphs: cp437;}@custom-variant hover{@media (hover: hover) { &:is(:hover, [data-mw-hover]) { @slot; } }}@custom-variant active (&:is(:active, [data-mw-active]));@layer base{mono-wind{isolation:isolate;letter-spacing:0;font-synthesis:style;--mw-fg:canvastext;--mw-bg:canvas;--mw-ansi-black:#000;--mw-ansi-red:#cd3131;--mw-ansi-green:#0dbc79;--mw-ansi-yellow:#e5e510;--mw-ansi-blue:#2472c8;--mw-ansi-magenta:#bc3fbc;--mw-ansi-cyan:#11a8cd;--mw-ansi-white:#e5e5e5;--mw-ansi-bright-black:#666;--mw-ansi-bright-red:#f14c4c;--mw-ansi-bright-green:#23d18b;--mw-ansi-bright-yellow:#f5f543;--mw-ansi-bright-blue:#3b8eea;--mw-ansi-bright-magenta:#d670d6;--mw-ansi-bright-cyan:#29b8db;--mw-ansi-bright-white:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;line-height:normal;display:block;position:relative}mono-wind :is(button,input,select,textarea){color:inherit;font:inherit;line-height:inherit;text-align:inherit;appearance:none;background:0 0;border-radius:0}mono-wind :is(input,textarea,select){color:var(--mw-fg);caret-color:var(--mw-fg)}mono-wind :is(input,textarea)::placeholder{color:color-mix(in srgb, currentcolor 50%, transparent);opacity:1}mono-wind select:invalid{color:color-mix(in srgb, var(--mw-fg) 50%, transparent)}mono-wind select:invalid:focus-visible{color:color-mix(in srgb, var(--mw-bg) 50%, transparent)}mono-wind :is(input,select){white-space:nowrap;overflow:hidden}mono-wind textarea{resize:none;overflow:clip}mono-wind :focus-visible{background-color:var(--mw-fg);color:var(--mw-bg);caret-color:var(--mw-bg);outline:none}}mono-wind[select=grid] *{pointer-events:none!important}mono-wind[select=grid] :is(a,button,input,select,textarea,label,[tabindex],[role=button]){pointer-events:auto!important}mono-wind:not([data-mw-ready]){visibility:hidden!important}mono-wind:not([measuring]) ::selection{color:var(--mw-bg,canvas)!important;background:var(--mw-fg,canvastext)!important}mono-wind:not([measuring]) :focus-visible::selection{color:var(--mw-fg,canvastext)!important;background:var(--mw-bg,canvas)!important}mono-wind *{font-family:inherit!important;font-size:inherit!important}mono-wind[measuring],mono-wind[measuring] *,mono-wind[settling],mono-wind[settling] *{transition-property:color,border-color,opacity!important}mono-wind[measuring] [data-mw-degrid]{display:block!important}mono-wind:not([measuring]) *{vertical-align:baseline!important;white-space:normal!important;overflow-wrap:anywhere!important;letter-spacing:calc(var(--mw-rls,0px) + var(--mw-ls) * var(--mw-cw,1px))!important;line-height:inherit!important;text-shadow:none!important;padding-left:calc(var(--mw-ipl,0) * var(--mw-cw,1px))!important;padding-right:calc(var(--mw-ipr,0) * var(--mw-cw,1px))!important;background-color:#0000!important}mono-wind:not([measuring]) :not(input):not(textarea):not(select){-webkit-text-fill-color:transparent!important;text-decoration-color:#0000!important}mono-wind:not([measuring]) input,mono-wind:not([measuring]) textarea,mono-wind:not([measuring]) select{-webkit-text-fill-color:currentColor!important}mono-wind:not([measuring]) [data-mw-nowrap]{white-space:nowrap!important}mono-wind:not([measuring]) [data-mw-pre],mono-wind:not([measuring]) [data-mw-pre] *{white-space:pre!important}mono-wind:not([measuring]) [data-mw-nowrap][data-mw-clip]{overflow:hidden!important}mono-wind:not([measuring]) [data-mw-laid-out]{left:calc(var(--mw-x,0) * var(--mw-cw,1px))!important;top:calc(var(--mw-y,0) * var(--mw-ch,1px))!important;translate:0 calc(var(--mw-lhs,0) * var(--mw-ch,1px))!important;grid-area:auto!important;grid-template-rows:none!important;grid-template-columns:none!important;place-content:start!important;place-items:stretch stretch!important;position:absolute!important}mono-wind:not([measuring]) [data-mw-laid-out],mono-wind:not([measuring]) [data-mw-inline-box],mono-wind:not([measuring]) [data-mw-multicol-flow-span]{box-sizing:border-box!important;width:calc((var(--mw-w,0) + max(0, var(--mw-ls,0) - var(--mw-pr,0) - var(--mw-br,0))) * var(--mw-cw,1px) + .03125px)!important;height:calc(var(--mw-h,0) * var(--mw-ch,1px))!important;column-rule-style:none!important;row-rule-style:none!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;z-index:calc(var(--mw-z))!important;padding-top:calc((var(--mw-pt,0) + var(--mw-bt,0)) * var(--mw-ch,1px))!important;padding-right:calc(max(0, var(--mw-pr,0) + var(--mw-br,0) - var(--mw-ls,0)) * var(--mw-cw,1px))!important;padding-bottom:calc((var(--mw-pb,0) + var(--mw-bb,0)) * var(--mw-ch,1px))!important;padding-left:calc((var(--mw-pl,0) + var(--mw-bl,0)) * var(--mw-cw,1px))!important;line-height:calc(var(--mw-lh,1) * var(--mw-ch,1px))!important;border-width:0!important;margin:0!important}mono-wind:not([measuring]) [data-mw-inline-box]{vertical-align:top!important;translate:0 calc(var(--mw-lhs,0) * var(--mw-ch,1px))!important;position:relative!important}mono-wind:not([measuring]) [data-mw-inline-box][data-mw-vbottom]{vertical-align:bottom!important}mono-wind:not([measuring]) [data-mw-multicol]{column-count:var(--mw-colc,1)!important;column-width:auto!important;column-gap:calc(var(--mw-colg,0) * var(--mw-cw,1px))!important;column-fill:auto!important;orphans:1!important;widows:1!important;width:calc(var(--mw-w,0) * var(--mw-cw,1px) + .03125px)!important;padding-right:calc((var(--mw-pr,0) + var(--mw-br,0)) * var(--mw-cw,1px))!important;height:calc((var(--mw-h,0) + var(--mw-lh,1) - 1) * var(--mw-ch,1px) + var(--mw-ink,0px) + .03125px)!important}mono-wind:not([measuring]) [data-mw-multicol-flow]{box-sizing:border-box!important;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;margin-top:calc(var(--mw-mt,0) * var(--mw-ch,1px))!important;margin-right:calc(var(--mw-mr,0) * var(--mw-cw,1px))!important;margin-bottom:calc(var(--mw-mb,0) * var(--mw-ch,1px))!important;margin-left:calc(var(--mw-ml,0) * var(--mw-cw,1px))!important;column-span:none!important;border-width:0!important;display:block!important;position:static!important}mono-wind:not([measuring]) [data-mw-laid-out],mono-wind:not([measuring]) [data-mw-multicol-flow]{text-indent:calc(var(--mw-ti,0) * var(--mw-cw,1px))!important}mono-wind:not([measuring]) [data-mw-center-nudge]{transform:translateX(calc(-.5 * var(--mw-cw,1px)))!important}mono-wind:not([measuring]) [data-mw-multicol-flow-span]{column-span:all!important;margin-top:calc(var(--mw-mt,0) * var(--mw-ch,1px))!important;margin-right:0!important;margin-bottom:calc(var(--mw-mb,0) * var(--mw-ch,1px))!important;margin-left:calc(var(--mw-ml,0) * var(--mw-cw,1px))!important;translate:0 calc(var(--mw-lhs,0) * var(--mw-ch,1px))!important;position:static!important}mono-wind:not([measuring]) [data-mw-multicol][data-mw-multicol-balance]{column-fill:balance!important;height:auto!important}mono-wind:not([measuring]) [data-mw-multicol-balance]>[data-mw-multicol-flow]{padding-top:calc(var(--mw-mt,0) * var(--mw-ch,1px))!important;padding-bottom:calc(var(--mw-mb,0) * var(--mw-ch,1px))!important;margin-top:0!important;margin-bottom:0!important}mono-wind [data-mw-clip]{overflow:clip!important}mono-wind:not([measuring]) [data-mw-inline-inset]{top:calc(var(--mw-it) * var(--mw-ch,1px))!important;right:calc(var(--mw-ir) * var(--mw-cw,1px))!important;bottom:calc(var(--mw-ib) * var(--mw-ch,1px))!important;left:calc(var(--mw-il) * var(--mw-cw,1px))!important;position:relative!important}mono-wind:not([measuring])[data-mw-dropped-text],mono-wind:not([measuring]) [data-mw-dropped-text]{visibility:hidden!important}mono-wind:not([measuring])[data-mw-dropped-text]>[data-mw-laid-out],mono-wind:not([measuring]) [data-mw-dropped-text]>[data-mw-laid-out]{visibility:visible!important}mono-wind:not([measuring]) [data-mw-table-hidden]{display:none!important}mono-wind:not([measuring]) [data-mw-text-align-blocked]{text-align:start!important}`,Ui=`@custom-variant hover{@media (hover: hover) { &:is(:hover, [data-mw-hover]) { @slot; } }}@custom-variant active (&:is(:active, [data-mw-active]));`,Wi=document.createElement(`style`);Wi.setAttribute(`data-monowind`,``),Wi.textContent=Hi,document.head.appendChild(Wi);var Gi=document.createElement(`style`);Gi.setAttribute(`type`,`text/tailwindcss`),Gi.setAttribute(`data-monowind-rules`,``),Gi.textContent=`${Vi}\n${Ui}`,document.head.appendChild(Gi),Bi(),Object.assign(globalThis,{monowind:{...globalThis.monowind,version:`0.2.0`,registerLeafRenderer:i,invalidateLeaves:a}})})();
|
|
995
|
+
`,Pi=`grid`,Fi=[`pointerover`,`pointerleave`,`pointerdown`,`pointerup`,`pointercancel`,`keydown`,`keyup`,`focusin`,`focusout`,`input`,`change`],Ii=/^(color|opacity|border-(top|right|bottom|left)-color|border-color)$/,Li=3e4,Ri=typeof HTMLElement>`u`?class{}:HTMLElement,zi=class e extends Ri{static observedAttributes=[`select`];static#e=new Set;static#t=null;static#n=()=>{for(let t of e.#e)t.#G()};static#r(t){t instanceof HTMLLinkElement&&t.rel===`stylesheet`&&!t.sheet&&t.addEventListener(`load`,e.#n,{once:!0})}static#i(t){if(e.#e.add(t),e.#t)return;for(let t of document.querySelectorAll(`link[rel=stylesheet]`))e.#r(t);let n=new MutationObserver(t=>{for(let n of t)for(let t of n.addedNodes)e.#r(t);e.#n()});n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),e.#t=n}static#a(t){e.#e.delete(t),e.#e.size===0&&(e.#t?.disconnect(),e.#t=null)}#o;#s;#c;#l=null;#u=null;#d=!1;#f=null;#p=null;#m=null;#h=null;#g(){this.#u?.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`style`,`colspan`,`rowspan`,`span`,...s()]})}constructor(){super(),this.#o=this.attachShadow({mode:`open`}),this.#o.innerHTML=Ni,this.#s=this.#o.getElementById(`grid`),this.#c=document.createElement(`span`),this.#c.setAttribute(`aria-hidden`,`true`),this.#c.setAttribute(`data-mw-probe`,``),this.#c.style.cssText=`position:absolute!important;top:0!important;left:0!important;visibility:hidden!important;pointer-events:none!important;user-select:none!important;white-space:pre!important;overflow-wrap:normal!important;padding:0!important;margin:0!important;border:0!important;`,this.#c.textContent=`M`.repeat(100)}connectedCallback(){this.hasAttribute(`select`)||this.setAttribute(`select`,Pi),this.#c.parentNode!==this&&this.appendChild(this.#c),this.#l=new ResizeObserver(()=>this.#G()),this.#l.observe(this),this.#l.observe(this.#c),window.addEventListener(`resize`,this.#V),this.#u=new MutationObserver(()=>this.#G()),this.#g(),this.#m=c(()=>{this.#g(),this.#G()}),this.#h=j(()=>this.#G()),document.fonts?.ready.then(this.#H).catch(e=>{console.warn(`[monowind] document.fonts.ready failed:`,e)}),document.fonts?.addEventListener(`loadingdone`,this.#H);for(let e of Fi)this.addEventListener(e,this.#B);this.addEventListener(`transitionrun`,this.#L),this.addEventListener(`transitionend`,this.#R),this.addEventListener(`transitioncancel`,this.#R),this.addEventListener(`pointermove`,this.#D),this.addEventListener(`pointerleave`,this.#O),this.addEventListener(`pointerdown`,this.#k),window.addEventListener(`pointerup`,this.#A),window.addEventListener(`pointercancel`,this.#A),document.addEventListener(`scroll`,this.#j,{capture:!0,passive:!0}),e.#i(this),this.#G()}disconnectedCallback(){window.removeEventListener(`resize`,this.#V),this.#l?.disconnect(),this.#u?.disconnect(),this.#l=null,this.#u=null,this.#m?.(),this.#m=null,this.#h?.(),this.#h=null,document.fonts?.removeEventListener(`loadingdone`,this.#H);for(let e of Fi)this.removeEventListener(e,this.#B);this.removeEventListener(`transitionrun`,this.#L),this.removeEventListener(`transitionend`,this.#R),this.removeEventListener(`transitioncancel`,this.#R),this.#P=0,this.removeEventListener(`pointermove`,this.#D),this.removeEventListener(`pointerleave`,this.#O),this.removeEventListener(`pointerdown`,this.#k),window.removeEventListener(`pointerup`,this.#A),window.removeEventListener(`pointercancel`,this.#A),document.removeEventListener(`scroll`,this.#j,{capture:!0}),this.#S=null,this.#y=null,this.#b=!1,this.#x=!1,this.#M(),e.#a(this)}#_=new Set;#v=new Set;#y=null;#b=!1;#x=!1;#S=null;#C=NaN;#w=NaN;#T=null;static#E=typeof matchMedia>`u`?null:matchMedia(`(hover: hover)`);#D=e=>{let{clientX:t,clientY:n}=e;this.#S={x:t,y:n};let r=this.#T,i=this.#f;if(r&&i){let e=Math.floor((t-r.left)/i.width),a=Math.floor((n-r.top)/i.height);if(e===this.#C&&a===this.#w)return}this.#M()};#O=()=>{this.#S=null,this.#M()};#k=e=>{let t=e;!t.isPrimary||t.button!==0||(this.#S={x:t.clientX,y:t.clientY},this.#b=!0,this.#M(!0))};#A=e=>{e.isPrimary&&(!this.#b&&!this.#y||(this.#b=!1,this.#y=null,this.#M(),this.#x&&this.#G()))};#j=()=>{this.#S&&(this.#T=null,this.#M())};#M(t=!1){let n=this.#p,r=this.#f,i=[];if(this.#S&&n&&r&&this.isConnected&&this.getAttribute(`select`)===`grid`&&(this.#b||e.#E?.matches)){if(!this.#T){let e=this.#s.getBoundingClientRect();this.#T={left:e.left,top:e.top}}this.#C=Math.floor((this.#S.x-this.#T.left)/r.width),this.#w=Math.floor((this.#S.y-this.#T.top)/r.height),i=ye(n,this.#C,this.#w)}else this.#C=NaN,this.#w=NaN;let a=i.at(-1)??null;t&&(this.#y=a);let o=e.#E?.matches?i:[],s=this.#y?i.indexOf(this.#y):-1,c=s>=0?i.slice(0,s+1):[],l=this.#N(`data-mw-hover`,this.#_,o);l=this.#N(`data-mw-active`,this.#v,c)||l;let u=a?getComputedStyle(a).cursor:``;this.#s.style.cursor=u===`auto`?``:u,l&&this.isConnected&&this.#G()}#N(e,t,n){let r=!1,i=new Set(n);for(let n of t)i.has(n)||(n.removeAttribute(e),r=!0);for(let n of i)t.has(n)||(n.setAttribute(e,``),r=!0);t.clear();for(let e of i)t.add(e);return r}#P=0;#F=!1;#I=0;#L=e=>{Ii.test(e.propertyName)&&(this.#P++,this.#I=performance.now(),this.#z())};#R=e=>{Ii.test(e.propertyName)&&(this.#P=Math.max(0,this.#P-1))};#z(){if(this.#F)return;this.#F=!0;let e=()=>{if(!this.isConnected||this.#P===0&&!g()||performance.now()-this.#I>Li){this.#F=!1,this.#P=0,this.#G();return}this.#W(),requestAnimationFrame(e)};requestAnimationFrame(e)}#B=e=>{if((e.type===`focusin`||e.type===`focusout`)&&e.target instanceof HTMLSelectElement){this.#W();return}this.#G()};attributeChangedCallback(e,t,n){if(e===`select`&&n!==`text`&&n!==`grid`){n!==null&&console.warn(`[monowind] Ignoring unrecognized select="${n}". Expected "grid" (default) or "text".`,this),this.setAttribute(`select`,Pi);return}e===`select`&&this.#M(),this.#G()}toPlainText(){return this.#d&&this.#K(),this.#p?Kn(this.#p):``}#V=()=>{this.#G()};#H=()=>{requestAnimationFrame(()=>this.#G())};#U(){let e=document.activeElement;if(!(e instanceof HTMLSelectElement)||!this.contains(e))return!1;try{return e.matches(`:open`)}catch{return!1}}#W(){try{this.#K()}catch(e){console.error(`[monowind] layout failed:`,e)}}#G(){this.#d||(this.#d=!0,requestAnimationFrame(()=>{if(this.#d=!1,this.#U()){this.#G();return}this.#W()}))}#K(){if(!this.isConnected)return;let e=new Map,t=getComputedStyle(this).getPropertyValue(`--mw-cw`).trim(),n=parseFloat(t);if(Number.isFinite(n)&&n>0)for(let t of this.querySelectorAll(`textarea`)){let r=getComputedStyle(t),i=t.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0);e.set(t,Math.max(0,Math.round(i/n)))}this.setAttribute(`measuring`,``);try{this.#c.parentNode!==this&&this.appendChild(this.#c);let t=F(this,this.#c),n=this.#f;(n===null||n.width!==t.width||n.height!==t.height||n.letterSpacing!==t.letterSpacing||n.inkOverhang!==t.inkOverhang)&&(this.style.setProperty(`--mw-cw`,`${t.width}px`),this.style.setProperty(`--mw-ch`,`${t.height}px`),this.style.setProperty(`--mw-rls`,`${t.letterSpacing}px`),this.style.setProperty(`--mw-ink`,`${t.inkOverhang??0}px`)),this.#f=t;let r=getComputedStyle(this),i=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0),a=Math.max(0,Math.floor((this.clientWidth-i)/t.width));if(a===0)return;let o=I(),s=[];for(let n of Array.from(this.children)){if(n===this.#c)continue;let r=hi(n,o,t,e);r&&s.push(r)}if(ki(this)?(this.hasAttribute(`data-mw-dropped-text`)||console.warn(`[monowind] ${Ai}`,this),this.setAttribute(`data-mw-dropped-text`,``)):this.removeAttribute(`data-mw-dropped-text`),s.length===0){this.#s.replaceChildren(),this.#p=null,this.setAttribute(`data-mw-ready`,``);return}let c={source:this,style:Ye(),children:s,text:``,intrinsicWidth:0,intrinsicHeight:0,localRect:{x:0,y:0,width:0,height:0},unclampedHeight:0,resolvedPadding:Xe()},{height:l}=bn(c,a);pr(c),this.#x=!ar(c,this.#s,this.#b),this.#p=c;let u=r.boxSizing===`border-box`?(parseFloat(r.paddingTop)||0)+(parseFloat(r.paddingBottom)||0)+(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0):0,d=`${l*t.height+u}px`;this.style.height!==d&&(this.style.height=d),this.hasAttribute(`data-mw-ready`)||this.setAttribute(`data-mw-ready`,``)}finally{this.setAttribute(`settling`,``),this.removeAttribute(`measuring`),getComputedStyle(this).transitionProperty,this.removeAttribute(`settling`),this.#u?.takeRecords(),h(this)&&(g()?(this.#I=performance.now(),this.#z()):this.#G()),this.#T=null,this.#S&&this.#M()}}};function Bi(){typeof customElements>`u`||customElements.get(`mono-wind`)||customElements.define(`mono-wind`,zi)}var Vi=`@property --mw-rule-x-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-y-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-x-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-y-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-x-color{syntax:"*";inherits:false}@property --mw-rule-y-color{syntax:"*";inherits:false}@utility rule-x-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([*], --default(1px)); column-rule-width: var(--mw-rule-x-width);}@utility rule-y-*{--mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([*], --default(1px)); row-rule-width: var(--mw-rule-y-width);}@utility rule-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([length], --default(1px)); --mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([length], --default(1px)); column-rule-width: var(--mw-rule-x-width); row-rule-width: var(--mw-rule-y-width); --mw-rule-x-color: --value(--color-*, [color]); --mw-rule-y-color: --value(--color-*, [color]); column-rule-color: var(--mw-rule-x-color); row-rule-color: var(--mw-rule-y-color);}@utility rule-solid{column-rule-style: solid; row-rule-style: solid; --mw-rule-x-style: solid; --mw-rule-y-style: solid;}@utility rule-dashed{column-rule-style: dashed; row-rule-style: dashed; --mw-rule-x-style: dashed; --mw-rule-y-style: dashed;}@utility rule-dotted{column-rule-style: dotted; row-rule-style: dotted; --mw-rule-x-style: dotted; --mw-rule-y-style: dotted;}@utility rule-double{column-rule-style: double; row-rule-style: double; --mw-rule-x-style: double; --mw-rule-y-style: double;}@property --mw-rule-break{syntax:"none|normal|intersection";inherits:false;initial-value:normal}@property --mw-rule-inset{syntax:"<length>|overlap-join";inherits:false;initial-value:0}@property --mw-rule-visibility-items{syntax:"normal|all|around|between";inherits:false;initial-value:normal}@utility rule-break-none{rule-break: none; --mw-rule-break: none;}@utility rule-break-normal{rule-break: normal; --mw-rule-break: normal;}@utility rule-break-intersection{rule-break: intersection; --mw-rule-break: intersection;}@utility rule-inset-*{--mw-rule-inset: calc(--value("0", "1", "2", "3", "4", integer) * 1px); --mw-rule-inset: --value([*]); rule-inset: var(--mw-rule-inset);}@utility rule-inset-overlap-join{rule-inset: overlap-join; --mw-rule-inset: overlap-join;}@utility rule-visibility-all{rule-visibility-items: all; --mw-rule-visibility-items: all;}@utility rule-visibility-around{rule-visibility-items: around; --mw-rule-visibility-items: around;}@utility rule-visibility-between{rule-visibility-items: between; --mw-rule-visibility-items: between;}@utility bg-clear{background-color: transparent; --mw-bg-clear: 1;}@property --mw-bg-clear{syntax:"<integer>";inherits:false;initial-value:0}@utility borders-default{--mw-border-glyphs: default;}@utility borders-rounded{--mw-border-glyphs: rounded;}@utility borders-ascii{--mw-border-glyphs: ascii;}@utility borders-single{--mw-border-glyphs: single;}@utility borders-blocks{--mw-border-glyphs: blocks;}@utility borders-cp437{--mw-border-glyphs: cp437;}`,Hi=`@property --mw-rule-x-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-y-width{syntax:"<length>";inherits:false;initial-value:0}@property --mw-rule-x-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-y-style{syntax:"solid|dashed|dotted|double";inherits:false;initial-value:solid}@property --mw-rule-x-color{syntax:"*";inherits:false}@property --mw-rule-y-color{syntax:"*";inherits:false}@utility rule-x-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([*], --default(1px)); column-rule-width: var(--mw-rule-x-width);}@utility rule-y-*{--mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([*], --default(1px)); row-rule-width: var(--mw-rule-y-width);}@utility rule-*{--mw-rule-x-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-x-width: --value([length], --default(1px)); --mw-rule-y-width: calc(--value("0", "2", "3", "4", integer) * 1px); --mw-rule-y-width: --value([length], --default(1px)); column-rule-width: var(--mw-rule-x-width); row-rule-width: var(--mw-rule-y-width); --mw-rule-x-color: --value(--color-*, [color]); --mw-rule-y-color: --value(--color-*, [color]); column-rule-color: var(--mw-rule-x-color); row-rule-color: var(--mw-rule-y-color);}@utility rule-solid{column-rule-style: solid; row-rule-style: solid; --mw-rule-x-style: solid; --mw-rule-y-style: solid;}@utility rule-dashed{column-rule-style: dashed; row-rule-style: dashed; --mw-rule-x-style: dashed; --mw-rule-y-style: dashed;}@utility rule-dotted{column-rule-style: dotted; row-rule-style: dotted; --mw-rule-x-style: dotted; --mw-rule-y-style: dotted;}@utility rule-double{column-rule-style: double; row-rule-style: double; --mw-rule-x-style: double; --mw-rule-y-style: double;}@property --mw-rule-break{syntax:"none|normal|intersection";inherits:false;initial-value:normal}@property --mw-rule-inset{syntax:"<length>|overlap-join";inherits:false;initial-value:0}@property --mw-rule-visibility-items{syntax:"normal|all|around|between";inherits:false;initial-value:normal}@utility rule-break-none{rule-break: none; --mw-rule-break: none;}@utility rule-break-normal{rule-break: normal; --mw-rule-break: normal;}@utility rule-break-intersection{rule-break: intersection; --mw-rule-break: intersection;}@utility rule-inset-*{--mw-rule-inset: calc(--value("0", "1", "2", "3", "4", integer) * 1px); --mw-rule-inset: --value([*]); rule-inset: var(--mw-rule-inset);}@utility rule-inset-overlap-join{rule-inset: overlap-join; --mw-rule-inset: overlap-join;}@utility rule-visibility-all{rule-visibility-items: all; --mw-rule-visibility-items: all;}@utility rule-visibility-around{rule-visibility-items: around; --mw-rule-visibility-items: around;}@utility rule-visibility-between{rule-visibility-items: between; --mw-rule-visibility-items: between;}@utility bg-clear{background-color: transparent; --mw-bg-clear: 1;}@property --mw-bg-clear{syntax:"<integer>";inherits:false;initial-value:0}@utility borders-default{--mw-border-glyphs: default;}@utility borders-rounded{--mw-border-glyphs: rounded;}@utility borders-ascii{--mw-border-glyphs: ascii;}@utility borders-single{--mw-border-glyphs: single;}@utility borders-blocks{--mw-border-glyphs: blocks;}@utility borders-cp437{--mw-border-glyphs: cp437;}@custom-variant hover{@media (hover: hover) { &:is(:hover, [data-mw-hover]) { @slot; } }}@custom-variant active (&:is(:active, [data-mw-active]));@layer base{mono-wind{isolation:isolate;letter-spacing:0;font-synthesis:style;--mw-fg:canvastext;--mw-bg:canvas;--mw-ansi-black:#000;--mw-ansi-red:#cd3131;--mw-ansi-green:#0dbc79;--mw-ansi-yellow:#e5e510;--mw-ansi-blue:#2472c8;--mw-ansi-magenta:#bc3fbc;--mw-ansi-cyan:#11a8cd;--mw-ansi-white:#e5e5e5;--mw-ansi-bright-black:#666;--mw-ansi-bright-red:#f14c4c;--mw-ansi-bright-green:#23d18b;--mw-ansi-bright-yellow:#f5f543;--mw-ansi-bright-blue:#3b8eea;--mw-ansi-bright-magenta:#d670d6;--mw-ansi-bright-cyan:#29b8db;--mw-ansi-bright-white:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;line-height:normal;display:block;position:relative}mono-wind :is(button,input,select,textarea){color:inherit;font:inherit;line-height:inherit;text-align:inherit;appearance:none;background:0 0;border-radius:0}mono-wind :is(input,textarea,select){color:var(--mw-fg);caret-color:var(--mw-fg)}mono-wind :is(input,textarea)::placeholder{color:color-mix(in srgb, currentcolor 50%, transparent);opacity:1}mono-wind select:invalid{color:color-mix(in srgb, var(--mw-fg) 50%, transparent)}mono-wind select:invalid:focus-visible{color:color-mix(in srgb, var(--mw-bg) 50%, transparent)}mono-wind :is(input,select){white-space:nowrap;overflow:hidden}mono-wind textarea{resize:none;overflow:clip}mono-wind :focus-visible{background-color:var(--mw-fg);color:var(--mw-bg);caret-color:var(--mw-bg);outline:none}}mono-wind[select=grid] *{pointer-events:none!important}mono-wind[select=grid] :is(a,button,input,select,textarea,label,[tabindex],[role=button]){pointer-events:auto!important}mono-wind:not([data-mw-ready]){visibility:hidden!important}mono-wind:not([measuring]) ::selection{color:var(--mw-bg,canvas)!important;text-shadow:0 0 0 var(--mw-bg,canvas)!important;background:var(--mw-fg,canvastext)!important}mono-wind:not([measuring]) :focus-visible::selection{color:var(--mw-fg,canvastext)!important;text-shadow:0 0 0 var(--mw-fg,canvastext)!important;background:var(--mw-bg,canvas)!important}mono-wind *{font-family:inherit!important;font-size:inherit!important}mono-wind[measuring],mono-wind[measuring] *,mono-wind[settling],mono-wind[settling] *{transition-property:color,border-color,opacity!important}mono-wind[measuring] [data-mw-degrid]{display:block!important}mono-wind:not([measuring]) *{vertical-align:baseline!important;white-space:normal!important;overflow-wrap:anywhere!important;letter-spacing:calc(var(--mw-rls,0px) + var(--mw-ls) * var(--mw-cw,1px))!important;line-height:inherit!important;text-shadow:none!important;padding-left:calc(var(--mw-ipl,0) * var(--mw-cw,1px))!important;padding-right:calc(var(--mw-ipr,0) * var(--mw-cw,1px))!important;background-color:#0000!important}mono-wind:not([measuring]) :not(input):not(textarea):not(select){-webkit-text-fill-color:transparent!important;text-decoration-color:#0000!important}mono-wind:not([measuring]) input,mono-wind:not([measuring]) textarea,mono-wind:not([measuring]) select{-webkit-text-fill-color:currentColor!important}mono-wind:not([measuring]) [data-mw-nowrap]{white-space:nowrap!important}mono-wind:not([measuring]) [data-mw-pre],mono-wind:not([measuring]) [data-mw-pre] *{white-space:pre!important}mono-wind:not([measuring]) [data-mw-nowrap][data-mw-clip]{overflow:hidden!important}mono-wind:not([measuring]) [data-mw-laid-out]{left:calc(var(--mw-x,0) * var(--mw-cw,1px))!important;top:calc(var(--mw-y,0) * var(--mw-ch,1px))!important;translate:0 calc(var(--mw-lhs,0) * var(--mw-ch,1px))!important;grid-area:auto!important;grid-template-rows:none!important;grid-template-columns:none!important;place-content:start!important;place-items:stretch stretch!important;position:absolute!important}mono-wind:not([measuring]) [data-mw-laid-out],mono-wind:not([measuring]) [data-mw-inline-box],mono-wind:not([measuring]) [data-mw-multicol-flow-span]{box-sizing:border-box!important;width:calc((var(--mw-w,0) + max(0, var(--mw-ls,0) - var(--mw-pr,0) - var(--mw-br,0))) * var(--mw-cw,1px) + .03125px)!important;height:calc(var(--mw-h,0) * var(--mw-ch,1px))!important;column-rule-style:none!important;row-rule-style:none!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;z-index:calc(var(--mw-z))!important;padding-top:calc((var(--mw-pt,0) + var(--mw-bt,0)) * var(--mw-ch,1px))!important;padding-right:calc(max(0, var(--mw-pr,0) + var(--mw-br,0) - var(--mw-ls,0)) * var(--mw-cw,1px))!important;padding-bottom:calc((var(--mw-pb,0) + var(--mw-bb,0)) * var(--mw-ch,1px))!important;padding-left:calc((var(--mw-pl,0) + var(--mw-bl,0)) * var(--mw-cw,1px))!important;line-height:calc(var(--mw-lh,1) * var(--mw-ch,1px))!important;border-width:0!important;margin:0!important}mono-wind:not([measuring]) [data-mw-inline-box]{vertical-align:top!important;translate:0 calc(var(--mw-lhs,0) * var(--mw-ch,1px))!important;position:relative!important}mono-wind:not([measuring]) [data-mw-inline-box][data-mw-vbottom]{vertical-align:bottom!important}mono-wind:not([measuring]) [data-mw-multicol]{column-count:var(--mw-colc,1)!important;column-width:auto!important;column-gap:calc(var(--mw-colg,0) * var(--mw-cw,1px))!important;column-fill:auto!important;orphans:1!important;widows:1!important;width:calc(var(--mw-w,0) * var(--mw-cw,1px) + .03125px)!important;padding-right:calc((var(--mw-pr,0) + var(--mw-br,0)) * var(--mw-cw,1px))!important;height:calc((var(--mw-h,0) + var(--mw-lh,1) - 1) * var(--mw-ch,1px) + var(--mw-ink,0px) + .03125px)!important}mono-wind:not([measuring]) [data-mw-multicol-flow]{box-sizing:border-box!important;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;margin-top:calc(var(--mw-mt,0) * var(--mw-ch,1px))!important;margin-right:calc(var(--mw-mr,0) * var(--mw-cw,1px))!important;margin-bottom:calc(var(--mw-mb,0) * var(--mw-ch,1px))!important;margin-left:calc(var(--mw-ml,0) * var(--mw-cw,1px))!important;column-span:none!important;border-width:0!important;display:block!important;position:static!important}mono-wind:not([measuring]) [data-mw-laid-out],mono-wind:not([measuring]) [data-mw-multicol-flow]{text-indent:calc(var(--mw-ti,0) * var(--mw-cw,1px))!important}mono-wind:not([measuring]) [data-mw-center-nudge]{transform:translateX(calc(-.5 * var(--mw-cw,1px)))!important}mono-wind:not([measuring]) [data-mw-multicol-flow-span]{column-span:all!important;margin-top:calc(var(--mw-mt,0) * var(--mw-ch,1px))!important;margin-right:0!important;margin-bottom:calc(var(--mw-mb,0) * var(--mw-ch,1px))!important;margin-left:calc(var(--mw-ml,0) * var(--mw-cw,1px))!important;translate:0 calc(var(--mw-lhs,0) * var(--mw-ch,1px))!important;position:static!important}mono-wind:not([measuring]) [data-mw-multicol][data-mw-multicol-balance]{column-fill:balance!important;height:auto!important}mono-wind:not([measuring]) [data-mw-multicol-balance]>[data-mw-multicol-flow]{padding-top:calc(var(--mw-mt,0) * var(--mw-ch,1px))!important;padding-bottom:calc(var(--mw-mb,0) * var(--mw-ch,1px))!important;margin-top:0!important;margin-bottom:0!important}mono-wind [data-mw-clip]{overflow:clip!important}mono-wind:not([measuring]) [data-mw-inline-inset]{top:calc(var(--mw-it) * var(--mw-ch,1px))!important;right:calc(var(--mw-ir) * var(--mw-cw,1px))!important;bottom:calc(var(--mw-ib) * var(--mw-ch,1px))!important;left:calc(var(--mw-il) * var(--mw-cw,1px))!important;position:relative!important}mono-wind:not([measuring])[data-mw-dropped-text],mono-wind:not([measuring]) [data-mw-dropped-text]{visibility:hidden!important}mono-wind:not([measuring])[data-mw-dropped-text]>[data-mw-laid-out],mono-wind:not([measuring]) [data-mw-dropped-text]>[data-mw-laid-out]{visibility:visible!important}mono-wind:not([measuring]) [data-mw-table-hidden]{display:none!important}mono-wind:not([measuring]) [data-mw-text-align-blocked]{text-align:start!important}`,Ui=`@custom-variant hover{@media (hover: hover) { &:is(:hover, [data-mw-hover]) { @slot; } }}@custom-variant active (&:is(:active, [data-mw-active]));`,Wi=document.createElement(`style`);Wi.setAttribute(`data-monowind`,``),Wi.textContent=Hi,document.head.appendChild(Wi);var Gi=document.createElement(`style`);Gi.setAttribute(`type`,`text/tailwindcss`),Gi.setAttribute(`data-monowind-rules`,``),Gi.textContent=`${Vi}\n${Ui}`,document.head.appendChild(Gi),Bi(),Object.assign(globalThis,{monowind:{...globalThis.monowind,version:`0.2.1`,registerLeafRenderer:i,invalidateLeaves:a}})})();
|
|
997
996
|
//# sourceMappingURL=cdn.js.map
|