mirror of
https://github.com/SupertigerDev/waybar-online.git
synced 2026-03-24 16:06:37 +00:00
3 lines
9.2 KiB
JavaScript
3 lines
9.2 KiB
JavaScript
|
|
function _(e){Object.defineProperty(e,"__esModule",{value:!0,configurable:!0})}function A(e,c,a,o){Object.defineProperty(e,c,{get:a,set:o,enumerable:!0,configurable:!0})}var R={};_(R);A(R,"default",()=>U);class U extends Error{constructor(c,a,o,m,s){super(c+":"+o+":"+m+": "+a),this.reason=a,this.filename=c,this.line=o,this.column=m,this.source=s}}var z={};_(z);A(z,"default",()=>H);class H{constructor(c,a,o){this.start=c,this.end=a,this.source=o}}var oe={};A(oe,"CssTypes",()=>$);var $=function(e){return e.stylesheet="stylesheet",e.rule="rule",e.declaration="declaration",e.comment="comment",e.container="container",e.charset="charset",e.document="document",e.customMedia="custom-media",e.fontFace="font-face",e.host="host",e.import="import",e.keyframes="keyframes",e.keyframe="keyframe",e.layer="layer",e.media="media",e.namespace="namespace",e.page="page",e.startingStyle="starting-style",e.supports="supports",e}({});const Q=1e4,N=(e,c,a)=>{let o=a,m=Q;do{const s=c.map(g=>e.indexOf(g,o));s.push(e.indexOf("\\",o));const h=s.filter(g=>g!==-1);if(h.length===0)return-1;const r=Math.min(...h);if(e[r]==="\\")o=r+2,m--;else return r}while(m>0);throw new Error("Too many escaping")},E=(e,c,a)=>{let o=a,m=Q;do{const s=c.map(i=>e.indexOf(i,o));s.push(e.indexOf("(",o)),s.push(e.indexOf('"',o)),s.push(e.indexOf("'",o)),s.push(e.indexOf("\\",o));const h=s.filter(i=>i!==-1);if(h.length===0)return-1;const r=Math.min(...h);switch(e[r]){case"\\":o=r+2;break;case"(":{const i=E(e,[")"],r+1);if(i===-1)return-1;o=i+1}break;case'"':{const i=N(e,['"'],r+1);if(i===-1)return-1;o=i+1}break;case"'":{const i=N(e,["'"],r+1);if(i===-1)return-1;o=i+1}break;default:return r}m--}while(m>0);throw new Error("Too many escaping")},ce=(e,c)=>{const a=[];let o=0;for(;o<e.length;){const m=E(e,c,o);if(m===-1)return a.push(e.substring(o)),a;a.push(e.substring(o,m)),o=m+1}return a},L=/\/\*[^]*?(?:\*\/|$)/g,se=(e,c)=>{c=c||{};let a=1,o=1;function m(n){const t=n.match(/\n/g);t&&(a+=t.length);const u=n.lastIndexOf(`
|
||
|
|
`);o=~u?n.length-u:o+n.length}function s(){const n={line:a,column:o};return function(t){return t.position=new H(n,{line:a,column:o},c?.source||""),w(),t}}const h=[];function r(n){const t=new U(c?.source||"",n,a,o,e);if(c?.silent)h.push(t);else throw t}function g(){const n=y();return{type:$.stylesheet,stylesheet:{source:c?.source,rules:n,parsingErrors:h}}}function i(){const n=/^{\s*/.exec(e);return n?(l(n),!0):!1}function d(){const n=/^}/.exec(e);return n?(l(n),!0):!1}function y(){let n;const t=[];for(w(),p(t);e.length&&e.charAt(0)!=="}"&&(n=ne()||re());)n&&(t.push(n),p(t));return t}function l(n){const t=n[0];return m(t),e=e.slice(t.length),n}function w(){const n=/^\s*/.exec(e);n&&l(n)}function p(n){let t;for(n=n||[];t=V();)t&&n.push(t);return n}function V(){const n=s();if(e.charAt(0)!=="/"||e.charAt(1)!=="*")return;const t=/^\/\*[^]*?\*\//.exec(e);return t?(l(t),n({type:$.comment,comment:t[0].slice(2,-2)})):r("End of comment missing")}function S(){const n=/^([^{]+)/.exec(e);if(!n)return;l(n);const t=b(n[0]).replace(L,"");return ce(t,[","]).map(u=>b(u))}function k(){const n=s(),t=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!t)return;l(t);const u=b(t[0]),f=/^:\s*/.exec(e);if(!f)return r("property missing ':'");l(f);let x="";const v=E(e,[";","}"]);v!==-1&&(x=e.substring(0,v),l([x]),x=b(x).replace(L,""));const M=n({type:$.declaration,property:u.replace(L,""),value:x}),F=/^[;\s]*/.exec(e);return F&&l(F),M}function I(){const n=[];if(!i())return r("missing '{'");p(n);let t;for(;t=k();)t&&(n.push(t),p(n));return d()?n:r("missing '}'")}function j(){let n;const t=[],u=s();for(;n=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);){const f=l(n);t.push(f[1]);const x=/^,\s*/.exec(e);x&&l(x)}if(t.length)return u({type:$.keyframe,values:t,declarations:I()||[]})}function B(){const n=s(),t=/^@([-\w]+)?keyframes\s*/.exec(e);if(!t)return;const u=l(t)[1],f=/^([-\w]+)\s*/.exec(e);if(!f)return r("@keyframes missing name");const x=l(f)[1];if(!i())return r("@keyframes missing '{'");let v,M=p();for(;v=j();)M.push(v),M=M.concat(p());return d()?n({type:$.keyframes,name:x,vendor:u,keyframes:M}):r("@keyframes missing '}'")}function D(){const n=s(),t=/^@supports *([^{]+)/.exec(e);if(!t)return;const u=b(l(t)[1]);if(!i())return r("@supports missing '{'");const f=p().concat(y());return d()?n({type:$.supports,supports:u,rules:f}):r("@supports missing '}'")}function W(){const n=s(),t=/^@host\s*/.exec(e);if(!t)return;if(l(t),!i())return r("@host missing '{'");const u=p().concat(y());return d()?n({type:$.host,rules:u}):r("@host missing '}'")}function q(){const n=s(),t=/^@container *([^{]+)/.exec(e);if(!t)return;const u=b(l(t)[1]);if(!i())return r("@container missing '{'");const f=p().concat(y());return d()?n({type:$.container,container:u,rules:f}):r("@container missing '}'")}function G(){const n=s(),t=/^@layer *([^{;@]+)/.exec(e);if(!t)return;const u=b(l(t)[1]);if(!i()){const x=/^[;\s]*/.exec(e);return x&&l(x),n({type:$.layer,layer:u})}const f=p().concat(y());return d()?n({type:$.layer,layer:u,rules:f}):r("@layer missing '}'")}function J(){const n=s(),t=/^@media *([^{]+)/.exec(e);if(!t)return;const u=b(l(t)[1]);if(!i())return r("@media missing '{'");const f=p().concat(y());return d()?n({type:$.media,media:u,rules:f}):r("@media missing '}'")}function K(){const n=s(),t=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);if(!t)return;const u=l(t);return n({type:$.customMedia,name:b(u[1]),media:b(u[2])})}function X(){const n=s(),t=/^@page */.exec(e);if(!t)return;l(t);const u=S()||[];if(!i())return r("@page missing '{'");let f=p(),x;for(;x=k();)f.push(x),f=f.concat(p());return d()?n({type:$.page,selectors:u,declarations:f}):r("@page missing '}'")}function Y(){const n=s(),t=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!t)return;const u=l(t),f=b(u[1]),x=b(u[2]);if(!i())return r("@document missing '{'");const v=p().concat(y());return d()?n({type:$.document,document:x,vendor:f,rules:v}):r("@document missing '}'")}function Z(){const n=s(),t=/^@font-face\s*/.exec(e);if(!t)return;if(l(t),!i())return r("@font-face missing '{'");let u=p(),f;for(;f=k();)u.push(f),u=u.c
|