@projectwallace/css-analyzer 5.11.0 → 5.12.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/analyzer.cjs +1 -1
- package/dist/analyzer.cjs.map +1 -1
- package/dist/analyzer.modern.js +1 -1
- package/dist/analyzer.modern.js.map +1 -1
- package/dist/analyzer.module.js +1 -1
- package/dist/analyzer.module.js.map +1 -1
- package/dist/analyzer.umd.js +1 -1
- package/dist/analyzer.umd.js.map +1 -1
- package/dist/index.d.ts +338 -372
- package/package.json +1 -1
package/dist/analyzer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=require("css-tree/parser"),t=require("css-tree/walker"),n=require("@bramus/specificity/core");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/i(e),a=/*#__PURE__*/i(t);function o(e,t){return t>=65&&t<=90&&(t|=32),e===t}function s(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(!1===o(e.charCodeAt(i),t.charCodeAt(i)))return!1;return!0}function u(e,t){var n=t.length,i=n-e.length;if(i<0)return!1;for(var r=n-1;r>=i;r--)if(!1===o(e.charCodeAt(r-i),t.charCodeAt(r)))return!1;return!0}function l(e,t){var n=e.length;if(t.length<n)return!1;for(var i=0;i<n;i++)if(!1===o(e.charCodeAt(i),t.charCodeAt(i)))return!1;return!0}function c(e,t,n){return s(t,e.property)&&"Identifier"===e.value.children.first.type&&s(n,e.value.children.first.name)}function f(e){return 45===e.charCodeAt(0)&&45!==e.charCodeAt(1)&&-1!==e.indexOf("-",2)}function h(e,t){var n=[];return a.default(e,{visit:"Selector",enter:function(e){n.push(t(e))}}),n}function d(e){return s(e,"not")||s(e,"nth-child")||s(e,"nth-last-child")||s(e,"where")||s(e,"is")||s(e,"has")||s(e,"matches")||s(e,"-webkit-any")||s(e,"-moz-any")}function m(e){var t=!1;return a.default(e,function(e){if("AttributeSelector"===e.type){if(s("role",e.name.name)||l("aria-",e.name.name))return t=!0,this.break}else if("PseudoClassSelector"===e.type&&d(e.name))return h(e,m).some(function(e){return!0===e})?(t=!0,this.skip):this.skip}),t}function v(e){var t=0,n=!1;return a.default(e,function(e){if("Selector"!==e.type&&"Nth"!==e.type){if(t++,"IdSelector"!==e.type&&"ClassSelector"!==e.type&&"PseudoElementSelector"!==e.type&&"TypeSelector"!==e.type&&"PseudoClassSelector"!==e.type||f(e.name)&&(n=!0,t++),"AttributeSelector"===e.type)return Boolean(e.value)&&t++,f(e.name.name)&&(n=!0,t++),this.skip;if("PseudoClassSelector"===e.type&&d(e.name)){var i=h(e,v);if(0===i.length)return;return i.forEach(function(e){t+=e[0],!0===e[1]&&(n=!0)}),this.skip}}}),[t,n]}var w=/*#__PURE__*/function(){function e(e){this.set=e}return e.prototype.has=function(e){for(var t=this.set.length,n=0;n<t;n++)if(s(this.set[n],e))return!0;return!1},e}(),b=new w(["white","black","red","blue","gray","grey","green","rebeccapurple","yellow","orange","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen"]),g=new w(["canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext"]),p=new w(["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color"]),y=new w(["transparent","currentcolor"]),k=new w(["caption","icon","menu","message-box","small-caption","status-bar"]),L=new w(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","smaller","larger"]);function x(e){var t=e.children.first;return null!==t&&"Identifier"===t.type&&k.has(t.name)}var q=new w(["auto","inherit","initial","unset","revert","revert-layer","none"]);function S(e){if(!e.children)return!1;if(e.children.size>1||0===e.children.size)return!1;var t=e.children.first;return"Identifier"===t.type&&q.has(t.name)}var z=new w(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),O=new w(["cubic-bezier","steps"]);function I(e){if(!e.children)return!1;for(var t=e.children.toArray(),n=0;n<t.length;n++){var i=t[n],r=i.type,a=i.name;if("Identifier"===r&&f(a))return!0;if("Function"===r){if(f(a))return!0;if(I(i))return!0}}return!1}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _=/*#__PURE__*/function(){function e(e){var t=e.useLocations,n=void 0!==t&&t;this.t=new Map,this.i=0,this.node_lines=[],this.node_columns=[],this.node_lengths=[],this.node_offsets=[],this.o=n}var t=e.prototype;return t.push=function(e,t){var n=this.i;if(this.node_lines[n]=t.start.line,this.node_columns[n]=t.start.column,this.node_offsets[n]=t.start.offset,this.node_lengths[n]=t.end.offset-t.start.offset,this.t.has(e))return this.t.get(e).push(n),void this.i++;this.t.set(e,[n]),this.i++},t.size=function(){return this.i},t.count=function(){var e=this,t=new Map,n={};return this.t.forEach(function(i,r){var a=i.map(function(t){return{line:e.node_lines[t],column:e.node_columns[t],offset:e.node_offsets[t],length:e.node_lengths[t]}});t.set(r,a),n[r]=i.length}),this.o?{total:this.i,totalUnique:this.t.size,unique:n,uniquenessRatio:0===this.i?0:this.t.size/this.i,__unstable__uniqueWithLocations:Object.fromEntries(t)}:{total:this.i,totalUnique:this.t.size,unique:n,uniquenessRatio:0===this.i?0:this.t.size/this.i}},e}(),j=/*#__PURE__*/function(){function e(e){var t=e.useLocations,n=void 0!==t&&t;this.u=new _({useLocations:n}),this.l=new Map,this.useLocations=n}var t=e.prototype;return t.push=function(e,t,n){this.u.push(e,n),this.l.has(t)||this.l.set(t,new _({useLocations:this.useLocations})),this.l.get(t).push(e,n)},t.count=function(){for(var e,t=new Map,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e))){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.l.entries());!(e=n()).done;){var i=e.value;t.set(i[0],i[1].count())}return Object.assign(this.u.count(),{itemsPerContext:Object.fromEntries(t)})},e}(),D=/*#__PURE__*/function(){function e(){this.t=[],this.h=0}var t=e.prototype;return t.push=function(e){this.t.push(e),this.h+=e},t.size=function(){return this.t.length},t.aggregate=function(){if(0===this.t.length)return{min:0,max:0,mean:0,mode:0,median:0,range:0,sum:0};var e,t,n,i=this.t.slice().sort(function(e,t){return e-t}),r=i[0],a=i[i.length-1],o=function(e){for(var t=new Map,n=-1,i=0,r=0,a=0;a<e.length;a++){var o=e[a],s=(t.get(o)||0)+1;t.set(o,s),s>n&&(n=s,i=0,r=0),s>=n&&(i++,r+=o)}return r/i}(i),s=(t=(e=i).length/2)!==(n=Math.floor(t))?e[n]:(e[n]+e[n-1])/2;return{min:r,max:a,mean:this.h/i.length,mode:o,median:s,range:a-r,sum:this.h}},t.toArray=function(){return this.t},e}();function M(e){return!(e.length<3)&&45===e.charCodeAt(0)&&45===e.charCodeAt(1)}function U(e,t){return!M(t)&&u(e,t)}function A(e,t){return 0===t?0:e/t}var R={useUnstableLocations:!1};function F(e,t){return e[0]===t[0]?e[1]===t[1]?t[2]-e[2]:t[1]-e[1]:t[0]-e[0]}exports.analyze=function(e,t){void 0===t&&(t={});var i=!0===Object.assign({},R,t).useUnstableLocations,o=Date.now();function h(e){return d(e).trim()}function d(t){return e.substring(t.loc.start.offset,t.loc.end.offset)}var w,k,q=0,C=0,P=new _({useLocations:i}),T=0,E={total:0,unique:new Map},H=Date.now(),N=r.default(e,{parseCustomProperty:!0,positions:!0,onComment:function(e){q++,C+=e.length}}),B=Date.now(),K=N.loc.end.line-N.loc.start.line+1,Q=0,V=[],W=new _({useLocations:i}),$=new _({useLocations:i}),G=new _({useLocations:i}),J=new _({useLocations:i}),X=new _({useLocations:i}),Y=new _({useLocations:i}),Z=new _({useLocations:i}),ee=new _({useLocations:i}),te=new _({useLocations:i}),ne=new _({useLocations:i}),ie=0,re=0,ae=new D,oe=new D,se=new D,ue=new _({useLocations:i}),le=new _({useLocations:i}),ce=new _({useLocations:i}),fe=new _({useLocations:i}),he=new Set,de=new _({useLocations:i}),me=new D,ve=new D,we=new D,be=new _({useLocations:i}),ge=new D,pe=new _({useLocations:i}),ye=[],ke=new _({useLocations:i}),Le=new _({useLocations:i}),xe=new _({useLocations:i}),qe=new Set,Se=0,ze=0,Oe=0,Ie=new _({useLocations:i}),Ce=new _({useLocations:i}),_e=new _({useLocations:i}),je=new _({useLocations:i}),De=new _({useLocations:i}),Me=new D,Ue=new _({useLocations:i}),Ae=new _({useLocations:i}),Re=new _({useLocations:i}),Fe=new _({useLocations:i}),Pe=new _({useLocations:i}),Te=new _({useLocations:i}),Ee=new _({useLocations:i}),He=new _({useLocations:i}),Ne=new _({useLocations:i}),Be=new _({useLocations:i}),Ke=new j({useLocations:i}),Qe=new _({useLocations:i}),Ve=new j({useLocations:i}),We=new _({useLocations:i});a.default(N,function(e){switch(e.type){case"Atrule":Q++;var t=e.name;if("font-face"===t){var i={};e.block.children.forEach(function(e){"Declaration"===e.type&&(i[e.property]=h(e.value))}),V.push(i);break}if("media"===t){var r=h(e.prelude);G.push(r,e.prelude.loc),function(e){var t=!1;return a.default(e,function(e){if("MediaQuery"===e.type&&1===e.children.size&&"Identifier"===e.children.first.type&&(l("\\0",(e=e.children.first).name)||u("\\9 ",e.name)))return t=!0,this.break;if("MediaFeature"===e.type){if(null!==e.value&&"\\0"===e.value.unit)return t=!0,this.break;if(s("-moz-images-in-menus",e.name)||s("min--moz-device-pixel-ratio",e.name)||s("-ms-high-contrast",e.name))return t=!0,this.break;if(s("min-resolution",e.name)&&s(".001",e.value.value)&&s("dpcm",e.value.unit))return t=!0,this.break;if(s("-webkit-min-device-pixel-ratio",e.name)&&(s("0",e.value.value)||s("10000",e.value.value)))return t=!0,this.break}}),t}(e.prelude)&&J.push(r,e.prelude.loc);break}if("supports"===t){var o=h(e.prelude);Y.push(o,e.prelude.loc),function(e){var t=!1;return a.default(e,function(e){if("Declaration"===e.type&&(c(e,"-webkit-appearance","none")||c(e,"-moz-appearance","meterbar")))return t=!0,this.break}),t}(e.prelude)&&Z.push(o,e.prelude.loc);break}if(u("keyframes",t)){var q="@"+t+" "+h(e.prelude);f(t)&&te.push(q,e.prelude.loc),ee.push(q,e.prelude.loc);break}if("import"===t){$.push(h(e.prelude),e.prelude.loc);break}if("charset"===t){X.push(h(e.prelude),e.prelude.loc);break}if("container"===t){ne.push(h(e.prelude),e.prelude.loc);break}"layer"===t&&h(e.prelude).split(",").forEach(function(t){return W.push(t.trim(),e.prelude.loc)});break;case"Rule":var C=e.prelude.children?e.prelude.children.size:0,_=e.block.children?e.block.children.size:0;ae.push(C+_),ue.push(C+_,e.loc),oe.push(C),le.push(C,e.prelude.loc),se.push(_),ce.push(_,e.block.loc),ie++,0===_&&re++;break;case"Selector":var j=h(e);if(this.atrule&&u("keyframes",this.atrule.name))return fe.push(j,e.loc),this.skip;m(e)&&Le.push(j,e.loc);var D=v(e),A=D[0];D[1]&&de.push(j,e.loc),he.add(j),ge.push(A),pe.push(A,e.loc);var R=n.calculate(e)[0].value,H=[R.a,R.b,R.c];return be.push(H[0]+","+H[1]+","+H[2],e.loc),void 0===w&&(w=H),void 0===k&&(k=H),me.push(H[0]),ve.push(H[1]),we.push(H[2]),void 0!==k&&F(k,H)<0&&(k=H),void 0!==w&&F(w,H)>0&&(w=H),ye.push(H),H[0]>0&&ke.push(j,e.loc),function(e,t){a.default(e,function(e,n){if("Combinator"===e.type)if(null===e.loc){var i=n.prev.data.loc.end,r={offset:i.offset,line:i.line,column:i.column};t({name:e.name,loc:{start:r,end:{offset:r.offset+1,line:r.line,column:r.column+1}}})}else t({name:e.name,loc:e.loc})})}(e,function(e){xe.push(e.name,e.loc)}),this.skip;case"Dimension":if(!this.declaration)break;var N=e.unit;return u("\\9",N)?Ve.push(N.substring(0,N.length-2),this.declaration.property,e.loc):Ve.push(N,this.declaration.property,e.loc),this.skip;case"Url":if(l("data:",e.value)){var B=e.value,K=B.length,$e=function(e){var t=e.indexOf(";"),n=e.indexOf(",");return e.substring(5,-1===t||-1!==n&&n<t?n:t)}(B);if(E.total++,T+=K,E.unique.has($e)){var Ge=E.unique.get($e);Ge.count++,Ge.size+=K,E.unique.set($e,Ge)}else E.unique.set($e,{count:1,size:K});P.push(B,e.loc)}break;case"Value":if(S(e))break;var Je=this.declaration,Xe=Je.property,Ye=Je.important;if(I(e)&&Ue.push(h(e),e.loc),"string"==typeof Ye&&Ae.push(d(e)+"!"+Ye,e.loc),function(e){var t=e.children;return t&&t.last&&"Identifier"===t.last.type&&u("\\9",t.last.name)}(e)&&Ae.push(h(e),e.loc),U("z-index",Xe))return Re.push(h(e),e.loc),this.skip;if(U("font",Xe)){if(x(e))return;var Ze=function(e,t){var n,i,r=[];return e.children.forEach(function(e,a){if(a.next&&"Operator"===a.next.data.type&&47===a.next.data.value.charCodeAt(0))n=t(e);else if(a.prev&&"Operator"===a.prev.data.type&&47===a.prev.data.value.charCodeAt(0))i=t(e);else{if(a.next&&"Operator"===a.next.data.type&&44===a.next.data.value.charCodeAt(0)&&!r[0])return r[0]=e,void(n||null==a.prev||(n=t(a.prev.data)));if("Dimension"===e.type&&a.prev&&"Identifier"===a.prev.data.type&&"oblique"===a.prev.data.name)font_style+="".padStart(e.loc.start.offset-a.prev.data.loc.end.offset)+t(e);else if("Number"!==e.type)return null===a.next?(r[1]=e,void(n||r[0]||!a.prev||(n=t(a.prev.data)))):void("Identifier"===e.type&&L.has(e.name)&&(n=e.name))}}),{font_size:n,line_height:i,font_family:t({loc:{start:{offset:(r[0]||r[1]).loc.start.offset},end:{offset:r[1].loc.end.offset}}})}}(e,h),et=Ze.font_size,tt=Ze.line_height,nt=Ze.font_family;nt&&Te.push(nt,e.loc),et&&Ee.push(et,e.loc),tt&&He.push(tt,e.loc);break}if(U("font-size",Xe)){x(e)||Ee.push(h(e),e.loc);break}if(U("font-family",Xe)){x(e)||Te.push(h(e),e.loc);break}if(U("line-height",Xe))He.push(h(e),e.loc);else{if(U("transition",Xe)||U("animation",Xe)){for(var it=function(e,t){var n=!1,i=[],r=[];return e.forEach(function(e){var a=e.type;return"Operator"===a?n=!1:"Dimension"===a&&!1===n?(n=!0,i.push(t(e))):"Identifier"===a&&z.has(e.name)||"Function"===a&&O.has(e.name)?r.push(t(e)):void 0}),[i,r]}(e.children,h),rt=it[0],at=it[1],ot=0;ot<rt.length;ot++)Be.push(rt[ot],e.loc);for(var st=0;st<at.length;st++)Ne.push(at[st],e.loc);break}if(U("animation-duration",Xe)||U("transition-duration",Xe)){e.children&&e.children.size>1?e.children.forEach(function(t){"Operator"!==t.type&&Be.push(h(t),e.loc)}):Be.push(h(e),e.loc);break}if(U("transition-timing-function",Xe)||U("animation-timing-function",Xe)){e.children&&e.children.size>1?e.children.forEach(function(t){"Operator"!==t.type&&Ne.push(h(t),e.loc)}):Ne.push(h(e),e.loc);break}U("text-shadow",Xe)?S(e)||Fe.push(h(e),e.loc):U("box-shadow",Xe)&&(S(e)||Pe.push(h(e),e.loc))}a.default(e,function(e){var t=e.name;switch(e.type){case"Hash":var n=e.value.length;return u("\\9",e.value)&&(n-=2),Ke.push("#"+e.value,Xe,e.loc),Qe.push("hex"+n,e.loc),this.skip;case"Identifier":if(t.length>20||t.length<3)return this.skip;if(b.has(t)){var i=h(e);return Ke.push(i,Xe,e.loc),void Qe.push("named",e.loc)}if(y.has(t)){var r=h(e);return Ke.push(r,Xe,e.loc),void Qe.push(t.toLowerCase(),e.loc)}if(g.has(t)){var a=h(e);return Ke.push(a,Xe,e.loc),void Qe.push("system",e.loc)}return this.skip;case"Function":if(s("var",t))return this.skip;if(p.has(t))return Ke.push(h(e),Xe,e.loc),void Qe.push(t.toLowerCase(),e.loc);if(u("gradient",t))return void We.push(h(e),e.loc)}});break;case"Declaration":if(null!==this.atrulePrelude)return this.skip;Se++,qe.add(h(e)),!0===e.important&&(ze++,this.atrule&&u("keyframes",this.atrule.name)&&Oe++);var ut=e.property,lt={start:{line:e.loc.start.line,column:e.loc.start.column,offset:e.loc.start.offset},end:{offset:e.loc.start.offset+ut.length}};Ce.push(ut,lt),f(ut)?(je.push(ut,lt),Me.push(2)):function(e){if(M(e)||f(e))return!1;var t=e.charCodeAt(0);return 47===t||95===t||43===t||42===t||38===t||36===t||35===t}(ut)?(_e.push(ut,lt),Me.push(2)):M(ut)?(De.push(ut,lt),Me.push(2),!0===e.important&&Ie.push(ut,lt)):Me.push(1)}});var $e=P.count(),Ge=qe.size,Je=ge.size(),Xe=me.aggregate(),Ye=ve.aggregate(),Ze=we.aggregate(),et=he.size,tt=Object.assign;return{stylesheet:{sourceLinesOfCode:Q+Je+Se+fe.size(),linesOfCode:K,size:e.length,comments:{total:q,size:C},embeddedContent:tt($e,{size:{total:T,ratio:A(T,e.length)},types:{total:E.total,totalUnique:E.unique.size,uniquenessRatio:A(E.unique.size,E.total),unique:Object.fromEntries(E.unique)}})},atrules:{fontface:{total:V.length,totalUnique:V.length,unique:V,uniquenessRatio:0===V.length?0:1},import:$.count(),media:tt(G.count(),{browserhacks:J.count()}),charset:X.count(),supports:tt(Y.count(),{browserhacks:Z.count()}),keyframes:tt(ee.count(),{prefixed:tt(te.count(),{ratio:A(te.size(),ee.size())})}),container:ne.count(),layer:W.count()},rules:{total:ie,empty:{total:re,ratio:A(re,ie)},sizes:tt(ae.aggregate(),{items:ae.toArray()},ue.count()),selectors:tt(oe.aggregate(),{items:oe.toArray()},le.count()),declarations:tt(se.aggregate(),{items:se.toArray()},ce.count())},selectors:{total:Je,totalUnique:et,uniquenessRatio:A(et,Je),specificity:tt({min:void 0===k?[0,0,0]:k,max:void 0===w?[0,0,0]:w,sum:[Xe.sum,Ye.sum,Ze.sum],mean:[Xe.mean,Ye.mean,Ze.mean],mode:[Xe.mode,Ye.mode,Ze.mode],median:[Xe.median,Ye.median,Ze.median],items:ye},be.count()),complexity:tt(ge.aggregate(),pe.count(),{items:ge.toArray()}),id:tt(ke.count(),{ratio:A(ke.size(),Je)}),accessibility:tt(Le.count(),{ratio:A(Le.size(),Je)}),keyframes:fe.count(),prefixed:tt(de.count(),{ratio:A(de.size(),Je)}),combinators:xe.count()},declarations:{total:Se,totalUnique:Ge,uniquenessRatio:A(Ge,Se),unique:{total:Ge,ratio:A(Ge,Se)},importants:{total:ze,ratio:A(ze,Se),inKeyframes:{total:Oe,ratio:A(Oe,ze)}}},properties:tt(Ce.count(),{prefixed:tt(je.count(),{ratio:A(je.size(),Ce.size())}),custom:tt(De.count(),{ratio:A(De.size(),Ce.size()),importants:tt(Ie.count(),{ratio:A(Ie.size(),De.size())})}),browserhacks:tt(_e.count(),{ratio:A(_e.size(),Ce.size())}),complexity:Me.aggregate()}),values:{colors:tt(Ke.count(),{formats:Qe.count()}),gradients:We.count(),fontFamilies:Te.count(),fontSizes:Ee.count(),lineHeights:He.count(),zindexes:Re.count(),textShadows:Fe.count(),boxShadows:Pe.count(),animations:{durations:Be.count(),timingFunctions:Ne.count()},prefixes:Ue.count(),browserhacks:Ae.count(),units:Ve.count()},__meta__:{parseTime:B-H,analyzeTime:Date.now()-B,total:Date.now()-o}}},exports.compareSpecificity=F;
|
|
1
|
+
var e=require("css-tree/parser"),t=require("css-tree/walker"),n=require("@bramus/specificity/core");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/i(e),a=/*#__PURE__*/i(t);function o(e,t){return t>=65&&t<=90&&(t|=32),e===t}function s(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(!1===o(e.charCodeAt(i),t.charCodeAt(i)))return!1;return!0}function u(e,t){var n=t.length,i=n-e.length;if(i<0)return!1;for(var r=n-1;r>=i;r--)if(!1===o(e.charCodeAt(r-i),t.charCodeAt(r)))return!1;return!0}function l(e,t){var n=e.length;if(t.length<n)return!1;for(var i=0;i<n;i++)if(!1===o(e.charCodeAt(i),t.charCodeAt(i)))return!1;return!0}function c(e,t,n){return s(t,e.property)&&"Identifier"===e.value.children.first.type&&s(n,e.value.children.first.name)}function f(e){return 45===e.charCodeAt(0)&&45!==e.charCodeAt(1)&&-1!==e.indexOf("-",2)}function h(e,t){var n=[];return a.default(e,{visit:"Selector",enter:function(e){n.push(t(e))}}),n}function d(e){return s(e,"not")||s(e,"nth-child")||s(e,"nth-last-child")||s(e,"where")||s(e,"is")||s(e,"has")||s(e,"matches")||s(e,"-webkit-any")||s(e,"-moz-any")}function m(e){var t=!1;return a.default(e,function(e){if("AttributeSelector"===e.type){if(s("role",e.name.name)||l("aria-",e.name.name))return t=!0,this.break}else if("PseudoClassSelector"===e.type&&d(e.name))return h(e,m).some(function(e){return!0===e})?(t=!0,this.skip):this.skip}),t}function v(e){var t=0,n=!1;return a.default(e,function(e){if("Selector"!==e.type&&"Nth"!==e.type){if(t++,"IdSelector"!==e.type&&"ClassSelector"!==e.type&&"PseudoElementSelector"!==e.type&&"TypeSelector"!==e.type&&"PseudoClassSelector"!==e.type||f(e.name)&&(n=!0,t++),"AttributeSelector"===e.type)return Boolean(e.value)&&t++,f(e.name.name)&&(n=!0,t++),this.skip;if("PseudoClassSelector"===e.type&&d(e.name)){var i=h(e,v);if(0===i.length)return;return i.forEach(function(e){t+=e[0],!0===e[1]&&(n=!0)}),this.skip}}}),[t,n]}var w=/*#__PURE__*/function(){function e(e){this.set=e}return e.prototype.has=function(e){for(var t=this.set.length,n=0;n<t;n++)if(s(this.set[n],e))return!0;return!1},e}(),b=new w(["white","black","red","blue","gray","grey","green","rebeccapurple","yellow","orange","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen"]),g=new w(["canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext"]),p=new w(["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color"]),y=new w(["transparent","currentcolor"]),k=new w(["caption","icon","menu","message-box","small-caption","status-bar"]),L=new w(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","smaller","larger"]);function x(e){var t=e.children.first;return null!==t&&"Identifier"===t.type&&k.has(t.name)}var q=new w(["auto","inherit","initial","unset","revert","revert-layer","none"]);function S(e){if(!e.children)return!1;if(e.children.size>1||0===e.children.size)return!1;var t=e.children.first;return"Identifier"===t.type&&q.has(t.name)}var z=new w(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),O=new w(["cubic-bezier","steps"]);function I(e){if(!e.children)return!1;for(var t=e.children.toArray(),n=0;n<t.length;n++){var i=t[n],r=i.type,a=i.name;if("Identifier"===r&&f(a))return!0;if("Function"===r){if(f(a))return!0;if(I(i))return!0}}return!1}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _=/*#__PURE__*/function(){function e(e){var t=e.useLocations,n=void 0!==t&&t;this.t=new Map,this.i=0,this.node_lines=[],this.node_columns=[],this.node_lengths=[],this.node_offsets=[],this.o=n}var t=e.prototype;return t.push=function(e,t){var n=this.i;if(this.node_lines[n]=t.start.line,this.node_columns[n]=t.start.column,this.node_offsets[n]=t.start.offset,this.node_lengths[n]=t.end.offset-t.start.offset,this.t.has(e))return this.t.get(e).push(n),void this.i++;this.t.set(e,[n]),this.i++},t.size=function(){return this.i},t.count=function(){var e=this,t=new Map,n={};return this.t.forEach(function(i,r){var a=i.map(function(t){return{line:e.node_lines[t],column:e.node_columns[t],offset:e.node_offsets[t],length:e.node_lengths[t]}});t.set(r,a),n[r]=i.length}),this.o?{total:this.i,totalUnique:this.t.size,unique:n,uniquenessRatio:0===this.i?0:this.t.size/this.i,__unstable__uniqueWithLocations:Object.fromEntries(t)}:{total:this.i,totalUnique:this.t.size,unique:n,uniquenessRatio:0===this.i?0:this.t.size/this.i}},e}(),j=/*#__PURE__*/function(){function e(e){var t=e.useLocations,n=void 0!==t&&t;this.u=new _({useLocations:n}),this.l=new Map,this.useLocations=n}var t=e.prototype;return t.push=function(e,t,n){this.u.push(e,n),this.l.has(t)||this.l.set(t,new _({useLocations:this.useLocations})),this.l.get(t).push(e,n)},t.count=function(){for(var e,t=new Map,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e))){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.l.entries());!(e=n()).done;){var i=e.value;t.set(i[0],i[1].count())}return Object.assign(this.u.count(),{itemsPerContext:Object.fromEntries(t)})},e}(),D=/*#__PURE__*/function(){function e(){this.t=[],this.h=0}var t=e.prototype;return t.push=function(e){this.t.push(e),this.h+=e},t.size=function(){return this.t.length},t.aggregate=function(){if(0===this.t.length)return{min:0,max:0,mean:0,mode:0,median:0,range:0,sum:0};var e,t,n,i=this.t.slice().sort(function(e,t){return e-t}),r=i[0],a=i[i.length-1],o=function(e){for(var t=new Map,n=-1,i=0,r=0,a=0;a<e.length;a++){var o=e[a],s=(t.get(o)||0)+1;t.set(o,s),s>n&&(n=s,i=0,r=0),s>=n&&(i++,r+=o)}return r/i}(i),s=(t=(e=i).length/2)!==(n=Math.floor(t))?e[n]:(e[n]+e[n-1])/2;return{min:r,max:a,mean:this.h/i.length,mode:o,median:s,range:a-r,sum:this.h}},t.toArray=function(){return this.t},e}();function M(e){return!(e.length<3)&&45===e.charCodeAt(0)&&45===e.charCodeAt(1)}function A(e,t){return!M(t)&&u(e,t)}function U(e,t){return 0===t?0:e/t}var R={useUnstableLocations:!1};function F(e,t){return e[0]===t[0]?e[1]===t[1]?t[2]-e[2]:t[1]-e[1]:t[0]-e[0]}exports.analyze=function(e,t){void 0===t&&(t={});var i=!0===Object.assign({},R,t).useUnstableLocations,o=Date.now();function h(e){return d(e).trim()}function d(t){return e.substring(t.loc.start.offset,t.loc.end.offset)}var w,k,q=0,C=0,P=new _({useLocations:i}),T=0,E={total:0,unique:new Map},H=Date.now(),N=r.default(e,{parseCustomProperty:!0,positions:!0,onComment:function(e){q++,C+=e.length}}),B=Date.now(),K=N.loc.end.line-N.loc.start.line+1,Q=0,V=[],W=new _({useLocations:i}),$=new _({useLocations:i}),G=new _({useLocations:i}),J=new _({useLocations:i}),X=new _({useLocations:i}),Y=new _({useLocations:i}),Z=new _({useLocations:i}),ee=new _({useLocations:i}),te=new _({useLocations:i}),ne=new _({useLocations:i}),ie=new _({useLocations:i}),re=0,ae=0,oe=new D,se=new D,ue=new D,le=new _({useLocations:i}),ce=new _({useLocations:i}),fe=new _({useLocations:i}),he=new _({useLocations:i}),de=new Set,me=new _({useLocations:i}),ve=new D,we=new D,be=new D,ge=new _({useLocations:i}),pe=new D,ye=new _({useLocations:i}),ke=[],Le=new _({useLocations:i}),xe=new _({useLocations:i}),qe=new _({useLocations:i}),Se=new Set,ze=0,Oe=0,Ie=0,Ce=new _({useLocations:i}),_e=new _({useLocations:i}),je=new _({useLocations:i}),De=new _({useLocations:i}),Me=new _({useLocations:i}),Ae=new D,Ue=new _({useLocations:i}),Re=new _({useLocations:i}),Fe=new _({useLocations:i}),Pe=new _({useLocations:i}),Te=new _({useLocations:i}),Ee=new _({useLocations:i}),He=new _({useLocations:i}),Ne=new _({useLocations:i}),Be=new _({useLocations:i}),Ke=new _({useLocations:i}),Qe=new j({useLocations:i}),Ve=new _({useLocations:i}),We=new j({useLocations:i}),$e=new _({useLocations:i});a.default(N,function(e){switch(e.type){case"Atrule":Q++;var t=e.name;if("font-face"===t){var i={};e.block.children.forEach(function(e){"Declaration"===e.type&&(i[e.property]=h(e.value))}),V.push(i);break}if("media"===t){var r=h(e.prelude);G.push(r,e.prelude.loc),function(e){var t=!1;return a.default(e,function(e){if("MediaQuery"===e.type&&1===e.children.size&&"Identifier"===e.children.first.type&&(l("\\0",(e=e.children.first).name)||u("\\9 ",e.name)))return t=!0,this.break;if("MediaFeature"===e.type){if(null!==e.value&&"\\0"===e.value.unit)return t=!0,this.break;if(s("-moz-images-in-menus",e.name)||s("min--moz-device-pixel-ratio",e.name)||s("-ms-high-contrast",e.name))return t=!0,this.break;if(s("min-resolution",e.name)&&s(".001",e.value.value)&&s("dpcm",e.value.unit))return t=!0,this.break;if(s("-webkit-min-device-pixel-ratio",e.name)&&(s("0",e.value.value)||s("10000",e.value.value)))return t=!0,this.break}}),t}(e.prelude)&&J.push(r,e.prelude.loc);break}if("supports"===t){var o=h(e.prelude);Y.push(o,e.prelude.loc),function(e){var t=!1;return a.default(e,function(e){if("Declaration"===e.type&&(c(e,"-webkit-appearance","none")||c(e,"-moz-appearance","meterbar")))return t=!0,this.break}),t}(e.prelude)&&Z.push(o,e.prelude.loc);break}if(u("keyframes",t)){var q="@"+t+" "+h(e.prelude);f(t)&&te.push(q,e.prelude.loc),ee.push(q,e.prelude.loc);break}if("import"===t){$.push(h(e.prelude),e.prelude.loc);break}if("charset"===t){X.push(h(e.prelude),e.prelude.loc);break}if("container"===t){ne.push(h(e.prelude),e.prelude.loc);break}if("layer"===t){h(e.prelude).split(",").forEach(function(t){return W.push(t.trim(),e.prelude.loc)});break}if("property"===t){var C=h(e.prelude);ie.push(C,e.prelude.loc);break}break;case"Rule":var _=e.prelude.children?e.prelude.children.size:0,j=e.block.children?e.block.children.size:0;oe.push(_+j),le.push(_+j,e.loc),se.push(_),ce.push(_,e.prelude.loc),ue.push(j),fe.push(j,e.block.loc),re++,0===j&&ae++;break;case"Selector":var D=h(e);if(this.atrule&&u("keyframes",this.atrule.name))return he.push(D,e.loc),this.skip;m(e)&&xe.push(D,e.loc);var U=v(e),R=U[0];U[1]&&me.push(D,e.loc),de.add(D),pe.push(R),ye.push(R,e.loc);var H=n.calculate(e)[0].value,N=H.a,B=H.b,K=H.c,Ge=[N,B,K];return ge.push(N+","+B+","+K,e.loc),ve.push(N),we.push(B),be.push(K),void 0===w&&(w=Ge),void 0===k&&(k=Ge),void 0!==k&&F(k,Ge)<0&&(k=Ge),void 0!==w&&F(w,Ge)>0&&(w=Ge),ke.push(Ge),N>0&&Le.push(D,e.loc),function(e,t){a.default(e,function(e,n){if("Combinator"===e.type)if(null===e.loc){var i=n.prev.data.loc.end,r={offset:i.offset,line:i.line,column:i.column};t({name:e.name,loc:{start:r,end:{offset:r.offset+1,line:r.line,column:r.column+1}}})}else t({name:e.name,loc:e.loc})})}(e,function(e){qe.push(e.name,e.loc)}),this.skip;case"Dimension":if(!this.declaration)break;var Je=e.unit;return u("\\9",Je)?We.push(Je.substring(0,Je.length-2),this.declaration.property,e.loc):We.push(Je,this.declaration.property,e.loc),this.skip;case"Url":if(l("data:",e.value)){var Xe=e.value,Ye=Xe.length,Ze=function(e){var t=e.indexOf(";"),n=e.indexOf(",");return e.substring(5,-1===t||-1!==n&&n<t?n:t)}(Xe);if(E.total++,T+=Ye,E.unique.has(Ze)){var et=E.unique.get(Ze);et.count++,et.size+=Ye,E.unique.set(Ze,et)}else E.unique.set(Ze,{count:1,size:Ye});P.push(Xe,e.loc)}break;case"Value":if(S(e))break;var tt=this.declaration,nt=tt.property,it=tt.important;if(I(e)&&Ue.push(h(e),e.loc),"string"==typeof it&&Re.push(d(e)+"!"+it,e.loc),function(e){var t=e.children;return t&&t.last&&"Identifier"===t.last.type&&u("\\9",t.last.name)}(e)&&Re.push(h(e),e.loc),A("z-index",nt))return Fe.push(h(e),e.loc),this.skip;if(A("font",nt)){if(x(e))return;var rt=function(e,t){var n,i,r=new Array(2);return e.children.forEach(function(e,a){if(a.next&&"Operator"===a.next.data.type&&47===a.next.data.value.charCodeAt(0))n=t(e);else if(a.prev&&"Operator"===a.prev.data.type&&47===a.prev.data.value.charCodeAt(0))i=t(e);else{if(a.next&&"Operator"===a.next.data.type&&44===a.next.data.value.charCodeAt(0)&&!r[0])return r[0]=e,void(n||null==a.prev||(n=t(a.prev.data)));if("Dimension"===e.type&&a.prev&&"Identifier"===a.prev.data.type&&"oblique"===a.prev.data.name)font_style+="".padStart(e.loc.start.offset-a.prev.data.loc.end.offset)+t(e);else if("Number"!==e.type)return null===a.next?(r[1]=e,void(n||r[0]||!a.prev||(n=t(a.prev.data)))):void("Identifier"===e.type&&L.has(e.name)&&(n=e.name))}}),{font_size:n,line_height:i,font_family:r[0]||r[1]?t({loc:{start:{offset:(r[0]||r[1]).loc.start.offset},end:{offset:r[1].loc.end.offset}}}):null}}(e,h),at=rt.font_size,ot=rt.line_height,st=rt.font_family;st&&Ee.push(st,e.loc),at&&He.push(at,e.loc),ot&&Ne.push(ot,e.loc);break}if(A("font-size",nt)){x(e)||He.push(h(e),e.loc);break}if(A("font-family",nt)){x(e)||Ee.push(h(e),e.loc);break}if(A("line-height",nt))Ne.push(h(e),e.loc);else{if(A("transition",nt)||A("animation",nt)){for(var ut=function(e,t){var n=!1,i=[],r=[];return e.forEach(function(e){var a=e.type;return"Operator"===a?n=!1:"Dimension"===a&&!1===n?(n=!0,i.push(t(e))):"Identifier"===a&&z.has(e.name)||"Function"===a&&O.has(e.name)?r.push(t(e)):void 0}),[i,r]}(e.children,h),lt=ut[0],ct=ut[1],ft=0;ft<lt.length;ft++)Ke.push(lt[ft],e.loc);for(var ht=0;ht<ct.length;ht++)Be.push(ct[ht],e.loc);break}if(A("animation-duration",nt)||A("transition-duration",nt)){e.children&&e.children.size>1?e.children.forEach(function(t){"Operator"!==t.type&&Ke.push(h(t),e.loc)}):Ke.push(h(e),e.loc);break}if(A("transition-timing-function",nt)||A("animation-timing-function",nt)){e.children&&e.children.size>1?e.children.forEach(function(t){"Operator"!==t.type&&Be.push(h(t),e.loc)}):Be.push(h(e),e.loc);break}A("text-shadow",nt)?S(e)||Pe.push(h(e),e.loc):A("box-shadow",nt)&&(S(e)||Te.push(h(e),e.loc))}a.default(e,function(e){var t=e.name;switch(e.type){case"Hash":var n=e.value.length;return u("\\9",e.value)&&(n-=2),Qe.push("#"+e.value,nt,e.loc),Ve.push("hex"+n,e.loc),this.skip;case"Identifier":if(t.length>20||t.length<3)return this.skip;if(b.has(t)){var i=h(e);return Qe.push(i,nt,e.loc),void Ve.push("named",e.loc)}if(y.has(t)){var r=h(e);return Qe.push(r,nt,e.loc),void Ve.push(t.toLowerCase(),e.loc)}if(g.has(t)){var a=h(e);return Qe.push(a,nt,e.loc),void Ve.push("system",e.loc)}return this.skip;case"Function":if(s("var",t))return this.skip;if(p.has(t))return Qe.push(h(e),nt,e.loc),void Ve.push(t.toLowerCase(),e.loc);if(u("gradient",t))return void $e.push(h(e),e.loc)}});break;case"Declaration":if(null!==this.atrulePrelude)return this.skip;ze++,Se.add(h(e)),!0===e.important&&(Oe++,this.atrule&&u("keyframes",this.atrule.name)&&Ie++);var dt=e.property,mt={start:{line:e.loc.start.line,column:e.loc.start.column,offset:e.loc.start.offset},end:{offset:e.loc.start.offset+dt.length}};_e.push(dt,mt),f(dt)?(De.push(dt,mt),Ae.push(2)):function(e){if(M(e)||f(e))return!1;var t=e.charCodeAt(0);return 47===t||95===t||43===t||42===t||38===t||36===t||35===t}(dt)?(je.push(dt,mt),Ae.push(2)):M(dt)?(Me.push(dt,mt),Ae.push(2),!0===e.important&&Ce.push(dt,mt)):Ae.push(1)}});var Ge=P.count(),Je=Se.size,Xe=pe.size(),Ye=ve.aggregate(),Ze=we.aggregate(),et=be.aggregate(),tt=de.size,nt=Object.assign;return{stylesheet:{sourceLinesOfCode:Q+Xe+ze+he.size(),linesOfCode:K,size:e.length,comments:{total:q,size:C},embeddedContent:nt(Ge,{size:{total:T,ratio:U(T,e.length)},types:{total:E.total,totalUnique:E.unique.size,uniquenessRatio:U(E.unique.size,E.total),unique:Object.fromEntries(E.unique)}})},atrules:{fontface:{total:V.length,totalUnique:V.length,unique:V,uniquenessRatio:0===V.length?0:1},import:$.count(),media:nt(G.count(),{browserhacks:J.count()}),charset:X.count(),supports:nt(Y.count(),{browserhacks:Z.count()}),keyframes:nt(ee.count(),{prefixed:nt(te.count(),{ratio:U(te.size(),ee.size())})}),container:ne.count(),layer:W.count(),property:ie.count()},rules:{total:re,empty:{total:ae,ratio:U(ae,re)},sizes:nt(oe.aggregate(),{items:oe.toArray()},le.count()),selectors:nt(se.aggregate(),{items:se.toArray()},ce.count()),declarations:nt(ue.aggregate(),{items:ue.toArray()},fe.count())},selectors:{total:Xe,totalUnique:tt,uniquenessRatio:U(tt,Xe),specificity:nt({min:void 0===k?[0,0,0]:k,max:void 0===w?[0,0,0]:w,sum:[Ye.sum,Ze.sum,et.sum],mean:[Ye.mean,Ze.mean,et.mean],mode:[Ye.mode,Ze.mode,et.mode],median:[Ye.median,Ze.median,et.median],items:ke},ge.count()),complexity:nt(pe.aggregate(),ye.count(),{items:pe.toArray()}),id:nt(Le.count(),{ratio:U(Le.size(),Xe)}),accessibility:nt(xe.count(),{ratio:U(xe.size(),Xe)}),keyframes:he.count(),prefixed:nt(me.count(),{ratio:U(me.size(),Xe)}),combinators:qe.count()},declarations:{total:ze,totalUnique:Je,uniquenessRatio:U(Je,ze),unique:{total:Je,ratio:U(Je,ze)},importants:{total:Oe,ratio:U(Oe,ze),inKeyframes:{total:Ie,ratio:U(Ie,Oe)}}},properties:nt(_e.count(),{prefixed:nt(De.count(),{ratio:U(De.size(),_e.size())}),custom:nt(Me.count(),{ratio:U(Me.size(),_e.size()),importants:nt(Ce.count(),{ratio:U(Ce.size(),Me.size())})}),browserhacks:nt(je.count(),{ratio:U(je.size(),_e.size())}),complexity:Ae.aggregate()}),values:{colors:nt(Qe.count(),{formats:Ve.count()}),gradients:$e.count(),fontFamilies:Ee.count(),fontSizes:He.count(),lineHeights:Ne.count(),zindexes:Fe.count(),textShadows:Pe.count(),boxShadows:Te.count(),animations:{durations:Ke.count(),timingFunctions:Be.count()},prefixes:Ue.count(),browserhacks:Re.count(),units:We.count()},__meta__:{parseTime:B-H,analyzeTime:Date.now()-B,total:Date.now()-o}}},exports.compareSpecificity=F;
|
|
2
2
|
//# sourceMappingURL=analyzer.cjs.map
|
package/dist/analyzer.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.cjs","sources":["../src/string-utils.js","../src/atrules/atrules.js","../src/vendor-prefix.js","../src/selectors/utils.js","../src/keyword-set.js","../src/values/colors.js","../src/values/destructure-font-shorthand.js","../src/values/values.js","../src/values/animations.js","../src/values/vendor-prefix.js","../src/collection.js","../src/context-collection.js","../src/aggregate-collection.js","../src/properties/property-utils.js","../src/index.js","../src/stylesheet/stylesheet.js","../src/values/browserhacks.js"],"sourcesContent":["/**\n * Case-insensitive compare two character codes\n * @param {string} referenceCode\n * @param {string} testCode\n * @see https://github.com/csstree/csstree/blob/41f276e8862d8223eeaa01a3d113ab70bb13d2d9/lib/tokenizer/utils.js#L22\n */\nfunction compareChar(referenceCode, testCode) {\n // if uppercase\n if (testCode >= 0x0041 && testCode <= 0x005A) {\n // shifting the 6th bit makes a letter lowercase\n testCode = testCode | 32\n }\n return referenceCode === testCode\n}\n\n/**\n * Case-insensitive string-comparison\n * @example\n * strEquals('test', 'test') // true\n * strEquals('test', 'TEST') // true\n * strEquals('test', 'TesT') // true\n * strEquals('test', 'derp') // false\n *\n * @param {string} base The string to check against\n * @param {string} maybe The test string, possibly containing uppercased characters\n * @returns {boolean} true if the two strings are the same, false otherwise\n */\nexport function strEquals(base, maybe) {\n let len = base.length;\n if (len !== maybe.length) return false\n\n for (let i = 0; i < len; i++) {\n if (compareChar(base.charCodeAt(i), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string ends with a given substring\n *\n * @example\n * endsWith('test', 'my-test') // true\n * endsWith('test', 'est') // false\n *\n * @param {string} base e.g. '-webkit-transform'\n * @param {string} maybe e.g. 'transform'\n * @returns {boolean} true if `test` ends with `base`, false otherwise\n */\nexport function endsWith(base, maybe) {\n let len = maybe.length\n let offset = len - base.length\n\n if (offset < 0) {\n return false\n }\n\n for (let i = len - 1; i >= offset; i--) {\n if (compareChar(base.charCodeAt(i - offset), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string starts with a given substring\n * @param {string} base\n * @param {string} maybe\n * @returns {boolean} true if `test` starts with `base`, false otherwise\n */\nexport function startsWith(base, maybe) {\n let len = base.length\n if (maybe.length < len) return false\n\n for (let i = 0; i < len; i++) {\n if (compareChar(base.charCodeAt(i), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n","import { strEquals, startsWith, endsWith } from '../string-utils.js'\nimport walk from 'css-tree/walker'\n\n/**\n * Check whether node.property === property and node.value === value,\n * but case-insensitive and fast.\n * @param {import('css-tree').Declaration} node\n * @param {string} property - The CSS property to compare with (case-insensitive)\n * @param {string} value - The identifier/keyword value to compare with\n * @returns true if declaratioNode is the given property: value, false otherwise\n */\nfunction isPropertyValue(node, property, value) {\n return strEquals(property, node.property)\n && node.value.children.first.type === 'Identifier'\n && strEquals(value, node.value.children.first.name)\n}\n\n/**\n * Check if an @supports atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isSupportsBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'Declaration') {\n if (\n isPropertyValue(node, '-webkit-appearance', 'none')\n || isPropertyValue(node, '-moz-appearance', 'meterbar')\n ) {\n returnValue = true\n return this.break\n }\n }\n })\n\n return returnValue\n}\n\n/**\n * Check if a @media atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isMediaBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'MediaQuery'\n && node.children.size === 1\n && node.children.first.type === 'Identifier'\n ) {\n node = node.children.first\n // Note: CSSTree adds a trailing space to \\\\9\n if (startsWith('\\\\0', node.name) || endsWith('\\\\9 ', node.name)) {\n returnValue = true\n return this.break\n }\n }\n if (node.type === 'MediaFeature') {\n if (node.value !== null && node.value.unit === '\\\\0') {\n returnValue = true\n return this.break\n }\n if (strEquals('-moz-images-in-menus', node.name)\n || strEquals('min--moz-device-pixel-ratio', node.name)\n || strEquals('-ms-high-contrast', node.name)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('min-resolution', node.name)\n && strEquals('.001', node.value.value)\n && strEquals('dpcm', node.value.unit)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('-webkit-min-device-pixel-ratio', node.name)) {\n if ((strEquals('0', node.value.value) || strEquals('10000', node.value.value))) {\n returnValue = true\n return this.break\n }\n }\n }\n })\n\n return returnValue\n}","const HYPHENMINUS = 45; // '-'.charCodeAt()\n\n/**\n * @param {string} keyword\n * @returns {boolean}\n */\nfunction hasVendorPrefix(keyword) {\n if (keyword.charCodeAt(0) === HYPHENMINUS && keyword.charCodeAt(1) !== HYPHENMINUS) {\n // String must have a 2nd occurrence of '-', at least at position 3 (offset=2)\n if (keyword.indexOf('-', 2) !== -1) {\n return true\n }\n }\n\n return false\n}\n\nexport {\n hasVendorPrefix\n}","import walk from 'css-tree/walker'\nimport { startsWith, strEquals } from '../string-utils.js'\nimport { hasVendorPrefix } from '../vendor-prefix.js'\n\n/**\n *\n * @param {import('css-tree').SelectorList} selectorListAst\n * @returns {Selector[]} Analyzed selectors in the selectorList\n */\nfunction analyzeList(selectorListAst, cb) {\n let childSelectors = []\n walk(selectorListAst, {\n visit: 'Selector',\n enter: function (node) {\n childSelectors.push(cb(node))\n }\n })\n\n return childSelectors\n}\n\nfunction isPseudoFunction(name) {\n return (\n strEquals(name, 'not')\n || strEquals(name, 'nth-child')\n || strEquals(name, 'nth-last-child')\n || strEquals(name, 'where')\n || strEquals(name, 'is')\n || strEquals(name, 'has')\n || strEquals(name, 'matches')\n || strEquals(name, '-webkit-any')\n || strEquals(name, '-moz-any')\n )\n}\n\n/** @param {import('css-tree').Selector} selector */\nexport function isAccessibility(selector) {\n let isA11y = false\n\n walk(selector, function (node) {\n if (node.type === 'AttributeSelector') {\n if (strEquals('role', node.name.name) || startsWith('aria-', node.name.name)) {\n isA11y = true\n return this.break\n }\n }\n // Test for [aria-] or [role] inside :is()/:where() and friends\n else if (node.type === 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n let list = analyzeList(node, isAccessibility)\n\n if (list.some(b => b === true)) {\n isA11y = true\n return this.skip\n }\n\n return this.skip\n }\n }\n })\n\n return isA11y;\n}\n\n/**\n * Get the Complexity for the AST of a Selector Node\n * @param {import('css-tree').Selector} ast - AST Node for a Selector\n * @return {[number, boolean]} - The numeric complexity of the Selector and whether it's prefixed or not\n */\nexport function getComplexity(selector) {\n let complexity = 0\n let isPrefixed = false\n\n walk(selector, function (node) {\n if (node.type === 'Selector' || node.type === 'Nth') return\n\n complexity++\n\n if (node.type === 'IdSelector'\n || node.type === 'ClassSelector'\n || node.type === 'PseudoElementSelector'\n || node.type === 'TypeSelector'\n || node.type === 'PseudoClassSelector'\n ) {\n if (hasVendorPrefix(node.name)) {\n isPrefixed = true\n complexity++\n }\n }\n\n if (node.type === 'AttributeSelector') {\n if (Boolean(node.value)) {\n complexity++\n }\n if (hasVendorPrefix(node.name.name)) {\n isPrefixed = true\n complexity++\n }\n return this.skip\n }\n\n if (node.type === 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n let list = analyzeList(node, getComplexity)\n\n // Bail out for empty/non-existent :nth-child() params\n if (list.length === 0) return\n\n list.forEach(([c, p]) => {\n complexity += c\n if (p === true) isPrefixed = true\n })\n return this.skip\n }\n }\n })\n\n return [complexity, isPrefixed]\n}\n\n/**\n * Walk a selector node and trigger a callback every time a Combinator was found\n * We need create the `loc` for descendant combinators manually, because CSSTree\n * does not keep track of whitespace for us. We'll assume that the combinator is\n * alwas a single ` ` (space) character, even though there could be newlines or\n * multiple spaces\n * @param {import('css-tree').CssNode} node\n * @param {*} onMatch\n */\nexport function getCombinators(node, onMatch) {\n walk(node, function (\n /** @type {import('css-tree').CssNode} */ selectorNode,\n /** @type {import('css-tree').ListItem} */ item\n ) {\n if (selectorNode.type === 'Combinator') {\n // .loc is null when selectorNode.name === ' '\n if (selectorNode.loc === null) {\n let previousLoc = item.prev.data.loc.end\n let start = {\n offset: previousLoc.offset,\n line: previousLoc.line,\n column: previousLoc.column\n }\n\n onMatch({\n name: selectorNode.name,\n loc: {\n start,\n end: {\n offset: start.offset + 1,\n line: start.line,\n column: start.column + 1\n }\n }\n })\n } else {\n onMatch({\n name: selectorNode.name,\n loc: selectorNode.loc\n })\n }\n }\n })\n}\n","import { strEquals } from \"./string-utils.js\"\n\n/**\n * @description A Set-like construct to search CSS keywords in a case-insensitive way\n */\nexport class KeywordSet {\n\n\t/** @param {string[]} items */\n\tconstructor(items) {\n\t\t/** @type {string[]} */\n\t\tthis.set = items\n\t}\n\n\t/** @param {string} item */\n\thas(item) {\n\t\tlet len = this.set.length\n\n\t\tfor (let index = 0; index < len; index++) {\n\t\t\tif (strEquals(this.set[index], item)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n}","import { KeywordSet } from \"../keyword-set.js\"\n\nexport const namedColors = new KeywordSet([\n // CSS Named Colors\n // Spec: https://drafts.csswg.org/css-color/#named-colors\n\n // Heuristic: popular names first for quick finding in set.has()\n 'white',\n 'black',\n 'red',\n 'blue',\n 'gray',\n 'grey',\n 'green',\n 'rebeccapurple',\n 'yellow',\n 'orange',\n\n 'aliceblue',\n 'antiquewhite',\n 'aqua',\n 'aquamarine',\n 'azure',\n 'beige',\n 'bisque',\n 'blanchedalmond',\n 'blueviolet',\n 'brown',\n 'burlywood',\n 'cadetblue',\n 'chartreuse',\n 'chocolate',\n 'coral',\n 'cornflowerblue',\n 'cornsilk',\n 'crimson',\n 'cyan',\n 'darkblue',\n 'darkcyan',\n 'darkgoldenrod',\n 'darkgray',\n 'darkgreen',\n 'darkgrey',\n 'darkkhaki',\n 'darkmagenta',\n 'darkolivegreen',\n 'darkorange',\n 'darkorchid',\n 'darkred',\n 'darksalmon',\n 'darkseagreen',\n 'darkslateblue',\n 'darkslategray',\n 'darkslategrey',\n 'darkturquoise',\n 'darkviolet',\n 'deeppink',\n 'deepskyblue',\n 'dimgray',\n 'dimgrey',\n 'dodgerblue',\n 'firebrick',\n 'floralwhite',\n 'forestgreen',\n 'fuchsia',\n 'gainsboro',\n 'ghostwhite',\n 'gold',\n 'goldenrod',\n 'greenyellow',\n 'honeydew',\n 'hotpink',\n 'indianred',\n 'indigo',\n 'ivory',\n 'khaki',\n 'lavender',\n 'lavenderblush',\n 'lawngreen',\n 'lemonchiffon',\n 'lightblue',\n 'lightcoral',\n 'lightcyan',\n 'lightgoldenrodyellow',\n 'lightgray',\n 'lightgreen',\n 'lightgrey',\n 'lightpink',\n 'lightsalmon',\n 'lightseagreen',\n 'lightskyblue',\n 'lightslategray',\n 'lightslategrey',\n 'lightsteelblue',\n 'lightyellow',\n 'lime',\n 'limegreen',\n 'linen',\n 'magenta',\n 'maroon',\n 'mediumaquamarine',\n 'mediumblue',\n 'mediumorchid',\n 'mediumpurple',\n 'mediumseagreen',\n 'mediumslateblue',\n 'mediumspringgreen',\n 'mediumturquoise',\n 'mediumvioletred',\n 'midnightblue',\n 'mintcream',\n 'mistyrose',\n 'moccasin',\n 'navajowhite',\n 'navy',\n 'oldlace',\n 'olive',\n 'olivedrab',\n 'orangered',\n 'orchid',\n 'palegoldenrod',\n 'palegreen',\n 'paleturquoise',\n 'palevioletred',\n 'papayawhip',\n 'peachpuff',\n 'peru',\n 'pink',\n 'plum',\n 'powderblue',\n 'purple',\n 'rosybrown',\n 'royalblue',\n 'saddlebrown',\n 'salmon',\n 'sandybrown',\n 'seagreen',\n 'seashell',\n 'sienna',\n 'silver',\n 'skyblue',\n 'slateblue',\n 'slategray',\n 'slategrey',\n 'snow',\n 'springgreen',\n 'steelblue',\n 'tan',\n 'teal',\n 'thistle',\n 'tomato',\n 'turquoise',\n 'violet',\n 'wheat',\n 'whitesmoke',\n 'yellowgreen',\n])\n\nexport const systemColors = new KeywordSet([\n // CSS System Colors\n // Spec: https://drafts.csswg.org/css-color/#css-system-colors\n 'canvas',\n 'canvastext',\n 'linktext',\n 'visitedtext',\n 'activetext',\n 'buttonface',\n 'buttontext',\n 'buttonborder',\n 'field',\n 'fieldtext',\n 'highlight',\n 'highlighttext',\n 'selecteditem',\n 'selecteditemtext',\n 'mark',\n 'marktext',\n 'graytext',\n\n // TODO: Deprecated CSS System colors\n // Spec: https://drafts.csswg.org/css-color/#deprecated-system-colors\n])\n\nexport const colorFunctions = new KeywordSet([\n 'rgb',\n 'rgba',\n 'hsl',\n 'hsla',\n 'hwb',\n 'lab',\n 'lch',\n 'oklab',\n 'oklch',\n 'color',\n])\n\nexport const colorKeywords = new KeywordSet([\n 'transparent',\n 'currentcolor',\n])\n","import { KeywordSet } from \"../keyword-set.js\"\n\nconst SYSTEM_FONTS = new KeywordSet([\n\t'caption',\n\t'icon',\n\t'menu',\n\t'message-box',\n\t'small-caption',\n\t'status-bar',\n])\n\nconst SIZE_KEYWORDS = new KeywordSet([\n\t/* <absolute-size> values */\n\t'xx-small',\n\t'x-small',\n\t'small',\n\t'medium',\n\t'large',\n\t'x-large',\n\t'xx-large',\n\t'xxx-large',\n\t/* <relative-size> values */\n\t'smaller',\n\t'larger',\n])\n\nconst COMMA = 44 // ','.charCodeAt(0) === 44\nconst SLASH = 47 // '/'.charCodeAt(0) === 47\nconst TYPE_OPERATOR = 'Operator'\nconst TYPE_IDENTIFIER = 'Identifier'\n\nexport function isSystemFont(node) {\n\tlet firstChild = node.children.first\n\tif (firstChild === null) return false\n\treturn firstChild.type === TYPE_IDENTIFIER && SYSTEM_FONTS.has(firstChild.name)\n}\n\nexport function destructure(value, stringifyNode) {\n\tlet font_family = []\n\tlet font_size\n\tlet line_height\n\n\tvalue.children.forEach(function (node, item) {\n\t\t// any node that comes before the '/' is the font-size\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type === TYPE_OPERATOR &&\n\t\t\titem.next.data.value.charCodeAt(0) === SLASH\n\t\t) {\n\t\t\tfont_size = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that comes after '/' is the line-height\n\t\tif (\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === TYPE_OPERATOR &&\n\t\t\titem.prev.data.value.charCodeAt(0) === SLASH\n\t\t) {\n\t\t\tline_height = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's followed by ',' is a font-family\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type === TYPE_OPERATOR &&\n\t\t\titem.next.data.value.charCodeAt(0) === COMMA &&\n\t\t\t!font_family[0]\n\t\t) {\n\t\t\tfont_family[0] = node\n\n\t\t\tif (!font_size && item.prev != null) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// If, after taking care of font-size and line-height, we still have a remaining dimension, it must be the oblique angle\n\t\tif (\n\t\t\tnode.type === 'Dimension' &&\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === TYPE_IDENTIFIER &&\n\t\t\titem.prev.data.name === 'oblique'\n\t\t) {\n\t\t\t// put in the correct amount of whitespace between `oblique` and `<angle>`\n\t\t\tfont_style +=\n\t\t\t\t''.padStart(node.loc.start.offset - item.prev.data.loc.end.offset) +\n\t\t\t\tstringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's a number and not previously caught by line-height or font-size is the font-weight\n\t\t// (oblique <angle> will not be caught here, because that's a Dimension, not a Number)\n\t\tif (node.type === 'Number') {\n\t\t\treturn\n\t\t}\n\n\t\t// last node always ends the font-family\n\t\tif (item.next === null) {\n\t\t\tfont_family[1] = node\n\n\t\t\t// if, at the last node, we don;t have a size yet, it *must* be the previous node\n\t\t\t// unless `font: menu` (system font), because then there's simply no size\n\t\t\tif (!font_size && !font_family[0] && item.prev) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// Any remaining identifiers can be font-size, font-style, font-stretch, font-variant or font-weight\n\t\tif (node.type === TYPE_IDENTIFIER) {\n\t\t\tif (SIZE_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_size = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t})\n\n\treturn {\n\t\tfont_size,\n\t\tline_height,\n\t\tfont_family: stringifyNode({\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\toffset: (font_family[0] || font_family[1]).loc.start.offset\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\toffset: font_family[1].loc.end.offset\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t}\n}","import { KeywordSet } from \"../keyword-set.js\"\n\nconst keywords = new KeywordSet([\n 'auto',\n 'inherit',\n 'initial',\n 'unset',\n 'revert',\n 'revert-layer',\n 'none', // for `text-shadow`, `box-shadow` and `background`\n])\n\nexport function isValueKeyword(node) {\n if (!node.children) return false\n if (node.children.size > 1 || node.children.size === 0) return false\n\n let firstChild = node.children.first\n return firstChild.type === 'Identifier' && keywords.has(firstChild.name)\n}\n","import { KeywordSet } from \"../keyword-set.js\"\n\nconst TIMING_KEYWORDS = new KeywordSet([\n 'linear',\n 'ease',\n 'ease-in',\n 'ease-out',\n 'ease-in-out',\n 'step-start',\n 'step-end',\n])\n\nconst TIMING_FUNCTION_VALUES = new KeywordSet([\n 'cubic-bezier',\n 'steps'\n])\n\nexport function analyzeAnimation(children, stringifyNode) {\n let durationFound = false\n let durations = []\n let timingFunctions = []\n\n children.forEach(child => {\n let type = child.type\n\n // Right after a ',' we start over again\n if (type === 'Operator') {\n return durationFound = false\n }\n if (type === 'Dimension' && durationFound === false) {\n durationFound = true\n return durations.push(stringifyNode(child))\n }\n if (type === 'Identifier' && TIMING_KEYWORDS.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n if (type === 'Function' && TIMING_FUNCTION_VALUES.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n })\n\n return [durations, timingFunctions]\n}\n","import { hasVendorPrefix } from '../vendor-prefix.js'\n\nexport function isAstVendorPrefixed(node) {\n if (!node.children) {\n return false\n }\n\n let children = node.children.toArray()\n\n for (let index = 0; index < children.length; index++) {\n let node = children[index]\n let { type, name } = node;\n\n if (type === 'Identifier' && hasVendorPrefix(name)) {\n return true\n }\n\n if (type === 'Function') {\n if (hasVendorPrefix(name)) {\n return true\n }\n\n if (isAstVendorPrefixed(node)) {\n return true\n }\n }\n }\n\n return false\n}\n","export class Collection {\n\tconstructor({ useLocations = false }) {\n\t\t/** @type {Map<string, Array<Number>>} */\n\t\tthis._items = new Map()\n\t\tthis._total = 0\n\t\t/** @type {number[]} */\n\t\tthis.node_lines = []\n\t\t/** @type {number[]} */\n\t\tthis.node_columns = []\n\t\t/** @type {number[]} */\n\t\tthis.node_lengths = []\n\t\t/** @type {number[]} */\n\t\tthis.node_offsets = []\n\n\t\t/** @type {boolean} */\n\t\tthis._useLocations = useLocations\n\t}\n\n\t/**\n\t * @param {string} item\n\t * @param {import('css-tree').CssLocation} node_location\n\t */\n\tpush(item, node_location) {\n\t\tlet index = this._total\n\n\t\tthis.node_lines[index] = node_location.start.line\n\t\tthis.node_columns[index] = node_location.start.column\n\t\tthis.node_offsets[index] = node_location.start.offset\n\t\tthis.node_lengths[index] = node_location.end.offset - node_location.start.offset\n\n\t\tif (this._items.has(item)) {\n\t\t\t/** @type number[] */\n\t\t\tlet list = this._items.get(item)\n\t\t\tlist.push(index)\n\t\t\tthis._total++\n\t\t\treturn\n\t\t}\n\n\t\tthis._items.set(item, [index])\n\t\tthis._total++\n\t}\n\n\tsize() {\n\t\treturn this._total\n\t}\n\n\tcount() {\n\t\tlet uniqueWithLocations = new Map()\n\t\tlet unique = {}\n\t\tthis._items.forEach((list, key) => {\n\t\t\tlet nodes = list.map(index => ({\n\t\t\t\tline: this.node_lines[index],\n\t\t\t\tcolumn: this.node_columns[index],\n\t\t\t\toffset: this.node_offsets[index],\n\t\t\t\tlength: this.node_lengths[index],\n\t\t\t}))\n\t\t\tuniqueWithLocations.set(key, nodes)\n\t\t\tunique[key] = list.length\n\t\t})\n\n\t\tif (this._useLocations) {\n\t\t\treturn {\n\t\t\t\ttotal: this._total,\n\t\t\t\ttotalUnique: this._items.size,\n\t\t\t\tunique,\n\t\t\t\tuniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n\t\t\t\t__unstable__uniqueWithLocations: Object.fromEntries(uniqueWithLocations),\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttotal: this._total,\n\t\t\ttotalUnique: this._items.size,\n\t\t\tunique,\n\t\t\tuniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n\t\t}\n\t}\n}\n","import { Collection } from './collection.js'\n\nclass ContextCollection {\n constructor({ useLocations = false }) {\n this._list = new Collection({ useLocations })\n /** @type {Map<string, Collection>} */\n this._contexts = new Map()\n /** @type {boolean} */\n this.useLocations = useLocations\n }\n\n /**\n * Add an item to this _list's context\n * @param {string} item Item to push\n * @param {string} context Context to push Item to\n * @param {import('css-tree').CssLocation} node_location\n */\n push(item, context, node_location) {\n this._list.push(item, node_location)\n\n if (!this._contexts.has(context)) {\n this._contexts.set(context, new Collection({ useLocations: this.useLocations }))\n }\n\n this._contexts.get(context).push(item, node_location)\n }\n\n count() {\n /**\n * @type {Map<string, {\n * total: number,\n * totalUnique: number,\n * unique: {[k: string]: number},\n * uniquenessRatio: number\n * }>}\n */\n let itemsPerContext = new Map()\n\n for (let [context, value] of this._contexts.entries()) {\n itemsPerContext.set(context, value.count())\n }\n\n return Object.assign(this._list.count(), {\n itemsPerContext: Object.fromEntries(itemsPerContext)\n })\n }\n}\n\nexport {\n ContextCollection\n}","/**\n * Find the mode (most occurring value) in an array of Numbers\n * Takes the mean/average of multiple values if multiple values occur the same amount of times.\n *\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-mode/index.js\n * @param {Array} arr - Array to find the mode value for\n * @returns {Number} mode - The `mode` value of `arr`\n */\nfunction Mode(arr) {\n let frequencies = new Map()\n let maxOccurrences = -1\n let maxOccurenceCount = 0\n let sum = 0\n\n for (let i = 0; i < arr.length; i++) {\n let element = arr[i]\n let updatedCount = (frequencies.get(element) || 0) + 1\n frequencies.set(element, updatedCount)\n\n if (updatedCount > maxOccurrences) {\n maxOccurrences = updatedCount\n maxOccurenceCount = 0\n sum = 0\n }\n\n if (updatedCount >= maxOccurrences) {\n maxOccurenceCount++\n sum += element\n }\n }\n\n return sum / maxOccurenceCount\n}\n\n/**\n * Find the middle number in an Array of Numbers\n * Returns the average of 2 numbers if the Array length is an even number\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-median/index.js\n * @param {Array} arr - A sorted Array\n * @returns {Number} - The array's Median\n */\nfunction Median(arr) {\n let middle = arr.length / 2\n let lowerMiddleRank = Math.floor(middle)\n\n if (middle !== lowerMiddleRank) {\n return arr[lowerMiddleRank]\n }\n return (arr[lowerMiddleRank] + arr[lowerMiddleRank - 1]) / 2\n}\n\nclass AggregateCollection {\n constructor() {\n /** @type number[] */\n this._items = []\n this._sum = 0\n }\n\n /**\n * Add a new Integer at the end of this AggregateCollection\n * @param {number} item - The item to add\n */\n push(item) {\n this._items.push(item)\n this._sum += item\n }\n\n size() {\n return this._items.length\n }\n\n aggregate() {\n if (this._items.length === 0) {\n return {\n min: 0,\n max: 0,\n mean: 0,\n mode: 0,\n median: 0,\n range: 0,\n sum: 0,\n }\n }\n\n // TODO: can we avoid this sort()? It's slow\n /** @type Number[] */\n let sorted = this._items.slice().sort((a, b) => a - b)\n let min = sorted[0]\n let max = sorted[sorted.length - 1]\n\n let mode = Mode(sorted)\n let median = Median(sorted)\n\n return {\n min,\n max,\n mean: this._sum / sorted.length,\n mode,\n median,\n range: max - min,\n sum: this._sum,\n }\n }\n\n /**\n * @returns {number[]} All _items in this collection\n */\n toArray() {\n return this._items\n }\n}\n\nexport {\n AggregateCollection\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\nimport { endsWith } from '../string-utils.js'\n\n/**\n * @param {string} property\n * @see https://github.com/csstree/csstree/blob/master/lib/utils/names.js#L69\n */\nexport function isHack(property) {\n if (isCustom(property) || hasVendorPrefix(property)) return false\n\n let code = property.charCodeAt(0)\n\n return code === 47 // /\n || code === 95 // _\n || code === 43 // +\n || code === 42 // *\n || code === 38 // &\n || code === 36 // $\n || code === 35 // #\n}\n\nexport function isCustom(property) {\n if (property.length < 3) return false\n // 45 === '-'.charCodeAt(0)\n return property.charCodeAt(0) === 45 && property.charCodeAt(1) === 45\n}\n\n/**\n * A check to verify that a propery is `basename` or a prefixed\n * version of that, but never a custom property that accidentally\n * ends with the same substring.\n *\n * @example\n * isProperty('animation', 'animation') // true\n * isProperty('animation', '-webkit-animation') // true\n * isProperty('animation', '--my-animation') // false\n *\n * @param {string} basename\n * @param {string} property\n * @returns {boolean} True if `property` equals `basename` without prefix\n */\nexport function isProperty(basename, property) {\n if (isCustom(property)) return false\n return endsWith(basename, property)\n}","import parse from 'css-tree/parser'\nimport walk from 'css-tree/walker'\nimport { calculate } from '@bramus/specificity/core'\nimport { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js'\nimport { getCombinators, getComplexity, isAccessibility } from './selectors/utils.js'\nimport { colorFunctions, colorKeywords, namedColors, systemColors } from './values/colors.js'\nimport { destructure, isSystemFont } from './values/destructure-font-shorthand.js'\nimport { isValueKeyword } from './values/values.js'\nimport { analyzeAnimation } from './values/animations.js'\nimport { isAstVendorPrefixed } from './values/vendor-prefix.js'\nimport { ContextCollection } from './context-collection.js'\nimport { Collection } from './collection.js'\nimport { AggregateCollection } from './aggregate-collection.js'\nimport { strEquals, startsWith, endsWith } from './string-utils.js'\nimport { hasVendorPrefix } from './vendor-prefix.js'\nimport { isCustom, isHack, isProperty } from './properties/property-utils.js'\nimport { getEmbedType } from './stylesheet/stylesheet.js'\nimport { isIe9Hack } from './values/browserhacks.js'\n\n/** @typedef {[number, number, number]} Specificity */\n\nfunction ratio(part, total) {\n if (total === 0) return 0\n return part / total\n}\n\nlet defaults = {\n useUnstableLocations: false\n}\n\n/**\n * @typedef Options\n * @property {boolean} useUnstableLocations **WARNING: EXPERIMENTAL!** Use Locations (`{ 'item': [{ line, column, offset, length }] }`) instead of a regular count per occurrence (`{ 'item': 3 }`)\n */\n\n/**\n * Analyze CSS\n * @param {string} css\n * @param {Options} options\n */\nexport function analyze(css, options = {}) {\n let settings = Object.assign({}, defaults, options)\n let useLocations = settings.useUnstableLocations === true\n let start = Date.now()\n\n /**\n * Recreate the authored CSS from a CSSTree node\n * @param {import('css-tree').CssNode} node - Node from CSSTree AST to stringify\n * @returns {string} str - The stringified node\n */\n function stringifyNode(node) {\n return stringifyNodePlain(node).trim()\n }\n\n function stringifyNodePlain(node) {\n return css.substring(node.loc.start.offset, node.loc.end.offset)\n }\n\n // Stylesheet\n let totalComments = 0\n let commentsSize = 0\n let embeds = new Collection({ useLocations })\n let embedSize = 0\n let embedTypes = {\n total: 0,\n /** @type {Map<string, {size: number, count: number}>} */\n unique: new Map()\n }\n\n let startParse = Date.now()\n\n let ast = parse(css, {\n parseCustomProperty: true, // To find font-families, colors, etc.\n positions: true, // So we can use stringifyNode()\n /** @param {string} comment */\n onComment: function (comment) {\n totalComments++\n commentsSize += comment.length\n },\n })\n\n let startAnalysis = Date.now()\n let linesOfCode = ast.loc.end.line - ast.loc.start.line + 1\n\n // Atrules\n let totalAtRules = 0\n /** @type {{[property: string]: string}[]} */\n let fontfaces = []\n let layers = new Collection({ useLocations })\n let imports = new Collection({ useLocations })\n let medias = new Collection({ useLocations })\n let mediaBrowserhacks = new Collection({ useLocations })\n let charsets = new Collection({ useLocations })\n let supports = new Collection({ useLocations })\n let supportsBrowserhacks = new Collection({ useLocations })\n let keyframes = new Collection({ useLocations })\n let prefixedKeyframes = new Collection({ useLocations })\n let containers = new Collection({ useLocations })\n\n // Rules\n let totalRules = 0\n let emptyRules = 0\n let ruleSizes = new AggregateCollection()\n let selectorsPerRule = new AggregateCollection()\n let declarationsPerRule = new AggregateCollection()\n let uniqueRuleSize = new Collection({ useLocations })\n let uniqueSelectorsPerRule = new Collection({ useLocations })\n let uniqueDeclarationsPerRule = new Collection({ useLocations })\n\n // Selectors\n let keyframeSelectors = new Collection({ useLocations })\n let uniqueSelectors = new Set()\n let prefixedSelectors = new Collection({ useLocations })\n /** @type {Specificity} */\n let maxSpecificity\n /** @type {Specificity} */\n let minSpecificity\n let specificityA = new AggregateCollection()\n let specificityB = new AggregateCollection()\n let specificityC = new AggregateCollection()\n let uniqueSpecificities = new Collection({ useLocations })\n let selectorComplexities = new AggregateCollection()\n let uniqueSelectorComplexities = new Collection({ useLocations })\n /** @type {Specificity[]} */\n let specificities = []\n let ids = new Collection({ useLocations })\n let a11y = new Collection({ useLocations })\n let combinators = new Collection({ useLocations })\n\n // Declarations\n let uniqueDeclarations = new Set()\n let totalDeclarations = 0\n let importantDeclarations = 0\n let importantsInKeyframes = 0\n let importantCustomProperties = new Collection({ useLocations })\n\n // Properties\n let properties = new Collection({ useLocations })\n let propertyHacks = new Collection({ useLocations })\n let propertyVendorPrefixes = new Collection({ useLocations })\n let customProperties = new Collection({ useLocations })\n let propertyComplexities = new AggregateCollection()\n\n // Values\n let vendorPrefixedValues = new Collection({ useLocations })\n let valueBrowserhacks = new Collection({ useLocations })\n let zindex = new Collection({ useLocations })\n let textShadows = new Collection({ useLocations })\n let boxShadows = new Collection({ useLocations })\n let fontFamilies = new Collection({ useLocations })\n let fontSizes = new Collection({ useLocations })\n let lineHeights = new Collection({ useLocations })\n let timingFunctions = new Collection({ useLocations })\n let durations = new Collection({ useLocations })\n let colors = new ContextCollection({ useLocations })\n let colorFormats = new Collection({ useLocations })\n let units = new ContextCollection({ useLocations })\n let gradients = new Collection({ useLocations })\n\n walk(ast, function (node) {\n switch (node.type) {\n case 'Atrule': {\n totalAtRules++\n let atRuleName = node.name\n\n if (atRuleName === 'font-face') {\n let descriptors = {}\n\n node.block.children.forEach(descriptor => {\n // Ignore 'Raw' nodes in case of CSS syntax errors\n if (descriptor.type === 'Declaration') {\n descriptors[descriptor.property] = stringifyNode(descriptor.value)\n }\n })\n\n fontfaces.push(descriptors)\n break\n }\n\n if (atRuleName === 'media') {\n let prelude = stringifyNode(node.prelude)\n medias.push(prelude, node.prelude.loc)\n if (isMediaBrowserhack(node.prelude)) {\n mediaBrowserhacks.push(prelude, node.prelude.loc)\n }\n break\n }\n if (atRuleName === 'supports') {\n let prelude = stringifyNode(node.prelude)\n supports.push(prelude, node.prelude.loc)\n if (isSupportsBrowserhack(node.prelude)) {\n supportsBrowserhacks.push(prelude, node.prelude.loc)\n }\n break\n }\n if (endsWith('keyframes', atRuleName)) {\n let name = '@' + atRuleName + ' ' + stringifyNode(node.prelude)\n if (hasVendorPrefix(atRuleName)) {\n prefixedKeyframes.push(name, node.prelude.loc)\n }\n keyframes.push(name, node.prelude.loc)\n break\n }\n if (atRuleName === 'import') {\n imports.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'charset') {\n charsets.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'container') {\n containers.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'layer') {\n let prelude = stringifyNode(node.prelude)\n prelude\n .split(',')\n .forEach(name => layers.push(name.trim(), node.prelude.loc))\n }\n break\n }\n case 'Rule': {\n let numSelectors = node.prelude.children ? node.prelude.children.size : 0\n let numDeclarations = node.block.children ? node.block.children.size : 0\n\n ruleSizes.push(numSelectors + numDeclarations)\n uniqueRuleSize.push(numSelectors + numDeclarations, node.loc)\n selectorsPerRule.push(numSelectors)\n uniqueSelectorsPerRule.push(numSelectors, node.prelude.loc)\n declarationsPerRule.push(numDeclarations)\n uniqueDeclarationsPerRule.push(numDeclarations, node.block.loc)\n\n totalRules++\n\n if (numDeclarations === 0) {\n emptyRules++\n }\n break\n }\n case 'Selector': {\n let selector = stringifyNode(node)\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n keyframeSelectors.push(selector, node.loc)\n return this.skip\n }\n\n if (isAccessibility(node)) {\n a11y.push(selector, node.loc)\n }\n\n let [complexity, isPrefixed] = getComplexity(node)\n\n if (isPrefixed) {\n prefixedSelectors.push(selector, node.loc)\n }\n\n uniqueSelectors.add(selector)\n selectorComplexities.push(complexity)\n uniqueSelectorComplexities.push(complexity, node.loc)\n\n // #region specificity\n let [{ value: specificityObj }] = calculate(node)\n /** @type {Specificity} */\n let specificity = [specificityObj.a, specificityObj.b, specificityObj.c]\n\n uniqueSpecificities.push(specificity[0] + ',' + specificity[1] + ',' + specificity[2], node.loc)\n\n if (maxSpecificity === undefined) {\n maxSpecificity = specificity\n }\n\n if (minSpecificity === undefined) {\n minSpecificity = specificity\n }\n\n specificityA.push(specificity[0])\n specificityB.push(specificity[1])\n specificityC.push(specificity[2])\n\n if (minSpecificity !== undefined && compareSpecificity(minSpecificity, specificity) < 0) {\n minSpecificity = specificity\n }\n\n if (maxSpecificity !== undefined && compareSpecificity(maxSpecificity, specificity) > 0) {\n maxSpecificity = specificity\n }\n\n specificities.push(specificity)\n // #endregion\n\n if (specificity[0] > 0) {\n ids.push(selector, node.loc)\n }\n\n getCombinators(node, function onCombinator(combinator) {\n combinators.push(combinator.name, combinator.loc)\n })\n\n // Avoid deeper walking of selectors to not mess with\n // our specificity calculations in case of a selector\n // with :where() or :is() that contain SelectorLists\n // as children\n return this.skip\n }\n case 'Dimension': {\n if (!this.declaration) {\n break\n }\n\n /** @type {string} */\n let unit = node.unit\n\n if (endsWith('\\\\9', unit)) {\n units.push(unit.substring(0, unit.length - 2), this.declaration.property, node.loc)\n } else {\n units.push(unit, this.declaration.property, node.loc)\n }\n\n return this.skip\n }\n case 'Url': {\n if (startsWith('data:', node.value)) {\n let embed = node.value\n let size = embed.length\n let type = getEmbedType(embed)\n\n embedTypes.total++\n embedSize += size\n\n if (embedTypes.unique.has(type)) {\n let item = embedTypes.unique.get(type)\n item.count++\n item.size += size\n embedTypes.unique.set(type, item)\n } else {\n embedTypes.unique.set(type, {\n count: 1,\n size\n })\n }\n\n // @deprecated\n embeds.push(embed, node.loc)\n }\n break\n }\n case 'Value': {\n if (isValueKeyword(node)) {\n break\n }\n\n let declaration = this.declaration\n let { property, important } = declaration\n\n if (isAstVendorPrefixed(node)) {\n vendorPrefixedValues.push(stringifyNode(node), node.loc)\n }\n\n // i.e. `property: value !ie`\n if (typeof important === 'string') {\n valueBrowserhacks.push(stringifyNodePlain(node) + '!' + important, node.loc)\n }\n\n // i.e. `property: value\\9`\n if (isIe9Hack(node)) {\n valueBrowserhacks.push(stringifyNode(node), node.loc)\n }\n\n // Process properties first that don't have colors,\n // so we can avoid further walking them;\n if (isProperty('z-index', property)) {\n zindex.push(stringifyNode(node), node.loc)\n return this.skip\n } else if (isProperty('font', property)) {\n if (isSystemFont(node)) return\n\n let { font_size, line_height, font_family } = destructure(node, stringifyNode)\n\n if (font_family) {\n fontFamilies.push(font_family, node.loc)\n }\n if (font_size) {\n fontSizes.push(font_size, node.loc)\n }\n if (line_height) {\n lineHeights.push(line_height, node.loc)\n }\n\n break\n } else if (isProperty('font-size', property)) {\n if (!isSystemFont(node)) {\n fontSizes.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('font-family', property)) {\n if (!isSystemFont(node)) {\n fontFamilies.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('line-height', property)) {\n lineHeights.push(stringifyNode(node), node.loc)\n } else if (isProperty('transition', property) || isProperty('animation', property)) {\n let [times, fns] = analyzeAnimation(node.children, stringifyNode)\n for (let i = 0; i < times.length; i++) {\n durations.push(times[i], node.loc)\n }\n for (let i = 0; i < fns.length; i++) {\n timingFunctions.push(fns[i], node.loc)\n }\n break\n } else if (isProperty('animation-duration', property) || isProperty('transition-duration', property)) {\n if (node.children && node.children.size > 1) {\n node.children.forEach(child => {\n if (child.type !== 'Operator') {\n durations.push(stringifyNode(child), node.loc)\n }\n })\n } else {\n durations.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('transition-timing-function', property) || isProperty('animation-timing-function', property)) {\n if (node.children && node.children.size > 1) {\n node.children.forEach(child => {\n if (child.type !== 'Operator') {\n timingFunctions.push(stringifyNode(child), node.loc)\n }\n })\n } else {\n timingFunctions.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('text-shadow', property)) {\n if (!isValueKeyword(node)) {\n textShadows.push(stringifyNode(node), node.loc)\n }\n // no break here: potentially contains colors\n } else if (isProperty('box-shadow', property)) {\n if (!isValueKeyword(node)) {\n boxShadows.push(stringifyNode(node), node.loc)\n }\n // no break here: potentially contains colors\n }\n\n walk(node, function (valueNode) {\n let nodeName = valueNode.name\n\n switch (valueNode.type) {\n case 'Hash': {\n let hexLength = valueNode.value.length\n if (endsWith('\\\\9', valueNode.value)) {\n hexLength = hexLength - 2\n }\n colors.push('#' + valueNode.value, property, valueNode.loc)\n colorFormats.push(`hex` + hexLength, valueNode.loc)\n\n return this.skip\n }\n case 'Identifier': {\n // Bail out if it can't be a color name\n // 20 === 'lightgoldenrodyellow'.length\n // 3 === 'red'.length\n if (nodeName.length > 20 || nodeName.length < 3) {\n return this.skip\n }\n\n if (namedColors.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push('named', valueNode.loc)\n return\n }\n\n if (colorKeywords.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push(nodeName.toLowerCase(), valueNode.loc)\n return\n }\n\n if (systemColors.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push('system', valueNode.loc)\n return\n }\n return this.skip\n }\n case 'Function': {\n // Don't walk var() multiple times\n if (strEquals('var', nodeName)) {\n return this.skip\n }\n\n if (colorFunctions.has(nodeName)) {\n colors.push(stringifyNode(valueNode), property, valueNode.loc)\n colorFormats.push(nodeName.toLowerCase(), valueNode.loc)\n return\n }\n\n if (endsWith('gradient', nodeName)) {\n gradients.push(stringifyNode(valueNode), valueNode.loc)\n return\n }\n // No this.skip here intentionally,\n // otherwise we'll miss colors in linear-gradient() etc.\n }\n }\n })\n break\n }\n case 'Declaration': {\n // Do not process Declarations in atRule preludes\n // because we will handle them manually\n if (this.atrulePrelude !== null) {\n return this.skip\n }\n\n totalDeclarations++\n\n uniqueDeclarations.add(stringifyNode(node))\n\n if (node.important === true) {\n importantDeclarations++\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n importantsInKeyframes++\n }\n }\n\n let { property } = node\n let propertyLoc = {\n start: {\n line: node.loc.start.line,\n column: node.loc.start.column,\n offset: node.loc.start.offset\n },\n end: {\n offset: node.loc.start.offset + property.length\n }\n }\n\n properties.push(property, propertyLoc)\n\n if (hasVendorPrefix(property)) {\n propertyVendorPrefixes.push(property, propertyLoc)\n propertyComplexities.push(2)\n } else if (isHack(property)) {\n propertyHacks.push(property, propertyLoc)\n propertyComplexities.push(2)\n } else if (isCustom(property)) {\n customProperties.push(property, propertyLoc)\n propertyComplexities.push(2)\n if (node.important === true) {\n importantCustomProperties.push(property, propertyLoc)\n }\n } else {\n propertyComplexities.push(1)\n }\n break\n }\n }\n })\n\n let embeddedContent = embeds.count()\n\n let totalUniqueDeclarations = uniqueDeclarations.size\n\n let totalSelectors = selectorComplexities.size()\n let specificitiesA = specificityA.aggregate()\n let specificitiesB = specificityB.aggregate()\n let specificitiesC = specificityC.aggregate()\n let totalUniqueSelectors = uniqueSelectors.size\n let assign = Object.assign\n\n return {\n stylesheet: {\n sourceLinesOfCode: totalAtRules + totalSelectors + totalDeclarations + keyframeSelectors.size(),\n linesOfCode,\n size: css.length,\n comments: {\n total: totalComments,\n size: commentsSize,\n },\n embeddedContent: assign(embeddedContent, {\n size: {\n total: embedSize,\n ratio: ratio(embedSize, css.length),\n },\n types: {\n total: embedTypes.total,\n totalUnique: embedTypes.unique.size,\n uniquenessRatio: ratio(embedTypes.unique.size, embedTypes.total),\n unique: Object.fromEntries(embedTypes.unique),\n },\n }),\n },\n atrules: {\n fontface: {\n total: fontfaces.length,\n totalUnique: fontfaces.length,\n unique: fontfaces,\n uniquenessRatio: fontfaces.length === 0 ? 0 : 1\n },\n import: imports.count(),\n media: assign(\n medias.count(),\n {\n browserhacks: mediaBrowserhacks.count(),\n }\n ),\n charset: charsets.count(),\n supports: assign(\n supports.count(),\n {\n browserhacks: supportsBrowserhacks.count(),\n },\n ),\n keyframes: assign(\n keyframes.count(), {\n prefixed: assign(\n prefixedKeyframes.count(), {\n ratio: ratio(prefixedKeyframes.size(), keyframes.size())\n }),\n }),\n container: containers.count(),\n layer: layers.count(),\n },\n rules: {\n total: totalRules,\n empty: {\n total: emptyRules,\n ratio: ratio(emptyRules, totalRules)\n },\n sizes: assign(\n ruleSizes.aggregate(),\n {\n items: ruleSizes.toArray(),\n },\n uniqueRuleSize.count(),\n ),\n selectors: assign(\n selectorsPerRule.aggregate(),\n {\n items: selectorsPerRule.toArray(),\n },\n uniqueSelectorsPerRule.count(),\n ),\n declarations: assign(\n declarationsPerRule.aggregate(),\n {\n items: declarationsPerRule.toArray(),\n },\n uniqueDeclarationsPerRule.count(),\n ),\n },\n selectors: {\n total: totalSelectors,\n totalUnique: totalUniqueSelectors,\n uniquenessRatio: ratio(totalUniqueSelectors, totalSelectors),\n specificity: assign(\n {\n /** @type Specificity */\n min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,\n /** @type Specificity */\n max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,\n /** @type Specificity */\n sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],\n /** @type Specificity */\n mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],\n /** @type Specificity */\n mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],\n /** @type Specificity */\n median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],\n items: specificities,\n },\n uniqueSpecificities.count(),\n ),\n complexity: assign(\n selectorComplexities.aggregate(),\n uniqueSelectorComplexities.count(),\n {\n items: selectorComplexities.toArray(),\n }\n ),\n id: assign(\n ids.count(), {\n ratio: ratio(ids.size(), totalSelectors),\n }),\n accessibility: assign(\n a11y.count(), {\n ratio: ratio(a11y.size(), totalSelectors),\n }),\n keyframes: keyframeSelectors.count(),\n prefixed: assign(\n prefixedSelectors.count(),\n {\n ratio: ratio(prefixedSelectors.size(), totalSelectors),\n },\n ),\n combinators: combinators.count(),\n },\n declarations: {\n total: totalDeclarations,\n totalUnique: totalUniqueDeclarations,\n uniquenessRatio: ratio(totalUniqueDeclarations, totalDeclarations),\n // @TODO: deprecated, remove in next major version\n unique: {\n total: totalUniqueDeclarations,\n ratio: ratio(totalUniqueDeclarations, totalDeclarations),\n },\n importants: {\n total: importantDeclarations,\n ratio: ratio(importantDeclarations, totalDeclarations),\n inKeyframes: {\n total: importantsInKeyframes,\n ratio: ratio(importantsInKeyframes, importantDeclarations),\n },\n },\n },\n properties: assign(\n properties.count(),\n {\n prefixed: assign(\n propertyVendorPrefixes.count(),\n {\n ratio: ratio(propertyVendorPrefixes.size(), properties.size()),\n },\n ),\n custom: assign(\n customProperties.count(),\n {\n ratio: ratio(customProperties.size(), properties.size()),\n importants: assign(\n importantCustomProperties.count(),\n {\n ratio: ratio(importantCustomProperties.size(), customProperties.size()),\n }\n ),\n },\n ),\n browserhacks: assign(\n propertyHacks.count(), {\n ratio: ratio(propertyHacks.size(), properties.size()),\n }),\n complexity: propertyComplexities.aggregate(),\n }),\n values: {\n colors: assign(\n colors.count(),\n {\n formats: colorFormats.count(),\n },\n ),\n gradients: gradients.count(),\n fontFamilies: fontFamilies.count(),\n fontSizes: fontSizes.count(),\n lineHeights: lineHeights.count(),\n zindexes: zindex.count(),\n textShadows: textShadows.count(),\n boxShadows: boxShadows.count(),\n animations: {\n durations: durations.count(),\n timingFunctions: timingFunctions.count(),\n },\n prefixes: vendorPrefixedValues.count(),\n browserhacks: valueBrowserhacks.count(),\n units: units.count(),\n },\n __meta__: {\n parseTime: startAnalysis - startParse,\n analyzeTime: Date.now() - startAnalysis,\n total: Date.now() - start\n }\n }\n}\n\n/**\n * Compare specificity A to Specificity B\n * @param {Specificity} a - Specificity A\n * @param {Specificity} b - Specificity B\n * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b\n */\nexport function compareSpecificity(a, b) {\n if (a[0] === b[0]) {\n if (a[1] === b[1]) {\n return b[2] - a[2]\n }\n\n return b[1] - a[1]\n }\n\n return b[0] - a[0]\n}","/** @param {string} embed */\nexport function getEmbedType(embed) {\n\t// data:image/gif;base64,R0lG\n\tlet start = 5 // `data:`.length\n\tlet semicolon = embed.indexOf(';')\n\tlet comma = embed.indexOf(',')\n\n\tif (semicolon === -1) {\n\t\treturn embed.substring(start, comma)\n\t}\n\n\tif (comma !== -1 && comma < semicolon) {\n\t\treturn embed.substring(start, comma);\n\t}\n\n\treturn embed.substring(start, semicolon)\n}","import { endsWith } from \"../string-utils.js\"\n\nexport function isIe9Hack(node) {\n\tlet children = node.children\n\treturn children\n\t\t&& children.last\n\t\t&& children.last.type === 'Identifier'\n\t\t&& endsWith('\\\\9', children.last.name)\n}"],"names":["compareChar","referenceCode","testCode","strEquals","base","maybe","len","length","i","charCodeAt","endsWith","offset","startsWith","isPropertyValue","node","property","value","children","first","type","name","hasVendorPrefix","keyword","indexOf","analyzeList","selectorListAst","cb","childSelectors","walk","visit","enter","push","isPseudoFunction","isAccessibility","selector","isA11y","some","b","skip","getComplexity","complexity","isPrefixed","Boolean","list","forEach","KeywordSet","items","this","set","has","item","index","namedColors","systemColors","colorFunctions","colorKeywords","SYSTEM_FONTS","SIZE_KEYWORDS","isSystemFont","firstChild","keywords","isValueKeyword","size","TIMING_KEYWORDS","TIMING_FUNCTION_VALUES","isAstVendorPrefixed","toArray","Collection","useLocations","_items","Map","_total","node_lines","node_columns","node_lengths","node_offsets","_useLocations","node_location","start","line","column","end","get","count","uniqueWithLocations","unique","key","nodes","map","_this","total","totalUnique","uniquenessRatio","__unstable__uniqueWithLocations","Object","fromEntries","ContextCollection","_list","_contexts","context","itemsPerContext","entries","assign","AggregateCollection","_sum","aggregate","min","max","mean","mode","median","range","sum","arr","middle","lowerMiddleRank","sorted","slice","sort","a","frequencies","maxOccurrences","maxOccurenceCount","element","updatedCount","Mode","Math","floor","isCustom","isProperty","basename","ratio","part","defaults","useUnstableLocations","compareSpecificity","css","options","Date","now","stringifyNode","stringifyNodePlain","trim","substring","loc","maxSpecificity","minSpecificity","totalComments","commentsSize","embeds","embedSize","embedTypes","startParse","ast","parse","parseCustomProperty","positions","onComment","comment","startAnalysis","linesOfCode","totalAtRules","fontfaces","layers","imports","medias","mediaBrowserhacks","charsets","supports","supportsBrowserhacks","keyframes","prefixedKeyframes","containers","totalRules","emptyRules","ruleSizes","selectorsPerRule","declarationsPerRule","uniqueRuleSize","uniqueSelectorsPerRule","uniqueDeclarationsPerRule","keyframeSelectors","uniqueSelectors","Set","prefixedSelectors","specificityA","specificityB","specificityC","uniqueSpecificities","selectorComplexities","uniqueSelectorComplexities","specificities","ids","a11y","combinators","uniqueDeclarations","totalDeclarations","importantDeclarations","importantsInKeyframes","importantCustomProperties","properties","propertyHacks","propertyVendorPrefixes","customProperties","propertyComplexities","vendorPrefixedValues","valueBrowserhacks","zindex","textShadows","boxShadows","fontFamilies","fontSizes","lineHeights","timingFunctions","durations","colors","colorFormats","units","gradients","atRuleName","descriptors","block","descriptor","prelude","returnValue","unit","isMediaBrowserhack","isSupportsBrowserhack","split","numSelectors","numDeclarations","atrule","add","specificityObj","calculate","specificity","c","undefined","onMatch","selectorNode","previousLoc","prev","data","getCombinators","combinator","declaration","embed","semicolon","comma","getEmbedType","important","last","isIe9Hack","font_size","line_height","font_family","next","font_style","padStart","destructure","durationFound","child","analyzeAnimation","times","fns","valueNode","nodeName","hexLength","stringified","toLowerCase","atrulePrelude","propertyLoc","code","isHack","embeddedContent","totalUniqueDeclarations","totalSelectors","specificitiesA","specificitiesB","specificitiesC","totalUniqueSelectors","stylesheet","sourceLinesOfCode","comments","types","atrules","fontface","import","media","browserhacks","charset","prefixed","container","layer","rules","empty","sizes","selectors","declarations","id","accessibility","importants","inKeyframes","custom","values","formats","zindexes","animations","prefixes","__meta__","parseTime","analyzeTime"],"mappings":"wNAMA,SAASA,EAAYC,EAAeC,GAMlC,OAJIA,GAAY,IAAUA,GAAY,KAEpCA,GAAsB,IAEjBD,IAAkBC,CAC1B,UAceC,EAAUC,EAAMC,GAC9B,IAAIC,EAAMF,EAAKG,OACf,GAAID,IAAQD,EAAME,OAAQ,SAE1B,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAK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GF,QACA,OCrBWE,EAAc,IAAIP,EAAW,CAKxC,QACA,QACA,MACA,OACA,OACA,OACA,QACA,gBACA,SACA,SAEA,YACA,eACA,OACA,aACA,QACA,QACA,SACA,iBACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,cACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,YACA,SACA,QACA,aACA,gBAGWQ,EAAe,IAAIR,EAAW,CAGzC,SACA,aACA,WACA,cACA,aACA,aACA,aACA,eACA,QACA,YACA,YACA,gBACA,eACA,mBACA,OACA,WACA,aAMWS,EAAiB,IAAIT,EAAW,CAC3C,MACA,OACA,MACA,OACA,MACA,MACA,MACA,QACA,QACA,UAGWU,EAAgB,IAAIV,EAAW,CAC1C,cACA,iBCpMIW,EAAe,IAAIX,EAAW,CACnC,UACA,OACA,OACA,cACA,gBACA,eAGKY,EAAgB,IAAIZ,EAAW,CAEpC,WACA,UACA,QACA,SACA,QACA,UACA,WACA,YAEA,UACA,oBAQea,EAAa5C,GAC5B,IAAI6C,EAAa7C,EAAKG,SAASC,MAC/B,OAAmB,OAAfyC,G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WAAYA,GAAW9H,QACvBgO,WAAY,CACV7F,UAAWA,GAAUnI,QACrBkI,gBAAiBA,GAAgBlI,SAEnCiO,SAAUvG,GAAqB1H,QAC/B8M,aAAcnF,GAAkB3H,QAChCsI,MAAOA,GAAMtI,SAEfkO,SAAU,CACRC,UAAWvJ,EAAgBP,EAC3B+J,YAAa7K,KAAKC,MAAQoB,EAC1BrE,MAAOgD,KAAKC,MAAQ7D,GAGzB"}
|
|
1
|
+
{"version":3,"file":"analyzer.cjs","sources":["../src/string-utils.js","../src/atrules/atrules.js","../src/vendor-prefix.js","../src/selectors/utils.js","../src/keyword-set.js","../src/values/colors.js","../src/values/destructure-font-shorthand.js","../src/values/values.js","../src/values/animations.js","../src/values/vendor-prefix.js","../src/collection.js","../src/context-collection.js","../src/aggregate-collection.js","../src/properties/property-utils.js","../src/index.js","../src/stylesheet/stylesheet.js","../src/values/browserhacks.js"],"sourcesContent":["/**\n * Case-insensitive compare two character codes\n * @param {string} referenceCode\n * @param {string} testCode\n * @see https://github.com/csstree/csstree/blob/41f276e8862d8223eeaa01a3d113ab70bb13d2d9/lib/tokenizer/utils.js#L22\n */\nfunction compareChar(referenceCode, testCode) {\n // if uppercase\n if (testCode >= 0x0041 && testCode <= 0x005A) {\n // shifting the 6th bit makes a letter lowercase\n testCode = testCode | 32\n }\n return referenceCode === testCode\n}\n\n/**\n * Case-insensitive string-comparison\n * @example\n * strEquals('test', 'test') // true\n * strEquals('test', 'TEST') // true\n * strEquals('test', 'TesT') // true\n * strEquals('test', 'derp') // false\n *\n * @param {string} base The string to check against\n * @param {string} maybe The test string, possibly containing uppercased characters\n * @returns {boolean} true if the two strings are the same, false otherwise\n */\nexport function strEquals(base, maybe) {\n let len = base.length;\n if (len !== maybe.length) return false\n\n for (let i = 0; i < len; i++) {\n if (compareChar(base.charCodeAt(i), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string ends with a given substring\n *\n * @example\n * endsWith('test', 'my-test') // true\n * endsWith('test', 'est') // false\n *\n * @param {string} base e.g. '-webkit-transform'\n * @param {string} maybe e.g. 'transform'\n * @returns {boolean} true if `test` ends with `base`, false otherwise\n */\nexport function endsWith(base, maybe) {\n let len = maybe.length\n let offset = len - base.length\n\n if (offset < 0) {\n return false\n }\n\n for (let i = len - 1; i >= offset; i--) {\n if (compareChar(base.charCodeAt(i - offset), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string starts with a given substring\n * @param {string} base\n * @param {string} maybe\n * @returns {boolean} true if `test` starts with `base`, false otherwise\n */\nexport function startsWith(base, maybe) {\n let len = base.length\n if (maybe.length < len) return false\n\n for (let i = 0; i < len; i++) {\n if (compareChar(base.charCodeAt(i), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n","import { strEquals, startsWith, endsWith } from '../string-utils.js'\nimport walk from 'css-tree/walker'\n\n/**\n * Check whether node.property === property and node.value === value,\n * but case-insensitive and fast.\n * @param {import('css-tree').Declaration} node\n * @param {string} property - The CSS property to compare with (case-insensitive)\n * @param {string} value - The identifier/keyword value to compare with\n * @returns true if declaratioNode is the given property: value, false otherwise\n */\nfunction isPropertyValue(node, property, value) {\n return strEquals(property, node.property)\n && node.value.children.first.type === 'Identifier'\n && strEquals(value, node.value.children.first.name)\n}\n\n/**\n * Check if an @supports atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isSupportsBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'Declaration') {\n if (\n isPropertyValue(node, '-webkit-appearance', 'none')\n || isPropertyValue(node, '-moz-appearance', 'meterbar')\n ) {\n returnValue = true\n return this.break\n }\n }\n })\n\n return returnValue\n}\n\n/**\n * Check if a @media atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isMediaBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'MediaQuery'\n && node.children.size === 1\n && node.children.first.type === 'Identifier'\n ) {\n node = node.children.first\n // Note: CSSTree adds a trailing space to \\\\9\n if (startsWith('\\\\0', node.name) || endsWith('\\\\9 ', node.name)) {\n returnValue = true\n return this.break\n }\n }\n if (node.type === 'MediaFeature') {\n if (node.value !== null && node.value.unit === '\\\\0') {\n returnValue = true\n return this.break\n }\n if (strEquals('-moz-images-in-menus', node.name)\n || strEquals('min--moz-device-pixel-ratio', node.name)\n || strEquals('-ms-high-contrast', node.name)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('min-resolution', node.name)\n && strEquals('.001', node.value.value)\n && strEquals('dpcm', node.value.unit)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('-webkit-min-device-pixel-ratio', node.name)) {\n if ((strEquals('0', node.value.value) || strEquals('10000', node.value.value))) {\n returnValue = true\n return this.break\n }\n }\n }\n })\n\n return returnValue\n}","const HYPHENMINUS = 45; // '-'.charCodeAt()\n\n/**\n * @param {string} keyword\n * @returns {boolean}\n */\nfunction hasVendorPrefix(keyword) {\n if (keyword.charCodeAt(0) === HYPHENMINUS && keyword.charCodeAt(1) !== HYPHENMINUS) {\n // String must have a 2nd occurrence of '-', at least at position 3 (offset=2)\n if (keyword.indexOf('-', 2) !== -1) {\n return true\n }\n }\n\n return false\n}\n\nexport {\n hasVendorPrefix\n}","import walk from 'css-tree/walker'\nimport { startsWith, strEquals } from '../string-utils.js'\nimport { hasVendorPrefix } from '../vendor-prefix.js'\n\n/**\n *\n * @param {import('css-tree').SelectorList} selectorListAst\n * @returns {Selector[]} Analyzed selectors in the selectorList\n */\nfunction analyzeList(selectorListAst, cb) {\n let childSelectors = []\n walk(selectorListAst, {\n visit: 'Selector',\n enter: function (node) {\n childSelectors.push(cb(node))\n }\n })\n\n return childSelectors\n}\n\nfunction isPseudoFunction(name) {\n return (\n strEquals(name, 'not')\n || strEquals(name, 'nth-child')\n || strEquals(name, 'nth-last-child')\n || strEquals(name, 'where')\n || strEquals(name, 'is')\n || strEquals(name, 'has')\n || strEquals(name, 'matches')\n || strEquals(name, '-webkit-any')\n || strEquals(name, '-moz-any')\n )\n}\n\n/** @param {import('css-tree').Selector} selector */\nexport function isAccessibility(selector) {\n let isA11y = false\n\n walk(selector, function (node) {\n if (node.type === 'AttributeSelector') {\n if (strEquals('role', node.name.name) || startsWith('aria-', node.name.name)) {\n isA11y = true\n return this.break\n }\n }\n // Test for [aria-] or [role] inside :is()/:where() and friends\n else if (node.type === 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n let list = analyzeList(node, isAccessibility)\n\n if (list.some(b => b === true)) {\n isA11y = true\n return this.skip\n }\n\n return this.skip\n }\n }\n })\n\n return isA11y;\n}\n\n/**\n * Get the Complexity for the AST of a Selector Node\n * @param {import('css-tree').Selector} ast - AST Node for a Selector\n * @return {[number, boolean]} - The numeric complexity of the Selector and whether it's prefixed or not\n */\nexport function getComplexity(selector) {\n let complexity = 0\n let isPrefixed = false\n\n walk(selector, function (node) {\n if (node.type === 'Selector' || node.type === 'Nth') return\n\n complexity++\n\n if (node.type === 'IdSelector'\n || node.type === 'ClassSelector'\n || node.type === 'PseudoElementSelector'\n || node.type === 'TypeSelector'\n || node.type === 'PseudoClassSelector'\n ) {\n if (hasVendorPrefix(node.name)) {\n isPrefixed = true\n complexity++\n }\n }\n\n if (node.type === 'AttributeSelector') {\n if (Boolean(node.value)) {\n complexity++\n }\n if (hasVendorPrefix(node.name.name)) {\n isPrefixed = true\n complexity++\n }\n return this.skip\n }\n\n if (node.type === 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n let list = analyzeList(node, getComplexity)\n\n // Bail out for empty/non-existent :nth-child() params\n if (list.length === 0) return\n\n list.forEach(([c, p]) => {\n complexity += c\n if (p === true) isPrefixed = true\n })\n return this.skip\n }\n }\n })\n\n return [complexity, isPrefixed]\n}\n\n/**\n * Walk a selector node and trigger a callback every time a Combinator was found\n * We need create the `loc` for descendant combinators manually, because CSSTree\n * does not keep track of whitespace for us. We'll assume that the combinator is\n * alwas a single ` ` (space) character, even though there could be newlines or\n * multiple spaces\n * @param {import('css-tree').CssNode} node\n * @param {*} onMatch\n */\nexport function getCombinators(node, onMatch) {\n walk(node, function (\n /** @type {import('css-tree').CssNode} */ selectorNode,\n /** @type {import('css-tree').ListItem} */ item\n ) {\n if (selectorNode.type === 'Combinator') {\n // .loc is null when selectorNode.name === ' '\n if (selectorNode.loc === null) {\n let previousLoc = item.prev.data.loc.end\n let start = {\n offset: previousLoc.offset,\n line: previousLoc.line,\n column: previousLoc.column\n }\n\n onMatch({\n name: selectorNode.name,\n loc: {\n start,\n end: {\n offset: start.offset + 1,\n line: start.line,\n column: start.column + 1\n }\n }\n })\n } else {\n onMatch({\n name: selectorNode.name,\n loc: selectorNode.loc\n })\n }\n }\n })\n}\n","import { strEquals } from \"./string-utils.js\"\n\n/**\n * @description A Set-like construct to search CSS keywords in a case-insensitive way\n */\nexport class KeywordSet {\n\n\t/** @param {string[]} items */\n\tconstructor(items) {\n\t\t/** @type {string[]} */\n\t\tthis.set = items\n\t}\n\n\t/** @param {string} item */\n\thas(item) {\n\t\tlet len = this.set.length\n\n\t\tfor (let index = 0; index < len; index++) {\n\t\t\tif (strEquals(this.set[index], item)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n}","import { KeywordSet } from \"../keyword-set.js\"\n\nexport const namedColors = new KeywordSet([\n // CSS Named Colors\n // Spec: https://drafts.csswg.org/css-color/#named-colors\n\n // Heuristic: popular names first for quick finding in set.has()\n 'white',\n 'black',\n 'red',\n 'blue',\n 'gray',\n 'grey',\n 'green',\n 'rebeccapurple',\n 'yellow',\n 'orange',\n\n 'aliceblue',\n 'antiquewhite',\n 'aqua',\n 'aquamarine',\n 'azure',\n 'beige',\n 'bisque',\n 'blanchedalmond',\n 'blueviolet',\n 'brown',\n 'burlywood',\n 'cadetblue',\n 'chartreuse',\n 'chocolate',\n 'coral',\n 'cornflowerblue',\n 'cornsilk',\n 'crimson',\n 'cyan',\n 'darkblue',\n 'darkcyan',\n 'darkgoldenrod',\n 'darkgray',\n 'darkgreen',\n 'darkgrey',\n 'darkkhaki',\n 'darkmagenta',\n 'darkolivegreen',\n 'darkorange',\n 'darkorchid',\n 'darkred',\n 'darksalmon',\n 'darkseagreen',\n 'darkslateblue',\n 'darkslategray',\n 'darkslategrey',\n 'darkturquoise',\n 'darkviolet',\n 'deeppink',\n 'deepskyblue',\n 'dimgray',\n 'dimgrey',\n 'dodgerblue',\n 'firebrick',\n 'floralwhite',\n 'forestgreen',\n 'fuchsia',\n 'gainsboro',\n 'ghostwhite',\n 'gold',\n 'goldenrod',\n 'greenyellow',\n 'honeydew',\n 'hotpink',\n 'indianred',\n 'indigo',\n 'ivory',\n 'khaki',\n 'lavender',\n 'lavenderblush',\n 'lawngreen',\n 'lemonchiffon',\n 'lightblue',\n 'lightcoral',\n 'lightcyan',\n 'lightgoldenrodyellow',\n 'lightgray',\n 'lightgreen',\n 'lightgrey',\n 'lightpink',\n 'lightsalmon',\n 'lightseagreen',\n 'lightskyblue',\n 'lightslategray',\n 'lightslategrey',\n 'lightsteelblue',\n 'lightyellow',\n 'lime',\n 'limegreen',\n 'linen',\n 'magenta',\n 'maroon',\n 'mediumaquamarine',\n 'mediumblue',\n 'mediumorchid',\n 'mediumpurple',\n 'mediumseagreen',\n 'mediumslateblue',\n 'mediumspringgreen',\n 'mediumturquoise',\n 'mediumvioletred',\n 'midnightblue',\n 'mintcream',\n 'mistyrose',\n 'moccasin',\n 'navajowhite',\n 'navy',\n 'oldlace',\n 'olive',\n 'olivedrab',\n 'orangered',\n 'orchid',\n 'palegoldenrod',\n 'palegreen',\n 'paleturquoise',\n 'palevioletred',\n 'papayawhip',\n 'peachpuff',\n 'peru',\n 'pink',\n 'plum',\n 'powderblue',\n 'purple',\n 'rosybrown',\n 'royalblue',\n 'saddlebrown',\n 'salmon',\n 'sandybrown',\n 'seagreen',\n 'seashell',\n 'sienna',\n 'silver',\n 'skyblue',\n 'slateblue',\n 'slategray',\n 'slategrey',\n 'snow',\n 'springgreen',\n 'steelblue',\n 'tan',\n 'teal',\n 'thistle',\n 'tomato',\n 'turquoise',\n 'violet',\n 'wheat',\n 'whitesmoke',\n 'yellowgreen',\n])\n\nexport const systemColors = new KeywordSet([\n // CSS System Colors\n // Spec: https://drafts.csswg.org/css-color/#css-system-colors\n 'canvas',\n 'canvastext',\n 'linktext',\n 'visitedtext',\n 'activetext',\n 'buttonface',\n 'buttontext',\n 'buttonborder',\n 'field',\n 'fieldtext',\n 'highlight',\n 'highlighttext',\n 'selecteditem',\n 'selecteditemtext',\n 'mark',\n 'marktext',\n 'graytext',\n\n // TODO: Deprecated CSS System colors\n // Spec: https://drafts.csswg.org/css-color/#deprecated-system-colors\n])\n\nexport const colorFunctions = new KeywordSet([\n 'rgb',\n 'rgba',\n 'hsl',\n 'hsla',\n 'hwb',\n 'lab',\n 'lch',\n 'oklab',\n 'oklch',\n 'color',\n])\n\nexport const colorKeywords = new KeywordSet([\n 'transparent',\n 'currentcolor',\n])\n","import { KeywordSet } from \"../keyword-set.js\"\n\nconst SYSTEM_FONTS = new KeywordSet([\n\t'caption',\n\t'icon',\n\t'menu',\n\t'message-box',\n\t'small-caption',\n\t'status-bar',\n])\n\nconst SIZE_KEYWORDS = new KeywordSet([\n\t/* <absolute-size> values */\n\t'xx-small',\n\t'x-small',\n\t'small',\n\t'medium',\n\t'large',\n\t'x-large',\n\t'xx-large',\n\t'xxx-large',\n\t/* <relative-size> values */\n\t'smaller',\n\t'larger',\n])\n\nconst COMMA = 44 // ','.charCodeAt(0) === 44\nconst SLASH = 47 // '/'.charCodeAt(0) === 47\nconst TYPE_OPERATOR = 'Operator'\nconst TYPE_IDENTIFIER = 'Identifier'\n\nexport function isSystemFont(node) {\n\tlet firstChild = node.children.first\n\tif (firstChild === null) return false\n\treturn firstChild.type === TYPE_IDENTIFIER && SYSTEM_FONTS.has(firstChild.name)\n}\n\n/**\n * @param {import('css-tree').Value} value\n * @param {*} stringifyNode\n */\nexport function destructure(value, stringifyNode) {\n\n\tlet font_family = new Array(2)\n\tlet font_size\n\tlet line_height\n\n\tvalue.children.forEach(function (node, item) {\n\t\t// any node that comes before the '/' is the font-size\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type === TYPE_OPERATOR &&\n\t\t\titem.next.data.value.charCodeAt(0) === SLASH\n\t\t) {\n\t\t\tfont_size = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that comes after '/' is the line-height\n\t\tif (\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === TYPE_OPERATOR &&\n\t\t\titem.prev.data.value.charCodeAt(0) === SLASH\n\t\t) {\n\t\t\tline_height = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's followed by ',' is a font-family\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type === TYPE_OPERATOR &&\n\t\t\titem.next.data.value.charCodeAt(0) === COMMA &&\n\t\t\t!font_family[0]\n\t\t) {\n\t\t\tfont_family[0] = node\n\n\t\t\tif (!font_size && item.prev != null) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// If, after taking care of font-size and line-height, we still have a remaining dimension, it must be the oblique angle\n\t\tif (\n\t\t\tnode.type === 'Dimension' &&\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === TYPE_IDENTIFIER &&\n\t\t\titem.prev.data.name === 'oblique'\n\t\t) {\n\t\t\t// put in the correct amount of whitespace between `oblique` and `<angle>`\n\t\t\tfont_style +=\n\t\t\t\t''.padStart(node.loc.start.offset - item.prev.data.loc.end.offset) +\n\t\t\t\tstringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's a number and not previously caught by line-height or font-size is the font-weight\n\t\t// (oblique <angle> will not be caught here, because that's a Dimension, not a Number)\n\t\tif (node.type === 'Number') {\n\t\t\treturn\n\t\t}\n\n\t\t// last node always ends the font-family\n\t\tif (item.next === null) {\n\t\t\tfont_family[1] = node\n\n\t\t\t// if, at the last node, we don;t have a size yet, it *must* be the previous node\n\t\t\t// unless `font: menu` (system font), because then there's simply no size\n\t\t\tif (!font_size && !font_family[0] && item.prev) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// Any remaining identifiers can be font-size, font-style, font-stretch, font-variant or font-weight\n\t\tif (node.type === TYPE_IDENTIFIER) {\n\t\t\tif (SIZE_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_size = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t})\n\n\treturn {\n\t\tfont_size,\n\t\tline_height,\n\t\tfont_family: (font_family[0] || font_family[1]) ? stringifyNode({\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\toffset: (font_family[0] || font_family[1]).loc.start.offset\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\toffset: font_family[1].loc.end.offset\n\t\t\t\t}\n\t\t\t}\n\t\t}) : null,\n\t}\n}","import { KeywordSet } from \"../keyword-set.js\"\n\nconst keywords = new KeywordSet([\n 'auto',\n 'inherit',\n 'initial',\n 'unset',\n 'revert',\n 'revert-layer',\n 'none', // for `text-shadow`, `box-shadow` and `background`\n])\n\nexport function isValueKeyword(node) {\n if (!node.children) return false\n if (node.children.size > 1 || node.children.size === 0) return false\n\n let firstChild = node.children.first\n return firstChild.type === 'Identifier' && keywords.has(firstChild.name)\n}\n","import { KeywordSet } from \"../keyword-set.js\"\n\nconst TIMING_KEYWORDS = new KeywordSet([\n 'linear',\n 'ease',\n 'ease-in',\n 'ease-out',\n 'ease-in-out',\n 'step-start',\n 'step-end',\n])\n\nconst TIMING_FUNCTION_VALUES = new KeywordSet([\n 'cubic-bezier',\n 'steps'\n])\n\nexport function analyzeAnimation(children, stringifyNode) {\n let durationFound = false\n let durations = []\n let timingFunctions = []\n\n children.forEach(child => {\n let type = child.type\n\n // Right after a ',' we start over again\n if (type === 'Operator') {\n return durationFound = false\n }\n if (type === 'Dimension' && durationFound === false) {\n durationFound = true\n return durations.push(stringifyNode(child))\n }\n if (type === 'Identifier' && TIMING_KEYWORDS.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n if (type === 'Function' && TIMING_FUNCTION_VALUES.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n })\n\n return [durations, timingFunctions]\n}\n","import { hasVendorPrefix } from '../vendor-prefix.js'\n\nexport function isAstVendorPrefixed(node) {\n if (!node.children) {\n return false\n }\n\n let children = node.children.toArray()\n\n for (let index = 0; index < children.length; index++) {\n let node = children[index]\n let { type, name } = node;\n\n if (type === 'Identifier' && hasVendorPrefix(name)) {\n return true\n }\n\n if (type === 'Function') {\n if (hasVendorPrefix(name)) {\n return true\n }\n\n if (isAstVendorPrefixed(node)) {\n return true\n }\n }\n }\n\n return false\n}\n","export class Collection {\n\tconstructor({ useLocations = false }) {\n\t\t/** @type {Map<string, number[]>} */\n\t\tthis._items = new Map()\n\t\tthis._total = 0\n\t\t/** @type {number[]} */\n\t\tthis.node_lines = []\n\t\t/** @type {number[]} */\n\t\tthis.node_columns = []\n\t\t/** @type {number[]} */\n\t\tthis.node_lengths = []\n\t\t/** @type {number[]} */\n\t\tthis.node_offsets = []\n\n\t\t/** @type {boolean} */\n\t\tthis._useLocations = useLocations\n\t}\n\n\t/**\n\t * @param {string} item\n\t * @param {import('css-tree').CssLocation} node_location\n\t */\n\tpush(item, node_location) {\n\t\tlet index = this._total\n\n\t\tthis.node_lines[index] = node_location.start.line\n\t\tthis.node_columns[index] = node_location.start.column\n\t\tthis.node_offsets[index] = node_location.start.offset\n\t\tthis.node_lengths[index] = node_location.end.offset - node_location.start.offset\n\n\t\tif (this._items.has(item)) {\n\t\t\t/** @type number[] */\n\t\t\tlet list = this._items.get(item)\n\t\t\tlist.push(index)\n\t\t\tthis._total++\n\t\t\treturn\n\t\t}\n\n\t\tthis._items.set(item, [index])\n\t\tthis._total++\n\t}\n\n\tsize() {\n\t\treturn this._total\n\t}\n\n\t/**\n\t * @typedef CssLocation\n\t * @property {number} line\n\t * @property {number} column\n\t * @property {number} offset\n\t * @property {number} length\n\t *\n\t * @returns {{ total: number; totalUnique: number; uniquenessRatio: number; unique: Record<string, number>; __unstable__uniqueWithLocations: Record<string, CssLocation[]>}}\n\t */\n\tcount() {\n\t\tlet uniqueWithLocations = new Map()\n\t\tlet unique = {}\n\t\tthis._items.forEach((list, key) => {\n\t\t\tlet nodes = list.map(index => ({\n\t\t\t\tline: this.node_lines[index],\n\t\t\t\tcolumn: this.node_columns[index],\n\t\t\t\toffset: this.node_offsets[index],\n\t\t\t\tlength: this.node_lengths[index],\n\t\t\t}))\n\t\t\tuniqueWithLocations.set(key, nodes)\n\t\t\tunique[key] = list.length\n\t\t})\n\n\t\tif (this._useLocations) {\n\t\t\treturn {\n\t\t\t\ttotal: this._total,\n\t\t\t\ttotalUnique: this._items.size,\n\t\t\t\tunique,\n\t\t\t\tuniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n\t\t\t\t__unstable__uniqueWithLocations: Object.fromEntries(uniqueWithLocations),\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttotal: this._total,\n\t\t\ttotalUnique: this._items.size,\n\t\t\tunique,\n\t\t\tuniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n\t\t}\n\t}\n}\n","import { Collection } from './collection.js'\n\nclass ContextCollection {\n constructor({ useLocations = false }) {\n this._list = new Collection({ useLocations })\n /** @type {Map<string, Collection>} */\n this._contexts = new Map()\n /** @type {boolean} */\n this.useLocations = useLocations\n }\n\n /**\n * Add an item to this _list's context\n * @param {string} item Item to push\n * @param {string} context Context to push Item to\n * @param {import('css-tree').CssLocation} node_location\n */\n push(item, context, node_location) {\n this._list.push(item, node_location)\n\n if (!this._contexts.has(context)) {\n this._contexts.set(context, new Collection({ useLocations: this.useLocations }))\n }\n\n this._contexts.get(context).push(item, node_location)\n }\n\n count() {\n /**\n * @type {Map<string, {\n * total: number,\n * totalUnique: number,\n * unique: Record<string, number>,\n * uniquenessRatio: number\n * }>}\n */\n let itemsPerContext = new Map()\n\n for (let [context, value] of this._contexts.entries()) {\n itemsPerContext.set(context, value.count())\n }\n\n return Object.assign(this._list.count(), {\n itemsPerContext: Object.fromEntries(itemsPerContext)\n })\n }\n}\n\nexport {\n ContextCollection\n}","/**\n * Find the mode (most occurring value) in an array of Numbers\n * Takes the mean/average of multiple values if multiple values occur the same amount of times.\n *\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-mode/index.js\n * @param {Array} arr - Array to find the mode value for\n * @returns {Number} mode - The `mode` value of `arr`\n */\nfunction Mode(arr) {\n let frequencies = new Map()\n let maxOccurrences = -1\n let maxOccurenceCount = 0\n let sum = 0\n\n for (let i = 0; i < arr.length; i++) {\n let element = arr[i]\n let updatedCount = (frequencies.get(element) || 0) + 1\n frequencies.set(element, updatedCount)\n\n if (updatedCount > maxOccurrences) {\n maxOccurrences = updatedCount\n maxOccurenceCount = 0\n sum = 0\n }\n\n if (updatedCount >= maxOccurrences) {\n maxOccurenceCount++\n sum += element\n }\n }\n\n return sum / maxOccurenceCount\n}\n\n/**\n * Find the middle number in an Array of Numbers\n * Returns the average of 2 numbers if the Array length is an even number\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-median/index.js\n * @param {Array} arr - A sorted Array\n * @returns {Number} - The array's Median\n */\nfunction Median(arr) {\n let middle = arr.length / 2\n let lowerMiddleRank = Math.floor(middle)\n\n if (middle !== lowerMiddleRank) {\n return arr[lowerMiddleRank]\n }\n return (arr[lowerMiddleRank] + arr[lowerMiddleRank - 1]) / 2\n}\n\nclass AggregateCollection {\n constructor() {\n /** @type number[] */\n this._items = []\n this._sum = 0\n }\n\n /**\n * Add a new Integer at the end of this AggregateCollection\n * @param {number} item - The item to add\n */\n push(item) {\n this._items.push(item)\n this._sum += item\n }\n\n size() {\n return this._items.length\n }\n\n aggregate() {\n if (this._items.length === 0) {\n return {\n min: 0,\n max: 0,\n mean: 0,\n mode: 0,\n median: 0,\n range: 0,\n sum: 0,\n }\n }\n\n // TODO: can we avoid this sort()? It's slow\n /** @type Number[] */\n let sorted = this._items.slice().sort((a, b) => a - b)\n let min = sorted[0]\n let max = sorted[sorted.length - 1]\n\n let mode = Mode(sorted)\n let median = Median(sorted)\n\n return {\n min,\n max,\n mean: this._sum / sorted.length,\n mode,\n median,\n range: max - min,\n sum: this._sum,\n }\n }\n\n /**\n * @returns {number[]} All _items in this collection\n */\n toArray() {\n return this._items\n }\n}\n\nexport {\n AggregateCollection\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\nimport { endsWith } from '../string-utils.js'\n\n/**\n * @param {string} property\n * @see https://github.com/csstree/csstree/blob/master/lib/utils/names.js#L69\n */\nexport function isHack(property) {\n if (isCustom(property) || hasVendorPrefix(property)) return false\n\n let code = property.charCodeAt(0)\n\n return code === 47 // /\n || code === 95 // _\n || code === 43 // +\n || code === 42 // *\n || code === 38 // &\n || code === 36 // $\n || code === 35 // #\n}\n\nexport function isCustom(property) {\n if (property.length < 3) return false\n // 45 === '-'.charCodeAt(0)\n return property.charCodeAt(0) === 45 && property.charCodeAt(1) === 45\n}\n\n/**\n * A check to verify that a propery is `basename` or a prefixed\n * version of that, but never a custom property that accidentally\n * ends with the same substring.\n *\n * @example\n * isProperty('animation', 'animation') // true\n * isProperty('animation', '-webkit-animation') // true\n * isProperty('animation', '--my-animation') // false\n *\n * @param {string} basename\n * @param {string} property\n * @returns {boolean} True if `property` equals `basename` without prefix\n */\nexport function isProperty(basename, property) {\n if (isCustom(property)) return false\n return endsWith(basename, property)\n}","import parse from 'css-tree/parser'\nimport walk from 'css-tree/walker'\nimport { calculate } from '@bramus/specificity/core'\nimport { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js'\nimport { getCombinators, getComplexity, isAccessibility } from './selectors/utils.js'\nimport { colorFunctions, colorKeywords, namedColors, systemColors } from './values/colors.js'\nimport { destructure, isSystemFont } from './values/destructure-font-shorthand.js'\nimport { isValueKeyword } from './values/values.js'\nimport { analyzeAnimation } from './values/animations.js'\nimport { isAstVendorPrefixed } from './values/vendor-prefix.js'\nimport { ContextCollection } from './context-collection.js'\nimport { Collection } from './collection.js'\nimport { AggregateCollection } from './aggregate-collection.js'\nimport { strEquals, startsWith, endsWith } from './string-utils.js'\nimport { hasVendorPrefix } from './vendor-prefix.js'\nimport { isCustom, isHack, isProperty } from './properties/property-utils.js'\nimport { getEmbedType } from './stylesheet/stylesheet.js'\nimport { isIe9Hack } from './values/browserhacks.js'\n\n/** @typedef {[number, number, number]} Specificity */\n\nfunction ratio(part, total) {\n if (total === 0) return 0\n return part / total\n}\n\nlet defaults = {\n useUnstableLocations: false\n}\n\n/**\n * @typedef Options\n * @property {boolean} useUnstableLocations **WARNING: EXPERIMENTAL!** Use Locations (`{ 'item': [{ line, column, offset, length }] }`) instead of a regular count per occurrence (`{ 'item': 3 }`)\n */\n\n/**\n * Analyze CSS\n * @param {string} css\n * @param {Options} options\n */\nexport function analyze(css, options = {}) {\n let settings = Object.assign({}, defaults, options)\n let useLocations = settings.useUnstableLocations === true\n let start = Date.now()\n\n /**\n * Recreate the authored CSS from a CSSTree node\n * @param {import('css-tree').CssNode} node - Node from CSSTree AST to stringify\n * @returns {string} str - The stringified node\n */\n function stringifyNode(node) {\n return stringifyNodePlain(node).trim()\n }\n\n function stringifyNodePlain(node) {\n return css.substring(node.loc.start.offset, node.loc.end.offset)\n }\n\n // Stylesheet\n let totalComments = 0\n let commentsSize = 0\n let embeds = new Collection({ useLocations })\n let embedSize = 0\n let embedTypes = {\n total: 0,\n /** @type {Map<string, {size: number, count: number}>} */\n unique: new Map()\n }\n\n let startParse = Date.now()\n\n let ast = parse(css, {\n parseCustomProperty: true, // To find font-families, colors, etc.\n positions: true, // So we can use stringifyNode()\n /** @param {string} comment */\n onComment: function (comment) {\n totalComments++\n commentsSize += comment.length\n },\n })\n\n let startAnalysis = Date.now()\n let linesOfCode = ast.loc.end.line - ast.loc.start.line + 1\n\n // Atrules\n let totalAtRules = 0\n /** @type {Record<string: string>}[]} */\n let fontfaces = []\n let layers = new Collection({ useLocations })\n let imports = new Collection({ useLocations })\n let medias = new Collection({ useLocations })\n let mediaBrowserhacks = new Collection({ useLocations })\n let charsets = new Collection({ useLocations })\n let supports = new Collection({ useLocations })\n let supportsBrowserhacks = new Collection({ useLocations })\n let keyframes = new Collection({ useLocations })\n let prefixedKeyframes = new Collection({ useLocations })\n let containers = new Collection({ useLocations })\n let registeredProperties = new Collection({ useLocations })\n\n // Rules\n let totalRules = 0\n let emptyRules = 0\n let ruleSizes = new AggregateCollection()\n let selectorsPerRule = new AggregateCollection()\n let declarationsPerRule = new AggregateCollection()\n let uniqueRuleSize = new Collection({ useLocations })\n let uniqueSelectorsPerRule = new Collection({ useLocations })\n let uniqueDeclarationsPerRule = new Collection({ useLocations })\n\n // Selectors\n let keyframeSelectors = new Collection({ useLocations })\n let uniqueSelectors = new Set()\n let prefixedSelectors = new Collection({ useLocations })\n /** @type {Specificity} */\n let maxSpecificity\n /** @type {Specificity} */\n let minSpecificity\n let specificityA = new AggregateCollection()\n let specificityB = new AggregateCollection()\n let specificityC = new AggregateCollection()\n let uniqueSpecificities = new Collection({ useLocations })\n let selectorComplexities = new AggregateCollection()\n let uniqueSelectorComplexities = new Collection({ useLocations })\n /** @type {Specificity[]} */\n let specificities = []\n let ids = new Collection({ useLocations })\n let a11y = new Collection({ useLocations })\n let combinators = new Collection({ useLocations })\n\n // Declarations\n let uniqueDeclarations = new Set()\n let totalDeclarations = 0\n let importantDeclarations = 0\n let importantsInKeyframes = 0\n let importantCustomProperties = new Collection({ useLocations })\n\n // Properties\n let properties = new Collection({ useLocations })\n let propertyHacks = new Collection({ useLocations })\n let propertyVendorPrefixes = new Collection({ useLocations })\n let customProperties = new Collection({ useLocations })\n let propertyComplexities = new AggregateCollection()\n\n // Values\n let vendorPrefixedValues = new Collection({ useLocations })\n let valueBrowserhacks = new Collection({ useLocations })\n let zindex = new Collection({ useLocations })\n let textShadows = new Collection({ useLocations })\n let boxShadows = new Collection({ useLocations })\n let fontFamilies = new Collection({ useLocations })\n let fontSizes = new Collection({ useLocations })\n let lineHeights = new Collection({ useLocations })\n let timingFunctions = new Collection({ useLocations })\n let durations = new Collection({ useLocations })\n let colors = new ContextCollection({ useLocations })\n let colorFormats = new Collection({ useLocations })\n let units = new ContextCollection({ useLocations })\n let gradients = new Collection({ useLocations })\n\n walk(ast, function (node) {\n switch (node.type) {\n case 'Atrule': {\n totalAtRules++\n let atRuleName = node.name\n\n if (atRuleName === 'font-face') {\n let descriptors = {}\n\n node.block.children.forEach(descriptor => {\n // Ignore 'Raw' nodes in case of CSS syntax errors\n if (descriptor.type === 'Declaration') {\n descriptors[descriptor.property] = stringifyNode(descriptor.value)\n }\n })\n\n fontfaces.push(descriptors)\n break\n }\n\n if (atRuleName === 'media') {\n let prelude = stringifyNode(node.prelude)\n medias.push(prelude, node.prelude.loc)\n if (isMediaBrowserhack(node.prelude)) {\n mediaBrowserhacks.push(prelude, node.prelude.loc)\n }\n break\n }\n if (atRuleName === 'supports') {\n let prelude = stringifyNode(node.prelude)\n supports.push(prelude, node.prelude.loc)\n if (isSupportsBrowserhack(node.prelude)) {\n supportsBrowserhacks.push(prelude, node.prelude.loc)\n }\n break\n }\n if (endsWith('keyframes', atRuleName)) {\n let name = '@' + atRuleName + ' ' + stringifyNode(node.prelude)\n if (hasVendorPrefix(atRuleName)) {\n prefixedKeyframes.push(name, node.prelude.loc)\n }\n keyframes.push(name, node.prelude.loc)\n break\n }\n if (atRuleName === 'import') {\n imports.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'charset') {\n charsets.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'container') {\n containers.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'layer') {\n let prelude = stringifyNode(node.prelude)\n prelude\n .split(',')\n .forEach(name => layers.push(name.trim(), node.prelude.loc))\n break\n }\n if (atRuleName === 'property') {\n let prelude = stringifyNode(node.prelude)\n registeredProperties.push(prelude, node.prelude.loc)\n break\n }\n break\n }\n case 'Rule': {\n let numSelectors = node.prelude.children ? node.prelude.children.size : 0\n let numDeclarations = node.block.children ? node.block.children.size : 0\n\n ruleSizes.push(numSelectors + numDeclarations)\n uniqueRuleSize.push(numSelectors + numDeclarations, node.loc)\n selectorsPerRule.push(numSelectors)\n uniqueSelectorsPerRule.push(numSelectors, node.prelude.loc)\n declarationsPerRule.push(numDeclarations)\n uniqueDeclarationsPerRule.push(numDeclarations, node.block.loc)\n\n totalRules++\n\n if (numDeclarations === 0) {\n emptyRules++\n }\n break\n }\n case 'Selector': {\n let selector = stringifyNode(node)\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n keyframeSelectors.push(selector, node.loc)\n return this.skip\n }\n\n if (isAccessibility(node)) {\n a11y.push(selector, node.loc)\n }\n\n let [complexity, isPrefixed] = getComplexity(node)\n\n if (isPrefixed) {\n prefixedSelectors.push(selector, node.loc)\n }\n\n uniqueSelectors.add(selector)\n selectorComplexities.push(complexity)\n uniqueSelectorComplexities.push(complexity, node.loc)\n\n // #region specificity\n let [{ value: specificityObj }] = calculate(node)\n let sa = specificityObj.a\n let sb = specificityObj.b\n let sc = specificityObj.c\n\n /** @type {Specificity} */\n let specificity = [sa, sb, sc]\n\n uniqueSpecificities.push(sa + ',' + sb + ',' + sc, node.loc)\n\n specificityA.push(sa)\n specificityB.push(sb)\n specificityC.push(sc)\n\n if (maxSpecificity === undefined) {\n maxSpecificity = specificity\n }\n\n if (minSpecificity === undefined) {\n minSpecificity = specificity\n }\n\n if (minSpecificity !== undefined && compareSpecificity(minSpecificity, specificity) < 0) {\n minSpecificity = specificity\n }\n\n if (maxSpecificity !== undefined && compareSpecificity(maxSpecificity, specificity) > 0) {\n maxSpecificity = specificity\n }\n\n specificities.push(specificity)\n // #endregion\n\n if (sa > 0) {\n ids.push(selector, node.loc)\n }\n\n getCombinators(node, function onCombinator(combinator) {\n combinators.push(combinator.name, combinator.loc)\n })\n\n // Avoid deeper walking of selectors to not mess with\n // our specificity calculations in case of a selector\n // with :where() or :is() that contain SelectorLists\n // as children\n return this.skip\n }\n case 'Dimension': {\n if (!this.declaration) {\n break\n }\n\n /** @type {string} */\n let unit = node.unit\n\n if (endsWith('\\\\9', unit)) {\n units.push(unit.substring(0, unit.length - 2), this.declaration.property, node.loc)\n } else {\n units.push(unit, this.declaration.property, node.loc)\n }\n\n return this.skip\n }\n case 'Url': {\n if (startsWith('data:', node.value)) {\n let embed = node.value\n let size = embed.length\n let type = getEmbedType(embed)\n\n embedTypes.total++\n embedSize += size\n\n if (embedTypes.unique.has(type)) {\n let item = embedTypes.unique.get(type)\n item.count++\n item.size += size\n embedTypes.unique.set(type, item)\n } else {\n embedTypes.unique.set(type, {\n count: 1,\n size\n })\n }\n\n // @deprecated\n embeds.push(embed, node.loc)\n }\n break\n }\n case 'Value': {\n if (isValueKeyword(node)) {\n break\n }\n\n let declaration = this.declaration\n let { property, important } = declaration\n\n if (isAstVendorPrefixed(node)) {\n vendorPrefixedValues.push(stringifyNode(node), node.loc)\n }\n\n // i.e. `property: value !ie`\n if (typeof important === 'string') {\n valueBrowserhacks.push(stringifyNodePlain(node) + '!' + important, node.loc)\n }\n\n // i.e. `property: value\\9`\n if (isIe9Hack(node)) {\n valueBrowserhacks.push(stringifyNode(node), node.loc)\n }\n\n // Process properties first that don't have colors,\n // so we can avoid further walking them;\n if (isProperty('z-index', property)) {\n zindex.push(stringifyNode(node), node.loc)\n return this.skip\n } else if (isProperty('font', property)) {\n if (isSystemFont(node)) return\n\n let { font_size, line_height, font_family } = destructure(node, stringifyNode)\n\n if (font_family) {\n fontFamilies.push(font_family, node.loc)\n }\n if (font_size) {\n fontSizes.push(font_size, node.loc)\n }\n if (line_height) {\n lineHeights.push(line_height, node.loc)\n }\n\n break\n } else if (isProperty('font-size', property)) {\n if (!isSystemFont(node)) {\n fontSizes.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('font-family', property)) {\n if (!isSystemFont(node)) {\n fontFamilies.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('line-height', property)) {\n lineHeights.push(stringifyNode(node), node.loc)\n } else if (isProperty('transition', property) || isProperty('animation', property)) {\n let [times, fns] = analyzeAnimation(node.children, stringifyNode)\n for (let i = 0; i < times.length; i++) {\n durations.push(times[i], node.loc)\n }\n for (let i = 0; i < fns.length; i++) {\n timingFunctions.push(fns[i], node.loc)\n }\n break\n } else if (isProperty('animation-duration', property) || isProperty('transition-duration', property)) {\n if (node.children && node.children.size > 1) {\n node.children.forEach(child => {\n if (child.type !== 'Operator') {\n durations.push(stringifyNode(child), node.loc)\n }\n })\n } else {\n durations.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('transition-timing-function', property) || isProperty('animation-timing-function', property)) {\n if (node.children && node.children.size > 1) {\n node.children.forEach(child => {\n if (child.type !== 'Operator') {\n timingFunctions.push(stringifyNode(child), node.loc)\n }\n })\n } else {\n timingFunctions.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('text-shadow', property)) {\n if (!isValueKeyword(node)) {\n textShadows.push(stringifyNode(node), node.loc)\n }\n // no break here: potentially contains colors\n } else if (isProperty('box-shadow', property)) {\n if (!isValueKeyword(node)) {\n boxShadows.push(stringifyNode(node), node.loc)\n }\n // no break here: potentially contains colors\n }\n\n walk(node, function (valueNode) {\n let nodeName = valueNode.name\n\n switch (valueNode.type) {\n case 'Hash': {\n let hexLength = valueNode.value.length\n if (endsWith('\\\\9', valueNode.value)) {\n hexLength = hexLength - 2\n }\n colors.push('#' + valueNode.value, property, valueNode.loc)\n colorFormats.push(`hex` + hexLength, valueNode.loc)\n\n return this.skip\n }\n case 'Identifier': {\n // Bail out if it can't be a color name\n // 20 === 'lightgoldenrodyellow'.length\n // 3 === 'red'.length\n if (nodeName.length > 20 || nodeName.length < 3) {\n return this.skip\n }\n\n if (namedColors.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push('named', valueNode.loc)\n return\n }\n\n if (colorKeywords.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push(nodeName.toLowerCase(), valueNode.loc)\n return\n }\n\n if (systemColors.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push('system', valueNode.loc)\n return\n }\n return this.skip\n }\n case 'Function': {\n // Don't walk var() multiple times\n if (strEquals('var', nodeName)) {\n return this.skip\n }\n\n if (colorFunctions.has(nodeName)) {\n colors.push(stringifyNode(valueNode), property, valueNode.loc)\n colorFormats.push(nodeName.toLowerCase(), valueNode.loc)\n return\n }\n\n if (endsWith('gradient', nodeName)) {\n gradients.push(stringifyNode(valueNode), valueNode.loc)\n return\n }\n // No this.skip here intentionally,\n // otherwise we'll miss colors in linear-gradient() etc.\n }\n }\n })\n break\n }\n case 'Declaration': {\n // Do not process Declarations in atRule preludes\n // because we will handle them manually\n if (this.atrulePrelude !== null) {\n return this.skip\n }\n\n totalDeclarations++\n\n uniqueDeclarations.add(stringifyNode(node))\n\n if (node.important === true) {\n importantDeclarations++\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n importantsInKeyframes++\n }\n }\n\n let { property } = node\n let propertyLoc = {\n start: {\n line: node.loc.start.line,\n column: node.loc.start.column,\n offset: node.loc.start.offset\n },\n end: {\n offset: node.loc.start.offset + property.length\n }\n }\n\n properties.push(property, propertyLoc)\n\n if (hasVendorPrefix(property)) {\n propertyVendorPrefixes.push(property, propertyLoc)\n propertyComplexities.push(2)\n } else if (isHack(property)) {\n propertyHacks.push(property, propertyLoc)\n propertyComplexities.push(2)\n } else if (isCustom(property)) {\n customProperties.push(property, propertyLoc)\n propertyComplexities.push(2)\n if (node.important === true) {\n importantCustomProperties.push(property, propertyLoc)\n }\n } else {\n propertyComplexities.push(1)\n }\n break\n }\n }\n })\n\n let embeddedContent = embeds.count()\n\n let totalUniqueDeclarations = uniqueDeclarations.size\n\n let totalSelectors = selectorComplexities.size()\n let specificitiesA = specificityA.aggregate()\n let specificitiesB = specificityB.aggregate()\n let specificitiesC = specificityC.aggregate()\n let totalUniqueSelectors = uniqueSelectors.size\n let assign = Object.assign\n\n return {\n stylesheet: {\n sourceLinesOfCode: totalAtRules + totalSelectors + totalDeclarations + keyframeSelectors.size(),\n linesOfCode,\n size: css.length,\n comments: {\n total: totalComments,\n size: commentsSize,\n },\n embeddedContent: assign(embeddedContent, {\n size: {\n total: embedSize,\n ratio: ratio(embedSize, css.length),\n },\n types: {\n total: embedTypes.total,\n totalUnique: embedTypes.unique.size,\n uniquenessRatio: ratio(embedTypes.unique.size, embedTypes.total),\n unique: Object.fromEntries(embedTypes.unique),\n },\n }),\n },\n atrules: {\n fontface: {\n total: fontfaces.length,\n totalUnique: fontfaces.length,\n unique: fontfaces,\n uniquenessRatio: fontfaces.length === 0 ? 0 : 1\n },\n import: imports.count(),\n media: assign(\n medias.count(),\n {\n browserhacks: mediaBrowserhacks.count(),\n }\n ),\n charset: charsets.count(),\n supports: assign(\n supports.count(),\n {\n browserhacks: supportsBrowserhacks.count(),\n },\n ),\n keyframes: assign(\n keyframes.count(), {\n prefixed: assign(\n prefixedKeyframes.count(), {\n ratio: ratio(prefixedKeyframes.size(), keyframes.size())\n }),\n }),\n container: containers.count(),\n layer: layers.count(),\n property: registeredProperties.count(),\n },\n rules: {\n total: totalRules,\n empty: {\n total: emptyRules,\n ratio: ratio(emptyRules, totalRules)\n },\n sizes: assign(\n ruleSizes.aggregate(),\n {\n items: ruleSizes.toArray(),\n },\n uniqueRuleSize.count(),\n ),\n selectors: assign(\n selectorsPerRule.aggregate(),\n {\n items: selectorsPerRule.toArray(),\n },\n uniqueSelectorsPerRule.count(),\n ),\n declarations: assign(\n declarationsPerRule.aggregate(),\n {\n items: declarationsPerRule.toArray(),\n },\n uniqueDeclarationsPerRule.count(),\n ),\n },\n selectors: {\n total: totalSelectors,\n totalUnique: totalUniqueSelectors,\n uniquenessRatio: ratio(totalUniqueSelectors, totalSelectors),\n specificity: assign(\n {\n /** @type Specificity */\n min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,\n /** @type Specificity */\n max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,\n /** @type Specificity */\n sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],\n /** @type Specificity */\n mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],\n /** @type Specificity */\n mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],\n /** @type Specificity */\n median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],\n items: specificities,\n },\n uniqueSpecificities.count(),\n ),\n complexity: assign(\n selectorComplexities.aggregate(),\n uniqueSelectorComplexities.count(),\n {\n items: selectorComplexities.toArray(),\n }\n ),\n id: assign(\n ids.count(), {\n ratio: ratio(ids.size(), totalSelectors),\n }),\n accessibility: assign(\n a11y.count(), {\n ratio: ratio(a11y.size(), totalSelectors),\n }),\n keyframes: keyframeSelectors.count(),\n prefixed: assign(\n prefixedSelectors.count(),\n {\n ratio: ratio(prefixedSelectors.size(), totalSelectors),\n },\n ),\n combinators: combinators.count(),\n },\n declarations: {\n total: totalDeclarations,\n totalUnique: totalUniqueDeclarations,\n uniquenessRatio: ratio(totalUniqueDeclarations, totalDeclarations),\n // @TODO: deprecated, remove in next major version\n unique: {\n total: totalUniqueDeclarations,\n ratio: ratio(totalUniqueDeclarations, totalDeclarations),\n },\n importants: {\n total: importantDeclarations,\n ratio: ratio(importantDeclarations, totalDeclarations),\n inKeyframes: {\n total: importantsInKeyframes,\n ratio: ratio(importantsInKeyframes, importantDeclarations),\n },\n },\n },\n properties: assign(\n properties.count(),\n {\n prefixed: assign(\n propertyVendorPrefixes.count(),\n {\n ratio: ratio(propertyVendorPrefixes.size(), properties.size()),\n },\n ),\n custom: assign(\n customProperties.count(),\n {\n ratio: ratio(customProperties.size(), properties.size()),\n importants: assign(\n importantCustomProperties.count(),\n {\n ratio: ratio(importantCustomProperties.size(), customProperties.size()),\n }\n ),\n },\n ),\n browserhacks: assign(\n propertyHacks.count(), {\n ratio: ratio(propertyHacks.size(), properties.size()),\n }),\n complexity: propertyComplexities.aggregate(),\n }),\n values: {\n colors: assign(\n colors.count(),\n {\n formats: colorFormats.count(),\n },\n ),\n gradients: gradients.count(),\n fontFamilies: fontFamilies.count(),\n fontSizes: fontSizes.count(),\n lineHeights: lineHeights.count(),\n zindexes: zindex.count(),\n textShadows: textShadows.count(),\n boxShadows: boxShadows.count(),\n animations: {\n durations: durations.count(),\n timingFunctions: timingFunctions.count(),\n },\n prefixes: vendorPrefixedValues.count(),\n browserhacks: valueBrowserhacks.count(),\n units: units.count(),\n },\n __meta__: {\n parseTime: startAnalysis - startParse,\n analyzeTime: Date.now() - startAnalysis,\n total: Date.now() - start\n }\n }\n}\n\n/**\n * Compare specificity A to Specificity B\n * @param {Specificity} a - Specificity A\n * @param {Specificity} b - Specificity B\n * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b\n */\nexport function compareSpecificity(a, b) {\n if (a[0] === b[0]) {\n if (a[1] === b[1]) {\n return b[2] - a[2]\n }\n\n return b[1] - a[1]\n }\n\n return b[0] - a[0]\n}","/** @param {string} embed */\nexport function getEmbedType(embed) {\n\t// data:image/gif;base64,R0lG\n\tlet start = 5 // `data:`.length\n\tlet semicolon = embed.indexOf(';')\n\tlet comma = embed.indexOf(',')\n\n\tif (semicolon === -1) {\n\t\treturn embed.substring(start, comma)\n\t}\n\n\tif (comma !== -1 && comma < semicolon) {\n\t\treturn embed.substring(start, comma);\n\t}\n\n\treturn embed.substring(start, semicolon)\n}","import { endsWith } from \"../string-utils.js\"\n\nexport function isIe9Hack(node) {\n\tlet children = node.children\n\treturn children\n\t\t&& children.last\n\t\t&& children.last.type === 'Identifier'\n\t\t&& endsWith('\\\\9', children.last.name)\n}"],"names":["compareChar","referenceCode","testCode","strEquals","base","maybe","len","length","i","charCodeAt","endsWith","offset","startsWith","isPropertyValue","node","property","value","children","first","type","name","hasVendorPrefix","keyword","indexOf","analyzeList","selectorListAst","cb","childSelectors","walk","visit","enter","push","isPseudoFunction","isAccessibility","selector","isA11y","some","b","skip","getComplexity","complexity","isPrefixed","Boolean","list","forEach","_ref","KeywordSet","items","this","set","prototype","has","item","index","namedColors","systemColors","colorFunctions","colorKeywords","SYSTEM_FONTS","SIZE_KEYWORDS","isSystemFont","firstChild","keywords","isValueKeyword","size","TIMING_KEYWORDS","TIMING_FUNCTION_VALUES","isAstVendorPrefixed","toArray","Collection","_ref$useLocations","useLocations","_items","Map","_total","node_lines","node_columns","node_lengths","node_offsets","_useLocations","_proto","node_location","start","line","column","end","get","count","_this","uniqueWithLocations","unique","key","nodes","map","total","totalUnique","uniquenessRatio","__unstable__uniqueWithLocations","Object","fromEntries","ContextCollection","_list","_contexts","context","_step","itemsPerContext","_iterator","_createForOfIteratorHelperLoose","entries","done","_step$value","assign","AggregateCollection","_sum","aggregate","min","max","mean","mode","median","range","sum","arr","middle","lowerMiddleRank","sorted","slice","sort","a","frequencies","maxOccurrences","maxOccurenceCount","element","updatedCount","Mode","Math","floor","isCustom","isProperty","basename","ratio","part","defaults","useUnstableLocations","compareSpecificity","css","options","Date","now","stringifyNode","stringifyNodePlain","trim","substring","loc","maxSpecificity","minSpecificity","totalComments","commentsSize","embeds","embedSize","embedTypes","startParse","ast","parse","parseCustomProperty","positions","onComment","comment","startAnalysis","linesOfCode","totalAtRules","fontfaces","layers","imports","medias","mediaBrowserhacks","charsets","supports","supportsBrowserhacks","keyframes","prefixedKeyframes","containers","registeredProperties","totalRules","emptyRules","ruleSizes","selectorsPerRule","declarationsPerRule","uniqueRuleSize","uniqueSelectorsPerRule","uniqueDeclarationsPerRule","keyframeSelectors","uniqueSelectors","Set","prefixedSelectors","specificityA","specificityB","specificityC","uniqueSpecificities","selectorComplexities","uniqueSelectorComplexities","specificities","ids","a11y","combinators","uniqueDeclarations","totalDeclarations","importantDeclarations","importantsInKeyframes","importantCustomProperties","properties","propertyHacks","propertyVendorPrefixes","customProperties","propertyComplexities","vendorPrefixedValues","valueBrowserhacks","zindex","textShadows","boxShadows","fontFamilies","fontSizes","lineHeights","timingFunctions","durations","colors","colorFormats","units","gradients","atRuleName","descriptors","block","descriptor","prelude","returnValue","unit","isMediaBrowserhack","isSupportsBrowserhack","split","numSelectors","numDeclarations","atrule","_getComplexity","add","specificityObj","calculate","sa","sb","sc","c","specificity","undefined","onMatch","selectorNode","previousLoc","prev","data","getCombinators","combinator","declaration","embed","semicolon","comma","getEmbedType","important","last","isIe9Hack","_destructure","font_size","line_height","font_family","Array","next","font_style","padStart","destructure","_analyzeAnimation","durationFound","child","analyzeAnimation","times","fns","valueNode","nodeName","hexLength","stringified","toLowerCase","atrulePrelude","propertyLoc","code","isHack","embeddedContent","totalUniqueDeclarations","totalSelectors","specificitiesA","specificitiesB","specificitiesC","totalUniqueSelectors","stylesheet","sourceLinesOfCode","comments","types","atrules","fontface","import","media","browserhacks","charset","prefixed","container","layer","rules","empty","sizes","selectors","declarations","id","accessibility","importants","inKeyframes","custom","values","formats","zindexes","animations","prefixes","__meta__","parseTime","analyzeTime"],"mappings":"wNAMA,SAASA,EAAYC,EAAeC,GAMlC,OAJIA,GAAY,IAAUA,GAAY,KAEpCA,GAAsB,IAEjBD,IAAkBC,CAC3B,UAcgBC,EAAUC,EAAMC,GAC9B,IAAIC,EAAMF,EAAKG,OACf,GAAID,IAAQD,EAAME,OAAQ,SAE1B,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAKE,IACvB,IAA6D,IAAzDR,EAAYI,EAAKK,WAAWD,GAAIH,EAAMI,WAAWD,IACnD,SAIJ,QACF,UAagB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IR,EAAW,CAKxC,QACA,QACA,MACA,OACA,OACA,OACA,QACA,gBACA,SACA,SAEA,YACA,eACA,OACA,aACA,QACA,QACA,SACA,iBACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,cACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,YACA,SACA,QACA,aACA,gBAGWS,EAAe,IAAIT,EAAW,CAGzC,SACA,aACA,WACA,cACA,aACA,aACA,aACA,eACA,QACA,YACA,YACA,gBACA,eACA,mBACA,OACA,WACA,aAMWU,EAAiB,IAAIV,EAAW,CAC3C,MACA,OACA,MACA,OACA,MACA,MACA,MACA,QACA,QACA,UAGWW,EAAgB,IAAIX,EAAW,CAC1C,cACA,iBCpMIY,EAAe,IAAIZ,EAAW,CACnC,UACA,OACA,OACA,cACA,gBACA,eAGKa,EAAgB,IAAIb,EAAW,CAEpC,WACA,UACA,QACA,SACA,QACA,UACA,WACA,YAEA,UACA,oBAQec,EAAa9C,GAC5B,IAAI+C,EAAa/C,EAAKG,SAASC,MAC/B,OAAmB,OAAf2C,GAJmB,eAKhBA,EAAW1C,MAA4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