@axel669/windstorm 0.5.5 → 0.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/dist/ws-es5.js ADDED
@@ -0,0 +1,1161 @@
1
+ var ws=function(e){"use strict";const t=Symbol("no match"),r=(e,r)=>{const o=r=>{const o=r.length;return()=>r===e.substr(F,o)?(F+=o,r):t},a=r=>()=>{const o=e.charAt(F);return!1!==r.test(o)?(F+=1,o):t};let n=null;const s=o("@"),i=o(":"),l=a(/[^;]/),c=o(";"),d=o("*"),p=a(/[a-z0-9_\-]/i),h=o("!"),u=a(/[^{]/),b=o("{"),g=o("}"),f=a(/[a-zA-Z0-9\.\-_#\^\$\/]/),m=o("#"),x=a(/[^;#]/),v=a(/[\s]/m),w=()=>{const e=F;let r=null,o=null;return(r=N())===t||(o=z())===t?(F=e,t):[r,o]},y=()=>{const r=F;let o=null,a=null;return(o=m())===t||(a=(()=>{const r=F,o=F;for(;x()!==t;);return F-o==0?t:e.slice(r,F)})())===t?(F=r,t):[o,a]},k=()=>{n="rules";let e=F,r=null;const o=[];let a=null;for(;(a=w())!==t;)o.push(a);if(r=o,N()===t)return F=e,t;return r.map((e=>e[1]))},z=()=>{let e=null;return(e=$())!==t||(e=A())!==t||(e=E())!==t||(e=L())!==t?e:t},$=()=>{n="rule$0";let e=F,r=null;if((r=S())===t)return F=e,t;return r},A=()=>{n="rule$1";let e=F,r=null;if((r=M())===t)return F=e,t;return r},E=()=>{n="rule$2";let e=F,r=null;if((r=V())===t)return F=e,t;return r},L=()=>{n="rule$3";let e=F,r=null;if((r=C())===t)return F=e,t;return r},S=()=>{n="variable";let r=F,o=null,a=null;if(s()===t)return F=r,t;if((o=q())===t)return F=r,t;if(i()===t)return F=r,t;if(N()===t)return F=r,t;if((a=(()=>{const r=F,o=F;for(;l()!==t;);return F-o==0?t:e.slice(r,F)})())===t)return F=r,t;if(c()===t)return F=r,t;return((e,t)=>({type:"var",name:e,value:t}))(o,a)},M=()=>{n="css";let r=F,o=null,a=null;if(d()===t)return F=r,t;if((o=q())===t)return F=r,t;if(i()===t)return F=r,t;if(N()===t)return F=r,t;if((a=(()=>{const r=F,o=F;for(;l()!==t;);return F-o==0?t:e.slice(r,F)})())===t)return F=r,t;if(c()===t)return F=r,t;return((e,t)=>({type:"css",name:e,value:t}))(o,a)},q=()=>{n="cssName";let r=F,o=null;if((o=(()=>{const r=F,o=F;for(;p()!==t;);return F-o==0?t:e.slice(r,F)})())===t)return F=r,t;return o},V=()=>{n="subrule";let r=F,o=null,a=null;if(h()===t)return F=r,t;if(N()===t)return F=r,t;if((o=(()=>{const r=F,o=F;for(;u()!==t;);return F-o==0?t:e.slice(r,F)})())===t)return F=r,t;if(b()===t)return F=r,t;if((a=k())===t)return F=r,t;if(g()===t)return F=r,t;var s;return s=a,{type:"alt",selector:o.trim(),rules:s}},C=()=>{n="macro";let r=F,o=null,a=null;if((o=(()=>{const r=F,o=F;for(;f()!==t;);return F-o==0?t:e.slice(r,F)})())===t)return F=r,t;const s=(()=>{const e=F;let r=null,o=null,a=null;return(r=i())===t||(o=N())===t||(a=I())===t?(F=e,t):[r,o,a]})();if(a=s===t?null:s,c()===t)return F=r,t;return((e,t)=>({type:"macro",name:e,value:t?.[2]}))(o,a)},I=()=>{let e=null;return(e=T())!==t||(e=j())!==t?e:t},T=()=>{n="macroValue$0";let e=null;const r=[];let o=null;for(;(o=y())!==t;)r.push(o);if(0===r.length)return t;e=r;return(e=>{const t=e.map((e=>e[1].trim()));return t.arg=t.join(" "),t})(e)},j=()=>{n="macroValue$1";let r=F,o=null;if((o=(()=>{const r=F,o=F;for(;l()!==t;);return F-o==0?t:e.slice(r,F)})())===t)return F=r,t;return(e=>{const t=[e.trim()];return t.arg=e,t})(o)},N=()=>{for(n="_";v()!==t;);};let F=0;const H=(()=>{n="$";let e=F,r=null;if((r=k())===t)return F=e,t;return r})();return F!==e.length?(console.log("last",n),console.log("@",F),console.log(e.slice(F-10,F+10)),new Error("End of input not found")):H},o=document.createElement("style");o.setAttribute("data-name","windstorm-generated"),o.innerHTML="@layer ws.custom ws.macro ws.user;",document.head.append(o);const a=(e,...t)=>{const o=String.raw(e,...t);return n(r(o),{"&":[]},"&")},n=(e,t,r)=>{for(const o of e)i(o,t,r);return t},s=e=>e.replace(/@([a-zA-Z0-9\-_]+)/g,((e,t)=>`var(--${t})`)),i=(e,t,r)=>{if("var"===e.type)return void t[r].push(`--${e.name}: ${s(e.value)};`);if("css"===e.type)return void t[r].push(`${e.name}: ${s(e.value)};`);if("macro"===e.type){const o=l[e.name];if(void 0===o)return void console.warn(`no macro for "${e.name}"`);for(const[a,n]of Object.entries(o)){const o=a.replace("&",r);t[o]=t[o]??[],t[o].push(...n.map((t=>s(t.replace(/%(arg|\d+)/g,((t,r)=>e.value?.[r]??""))))))}return}const o=e.selector.replaceAll("&",r);t[o]=[...t[o]??[]],n(e.rules,t,o)},l={},c=e=>(t,...r)=>l[e]=a(t,...r),d=e=>Object.entries(e).reduce(((e,[t,r])=>{if(!0===t.startsWith("|")){const o=t.lastIndexOf("|"),a=[`@media (${t.slice(1,o)}) {`,`${`&${t.slice(o+1)}`} {`,...r,"}","}"].join("\n");return e.push(a),e}return e.push(`${t} {\n${r.join("\n")}\n}`),e}),[]),p=(e,t="ws.custom")=>(r,...n)=>{const s=a(r,...n),i=d(s).map((t=>t.replaceAll("&",e))),l=`@layer ${t} { ${i.join("\n")} }`;o.sheet.insertRule(l)};const h={attr:"ws-x",origin:"https://wind-cdn.axel669.net",...window.wsConfig,version:"0.6.0",fontVersion:"2",iconVersion:"3.34.0"},u={},b=async(e,t)=>{const r=u[t],o=`ws-icon-${t}`;if(void 0!==r){if(await r.loaded,"loaded"!==r.status||null===e)return;return void e.style.setProperty("--icon-font",o)}const a=new FontFace(o,`url(${h.origin}/icon/${t}.woff?v${h.iconVersion})`);u[t]=a;try{await a.load()}catch(e){console.error(e)}document.fonts.add(a),b(e,t)},g=e=>{if(void 0===e.tagName)return;const t=e.dataset.icon??null;null!==t&&b(e,t)},f={childList(e){0!==e.addedNodes.length&&e.addedNodes.forEach((e=>{if(void 0===e.tagName)return;[e,...e.querySelectorAll("*")].forEach(g)}))},attributes(e){g(e.target)}};new MutationObserver((e=>e.forEach((e=>f[e.type](e))))).observe(document.body,{subtree:!0,attributes:!0,childList:!0,attributeFilter:["data-icon"]});const m=(...e)=>{for(const t of e)b(null,t)};c("appr")`*apperance: %arg; *-webkit-appearance: %arg;`,c("area")`*grid-area: %arg;`,c("b")`*border: %arg;`,c("b.b")`*border-bottom: %arg;`,c("b.b.c")`*border-bottom-color: %arg;`,c("b.b.s")`*border-bottom-style: %arg;`,c("b.b.w")`*border-bottom-width: %arg;`,c("b.c")`*border-color: %arg;`,c("b.l")`*border-left: %arg;`,c("b.l.c")`*border-left-color: %arg;`,c("b.l.s")`*border-left-style: %arg;`,c("b.l.w")`*border-left-width: %arg;`,c("b.r")`*border-right: %arg;`,c("b.r.c")`*border-right-color: %arg;`,c("b.r.s")`*border-right-style: %arg;`,c("b.r.w")`*border-right-width: %arg;`,c("b.s")`*border-style: %arg;`,c("b.t")`*border-top: %arg;`,c("b.t.c")`*border-top-color: %arg;`,c("b.t.s")`*border-top-style: %arg;`,c("b.t.w")`*border-top-width: %arg;`,c("b.w")`*border-width: %arg;`,c("b.x")`*border-left: %arg; *border-right: %arg;`,c("b.x.c")`*border-left-color: %arg; *border-right-color: %arg;`,c("b.x.s")`*border-left-style: %arg; *border-right-style: %arg;`,c("b.x.w")`*border-left-width: %arg; *border-right-width: %arg;`,c("b.y")`*border-top: %arg; *border-bottom: %arg;`,c("b.y.c")`*border-top-color: %arg; *border-bottom-color: %arg;`,c("b.y.s")`*border-top-style: %arg; *border-bottom-style: %arg;`,c("b.y.w")`*border-top-width: %arg; *border-bottom-width: %arg;`,c("bg")`*background: %arg;`,c("bg.att")`*background-attachment: %arg;`,c("bg.c")`*background-color: %arg;`,c("bg.img")`*background-image: %arg;`,c("bg.pos")`*background-position: %arg;`,c("bg.rep")`*background-repeat: %arg;`,c("bg.sz")`*background-size: %arg;`,c("c")`*color: %arg;`,c("col")`*grid-column: %arg;`,c("cur")`*cursor: %arg;`,c("disp")`*display: %arg;`,c("fl.basis")`*flex-basis: %arg;`,c("fl.cross")`*align-items: %arg;`,c("fl.dir")`*flex-direction: %arg;`,c("fl.flow")`*flex-flow: %arg;`,c("fl.grow")`*flex-grow: %arg;`,c("fl.main")`*justify-content: %arg;`,c("fl.shrink")`*flex-shrink: %arg;`,c("fl.size")`*flex: %arg;`,c("fl.wr")`*flex-wrap: %arg;`,c("font")`*font-family: %arg;`,c("gap")`*gap: %arg;`,c("gap.col")`*column-gap: %arg;`,c("gap.row")`*row-gap: %arg;`,c("gr.areas")`*grid-template-areas: %arg;`,c("gr.cols")`*grid-template-columns: %arg;`,c("gr.cols.a")`*grid-auto-columns: %arg;`,c("gr.flow")`*grid-auto-flow: %arg;`,c("gr.rows")`*grid-template-rows: %arg;`,c("gr.rows.a")`*grid-auto-rows: %arg;`,c("h")`*height: %arg;`,c("h.max")`*max-height: %arg;`,c("h.min")`*min-height: %arg;`,c("inset")`*top: %arg; *left: %arg; *bottom: %arg; *right: %arg;`,c("inset.x")`*left: %arg; *right: %arg;`,c("inset.y")`*top: %arg; *bottom: %arg;`,c("m")`*margin: %arg;`,c("m.b")`*margin-bottom: %arg;`,c("m.l")`*margin-left: %arg;`,c("m.r")`*margin-right: %arg;`,c("m.t")`*margin-top: %arg;`,c("m.x")`*margin-left: %arg; *margin-right: %arg;`,c("m.y")`*margin-bottom: %arg; *margin-top: %arg;`,c("o")`*opacity: %arg;`,c("outln")`*outline: %arg;`,c("over")`*overflow: %arg;`,c("over.x")`*overflow-x: %arg;`,c("over.y")`*overflow-y: %arg;`,c("p")`*padding: %arg;`,c("p.b")`*padding-bottom: %arg;`,c("p.l")`*padding-left: %arg;`,c("p.r")`*padding-right: %arg;`,c("p.t")`*padding-top: %arg;`,c("p.x")`*padding-left: %arg; *padding-right: %arg;`,c("p.y")`*padding-top: %arg; *padding-bottom: %arg;`,c("pos")`*position: %arg;`,c("pos.abs")`*position: absolute;`,c("pos.fix")`*position: fixed;`,c("pos.rel")`*position: relative;`,c("pos.stick")`*position: sticky;`,c("r")`*border-radius: %arg;`,c("r.b")`*border-bottom-left-radius: %arg; *border-bottom-right-radius: %arg;`,c("r.bl")`*border-bottom-left-radius: %arg;`,c("r.br")`*border-bottom-right-radius: %arg;`,c("r.l")`*border-top-left-radius: %arg; *border-bottom-left-radius: %arg;`,c("r.r")`*border-top-right-radius: %arg; *border-bottom-right-radius: %arg;`,c("r.t")`*border-top-left-radius: %arg; *border-top-right-radius: %arg;`,c("r.tl")`*border-top-left-radius: %arg;`,c("r.tr")`*border-top-right-radius: %arg;`,c("row")`*grid-row: %arg;`,c("sel")`*user-select: %arg;`,c("self.cross")`*align-self: %arg;`,c("self.main")`*justify-self: %arg;`,c("sh.box")`*box-shadow: %arg;`,c("sh.text")`*text-shadow: %arg;`,c("t.a")`*text-align: %arg;`,c("t.br")`*word-break: %arg;`,c("t.c")`*color: %arg;`,c("t.deco")`*text-decoration: %arg;`,c("t.lh")`*line-height: %arg;`,c("t.over")`*text-overflow: %arg;`,c("t.st")`*font-style: %arg;`,c("t.sz")`*font-size: %arg;`,c("t.tf")`*text-transform: %arg;`,c("t.var")`*font-variant: %arg;`,c("t.wrap")`*word-wrap: %arg;`,c("t.ws")`*white-space: %arg;`,c("t.wt")`*font-weight: %arg;`,c("tf")`*transform: %arg;`,c("tf.o")`*transform-origin: %arg;`,c("tf.p")`*perspective: %arg;`,c("tr")`*transition: %arg;`,c("v.a")`*vertical-align: %arg;`,c("vis")`*visibility: %arg;`,c("w")`*width: %arg;`,c("w.max")`*max-width: %arg;`,c("w.min")`*min-width: %arg;`,c("x")`*left: %arg;`,c("-x")`*right: %arg;`,c("y")`*top: %arg;`,c("-y")`*bottom: %arg;`,c("z")`*z-index: %arg;`,c("fl.cn")`fl.cross: center; fl.main: center;`,c("fl.cn.cross")`fl.cross: center;`,c("fl.cn.main")`fl.main: center;`,c("flex")`disp: flex; fl.dir: %arg;`,c("grid")`disp: grid; gr.flow: %arg;`,c("hide")`disp: none;`,c("invis")`vis: hidden;`,c("sticky")`pos: sticky; y: 0px; z: +1;`,c("adorn")`disp: flex; fl.cn; p: 4px;`,c("pad.compact")`p: 0px 4px;`,c("variant.outline")`b.w: 1px;`,c("variant.fill")`@text-color: @alt-color; @fill-color: @core-color; @active: @alt-color;`,c("variant.lined")`b.w: 0px; b.b.w: @border-size; r.b: 0px;`,c("gr.cols-fit")`*grid-template-columns: repeat(auto-fit, minmax(%arg));`,c("gr.cols-fill")`*grid-template-columns: repeat(auto-fill, minmax(%arg));`,c("text.subtitle")`t.sz: @text-size-subtitle; flex; fl.main: center; p: 0px 8px;`,c("text.title")`t.sz: @text-size-title; flex; fl.main: center; p: 4px 8px;`,c("elevate")`sh.box: 0px 2px 3px @shadow-color;`;const x=e=>{let t=5381;for(let r=0;r<e.length;r+=1)t=33*t^e.charCodeAt(r);return t.toString(36)},v={},w=e=>Object.entries(e).reduce(((e,t)=>{const[r,o]=t;return null==o||!1===o?e:!0===o?(e.push(`${r};`),e):"object"==typeof o?(e.push(`${r} { ${w(o)} }`),e):(e.push(`${r}: ${o};`),e)}),[]).join(" "),y=h.version,k=Math.ceil(screen.height*devicePixelRatio*10)%10>=5;c("#theme.base")`
2
+ font: @font;
3
+
4
+ @sub-pixel-offset: ${k?1:0}px;
5
+ @z-info: 5;
6
+ @z-cover: 25;
7
+ @z-notif: 50;
8
+ @z-layer: 100;
9
+
10
+ @base-radius: 4px;
11
+ @anim-time: 250ms;
12
+ @short-anim-time: 150ms;
13
+
14
+ @text-size-normal: 15px;
15
+ @text-size-title: calc(@text-size-normal * 2);
16
+ @text-size-header: calc(@text-size-normal * 1.5);
17
+ @text-size-subtitle: calc(@text-size-normal * 0.9);
18
+ @text-size-info: calc(@text-size-normal * 0.75);
19
+
20
+ @color: @mono;
21
+
22
+ @page-text-color: hsl(@color, @layer-text);
23
+ bg.c: hsl(@color, @layer-bg);
24
+ t.c: @page-text-color;
25
+ t.sz: @text-size-normal;
26
+ `,c("#theme.tron")`
27
+ #theme.base;
28
+
29
+ @font: Tektur;
30
+
31
+ @mono: 0, 0%;
32
+ @primary: 184, 80%;
33
+ @accent: 160, 80%;
34
+ @info: 208, 80%;
35
+ @success: 130, 80%;
36
+ @warning: 58, 80%;
37
+ @error: 4, 80%;
38
+
39
+ @layer-bg: 15%;
40
+ @layer-surface: 5%;
41
+ @layer-element: 65%;
42
+ @layer-container: 10%;
43
+ @layer-border: 25%;
44
+ @layer-text: 95%;
45
+ @layer-fill: 5%;
46
+
47
+ @shadow-color: hsla(0, 0%, 100%, 0.25);
48
+ @modal-color: hsla(0, 0%, 0%, 0.25);
49
+
50
+ *color-scheme: dark;
51
+ `,c("#theme.dark")`
52
+ #theme.base;
53
+ @font: Roboto;
54
+
55
+ @mono: 0, 0%;
56
+ @primary: 184, 80%;
57
+ @accent: 160, 80%;
58
+ @info: 208, 80%;
59
+ @success: 130, 80%;
60
+ @warning: 58, 80%;
61
+ @error: 4, 80%;
62
+
63
+ @layer-bg: 20%;
64
+ @layer-surface: 10%;
65
+ @layer-element: 50%;
66
+ @layer-container: 15%;
67
+ @layer-border: 30%;
68
+ @layer-text: 90%;
69
+ @layer-fill: 10%;
70
+
71
+ @shadow-color: hsla(0, 0%, 100%, 0.25);
72
+ @modal-color: hsla(0, 0%, 0%, 0.25);
73
+
74
+ *color-scheme: dark;
75
+ `,c("#theme.light")`
76
+ #theme.base;
77
+ @font: Roboto;
78
+
79
+ @mono: 0, 0%;
80
+ @primary: 184, 70%;
81
+ @accent: 160, 85%;
82
+ @info: 208, 85%;
83
+ @success: 130, 90%;
84
+ @warning: 58, 85%;
85
+ @error: 4, 80%;
86
+
87
+ @layer-bg: 85%;
88
+ @layer-surface: 95%;
89
+ @layer-element: 37.5%;
90
+ @layer-container: 90%;
91
+ @layer-border: 80%;
92
+ @layer-text: 10%;
93
+ @layer-fill: 95%;
94
+
95
+ @shadow-color: hsla(0, 0%, 20%, 0.25);
96
+ @modal-color: hsla(0, 0%, 0%, 0.25);
97
+ `;var z=(e,...t)=>{const r=String.raw(e,...t),o=document.createElement("template");return o.innerHTML=r,()=>o.content.cloneNode(!0)};p("ws-circle-spinner, ws-hexagon-spinner")`
98
+ @size: 100px;
99
+
100
+ w: @size;
101
+ h: @size;
102
+ disp: inline-block;
103
+ `;const $=z`
104
+ <style>
105
+ :host {
106
+ --color: var(--primary);
107
+ --core-color: hsl(var(--color), var(--layer-element));
108
+ --alt-color: hsl(var(--color), var(--layer-border));
109
+ --size: 100px;
110
+ display: inline;
111
+ }
112
+ @keyframes spin {
113
+ from {
114
+ transform: rotate(0deg);
115
+ }
116
+ to {
117
+ transform: rotate(360deg);
118
+ }
119
+ }
120
+ circle {
121
+ animation-name: spin;
122
+ animation-iteration-count: infinite;
123
+ animation-timing-function: linear;
124
+ transform-origin: 50% 50%;
125
+ stroke: var(--core-color);
126
+ }
127
+ circle.mid {
128
+ stroke: var(--alt-color);
129
+ }
130
+ circle:nth-child(1) {
131
+ animation-duration: 4s;
132
+ }
133
+ circle:nth-child(2) {
134
+ animation-duration: 3s;
135
+ animation-direction: reverse;
136
+ }
137
+ circle:nth-child(3) {
138
+ animation-duration: 2s;
139
+ }
140
+
141
+ svg {
142
+ display: inline-block;
143
+ width: var(--size);
144
+ height: var(--size);
145
+ }
146
+ </style>
147
+
148
+ <svg viewBox="0 0 100 100">
149
+ <circle cx="50" cy="50" stroke-width="4" fill="transparent" r="48" stroke-dasharray="0 37.7 75.4 75.4 75.4 75.4"></circle>
150
+ <circle class="mid" cx="50" cy="50" stroke-width="4" fill="transparent" r="40" stroke-dasharray="0 31.4 62.83 62.83 62.83 62.83"></circle>
151
+ <circle cx="50" cy="50" stroke-width="4" fill="transparent" r="32" stroke-dasharray="0 12.57 25.13 25.13 25.13 25.13 25.13 25.13 25.13 25.13"></circle>
152
+ </svg>
153
+ `;customElements.define("ws-circle-spinner",class extends HTMLElement{constructor(){super();this.attachShadow({mode:"closed"}).appendChild($())}});const A=z`
154
+ <style>
155
+ :host {
156
+ --color: var(--primary);
157
+ --core-color: hsl(var(--color), var(--layer-element));
158
+ --alt-color: hsl(var(--color), var(--layer-border));
159
+ --size: 100px;
160
+ display: inline;
161
+ }
162
+ @keyframes spin {
163
+ from {
164
+ transform: rotateY(0deg);
165
+ }
166
+ to {
167
+ transform: rotateY(360deg);
168
+ }
169
+ }
170
+ path {
171
+ animation-name: spin;
172
+ animation-iteration-count: infinite;
173
+ animation-timing-function: linear;
174
+ transform-origin: 50% 50%;
175
+ stroke: var(--core-color);
176
+ }
177
+ path.mid {
178
+ stroke: var(--alt-color);
179
+ }
180
+ path:nth-child(1) {
181
+ animation-duration: 3s;
182
+ }
183
+ path:nth-child(2) {
184
+ animation-duration: 2s;
185
+ animation-direction: reverse;
186
+ }
187
+ path:nth-child(3) {
188
+ animation-duration: 1s;
189
+ }
190
+
191
+ svg {
192
+ display: inline-block;
193
+ width: var(--size);
194
+ height: var(--size);
195
+ }
196
+ </style>
197
+
198
+ <svg viewBox="0 0 100 100">
199
+ <path stroke-width="4" fill="none" d="M91.57 26v48L50 98 8.43 74V26L50 2l41.57 24Z"></path>
200
+ <path stroke-width="4" class="mid" fill="none" d="M81.177 32v36L50 86 18.823 68V32L50 14l31.177 18Z"></path>
201
+ <path stroke-width="4" fill="none" d="M70.785 38v24L50 74 29.215 62V38L50 26l20.785 12Z"></path>
202
+ </svg>
203
+ `;customElements.define("ws-hexagon-spinner",class extends HTMLElement{constructor(){super();this.attachShadow({mode:"closed"}).appendChild(A())}});var E=(e,t)=>`\n @core: ${e};\n @alt: ${t};\n @core-color: hsl(@color, @core);\n @alt-color: hsl(@color, @alt);\n\n @fill: var(--fill-color, transparent);\n @text: var(--text-color, @core-color);\n @active: @text;\n`;p("ws-avatar")`
204
+ @color: @mono;
205
+ @size: 36px;
206
+
207
+ ${E("@layer-element","@layer-fill")}
208
+
209
+ disp: inline-flex;
210
+ over: hidden;
211
+ r: 500px;
212
+ fl.cross: center;
213
+ fl.main: center;
214
+ w: @size;
215
+ h: @size;
216
+ bg.c: @fill;
217
+ t.c: @text;
218
+ v.a: text-bottom;
219
+
220
+ ! & > img {
221
+ w: 100%;
222
+ }
223
+ ! & > object {
224
+ w: 100%;
225
+ h: 100%;
226
+ disp: flex;
227
+ fl.cross: center;
228
+ fl.main: center;
229
+ }
230
+ `,p("ws-badge")`
231
+ @color: @primary;
232
+
233
+ ${E("@layer-element","@layer-fill")}
234
+
235
+ pos: relative;
236
+ disp: inline-grid;
237
+ over: visible;
238
+
239
+ ! &::after {
240
+ pos: absolute;
241
+ *content: attr(ws-text);
242
+ -x: -10px;
243
+ y: 0px;
244
+ tf: translateY(-50%);
245
+ bg.c: @core-color;
246
+ *pointer-events: none;
247
+ r: 20px;
248
+ p: 4px;
249
+ w.min: 20px;
250
+ h: 20px;
251
+ *box-sizing: border-box;
252
+ t.a: center;
253
+ t.sz: @text-size-subtitle;
254
+ t.c: @alt-color;
255
+ t.lh: 14px;
256
+ z: @z-info;
257
+ t.wt: 600;
258
+ }
259
+ `;var L='\n over: hidden;\n pos: relative;\n cur: pointer;\n\n ! &::after {\n *content: "";\n pos: absolute;\n y: 0px;\n x: 0px;\n -y: 0px;\n -x: 0px;\n *pointer-events: none;\n o: 0;\n bg.c: @active;\n tr: opacity @anim-time linear;\n }\n ! &:where(:not(:disabled)):active::after {\n tr: none;\n o: 0.3;\n }\n',S='\n over: hidden;\n pos: relative;\n\n ! |pointer: fine| {\n ! &::before {\n *content: "";\n pos: absolute;\n y: 0px;\n x: 0px;\n -y: 0px;\n -x: 0px;\n *pointer-events: none;\n o: 0;\n bg.c: @active;\n }\n ! &:where(:not(:disabled)):hover::before {\n tr: none;\n o: 0.1;\n }\n }\n';p(":where(button[data-ws], a[data-ws][button], label[data-ws][button])")`
260
+ @color: @primary;
261
+
262
+ ${E("@layer-element","@layer-fill")}
263
+
264
+ pos: relative;
265
+
266
+ b: 0px solid @core-color;
267
+ font: @font;
268
+
269
+ t.c: @text;
270
+ bg.c: @fill;
271
+ r: @base-radius;
272
+ cur: pointer;
273
+ p: 8px 16px;
274
+ over: hidden;
275
+ *user-select: none;
276
+ disp: inline-flex;
277
+ fl.cross: center;
278
+ fl.main: center;
279
+ t.deco: none;
280
+ t.wt: 500;
281
+
282
+ ! &:disabled {
283
+ cur: default;
284
+ *filter: saturate(30%) brightness(0.7);
285
+ }
286
+
287
+ ${S}
288
+ ${L}
289
+ `,p("ws-chip")`
290
+ @color: @mono;
291
+
292
+ ${E("@layer-element","@layer-fill")}
293
+
294
+ disp: inline-flex;
295
+ fl.cross: center;
296
+ fl.main: center;
297
+ r: 100px;
298
+ p: 4px 12px;
299
+ *user-select: none;
300
+ v.a: text-bottom;
301
+ t.c: @text-color;
302
+ bg: @fill-color;
303
+ b: 1px solid @core-color;
304
+
305
+ ! &[clickable] {
306
+ cur: pointer;
307
+ ${L}
308
+ }
309
+ `,p("label[control][data-ws]")`
310
+ @color: @primary;
311
+ @active: @mono;
312
+
313
+ pos: relative;
314
+ disp: inline-grid;
315
+ gr.areas: "label label label" "start control end" "extra extra extra";
316
+ gr.rows: minmax(0px, min-content) auto minmax(0px, min-content);
317
+ gr.cols: minmax(0px, min-content) auto minmax(0px, min-content);
318
+ *user-select: none;
319
+ over: hidden;
320
+ b: 0px solid hsl(@color, @layer-border);
321
+ bg.c: hsl(@active, @layer-container);
322
+ r: @base-radius;
323
+
324
+ ! &:focus-within {
325
+ @active: @color;
326
+ }
327
+
328
+ ! &:has(:not(button):disabled) {
329
+ *filter: saturate(50%) brightness(0.7);
330
+ }
331
+
332
+ ! & > :is(input, select, ws-select, textarea) {
333
+ area: control;
334
+ b.w: 0px;
335
+ @color: inherit;
336
+ ! &:focus {
337
+ outln: none;
338
+ }
339
+ }
340
+
341
+ ! & > :where(input, textarea) {
342
+ t.c: @text-color-normal;
343
+ h.min: 28px;
344
+ w: 100%;
345
+ h: 100%;
346
+ p: 4px;
347
+ bg.c: transparent;
348
+ w.min: 16px;
349
+ }
350
+
351
+ ! & > :where(input[type="file"]) {
352
+ pos: relative;
353
+ p: 0px;
354
+
355
+ ! &::file-selector-button {
356
+ font: @font;
357
+ h: 100%;
358
+ m: 0px;
359
+ m.r: 4px;
360
+ p: 4px;
361
+ t.c: @text-color-normal;
362
+ bg.c: transparent;
363
+ b.w: 0px;
364
+ t.deco: underline;
365
+ }
366
+ }
367
+
368
+ ! & > [label-text] {
369
+ area: label;
370
+ p: 4px;
371
+ disp: flex;
372
+ fl.dir: column;
373
+ fl.cross: start;
374
+ t.c: hsl(@color, @layer-element);
375
+ t.ws: nowrap;
376
+ t.sz: @text-size-normal;
377
+ }
378
+ `,m("caret-right-filled"),p(":where(details[data-ws])")`
379
+ @color: @primary;
380
+ @padding: 8px;
381
+
382
+ ${E("@layer-element","@layer-fill")}
383
+
384
+ b: 0px solid @core-color;
385
+ p: 0px @padding;
386
+ r: 4px;
387
+ over: hidden;
388
+
389
+ ! &:open {
390
+ p.b: @padding;
391
+ }
392
+
393
+ ! & > summary {
394
+ t.c: @core-color;
395
+ pos: relative;
396
+ p: 4px;
397
+ p.l: 24px;
398
+ m.x: calc(-1 * @padding);
399
+ cur: pointer;
400
+ *user-select: none;
401
+
402
+ ! &::before {
403
+ pos: absolute;
404
+ x: 0px;
405
+ y: 50%;
406
+ -y: 0px;
407
+ w: 1em;
408
+ disp: flex;
409
+ fl.cross: center;
410
+ fl.main: center;
411
+ font: ws-icon-caret-right-filled;
412
+ *speak: none;
413
+ t.st: normal;
414
+ t.wt: 400;
415
+ t.var: normal;
416
+ t.tf: none;
417
+ *content: "caret-right-filled";
418
+ tf: translateY(-50%);
419
+ tr: transform 100ms linear;
420
+ w: 24px;
421
+ h: 24px;
422
+ t.lh: 24px;
423
+ t.sz: 18px;
424
+ }
425
+
426
+ ! &::marker, &::-webkit-details-marker {
427
+ *content: "";
428
+ disp: none;
429
+ }
430
+ }
431
+ ! &:open > summary::before {
432
+ tf: translateY(-50%) rotate(90deg);
433
+ }
434
+ `,p("ws-dialog")`
435
+ pos: absolute;
436
+ x: 50%;
437
+ y: 50%;
438
+ tf: translate(-50%, -50%);
439
+ o: 0;
440
+ tr: opacity @anim-time linear;
441
+
442
+ ! ws-modal[open] > & {
443
+ o: 1;
444
+ }
445
+ `,p("ws-drawer")`
446
+ pos: absolute;
447
+ x: 0px;
448
+ y: 0px;
449
+ -y: 0px;
450
+ tf: translateX(-100%);
451
+ tr: transform @anim-time linear;
452
+ disp: grid;
453
+
454
+ ! ws-modal[open] > & {
455
+ tf: translateX(0%);
456
+ }
457
+ `,p("ws-flex")`
458
+ disp: flex;
459
+ fl.dir: column;
460
+ gap: 8px;
461
+ p: 4px;
462
+ over: hidden;
463
+
464
+ ! & > * {
465
+ fl.shrink: 0;
466
+ }
467
+ `,p("ws-grid")`
468
+ disp: grid;
469
+ over: hidden;
470
+ gap: 8px;
471
+ p: 4px;
472
+ gr.rows.a: min-content;
473
+ `,p("ws-icon")`
474
+ disp: var(--icon-font, none);
475
+ t.lh: 1;
476
+ ! &::before {
477
+ disp: inline-block;
478
+ font: @icon-font;
479
+ *-webkit-font-smoothing: antialiased;
480
+ *-moz-osx-font-smoothing: grayscale;
481
+ *content: attr(data-icon);
482
+ m.t: 2px;
483
+ }
484
+ `,p("a[data-ws]:not([button])")`
485
+ @color: @primary;
486
+
487
+ t.c: hsl(@color, @layer-element);
488
+
489
+ ! &:visited, &:hover {
490
+ t.c: hsl(@color, @layer-element);
491
+ }
492
+
493
+ ! &[disabled] {
494
+ *pointer-events: none;
495
+ *filter: saturation(30%) brightness(0.7);
496
+ }
497
+ `;const M=z`
498
+ <style>
499
+ :host {
500
+ position: fixed;
501
+ top: 0px;
502
+ left: 0px;
503
+ width: 100vw;
504
+ height: 100vh;
505
+ background-color: var(--modal-color);
506
+ z-index: var(--z-cover);
507
+ transition: visibility linear var(--anim-time, 0ms);
508
+ }
509
+ ws-modal-overlay {
510
+ position: absolute;
511
+ inset: 0px;
512
+ }
513
+ ws-modal-overlay:focus {
514
+ outline: none;
515
+ }
516
+ :host(:not([open])) {
517
+ visibility: hidden;
518
+ }
519
+ :host([clear]) {
520
+ background-color: transparent;
521
+ }
522
+ </style>
523
+
524
+ <ws-modal-overlay>
525
+ </ws-modal-overlay>
526
+ <slot></slot>
527
+ `;customElements.define("ws-modal",class extends HTMLElement{#e=null;constructor(){super(),this.#e=this.attachShadow({mode:"closed",delegatesFocus:!0}),this.#e.append(M())}connectedCallback(){window.addEventListener("keydown",(e=>{!0!==(!1===this.open||"Escape"!==e.key||!0===this.persistent)&&(this.hide(),this.dispatchEvent(new Event("close")))}));this.#e.querySelector("ws-modal-overlay").addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),!0!==this.persistent&&(this.hide(),this.dispatchEvent(new Event("close")))}))}get open(){return this.hasAttribute("open")}set open(e){!1!==e?this.setAttribute("open",""):this.removeAttribute("open")}get persistent(){return this.hasAttribute("persistent")}set persistent(e){!1!==e?this.setAttribute("persistent",""):this.removeAttribute("persistent")}show(){this.open=!0}hide(){this.open=!1}}),p("ws-paper")`
528
+ @color: @mono;
529
+
530
+ ${E("@layer-surface","@layer-border")}
531
+
532
+ disp: grid;
533
+ r: @base-radius;
534
+ over: hidden;
535
+ gr.cols: 1fr;
536
+ gr.rows: min-content auto min-content;
537
+ gr.areas: "header" "content" "footer";
538
+ bg.c: @core-color;
539
+ b.c: @alt-color;
540
+
541
+ ! & > :where(*) {
542
+ area: content;
543
+ }
544
+
545
+ ! &::before {
546
+ *content: "";
547
+ area: header;
548
+ }
549
+ ! &::after {
550
+ *content: "";
551
+ area: footer;
552
+ }
553
+ `;const q=z`
554
+ <style>
555
+ :host {
556
+ --anim-time: 0ms;
557
+ }
558
+ </style>
559
+ <slot></slot>
560
+
561
+ <ws-modal>
562
+ <ws-popover-position>
563
+ <slot name="popover"></slot>
564
+ </ws-popover-position>
565
+ </ws-modal>
566
+ `;customElements.define("ws-popover",class extends HTMLElement{static observedAttributes=["open","persistent"];#e=null;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:"closed",delegatesFocus:!0}),this.#e.append(q()),this.#t=this.#e.querySelector("ws-modal")}connectedCallback(){this.#t.addEventListener("close",(()=>{this.hide(),this.dispatchEvent(new Event("close"))})),this.#t.addEventListener("click",(e=>e.stopPropagation())),!1!==this.open&&(this.#t.open=this.open,this.setVars())}attributeChangedCallback(e,t,r){null!==r?(this.#t[e]=!0,"open"===e&&this.setVars()):this.#t[e]=!1}setVars(){const e=(this.sizeTarget??this).getBoundingClientRect();this.style.setProperty("--x",`${e.x}px`),this.style.setProperty("--y",`${e.y}px`),this.style.setProperty("--w",`${e.width}px`),this.style.setProperty("--h",`${e.height}px`)}get open(){return this.hasAttribute("open")}set open(e){this.#t.open=e,!1!==e?this.setAttribute("open",""):this.removeAttribute("open")}get persistent(){return this.hasAttribute("persistent")}set persistent(e){this.#t.persistent=e,!1!==e?this.setAttribute("persistent",""):this.removeAttribute("persistent")}show(){this.open=!0,this.focus()}hide(){this.open=!1}});const V=z`
567
+ <style>
568
+ @keyframes busy-load {
569
+ from {
570
+ transform: translateX(-100%);
571
+ }
572
+ to {
573
+ transform: translateX(400%);
574
+ }
575
+ }
576
+ :host {
577
+ display: block;
578
+ height: 8px;
579
+ border-radius: var(--base-radius);
580
+ background-color: hsl(var(--mono), var(--layer-border));
581
+ position: relative;
582
+ overflow: hidden;
583
+ --color: var(--mono);
584
+ }
585
+ div::before, div::after {
586
+ content: "";
587
+ position: absolute;
588
+ top: 0px;
589
+ left: 0px;
590
+ height: 100%;
591
+ --range: calc(var(--max, 1) - var(--min, 0));
592
+ --bar-width: calc(100% * var(--value, 0) / var(--range));
593
+ --buffer-width: calc(100% * var(--buffer, 0) / var(--range));
594
+ }
595
+ div::before {
596
+ background-color: hsl(var(--color), var(--layer-element));
597
+ }
598
+ div::after {
599
+ opacity: 0.3;
600
+ background-color: hsl(var(--color), var(--layer-element));
601
+ }
602
+ :host(:not([busy])) div::before {
603
+ width: var(--bar-width);
604
+ }
605
+ :host(:not([busy])) div::after {
606
+ width: var(--buffer-width);
607
+ }
608
+ :host([busy]) div::before {
609
+ width: 25%;
610
+ animation-name: busy-load;
611
+ animation-iteration-count: infinite;
612
+ animation-duration: 2s;
613
+ }
614
+ </style>
615
+
616
+ <div></div>
617
+ `;customElements.define("ws-progress",class extends HTMLElement{static observedAttributes=["min","max","value","buffer"];#r=null;constructor(){super();const e=this.attachShadow({mode:"closed"});e.append(V()),this.#r=e.querySelector("div")}get value(){return parseFloat(this.getAttribute("value")??"0")}get buffer(){return parseFloat(this.getAttribute("buffer")??"0")}get min(){return parseFloat(this.getAttribute("min")??"0")}get max(){return parseFloat(this.getAttribute("max")??"1")}get busy(){return this.hasAttribute("busy")}set value(e){!1===e&&this.removeAttribute("value"),this.setAttribute("value","")}set buffer(e){!1===e&&this.removeAttribute("buffer"),this.setAttribute("buffer","")}set min(e){!1===e&&this.removeAttribute("min"),this.setAttribute("min","")}set max(e){!1===e&&this.removeAttribute("max"),this.setAttribute("max","")}set busy(e){!1===e&&this.removeAttribute("busy"),this.setAttribute("busy","")}#o(e,t){this.#r.style.setProperty(`--${e}`,this.getAttribute(e)||t)}connectedCallback(){this.#o("value","0"),this.#o("buffer","0"),this.#o("min","0"),this.#o("max","1")}attributeChangedCallback(e,t,r){this.#o(e,r)}}),p("ws-screen")`
618
+ @screen-width: min(720px, 100%);
619
+ @pad-x: auto;
620
+ @pad-y: auto;
621
+ @pad-left: var(--pad-x, auto);
622
+ @pad-right: var(--pad-x, auto);
623
+ @pad-top: var(--pad-y, auto);
624
+ @pad-bottom: var(--pad-y, auto);
625
+
626
+ disp: grid;
627
+ h: round(down, calc(100% - @sub-pixel-offset), 1px);
628
+ w: calc(100%);
629
+ over: hidden;
630
+ pos: absolute;
631
+ y: 0px;
632
+ x: 0px;
633
+ gr.cols: @pad-left @screen-width @pad-right;
634
+ gr.rows: @pad-top 1fr @pad-bottom;
635
+ gr.areas:
636
+ "tl t tr"
637
+ "l content r"
638
+ "bl b br"
639
+ ;
640
+
641
+ ! & > :where(*) {
642
+ area: content;
643
+ }
644
+ `;const C="caret-down-filled";m(C),p("ws-option")`
645
+ ${E("@layer-element","@layer-fill")}
646
+
647
+ disp: block;
648
+ p: 8px;
649
+ *pointer-events: auto;
650
+ t.c: @text-color-normal;
651
+ w.min: fit-content;
652
+
653
+ ! &[selected] {
654
+ bg.c: @core-color;
655
+ t.c: @alt-color;
656
+ }
657
+
658
+ ! & * {
659
+ *pointer-events: none;
660
+ }
661
+
662
+ ${S}
663
+ ${L}
664
+ `,p("ws-optgroup")`
665
+ grid;
666
+ gr.cols: 16px 1fr;
667
+ *pointer-events: none;
668
+
669
+ ! &::before {
670
+ *content: attr(label);
671
+ disp: block;
672
+ p: 8px;
673
+ col: 1 / -1;
674
+ bg.c: hsl(@color, @layer-container);
675
+ }
676
+
677
+ ! & > * {
678
+ col: 2;
679
+ }
680
+ `;const I=z`
681
+ <style>
682
+ :host {
683
+ --color: var(--mono);
684
+ --modal-color: transparent;
685
+ --max-height: 200px;
686
+ --core-color: hsl(var(--color), var(--layer-border));
687
+ --alt-color: hsl(var(--color), var(--layer-surface));
688
+ display: inline-grid;
689
+ grid-template-rows: 1fr 0px;
690
+ user-select: none;
691
+ cursor: default;
692
+ position: relative;
693
+ border: 1px solid var(--core-color);
694
+ border-radius: var(--base-radius);
695
+ padding: 4px;
696
+ }
697
+
698
+ slot[name=options] {
699
+ display: block;
700
+ overflow: visible;
701
+ }
702
+ ws-options {
703
+ box-sizing: border-box;
704
+ border: 1px solid var(--core-color);
705
+ border-radius: var(--base-radius);
706
+ display: grid;
707
+ position: absolute;
708
+ max-height: var(--max-height);
709
+ overflow: auto;
710
+ background-color: var(--alt-color);
711
+ grid-template-columns: 1fr;
712
+ border-radius: var(--base-radius);
713
+ box-shadow: 0px 2px 4px var(--shadow-color);
714
+ /* visibility: none; */
715
+ opacity: 0;
716
+ transform: translateY(10px);
717
+ transition:
718
+ /* visibility var(--anim-time) linear, */
719
+ opacity var(--anim-time) linear,
720
+ transform var(--anim-time) linear
721
+ ;
722
+ }
723
+ :host([open]) ws-options {
724
+ transform: translateY(0);
725
+ opacity: 1;
726
+ visibility: visible;
727
+ }
728
+ ws-options {
729
+ top: calc(var(--y) + var(--h));
730
+ left: var(--x);
731
+ width: var(--w);
732
+ transform-origin: top center;
733
+ }
734
+ :host([direction="up"]) ws-options {
735
+ top: unset;
736
+ bottom: calc(100% - var(--y));
737
+ transform-origin: bottom center;
738
+ }
739
+
740
+ value-display {
741
+ display: grid;
742
+ user-select: none;
743
+ grid-template-columns: 1fr min-content;
744
+ height: 100%;
745
+ }
746
+ value-display:focus {
747
+ outline: none;
748
+ }
749
+ ws-sel-caret {
750
+ display: flex;
751
+ align-items: center;
752
+ justify-content: center;
753
+ padding: 4px;
754
+ padding-right: 0px;
755
+ width: 24px;
756
+ }
757
+ ws-sel-caret::before {
758
+ display: block;
759
+ font-family: ws-icon-${C};
760
+ content: attr(data-icon);
761
+ }
762
+ slot[name="selected"] {
763
+ display: flex;
764
+ align-items: center;
765
+ }
766
+ :host(:focus:not(:disabled)) {
767
+ outline-style: auto;
768
+ outline-width: 1px;
769
+ }
770
+
771
+ ws-popover {
772
+ --anim-time: unset;
773
+ }
774
+
775
+ :host(:disabled) {
776
+ filter: saturate(50%) brightness(0.8);
777
+ }
778
+ </style>
779
+
780
+ <value-display tabindex="0">
781
+ <slot name="selected">
782
+ <ws-selected>No Selection</ws-selected>
783
+ </slot>
784
+ <ws-sel-caret data-icon="${C}"></ws-sel-caret>
785
+ </value-display>
786
+ <ws-popover>
787
+ <slot slot="popover" name="options">
788
+ <ws-options>
789
+ <slot></slot>
790
+ </ws-options>
791
+ </slot>
792
+ </ws-popover>
793
+ `,T="ws-option";customElements.define(T,class extends HTMLElement{#a=null;get value(){return this.#a}set value(e){this.#a=e;const t=this.parentNode;null!==t&&t.value===e&&t.__childValueMatch?.(this)}}),customElements.define("ws-select",class extends HTMLElement{static formAssociated=!0;#a=null;#n=-1;#s=null;#i=null;#l=null;#c=null;#e=null;#d=null;#p(){return[...this.querySelectorAll(T)]}#h(e){const t=Array.from(e,(e=>[...e.addedNodes])).flat();if(!1===t.some((e=>e.tagName?.toLowerCase()===T)))return;const r=t.findLast((e=>e.tagName?.toLowerCase()===T&&!0===e.hasAttribute("selected")))??this.#s,o=this.#p();for(const e of o)e.removeAttribute("selected");this.selectedIndex=o.indexOf(r)}constructor(){super(),this.#e=this.attachShadow({mode:"closed",delegatesFocus:!0}),this.#e.append(I()),this.#c=this.#e.querySelector("ws-selected"),this.#l=this.#e.querySelector("ws-popover"),this.#d=this.#e.querySelector("value-display"),this.#l.sizeTarget=this,this.removeAttribute("open")}connectedCallback(){this.tabIndex=this.getAttribute("tabindex")??"0";const e=new MutationObserver(this.#h.bind(this));e.observe(this,{childList:!0,subtree:!0}),this.#i=e,this.role="combobox",this.addEventListener("click",(()=>{this.open(),this.#d.focus()}),{passive:!0}),this.#l.addEventListener("close",(()=>this.close())),this.#l.addEventListener("pointerdown",(e=>e.preventDefault())),this.#l.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),this.#e.querySelector("slot[name='options']").addEventListener("pointerdown",(e=>e.preventDefault())),this.#e.querySelector("slot[name='options']").addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=e.target.tagName?.toLowerCase();"ws-option"===t&&(this.selectedIndex=this.#p().indexOf(e.target),this.close(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new Event("input",{bubbles:!0})))}))}disconnectedCallback(){this.#i.disconnect()}get value(){return this.#a}set value(e){this.#a=e;const t=this.#p(),r=t.find((t=>t.value===e||t.getAttribute("value")===e));this.selectedIndex=t.indexOf(r)}get selectedIndex(){return this.#n}set selectedIndex(e){this.#s?.removeAttribute("selected");const t=this.#p(),r=Math.min(e,t.length);this.#s=t[r]??null,this.#n=r,this.#s?.setAttribute("selected",""),this.#a=this.#s?.value??this.#s?.getAttribute("value")??this.#a;(this.querySelector("[slot=selected] ws-selected")??this.#c).innerHTML=this.#s?.getAttribute("preview")??this.#s?.innerHTML??this.getAttribute("blank")??"No Selection"}toggle(){null!==this.getAttribute("open")?this.close():this.open()}open(){this.setAttribute("open",""),this.#l.show();(this.querySelector("ws-options")??this.#e.querySelector("ws-options")).scrollTop=0,this.#s?.scrollIntoView()}close(){this.removeAttribute("open"),this.#l.hide()}__childValueMatch(e){const t=this.#p().indexOf(e);this.selectedIndex=t}}),p("table[data-ws]")`
794
+ @color: @primary;
795
+
796
+ *border-collapse: separate;
797
+ *border-spacing: 0px;
798
+
799
+ b.s: solid;
800
+ b.c: hsl(@color, @layer-border);
801
+ b.b.w: 1px;
802
+
803
+ ! & th {
804
+ bg.c: hsl(@color, @layer-container);
805
+ }
806
+ ! & :is(th, td:not(:empty)) {
807
+ b.s: solid;
808
+ b.c: hsl(@color, @layer-border);
809
+ b.b.w: 1px;
810
+ p: 4px;
811
+ }
812
+ ! & tbody tr:last-child :is(td, th) {
813
+ b.b.w: 0px;
814
+ }
815
+ ! &[sticky-header] thead {
816
+ pos.stick;
817
+ y: 0px;
818
+ z: +2;
819
+ }
820
+ ! &[sticky-header] th:first-child {
821
+ pos.stick;
822
+ z: +1;
823
+ x: 0px;
824
+ -x: 0px;
825
+ }
826
+ `,p("ws-text")`
827
+ ! &[title] {
828
+ t.sz: @text-size-title;
829
+ disp: flex;
830
+ fl.dir: column;
831
+ p: 0px 8px;
832
+ fl.cross: start;
833
+ fl.main: center;
834
+ }
835
+ ! &[header] {
836
+ t.sz: @text-size-header;
837
+ disp: flex;
838
+ fl.dir: column;
839
+ p: 0px 8px;
840
+ fl.cross: start;
841
+ fl.main: center;
842
+ }
843
+ ! &[subtitle] {
844
+ disp: inline-block;
845
+ t.sz: @text-size-subtitle;
846
+ p: 0px 8px;
847
+ }
848
+ ! &[info] {
849
+ disp: inline-block;
850
+ t.sz: @text-size-info;
851
+ }
852
+ `,p("ws-tabs")`
853
+ @color: @primary;
854
+
855
+ ${E("@layer-element","@layer-fill")}
856
+
857
+ disp: grid;
858
+ gr.cols.a: 1fr;
859
+ gr.rows.a: 1fr;
860
+ gr.flow: column;
861
+ *user-select: none;
862
+ gap: 4px;
863
+ `,p("label[tab]")`
864
+ @fill: transparent;
865
+ @text: @core-color;
866
+ @active: @core-color;
867
+
868
+ bg.c: @fill;
869
+ t.c: @text;
870
+
871
+ grid;
872
+ gr.cols: 1fr;
873
+ gr.rows: min-content 2px;
874
+ gr.areas: "content" "border";
875
+ pos: relative;
876
+
877
+ ! & > input[type="radio"] {
878
+ hide;
879
+ }
880
+
881
+ ! & > :where(*) {
882
+ area: content;
883
+ flex;
884
+ fl.cn;
885
+ p: 8px;
886
+ }
887
+
888
+ ! &::before {
889
+ *content: "";
890
+ pos: absolute;
891
+ -y: 0px;
892
+ x: 0px;
893
+ w: 100%;
894
+ h: 2px;
895
+ area: border;
896
+ }
897
+
898
+ ! &:has(input[type="radio"]:checked) {
899
+ @fill: var(--fill-color, transparent);
900
+ @text: var(--text-color, @core-color);
901
+ @active: unset;
902
+ ! &::before {
903
+ bg.c: @core-color;
904
+ }
905
+ }
906
+
907
+ ${L}
908
+ `,p("ws-titlebar")`
909
+ @border-size: 2px;
910
+ @color: @primary;
911
+
912
+ ${E("@layer-element","@layer-fill")}
913
+
914
+ disp: grid;
915
+ h.min: 52px;
916
+ gr.cols: auto 1fr auto;
917
+ gr.areas: "menu title action";
918
+ *user-select: none;
919
+ pos: relative;
920
+ p: 0px 2px;
921
+
922
+ t.c: @text;
923
+ bg.c: @fill;
924
+
925
+ b.y: @border-size solid @core-color;
926
+
927
+ ! & > :where(*) {
928
+ area: title;
929
+ }
930
+ `,p("ws-toast")`
931
+ @color: @primary;
932
+
933
+ t.c: @page-text-color;
934
+ bg.c: hsl(@color, @layer-surface);
935
+
936
+ pos: relative;
937
+ disp: inline-grid;
938
+ gr.cols: auto 1fr auto;
939
+ gr.areas: "start content end";
940
+ r: @base-radius;
941
+ *user-select: none;
942
+ b: 2px solid hsl(@color, @layer-element);
943
+ h.min: 32px;
944
+ z: +0;
945
+
946
+ ! & > :where(*) {
947
+ area: content;
948
+ }
949
+ ! &::before, &::after {
950
+ *content: "";
951
+ w.min: 20px;
952
+ bg.c: hsl(@color, @layer-element);
953
+ z: -1;
954
+ }
955
+ ! &::before {
956
+ area: start;
957
+ }
958
+ ! &::after {
959
+ area: end;
960
+ }
961
+
962
+ ! & > [notif-text] {
963
+ disp: flex;
964
+ fl.dir: column;
965
+ fl.main: center;
966
+ p: 4px;
967
+ }
968
+
969
+ ! & > :not([notif-text]) {
970
+ t.c: hsl(@mono, @layer-fill);
971
+ @color: inherit;
972
+ variant.fill;
973
+ }
974
+ `,p("ws-toaster")`
975
+ pos: fixed;
976
+ z: var(--z-notif);
977
+ disp: grid;
978
+ gr.cols: fr;
979
+ p: 0px;
980
+ gap: 8px;
981
+ h: min-content;
982
+ w: 280px;
983
+
984
+ ! &[pos^="top-"] {
985
+ y: 20px;
986
+ }
987
+ ! &[pos^="center-"] {
988
+ y: 50%;
989
+ tf: translateY(-50%);
990
+ }
991
+ ! &[pos^="bottom-"] {
992
+ -y: 20px;
993
+ }
994
+
995
+ ! &[pos$="-left"] {
996
+ x: 20px;
997
+ }
998
+ ! &[pos$="-center"] {
999
+ x: 50%;
1000
+ tf: translateX(-50%);
1001
+ }
1002
+ ! &[pos$="-right"] {
1003
+ -x: 20px;
1004
+ }
1005
+ `,m("square-dashed","square-check-filled","circle","circle-check-filled","circle-filled");const j='\n @color: var(--toggle-color, @primary);\n @size: 20px;\n\n @core-color: hsl(@color, @layer-element);\n\n pos: relative;\n w: @size;\n h: @size;\n appr: none;\n m: 0px;\n t.c: @core-color;\n v.a: middle;\n\n ! &::after {\n *content: "";\n pos: absolute;\n t.sz: calc(@size - 2px);\n *speak: none;\n t.st: normal;\n t.wt: 400;\n t.var: normal;\n t.tf: none;\n y: 50%;\n x: 50%;\n w: @size;\n h: @size;\n tf: translate(-50%, -50%);\n disp: flex;\n fl.cross: center;\n fl.main: center;\n over: hidden;\n }\n';p(":where(input[data-ws][type=checkbox]:not([switch]))")`
1006
+ ${j}
1007
+
1008
+ ! &::after {
1009
+ font: ws-icon-square-dashed;
1010
+ *content: "square-dashed";
1011
+ }
1012
+ ! &:checked::after {
1013
+ font: ws-icon-square-check-filled;
1014
+ *content: "square-check-filled";
1015
+ }
1016
+ `,p(":where(input[data-ws][type=radio])")`
1017
+ ${j}
1018
+
1019
+ ! &::after {
1020
+ font: ws-icon-circle;
1021
+ *content: "circle";
1022
+ }
1023
+ ! &:checked::after {
1024
+ font: ws-icon-circle-check-filled;
1025
+ *content: "circle-check-filled";
1026
+ }
1027
+ `,p(":where(input[data-ws][type=checkbox][switch])")`
1028
+ @color: @primary;
1029
+ @size: 20px;
1030
+ @anim-time: 100ms;
1031
+
1032
+ appr: none;
1033
+ m: 0px;
1034
+ pos: relative;
1035
+ w: calc(@size * 2);
1036
+ h: @size;
1037
+ v.a: middle;
1038
+
1039
+ ! &::before {
1040
+ *content: "";
1041
+ pos: absolute;
1042
+ inset: calc(@size / 4);
1043
+ b: 1px solid @color;
1044
+ r: calc(@size / 2);
1045
+ bg.c: hsl(@color, @layer-border);
1046
+ o: 0.5;
1047
+ tr: background-color @anim-time linear;
1048
+ }
1049
+ ! &:checked::before {
1050
+ bg.c: hsl(@color, @layer-border);
1051
+ }
1052
+
1053
+ ! &::after {
1054
+ *content: "";
1055
+ pos: absolute;
1056
+ w: @size;
1057
+ h: @size;
1058
+ y: 0px;
1059
+ x: 0px;
1060
+ tr: left @anim-time linear, background-color @anim-time linear;
1061
+ bg.c: hsl(@mono, @layer-text);
1062
+ r: @size;
1063
+ }
1064
+ ! &:checked::after {
1065
+ x: @size;
1066
+ bg.c: hsl(@color, @layer-element);
1067
+ }
1068
+ `,p("label[data-ws][toggle]")`
1069
+ @color: @primary;
1070
+ @active: @mono;
1071
+
1072
+ pos: relative;
1073
+ *user-select: none;
1074
+ over: hidden;
1075
+ b: 0px solid hsl(@color, @layer-border);
1076
+ bg.c: hsl(@active, @layer-container);
1077
+ r: @base-radius;
1078
+ p: 4px;
1079
+
1080
+ disp: flex;
1081
+ fl.main: space-between;
1082
+
1083
+ ! &:focus-within {
1084
+ @active: @color;
1085
+ }
1086
+
1087
+ ! & > input {
1088
+ @color: inherit;
1089
+ ! &:focus {
1090
+ outln: none;
1091
+ }
1092
+ }
1093
+
1094
+ ! &:has(:not(button):disabled) {
1095
+ *filter: saturate(50%) brightness(0.7);
1096
+ }
1097
+ `,p("ws-tooltip")`
1098
+ @color: @mono;
1099
+
1100
+ pos.rel;
1101
+ disp: inline-grid;
1102
+
1103
+ ! &[pos]:hover::before {
1104
+ *content: attr(text);
1105
+ pos.abs;
1106
+ p: 4px;
1107
+ bg.c: hsl(@color, @layer-container);
1108
+ b: 1px solid hsl(@color, @layer-border);
1109
+ t.ws: nowrap;
1110
+ r: 4px;
1111
+ z: +1;
1112
+ }
1113
+
1114
+ ! &[pos="top"]:hover::before {
1115
+ -y: calc(100% + 8px);
1116
+ x: 50%;
1117
+ tf: translateX(-50%);
1118
+ }
1119
+ ! &[pos="bottom"]:hover::before {
1120
+ y: calc(100% + 8px);
1121
+ x: 50%;
1122
+ tf: translateX(-50%);
1123
+ }
1124
+ ! &[pos="left"]:hover::before {
1125
+ -x: calc(100% + 8px);
1126
+ y: 50%;
1127
+ tf: translateY(-50%);
1128
+ }
1129
+ ! &[pos="right"]:hover::before {
1130
+ x: calc(100% + 8px);
1131
+ y: 50%;
1132
+ tf: translateY(-50%);
1133
+ }
1134
+ `,p("*")`
1135
+ *box-sizing: border-box;
1136
+ *-webkit-tap-highlight-color: transparent;
1137
+ *border-width: 0px;
1138
+ *border-style: solid;
1139
+ *outline-color: hsl(@mono, @layer-text);
1140
+ `,p("html, body")`
1141
+ *padding: 0px;
1142
+ *margin: 0px;
1143
+ *width: 100%;
1144
+ *height: 100%;
1145
+ *-webkit-tap-highlight-color: transparent;
1146
+ *-webkit-font-smoothing: antialiased;
1147
+ `,p("@font-face",null)`
1148
+ *font-family: Tektur;
1149
+ *font-display: swap;
1150
+ *src:
1151
+ url(${h.origin}/font/tektur.woff2?v${h.version})
1152
+ format("woff2")
1153
+ ;
1154
+ `,p("@font-face",null)`
1155
+ *font-family: Roboto;
1156
+ *font-display: swap;
1157
+ *src:
1158
+ url(${h.origin}/font/roboto.woff2?v${h.version})
1159
+ format("woff2")
1160
+ ;
1161
+ `;const N=e=>{const t=(e=>{if(""===e||null===e)return;const t=d(a({raw:[e]})),r=x(t.join("\n"));if(v[r]=(v[r]??0)+1,v[r]>1)return r;const n=t.map((e=>e.replaceAll("&",`[data-wsid="${r}"]`)));return o.sheet.insertRule(`@layer ws.macro { ${n.join("\n")} }`,o.sheet.cssRules.length),r})(e.dataset?.ws??"");void 0!==t?e.dataset.wsid=t:delete e.dataset?.wsid};new MutationObserver((e=>{const t=new Set(Array.from(e,(e=>[e.target,...Array.from(e.addedNodes,(e=>[e,...e.querySelectorAll?.("*")||[]]))])).flat(3));for(const e of t)N(e)})).observe(document.body,{subtree:!0,attributes:!0,childList:!0,attributeFilter:["data-ws"]});for(const e of document.querySelectorAll("*"))N(e);return e.component=p,e.localMacro=(e,...t)=>{const r=x(`${Date.now()}:${Math.random().toString(16)}`);return c(r)(e,...t)},e.macro=c,e.preloadIcons=m,e.version=y,e.x=w,e}({});