Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,5 @@ | ||
## 1.1.2 (February 13, 2016) | ||
- patch `@font-face {}` | ||
## 1.1.1 (February 11, 2016) | ||
@@ -2,0 +6,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "stylis is a feature-rich css preprocessor", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"homepage": "https://github.com/thysultan/stylis.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -34,3 +34,3 @@ # STYLIS | ||
```html | ||
<script src=https://unpkg.com/stylis@1.1.1/stylis.min.js></script> | ||
<script src=https://unpkg.com/stylis@1.1.2/stylis.min.js></script> | ||
``` | ||
@@ -37,0 +37,0 @@ |
219
stylis.js
@@ -140,3 +140,4 @@ /* | ||
// variables | ||
var variables; | ||
var vars; | ||
var varlen; | ||
@@ -176,4 +177,4 @@ // mixins | ||
var comment = 0; | ||
var blockComment = 0; | ||
var lineComment = 0; | ||
var comblck = 0; | ||
var comline = 0; | ||
@@ -254,99 +255,102 @@ if (use) { | ||
// @keyframe/@global, `k` or @global, `g` character | ||
if (second === 107 || second === 103) { | ||
// k, @keyframes | ||
if (second === 107) { | ||
blob = buff.substring(1, 11) + animns + buff.substring(11); | ||
buff = '@' + webkit + blob; | ||
type = 1; | ||
// ; | ||
if (code !== 59) { | ||
// @keyframe/@global, `k` or @global, `g` character | ||
if (second === 107 || second === 103) { | ||
// k, @keyframes | ||
if (second === 107) { | ||
blob = buff.substring(1, 11) + animns + buff.substring(11); | ||
buff = '@' + webkit + blob; | ||
type = 1; | ||
} | ||
// g, @global | ||
else { | ||
buff = ''; | ||
} | ||
} | ||
// g, @global | ||
else { | ||
buff = ''; | ||
} | ||
} | ||
// @media/@mixin `m` character | ||
else if (second === 109) { | ||
// @mixin | ||
if (compact === true && third === 105) { | ||
// first match create mixin store | ||
if (mixins === void 0) { | ||
mixins = {}; | ||
} | ||
// @media/@mixin `m` character | ||
else if (second === 109) { | ||
// @mixin | ||
if (compact === true && third === 105) { | ||
// first match create mixin store | ||
if (mixins === void 0) { | ||
mixins = {}; | ||
} | ||
// retrieve mixin identifier | ||
blob = (mixin = buff.substring(7, buff.indexOf('{')) + ' ').trim(); | ||
// retrieve mixin identifier | ||
blob = (mixin = buff.substring(7, buff.indexOf('{')) + ' ').trim(); | ||
// cache current mixin name | ||
mixin = mixin.substring(0, mixin.indexOf(' ')).trim(); | ||
// cache current mixin name | ||
mixin = mixin.substring(0, mixin.indexOf(' ')).trim(); | ||
// append mixin identifier | ||
mixins[mixin] = {key: blob.trim(), body: ''}; | ||
// append mixin identifier | ||
mixins[mixin] = {key: blob.trim(), body: ''}; | ||
type = 3; | ||
buff = ''; | ||
blob = ''; | ||
} | ||
// @media | ||
else if (third === 101) { | ||
// nested | ||
if (depth !== 0) { | ||
// discard first character { | ||
caret++; | ||
media = ''; | ||
inner = ''; | ||
selectors = prev.split(','); | ||
type = 3; | ||
buff = ''; | ||
blob = ''; | ||
} | ||
// @media | ||
else if (third === 101) { | ||
// nested | ||
if (depth !== 0) { | ||
// discard first character { | ||
caret++; | ||
media = ''; | ||
inner = ''; | ||
selectors = prev.split(','); | ||
// keep track of opening `{` and `}` occurrences | ||
closed = 1; | ||
// keep track of opening `{` and `}` occurrences | ||
closed = 1; | ||
// travel to the end of the block | ||
while (caret < eof) { | ||
char = styles.charCodeAt(caret); | ||
// travel to the end of the block | ||
while (caret < eof) { | ||
char = styles.charCodeAt(caret); | ||
// {, }, nested blocks may have nested blocks | ||
if (char === 123) { | ||
closed++; | ||
} | ||
else if (char === 125) { | ||
closed--; | ||
} | ||
// {, }, nested blocks may have nested blocks | ||
if (char === 123) { | ||
closed++; | ||
} | ||
else if (char === 125) { | ||
closed--; | ||
} | ||
// break when the nested block has ended | ||
if (closed === 0) { | ||
break; | ||
// break when the nested block has ended | ||
if (closed === 0) { | ||
break; | ||
} | ||
// build content of nested block | ||
inner += styles.charAt(caret++); | ||
} | ||
// build content of nested block | ||
inner += styles.charAt(caret++); | ||
} | ||
for (var i = 0, length = selectors.length; i < length; i++) { | ||
selector = selectors[i]; | ||
for (var i = 0, length = selectors.length; i < length; i++) { | ||
selector = selectors[i]; | ||
// build media block | ||
media += stylis( | ||
// remove { on last selector | ||
(i === length - 1 ? selector.substring(0, selector.length - 1) : selector).trim(), | ||
inner, | ||
animations, | ||
compact, | ||
middleware | ||
); | ||
} | ||
// build media block | ||
media += stylis( | ||
// remove { on last selector | ||
(i === length - 1 ? selector.substring(0, selector.length - 1) : selector).trim(), | ||
inner, | ||
animations, | ||
compact, | ||
middleware | ||
); | ||
media = buff + media + '}'; | ||
buff = ''; | ||
type = 4; | ||
} | ||
media = buff + media + '}'; | ||
buff = ''; | ||
type = 4; | ||
// top-level | ||
else { | ||
type = 2; | ||
} | ||
} | ||
// top-level | ||
// unknown | ||
else { | ||
type = 2; | ||
type = 6; | ||
} | ||
} | ||
// unknown | ||
else { | ||
type = 6; | ||
} | ||
} | ||
@@ -426,4 +430,9 @@ | ||
} | ||
// flag special, i.e @keyframes, @global | ||
else if (type !== 4) { | ||
// flag special, i.e @keyframes, @global, @font-face ... | ||
else if (type !== 4 && code !== 59) { | ||
// k, g, m | ||
if (second !== 107 && second !== 103 && second !== 109) { | ||
type = 5; | ||
} | ||
close = -1; | ||
@@ -433,11 +442,18 @@ special++; | ||
} | ||
// ;, ~, ~ variables | ||
else if (compact === true && code === 59 && first === 126 && second === 126 && (colon = buff.indexOf(':')) !== -1) { | ||
// ~, ~, ; variables | ||
else if ( | ||
compact === true && | ||
first === 126 && | ||
second === 126 && | ||
code === 59 && | ||
(colon = buff.indexOf(':')) !== -1 | ||
) { | ||
// first match create variables store | ||
if (variables === void 0) { | ||
variables = []; | ||
if (varlen === void 0) { | ||
vars = []; | ||
varlen = 0; | ||
} | ||
// push key value pair | ||
variables[variables.length] = [buff.substring(0, colon), buff.substring(colon + 1, buff.length - 1).trim()]; | ||
vars[varlen++] = [buff.substring(0, colon), buff.substring(colon + 1, buff.length - 1).trim()]; | ||
@@ -699,6 +715,7 @@ // reset buffer | ||
// {, }, nested blocks may have nested blocks | ||
// {, nested blocks may have nested blocks | ||
if (char === 123) { | ||
closed++; | ||
} | ||
// }, | ||
else if (char === 125) { | ||
@@ -976,3 +993,3 @@ closed--; | ||
// append if the block is not empty {} | ||
if (blck.charCodeAt(blck.length-2) !== 123) { | ||
if (blck.charCodeAt(blck.length - 2) !== 123) { | ||
// middleware, block context | ||
@@ -1017,4 +1034,4 @@ if (use && blck.length !== 0) { | ||
if (code === 13 || code === 10) { | ||
if (lineComment === 1) { | ||
comment = lineComment = 0; | ||
if (comline === 1) { | ||
comment = comline = 0; | ||
buff = buff.substring(0, buff.indexOf('//')); | ||
@@ -1063,8 +1080,8 @@ } | ||
// /, begin line comment | ||
if (blockComment === 0 && styles.charCodeAt(caret - 1) === 47) { | ||
comment = lineComment = 1; | ||
if (comblck === 0 && styles.charCodeAt(caret - 1) === 47) { | ||
comment = comline = 1; | ||
} | ||
// *, end block comment | ||
else if (styles.charCodeAt(caret - 1) === 42) { | ||
comment = blockComment = 0; | ||
comment = comblck = 0; | ||
buff = buff.substring(0, buff.indexOf('/*')); | ||
@@ -1078,6 +1095,6 @@ } | ||
case 42: { | ||
if (strings === 0 && func === 0 && lineComment === 0 && blockComment === 0) { | ||
if (strings === 0 && func === 0 && comline === 0 && comblck === 0) { | ||
// /, begin block comment | ||
if (styles.charCodeAt(caret - 1) === 47) { | ||
comment = blockComment = 1; | ||
comment = comblck = 1; | ||
} | ||
@@ -1118,6 +1135,6 @@ } | ||
// has variables | ||
if (compact && variables !== void 0) { | ||
if (compact && vars !== void 0) { | ||
// replace all variables | ||
for (var i = 0, length = variables.length; i < length; i++) { | ||
output = output.replace(new RegExp('var\\('+variables[i][0]+'\\)', 'g'), variables[i][1]); | ||
for (var i = 0; i < varlen; i++) { | ||
output = output.replace(new RegExp('var\\(' + vars[i][0]+'\\)', 'g'), vars[i][1]); | ||
} | ||
@@ -1124,0 +1141,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.stylis=e(window)}(function(e){"use strict";function r(e,t,i,l,n){e+="";var s,a,o,f,g,c="",u="",h=e.charCodeAt(0)||0;91===h?(a=e.substring(1,e.length-1).split("="),s=(u=a[1]).charCodeAt(0),34!==s&&39!==s||(u=u.substring(1,u.length-1)),c="["+a[0]+'="'+u+'"]'):u=35===h||46===h||62===h?(c=e).substring(1):c=e,h=0,void 0==i||i===!0?(i=!0,o=u):(o="",i=!1);var d=null!=n;d&&(g=(typeof n).charCodeAt(0),111===g?r.use(n,null):102!==g&&(d=!1)),0!==(f=r.plugins).length&&(n=1===f.length?f[0]:function(e,r,t,i){for(var l=r,n=0,s=f.length;n<s;n++)l=f[n](e,l,t,i,c)||l;return l!==r?l:void 0},d=!0);var b,p,v,A,x,m,C,y,O,k,w,j,E,R,z,N="-moz-",F="-ms-",q="-webkit-",B="",D="",G="",H="",I="",J=0,K=0,L=0,M=0,P=0,Q=0,S=0,T=0,U=0,V=0,W=0,X=0;d&&(m=n(0,t,_,$,c),null!=m&&(t=m));for(var Y=0,Z=0,$=0,_=1,ee=t.length,re="";Y<ee;){if(J=t.charCodeAt(Y),0!==P||0!==S||0!==V||123!==J&&125!==J&&59!==J)if(13===J||10===J)1===X&&(V=X=0,B=B.substring(0,B.indexOf("//"))),$=0,_++;else{if(9!==J)switch(B+=t.charAt(Y),J){case 34:P=34===P?0:39===P?39:34;break;case 39:P=39===P?0:34===P?34:39;break;case 40:0===P&&(S=1);break;case 41:0===P&&(S=0);break;case 47:0===P&&0===S&&(0===W&&47===t.charCodeAt(Y-1)?V=X=1:42===t.charCodeAt(Y-1)&&(V=W=0,B=B.substring(0,B.indexOf("/*"))));break;case 42:0===P&&0===S&&0===X&&0===W&&47===t.charCodeAt(Y-1)&&(V=W=1)}$++}else{if(B+=t.charAt(Y),O=B.charCodeAt(0),32===O&&(O=(B=B.trim()).charCodeAt(0)),k=B.charCodeAt(1)||0,w=B.charCodeAt(2)||0,d&&125!==J&&(m=123===J?n(1,B.substring(0,B.length-1).trim(),_,$,c):n(2,B,_,$,c),null!=m&&(B=123===J?m+" {":m)),64===O){if(1===T&&0!==I.length&&(T=0,I=c+" {"+I+"}",d&&(m=n(4,I,_,$,c),null!=m&&(I=m)),re+=I,I=""),107===k||103===k)107===k?(D=B.substring(1,11)+o+B.substring(11),B="@"+q+D,h=1):B="";else if(109===k)if(l===!0&&105===w)void 0===R&&(R={}),D=(z=B.substring(7,B.indexOf("{"))+" ").trim(),z=z.substring(0,z.indexOf(" ")).trim(),R[z]={key:D.trim(),body:""},h=3,B="",D="";else if(101===w)if(0!==Z){for(Y++,x="",p="",v=C.split(","),M=1;Y<ee&&(s=t.charCodeAt(Y),123===s?M++:125===s&&M--,0!==M);)p+=t.charAt(Y++);for(var te=0,ie=v.length;te<ie;te++)e=v[te],x+=r((te===ie-1?e.substring(0,e.length-1):e).trim(),p,i,l,n);x=B+x+"}",B="",h=4}else h=2;else h=6;if(105===k){if(l===!0&&110===w)if(B=B.substring(9,B.length-1),y=B.indexOf("("),y!==-1){var le=B.substring(0,y),ne=R[le],se=B.substring(le.length+1,B.length-1).split(","),ae=ne.key.replace(le,"").replace(/\(|\)/g,"").trim().split(",");B=ne.body;for(var te=0,ie=se.length;te<ie;te++){var oe=ae[te].trim();void 0!==oe&&(B=B.replace(new RegExp("var\\(~~"+oe+"\\)","g"),se[te].trim()))}t+=B,ee+=B.length,B=""}else B=R[B].body,0===Z&&(t+=B,ee+=B.length,B="");else if(109===w&&d){var fe=/@import.*?(["'`][^\.\n\r]*?["'`];|["'`][^:\r\n]*?\.[^c].*?["'`])/g.exec(B);null!==fe&&(B=n(5,fe[1].replace(/['"; ]/g,""),_,$,c)||"",B&&(t=t.substring(0,Y+1)+B+t.substring(Y+1),ee+=B.length),B="")}}else 4!==h&&(L=-1,K++)}else if(l===!0&&59===J&&126===O&&126===k&&(b=B.indexOf(":"))!==-1)void 0===E&&(E=[]),E[E.length]=[B.substring(0,b),B.substring(b+1,B.length-1).trim()],B="";else{if(97===O&&110===k&&105===w){B=B.substring(0,B.length-1),b=B.indexOf(":")+1,A=B.substring(0,b);var ge=B.substring(b).trim().split(",");if(i===!0&&45!==(B.charCodeAt(9)||0))for(var ce=0,ie=ge.length;ce<ie;ce++){for(var ue=ge[ce],he=ue.split(" "),de=0,be=he.length;de<be;de++){var pe=he[de].trim(),ve=pe.charCodeAt(0),Ae=pe.charCodeAt(2),xe=pe.length,me=pe.charCodeAt(xe-1);41===me||0===xe||105===ve&&102===Ae&&101===me&&8===xe||108===ve&&110===Ae&&114===me&&6===xe||97===ve&&116===Ae&&101===me&&(9===xe||17===xe)||110===ve&&114===Ae&&108===me&&6===xe||98===ve&&99===Ae&&115===me&&9===xe||102===ve&&114===Ae&&115===me&&8===xe||98===ve&&116===Ae&&104===me&&4===xe||110===ve&&110===Ae&&101===me&&4===xe||114===ve&&110===Ae&&103===me&&7===xe||112===ve&&117===Ae&&100===me&&6===xe||114===ve&&118===Ae&&100===me&&8===xe||115===ve&&101===Ae&&(116===me&&10===xe||100===me&&8===xe)||101===ve&&115===Ae&&(101===me&&4===xe||(11===xe||7===xe||8===xe)&&45===pe.charCodeAt(4))||!isNaN(parseFloat(pe))||pe.indexOf("(")!==-1||(he[de]=o+pe)}A+=(0===ce?"":",")+he.join(" ").trim()}else A+=(110!==(B.charCodeAt(10)||0)?"":o)+ge[0].trim();B=q+A+";"+A+";"}else if(97===O&&112===k&&112===w)B=q+B+N+B+B;else if(100===O&&105===k&&115===w)(y=B.indexOf("flex"))!==-1&&(m=101===B.charCodeAt(y-2)?"inline-":"",B="display: "+q+m+"box;display: "+q+m+"flex;display: "+F+"flexbox;display: "+m+"flex;");else if(116===O&&114===k&&97===w)B=q+B+(102===B.charCodeAt(5)?F+B:"")+B;else if(104===O&&121===k&&112===w||117===O&&115===k&&101===w)B=q+B+N+B+F+B+B;else if(102===O&&108===k&&101===w)B=q+B+F+B+B;else if(111===O&&114===k&&100===w)B=q+B+F+"flex-"+B+B;else if(97===O&&108===k&&105===w&&45===(B.charCodeAt(5)||0))switch(B.charCodeAt(6)||0){case 105:m=B.replace("-items",""),B=q+"box-"+m+F+"flex-"+m+B;break;case 115:B=F+"flex-item-"+B.replace("-self","")+B;break;default:B=F+"flex-line-pack"+B.replace("align-content","")+B}else if(99===O&&117===k&&114===w&&null!==/zoo|gra/.exec(B))B=B.replace(/: +/g,": "+q)+B.replace(/: +/g,": "+N)+B;else if(123===J){if(Z++,1===T&&0!==I.length&&(T=0,I=c+" {"+I+"}",d&&(m=n(4,I,_,$,c),null!=m&&(I=m)),re+=I,I=""),0===K||2===h)if(2===Z){Y++,p="";var Ce=B.substring(0,B.length-1).split(","),ye=C.substring(0,C.length-1).split(",");for(M=1;Y<ee&&(s=t.charCodeAt(Y),123===s?M++:125===s&&M--,0!==M);)p+=t.charAt(Y++);for(var ce=0,ie=ye.length;ce<ie;ce++){m=ye[ce],ye[ce]="";for(var de=0,be=Ce.length;de<be;de++)e=m.replace(c,"&").trim(),j=Ce[de].trim(),e=j.indexOf(" &")>0?j.replace("&","").trim()+" "+e:e+" "+j,ye[ce]+=e.replace(/ +&/,"").trim()+(de===be-1?"":",")}H+="\n"+ye.join(",")+" {"+p+"}",Q=1,B="",Z--}else{v=B.split(","),A="";for(var ce=0,ie=v.length;ce<ie;ce++){var Oe=(e=v[ce]).charCodeAt(0);if(32===Oe&&(Oe=(e=e.trim()).charCodeAt(0)),91===Oe&&e.indexOf("]")===-1)for(var de=ce+1,be=ie;de<be;de++){var ke=(e+=","+v[de]).trim();if(ke.indexOf("]")!==-1){ie-=de,v.splice(ce,de);break}}if(38===Oe)e=38===e.charCodeAt(1)?e.replace(/&/g,c):c+e.substring(1);else if((y=e.indexOf(" &"))>0&&(Oe=58,e=":global("+e.substring(0,y)+")"+e.substring(y)),58===Oe){var we=e.charCodeAt(1);if(104===we&&116===e.charCodeAt(4)){var je=(e=e.substring(5)).charCodeAt(0);40===je?e=c+e.substring(1).replace(")",""):45===je?(y=e.indexOf(")"),e=e.substring(9,y)+" "+c+e.substring(y+1)):e=c+e}else e=103===we?e.substring(8).replace(")","").replace("&",c):c+e}else e=c+" "+e;d&&(m=n(1.5,ce===ie-1?e.substring(0,e.length-1).trim():e,_,$,c),null!=m&&(e=ce===ie-1?m+" {":m)),A+=0===ce?e:","+e}C=B=A}}else 125===J&&(0!==Z&&Z--,0===Z&&1===Q&&(t=t.substring(0,Y+1)+H+t.substring(Y+1),ee+=H.length,H="",Q=0,L++));0!==K?(125===J?L++:123===J&&0!==L&&L--,1!==U||123!==J&&0!==L||0===I.length||(U=0,B=c+" {"+I+"}"+B,I=""),0===L?(0===h?B="":1===h?(B="}@"+D+"}",D=""):3===h&&(R[z].body=D,z="",B="",D=""),h=0,L--,K--):1===h||3===h?(D+=B,3===h&&(B="")):2===h&&0===Z&&(125!==J&&(0===U&&(I=""),I+=B,B=""),U=1)):0===Z&&125!==J&&(T=1,I=void 0===I?B:I+B,B="")}G+=B,B="",125!==J||0!==h&&4!==h||(123!==G.charCodeAt(G.length-2)&&(d&&0!==G.length&&(m=n(3,G,_,$,c),null!=m&&(G=m)),re+=G.trim()),4===h&&(d&&(m=n(3,x,_,$,c),null!=m&&(x=m)),h=0,re+=x),G="")}Y++}if(void 0!==I&&0!==I.length&&(I=c+" {"+I+"}",d&&(m=n(4,I,_,$,c),null!=m&&(I=m)),re+=I),l&&void 0!==E)for(var te=0,ie=E.length;te<ie;te++)re=re.replace(new RegExp("var\\("+E[te][0]+"\\)","g"),E[te][1]);return d&&(m=n(6,re,_,$,c),null!=m&&(re=m)),re}return r.use=function(e,t){var i=r.plugins,l=i.length;if(null==t&&(t=e,e=void 0),null!=t)if(t.constructor===Object)for(var n in t)r.use(n,t[n]);else if(t.constructor===Array)for(var s=0,a=t.length;s<a;s++)i[l++]=t[s];else if(null==e)i[l]=t;else{var o=e instanceof RegExp?e:new RegExp(e+"\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)","g"),f=/[ \t\r\n]*,[ \t\r\n]*/g;i[l]=function(e,r,i,l){if(6===e)return r=r.replace(o,function(e,r){var i=r.replace(f,",").split(","),l=t.apply(null,i);return null!=l?l:e})}}return r},r.plugins=[],r}); | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.stylis=e(window)}(function(e){"use strict";function r(e,t,i,l,n){e+="";var s,a,o,f,g,c="",u="",d=e.charCodeAt(0)||0;91===d?(a=e.substring(1,e.length-1).split("="),s=(u=a[1]).charCodeAt(0),34!==s&&39!==s||(u=u.substring(1,u.length-1)),c="["+a[0]+'="'+u+'"]'):u=35===d||46===d||62===d?(c=e).substring(1):c=e,d=0,void 0==i||i===!0?(i=!0,o=u):(o="",i=!1);var h=null!=n;h&&(g=(typeof n).charCodeAt(0),111===g?r.use(n,null):102!==g&&(h=!1)),0!==(f=r.plugins).length&&(n=1===f.length?f[0]:function(e,r,t,i){for(var l=r,n=0,s=f.length;n<s;n++)l=f[n](e,l,t,i,c)||l;return l!==r?l:void 0},h=!0);var b,p,v,A,x,m,C,y,O,k,w,j,E,R,z,N,F="-moz-",q="-ms-",B="-webkit-",D="",G="",H="",I="",J="",K=0,L=0,M=0,P=0,Q=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;h&&(m=n(0,t,ee,_,c),null!=m&&(t=m));for(var Z=0,$=0,_=0,ee=1,re=t.length,te="";Z<re;){if(K=t.charCodeAt(Z),0!==Q||0!==T||0!==W||123!==K&&125!==K&&59!==K)if(13===K||10===K)1===Y&&(W=Y=0,D=D.substring(0,D.indexOf("//"))),_=0,ee++;else{if(9!==K)switch(D+=t.charAt(Z),K){case 34:Q=34===Q?0:39===Q?39:34;break;case 39:Q=39===Q?0:34===Q?34:39;break;case 40:0===Q&&(T=1);break;case 41:0===Q&&(T=0);break;case 47:0===Q&&0===T&&(0===X&&47===t.charCodeAt(Z-1)?W=Y=1:42===t.charCodeAt(Z-1)&&(W=X=0,D=D.substring(0,D.indexOf("/*"))));break;case 42:0===Q&&0===T&&0===Y&&0===X&&47===t.charCodeAt(Z-1)&&(W=X=1)}_++}else{if(D+=t.charAt(Z),O=D.charCodeAt(0),32===O&&(O=(D=D.trim()).charCodeAt(0)),k=D.charCodeAt(1)||0,w=D.charCodeAt(2)||0,h&&125!==K&&(m=123===K?n(1,D.substring(0,D.length-1).trim(),ee,_,c):n(2,D,ee,_,c),null!=m&&(D=123===K?m+" {":m)),64===O){if(1===U&&0!==J.length&&(U=0,J=c+" {"+J+"}",h&&(m=n(4,J,ee,_,c),null!=m&&(J=m)),te+=J,J=""),59!==K)if(107===k||103===k)107===k?(G=D.substring(1,11)+o+D.substring(11),D="@"+B+G,d=1):D="";else if(109===k)if(l===!0&&105===w)void 0===z&&(z={}),G=(N=D.substring(7,D.indexOf("{"))+" ").trim(),N=N.substring(0,N.indexOf(" ")).trim(),z[N]={key:G.trim(),body:""},d=3,D="",G="";else if(101===w)if(0!==$){for(Z++,x="",p="",v=C.split(","),P=1;Z<re&&(s=t.charCodeAt(Z),123===s?P++:125===s&&P--,0!==P);)p+=t.charAt(Z++);for(var ie=0,le=v.length;ie<le;ie++)e=v[ie],x+=r((ie===le-1?e.substring(0,e.length-1):e).trim(),p,i,l,n);x=D+x+"}",D="",d=4}else d=2;else d=6;if(105===k){if(l===!0&&110===w)if(D=D.substring(9,D.length-1),y=D.indexOf("("),y!==-1){var ne=D.substring(0,y),se=z[ne],ae=D.substring(ne.length+1,D.length-1).split(","),oe=se.key.replace(ne,"").replace(/\(|\)/g,"").trim().split(",");D=se.body;for(var ie=0,le=ae.length;ie<le;ie++){var fe=oe[ie].trim();void 0!==fe&&(D=D.replace(new RegExp("var\\(~~"+fe+"\\)","g"),ae[ie].trim()))}t+=D,re+=D.length,D=""}else D=z[D].body,0===$&&(t+=D,re+=D.length,D="");else if(109===w&&h){var ge=/@import.*?(["'`][^\.\n\r]*?["'`];|["'`][^:\r\n]*?\.[^c].*?["'`])/g.exec(D);null!==ge&&(D=n(5,ge[1].replace(/['"; ]/g,""),ee,_,c)||"",D&&(t=t.substring(0,Z+1)+D+t.substring(Z+1),re+=D.length),D="")}}else 4!==d&&59!==K&&(107!==k&&103!==k&&109!==k&&(d=5),M=-1,L++)}else if(l===!0&&126===O&&126===k&&59===K&&(b=D.indexOf(":"))!==-1)void 0===R&&(E=[],R=0),E[R++]=[D.substring(0,b),D.substring(b+1,D.length-1).trim()],D="";else{if(97===O&&110===k&&105===w){D=D.substring(0,D.length-1),b=D.indexOf(":")+1,A=D.substring(0,b);var ce=D.substring(b).trim().split(",");if(i===!0&&45!==(D.charCodeAt(9)||0))for(var ue=0,le=ce.length;ue<le;ue++){for(var de=ce[ue],he=de.split(" "),be=0,pe=he.length;be<pe;be++){var ve=he[be].trim(),Ae=ve.charCodeAt(0),xe=ve.charCodeAt(2),me=ve.length,Ce=ve.charCodeAt(me-1);41===Ce||0===me||105===Ae&&102===xe&&101===Ce&&8===me||108===Ae&&110===xe&&114===Ce&&6===me||97===Ae&&116===xe&&101===Ce&&(9===me||17===me)||110===Ae&&114===xe&&108===Ce&&6===me||98===Ae&&99===xe&&115===Ce&&9===me||102===Ae&&114===xe&&115===Ce&&8===me||98===Ae&&116===xe&&104===Ce&&4===me||110===Ae&&110===xe&&101===Ce&&4===me||114===Ae&&110===xe&&103===Ce&&7===me||112===Ae&&117===xe&&100===Ce&&6===me||114===Ae&&118===xe&&100===Ce&&8===me||115===Ae&&101===xe&&(116===Ce&&10===me||100===Ce&&8===me)||101===Ae&&115===xe&&(101===Ce&&4===me||(11===me||7===me||8===me)&&45===ve.charCodeAt(4))||!isNaN(parseFloat(ve))||ve.indexOf("(")!==-1||(he[be]=o+ve)}A+=(0===ue?"":",")+he.join(" ").trim()}else A+=(110!==(D.charCodeAt(10)||0)?"":o)+ce[0].trim();D=B+A+";"+A+";"}else if(97===O&&112===k&&112===w)D=B+D+F+D+D;else if(100===O&&105===k&&115===w)(y=D.indexOf("flex"))!==-1&&(m=101===D.charCodeAt(y-2)?"inline-":"",D="display: "+B+m+"box;display: "+B+m+"flex;display: "+q+"flexbox;display: "+m+"flex;");else if(116===O&&114===k&&97===w)D=B+D+(102===D.charCodeAt(5)?q+D:"")+D;else if(104===O&&121===k&&112===w||117===O&&115===k&&101===w)D=B+D+F+D+q+D+D;else if(102===O&&108===k&&101===w)D=B+D+q+D+D;else if(111===O&&114===k&&100===w)D=B+D+q+"flex-"+D+D;else if(97===O&&108===k&&105===w&&45===(D.charCodeAt(5)||0))switch(D.charCodeAt(6)||0){case 105:m=D.replace("-items",""),D=B+"box-"+m+q+"flex-"+m+D;break;case 115:D=q+"flex-item-"+D.replace("-self","")+D;break;default:D=q+"flex-line-pack"+D.replace("align-content","")+D}else if(99===O&&117===k&&114===w&&null!==/zoo|gra/.exec(D))D=D.replace(/: +/g,": "+B)+D.replace(/: +/g,": "+F)+D;else if(123===K){if($++,1===U&&0!==J.length&&(U=0,J=c+" {"+J+"}",h&&(m=n(4,J,ee,_,c),null!=m&&(J=m)),te+=J,J=""),0===L||2===d)if(2===$){Z++,p="";var ye=D.substring(0,D.length-1).split(","),Oe=C.substring(0,C.length-1).split(",");for(P=1;Z<re&&(s=t.charCodeAt(Z),123===s?P++:125===s&&P--,0!==P);)p+=t.charAt(Z++);for(var ue=0,le=Oe.length;ue<le;ue++){m=Oe[ue],Oe[ue]="";for(var be=0,pe=ye.length;be<pe;be++)e=m.replace(c,"&").trim(),j=ye[be].trim(),e=j.indexOf(" &")>0?j.replace("&","").trim()+" "+e:e+" "+j,Oe[ue]+=e.replace(/ +&/,"").trim()+(be===pe-1?"":",")}I+="\n"+Oe.join(",")+" {"+p+"}",S=1,D="",$--}else{v=D.split(","),A="";for(var ue=0,le=v.length;ue<le;ue++){var ke=(e=v[ue]).charCodeAt(0);if(32===ke&&(ke=(e=e.trim()).charCodeAt(0)),91===ke&&e.indexOf("]")===-1)for(var be=ue+1,pe=le;be<pe;be++){var we=(e+=","+v[be]).trim();if(we.indexOf("]")!==-1){le-=be,v.splice(ue,be);break}}if(38===ke)e=38===e.charCodeAt(1)?e.replace(/&/g,c):c+e.substring(1);else if((y=e.indexOf(" &"))>0&&(ke=58,e=":global("+e.substring(0,y)+")"+e.substring(y)),58===ke){var je=e.charCodeAt(1);if(104===je&&116===e.charCodeAt(4)){var Ee=(e=e.substring(5)).charCodeAt(0);40===Ee?e=c+e.substring(1).replace(")",""):45===Ee?(y=e.indexOf(")"),e=e.substring(9,y)+" "+c+e.substring(y+1)):e=c+e}else e=103===je?e.substring(8).replace(")","").replace("&",c):c+e}else e=c+" "+e;h&&(m=n(1.5,ue===le-1?e.substring(0,e.length-1).trim():e,ee,_,c),null!=m&&(e=ue===le-1?m+" {":m)),A+=0===ue?e:","+e}C=D=A}}else 125===K&&(0!==$&&$--,0===$&&1===S&&(t=t.substring(0,Z+1)+I+t.substring(Z+1),re+=I.length,I="",S=0,M++));0!==L?(125===K?M++:123===K&&0!==M&&M--,1!==V||123!==K&&0!==M||0===J.length||(V=0,D=c+" {"+J+"}"+D,J=""),0===M?(0===d?D="":1===d?(D="}@"+G+"}",G=""):3===d&&(z[N].body=G,N="",D="",G=""),d=0,M--,L--):1===d||3===d?(G+=D,3===d&&(D="")):2===d&&0===$&&(125!==K&&(0===V&&(J=""),J+=D,D=""),V=1)):0===$&&125!==K&&(U=1,J=void 0===J?D:J+D,D="")}H+=D,D="",125!==K||0!==d&&4!==d||(123!==H.charCodeAt(H.length-2)&&(h&&0!==H.length&&(m=n(3,H,ee,_,c),null!=m&&(H=m)),te+=H.trim()),4===d&&(h&&(m=n(3,x,ee,_,c),null!=m&&(x=m)),d=0,te+=x),H="")}Z++}if(void 0!==J&&0!==J.length&&(J=c+" {"+J+"}",h&&(m=n(4,J,ee,_,c),null!=m&&(J=m)),te+=J),l&&void 0!==E)for(var ie=0;ie<R;ie++)te=te.replace(new RegExp("var\\("+E[ie][0]+"\\)","g"),E[ie][1]);return h&&(m=n(6,te,ee,_,c),null!=m&&(te=m)),te}return r.use=function(e,t){var i=r.plugins,l=i.length;if(null==t&&(t=e,e=void 0),null!=t)if(t.constructor===Object)for(var n in t)r.use(n,t[n]);else if(t.constructor===Array)for(var s=0,a=t.length;s<a;s++)i[l++]=t[s];else if(null==e)i[l]=t;else{var o=e instanceof RegExp?e:new RegExp(e+"\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)","g"),f=/[ \t\r\n]*,[ \t\r\n]*/g;i[l]=function(e,r,i,l){if(6===e)return r=r.replace(o,function(e,r){var i=r.replace(f,",").split(","),l=t.apply(null,i);return null!=l?l:e})}}return r},r.plugins=[],r}); |
54287
1032