csso.js 258 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  3. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  4. (global = global || self, factory(global.csso = {}));
  5. }(this, (function (exports) { 'use strict';
  6. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  7. function createCommonjsModule(fn, module) {
  8. return module = { exports: {} }, fn(module, module.exports), module.exports;
  9. }
  10. function getCjsExportFromNamespace (n) {
  11. return n && n['default'] || n;
  12. }
  13. var csstree_min = createCommonjsModule(function (module, exports) {
  14. !function(e,t){module.exports=t();}(commonjsGlobal,(function(){function e(e){return {prev:null,next:null,data:e}}function t(e,t,n){var i;return null!==r?(i=r,r=r.cursor,i.prev=t,i.next=n,i.cursor=e.cursor):i={prev:t,next:n,cursor:e.cursor},e.cursor=i,i}function n(e){var t=e.cursor;e.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=r,r=t;}var r=null,i=function(){this.cursor=null,this.head=null,this.tail=null;};i.createItem=e,i.prototype.createItem=e,i.prototype.updateCursors=function(e,t,n,r){for(var i=this.cursor;null!==i;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor;},i.prototype.getSize=function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e},i.prototype.fromArray=function(t){var n=null;this.head=null;for(var r=0;r<t.length;r++){var i=e(t[r]);null!==n?n.next=i:this.head=i,i.prev=n,n=i;}return this.tail=n,this},i.prototype.toArray=function(){for(var e=this.head,t=[];e;)t.push(e.data),e=e.next;return t},i.prototype.toJSON=i.prototype.toArray,i.prototype.isEmpty=function(){return null===this.head},i.prototype.first=function(){return this.head&&this.head.data},i.prototype.last=function(){return this.tail&&this.tail.data},i.prototype.each=function(e,r){var i;void 0===r&&(r=this);for(var a=t(this,null,this.head);null!==a.next;)i=a.next,a.next=i.next,e.call(r,i.data,i,this);n(this);},i.prototype.forEach=i.prototype.each,i.prototype.eachRight=function(e,r){var i;void 0===r&&(r=this);for(var a=t(this,this.tail,null);null!==a.prev;)i=a.prev,a.prev=i.prev,e.call(r,i.data,i,this);n(this);},i.prototype.forEachRight=i.prototype.eachRight,i.prototype.reduce=function(e,r,i){var a;void 0===i&&(i=this);for(var o=t(this,null,this.head),s=r;null!==o.next;)a=o.next,o.next=a.next,s=e.call(i,s,a.data,a,this);return n(this),s},i.prototype.reduceRight=function(e,r,i){var a;void 0===i&&(i=this);for(var o=t(this,this.tail,null),s=r;null!==o.prev;)a=o.prev,o.prev=a.prev,s=e.call(i,s,a.data,a,this);return n(this),s},i.prototype.nextUntil=function(e,r,i){if(null!==e){var a;void 0===i&&(i=this);for(var o=t(this,null,e);null!==o.next&&(a=o.next,o.next=a.next,!r.call(i,a.data,a,this)););n(this);}},i.prototype.prevUntil=function(e,r,i){if(null!==e){var a;void 0===i&&(i=this);for(var o=t(this,e,null);null!==o.prev&&(a=o.prev,o.prev=a.prev,!r.call(i,a.data,a,this)););n(this);}},i.prototype.some=function(e,t){var n=this.head;for(void 0===t&&(t=this);null!==n;){if(e.call(t,n.data,n,this))return !0;n=n.next;}return !1},i.prototype.map=function(e,t){var n=new i,r=this.head;for(void 0===t&&(t=this);null!==r;)n.appendData(e.call(t,r.data,r,this)),r=r.next;return n},i.prototype.filter=function(e,t){var n=new i,r=this.head;for(void 0===t&&(t=this);null!==r;)e.call(t,r.data,r,this)&&n.appendData(r.data),r=r.next;return n},i.prototype.clear=function(){this.head=null,this.tail=null;},i.prototype.copy=function(){for(var t=new i,n=this.head;null!==n;)t.insert(e(n.data)),n=n.next;return t},i.prototype.prepend=function(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this},i.prototype.prependData=function(t){return this.prepend(e(t))},i.prototype.append=function(e){return this.insert(e)},i.prototype.appendData=function(t){return this.insert(e(t))},i.prototype.insert=function(e,t){if(null!=t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e);}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this},i.prototype.insertData=function(t,n){return this.insert(e(t),n)},i.prototype.remove=function(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else {if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next;}if(null!==e.next)e.next.prev=e.prev;else {if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev;}return e.prev=null,e.next=null,e},i.prototype.push=function(t){this.insert(e(t));},i.prototype.pop=function(){if(null!==this.tail)return this.remove(this.tail)},i.prototype.unshift=function(t){this.prepend(e(t));},i.prototype.shift=function(){if(null!==this.head)return this.remove(this.head)},i.prototype.prependList=function(e){return this.insertList(e,this.head)},i.prototype.appendList=function(e){return this.insertList(e)},i.prototype.insertList=function(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this},i.prototype.replace=function(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e);};var a=i,o=function(e,t){var n=Object.create(SyntaxError.prototype),r=new Error;return n.name=e,n.message=t,Object.defineProperty(n,"stack",{get:function(){return (r.stack||"").replace(/^(.+\n){1,3}/,e+": "+t+"\n")}}),n};function s(e,t){function n(e,t){return r.slice(e,t).map((function(t,n){for(var r=String(e+n+1);r.length<l;)r=" "+r;return r+" |"+t})).join("\n")}var r=e.source.split(/\r\n?|\n|\f/),i=e.line,a=e.column,o=Math.max(1,i-t)-1,s=Math.min(i+t,r.length+1),l=Math.max(4,String(s).length)+1,c=0;(a+=(" ".length-1)*(r[i-1].substr(0,a-1).match(/\t/g)||[]).length)>100&&(c=a-60+3,a=58);for(var u=o;u<=s;u++)u>=0&&u<r.length&&(r[u]=r[u].replace(/\t/g," "),r[u]=(c>0&&r[u].length>c?"…":"")+r[u].substr(c,98)+(r[u].length>c+100-1?"…":""));return [n(o,i),new Array(a+l+2).join("-")+"^",n(i,s)].filter(Boolean).join("\n")}var l=function(e,t,n,r,i){var a=o("SyntaxError",e);return a.source=t,a.offset=n,a.line=r,a.column=i,a.sourceFragment=function(e){return s(a,isNaN(e)?0:e)},Object.defineProperty(a,"formattedMessage",{get:function(){return "Parse error: "+a.message+"\n"+s(a,2)}}),a.parseError={offset:n,line:r,column:i},a},c={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},u=Object.keys(c).reduce((function(e,t){return e[c[t]]=t,e}),{}),h={TYPE:c,NAME:u};function p(e){return e>=48&&e<=57}function d(e){return e>=65&&e<=90}function m(e){return e>=97&&e<=122}function g(e){return d(e)||m(e)}function f(e){return e>=128}function b(e){return g(e)||f(e)||95===e}function y(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function k(e){return 10===e||13===e||12===e}function v(e){return k(e)||32===e||9===e}function x(e,t){return 92===e&&(!k(t)&&0!==t)}var w=new Array(128);C.Eof=128,C.WhiteSpace=130,C.Digit=131,C.NameStart=132,C.NonPrintable=133;for(var S=0;S<w.length;S++)switch(!0){case v(S):w[S]=C.WhiteSpace;break;case p(S):w[S]=C.Digit;break;case b(S):w[S]=C.NameStart;break;case y(S):w[S]=C.NonPrintable;break;default:w[S]=S||C.Eof;}function C(e){return e<128?w[e]:C.NameStart}var z={isDigit:p,isHexDigit:function(e){return p(e)||e>=65&&e<=70||e>=97&&e<=102},isUppercaseLetter:d,isLowercaseLetter:m,isLetter:g,isNonAscii:f,isNameStart:b,isName:function(e){return b(e)||p(e)||45===e},isNonPrintable:y,isNewline:k,isWhiteSpace:v,isValidEscape:x,isIdentifierStart:function(e,t,n){return 45===e?b(t)||45===t||x(t,n):!!b(e)||92===e&&x(e,t)},isNumberStart:function(e,t,n){return 43===e||45===e?p(t)?2:46===t&&p(n)?3:0:46===e?p(t)?2:0:p(e)?1:0},isBOM:function(e){return 65279===e||65534===e?1:0},charCodeCategory:C},A=z.isDigit,P=z.isHexDigit,T=z.isUppercaseLetter,L=z.isName,E=z.isWhiteSpace,D=z.isValidEscape;function O(e,t){return t<e.length?e.charCodeAt(t):0}function B(e,t,n){return 13===n&&10===O(e,t+1)?2:1}function I(e,t,n){var r=e.charCodeAt(t);return T(r)&&(r|=32),r===n}function N(e,t){for(;t<e.length&&A(e.charCodeAt(t));t++);return t}function R(e,t){if(P(O(e,(t+=2)-1))){for(var n=Math.min(e.length,t+5);t<n&&P(O(e,t));t++);var r=O(e,t);E(r)&&(t+=B(e,t,r));}return t}var M={consumeEscaped:R,consumeName:function(e,t){for(;t<e.length;t++){var n=e.charCodeAt(t);if(!L(n)){if(!D(n,O(e,t+1)))break;t=R(e,t)-1;}}return t},consumeNumber:function(e,t){var n=e.charCodeAt(t);if(43!==n&&45!==n||(n=e.charCodeAt(t+=1)),A(n)&&(t=N(e,t+1),n=e.charCodeAt(t)),46===n&&A(e.charCodeAt(t+1))&&(n=e.charCodeAt(t+=2),t=N(e,t)),I(e,t,101)){var r=0;45!==(n=e.charCodeAt(t+1))&&43!==n||(r=1,n=e.charCodeAt(t+2)),A(n)&&(t=N(e,t+1+r+1));}return t},consumeBadUrlRemnants:function(e,t){for(;t<e.length;t++){var n=e.charCodeAt(t);if(41===n){t++;break}D(n,O(e,t+1))&&(t=R(e,t));}return t},cmpChar:I,cmpStr:function(e,t,n,r){if(n-t!==r.length)return !1;if(t<0||n>e.length)return !1;for(var i=t;i<n;i++){var a=e.charCodeAt(i),o=r.charCodeAt(i-t);if(T(a)&&(a|=32),a!==o)return !1}return !0},getNewlineLength:B,findWhiteSpaceStart:function(e,t){for(;t>=0&&E(e.charCodeAt(t));t--);return t+1},findWhiteSpaceEnd:function(e,t){for(;t<e.length&&E(e.charCodeAt(t));t++);return t}},j=h.TYPE,_=h.NAME,F=M.cmpStr,W=j.EOF,q=j.WhiteSpace,Y=j.Comment,U=function(){this.offsetAndType=null,this.balance=null,this.reset();};U.prototype={reset:function(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset;},lookupType:function(e){return (e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>24:W},lookupOffset:function(e){return (e+=this.tokenIndex)<this.tokenCount?16777215&this.offsetAndType[e-1]:this.source.length},lookupValue:function(e,t){return (e+=this.tokenIndex)<this.tokenCount&&F(this.source,16777215&this.offsetAndType[e-1],16777215&this.offsetAndType[e],t)},getTokenStart:function(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?16777215&this.offsetAndType[e-1]:16777215&this.offsetAndType[this.tokenCount]:this.firstCharOffset},getRawLength:function(e,t){var n,r=e,i=16777215&this.offsetAndType[Math.max(r-1,0)];e:for(;r<this.tokenCount&&!((n=this.balance[r])<e);r++)switch(t(this.offsetAndType[r]>>24,this.source,i)){case 1:break e;case 2:r++;break e;default:i=16777215&this.offsetAndType[r],this.balance[n]===r&&(r=n);}return r-this.tokenIndex},isBalanceEdge:function(e){return this.balance[this.tokenIndex]<e},isDelim:function(e,t){return t?this.lookupType(t)===j.Delim&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===j.Delim&&this.source.charCodeAt(this.tokenStart)===e},getTokenValue:function(){return this.source.substring(this.tokenStart,this.tokenEnd)},getTokenLength:function(){return this.tokenEnd-this.tokenStart},substrToCursor:function(e){return this.source.substring(e,this.tokenStart)},skipWS:function(){for(var e=this.tokenIndex,t=0;e<this.tokenCount&&this.offsetAndType[e]>>24===q;e++,t++);t>0&&this.skip(t);},skipSC:function(){for(;this.tokenType===q||this.tokenType===Y;)this.next();},skip:function(e){var t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=16777215&this.offsetAndType[t-1],t=this.offsetAndType[t],this.tokenType=t>>24,this.tokenEnd=16777215&t):(this.tokenIndex=this.tokenCount,this.next());},next:function(){var e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>24,this.tokenEnd=16777215&e):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=W,this.tokenStart=this.tokenEnd=this.source.length);},forEachToken(e){for(var t=0,n=this.firstCharOffset;t<this.tokenCount;t++){var r=n,i=this.offsetAndType[t],a=16777215&i;n=a,e(i>>24,r,a,t);}},dump(){var e=new Array(this.tokenCount);return this.forEachToken((t,n,r,i)=>{e[i]={idx:i,type:_[t],chunk:this.source.substring(n,r),balance:this.balance[i]};}),e}};var H=U;function V(e){return e}function K(e,t,n,r){var i,a;switch(e.type){case"Group":i=function(e,t,n,r){var i=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",a=e.terms.map((function(e){return K(e,t,n,r)})).join(i);return (e.explicit||n)&&(a=(r||","===a[0]?"[":"[ ")+a+(r?"]":" ]")),a}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return K(e.term,t,n,r)+t(0===(a=e).min&&0===a.max?"*":0===a.min&&1===a.max?"?":1===a.min&&0===a.max?a.comma?"#":"+":1===a.min&&1===a.max?"":(a.comma?"#":"")+(a.min===a.max?"{"+a.min+"}":"{"+a.min+","+(0!==a.max?a.max:"")+"}"),e);case"Type":i="<"+e.name+(e.opts?t(function(e){switch(e.type){case"Range":return " ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}(e.opts),e.opts):"")+">";break;case"Property":i="<'"+e.name+"'>";break;case"Keyword":i=e.name;break;case"AtKeyword":i="@"+e.name;break;case"Function":i=e.name+"(";break;case"String":case"Token":i=e.value;break;case"Comma":i=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(i,e)}var G=function(e,t){var n=V,r=!1,i=!1;return "function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),i=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),K(e,n,r,i)};const Q={offset:0,line:1,column:1};function X(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Z(n):n:null}function Z({offset:e,line:t,column:n},r){const i={offset:e,line:t,column:n};if(r){const e=r.split(/\n|\r\n?|\f/);i.offset+=r.length,i.line+=e.length-1,i.column=1===e.length?i.column+r.length:e.pop().length+1;}return i}var $=function(e,t){const n=o("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},J=function(e,t,n,r){const i=o("SyntaxMatchError",e),{css:a,mismatchOffset:s,mismatchLength:l,start:c,end:u}=function(e,t){const n=e.tokens,r=e.longestMatch,i=r<n.length&&n[r].node||null,a=i!==t?i:null;let o,s,l=0,c=0,u=0,h="";for(let e=0;e<n.length;e++){const t=n[e].value;e===r&&(c=t.length,l=h.length),null!==a&&n[e].node===a&&(e<=r?u++:u=0),h+=t;}return r===n.length||u>1?(o=X(a||t,"end")||Z(Q,h),s=Z(o)):(o=X(a,"start")||Z(X(t,"start")||Q,h.slice(0,l)),s=X(a,"end")||Z(o,h.substr(l,c))),{css:h,mismatchOffset:l,mismatchLength:c,start:o,end:s}}(r,n);return i.rawMessage=e,i.syntax=t?G(t):"<generic>",i.css=a,i.mismatchOffset=s,i.mismatchLength=l,i.message=e+"\n syntax: "+i.syntax+"\n value: "+(a||"<empty string>")+"\n --------"+new Array(i.mismatchOffset+1).join("-")+"^",Object.assign(i,c),i.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:c,end:u},i},ee=Object.prototype.hasOwnProperty,te=Object.create(null),ne=Object.create(null);function re(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function ie(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){var n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return ""}var ae={keyword:function(e){if(ee.call(te,e))return te[e];var t=e.toLowerCase();if(ee.call(te,t))return te[e]=te[t];var n=re(t,0),r=n?"":ie(t,0);return te[e]=Object.freeze({basename:t.substr(r.length),name:t,vendor:r,prefix:r,custom:n})},property:function(e){if(ee.call(ne,e))return ne[e];var t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");var r=re(t,n.length);if(!r&&(t=t.toLowerCase(),ee.call(ne,t)))return ne[e]=ne[t];var i=r?"":ie(t,n.length),a=t.substr(0,n.length+i.length);return ne[e]=Object.freeze({basename:t.substr(a.length),name:t.substr(n.length),hack:n,vendor:i,prefix:a,custom:r})},isCustomProperty:re,vendorPrefix:ie},oe="undefined"!=typeof Uint32Array?Uint32Array:Array,se=function(e,t){return null===e||e.length<t?new oe(Math.max(t+1024,16384)):e},le=h.TYPE,ce=z.isNewline,ue=z.isName,he=z.isValidEscape,pe=z.isNumberStart,de=z.isIdentifierStart,me=z.charCodeCategory,ge=z.isBOM,fe=M.cmpStr,be=M.getNewlineLength,ye=M.findWhiteSpaceEnd,ke=M.consumeEscaped,ve=M.consumeName,xe=M.consumeNumber,we=M.consumeBadUrlRemnants;function Se(e,t){function n(t){return t<o?e.charCodeAt(t):0}function r(){return h=xe(e,h),de(n(h),n(h+1),n(h+2))?(f=le.Dimension,void(h=ve(e,h))):37===n(h)?(f=le.Percentage,void h++):void(f=le.Number)}function i(){const t=h;return h=ve(e,h),fe(e,t,h,"url")&&40===n(h)?34===n(h=ye(e,h+1))||39===n(h)?(f=le.Function,void(h=t+4)):void function(){for(f=le.Url,h=ye(e,h);h<e.length;h++){var t=e.charCodeAt(h);switch(me(t)){case 41:return void h++;case me.Eof:return;case me.WhiteSpace:return 41===n(h=ye(e,h))||h>=e.length?void(h<e.length&&h++):(h=we(e,h),void(f=le.BadUrl));case 34:case 39:case 40:case me.NonPrintable:return h=we(e,h),void(f=le.BadUrl);case 92:if(he(t,n(h+1))){h=ke(e,h)-1;break}return h=we(e,h),void(f=le.BadUrl)}}}():40===n(h)?(f=le.Function,void h++):void(f=le.Ident)}function a(t){for(t||(t=n(h++)),f=le.String;h<e.length;h++){var r=e.charCodeAt(h);switch(me(r)){case t:return void h++;case me.Eof:return;case me.WhiteSpace:if(ce(r))return h+=be(e,h,r),void(f=le.BadString);break;case 92:if(h===e.length-1)break;var i=n(h+1);ce(i)?h+=be(e,h+1,i):he(r,i)&&(h=ke(e,h)-1);}}}t||(t=new H);for(var o=(e=String(e||"")).length,s=se(t.offsetAndType,o+1),l=se(t.balance,o+1),c=0,u=ge(n(0)),h=u,p=0,d=0,m=0;h<o;){var g=e.charCodeAt(h),f=0;switch(l[c]=o,me(g)){case me.WhiteSpace:f=le.WhiteSpace,h=ye(e,h+1);break;case 34:a();break;case 35:ue(n(h+1))||he(n(h+1),n(h+2))?(f=le.Hash,h=ve(e,h+1)):(f=le.Delim,h++);break;case 39:a();break;case 40:f=le.LeftParenthesis,h++;break;case 41:f=le.RightParenthesis,h++;break;case 43:pe(g,n(h+1),n(h+2))?r():(f=le.Delim,h++);break;case 44:f=le.Comma,h++;break;case 45:pe(g,n(h+1),n(h+2))?r():45===n(h+1)&&62===n(h+2)?(f=le.CDC,h+=3):de(g,n(h+1),n(h+2))?i():(f=le.Delim,h++);break;case 46:pe(g,n(h+1),n(h+2))?r():(f=le.Delim,h++);break;case 47:42===n(h+1)?(f=le.Comment,1===(h=e.indexOf("*/",h+2)+2)&&(h=e.length)):(f=le.Delim,h++);break;case 58:f=le.Colon,h++;break;case 59:f=le.Semicolon,h++;break;case 60:33===n(h+1)&&45===n(h+2)&&45===n(h+3)?(f=le.CDO,h+=4):(f=le.Delim,h++);break;case 64:de(n(h+1),n(h+2),n(h+3))?(f=le.AtKeyword,h=ve(e,h+1)):(f=le.Delim,h++);break;case 91:f=le.LeftSquareBracket,h++;break;case 92:he(g,n(h+1))?i():(f=le.Delim,h++);break;case 93:f=le.RightSquareBracket,h++;break;case 123:f=le.LeftCurlyBracket,h++;break;case 125:f=le.RightCurlyBracket,h++;break;case me.Digit:r();break;case me.NameStart:i();break;case me.Eof:break;default:f=le.Delim,h++;}switch(f){case p:for(p=(d=l[m=16777215&d])>>24,l[c]=m,l[m++]=c;m<c;m++)l[m]===o&&(l[m]=c);break;case le.LeftParenthesis:case le.Function:l[c]=d,d=(p=le.RightParenthesis)<<24|c;break;case le.LeftSquareBracket:l[c]=d,d=(p=le.RightSquareBracket)<<24|c;break;case le.LeftCurlyBracket:l[c]=d,d=(p=le.RightCurlyBracket)<<24|c;}s[c++]=f<<24|h;}for(s[c]=le.EOF<<24|h,l[c]=o,l[o]=o;0!==d;)d=l[m=16777215&d],l[m]=o;return t.source=e,t.firstCharOffset=u,t.offsetAndType=s,t.tokenCount=c,t.balance=l,t.reset(),t.next(),t}Object.keys(h).forEach((function(e){Se[e]=h[e];})),Object.keys(z).forEach((function(e){Se[e]=z[e];})),Object.keys(M).forEach((function(e){Se[e]=M[e];}));var Ce=Se,ze=Ce.isDigit,Ae=Ce.cmpChar,Pe=Ce.TYPE,Te=Pe.Delim,Le=Pe.WhiteSpace,Ee=Pe.Comment,De=Pe.Ident,Oe=Pe.Number,Be=Pe.Dimension;function Ie(e,t){return null!==e&&e.type===Te&&e.value.charCodeAt(0)===t}function Ne(e,t,n){for(;null!==e&&(e.type===Le||e.type===Ee);)e=n(++t);return t}function Re(e,t,n,r){if(!e)return 0;var i=e.value.charCodeAt(t);if(43===i||45===i){if(n)return 0;t++;}for(;t<e.value.length;t++)if(!ze(e.value.charCodeAt(t)))return 0;return r+1}function Me(e,t,n){var r=!1,i=Ne(e,t,n);if(null===(e=n(i)))return t;if(e.type!==Oe){if(!Ie(e,43)&&!Ie(e,45))return t;if(r=!0,i=Ne(n(++i),i,n),null===(e=n(i))&&e.type!==Oe)return 0}if(!r){var a=e.value.charCodeAt(0);if(43!==a&&45!==a)return 0}return Re(e,r?0:1,r,i)}var je=Ce.isHexDigit,_e=Ce.cmpChar,Fe=Ce.TYPE,We=Fe.Ident,qe=Fe.Delim,Ye=Fe.Number,Ue=Fe.Dimension;function He(e,t){return null!==e&&e.type===qe&&e.value.charCodeAt(0)===t}function Ve(e,t){return e.value.charCodeAt(0)===t}function Ke(e,t,n){for(var r=t,i=0;r<e.value.length;r++){var a=e.value.charCodeAt(r);if(45===a&&n&&0!==i)return Ke(e,t+i+1,!1)>0?6:0;if(!je(a))return 0;if(++i>6)return 0}return i}function Ge(e,t,n){if(!e)return 0;for(;He(n(t),63);){if(++e>6)return 0;t++;}return t}var Qe=Ce.isIdentifierStart,Xe=Ce.isHexDigit,Ze=Ce.isDigit,$e=Ce.cmpStr,Je=Ce.consumeNumber,et=Ce.TYPE,tt=["unset","initial","inherit"],nt=["calc(","-moz-calc(","-webkit-calc("];function rt(e,t){return t<e.length?e.charCodeAt(t):0}function it(e,t){return $e(e,0,e.length,t)}function at(e,t){for(var n=0;n<t.length;n++)if(it(e,t[n]))return !0;return !1}function ot(e,t){return t===e.length-2&&(92===e.charCodeAt(t)&&Ze(e.charCodeAt(t+1)))}function st(e,t,n){if(e&&"Range"===e.type){var r=Number(void 0!==n&&n!==t.length?t.substr(0,n):t);if(isNaN(r))return !0;if(null!==e.min&&r<e.min)return !0;if(null!==e.max&&r>e.max)return !0}return !1}function lt(e,t){var n=e.index,r=0;do{if(r++,e.balance<=n)break}while(e=t(r));return r}function ct(e){return function(t,n,r){return null===t?0:t.type===et.Function&&at(t.value,nt)?lt(t,n):e(t,n,r)}}function ut(e){return function(t){return null===t||t.type!==e?0:1}}function ht(e){return function(t,n,r){if(null===t||t.type!==et.Dimension)return 0;var i=Je(t.value,0);if(null!==e){var a=t.value.indexOf("\\",i),o=-1!==a&&ot(t.value,a)?t.value.substring(i,a):t.value.substr(i);if(!1===e.hasOwnProperty(o.toLowerCase()))return 0}return st(r,t.value,i)?0:1}}function pt(e){return "function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===et.Number&&0===Number(t.value)?1:e(t,n,r)}}var dt,mt={"ident-token":ut(et.Ident),"function-token":ut(et.Function),"at-keyword-token":ut(et.AtKeyword),"hash-token":ut(et.Hash),"string-token":ut(et.String),"bad-string-token":ut(et.BadString),"url-token":ut(et.Url),"bad-url-token":ut(et.BadUrl),"delim-token":ut(et.Delim),"number-token":ut(et.Number),"percentage-token":ut(et.Percentage),"dimension-token":ut(et.Dimension),"whitespace-token":ut(et.WhiteSpace),"CDO-token":ut(et.CDO),"CDC-token":ut(et.CDC),"colon-token":ut(et.Colon),"semicolon-token":ut(et.Semicolon),"comma-token":ut(et.Comma),"[-token":ut(et.LeftSquareBracket),"]-token":ut(et.RightSquareBracket),"(-token":ut(et.LeftParenthesis),")-token":ut(et.RightParenthesis),"{-token":ut(et.LeftCurlyBracket),"}-token":ut(et.RightCurlyBracket),string:ut(et.String),ident:ut(et.Ident),"custom-ident":function(e){if(null===e||e.type!==et.Ident)return 0;var t=e.value.toLowerCase();return at(t,tt)||it(t,"default")?0:1},"custom-property-name":function(e){return null===e||e.type!==et.Ident||45!==rt(e.value,0)||45!==rt(e.value,1)?0:1},"hex-color":function(e){if(null===e||e.type!==et.Hash)return 0;var t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(var n=1;n<t;n++)if(!Xe(e.value.charCodeAt(n)))return 0;return 1},"id-selector":function(e){return null===e||e.type!==et.Hash?0:Qe(rt(e.value,1),rt(e.value,2),rt(e.value,3))?1:0},"an-plus-b":function(e,t){var n=0;if(!e)return 0;if(e.type===Oe)return Re(e,0,!1,n);if(e.type===De&&45===e.value.charCodeAt(0)){if(!Ae(e.value,1,110))return 0;switch(e.value.length){case 2:return Me(t(++n),n,t);case 3:return 45!==e.value.charCodeAt(2)?0:(n=Ne(t(++n),n,t),Re(e=t(n),0,!0,n));default:return 45!==e.value.charCodeAt(2)?0:Re(e,3,!0,n)}}else if(e.type===De||Ie(e,43)&&t(n+1).type===De){if(e.type!==De&&(e=t(++n)),null===e||!Ae(e.value,0,110))return 0;switch(e.value.length){case 1:return Me(t(++n),n,t);case 2:return 45!==e.value.charCodeAt(1)?0:(n=Ne(t(++n),n,t),Re(e=t(n),0,!0,n));default:return 45!==e.value.charCodeAt(1)?0:Re(e,2,!0,n)}}else if(e.type===Be){for(var r=e.value.charCodeAt(0),i=43===r||45===r?1:0,a=i;a<e.value.length&&ze(e.value.charCodeAt(a));a++);return a===i?0:Ae(e.value,a,110)?a+1===e.value.length?Me(t(++n),n,t):45!==e.value.charCodeAt(a+1)?0:a+2===e.value.length?(n=Ne(t(++n),n,t),Re(e=t(n),0,!0,n)):Re(e,a+2,!0,n):0}return 0},urange:function(e,t){var n=0;if(null===e||e.type!==We||!_e(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if(He(e,43))return null===(e=t(++n))?0:e.type===We?Ge(Ke(e,0,!0),++n,t):He(e,63)?Ge(1,++n,t):0;if(e.type===Ye){if(!Ve(e,43))return 0;var r=Ke(e,1,!0);return 0===r?0:null===(e=t(++n))?n:e.type===Ue||e.type===Ye?Ve(e,45)&&Ke(e,1,!1)?n+1:0:Ge(r,n,t)}return e.type===Ue&&Ve(e,43)?Ge(Ke(e,1,!0),++n,t):0},"declaration-value":function(e,t){if(!e)return 0;var n=0,r=0,i=e.index;e:do{switch(e.type){case et.BadString:case et.BadUrl:break e;case et.RightCurlyBracket:case et.RightParenthesis:case et.RightSquareBracket:if(e.balance>e.index||e.balance<i)break e;r--;break;case et.Semicolon:if(0===r)break e;break;case et.Delim:if("!"===e.value&&0===r)break e;break;case et.Function:case et.LeftParenthesis:case et.LeftSquareBracket:case et.LeftCurlyBracket:r++;}if(n++,e.balance<=i)break}while(e=t(n));return n},"any-value":function(e,t){if(!e)return 0;var n=e.index,r=0;e:do{switch(e.type){case et.BadString:case et.BadUrl:break e;case et.RightCurlyBracket:case et.RightParenthesis:case et.RightSquareBracket:if(e.balance>e.index||e.balance<n)break e}if(r++,e.balance<=n)break}while(e=t(r));return r},dimension:ct(ht(null)),angle:ct(ht({deg:!0,grad:!0,rad:!0,turn:!0})),decibel:ct(ht({db:!0})),frequency:ct(ht({hz:!0,khz:!0})),flex:ct(ht({fr:!0})),length:ct(pt(ht({px:!0,mm:!0,cm:!0,in:!0,pt:!0,pc:!0,q:!0,em:!0,ex:!0,ch:!0,rem:!0,vh:!0,vw:!0,vmin:!0,vmax:!0,vm:!0}))),resolution:ct(ht({dpi:!0,dpcm:!0,dppx:!0,x:!0})),semitones:ct(ht({st:!0})),time:ct(ht({s:!0,ms:!0})),percentage:ct((function(e,t,n){return null===e||e.type!==et.Percentage||st(n,e.value,e.value.length-1)?0:1})),zero:pt(),number:ct((function(e,t,n){if(null===e)return 0;var r=Je(e.value,0);return r===e.value.length||ot(e.value,r)?st(n,e.value,r)?0:1:0})),integer:ct((function(e,t,n){if(null===e||e.type!==et.Number)return 0;for(var r=43===e.value.charCodeAt(0)||45===e.value.charCodeAt(0)?1:0;r<e.value.length;r++)if(!Ze(e.value.charCodeAt(r)))return 0;return st(n,e.value,r)?0:1})),"-ms-legacy-expression":(dt="expression",dt+="(",function(e,t){return null!==e&&it(e.value,dt)?lt(e,t):0})},gt=function(e,t,n){var r=o("SyntaxError",e);return r.input=t,r.offset=n,r.rawMessage=e,r.message=r.rawMessage+"\n "+r.input+"\n--"+new Array((r.offset||r.input.length)+1).join("-")+"^",r},ft=function(e){this.str=e,this.pos=0;};ft.prototype={charCodeAt:function(e){return e<this.str.length?this.str.charCodeAt(e):0},charCode:function(){return this.charCodeAt(this.pos)},nextCharCode:function(){return this.charCodeAt(this.pos+1)},nextNonWsCode:function(e){return this.charCodeAt(this.findWsEnd(e))},findWsEnd:function(e){for(;e<this.str.length;e++){var t=this.str.charCodeAt(e);if(13!==t&&10!==t&&12!==t&&32!==t&&9!==t)break}return e},substringToPos:function(e){return this.str.substring(this.pos,this.pos=e)},eat:function(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++;},peek:function(){return this.pos<this.str.length?this.str.charAt(this.pos++):""},error:function(e){throw new gt(e,this.str,this.pos)}};var bt=ft,yt=function(e){for(var t="function"==typeof Uint32Array?new Uint32Array(128):new Array(128),n=0;n<128;n++)t[n]=e(String.fromCharCode(n))?1:0;return t}((function(e){return /[a-zA-Z0-9\-]/.test(e)})),kt={" ":1,"&&":2,"||":3,"|":4};function vt(e){return e.substringToPos(e.findWsEnd(e.pos))}function xt(e){for(var t=e.pos;t<e.str.length;t++){var n=e.str.charCodeAt(t);if(n>=128||0===yt[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function wt(e){for(var t=e.pos;t<e.str.length;t++){var n=e.str.charCodeAt(t);if(n<48||n>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function St(e){var t=e.str.indexOf("'",e.pos+1);return -1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function Ct(e){var t,n=null;return e.eat(123),t=wt(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=wt(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function zt(e,t){var n=function(e){var t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,t=123===e.charCode()?Ct(e):{min:1,max:0};break;case 123:t=Ct(e);break;default:return null}return {type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,n):t}function At(e){var t=e.peek();return ""===t?null:{type:"Token",value:t}}function Pt(e){var t,n=null;return e.eat(60),t=xt(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(vt(e),n=function(e){var t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():t=r*Number(wt(e)),vt(e),e.eat(44),vt(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(wt(e))),e.eat(93),null===t&&null===n?null:{type:"Range",min:t,max:n}}(e)),e.eat(62),zt(e,{type:"Type",name:t,opts:n})}function Tt(e,t){function n(e,t){return {type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}for(t=Object.keys(t).sort((function(e,t){return kt[e]-kt[t]}));t.length>0;){for(var r=t.shift(),i=0,a=0;i<e.length;i++){var o=e[i];"Combinator"===o.type&&(o.value===r?(-1===a&&(a=i-1),e.splice(i,1),i--):(-1!==a&&i-a>1&&(e.splice(a,i-a,n(e.slice(a,i),r)),i=a+1),a=-1));}-1!==a&&t.length&&e.splice(a,i-a,n(e.slice(a,i),r));}return r}function Lt(e){for(var t,n=[],r={},i=null,a=e.pos;t=Et(e);)"Spaces"!==t.type&&("Combinator"===t.type?(null!==i&&"Combinator"!==i.type||(e.pos=a,e.error("Unexpected combinator")),r[t.value]=!0):null!==i&&"Combinator"!==i.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),i=t,a=e.pos);return null!==i&&"Combinator"===i.type&&(e.pos-=a,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:Tt(n,r)||" ",disallowEmpty:!1,explicit:!1}}function Et(e){var t=e.charCode();if(t<128&&1===yt[t])return function(e){var t;return t=xt(e),40===e.charCode()?(e.pos++,{type:"Function",name:t}):zt(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return zt(e,function(e){var t;return e.eat(91),t=Lt(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){var t;return e.eat(60),e.eat(39),t=xt(e),e.eat(39),e.eat(62),zt(e,{type:"Property",name:t})}(e):Pt(e);case 124:return {type:"Combinator",value:e.substringToPos(124===e.nextCharCode()?e.pos+2:e.pos+1)};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return zt(e,{type:"String",value:St(e)});case 32:case 9:case 10:case 13:case 12:return {type:"Spaces",value:vt(e)};case 64:return (t=e.nextCharCode())<128&&1===yt[t]?(e.pos++,{type:"AtKeyword",name:xt(e)}):At(e);case 42:case 43:case 63:case 35:case 33:break;case 123:if((t=e.nextCharCode())<48||t>57)return At(e);break;default:return At(e)}}function Dt(e){var t=new bt(e),n=Lt(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type&&(n=n.terms[0]),n}Dt("[a&&<b>#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!");var Ot=Dt,Bt=function(){};function It(e){return "function"==typeof e?e:Bt}var Nt=function(e,t,n){var r=Bt,i=Bt;if("function"==typeof t?r=t:t&&(r=It(t.enter),i=It(t.leave)),r===Bt&&i===Bt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}i.call(n,t);}(e);},Rt=new H,Mt={decorator:function(e){var t=null,n={len:0,node:null},r=[n],i="";return {children:e.children,node:function(n){var r=t;t=n,e.node.call(this,n),t=r;},chunk:function(e){i+=e,n.node!==t?r.push({len:e.length,node:t}):n.len+=e.length;},result:function(){return jt(i,r)}}}};function jt(e,t){var n=[],r=0,i=0,a=t?t[i].node:null;for(Ce(e,Rt);!Rt.eof;){if(t)for(;i<t.length&&r+t[i].len<=Rt.tokenStart;)r+=t[i++].len,a=t[i].node;n.push({type:Rt.tokenType,value:Rt.getTokenValue(),index:Rt.tokenIndex,balance:Rt.balance[Rt.tokenIndex],node:a}),Rt.next();}return n}var _t={type:"Match"},Ft={type:"Mismatch"},Wt={type:"DisallowEmpty"};function qt(e,t,n){return t===_t&&n===Ft||e===_t&&t===_t&&n===_t?e:("If"===e.type&&e.else===Ft&&t===_t&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function Yt(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Ut(e){return "Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&Yt(e.name)}function Ht(e){if("function"==typeof e)return {type:"Generic",fn:e};switch(e.type){case"Group":var t=function e(t,n,r){switch(t){case" ":for(var i=_t,a=n.length-1;a>=0;a--){i=qt(l=n[a],i,Ft);}return i;case"|":i=Ft;var o=null;for(a=n.length-1;a>=0;a--){if(Ut(l=n[a])&&(null===o&&a>0&&Ut(n[a-1])&&(i=qt({type:"Enum",map:o=Object.create(null)},_t,i)),null!==o)){var s=(Yt(l.name)?l.name.slice(0,-1):l.name).toLowerCase();if(s in o==!1){o[s]=l;continue}}o=null,i=qt(l,_t,i);}return i;case"&&":if(n.length>5)return {type:"MatchOnce",terms:n,all:!0};for(i=Ft,a=n.length-1;a>=0;a--){var l=n[a];c=n.length>1?e(t,n.filter((function(e){return e!==l})),!1):_t,i=qt(l,c,i);}return i;case"||":if(n.length>5)return {type:"MatchOnce",terms:n,all:!1};for(i=r?_t:Ft,a=n.length-1;a>=0;a--){var c;l=n[a];c=n.length>1?e(t,n.filter((function(e){return e!==l})),!0):_t,i=qt(l,c,i);}return i}}(e.combinator,e.terms.map(Ht),!1);return e.disallowEmpty&&(t=qt(t,Wt,Ft)),t;case"Multiplier":return function(e){var t=_t,n=Ht(e.term);if(0===e.max)n=qt(n,Wt,Ft),(t=qt(n,null,Ft)).then=qt(_t,_t,t),e.comma&&(t.then.else=qt({type:"Comma",syntax:e},t,Ft));else for(var r=e.min||1;r<=e.max;r++)e.comma&&t!==_t&&(t=qt({type:"Comma",syntax:e},t,Ft)),t=qt(n,qt(_t,_t,t),Ft);if(0===e.min)t=qt(_t,_t,t);else for(r=0;r<e.min-1;r++)e.comma&&t!==_t&&(t=qt({type:"Comma",syntax:e},t,Ft)),t=qt(n,t,Ft);return t}(e);case"Type":case"Property":return {type:e.type,name:e.name,syntax:e};case"Keyword":return {type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return {type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return {type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return 3===e.value.length?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return {type:e.type,value:e.value,syntax:e};case"Comma":return {type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}var Vt=_t,Kt=Ft,Gt=Wt,Qt=function(e,t){return "string"==typeof e&&(e=Ot(e)),{type:"MatchGraph",match:Ht(e),syntax:t||null,source:e}},Xt=Object.prototype.hasOwnProperty,Zt=Vt,$t=Kt,Jt=Gt,en=h.TYPE;function tn(e){for(var t=null,n=null,r=e;null!==r;)n=r.prev,r.prev=t,t=r,r=n;return t}function nn(e,t){if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=65&&r<=90&&(r|=32),r!==t.charCodeAt(n))return !1}return !0}function rn(e){return null===e||(e.type===en.Comma||e.type===en.Function||e.type===en.LeftParenthesis||e.type===en.LeftSquareBracket||e.type===en.LeftCurlyBracket||function(e){return e.type===en.Delim&&"?"!==e.value}(e))}function an(e){return null===e||(e.type===en.RightParenthesis||e.type===en.RightSquareBracket||e.type===en.RightCurlyBracket||e.type===en.Delim)}function on(e,t,n){function r(){do{b++,f=b<e.length?e[b]:null;}while(null!==f&&(f.type===en.WhiteSpace||f.type===en.Comment))}function i(t){var n=b+t;return n<e.length?e[n]:null}function a(e,t){return {nextState:e,matchStack:k,syntaxStack:u,thenStack:h,tokenIndex:b,prev:t}}function o(e){h={nextState:e,matchStack:k,syntaxStack:u,prev:h};}function s(e){p=a(e,p);}function l(){k={type:1,syntax:t.syntax,token:f,prev:k},r(),d=null,b>y&&(y=b);}function c(){k=2===k.type?k.prev:{type:3,syntax:u.syntax,token:k.token,prev:k},u=u.prev;}var u=null,h=null,p=null,d=null,m=0,g=null,f=null,b=-1,y=0,k={type:0,syntax:null,token:null,prev:null};for(r();null===g&&++m<15e3;)switch(t.type){case"Match":if(null===h){if(null!==f&&(b!==e.length-1||"\\0"!==f.value&&"\\9"!==f.value)){t=$t;break}g="Match";break}if((t=h.nextState)===Jt){if(h.matchStack===k){t=$t;break}t=Zt;}for(;h.syntaxStack!==u;)c();h=h.prev;break;case"Mismatch":if(null!==d&&!1!==d)(null===p||b>p.tokenIndex)&&(p=d,d=!1);else if(null===p){g="Mismatch";break}t=p.nextState,h=p.thenStack,u=p.syntaxStack,k=p.matchStack,b=p.tokenIndex,f=b<e.length?e[b]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==$t&&s(t.else),t.then!==Zt&&o(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":var v=t.syntax.terms;if(t.index===v.length){if(0===t.mask||t.syntax.all){t=$t;break}t=Zt;break}if(t.mask===(1<<v.length)-1){t=Zt;break}for(;t.index<v.length;t.index++){var x=1<<t.index;if(0==(t.mask&x)){s(t),o({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|x}),t=v[t.index++];break}}break;case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(null!==f)if(-1!==(A=f.value.toLowerCase()).indexOf("\\")&&(A=A.replace(/\\[09].*$/,"")),Xt.call(t.map,A)){t=t.map[A];break}t=$t;break;case"Generic":var w=null!==u?u.opts:null,S=b+Math.floor(t.fn(f,i,w));if(!isNaN(S)&&S>b){for(;b<S;)l();t=Zt;}else t=$t;break;case"Type":case"Property":var C="Type"===t.type?"types":"properties",z=Xt.call(n,C)?n[C][t.name]:null;if(!z||!z.match)throw new Error("Bad syntax reference: "+("Type"===t.type?"<"+t.name+">":"<'"+t.name+"'>"));if(!1!==d&&null!==f&&"Type"===t.type)if("custom-ident"===t.name&&f.type===en.Ident||"length"===t.name&&"0"===f.value){null===d&&(d=a(t,p)),t=$t;break}u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},k={type:2,syntax:t.syntax,token:k.token,prev:k},t=z.match;break;case"Keyword":var A=t.name;if(null!==f){var P=f.value;if(-1!==P.indexOf("\\")&&(P=P.replace(/\\[09].*$/,"")),nn(P,A)){l(),t=Zt;break}}t=$t;break;case"AtKeyword":case"Function":if(null!==f&&nn(f.value,t.name)){l(),t=Zt;break}t=$t;break;case"Token":if(null!==f&&f.value===t.value){l(),t=Zt;break}t=$t;break;case"Comma":null!==f&&f.type===en.Comma?rn(k.token)?t=$t:(l(),t=an(f)?$t:Zt):t=rn(k.token)||an(f)?Zt:$t;break;case"String":var T="";for(S=b;S<e.length&&T.length<t.value.length;S++)T+=e[S].value;if(nn(T,t.value)){for(;b<S;)l();t=Zt;}else t=$t;break;default:throw new Error("Unknown node type: "+t.type)}switch(g){case null:console.warn("[csstree-match] BREAK after 15000 iterations"),g="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",k=null;break;case"Match":for(;null!==u;)c();break;default:k=null;}return {tokens:e,reason:g,iterations:m,match:k,longestMatch:y}}var sn=function(e,t,n){var r=on(e,t,n||{});if(null===r.match)return r;var i=r.match,a=r.match={syntax:t.syntax||null,match:[]},o=[a];for(i=tn(i).prev;null!==i;){switch(i.type){case 2:a.match.push(a={syntax:i.syntax,match:[]}),o.push(a);break;case 3:o.pop(),a=o[o.length-1];break;default:a.match.push({syntax:i.syntax||null,token:i.token.value,node:i.token.node});}i=i.prev;}return r};function ln(e){function t(e){return null!==e&&("Type"===e.type||"Property"===e.type||"Keyword"===e.type)}var n=null;return null!==this.matched&&function r(i){if(Array.isArray(i.match)){for(var a=0;a<i.match.length;a++)if(r(i.match[a]))return t(i.syntax)&&n.unshift(i.syntax),!0}else if(i.node===e)return n=t(i.syntax)?[i.syntax]:[],!0;return !1}(this.matched),n}function cn(e,t,n){var r=ln.call(e,t);return null!==r&&r.some(n)}var un={getTrace:ln,isType:function(e,t){return cn(this,e,(function(e){return "Type"===e.type&&e.name===t}))},isProperty:function(e,t){return cn(this,e,(function(e){return "Property"===e.type&&e.name===t}))},isKeyword:function(e){return cn(this,e,(function(e){return "Keyword"===e.type}))}};var hn={matchFragments:function(e,t,n,r,i){var o=[];return null!==n.matched&&function n(s){if(null!==s.syntax&&s.syntax.type===r&&s.syntax.name===i){var l=function e(t){return "node"in t?t.node:e(t.match[0])}(s),c=function e(t){return "node"in t?t.node:e(t.match[t.match.length-1])}(s);e.syntax.walk(t,(function(e,t,n){if(e===l){var r=new a;do{if(r.appendData(t.data),t.data===c)break;t=t.next;}while(null!==t);o.push({parent:n,nodes:r});}}));}Array.isArray(s.match)&&s.match.forEach(n);}(n.matched),o}},pn=Object.prototype.hasOwnProperty;function dn(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function mn(e){return Boolean(e)&&dn(e.offset)&&dn(e.line)&&dn(e.column)}function gn(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(var i in n){var o=!0;if(!1!==pn.call(n,i)){if("type"===i)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===i){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)i+=".source";else if(mn(n.loc.start)){if(mn(n.loc.end))continue;i+=".end";}else i+=".start";o=!1;}else if(t.hasOwnProperty(i)){var s=0;for(o=!1;!o&&s<t[i].length;s++){var l=t[i][s];switch(l){case String:o="string"==typeof n[i];break;case Boolean:o="boolean"==typeof n[i];break;case null:o=null===n[i];break;default:"string"==typeof l?o=n[i]&&n[i].type===l:Array.isArray(l)&&(o=n[i]instanceof a);}}}else r(n,"Unknown field `"+i+"` for "+e+" node type");o||r(n,"Bad value for `"+e+"."+i+"`");}}for(var i in t)pn.call(t,i)&&!1===pn.call(n,i)&&r(n,"Field `"+e+"."+i+"` is missed");}}function fn(e,t){var n=t.structure,r={type:String,loc:!0},i={type:'"'+e+'"'};for(var a in n)if(!1!==pn.call(n,a)){for(var o=[],s=r[a]=Array.isArray(n[a])?n[a].slice():[n[a]],l=0;l<s.length;l++){var c=s[l];if(c===String||c===Boolean)o.push(c.name);else if(null===c)o.push("null");else if("string"==typeof c)o.push("<"+c+">");else {if(!Array.isArray(c))throw new Error("Wrong value `"+c+"` in `"+e+"."+a+"` structure definition");o.push("List");}}i[a]=o.join(" | ");}return {docs:i,check:gn(e,r)}}var bn=$,yn=J,kn=Qt,vn=sn,xn=function(e){var t={};if(e.node)for(var n in e.node)if(pn.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=fn(n,r);}return t},wn=kn("inherit | initial | unset"),Sn=kn("inherit | initial | unset | <-ms-legacy-expression>");function Cn(e,t,n){var r={};for(var i in e)e[i].syntax&&(r[i]=n?e[i].syntax:G(e[i].syntax,{compact:t}));return r}function zn(e,t,n){const r={};for(const[i,a]of Object.entries(e))r[i]={prelude:a.prelude&&(n?a.prelude.syntax:G(a.prelude.syntax,{compact:t})),descriptors:a.descriptors&&Cn(a.descriptors,t,n)};return r}function An(e,t,n){return {matched:e,iterations:n,error:t,getTrace:un.getTrace,isType:un.isType,isProperty:un.isProperty,isKeyword:un.isKeyword}}function Pn(e,t,n,r){var i,a=function(e,t){return "string"==typeof e?jt(e,null):t.generate(e,Mt)}(n,e.syntax);return function(e){for(var t=0;t<e.length;t++)if("var("===e[t].value.toLowerCase())return !0;return !1}(a)?An(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=vn(a,e.valueCommonSyntax,e)),r&&i.match||(i=vn(a,t.match,e)).match?An(i.match,null,i.iterations):An(null,new yn(i.reason,t.syntax,n,i),i.iterations))}var Tn=function(e,t,n){if(this.valueCommonSyntax=wn,this.syntax=t,this.generic=!1,this.atrules={},this.properties={},this.types={},this.structure=n||xn(e),e){if(e.types)for(var r in e.types)this.addType_(r,e.types[r]);if(e.generic)for(var r in this.generic=!0,mt)this.addType_(r,mt[r]);if(e.atrules)for(var r in e.atrules)this.addAtrule_(r,e.atrules[r]);if(e.properties)for(var r in e.properties)this.addProperty_(r,e.properties[r]);}};Tn.prototype={structure:{},checkStructure:function(e){function t(e,t){r.push({node:e,message:t});}var n=this.structure,r=[];return this.syntax.walk(e,(function(e){n.hasOwnProperty(e.type)?n[e.type].check(e,t):t(e,"Unknown node type `"+e.type+"`");})),!!r.length&&r},createDescriptor:function(e,t,n,r=null){var i={type:t,name:n},a={type:t,name:n,parent:r,syntax:null,match:null};return "function"==typeof e?a.match=kn(e,i):("string"==typeof e?Object.defineProperty(a,"syntax",{get:function(){return Object.defineProperty(a,"syntax",{value:Ot(e)}),a.syntax}}):a.syntax=e,Object.defineProperty(a,"match",{get:function(){return Object.defineProperty(a,"match",{value:kn(a.syntax,i)}),a.match}})),a},addAtrule_:function(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n),{}):null});},addProperty_:function(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e));},addType_:function(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e),t===mt["-ms-legacy-expression"]&&(this.valueCommonSyntax=Sn));},checkAtruleName:function(e){if(!this.getAtrule(e))return new bn("Unknown at-rule","@"+e)},checkAtrulePrelude:function(e,t){let n=this.checkAtruleName(e);if(n)return n;var r=this.getAtrule(e);return !r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):r.prelude&&!t?new SyntaxError("At-rule `@"+e+"` should contain a prelude"):void 0},checkAtruleDescriptorName:function(e,t){let n=this.checkAtruleName(e);if(n)return n;var r=this.getAtrule(e),i=ae.keyword(t);return r.descriptors?r.descriptors[i.name]||r.descriptors[i.basename]?void 0:new bn("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")},checkPropertyName:function(e){return ae.property(e).custom?new Error("Lexer matching doesn't applicable for custom properties"):this.getProperty(e)?void 0:new bn("Unknown property",e)},matchAtrulePrelude:function(e,t){var n=this.checkAtrulePrelude(e,t);return n?An(null,n):t?Pn(this,this.getAtrule(e).prelude,t,!0):An(null,null)},matchAtruleDescriptor:function(e,t,n){var r=this.checkAtruleDescriptorName(e,t);if(r)return An(null,r);var i=this.getAtrule(e),a=ae.keyword(t);return Pn(this,i.descriptors[a.name]||i.descriptors[a.basename],n,!0)},matchDeclaration:function(e){return "Declaration"!==e.type?An(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)},matchProperty:function(e,t){var n=this.checkPropertyName(e);return n?An(null,n):Pn(this,this.getProperty(e),t,!0)},matchType:function(e,t){var n=this.getType(e);return n?Pn(this,n,t,!1):An(null,new bn("Unknown type",e))},match:function(e,t){return "string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),Pn(this,e,t,!1)):An(null,new bn("Bad syntax"))},findValueFragments:function(e,t,n,r){return hn.matchFragments(this,t,this.matchProperty(e,t),n,r)},findDeclarationValueFragments:function(e,t,n){return hn.matchFragments(this,e.value,this.matchDeclaration(e),t,n)},findAllFragments:function(e,t,n){var r=[];return this.syntax.walk(e,{visit:"Declaration",enter:function(e){r.push.apply(r,this.findDeclarationValueFragments(e,t,n));}.bind(this)}),r},getAtrule:function(e,t=!0){var n=ae.keyword(e);return (n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null},getAtrulePrelude:function(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null},getAtruleDescriptor:function(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null},getProperty:function(e,t=!0){var n=ae.property(e);return (n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null},getType:function(e){return this.types.hasOwnProperty(e)?this.types[e]:null},validate:function(){function e(r,i,a,o){if(a.hasOwnProperty(i))return a[i];a[i]=!1,null!==o.syntax&&Nt(o.syntax,(function(o){if("Type"===o.type||"Property"===o.type){var s="Type"===o.type?r.types:r.properties,l="Type"===o.type?t:n;s.hasOwnProperty(o.name)&&!e(r,o.name,l,s[o.name])||(a[i]=!0);}}),this);}var t={},n={};for(var r in this.types)e(this,r,t,this.types[r]);for(var r in this.properties)e(this,r,n,this.properties[r]);return t=Object.keys(t).filter((function(e){return t[e]})),n=Object.keys(n).filter((function(e){return n[e]})),t.length||n.length?{types:t,properties:n}:null},dump:function(e,t){return {generic:this.generic,types:Cn(this.types,!t,e),properties:Cn(this.properties,!t,e),atrules:zn(this.atrules,!t,e)}},toString:function(){return JSON.stringify(this.dump())}};var Ln=Tn,En={SyntaxError:gt,parse:Ot,generate:G,walk:Nt},Dn=Ce.isBOM;var On=function(){this.lines=null,this.columns=null,this.linesAndColumnsComputed=!1;};On.prototype={setSource:function(e,t,n,r){this.source=e,this.startOffset=void 0===t?0:t,this.startLine=void 0===n?1:n,this.startColumn=void 0===r?1:r,this.linesAndColumnsComputed=!1;},ensureLinesAndColumnsComputed:function(){this.linesAndColumnsComputed||(!function(e,t){for(var n=t.length,r=se(e.lines,n),i=e.startLine,a=se(e.columns,n),o=e.startColumn,s=t.length>0?Dn(t.charCodeAt(0)):0;s<n;s++){var l=t.charCodeAt(s);r[s]=i,a[s]=o++,10!==l&&13!==l&&12!==l||(13===l&&s+1<n&&10===t.charCodeAt(s+1)&&(r[++s]=i,a[s]=o),i++,o=1);}r[s]=i,a[s]=o,e.lines=r,e.columns=a;}(this,this.source),this.linesAndColumnsComputed=!0);},getLocation:function(e,t){return this.ensureLinesAndColumnsComputed(),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}},getLocationRange:function(e,t,n){return this.ensureLinesAndColumnsComputed(),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}};var Bn=On,In=Ce.TYPE,Nn=In.WhiteSpace,Rn=In.Comment,Mn=function(e){var t=this.createList(),n=null,r={recognizer:e,space:null,ignoreWS:!1,ignoreWSAfter:!1};for(this.scanner.skipSC();!this.scanner.eof;){switch(this.scanner.tokenType){case Rn:this.scanner.next();continue;case Nn:r.ignoreWS?this.scanner.next():r.space=this.WhiteSpace();continue}if(void 0===(n=e.getNode.call(this,r)))break;null!==r.space&&(t.push(r.space),r.space=null),t.push(n),r.ignoreWSAfter?(r.ignoreWSAfter=!1,r.ignoreWS=!0):r.ignoreWS=!1;}return t},{findWhiteSpaceStart:jn,cmpStr:_n}=M,Fn=function(){},Wn=h.TYPE,qn=h.NAME,Yn=Wn.WhiteSpace,Un=Wn.Comment,Hn=Wn.Ident,Vn=Wn.Function,Kn=Wn.Url,Gn=Wn.Hash,Qn=Wn.Percentage,Xn=Wn.Number;function Zn(e){return function(){return this[e]()}}var $n=function(e){var t={scanner:new H,locationMap:new Bn,filename:"<unknown>",needPositions:!1,onParseError:Fn,onParseErrorThrow:!1,parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Mn,createList:function(){return new a},createSingleNodeList:function(e){return (new a).appendData(e)},getFirstListNode:function(e){return e&&e.first()},getLastListNode:function(e){return e.last()},parseWithFallback:function(e,t){var n=this.scanner.tokenIndex;try{return e.call(this)}catch(e){if(this.onParseErrorThrow)throw e;var r=t.call(this,n);return this.onParseErrorThrow=!0,this.onParseError(e,r),this.onParseErrorThrow=!1,r}},lookupNonWSType:function(e){do{var t=this.scanner.lookupType(e++);if(t!==Yn)return t}while(0!==t);return 0},eat:function(e){if(this.scanner.tokenType!==e){var t=this.scanner.tokenStart,n=qn[e]+" is expected";switch(e){case Hn:this.scanner.tokenType===Vn||this.scanner.tokenType===Kn?(t=this.scanner.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case Gn:this.scanner.isDelim(35)&&(this.scanner.next(),t++,n="Name is expected");break;case Qn:this.scanner.tokenType===Xn&&(t=this.scanner.tokenEnd,n="Percent sign is expected");break;default:this.scanner.source.charCodeAt(this.scanner.tokenStart)===e&&(t+=1);}this.error(n,t);}this.scanner.next();},consume:function(e){var t=this.scanner.getTokenValue();return this.eat(e),t},consumeFunctionName:function(){var e=this.scanner.source.substring(this.scanner.tokenStart,this.scanner.tokenEnd-1);return this.eat(Vn),e},getLocation:function(e,t){return this.needPositions?this.locationMap.getLocationRange(e,t,this.filename):null},getLocationFromList:function(e){if(this.needPositions){var t=this.getFirstListNode(e),n=this.getLastListNode(e);return this.locationMap.getLocationRange(null!==t?t.loc.start.offset-this.locationMap.startOffset:this.scanner.tokenStart,null!==n?n.loc.end.offset-this.locationMap.startOffset:this.scanner.tokenStart,this.filename)}return null},error:function(e,t){var n=void 0!==t&&t<this.scanner.source.length?this.locationMap.getLocation(t):this.scanner.eof?this.locationMap.getLocation(jn(this.scanner.source,this.scanner.source.length-1)):this.locationMap.getLocation(this.scanner.tokenStart);throw new l(e||"Unexpected input",this.scanner.source,n.offset,n.line,n.column)}};for(var n in e=function(e){var t={context:{},scope:{},atrule:{},pseudo:{}};if(e.parseContext)for(var n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=Zn(e.parseContext[n]);}if(e.scope)for(var n in e.scope)t.scope[n]=e.scope[n];if(e.atrule)for(var n in e.atrule){var r=e.atrule[n];r.parse&&(t.atrule[n]=r.parse);}if(e.pseudo)for(var n in e.pseudo){var i=e.pseudo[n];i.parse&&(t.pseudo[n]=i.parse);}if(e.node)for(var n in e.node)t[n]=e.node[n].parse;return t}(e||{}))t[n]=e[n];return function(e,n){var r,i=(n=n||{}).context||"default",a=n.onComment;if(Ce(e,t.scanner),t.locationMap.setSource(e,n.offset,n.line,n.column),t.filename=n.filename||"<unknown>",t.needPositions=Boolean(n.positions),t.onParseError="function"==typeof n.onParseError?n.onParseError:Fn,t.onParseErrorThrow=!1,t.parseAtrulePrelude=!("parseAtrulePrelude"in n)||Boolean(n.parseAtrulePrelude),t.parseRulePrelude=!("parseRulePrelude"in n)||Boolean(n.parseRulePrelude),t.parseValue=!("parseValue"in n)||Boolean(n.parseValue),t.parseCustomProperty="parseCustomProperty"in n&&Boolean(n.parseCustomProperty),!t.context.hasOwnProperty(i))throw new Error("Unknown context `"+i+"`");return "function"==typeof a&&t.scanner.forEachToken((n,r,i)=>{if(n===Un){const n=t.getLocation(r,i),o=_n(e,i-2,i,"*/")?e.slice(r+2,i-2):e.slice(r+2,i);a(o,n);}}),r=t.context[i].call(t,n),t.scanner.eof||t.error(),r}},Jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),er=function(e){if(0<=e&&e<Jn.length)return Jn[e];throw new TypeError("Must be between 0 and 63: "+e)};var tr=function(e){var t,n="",r=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&r,(r>>>=5)>0&&(t|=32),n+=er(t);}while(r>0);return n};var nr=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function a(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,r=i(e);if(r){if(!r.path)return e;n=r.path;}for(var o,s=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(o=l[u])?l.splice(u,1):".."===o?c++:c>0&&(""===o?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return ""===(n=l.join("/"))&&(n=s?"/":"."),r?(r.path=n,a(r)):n}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),s=i(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),a(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,a(s);var l="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=l,a(s)):l}t.urlParse=i,t.urlGenerate=a,t.normalize=o,t.join=s,t.isAbsolute=function(e){return "/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n;}return Array(n+1).join("../")+t.substr(e.length+1)};var l=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return !1;var t=e.length;if(t<9)return !1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return !1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return !1;return !0}function h(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=l?c:function(e){return u(e)?"$"+e:e},t.fromSetString=l?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=h(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:h(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=h(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:h(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=h(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:h(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=i(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var l=r.path.lastIndexOf("/");l>=0&&(r.path=r.path.substring(0,l+1));}t=s(a(r),t);}return o(t)};})),rr=(nr.getArg,nr.urlParse,nr.urlGenerate,nr.normalize,nr.join,nr.isAbsolute,nr.relative,nr.toSetString,nr.fromSetString,nr.compareByOriginalPositions,nr.compareByGeneratedPositionsDeflated,nr.compareByGeneratedPositionsInflated,nr.parseSourceMapInput,nr.computeSourceURL,Object.prototype.hasOwnProperty),ir="undefined"!=typeof Map;function ar(){this._array=[],this._set=ir?new Map:Object.create(null);}ar.fromArray=function(e,t){for(var n=new ar,r=0,i=e.length;r<i;r++)n.add(e[r],t);return n},ar.prototype.size=function(){return ir?this._set.size:Object.getOwnPropertyNames(this._set).length},ar.prototype.add=function(e,t){var n=ir?e:nr.toSetString(e),r=ir?this.has(e):rr.call(this._set,n),i=this._array.length;r&&!t||this._array.push(e),r||(ir?this._set.set(e,i):this._set[n]=i);},ar.prototype.has=function(e){if(ir)return this._set.has(e);var t=nr.toSetString(e);return rr.call(this._set,t)},ar.prototype.indexOf=function(e){if(ir){var t=this._set.get(e);if(t>=0)return t}else {var n=nr.toSetString(e);if(rr.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},ar.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},ar.prototype.toArray=function(){return this._array.slice()};var or={ArraySet:ar};function sr(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0};}sr.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t);},sr.prototype.add=function(e){var t,n,r,i,a,o;t=this._last,n=e,r=t.generatedLine,i=n.generatedLine,a=t.generatedColumn,o=n.generatedColumn,i>r||i==r&&o>=a||nr.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e));},sr.prototype.toArray=function(){return this._sorted||(this._array.sort(nr.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var lr=or.ArraySet,cr={MappingList:sr}.MappingList;function ur(e){e||(e={}),this._file=nr.getArg(e,"file",null),this._sourceRoot=nr.getArg(e,"sourceRoot",null),this._skipValidation=nr.getArg(e,"skipValidation",!1),this._sources=new lr,this._names=new lr,this._mappings=new cr,this._sourcesContents=null;}ur.prototype._version=3,ur.fromSourceMap=function(e){var t=e.sourceRoot,n=new ur({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=nr.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r);})),e.sources.forEach((function(r){var i=r;null!==t&&(i=nr.relative(t,r)),n._sources.has(i)||n._sources.add(i);var a=e.sourceContentFor(r);null!=a&&n.setSourceContent(r,a);})),n},ur.prototype.addMapping=function(e){var t=nr.getArg(e,"generated"),n=nr.getArg(e,"original",null),r=nr.getArg(e,"source",null),i=nr.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i});},ur.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=nr.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[nr.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[nr.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null));},ur.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file;}var i=this._sourceRoot;null!=i&&(r=nr.relative(i,r));var a=new lr,o=new lr;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var s=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=s.source&&(t.source=s.source,null!=n&&(t.source=nr.join(n,t.source)),null!=i&&(t.source=nr.relative(i,t.source)),t.originalLine=s.line,t.originalColumn=s.column,null!=s.name&&(t.name=s.name));}var l=t.source;null==l||a.has(l)||a.add(l);var c=t.name;null==c||o.has(c)||o.add(c);}),this),this._sources=a,this._names=o,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=nr.join(n,t)),null!=i&&(t=nr.relative(i,t)),this.setSourceContent(t,r));}),this);},ur.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},ur.prototype._serializeMappings=function(){for(var e,t,n,r,i=0,a=1,o=0,s=0,l=0,c=0,u="",h=this._mappings.toArray(),p=0,d=h.length;p<d;p++){if(e="",(t=h[p]).generatedLine!==a)for(i=0;t.generatedLine!==a;)e+=";",a++;else if(p>0){if(!nr.compareByGeneratedPositionsInflated(t,h[p-1]))continue;e+=",";}e+=tr(t.generatedColumn-i),i=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=tr(r-c),c=r,e+=tr(t.originalLine-1-s),s=t.originalLine-1,e+=tr(t.originalColumn-o),o=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=tr(n-l),l=n)),u+=e;}return u},ur.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=nr.relative(t,e));var n=nr.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},ur.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},ur.prototype.toString=function(){return JSON.stringify(this.toJSON())};var hr={SourceMapGenerator:ur}.SourceMapGenerator,pr={Atrule:!0,Selector:!0,Declaration:!0},dr=Object.prototype.hasOwnProperty;function mr(e,t){var n=e.children,r=null;"function"!=typeof t?n.forEach(this.node,this):n.forEach((function(e){null!==r&&t.call(this,r),this.node(e),r=e;}),this);}var gr=function(e){function t(e){if(!dr.call(n,e.type))throw new Error("Unknown node type: "+e.type);n[e.type].call(this,e);}var n={};if(e.node)for(var r in e.node)n[r]=e.node[r].generate;return function(e,n){var r="",i={children:mr,node:t,chunk:function(e){r+=e;},result:function(){return r}};return n&&("function"==typeof n.decorator&&(i=n.decorator(i)),n.sourceMap&&(i=function(e){var t=new hr,n=1,r=0,i={line:1,column:0},a={line:0,column:0},o=!1,s={line:1,column:0},l={generated:s},c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&pr.hasOwnProperty(e.type)){var u=e.loc.start.line,h=e.loc.start.column-1;a.line===u&&a.column===h||(a.line=u,a.column=h,i.line=n,i.column=r,o&&(o=!1,i.line===s.line&&i.column===s.column||t.addMapping(l)),o=!0,t.addMapping({source:e.loc.source,original:a,generated:i}));}c.call(this,e),o&&pr.hasOwnProperty(e.type)&&(s.line=n,s.column=r);};var u=e.chunk;e.chunk=function(e){for(var t=0;t<e.length;t++)10===e.charCodeAt(t)?(n++,r=0):r++;u(e);};var h=e.result;return e.result=function(){return o&&t.addMapping(l),{css:h(),map:t}},e}(i))),i.node(e),i.result()}},fr=Object.prototype.hasOwnProperty,br=function(){};function yr(e){return "function"==typeof e?e:br}function kr(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i);}}function vr(e,t){var n=t.structure,r=[];for(var i in n)if(!1!==fr.call(n,i)){var a=n[i],o={name:i,type:!1,nullable:!1};Array.isArray(n[i])||(a=[n[i]]);for(var s=0;s<a.length;s++){var l=a[s];null===l?o.nullable=!0:"string"==typeof l?o.type="node":Array.isArray(l)&&(o.type="list");}o.type&&r.push(o);}return r.length?{context:t.walkContext,fields:r}:null}function xr(e,t){var n=e.fields.slice(),r=e.context,i="string"==typeof r;return t&&n.reverse(),function(e,a,o,s){var l;i&&(l=a[r],a[r]=e);for(var c=0;c<n.length;c++){var u=n[c],h=e[u.name];if(!u.nullable||h)if("list"===u.type){if(t?h.reduceRight(s,!1):h.reduce(s,!1))return !0}else if(o(h))return !0}i&&(a[r]=l);}}function wr(e){return {Atrule:{StyleSheet:e.StyleSheet,Atrule:e.Atrule,Rule:e.Rule,Block:e.Block},Rule:{StyleSheet:e.StyleSheet,Atrule:e.Atrule,Rule:e.Rule,Block:e.Block},Declaration:{StyleSheet:e.StyleSheet,Atrule:e.Atrule,Rule:e.Rule,Block:e.Block,DeclarationList:e.DeclarationList}}}var Sr=function(e){var t=function(e){var t={};for(var n in e.node)if(fr.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=vr(0,r);}return t}(e),n={},r={},i=Symbol("break-walk"),a=Symbol("skip-node");for(var o in t)fr.call(t,o)&&null!==t[o]&&(n[o]=xr(t[o],!1),r[o]=xr(t[o],!0));var s=wr(n),l=wr(r),c=function(e,o){function c(e,t,n){var r=h.call(m,e,t,n);return r===i||r!==a&&(!(!d.hasOwnProperty(e.type)||!d[e.type](e,m,c,u))||p.call(m,e,t,n)===i)}var u=(e,t,n,r)=>e||c(t,n,r),h=br,p=br,d=n,m={break:i,skip:a,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof o)h=o;else if(o&&(h=yr(o.enter),p=yr(o.leave),o.reverse&&(d=r),o.visit)){if(s.hasOwnProperty(o.visit))d=o.reverse?l[o.visit]:s[o.visit];else if(!t.hasOwnProperty(o.visit))throw new Error("Bad value `"+o.visit+"` for `visit` option (should be: "+Object.keys(t).join(", ")+")");h=kr(h,o.visit),p=kr(p,o.visit);}if(h===br&&p===br)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e);};return c.break=i,c.skip=a,c.find=function(e,t){var n=null;return c(e,(function(e,r,a){if(t.call(this,e,r,a))return n=e,i})),n},c.findLast=function(e,t){var n=null;return c(e,{reverse:!0,enter:function(e,r,a){if(t.call(this,e,r,a))return n=e,i}}),n},c.findAll=function(e,t){var n=[];return c(e,(function(e,r,i){t.call(this,e,r,i)&&n.push(e);})),n},c},Cr=function e(t){var n={};for(var r in t){var i=t[r];i&&(Array.isArray(i)||i instanceof a?i=i.map(e):i.constructor===Object&&(i=e(i))),n[r]=i;}return n};const zr=Object.prototype.hasOwnProperty,Ar={generic:!0,types:Er,atrules:{prelude:Dr,descriptors:Dr},properties:Er,parseContext:function(e,t){return Object.assign(e,t)},scope:function e(t,n){for(const r in n)zr.call(n,r)&&(Pr(t[r])?e(t[r],Tr(n[r])):t[r]=Tr(n[r]));return t},atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Pr(e){return e&&e.constructor===Object}function Tr(e){return Pr(e)?Object.assign({},e):e}function Lr(e,t){return "string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Er(e,t){if("string"==typeof t)return Lr(e,t);const n=Object.assign({},e);for(let r in t)zr.call(t,r)&&(n[r]=Lr(zr.call(e,r)?e[r]:void 0,t[r]));return n}function Dr(e,t){const n=Er(e,t);return !Pr(n)||Object.keys(n).length?n:null}var Or=(e,t)=>function e(t,n,r){for(const i in r)if(!1!==zr.call(r,i))if(!0===r[i])i in n&&zr.call(n,i)&&(t[i]=Tr(n[i]));else if(r[i])if("function"==typeof r[i]){const e=r[i];t[i]=e({},t[i]),t[i]=e(t[i]||{},n[i]);}else if(Pr(r[i])){const a={};for(let n in t[i])a[n]=e({},t[i][n],r[i]);for(let t in n[i])a[t]=e(a[t]||{},n[i][t],r[i]);t[i]=a;}else if(Array.isArray(r[i])){const a={},o=r[i].reduce((function(e,t){return e[t]=!0,e}),{});for(const[n,r]of Object.entries(t[i]||{}))a[n]={},r&&e(a[n],r,o);for(const t in n[i])zr.call(n[i],t)&&(a[t]||(a[t]={}),n[i]&&n[i][t]&&e(a[t],n[i][t],o));t[i]=a;}return t}(e,t,Ar);function Br(e){var t=$n(e),n=Sr(e),r=gr(e),i=function(e){return {fromPlainObject:function(t){return e(t,{enter:function(e){e.children&&e.children instanceof a==!1&&(e.children=(new a).fromArray(e.children));}}),t},toPlainObject:function(t){return e(t,{leave:function(e){e.children&&e.children instanceof a&&(e.children=e.children.toArray());}}),t}}}(n),o={List:a,SyntaxError:l,TokenStream:H,Lexer:Ln,vendorPrefix:ae.vendorPrefix,keyword:ae.keyword,property:ae.property,isCustomProperty:ae.isCustomProperty,definitionSyntax:En,lexer:null,createLexer:function(e){return new Ln(e,o,o.lexer.structure)},tokenize:Ce,parse:t,walk:n,generate:r,find:n.find,findLast:n.findLast,findAll:n.findAll,clone:Cr,fromPlainObject:i.fromPlainObject,toPlainObject:i.toPlainObject,createSyntax:function(e){return Br(Or({},e))},fork:function(t){var n=Or({},e);return Br("function"==typeof t?t(n,Object.assign):Or(n,t))}};return o.lexer=new Ln({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},o),o}var Ir=function(e){return Br(Or({},e))},Nr={generic:!0,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<quote>|<target>|<leader()>|<attr()>|counter( <ident> , <'list-style-type'>? )]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )","counter()":"counter( <custom-ident> , <counter-style>? )","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <custom-ident> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fit-content()":"fit-content( [<length>|<percentage>] )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<positive-integer>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] <resolution>","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length>|<percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length>|<percentage>|min-content|max-content|auto] , [<length>|<percentage>|<flex>|min-content|max-content|auto] )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|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|gray|green|greenyellow|grey|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|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( <length> )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","saturate()":"saturate( <number-percentage> )","scale()":"scale( <number> , <number>? )","scale3d()":"scale3d( <number> , <number> , <number> )","scaleX()":"scaleX( <number> )","scaleY()":"scaleY( <number> )","scaleZ()":"scaleZ( <number> )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"<time>||<timing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-transition":"[none|<single-transition-property>]||<time>||<timing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<positive-integer>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( [<length>|<percentage>] )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","border-radius":"<length-percentage>{1,2}",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral",left:"<length>|auto","mask-image":"<mask-reference>#","name-repeat":"repeat( [<positive-integer>|auto-fill] , <line-names>+ )",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",ratio:"<integer> / <integer>",right:"<length>|auto","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto","track-group":"'(' [<string>* <track-minmax> <string>*]+ ')' ['[' <positive-integer> ']']?|<track-minmax>","track-list-v0":"[<string>* <track-group> <string>*]+|none","track-minmax":"minmax( <track-breadth> , <track-breadth> )|auto|<track-breadth>|fit-content",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","positive-integer":"<integer [0,∞]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"<integer [0,1]>","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<'color'>","-webkit-border-before-color":"<'color'>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<timing-function>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<box>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end","caret-color":"auto|<color>",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","color-adjust":"economy|exact","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[size||layout||style||paint]",content:"normal|none|[<content-replacement>|<content-list>] [/ <string>]?","counter-increment":"[<custom-ident> <integer>?]+|none","counter-reset":"[<custom-ident> <integer>?]+|none","counter-set":"[<custom-ident> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|<number>","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content( <length-percentage> )",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<url>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage>|min-content|max-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"over|under|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|dark|light|<color>{2}","scrollbar-gutter":"auto|[stable|always]&&both?&&force?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|<shape-box>||<basic-shape>|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<timing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content( <length-percentage> )","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length-percentage>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [<media-query-list>]?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}}}},Rr=Ce.cmpChar,Mr=Ce.isDigit,jr=Ce.TYPE,_r=jr.WhiteSpace,Fr=jr.Comment,Wr=jr.Ident,qr=jr.Number,Yr=jr.Dimension;function Ur(e,t){var n=this.scanner.tokenStart+e,r=this.scanner.source.charCodeAt(n);for(43!==r&&45!==r||(t&&this.error("Number sign is not allowed"),n++);n<this.scanner.tokenEnd;n++)Mr(this.scanner.source.charCodeAt(n))||this.error("Integer is expected",n);}function Hr(e){return Ur.call(this,0,e)}function Vr(e,t){if(!Rr(this.scanner.source,this.scanner.tokenStart+e,t)){var n="";switch(t){case 110:n="N is expected";break;case 45:n="HyphenMinus is expected";}this.error(n,this.scanner.tokenStart+e);}}function Kr(){for(var e=0,t=0,n=this.scanner.tokenType;n===_r||n===Fr;)n=this.scanner.lookupType(++e);if(n!==qr){if(!this.scanner.isDelim(43,e)&&!this.scanner.isDelim(45,e))return null;t=this.scanner.isDelim(43,e)?43:45;do{n=this.scanner.lookupType(++e);}while(n===_r||n===Fr);n!==qr&&(this.scanner.skip(e),Hr.call(this,!0));}return e>0&&this.scanner.skip(e),0===t&&43!==(n=this.scanner.source.charCodeAt(this.scanner.tokenStart))&&45!==n&&this.error("Number sign is expected"),Hr.call(this,0!==t),45===t?"-"+this.consume(qr):this.consume(qr)}var Gr={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var e=this.scanner.tokenStart,t=null,n=null;if(this.scanner.tokenType===qr)Hr.call(this,!1),n=this.consume(qr);else if(this.scanner.tokenType===Wr&&Rr(this.scanner.source,this.scanner.tokenStart,45))switch(t="-1",Vr.call(this,1,110),this.scanner.getTokenLength()){case 2:this.scanner.next(),n=Kr.call(this);break;case 3:Vr.call(this,2,45),this.scanner.next(),this.scanner.skipSC(),Hr.call(this,!0),n="-"+this.consume(qr);break;default:Vr.call(this,2,45),Ur.call(this,3,!0),this.scanner.next(),n=this.scanner.substrToCursor(e+2);}else if(this.scanner.tokenType===Wr||this.scanner.isDelim(43)&&this.scanner.lookupType(1)===Wr){var r=0;switch(t="1",this.scanner.isDelim(43)&&(r=1,this.scanner.next()),Vr.call(this,0,110),this.scanner.getTokenLength()){case 1:this.scanner.next(),n=Kr.call(this);break;case 2:Vr.call(this,1,45),this.scanner.next(),this.scanner.skipSC(),Hr.call(this,!0),n="-"+this.consume(qr);break;default:Vr.call(this,1,45),Ur.call(this,2,!0),this.scanner.next(),n=this.scanner.substrToCursor(e+r+1);}}else if(this.scanner.tokenType===Yr){for(var i=this.scanner.source.charCodeAt(this.scanner.tokenStart),a=(r=43===i||45===i,this.scanner.tokenStart+r);a<this.scanner.tokenEnd&&Mr(this.scanner.source.charCodeAt(a));a++);a===this.scanner.tokenStart+r&&this.error("Integer is expected",this.scanner.tokenStart+r),Vr.call(this,a-this.scanner.tokenStart,110),t=this.scanner.source.substring(e,a),a+1===this.scanner.tokenEnd?(this.scanner.next(),n=Kr.call(this)):(Vr.call(this,a-this.scanner.tokenStart+1,45),a+2===this.scanner.tokenEnd?(this.scanner.next(),this.scanner.skipSC(),Hr.call(this,!0),n="-"+this.consume(qr)):(Ur.call(this,a-this.scanner.tokenStart+2,!0),this.scanner.next(),n=this.scanner.substrToCursor(a+1)));}else this.error();return null!==t&&43===t.charCodeAt(0)&&(t=t.substr(1)),null!==n&&43===n.charCodeAt(0)&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.scanner.tokenStart),a:t,b:n}},generate:function(e){var t=null!==e.a&&void 0!==e.a,n=null!==e.b&&void 0!==e.b;t?(this.chunk("+1"===e.a?"+n":"1"===e.a?"n":"-1"===e.a?"-n":e.a+"n"),n&&("-"===(n=String(e.b)).charAt(0)||"+"===n.charAt(0)?(this.chunk(n.charAt(0)),this.chunk(n.substr(1))):(this.chunk("+"),this.chunk(n)))):this.chunk(String(e.b));}},Qr=Ce.TYPE,Xr=Qr.WhiteSpace,Zr=Qr.Semicolon,$r=Qr.LeftCurlyBracket,Jr=Qr.Delim;function ei(){return this.scanner.tokenIndex>0&&this.scanner.lookupType(-1)===Xr?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function ti(){return 0}var ni={name:"Raw",structure:{value:String},parse:function(e,t,n){var r,i=this.scanner.getTokenStart(e);return this.scanner.skip(this.scanner.getRawLength(e,t||ti)),r=n&&this.scanner.tokenStart>i?ei.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(i,r),value:this.scanner.source.substring(i,r)}},generate:function(e){this.chunk(e.value);},mode:{default:ti,leftCurlyBracket:function(e){return e===$r?1:0},leftCurlyBracketOrSemicolon:function(e){return e===$r||e===Zr?1:0},exclamationMarkOrSemicolon:function(e,t,n){return e===Jr&&33===t.charCodeAt(n)||e===Zr?1:0},semicolonIncluded:function(e){return e===Zr?2:0}}},ri=Ce.TYPE,ii=ni.mode,ai=ri.AtKeyword,oi=ri.Semicolon,si=ri.LeftCurlyBracket,li=ri.RightCurlyBracket;function ci(e){return this.Raw(e,ii.leftCurlyBracketOrSemicolon,!0)}function ui(){for(var e,t=1;e=this.scanner.lookupType(t);t++){if(e===li)return !0;if(e===si||e===ai)return !1}return !1}var hi={name:"Atrule",structure:{name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null,i=null;switch(this.eat(ai),t=(e=this.scanner.substrToCursor(n+1)).toLowerCase(),this.scanner.skipSC(),!1===this.scanner.eof&&this.scanner.tokenType!==si&&this.scanner.tokenType!==oi&&(this.parseAtrulePrelude?"AtrulePrelude"===(r=this.parseWithFallback(this.AtrulePrelude.bind(this,e),ci)).type&&null===r.children.head&&(r=null):r=ci.call(this,this.scanner.tokenIndex),this.scanner.skipSC()),this.scanner.tokenType){case oi:this.scanner.next();break;case si:i=this.atrule.hasOwnProperty(t)&&"function"==typeof this.atrule[t].block?this.atrule[t].block.call(this):this.Block(ui.call(this));}return {type:"Atrule",loc:this.getLocation(n,this.scanner.tokenStart),name:e,prelude:r,block:i}},generate:function(e){this.chunk("@"),this.chunk(e.name),null!==e.prelude&&(this.chunk(" "),this.node(e.prelude)),e.block?this.node(e.block):this.chunk(";");},walkContext:"atrule"},pi=Ce.TYPE,di=pi.Semicolon,mi=pi.LeftCurlyBracket,gi={name:"AtrulePrelude",structure:{children:[[]]},parse:function(e){var t=null;return null!==e&&(e=e.toLowerCase()),this.scanner.skipSC(),t=this.atrule.hasOwnProperty(e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.scanner.skipSC(),!0!==this.scanner.eof&&this.scanner.tokenType!==mi&&this.scanner.tokenType!==di&&this.error("Semicolon or block is expected"),null===t&&(t=this.createList()),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e);},walkContext:"atrulePrelude"},fi=Ce.TYPE,bi=fi.Ident,yi=fi.String,ki=fi.Colon,vi=fi.LeftSquareBracket,xi=fi.RightSquareBracket;function wi(){this.scanner.eof&&this.error("Unexpected end of input");var e=this.scanner.tokenStart,t=!1,n=!0;return this.scanner.isDelim(42)?(t=!0,n=!1,this.scanner.next()):this.scanner.isDelim(124)||this.eat(bi),this.scanner.isDelim(124)?61!==this.scanner.source.charCodeAt(this.scanner.tokenStart+1)?(this.scanner.next(),this.eat(bi)):t&&this.error("Identifier is expected",this.scanner.tokenEnd):t&&this.error("Vertical line is expected"),n&&this.scanner.tokenType===ki&&(this.scanner.next(),this.eat(bi)),{type:"Identifier",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}}function Si(){var e=this.scanner.tokenStart,t=this.scanner.source.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.scanner.next(),61!==t&&(this.scanner.isDelim(61)||this.error("Equal sign is expected"),this.scanner.next()),this.scanner.substrToCursor(e)}var Ci={name:"AttributeSelector",structure:{name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]},parse:function(){var e,t=this.scanner.tokenStart,n=null,r=null,i=null;return this.eat(vi),this.scanner.skipSC(),e=wi.call(this),this.scanner.skipSC(),this.scanner.tokenType!==xi&&(this.scanner.tokenType!==bi&&(n=Si.call(this),this.scanner.skipSC(),r=this.scanner.tokenType===yi?this.String():this.Identifier(),this.scanner.skipSC()),this.scanner.tokenType===bi&&(i=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC())),this.eat(xi),{type:"AttributeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:e,matcher:n,value:r,flags:i}},generate:function(e){var t=" ";this.chunk("["),this.node(e.name),null!==e.matcher&&(this.chunk(e.matcher),null!==e.value&&(this.node(e.value),"String"===e.value.type&&(t=""))),null!==e.flags&&(this.chunk(t),this.chunk(e.flags)),this.chunk("]");}},zi=Ce.TYPE,Ai=ni.mode,Pi=zi.WhiteSpace,Ti=zi.Comment,Li=zi.Semicolon,Ei=zi.AtKeyword,Di=zi.LeftCurlyBracket,Oi=zi.RightCurlyBracket;function Bi(e){return this.Raw(e,null,!0)}function Ii(){return this.parseWithFallback(this.Rule,Bi)}function Ni(e){return this.Raw(e,Ai.semicolonIncluded,!0)}function Ri(){if(this.scanner.tokenType===Li)return Ni.call(this,this.scanner.tokenIndex);var e=this.parseWithFallback(this.Declaration,Ni);return this.scanner.tokenType===Li&&this.scanner.next(),e}var Mi={name:"Block",structure:{children:[["Atrule","Rule","Declaration"]]},parse:function(e){var t=e?Ri:Ii,n=this.scanner.tokenStart,r=this.createList();this.eat(Di);e:for(;!this.scanner.eof;)switch(this.scanner.tokenType){case Oi:break e;case Pi:case Ti:this.scanner.next();break;case Ei:r.push(this.parseWithFallback(this.Atrule,Bi));break;default:r.push(t.call(this));}return this.scanner.eof||this.eat(Oi),{type:"Block",loc:this.getLocation(n,this.scanner.tokenStart),children:r}},generate:function(e){this.chunk("{"),this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";");})),this.chunk("}");},walkContext:"block"},ji=Ce.TYPE,_i=ji.LeftSquareBracket,Fi=ji.RightSquareBracket,Wi={name:"Brackets",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(_i),n=e.call(this,t),this.scanner.eof||this.eat(Fi),{type:"Brackets",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("["),this.children(e),this.chunk("]");}},qi=Ce.TYPE.CDC,Yi={name:"CDC",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(qi),{type:"CDC",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("--\x3e");}},Ui=Ce.TYPE.CDO,Hi={name:"CDO",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(Ui),{type:"CDO",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("\x3c!--");}},Vi=Ce.TYPE.Ident,Ki={name:"ClassSelector",structure:{name:String},parse:function(){return this.scanner.isDelim(46)||this.error("Full stop is expected"),this.scanner.next(),{type:"ClassSelector",loc:this.getLocation(this.scanner.tokenStart-1,this.scanner.tokenEnd),name:this.consume(Vi)}},generate:function(e){this.chunk("."),this.chunk(e.name);}},Gi=Ce.TYPE.Ident,Qi={name:"Combinator",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 62:case 43:case 126:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.tokenType===Gi&&!1!==this.scanner.lookupValue(0,"deep")||this.error("Identifier `deep` is expected"),this.scanner.next(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.scanner.next();break;default:this.error("Combinator is expected");}return {type:"Combinator",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.name);}},Xi=Ce.TYPE.Comment,Zi={name:"Comment",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=this.scanner.tokenEnd;return this.eat(Xi),t-e+2>=2&&42===this.scanner.source.charCodeAt(t-2)&&47===this.scanner.source.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e+2,t)}},generate:function(e){this.chunk("/*"),this.chunk(e.value),this.chunk("*/");}},$i=ae.isCustomProperty,Ji=Ce.TYPE,ea=ni.mode,ta=Ji.Ident,na=Ji.Hash,ra=Ji.Colon,ia=Ji.Semicolon,aa=Ji.Delim,oa=Ji.WhiteSpace;function sa(e){return this.Raw(e,ea.exclamationMarkOrSemicolon,!0)}function la(e){return this.Raw(e,ea.exclamationMarkOrSemicolon,!1)}function ca(){var e=this.scanner.tokenIndex,t=this.Value();return "Raw"!==t.type&&!1===this.scanner.eof&&this.scanner.tokenType!==ia&&!1===this.scanner.isDelim(33)&&!1===this.scanner.isBalanceEdge(e)&&this.error(),t}var ua={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var e,t=this.scanner.tokenStart,n=this.scanner.tokenIndex,r=ha.call(this),i=$i(r),a=i?this.parseCustomProperty:this.parseValue,o=i?la:sa,s=!1;this.scanner.skipSC(),this.eat(ra);const l=this.scanner.tokenIndex;if(i||this.scanner.skipSC(),e=a?this.parseWithFallback(ca,o):o.call(this,this.scanner.tokenIndex),i&&"Value"===e.type&&e.children.isEmpty())for(let t=l-this.scanner.tokenIndex;t<=0;t++)if(this.scanner.lookupType(t)===oa){e.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.scanner.isDelim(33)&&(s=pa.call(this),this.scanner.skipSC()),!1===this.scanner.eof&&this.scanner.tokenType!==ia&&!1===this.scanner.isBalanceEdge(n)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.scanner.tokenStart),important:s,property:r,value:e}},generate:function(e){this.chunk(e.property),this.chunk(":"),this.node(e.value),e.important&&this.chunk(!0===e.important?"!important":"!"+e.important);},walkContext:"declaration"};function ha(){var e=this.scanner.tokenStart;if(this.scanner.tokenType===aa)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.isDelim(47)&&this.scanner.next();}return this.scanner.tokenType===na?this.eat(na):this.eat(ta),this.scanner.substrToCursor(e)}function pa(){this.eat(aa),this.scanner.skipSC();var e=this.consume(ta);return "important"===e||e}var da=Ce.TYPE,ma=ni.mode,ga=da.WhiteSpace,fa=da.Comment,ba=da.Semicolon;function ya(e){return this.Raw(e,ma.semicolonIncluded,!0)}var ka={name:"DeclarationList",structure:{children:[["Declaration"]]},parse:function(){for(var e=this.createList();!this.scanner.eof;)switch(this.scanner.tokenType){case ga:case fa:case ba:this.scanner.next();break;default:e.push(this.parseWithFallback(this.Declaration,ya));}return {type:"DeclarationList",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";");}));}},va=M.consumeNumber,xa=Ce.TYPE.Dimension,wa={name:"Dimension",structure:{value:String,unit:String},parse:function(){var e=this.scanner.tokenStart,t=va(this.scanner.source,e);return this.eat(xa),{type:"Dimension",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t),unit:this.scanner.source.substring(t,this.scanner.tokenStart)}},generate:function(e){this.chunk(e.value),this.chunk(e.unit);}},Sa=Ce.TYPE.RightParenthesis,Ca={name:"Function",structure:{name:String,children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart,i=this.consumeFunctionName(),a=i.toLowerCase();return n=t.hasOwnProperty(a)?t[a].call(this,t):e.call(this,t),this.scanner.eof||this.eat(Sa),{type:"Function",loc:this.getLocation(r,this.scanner.tokenStart),name:i,children:n}},generate:function(e){this.chunk(e.name),this.chunk("("),this.children(e),this.chunk(")");},walkContext:"function"},za=Ce.TYPE.Hash,Aa={name:"Hash",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(za),{type:"Hash",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.value);}},Pa=Ce.TYPE.Ident,Ta={name:"Identifier",structure:{name:String},parse:function(){return {type:"Identifier",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),name:this.consume(Pa)}},generate:function(e){this.chunk(e.name);}},La=Ce.TYPE.Hash,Ea={name:"IdSelector",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(La),{type:"IdSelector",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.name);}},Da=Ce.TYPE,Oa=Da.Ident,Ba=Da.Number,Ia=Da.Dimension,Na=Da.LeftParenthesis,Ra=Da.RightParenthesis,Ma=Da.Colon,ja=Da.Delim,_a={name:"MediaFeature",structure:{name:String,value:["Identifier","Number","Dimension","Ratio",null]},parse:function(){var e,t=this.scanner.tokenStart,n=null;if(this.eat(Na),this.scanner.skipSC(),e=this.consume(Oa),this.scanner.skipSC(),this.scanner.tokenType!==Ra){switch(this.eat(Ma),this.scanner.skipSC(),this.scanner.tokenType){case Ba:n=this.lookupNonWSType(1)===ja?this.Ratio():this.Number();break;case Ia:n=this.Dimension();break;case Oa:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected");}this.scanner.skipSC();}return this.eat(Ra),{type:"MediaFeature",loc:this.getLocation(t,this.scanner.tokenStart),name:e,value:n}},generate:function(e){this.chunk("("),this.chunk(e.name),null!==e.value&&(this.chunk(":"),this.node(e.value)),this.chunk(")");}},Fa=Ce.TYPE,Wa=Fa.WhiteSpace,qa=Fa.Comment,Ya=Fa.Ident,Ua=Fa.LeftParenthesis,Ha={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var e=this.createList(),t=null,n=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case qa:this.scanner.next();continue;case Wa:n=this.WhiteSpace();continue;case Ya:t=this.Identifier();break;case Ua:t=this.MediaFeature();break;default:break e}null!==n&&(e.push(n),n=null),e.push(t);}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e);}},Va=Ce.TYPE.Comma,Ka={name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:function(e){var t=this.createList();for(this.scanner.skipSC();!this.scanner.eof&&(t.push(this.MediaQuery(e)),this.scanner.tokenType===Va);)this.scanner.next();return {type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e,(function(){this.chunk(",");}));}},Ga=Ce.TYPE.Number,Qa={name:"Number",structure:{value:String},parse:function(){return {type:"Number",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(Ga)}},generate:function(e){this.chunk(e.value);}},Xa={name:"Operator",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.scanner.next(),{type:"Operator",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value);}},Za=Ce.TYPE,$a=Za.LeftParenthesis,Ja=Za.RightParenthesis,eo={name:"Parentheses",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat($a),n=e.call(this,t),this.scanner.eof||this.eat(Ja),{type:"Parentheses",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("("),this.children(e),this.chunk(")");}},to=M.consumeNumber,no=Ce.TYPE.Percentage,ro={name:"Percentage",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=to(this.scanner.source,e);return this.eat(no),{type:"Percentage",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t)}},generate:function(e){this.chunk(e.value),this.chunk("%");}},io=Ce.TYPE,ao=io.Ident,oo=io.Function,so=io.Colon,lo=io.RightParenthesis,co={name:"PseudoClassSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(so),this.scanner.tokenType===oo?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(lo)):e=this.consume(ao),{type:"PseudoClassSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk(":"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"));},walkContext:"function"},uo=Ce.TYPE,ho=uo.Ident,po=uo.Function,mo=uo.Colon,go=uo.RightParenthesis,fo={name:"PseudoElementSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(mo),this.eat(mo),this.scanner.tokenType===po?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(go)):e=this.consume(ho),{type:"PseudoElementSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk("::"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"));},walkContext:"function"},bo=Ce.isDigit,yo=Ce.TYPE,ko=yo.Number,vo=yo.Delim;function xo(){this.scanner.skipWS();for(var e=this.consume(ko),t=0;t<e.length;t++){var n=e.charCodeAt(t);bo(n)||46===n||this.error("Unsigned number is expected",this.scanner.tokenStart-e.length+t);}return 0===Number(e)&&this.error("Zero number is not allowed",this.scanner.tokenStart-e.length),e}var wo={name:"Ratio",structure:{left:String,right:String},parse:function(){var e,t=this.scanner.tokenStart,n=xo.call(this);return this.scanner.skipWS(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.eat(vo),e=xo.call(this),{type:"Ratio",loc:this.getLocation(t,this.scanner.tokenStart),left:n,right:e}},generate:function(e){this.chunk(e.left),this.chunk("/"),this.chunk(e.right);}},So=Ce.TYPE,Co=ni.mode,zo=So.LeftCurlyBracket;function Ao(e){return this.Raw(e,Co.leftCurlyBracket,!0)}function Po(){var e=this.SelectorList();return "Raw"!==e.type&&!1===this.scanner.eof&&this.scanner.tokenType!==zo&&this.error(),e}var To={name:"Rule",structure:{prelude:["SelectorList","Raw"],block:["Block"]},parse:function(){var e,t,n=this.scanner.tokenIndex,r=this.scanner.tokenStart;return e=this.parseRulePrelude?this.parseWithFallback(Po,Ao):Ao.call(this,n),t=this.Block(!0),{type:"Rule",loc:this.getLocation(r,this.scanner.tokenStart),prelude:e,block:t}},generate:function(e){this.node(e.prelude),this.node(e.block);},walkContext:"rule"},Lo=Ce.TYPE.Comma,Eo={name:"SelectorList",structure:{children:[["Selector","Raw"]]},parse:function(){for(var e=this.createList();!this.scanner.eof&&(e.push(this.Selector()),this.scanner.tokenType===Lo);)this.scanner.next();return {type:"SelectorList",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e,(function(){this.chunk(",");}));},walkContext:"selector"},Do=Ce.TYPE.String,Oo={name:"String",structure:{value:String},parse:function(){return {type:"String",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(Do)}},generate:function(e){this.chunk(e.value);}},Bo=Ce.TYPE,Io=Bo.WhiteSpace,No=Bo.Comment,Ro=Bo.AtKeyword,Mo=Bo.CDO,jo=Bo.CDC;function _o(e){return this.Raw(e,null,!1)}var Fo={name:"StyleSheet",structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},parse:function(){for(var e,t=this.scanner.tokenStart,n=this.createList();!this.scanner.eof;){switch(this.scanner.tokenType){case Io:this.scanner.next();continue;case No:if(33!==this.scanner.source.charCodeAt(this.scanner.tokenStart+2)){this.scanner.next();continue}e=this.Comment();break;case Mo:e=this.CDO();break;case jo:e=this.CDC();break;case Ro:e=this.parseWithFallback(this.Atrule,_o);break;default:e=this.parseWithFallback(this.Rule,_o);}n.push(e);}return {type:"StyleSheet",loc:this.getLocation(t,this.scanner.tokenStart),children:n}},generate:function(e){this.children(e);},walkContext:"stylesheet"},Wo=Ce.TYPE.Ident;function qo(){this.scanner.tokenType!==Wo&&!1===this.scanner.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.scanner.next();}var Yo={name:"TypeSelector",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;return this.scanner.isDelim(124)?(this.scanner.next(),qo.call(this)):(qo.call(this),this.scanner.isDelim(124)&&(this.scanner.next(),qo.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.name);}},Uo=Ce.isHexDigit,Ho=Ce.cmpChar,Vo=Ce.TYPE,Ko=Ce.NAME,Go=Vo.Ident,Qo=Vo.Number,Xo=Vo.Dimension;function Zo(e,t){for(var n=this.scanner.tokenStart+e,r=0;n<this.scanner.tokenEnd;n++){var i=this.scanner.source.charCodeAt(n);if(45===i&&t&&0!==r)return 0===Zo.call(this,e+r+1,!1)&&this.error(),-1;Uo(i)||this.error(t&&0!==r?"HyphenMinus"+(r<6?" or hex digit":"")+" is expected":r<6?"Hex digit is expected":"Unexpected input",n),++r>6&&this.error("Too many hex digits",n);}return this.scanner.next(),r}function $o(e){for(var t=0;this.scanner.isDelim(63);)++t>e&&this.error("Too many question marks"),this.scanner.next();}function Jo(e){this.scanner.source.charCodeAt(this.scanner.tokenStart)!==e&&this.error(Ko[e]+" is expected");}function es(){var e=0;return this.scanner.isDelim(43)?(this.scanner.next(),this.scanner.tokenType===Go?void((e=Zo.call(this,0,!0))>0&&$o.call(this,6-e)):this.scanner.isDelim(63)?(this.scanner.next(),void $o.call(this,5)):void this.error("Hex digit or question mark is expected")):this.scanner.tokenType===Qo?(Jo.call(this,43),e=Zo.call(this,1,!0),this.scanner.isDelim(63)?void $o.call(this,6-e):this.scanner.tokenType===Xo||this.scanner.tokenType===Qo?(Jo.call(this,45),void Zo.call(this,1,!1)):void 0):this.scanner.tokenType===Xo?(Jo.call(this,43),void((e=Zo.call(this,1,!0))>0&&$o.call(this,6-e))):void this.error()}var ts={name:"UnicodeRange",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return Ho(this.scanner.source,e,117)||this.error("U is expected"),Ho(this.scanner.source,e+1,43)||this.error("Plus sign is expected"),this.scanner.next(),es.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value);}},ns=Ce.isWhiteSpace,rs=Ce.cmpStr,is=Ce.TYPE,as=is.Function,os=is.Url,ss=is.RightParenthesis,ls={name:"Url",structure:{value:["String","Raw"]},parse:function(){var e,t=this.scanner.tokenStart;switch(this.scanner.tokenType){case os:for(var n=t+4,r=this.scanner.tokenEnd-1;n<r&&ns(this.scanner.source.charCodeAt(n));)n++;for(;n<r&&ns(this.scanner.source.charCodeAt(r-1));)r--;e={type:"Raw",loc:this.getLocation(n,r),value:this.scanner.source.substring(n,r)},this.eat(os);break;case as:rs(this.scanner.source,this.scanner.tokenStart,this.scanner.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(as),this.scanner.skipSC(),e=this.String(),this.scanner.skipSC(),this.eat(ss);break;default:this.error("Url or Function is expected");}return {type:"Url",loc:this.getLocation(t,this.scanner.tokenStart),value:e}},generate:function(e){this.chunk("url"),this.chunk("("),this.node(e.value),this.chunk(")");}},cs=Ce.TYPE.WhiteSpace,us=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),hs={AnPlusB:Gr,Atrule:hi,AtrulePrelude:gi,AttributeSelector:Ci,Block:Mi,Brackets:Wi,CDC:Yi,CDO:Hi,ClassSelector:Ki,Combinator:Qi,Comment:Zi,Declaration:ua,DeclarationList:ka,Dimension:wa,Function:Ca,Hash:Aa,Identifier:Ta,IdSelector:Ea,MediaFeature:_a,MediaQuery:Ha,MediaQueryList:Ka,Nth:{name:"Nth",structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]},parse:function(e){this.scanner.skipSC();var t,n=this.scanner.tokenStart,r=n,i=null;return t=this.scanner.lookupValue(0,"odd")||this.scanner.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),this.scanner.skipSC(),e&&this.scanner.lookupValue(0,"of")?(this.scanner.next(),i=this.SelectorList(),this.needPositions&&(r=this.getLastListNode(i.children).loc.end.offset)):this.needPositions&&(r=t.loc.end.offset),{type:"Nth",loc:this.getLocation(n,r),nth:t,selector:i}},generate:function(e){this.node(e.nth),null!==e.selector&&(this.chunk(" of "),this.node(e.selector));}},Number:Qa,Operator:Xa,Parentheses:eo,Percentage:ro,PseudoClassSelector:co,PseudoElementSelector:fo,Ratio:wo,Raw:ni,Rule:To,Selector:{name:"Selector",structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]},parse:function(){var e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e);}},SelectorList:Eo,String:Oo,StyleSheet:Fo,TypeSelector:Yo,UnicodeRange:ts,Url:ls,Value:{name:"Value",structure:{children:[[]]},parse:function(){var e=this.scanner.tokenStart,t=this.readSequence(this.scope.Value);return {type:"Value",loc:this.getLocation(e,this.scanner.tokenStart),children:t}},generate:function(e){this.children(e);}},WhiteSpace:{name:"WhiteSpace",structure:{value:String},parse:function(){return this.eat(cs),us},generate:function(e){this.chunk(e.value);}}},ps={generic:!0,types:Nr.types,atrules:Nr.atrules,properties:Nr.properties,node:hs},ds=Ce.cmpChar,ms=Ce.cmpStr,gs=Ce.TYPE,fs=gs.Ident,bs=gs.String,ys=gs.Number,ks=gs.Function,vs=gs.Url,xs=gs.Hash,ws=gs.Dimension,Ss=gs.Percentage,Cs=gs.LeftParenthesis,zs=gs.LeftSquareBracket,As=gs.Comma,Ps=gs.Delim,Ts=function(e){switch(this.scanner.tokenType){case xs:return this.Hash();case As:return e.space=null,e.ignoreWSAfter=!0,this.Operator();case Cs:return this.Parentheses(this.readSequence,e.recognizer);case zs:return this.Brackets(this.readSequence,e.recognizer);case bs:return this.String();case ws:return this.Dimension();case Ss:return this.Percentage();case ys:return this.Number();case ks:return ms(this.scanner.source,this.scanner.tokenStart,this.scanner.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case vs:return this.Url();case fs:return ds(this.scanner.source,this.scanner.tokenStart,117)&&ds(this.scanner.source,this.scanner.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case Ps:var t=this.scanner.source.charCodeAt(this.scanner.tokenStart);if(47===t||42===t||43===t||45===t)return this.Operator();35===t&&this.error("Hex or identifier is expected",this.scanner.tokenStart+1);}},Ls={getNode:Ts},Es=Ce.TYPE,Ds=Es.Delim,Os=Es.Ident,Bs=Es.Dimension,Is=Es.Percentage,Ns=Es.Number,Rs=Es.Hash,Ms=Es.Colon,js=Es.LeftSquareBracket;var _s={getNode:function(e){switch(this.scanner.tokenType){case js:return this.AttributeSelector();case Rs:return this.IdSelector();case Ms:return this.scanner.lookupType(1)===Ms?this.PseudoElementSelector():this.PseudoClassSelector();case Os:return this.TypeSelector();case Ns:case Is:return this.Percentage();case Bs:46===this.scanner.source.charCodeAt(this.scanner.tokenStart)&&this.error("Identifier is expected",this.scanner.tokenStart+1);break;case Ds:switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 43:case 62:case 126:return e.space=null,e.ignoreWSAfter=!0,this.Combinator();case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector()}}}},Fs=Ce.TYPE,Ws=ni.mode,qs=Fs.Comma,Ys=Fs.WhiteSpace,Us={AtrulePrelude:Ls,Selector:_s,Value:{getNode:Ts,expression:function(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))},var:function(){var e=this.createList();if(this.scanner.skipSC(),e.push(this.Identifier()),this.scanner.skipSC(),this.scanner.tokenType===qs){e.push(this.Operator());const t=this.scanner.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.scanner.tokenIndex,Ws.exclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty())for(let e=t-this.scanner.tokenIndex;e<=0;e++)if(this.scanner.lookupType(e)===Ys){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n);}return e}}},Hs=Ce.TYPE,Vs=Hs.String,Ks=Hs.Ident,Gs=Hs.Url,Qs=Hs.Function,Xs=Hs.LeftParenthesis,Zs={parse:{prelude:function(){var e=this.createList();switch(this.scanner.skipSC(),this.scanner.tokenType){case Vs:e.push(this.String());break;case Gs:case Qs:e.push(this.Url());break;default:this.error("String or url() is expected");}return this.lookupNonWSType(0)!==Ks&&this.lookupNonWSType(0)!==Xs||(e.push(this.WhiteSpace()),e.push(this.MediaQueryList())),e},block:null}},$s=Ce.TYPE,Js=$s.WhiteSpace,el=$s.Comment,tl=$s.Ident,nl=$s.Function,rl=$s.Colon,il=$s.LeftParenthesis;function al(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))}function ol(){return this.scanner.skipSC(),this.scanner.tokenType===tl&&this.lookupNonWSType(1)===rl?this.createSingleNodeList(this.Declaration()):sl.call(this)}function sl(){var e,t=this.createList(),n=null;this.scanner.skipSC();e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case Js:n=this.WhiteSpace();continue;case el:this.scanner.next();continue;case nl:e=this.Function(al,this.scope.AtrulePrelude);break;case tl:e=this.Identifier();break;case il:e=this.Parentheses(ol,this.scope.AtrulePrelude);break;default:break e}null!==n&&(t.push(n),n=null),t.push(e);}return t}var ll,cl={parse:function(){return this.createSingleNodeList(this.SelectorList())}},ul={parse:function(){return this.createSingleNodeList(this.Nth(!0))}},hl={parse:function(){return this.createSingleNodeList(this.Nth(!1))}},pl={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude:function(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block:function(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:Us,atrule:{"font-face":{parse:{prelude:null,block:function(){return this.Block(!0)}}},import:Zs,media:{parse:{prelude:function(){return this.createSingleNodeList(this.MediaQueryList())},block:function(){return this.Block(!1)}}},page:{parse:{prelude:function(){return this.createSingleNodeList(this.SelectorList())},block:function(){return this.Block(!0)}}},supports:{parse:{prelude:function(){var e=sl.call(this);return null===this.getFirstListNode(e)&&this.error("Condition is expected"),e},block:function(){return this.Block(!1)}}}},pseudo:{dir:{parse:function(){return this.createSingleNodeList(this.Identifier())}},has:{parse:function(){return this.createSingleNodeList(this.SelectorList())}},lang:{parse:function(){return this.createSingleNodeList(this.Identifier())}},matches:cl,not:cl,"nth-child":ul,"nth-last-child":ul,"nth-last-of-type":hl,"nth-of-type":hl,slotted:{parse:function(){return this.createSingleNodeList(this.Selector())}}},node:hs},dl={node:hs},ml={version:"1.1.2"},gl=(ll=Object.freeze({__proto__:null,version:"1.1.2",default:ml}))&&ll.default||ll;var fl=Ir(function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r];}return e}(ps,pl,dl)),bl=gl.version;return fl.version=bl,fl}));
  15. });
  16. var hasOwnProperty = Object.prototype.hasOwnProperty;
  17. function buildMap(list, caseInsensitive) {
  18. var map = Object.create(null);
  19. if (!Array.isArray(list)) {
  20. return null;
  21. }
  22. for (var i = 0; i < list.length; i++) {
  23. var name = list[i];
  24. if (caseInsensitive) {
  25. name = name.toLowerCase();
  26. }
  27. map[name] = true;
  28. }
  29. return map;
  30. }
  31. function buildList(data) {
  32. if (!data) {
  33. return null;
  34. }
  35. var tags = buildMap(data.tags, true);
  36. var ids = buildMap(data.ids);
  37. var classes = buildMap(data.classes);
  38. if (tags === null &&
  39. ids === null &&
  40. classes === null) {
  41. return null;
  42. }
  43. return {
  44. tags: tags,
  45. ids: ids,
  46. classes: classes
  47. };
  48. }
  49. function buildIndex(data) {
  50. var scopes = false;
  51. if (data.scopes && Array.isArray(data.scopes)) {
  52. scopes = Object.create(null);
  53. for (var i = 0; i < data.scopes.length; i++) {
  54. var list = data.scopes[i];
  55. if (!list || !Array.isArray(list)) {
  56. throw new Error('Wrong usage format');
  57. }
  58. for (var j = 0; j < list.length; j++) {
  59. var name = list[j];
  60. if (hasOwnProperty.call(scopes, name)) {
  61. throw new Error('Class can\'t be used for several scopes: ' + name);
  62. }
  63. scopes[name] = i + 1;
  64. }
  65. }
  66. }
  67. return {
  68. whitelist: buildList(data),
  69. blacklist: buildList(data.blacklist),
  70. scopes: scopes
  71. };
  72. }
  73. var usage = {
  74. buildIndex: buildIndex
  75. };
  76. var utils = {
  77. hasNoChildren: function(node) {
  78. return !node || !node.children || node.children.isEmpty();
  79. },
  80. isNodeChildrenList: function(node, list) {
  81. return node !== null && node.children === list;
  82. }
  83. };
  84. var resolveKeyword = csstree_min.keyword;
  85. var { hasNoChildren } = utils;
  86. var Atrule = function cleanAtrule(node, item, list) {
  87. if (node.block) {
  88. // otherwise removed at-rule don't prevent @import for removal
  89. if (this.stylesheet !== null) {
  90. this.stylesheet.firstAtrulesAllowed = false;
  91. }
  92. if (hasNoChildren(node.block)) {
  93. list.remove(item);
  94. return;
  95. }
  96. }
  97. switch (node.name) {
  98. case 'charset':
  99. if (hasNoChildren(node.prelude)) {
  100. list.remove(item);
  101. return;
  102. }
  103. // if there is any rule before @charset -> remove it
  104. if (item.prev) {
  105. list.remove(item);
  106. return;
  107. }
  108. break;
  109. case 'import':
  110. if (this.stylesheet === null || !this.stylesheet.firstAtrulesAllowed) {
  111. list.remove(item);
  112. return;
  113. }
  114. // if there are some rules that not an @import or @charset before @import
  115. // remove it
  116. list.prevUntil(item.prev, function(rule) {
  117. if (rule.type === 'Atrule') {
  118. if (rule.name === 'import' || rule.name === 'charset') {
  119. return;
  120. }
  121. }
  122. this.root.firstAtrulesAllowed = false;
  123. list.remove(item);
  124. return true;
  125. }, this);
  126. break;
  127. default:
  128. var name = resolveKeyword(node.name).basename;
  129. if (name === 'keyframes' ||
  130. name === 'media' ||
  131. name === 'supports') {
  132. // drop at-rule with no prelude
  133. if (hasNoChildren(node.prelude) || hasNoChildren(node.block)) {
  134. list.remove(item);
  135. }
  136. }
  137. }
  138. };
  139. var Comment = function cleanComment(data, item, list) {
  140. list.remove(item);
  141. };
  142. var property = csstree_min.property;
  143. var Declaration = function cleanDeclartion(node, item, list) {
  144. if (node.value.children && node.value.children.isEmpty()) {
  145. list.remove(item);
  146. return;
  147. }
  148. if (property(node.property).custom) {
  149. if (/\S/.test(node.value.value)) {
  150. node.value.value = node.value.value.trim();
  151. }
  152. }
  153. };
  154. var { isNodeChildrenList } = utils;
  155. var Raw = function cleanRaw(node, item, list) {
  156. // raw in stylesheet or block children
  157. if (isNodeChildrenList(this.stylesheet, list) ||
  158. isNodeChildrenList(this.block, list)) {
  159. list.remove(item);
  160. }
  161. };
  162. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  163. var walk = csstree_min.walk;
  164. var { hasNoChildren: hasNoChildren$1 } = utils;
  165. function cleanUnused(selectorList, usageData) {
  166. selectorList.children.each(function(selector, item, list) {
  167. var shouldRemove = false;
  168. walk(selector, function(node) {
  169. // ignore nodes in nested selectors
  170. if (this.selector === null || this.selector === selectorList) {
  171. switch (node.type) {
  172. case 'SelectorList':
  173. // TODO: remove toLowerCase when pseudo selectors will be normalized
  174. // ignore selectors inside :not()
  175. if (this.function === null || this.function.name.toLowerCase() !== 'not') {
  176. if (cleanUnused(node, usageData)) {
  177. shouldRemove = true;
  178. }
  179. }
  180. break;
  181. case 'ClassSelector':
  182. if (usageData.whitelist !== null &&
  183. usageData.whitelist.classes !== null &&
  184. !hasOwnProperty$1.call(usageData.whitelist.classes, node.name)) {
  185. shouldRemove = true;
  186. }
  187. if (usageData.blacklist !== null &&
  188. usageData.blacklist.classes !== null &&
  189. hasOwnProperty$1.call(usageData.blacklist.classes, node.name)) {
  190. shouldRemove = true;
  191. }
  192. break;
  193. case 'IdSelector':
  194. if (usageData.whitelist !== null &&
  195. usageData.whitelist.ids !== null &&
  196. !hasOwnProperty$1.call(usageData.whitelist.ids, node.name)) {
  197. shouldRemove = true;
  198. }
  199. if (usageData.blacklist !== null &&
  200. usageData.blacklist.ids !== null &&
  201. hasOwnProperty$1.call(usageData.blacklist.ids, node.name)) {
  202. shouldRemove = true;
  203. }
  204. break;
  205. case 'TypeSelector':
  206. // TODO: remove toLowerCase when type selectors will be normalized
  207. // ignore universal selectors
  208. if (node.name.charAt(node.name.length - 1) !== '*') {
  209. if (usageData.whitelist !== null &&
  210. usageData.whitelist.tags !== null &&
  211. !hasOwnProperty$1.call(usageData.whitelist.tags, node.name.toLowerCase())) {
  212. shouldRemove = true;
  213. }
  214. if (usageData.blacklist !== null &&
  215. usageData.blacklist.tags !== null &&
  216. hasOwnProperty$1.call(usageData.blacklist.tags, node.name.toLowerCase())) {
  217. shouldRemove = true;
  218. }
  219. }
  220. break;
  221. }
  222. }
  223. });
  224. if (shouldRemove) {
  225. list.remove(item);
  226. }
  227. });
  228. return selectorList.children.isEmpty();
  229. }
  230. var Rule = function cleanRule(node, item, list, options) {
  231. if (hasNoChildren$1(node.prelude) || hasNoChildren$1(node.block)) {
  232. list.remove(item);
  233. return;
  234. }
  235. var usageData = options.usage;
  236. if (usageData && (usageData.whitelist !== null || usageData.blacklist !== null)) {
  237. cleanUnused(node.prelude, usageData);
  238. if (hasNoChildren$1(node.prelude)) {
  239. list.remove(item);
  240. return;
  241. }
  242. }
  243. };
  244. // remove useless universal selector
  245. var TypeSelector = function cleanTypeSelector(node, item, list) {
  246. var name = item.data.name;
  247. // check it's a non-namespaced universal selector
  248. if (name !== '*') {
  249. return;
  250. }
  251. // remove when universal selector before other selectors
  252. var nextType = item.next && item.next.data.type;
  253. if (nextType === 'IdSelector' ||
  254. nextType === 'ClassSelector' ||
  255. nextType === 'AttributeSelector' ||
  256. nextType === 'PseudoClassSelector' ||
  257. nextType === 'PseudoElementSelector') {
  258. list.remove(item);
  259. }
  260. };
  261. var { isNodeChildrenList: isNodeChildrenList$1 } = utils;
  262. function isSafeOperator(node) {
  263. return node.type === 'Operator' && node.value !== '+' && node.value !== '-';
  264. }
  265. var WhiteSpace = function cleanWhitespace(node, item, list) {
  266. // remove when first or last item in sequence
  267. if (item.next === null || item.prev === null) {
  268. list.remove(item);
  269. return;
  270. }
  271. // white space in stylesheet or block children
  272. if (isNodeChildrenList$1(this.stylesheet, list) ||
  273. isNodeChildrenList$1(this.block, list)) {
  274. list.remove(item);
  275. return;
  276. }
  277. if (item.next.data.type === 'WhiteSpace') {
  278. list.remove(item);
  279. return;
  280. }
  281. if (isSafeOperator(item.prev.data) || isSafeOperator(item.next.data)) {
  282. list.remove(item);
  283. return;
  284. }
  285. };
  286. var walk$1 = csstree_min.walk;
  287. var handlers = {
  288. Atrule: Atrule,
  289. Comment: Comment,
  290. Declaration: Declaration,
  291. Raw: Raw,
  292. Rule: Rule,
  293. TypeSelector: TypeSelector,
  294. WhiteSpace: WhiteSpace
  295. };
  296. var clean = function(ast, options) {
  297. walk$1(ast, {
  298. leave: function(node, item, list) {
  299. if (handlers.hasOwnProperty(node.type)) {
  300. handlers[node.type].call(this, node, item, list, options);
  301. }
  302. }
  303. });
  304. };
  305. var keyframes = function(node) {
  306. node.block.children.each(function(rule) {
  307. rule.prelude.children.each(function(simpleselector) {
  308. simpleselector.children.each(function(data, item) {
  309. if (data.type === 'Percentage' && data.value === '100') {
  310. item.data = {
  311. type: 'TypeSelector',
  312. loc: data.loc,
  313. name: 'to'
  314. };
  315. } else if (data.type === 'TypeSelector' && data.name === 'from') {
  316. item.data = {
  317. type: 'Percentage',
  318. loc: data.loc,
  319. value: '0'
  320. };
  321. }
  322. });
  323. });
  324. });
  325. };
  326. var resolveKeyword$1 = csstree_min.keyword;
  327. var Atrule$1 = function(node) {
  328. // compress @keyframe selectors
  329. if (resolveKeyword$1(node.name).basename === 'keyframes') {
  330. keyframes(node);
  331. }
  332. };
  333. // Can unquote attribute detection
  334. // Adopted implementation of Mathias Bynens
  335. // https://github.com/mathiasbynens/mothereff.in/blob/master/unquoted-attributes/eff.js
  336. var escapesRx = /\\([0-9A-Fa-f]{1,6})(\r\n|[ \t\n\f\r])?|\\./g;
  337. var blockUnquoteRx = /^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;
  338. function canUnquote(value) {
  339. if (value === '' || value === '-') {
  340. return;
  341. }
  342. // Escapes are valid, so replace them with a valid non-empty string
  343. value = value.replace(escapesRx, 'a');
  344. return !blockUnquoteRx.test(value);
  345. }
  346. var AttributeSelector = function(node) {
  347. var attrValue = node.value;
  348. if (!attrValue || attrValue.type !== 'String') {
  349. return;
  350. }
  351. var unquotedValue = attrValue.value.replace(/^(.)(.*)\1$/, '$2');
  352. if (canUnquote(unquotedValue)) {
  353. node.value = {
  354. type: 'Identifier',
  355. loc: attrValue.loc,
  356. name: unquotedValue
  357. };
  358. }
  359. };
  360. var font = function compressFont(node) {
  361. var list = node.children;
  362. list.eachRight(function(node, item) {
  363. if (node.type === 'Identifier') {
  364. if (node.name === 'bold') {
  365. item.data = {
  366. type: 'Number',
  367. loc: node.loc,
  368. value: '700'
  369. };
  370. } else if (node.name === 'normal') {
  371. var prev = item.prev;
  372. if (prev && prev.data.type === 'Operator' && prev.data.value === '/') {
  373. this.remove(prev);
  374. }
  375. this.remove(item);
  376. } else if (node.name === 'medium') {
  377. var next = item.next;
  378. if (!next || next.data.type !== 'Operator') {
  379. this.remove(item);
  380. }
  381. }
  382. }
  383. });
  384. // remove redundant spaces
  385. list.each(function(node, item) {
  386. if (node.type === 'WhiteSpace') {
  387. if (!item.prev || !item.next || item.next.data.type === 'WhiteSpace') {
  388. this.remove(item);
  389. }
  390. }
  391. });
  392. if (list.isEmpty()) {
  393. list.insert(list.createItem({
  394. type: 'Identifier',
  395. name: 'normal'
  396. }));
  397. }
  398. };
  399. var fontWeight = function compressFontWeight(node) {
  400. var value = node.children.head.data;
  401. if (value.type === 'Identifier') {
  402. switch (value.name) {
  403. case 'normal':
  404. node.children.head.data = {
  405. type: 'Number',
  406. loc: value.loc,
  407. value: '400'
  408. };
  409. break;
  410. case 'bold':
  411. node.children.head.data = {
  412. type: 'Number',
  413. loc: value.loc,
  414. value: '700'
  415. };
  416. break;
  417. }
  418. }
  419. };
  420. var List = csstree_min.List;
  421. var background = function compressBackground(node) {
  422. function lastType() {
  423. if (buffer.length) {
  424. return buffer[buffer.length - 1].type;
  425. }
  426. }
  427. function flush() {
  428. if (lastType() === 'WhiteSpace') {
  429. buffer.pop();
  430. }
  431. if (!buffer.length) {
  432. buffer.unshift(
  433. {
  434. type: 'Number',
  435. loc: null,
  436. value: '0'
  437. },
  438. {
  439. type: 'WhiteSpace',
  440. value: ' '
  441. },
  442. {
  443. type: 'Number',
  444. loc: null,
  445. value: '0'
  446. }
  447. );
  448. }
  449. newValue.push.apply(newValue, buffer);
  450. buffer = [];
  451. }
  452. var newValue = [];
  453. var buffer = [];
  454. node.children.each(function(node) {
  455. if (node.type === 'Operator' && node.value === ',') {
  456. flush();
  457. newValue.push(node);
  458. return;
  459. }
  460. // remove defaults
  461. if (node.type === 'Identifier') {
  462. if (node.name === 'transparent' ||
  463. node.name === 'none' ||
  464. node.name === 'repeat' ||
  465. node.name === 'scroll') {
  466. return;
  467. }
  468. }
  469. // don't add redundant spaces
  470. if (node.type === 'WhiteSpace' && (!buffer.length || lastType() === 'WhiteSpace')) {
  471. return;
  472. }
  473. buffer.push(node);
  474. });
  475. flush();
  476. node.children = new List().fromArray(newValue);
  477. };
  478. function removeItemAndRedundantWhiteSpace(list, item) {
  479. var prev = item.prev;
  480. var next = item.next;
  481. if (next !== null) {
  482. if (next.data.type === 'WhiteSpace' && (prev === null || prev.data.type === 'WhiteSpace')) {
  483. list.remove(next);
  484. }
  485. } else if (prev !== null && prev.data.type === 'WhiteSpace') {
  486. list.remove(prev);
  487. }
  488. list.remove(item);
  489. }
  490. var border = function compressBorder(node) {
  491. node.children.each(function(node, item, list) {
  492. if (node.type === 'Identifier' && node.name.toLowerCase() === 'none') {
  493. if (list.head === list.tail) {
  494. // replace `none` for zero when `none` is a single term
  495. item.data = {
  496. type: 'Number',
  497. loc: node.loc,
  498. value: '0'
  499. };
  500. } else {
  501. removeItemAndRedundantWhiteSpace(list, item);
  502. }
  503. }
  504. });
  505. };
  506. var resolveName = csstree_min.property;
  507. var handlers$1 = {
  508. 'font': font,
  509. 'font-weight': fontWeight,
  510. 'background': background,
  511. 'border': border,
  512. 'outline': border
  513. };
  514. var Value = function compressValue(node) {
  515. if (!this.declaration) {
  516. return;
  517. }
  518. var property = resolveName(this.declaration.property);
  519. if (handlers$1.hasOwnProperty(property.basename)) {
  520. handlers$1[property.basename](node);
  521. }
  522. };
  523. var OMIT_PLUSSIGN = /^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/;
  524. var KEEP_PLUSSIGN = /^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/;
  525. var unsafeToRemovePlusSignAfter = {
  526. Dimension: true,
  527. Hash: true,
  528. Identifier: true,
  529. Number: true,
  530. Raw: true,
  531. UnicodeRange: true
  532. };
  533. function packNumber(value, item) {
  534. // omit plus sign only if no prev or prev is safe type
  535. var regexp = item && item.prev !== null && unsafeToRemovePlusSignAfter.hasOwnProperty(item.prev.data.type)
  536. ? KEEP_PLUSSIGN
  537. : OMIT_PLUSSIGN;
  538. // 100 -> '100'
  539. // 00100 -> '100'
  540. // +100 -> '100' (only when safe, e.g. omitting plus sign for 1px+1px leads to single dimension instead of two)
  541. // -100 -> '-100'
  542. // 0.123 -> '.123'
  543. // 0.12300 -> '.123'
  544. // 0.0 -> ''
  545. // 0 -> ''
  546. // -0 -> '-'
  547. value = String(value).replace(regexp, '$1$2$3');
  548. if (value === '' || value === '-') {
  549. value = '0';
  550. }
  551. return value;
  552. }
  553. var _Number = function(node, item) {
  554. node.value = packNumber(node.value, item);
  555. };
  556. var pack = packNumber;
  557. _Number.pack = pack;
  558. var packNumber$1 = _Number.pack;
  559. var MATH_FUNCTIONS = {
  560. 'calc': true,
  561. 'min': true,
  562. 'max': true,
  563. 'clamp': true
  564. };
  565. var LENGTH_UNIT = {
  566. // absolute length units
  567. 'px': true,
  568. 'mm': true,
  569. 'cm': true,
  570. 'in': true,
  571. 'pt': true,
  572. 'pc': true,
  573. // relative length units
  574. 'em': true,
  575. 'ex': true,
  576. 'ch': true,
  577. 'rem': true,
  578. // viewport-percentage lengths
  579. 'vh': true,
  580. 'vw': true,
  581. 'vmin': true,
  582. 'vmax': true,
  583. 'vm': true
  584. };
  585. var Dimension = function compressDimension(node, item) {
  586. var value = packNumber$1(node.value, item);
  587. node.value = value;
  588. if (value === '0' && this.declaration !== null && this.atrulePrelude === null) {
  589. var unit = node.unit.toLowerCase();
  590. // only length values can be compressed
  591. if (!LENGTH_UNIT.hasOwnProperty(unit)) {
  592. return;
  593. }
  594. // issue #362: shouldn't remove unit in -ms-flex since it breaks flex in IE10/11
  595. // issue #200: shouldn't remove unit in flex since it breaks flex in IE10/11
  596. if (this.declaration.property === '-ms-flex' ||
  597. this.declaration.property === 'flex') {
  598. return;
  599. }
  600. // issue #222: don't remove units inside calc
  601. if (this.function && MATH_FUNCTIONS.hasOwnProperty(this.function.name)) {
  602. return;
  603. }
  604. item.data = {
  605. type: 'Number',
  606. loc: node.loc,
  607. value: value
  608. };
  609. }
  610. };
  611. var lexer = csstree_min.lexer;
  612. var packNumber$2 = _Number.pack;
  613. var blacklist = new Set([
  614. // see https://github.com/jakubpawlowicz/clean-css/issues/957
  615. 'width',
  616. 'min-width',
  617. 'max-width',
  618. 'height',
  619. 'min-height',
  620. 'max-height',
  621. // issue #410: Don’t remove units in flex-basis value for (-ms-)flex shorthand
  622. // issue #362: shouldn't remove unit in -ms-flex since it breaks flex in IE10/11
  623. // issue #200: shouldn't remove unit in flex since it breaks flex in IE10/11
  624. 'flex',
  625. '-ms-flex'
  626. ]);
  627. var Percentage = function compressPercentage(node, item) {
  628. node.value = packNumber$2(node.value, item);
  629. if (node.value === '0' && this.declaration && !blacklist.has(this.declaration.property)) {
  630. // try to convert a number
  631. item.data = {
  632. type: 'Number',
  633. loc: node.loc,
  634. value: node.value
  635. };
  636. // that's ok only when new value matches on length
  637. if (!lexer.matchDeclaration(this.declaration).isType(item.data, 'length')) {
  638. // otherwise rollback changes
  639. item.data = node;
  640. }
  641. }
  642. };
  643. var _String = function(node) {
  644. var value = node.value;
  645. // remove escaped newlines, i.e.
  646. // .a { content: "foo\
  647. // bar"}
  648. // ->
  649. // .a { content: "foobar" }
  650. value = value.replace(/\\(\r\n|\r|\n|\f)/g, '');
  651. node.value = value;
  652. };
  653. var UNICODE = '\\\\[0-9a-f]{1,6}(\\r\\n|[ \\n\\r\\t\\f])?';
  654. var ESCAPE = '(' + UNICODE + '|\\\\[^\\n\\r\\f0-9a-fA-F])';
  655. var NONPRINTABLE = '\u0000\u0008\u000b\u000e-\u001f\u007f';
  656. var SAFE_URL = new RegExp('^(' + ESCAPE + '|[^\"\'\\(\\)\\\\\\s' + NONPRINTABLE + '])*$', 'i');
  657. var Url = function(node) {
  658. var value = node.value;
  659. if (value.type !== 'String') {
  660. return;
  661. }
  662. var quote = value.value[0];
  663. var url = value.value.substr(1, value.value.length - 2);
  664. // convert `\\` to `/`
  665. url = url.replace(/\\\\/g, '/');
  666. // remove quotes when safe
  667. // https://www.w3.org/TR/css-syntax-3/#url-unquoted-diagram
  668. if (SAFE_URL.test(url)) {
  669. node.value = {
  670. type: 'Raw',
  671. loc: node.value.loc,
  672. value: url
  673. };
  674. } else {
  675. // use double quotes if string has no double quotes
  676. // otherwise use original quotes
  677. // TODO: make better quote type selection
  678. node.value.value = url.indexOf('"') === -1 ? '"' + url + '"' : quote + url + quote;
  679. }
  680. };
  681. var lexer$1 = csstree_min.lexer;
  682. var packNumber$3 = _Number.pack;
  683. // http://www.w3.org/TR/css3-color/#svg-color
  684. var NAME_TO_HEX = {
  685. 'aliceblue': 'f0f8ff',
  686. 'antiquewhite': 'faebd7',
  687. 'aqua': '0ff',
  688. 'aquamarine': '7fffd4',
  689. 'azure': 'f0ffff',
  690. 'beige': 'f5f5dc',
  691. 'bisque': 'ffe4c4',
  692. 'black': '000',
  693. 'blanchedalmond': 'ffebcd',
  694. 'blue': '00f',
  695. 'blueviolet': '8a2be2',
  696. 'brown': 'a52a2a',
  697. 'burlywood': 'deb887',
  698. 'cadetblue': '5f9ea0',
  699. 'chartreuse': '7fff00',
  700. 'chocolate': 'd2691e',
  701. 'coral': 'ff7f50',
  702. 'cornflowerblue': '6495ed',
  703. 'cornsilk': 'fff8dc',
  704. 'crimson': 'dc143c',
  705. 'cyan': '0ff',
  706. 'darkblue': '00008b',
  707. 'darkcyan': '008b8b',
  708. 'darkgoldenrod': 'b8860b',
  709. 'darkgray': 'a9a9a9',
  710. 'darkgrey': 'a9a9a9',
  711. 'darkgreen': '006400',
  712. 'darkkhaki': 'bdb76b',
  713. 'darkmagenta': '8b008b',
  714. 'darkolivegreen': '556b2f',
  715. 'darkorange': 'ff8c00',
  716. 'darkorchid': '9932cc',
  717. 'darkred': '8b0000',
  718. 'darksalmon': 'e9967a',
  719. 'darkseagreen': '8fbc8f',
  720. 'darkslateblue': '483d8b',
  721. 'darkslategray': '2f4f4f',
  722. 'darkslategrey': '2f4f4f',
  723. 'darkturquoise': '00ced1',
  724. 'darkviolet': '9400d3',
  725. 'deeppink': 'ff1493',
  726. 'deepskyblue': '00bfff',
  727. 'dimgray': '696969',
  728. 'dimgrey': '696969',
  729. 'dodgerblue': '1e90ff',
  730. 'firebrick': 'b22222',
  731. 'floralwhite': 'fffaf0',
  732. 'forestgreen': '228b22',
  733. 'fuchsia': 'f0f',
  734. 'gainsboro': 'dcdcdc',
  735. 'ghostwhite': 'f8f8ff',
  736. 'gold': 'ffd700',
  737. 'goldenrod': 'daa520',
  738. 'gray': '808080',
  739. 'grey': '808080',
  740. 'green': '008000',
  741. 'greenyellow': 'adff2f',
  742. 'honeydew': 'f0fff0',
  743. 'hotpink': 'ff69b4',
  744. 'indianred': 'cd5c5c',
  745. 'indigo': '4b0082',
  746. 'ivory': 'fffff0',
  747. 'khaki': 'f0e68c',
  748. 'lavender': 'e6e6fa',
  749. 'lavenderblush': 'fff0f5',
  750. 'lawngreen': '7cfc00',
  751. 'lemonchiffon': 'fffacd',
  752. 'lightblue': 'add8e6',
  753. 'lightcoral': 'f08080',
  754. 'lightcyan': 'e0ffff',
  755. 'lightgoldenrodyellow': 'fafad2',
  756. 'lightgray': 'd3d3d3',
  757. 'lightgrey': 'd3d3d3',
  758. 'lightgreen': '90ee90',
  759. 'lightpink': 'ffb6c1',
  760. 'lightsalmon': 'ffa07a',
  761. 'lightseagreen': '20b2aa',
  762. 'lightskyblue': '87cefa',
  763. 'lightslategray': '789',
  764. 'lightslategrey': '789',
  765. 'lightsteelblue': 'b0c4de',
  766. 'lightyellow': 'ffffe0',
  767. 'lime': '0f0',
  768. 'limegreen': '32cd32',
  769. 'linen': 'faf0e6',
  770. 'magenta': 'f0f',
  771. 'maroon': '800000',
  772. 'mediumaquamarine': '66cdaa',
  773. 'mediumblue': '0000cd',
  774. 'mediumorchid': 'ba55d3',
  775. 'mediumpurple': '9370db',
  776. 'mediumseagreen': '3cb371',
  777. 'mediumslateblue': '7b68ee',
  778. 'mediumspringgreen': '00fa9a',
  779. 'mediumturquoise': '48d1cc',
  780. 'mediumvioletred': 'c71585',
  781. 'midnightblue': '191970',
  782. 'mintcream': 'f5fffa',
  783. 'mistyrose': 'ffe4e1',
  784. 'moccasin': 'ffe4b5',
  785. 'navajowhite': 'ffdead',
  786. 'navy': '000080',
  787. 'oldlace': 'fdf5e6',
  788. 'olive': '808000',
  789. 'olivedrab': '6b8e23',
  790. 'orange': 'ffa500',
  791. 'orangered': 'ff4500',
  792. 'orchid': 'da70d6',
  793. 'palegoldenrod': 'eee8aa',
  794. 'palegreen': '98fb98',
  795. 'paleturquoise': 'afeeee',
  796. 'palevioletred': 'db7093',
  797. 'papayawhip': 'ffefd5',
  798. 'peachpuff': 'ffdab9',
  799. 'peru': 'cd853f',
  800. 'pink': 'ffc0cb',
  801. 'plum': 'dda0dd',
  802. 'powderblue': 'b0e0e6',
  803. 'purple': '800080',
  804. 'rebeccapurple': '639',
  805. 'red': 'f00',
  806. 'rosybrown': 'bc8f8f',
  807. 'royalblue': '4169e1',
  808. 'saddlebrown': '8b4513',
  809. 'salmon': 'fa8072',
  810. 'sandybrown': 'f4a460',
  811. 'seagreen': '2e8b57',
  812. 'seashell': 'fff5ee',
  813. 'sienna': 'a0522d',
  814. 'silver': 'c0c0c0',
  815. 'skyblue': '87ceeb',
  816. 'slateblue': '6a5acd',
  817. 'slategray': '708090',
  818. 'slategrey': '708090',
  819. 'snow': 'fffafa',
  820. 'springgreen': '00ff7f',
  821. 'steelblue': '4682b4',
  822. 'tan': 'd2b48c',
  823. 'teal': '008080',
  824. 'thistle': 'd8bfd8',
  825. 'tomato': 'ff6347',
  826. 'turquoise': '40e0d0',
  827. 'violet': 'ee82ee',
  828. 'wheat': 'f5deb3',
  829. 'white': 'fff',
  830. 'whitesmoke': 'f5f5f5',
  831. 'yellow': 'ff0',
  832. 'yellowgreen': '9acd32'
  833. };
  834. var HEX_TO_NAME = {
  835. '800000': 'maroon',
  836. '800080': 'purple',
  837. '808000': 'olive',
  838. '808080': 'gray',
  839. '00ffff': 'cyan',
  840. 'f0ffff': 'azure',
  841. 'f5f5dc': 'beige',
  842. 'ffe4c4': 'bisque',
  843. '000000': 'black',
  844. '0000ff': 'blue',
  845. 'a52a2a': 'brown',
  846. 'ff7f50': 'coral',
  847. 'ffd700': 'gold',
  848. '008000': 'green',
  849. '4b0082': 'indigo',
  850. 'fffff0': 'ivory',
  851. 'f0e68c': 'khaki',
  852. '00ff00': 'lime',
  853. 'faf0e6': 'linen',
  854. '000080': 'navy',
  855. 'ffa500': 'orange',
  856. 'da70d6': 'orchid',
  857. 'cd853f': 'peru',
  858. 'ffc0cb': 'pink',
  859. 'dda0dd': 'plum',
  860. 'f00': 'red',
  861. 'ff0000': 'red',
  862. 'fa8072': 'salmon',
  863. 'a0522d': 'sienna',
  864. 'c0c0c0': 'silver',
  865. 'fffafa': 'snow',
  866. 'd2b48c': 'tan',
  867. '008080': 'teal',
  868. 'ff6347': 'tomato',
  869. 'ee82ee': 'violet',
  870. 'f5deb3': 'wheat',
  871. 'ffffff': 'white',
  872. 'ffff00': 'yellow'
  873. };
  874. function hueToRgb(p, q, t) {
  875. if (t < 0) {
  876. t += 1;
  877. }
  878. if (t > 1) {
  879. t -= 1;
  880. }
  881. if (t < 1 / 6) {
  882. return p + (q - p) * 6 * t;
  883. }
  884. if (t < 1 / 2) {
  885. return q;
  886. }
  887. if (t < 2 / 3) {
  888. return p + (q - p) * (2 / 3 - t) * 6;
  889. }
  890. return p;
  891. }
  892. function hslToRgb(h, s, l, a) {
  893. var r;
  894. var g;
  895. var b;
  896. if (s === 0) {
  897. r = g = b = l; // achromatic
  898. } else {
  899. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  900. var p = 2 * l - q;
  901. r = hueToRgb(p, q, h + 1 / 3);
  902. g = hueToRgb(p, q, h);
  903. b = hueToRgb(p, q, h - 1 / 3);
  904. }
  905. return [
  906. Math.round(r * 255),
  907. Math.round(g * 255),
  908. Math.round(b * 255),
  909. a
  910. ];
  911. }
  912. function toHex(value) {
  913. value = value.toString(16);
  914. return value.length === 1 ? '0' + value : value;
  915. }
  916. function parseFunctionArgs(functionArgs, count, rgb) {
  917. var cursor = functionArgs.head;
  918. var args = [];
  919. var wasValue = false;
  920. while (cursor !== null) {
  921. var node = cursor.data;
  922. var type = node.type;
  923. switch (type) {
  924. case 'Number':
  925. case 'Percentage':
  926. if (wasValue) {
  927. return;
  928. }
  929. wasValue = true;
  930. args.push({
  931. type: type,
  932. value: Number(node.value)
  933. });
  934. break;
  935. case 'Operator':
  936. if (node.value === ',') {
  937. if (!wasValue) {
  938. return;
  939. }
  940. wasValue = false;
  941. } else if (wasValue || node.value !== '+') {
  942. return;
  943. }
  944. break;
  945. default:
  946. // something we couldn't understand
  947. return;
  948. }
  949. cursor = cursor.next;
  950. }
  951. if (args.length !== count) {
  952. // invalid arguments count
  953. // TODO: remove those tokens
  954. return;
  955. }
  956. if (args.length === 4) {
  957. if (args[3].type !== 'Number') {
  958. // 4th argument should be a number
  959. // TODO: remove those tokens
  960. return;
  961. }
  962. args[3].type = 'Alpha';
  963. }
  964. if (rgb) {
  965. if (args[0].type !== args[1].type || args[0].type !== args[2].type) {
  966. // invalid color, numbers and percentage shouldn't be mixed
  967. // TODO: remove those tokens
  968. return;
  969. }
  970. } else {
  971. if (args[0].type !== 'Number' ||
  972. args[1].type !== 'Percentage' ||
  973. args[2].type !== 'Percentage') {
  974. // invalid color, for hsl values should be: number, percentage, percentage
  975. // TODO: remove those tokens
  976. return;
  977. }
  978. args[0].type = 'Angle';
  979. }
  980. return args.map(function(arg) {
  981. var value = Math.max(0, arg.value);
  982. switch (arg.type) {
  983. case 'Number':
  984. // fit value to [0..255] range
  985. value = Math.min(value, 255);
  986. break;
  987. case 'Percentage':
  988. // convert 0..100% to value in [0..255] range
  989. value = Math.min(value, 100) / 100;
  990. if (!rgb) {
  991. return value;
  992. }
  993. value = 255 * value;
  994. break;
  995. case 'Angle':
  996. // fit value to (-360..360) range
  997. return (((value % 360) + 360) % 360) / 360;
  998. case 'Alpha':
  999. // fit value to [0..1] range
  1000. return Math.min(value, 1);
  1001. }
  1002. return Math.round(value);
  1003. });
  1004. }
  1005. function compressFunction(node, item, list) {
  1006. var functionName = node.name;
  1007. var args;
  1008. if (functionName === 'rgba' || functionName === 'hsla') {
  1009. args = parseFunctionArgs(node.children, 4, functionName === 'rgba');
  1010. if (!args) {
  1011. // something went wrong
  1012. return;
  1013. }
  1014. if (functionName === 'hsla') {
  1015. args = hslToRgb.apply(null, args);
  1016. node.name = 'rgba';
  1017. }
  1018. if (args[3] === 0) {
  1019. // try to replace `rgba(x, x, x, 0)` to `transparent`
  1020. // always replace `rgba(0, 0, 0, 0)` to `transparent`
  1021. // otherwise avoid replacement in gradients since it may break color transition
  1022. // http://stackoverflow.com/questions/11829410/css3-gradient-rendering-issues-from-transparent-to-white
  1023. var scopeFunctionName = this.function && this.function.name;
  1024. if ((args[0] === 0 && args[1] === 0 && args[2] === 0) ||
  1025. !/^(?:to|from|color-stop)$|gradient$/i.test(scopeFunctionName)) {
  1026. item.data = {
  1027. type: 'Identifier',
  1028. loc: node.loc,
  1029. name: 'transparent'
  1030. };
  1031. return;
  1032. }
  1033. }
  1034. if (args[3] !== 1) {
  1035. // replace argument values for normalized/interpolated
  1036. node.children.each(function(node, item, list) {
  1037. if (node.type === 'Operator') {
  1038. if (node.value !== ',') {
  1039. list.remove(item);
  1040. }
  1041. return;
  1042. }
  1043. item.data = {
  1044. type: 'Number',
  1045. loc: node.loc,
  1046. value: packNumber$3(args.shift(), null)
  1047. };
  1048. });
  1049. return;
  1050. }
  1051. // otherwise convert to rgb, i.e. rgba(255, 0, 0, 1) -> rgb(255, 0, 0)
  1052. functionName = 'rgb';
  1053. }
  1054. if (functionName === 'hsl') {
  1055. args = args || parseFunctionArgs(node.children, 3, false);
  1056. if (!args) {
  1057. // something went wrong
  1058. return;
  1059. }
  1060. // convert to rgb
  1061. args = hslToRgb.apply(null, args);
  1062. functionName = 'rgb';
  1063. }
  1064. if (functionName === 'rgb') {
  1065. args = args || parseFunctionArgs(node.children, 3, true);
  1066. if (!args) {
  1067. // something went wrong
  1068. return;
  1069. }
  1070. // check if color is not at the end and not followed by space
  1071. var next = item.next;
  1072. if (next && next.data.type !== 'WhiteSpace') {
  1073. list.insert(list.createItem({
  1074. type: 'WhiteSpace',
  1075. value: ' '
  1076. }), next);
  1077. }
  1078. item.data = {
  1079. type: 'Hash',
  1080. loc: node.loc,
  1081. value: toHex(args[0]) + toHex(args[1]) + toHex(args[2])
  1082. };
  1083. compressHex(item.data, item);
  1084. }
  1085. }
  1086. function compressIdent(node, item) {
  1087. if (this.declaration === null) {
  1088. return;
  1089. }
  1090. var color = node.name.toLowerCase();
  1091. if (NAME_TO_HEX.hasOwnProperty(color) &&
  1092. lexer$1.matchDeclaration(this.declaration).isType(node, 'color')) {
  1093. var hex = NAME_TO_HEX[color];
  1094. if (hex.length + 1 <= color.length) {
  1095. // replace for shorter hex value
  1096. item.data = {
  1097. type: 'Hash',
  1098. loc: node.loc,
  1099. value: hex
  1100. };
  1101. } else {
  1102. // special case for consistent colors
  1103. if (color === 'grey') {
  1104. color = 'gray';
  1105. }
  1106. // just replace value for lower cased name
  1107. node.name = color;
  1108. }
  1109. }
  1110. }
  1111. function compressHex(node, item) {
  1112. var color = node.value.toLowerCase();
  1113. // #112233 -> #123
  1114. if (color.length === 6 &&
  1115. color[0] === color[1] &&
  1116. color[2] === color[3] &&
  1117. color[4] === color[5]) {
  1118. color = color[0] + color[2] + color[4];
  1119. }
  1120. if (HEX_TO_NAME[color]) {
  1121. item.data = {
  1122. type: 'Identifier',
  1123. loc: node.loc,
  1124. name: HEX_TO_NAME[color]
  1125. };
  1126. } else {
  1127. node.value = color;
  1128. }
  1129. }
  1130. var color = {
  1131. compressFunction: compressFunction,
  1132. compressIdent: compressIdent,
  1133. compressHex: compressHex
  1134. };
  1135. var walk$2 = csstree_min.walk;
  1136. var handlers$2 = {
  1137. Atrule: Atrule$1,
  1138. AttributeSelector: AttributeSelector,
  1139. Value: Value,
  1140. Dimension: Dimension,
  1141. Percentage: Percentage,
  1142. Number: _Number,
  1143. String: _String,
  1144. Url: Url,
  1145. Hash: color.compressHex,
  1146. Identifier: color.compressIdent,
  1147. Function: color.compressFunction
  1148. };
  1149. var replace = function(ast) {
  1150. walk$2(ast, {
  1151. leave: function(node, item, list) {
  1152. if (handlers$2.hasOwnProperty(node.type)) {
  1153. handlers$2[node.type].call(this, node, item, list);
  1154. }
  1155. }
  1156. });
  1157. };
  1158. var generate = csstree_min.generate;
  1159. function Index() {
  1160. this.seed = 0;
  1161. this.map = Object.create(null);
  1162. }
  1163. Index.prototype.resolve = function(str) {
  1164. var index = this.map[str];
  1165. if (!index) {
  1166. index = ++this.seed;
  1167. this.map[str] = index;
  1168. }
  1169. return index;
  1170. };
  1171. var createDeclarationIndexer = function createDeclarationIndexer() {
  1172. var ids = new Index();
  1173. return function markDeclaration(node) {
  1174. var id = generate(node);
  1175. node.id = ids.resolve(id);
  1176. node.length = id.length;
  1177. node.fingerprint = null;
  1178. return node;
  1179. };
  1180. };
  1181. var specificity = function specificity(simpleSelector) {
  1182. var A = 0;
  1183. var B = 0;
  1184. var C = 0;
  1185. simpleSelector.children.each(function walk(node) {
  1186. switch (node.type) {
  1187. case 'SelectorList':
  1188. case 'Selector':
  1189. node.children.each(walk);
  1190. break;
  1191. case 'IdSelector':
  1192. A++;
  1193. break;
  1194. case 'ClassSelector':
  1195. case 'AttributeSelector':
  1196. B++;
  1197. break;
  1198. case 'PseudoClassSelector':
  1199. switch (node.name.toLowerCase()) {
  1200. case 'not':
  1201. node.children.each(walk);
  1202. break;
  1203. case 'before':
  1204. case 'after':
  1205. case 'first-line':
  1206. case 'first-letter':
  1207. C++;
  1208. break;
  1209. // TODO: support for :nth-*(.. of <SelectorList>), :matches(), :has()
  1210. default:
  1211. B++;
  1212. }
  1213. break;
  1214. case 'PseudoElementSelector':
  1215. C++;
  1216. break;
  1217. case 'TypeSelector':
  1218. // ignore universal selector
  1219. if (node.name.charAt(node.name.length - 1) !== '*') {
  1220. C++;
  1221. }
  1222. break;
  1223. }
  1224. });
  1225. return [A, B, C];
  1226. };
  1227. var generate$1 = csstree_min.generate;
  1228. var nonFreezePseudoElements = {
  1229. 'first-letter': true,
  1230. 'first-line': true,
  1231. 'after': true,
  1232. 'before': true
  1233. };
  1234. var nonFreezePseudoClasses = {
  1235. 'link': true,
  1236. 'visited': true,
  1237. 'hover': true,
  1238. 'active': true,
  1239. 'first-letter': true,
  1240. 'first-line': true,
  1241. 'after': true,
  1242. 'before': true
  1243. };
  1244. var processSelector = function freeze(node, usageData) {
  1245. var pseudos = Object.create(null);
  1246. var hasPseudo = false;
  1247. node.prelude.children.each(function(simpleSelector) {
  1248. var tagName = '*';
  1249. var scope = 0;
  1250. simpleSelector.children.each(function(node) {
  1251. switch (node.type) {
  1252. case 'ClassSelector':
  1253. if (usageData && usageData.scopes) {
  1254. var classScope = usageData.scopes[node.name] || 0;
  1255. if (scope !== 0 && classScope !== scope) {
  1256. throw new Error('Selector can\'t has classes from different scopes: ' + generate$1(simpleSelector));
  1257. }
  1258. scope = classScope;
  1259. }
  1260. break;
  1261. case 'PseudoClassSelector':
  1262. var name = node.name.toLowerCase();
  1263. if (!nonFreezePseudoClasses.hasOwnProperty(name)) {
  1264. pseudos[':' + name] = true;
  1265. hasPseudo = true;
  1266. }
  1267. break;
  1268. case 'PseudoElementSelector':
  1269. var name = node.name.toLowerCase();
  1270. if (!nonFreezePseudoElements.hasOwnProperty(name)) {
  1271. pseudos['::' + name] = true;
  1272. hasPseudo = true;
  1273. }
  1274. break;
  1275. case 'TypeSelector':
  1276. tagName = node.name.toLowerCase();
  1277. break;
  1278. case 'AttributeSelector':
  1279. if (node.flags) {
  1280. pseudos['[' + node.flags.toLowerCase() + ']'] = true;
  1281. hasPseudo = true;
  1282. }
  1283. break;
  1284. case 'WhiteSpace':
  1285. case 'Combinator':
  1286. tagName = '*';
  1287. break;
  1288. }
  1289. });
  1290. simpleSelector.compareMarker = specificity(simpleSelector).toString();
  1291. simpleSelector.id = null; // pre-init property to avoid multiple hidden class
  1292. simpleSelector.id = generate$1(simpleSelector);
  1293. if (scope) {
  1294. simpleSelector.compareMarker += ':' + scope;
  1295. }
  1296. if (tagName !== '*') {
  1297. simpleSelector.compareMarker += ',' + tagName;
  1298. }
  1299. });
  1300. // add property to all rule nodes to avoid multiple hidden class
  1301. node.pseudoSignature = hasPseudo && Object.keys(pseudos).sort().join(',');
  1302. };
  1303. var resolveKeyword$2 = csstree_min.keyword;
  1304. var walk$3 = csstree_min.walk;
  1305. var generate$2 = csstree_min.generate;
  1306. var prepare = function prepare(ast, options) {
  1307. var markDeclaration = createDeclarationIndexer();
  1308. walk$3(ast, {
  1309. visit: 'Rule',
  1310. enter: function processRule(node) {
  1311. node.block.children.each(markDeclaration);
  1312. processSelector(node, options.usage);
  1313. }
  1314. });
  1315. walk$3(ast, {
  1316. visit: 'Atrule',
  1317. enter: function(node) {
  1318. if (node.prelude) {
  1319. node.prelude.id = null; // pre-init property to avoid multiple hidden class for generate
  1320. node.prelude.id = generate$2(node.prelude);
  1321. }
  1322. // compare keyframe selectors by its values
  1323. // NOTE: still no clarification about problems with keyframes selector grouping (issue #197)
  1324. if (resolveKeyword$2(node.name).basename === 'keyframes') {
  1325. node.block.avoidRulesMerge = true; /* probably we don't need to prevent those merges for @keyframes
  1326. TODO: need to be checked */
  1327. node.block.children.each(function(rule) {
  1328. rule.prelude.children.each(function(simpleselector) {
  1329. simpleselector.compareMarker = simpleselector.id;
  1330. });
  1331. });
  1332. }
  1333. }
  1334. });
  1335. return {
  1336. declaration: markDeclaration
  1337. };
  1338. };
  1339. var List$1 = csstree_min.List;
  1340. var resolveKeyword$3 = csstree_min.keyword;
  1341. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  1342. var walk$4 = csstree_min.walk;
  1343. function addRuleToMap(map, item, list, single) {
  1344. var node = item.data;
  1345. var name = resolveKeyword$3(node.name).basename;
  1346. var id = node.name.toLowerCase() + '/' + (node.prelude ? node.prelude.id : null);
  1347. if (!hasOwnProperty$2.call(map, name)) {
  1348. map[name] = Object.create(null);
  1349. }
  1350. if (single) {
  1351. delete map[name][id];
  1352. }
  1353. if (!hasOwnProperty$2.call(map[name], id)) {
  1354. map[name][id] = new List$1();
  1355. }
  1356. map[name][id].append(list.remove(item));
  1357. }
  1358. function relocateAtrules(ast, options) {
  1359. var collected = Object.create(null);
  1360. var topInjectPoint = null;
  1361. ast.children.each(function(node, item, list) {
  1362. if (node.type === 'Atrule') {
  1363. var name = resolveKeyword$3(node.name).basename;
  1364. switch (name) {
  1365. case 'keyframes':
  1366. addRuleToMap(collected, item, list, true);
  1367. return;
  1368. case 'media':
  1369. if (options.forceMediaMerge) {
  1370. addRuleToMap(collected, item, list, false);
  1371. return;
  1372. }
  1373. break;
  1374. }
  1375. if (topInjectPoint === null &&
  1376. name !== 'charset' &&
  1377. name !== 'import') {
  1378. topInjectPoint = item;
  1379. }
  1380. } else {
  1381. if (topInjectPoint === null) {
  1382. topInjectPoint = item;
  1383. }
  1384. }
  1385. });
  1386. for (var atrule in collected) {
  1387. for (var id in collected[atrule]) {
  1388. ast.children.insertList(
  1389. collected[atrule][id],
  1390. atrule === 'media' ? null : topInjectPoint
  1391. );
  1392. }
  1393. }
  1394. }
  1395. function isMediaRule(node) {
  1396. return node.type === 'Atrule' && node.name === 'media';
  1397. }
  1398. function processAtrule(node, item, list) {
  1399. if (!isMediaRule(node)) {
  1400. return;
  1401. }
  1402. var prev = item.prev && item.prev.data;
  1403. if (!prev || !isMediaRule(prev)) {
  1404. return;
  1405. }
  1406. // merge @media with same query
  1407. if (node.prelude &&
  1408. prev.prelude &&
  1409. node.prelude.id === prev.prelude.id) {
  1410. prev.block.children.appendList(node.block.children);
  1411. list.remove(item);
  1412. // TODO: use it when we can refer to several points in source
  1413. // prev.loc = {
  1414. // primary: prev.loc,
  1415. // merged: node.loc
  1416. // };
  1417. }
  1418. }
  1419. var _1MergeAtrule = function rejoinAtrule(ast, options) {
  1420. relocateAtrules(ast, options);
  1421. walk$4(ast, {
  1422. visit: 'Atrule',
  1423. reverse: true,
  1424. enter: processAtrule
  1425. });
  1426. };
  1427. var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
  1428. function isEqualSelectors(a, b) {
  1429. var cursor1 = a.head;
  1430. var cursor2 = b.head;
  1431. while (cursor1 !== null && cursor2 !== null && cursor1.data.id === cursor2.data.id) {
  1432. cursor1 = cursor1.next;
  1433. cursor2 = cursor2.next;
  1434. }
  1435. return cursor1 === null && cursor2 === null;
  1436. }
  1437. function isEqualDeclarations(a, b) {
  1438. var cursor1 = a.head;
  1439. var cursor2 = b.head;
  1440. while (cursor1 !== null && cursor2 !== null && cursor1.data.id === cursor2.data.id) {
  1441. cursor1 = cursor1.next;
  1442. cursor2 = cursor2.next;
  1443. }
  1444. return cursor1 === null && cursor2 === null;
  1445. }
  1446. function compareDeclarations(declarations1, declarations2) {
  1447. var result = {
  1448. eq: [],
  1449. ne1: [],
  1450. ne2: [],
  1451. ne2overrided: []
  1452. };
  1453. var fingerprints = Object.create(null);
  1454. var declarations2hash = Object.create(null);
  1455. for (var cursor = declarations2.head; cursor; cursor = cursor.next) {
  1456. declarations2hash[cursor.data.id] = true;
  1457. }
  1458. for (var cursor = declarations1.head; cursor; cursor = cursor.next) {
  1459. var data = cursor.data;
  1460. if (data.fingerprint) {
  1461. fingerprints[data.fingerprint] = data.important;
  1462. }
  1463. if (declarations2hash[data.id]) {
  1464. declarations2hash[data.id] = false;
  1465. result.eq.push(data);
  1466. } else {
  1467. result.ne1.push(data);
  1468. }
  1469. }
  1470. for (var cursor = declarations2.head; cursor; cursor = cursor.next) {
  1471. var data = cursor.data;
  1472. if (declarations2hash[data.id]) {
  1473. // when declarations1 has an overriding declaration, this is not a difference
  1474. // unless no !important is used on prev and !important is used on the following
  1475. if (!hasOwnProperty$3.call(fingerprints, data.fingerprint) ||
  1476. (!fingerprints[data.fingerprint] && data.important)) {
  1477. result.ne2.push(data);
  1478. }
  1479. result.ne2overrided.push(data);
  1480. }
  1481. }
  1482. return result;
  1483. }
  1484. function addSelectors(dest, source) {
  1485. source.each(function(sourceData) {
  1486. var newStr = sourceData.id;
  1487. var cursor = dest.head;
  1488. while (cursor) {
  1489. var nextStr = cursor.data.id;
  1490. if (nextStr === newStr) {
  1491. return;
  1492. }
  1493. if (nextStr > newStr) {
  1494. break;
  1495. }
  1496. cursor = cursor.next;
  1497. }
  1498. dest.insert(dest.createItem(sourceData), cursor);
  1499. });
  1500. return dest;
  1501. }
  1502. // check if simpleselectors has no equal specificity and element selector
  1503. function hasSimilarSelectors(selectors1, selectors2) {
  1504. var cursor1 = selectors1.head;
  1505. while (cursor1 !== null) {
  1506. var cursor2 = selectors2.head;
  1507. while (cursor2 !== null) {
  1508. if (cursor1.data.compareMarker === cursor2.data.compareMarker) {
  1509. return true;
  1510. }
  1511. cursor2 = cursor2.next;
  1512. }
  1513. cursor1 = cursor1.next;
  1514. }
  1515. return false;
  1516. }
  1517. // test node can't to be skipped
  1518. function unsafeToSkipNode(node) {
  1519. switch (node.type) {
  1520. case 'Rule':
  1521. // unsafe skip ruleset with selector similarities
  1522. return hasSimilarSelectors(node.prelude.children, this);
  1523. case 'Atrule':
  1524. // can skip at-rules with blocks
  1525. if (node.block) {
  1526. // unsafe skip at-rule if block contains something unsafe to skip
  1527. return node.block.children.some(unsafeToSkipNode, this);
  1528. }
  1529. break;
  1530. case 'Declaration':
  1531. return false;
  1532. }
  1533. // unsafe by default
  1534. return true;
  1535. }
  1536. var utils$1 = {
  1537. isEqualSelectors: isEqualSelectors,
  1538. isEqualDeclarations: isEqualDeclarations,
  1539. compareDeclarations: compareDeclarations,
  1540. addSelectors: addSelectors,
  1541. hasSimilarSelectors: hasSimilarSelectors,
  1542. unsafeToSkipNode: unsafeToSkipNode
  1543. };
  1544. var walk$5 = csstree_min.walk;
  1545. function processRule(node, item, list) {
  1546. var selectors = node.prelude.children;
  1547. var declarations = node.block.children;
  1548. list.prevUntil(item.prev, function(prev) {
  1549. // skip non-ruleset node if safe
  1550. if (prev.type !== 'Rule') {
  1551. return utils$1.unsafeToSkipNode.call(selectors, prev);
  1552. }
  1553. var prevSelectors = prev.prelude.children;
  1554. var prevDeclarations = prev.block.children;
  1555. // try to join rulesets with equal pseudo signature
  1556. if (node.pseudoSignature === prev.pseudoSignature) {
  1557. // try to join by selectors
  1558. if (utils$1.isEqualSelectors(prevSelectors, selectors)) {
  1559. prevDeclarations.appendList(declarations);
  1560. list.remove(item);
  1561. return true;
  1562. }
  1563. // try to join by declarations
  1564. if (utils$1.isEqualDeclarations(declarations, prevDeclarations)) {
  1565. utils$1.addSelectors(prevSelectors, selectors);
  1566. list.remove(item);
  1567. return true;
  1568. }
  1569. }
  1570. // go to prev ruleset if has no selector similarities
  1571. return utils$1.hasSimilarSelectors(selectors, prevSelectors);
  1572. });
  1573. }
  1574. // NOTE: direction should be left to right, since rulesets merge to left
  1575. // ruleset. When direction right to left unmerged rulesets may prevent lookup
  1576. // TODO: remove initial merge
  1577. var _2InitialMergeRuleset = function initialMergeRule(ast) {
  1578. walk$5(ast, {
  1579. visit: 'Rule',
  1580. enter: processRule
  1581. });
  1582. };
  1583. var List$2 = csstree_min.List;
  1584. var walk$6 = csstree_min.walk;
  1585. function processRule$1(node, item, list) {
  1586. var selectors = node.prelude.children;
  1587. // generate new rule sets:
  1588. // .a, .b { color: red; }
  1589. // ->
  1590. // .a { color: red; }
  1591. // .b { color: red; }
  1592. // while there are more than 1 simple selector split for rulesets
  1593. while (selectors.head !== selectors.tail) {
  1594. var newSelectors = new List$2();
  1595. newSelectors.insert(selectors.remove(selectors.head));
  1596. list.insert(list.createItem({
  1597. type: 'Rule',
  1598. loc: node.loc,
  1599. prelude: {
  1600. type: 'SelectorList',
  1601. loc: node.prelude.loc,
  1602. children: newSelectors
  1603. },
  1604. block: {
  1605. type: 'Block',
  1606. loc: node.block.loc,
  1607. children: node.block.children.copy()
  1608. },
  1609. pseudoSignature: node.pseudoSignature
  1610. }), item);
  1611. }
  1612. }
  1613. var _3DisjoinRuleset = function disjoinRule(ast) {
  1614. walk$6(ast, {
  1615. visit: 'Rule',
  1616. reverse: true,
  1617. enter: processRule$1
  1618. });
  1619. };
  1620. var List$3 = csstree_min.List;
  1621. var generate$3 = csstree_min.generate;
  1622. var walk$7 = csstree_min.walk;
  1623. var REPLACE = 1;
  1624. var REMOVE = 2;
  1625. var TOP = 0;
  1626. var RIGHT = 1;
  1627. var BOTTOM = 2;
  1628. var LEFT = 3;
  1629. var SIDES = ['top', 'right', 'bottom', 'left'];
  1630. var SIDE = {
  1631. 'margin-top': 'top',
  1632. 'margin-right': 'right',
  1633. 'margin-bottom': 'bottom',
  1634. 'margin-left': 'left',
  1635. 'padding-top': 'top',
  1636. 'padding-right': 'right',
  1637. 'padding-bottom': 'bottom',
  1638. 'padding-left': 'left',
  1639. 'border-top-color': 'top',
  1640. 'border-right-color': 'right',
  1641. 'border-bottom-color': 'bottom',
  1642. 'border-left-color': 'left',
  1643. 'border-top-width': 'top',
  1644. 'border-right-width': 'right',
  1645. 'border-bottom-width': 'bottom',
  1646. 'border-left-width': 'left',
  1647. 'border-top-style': 'top',
  1648. 'border-right-style': 'right',
  1649. 'border-bottom-style': 'bottom',
  1650. 'border-left-style': 'left'
  1651. };
  1652. var MAIN_PROPERTY = {
  1653. 'margin': 'margin',
  1654. 'margin-top': 'margin',
  1655. 'margin-right': 'margin',
  1656. 'margin-bottom': 'margin',
  1657. 'margin-left': 'margin',
  1658. 'padding': 'padding',
  1659. 'padding-top': 'padding',
  1660. 'padding-right': 'padding',
  1661. 'padding-bottom': 'padding',
  1662. 'padding-left': 'padding',
  1663. 'border-color': 'border-color',
  1664. 'border-top-color': 'border-color',
  1665. 'border-right-color': 'border-color',
  1666. 'border-bottom-color': 'border-color',
  1667. 'border-left-color': 'border-color',
  1668. 'border-width': 'border-width',
  1669. 'border-top-width': 'border-width',
  1670. 'border-right-width': 'border-width',
  1671. 'border-bottom-width': 'border-width',
  1672. 'border-left-width': 'border-width',
  1673. 'border-style': 'border-style',
  1674. 'border-top-style': 'border-style',
  1675. 'border-right-style': 'border-style',
  1676. 'border-bottom-style': 'border-style',
  1677. 'border-left-style': 'border-style'
  1678. };
  1679. function TRBL(name) {
  1680. this.name = name;
  1681. this.loc = null;
  1682. this.iehack = undefined;
  1683. this.sides = {
  1684. 'top': null,
  1685. 'right': null,
  1686. 'bottom': null,
  1687. 'left': null
  1688. };
  1689. }
  1690. TRBL.prototype.getValueSequence = function(declaration, count) {
  1691. var values = [];
  1692. var iehack = '';
  1693. var hasBadValues = declaration.value.type !== 'Value' || declaration.value.children.some(function(child) {
  1694. var special = false;
  1695. switch (child.type) {
  1696. case 'Identifier':
  1697. switch (child.name) {
  1698. case '\\0':
  1699. case '\\9':
  1700. iehack = child.name;
  1701. return;
  1702. case 'inherit':
  1703. case 'initial':
  1704. case 'unset':
  1705. case 'revert':
  1706. special = child.name;
  1707. break;
  1708. }
  1709. break;
  1710. case 'Dimension':
  1711. switch (child.unit) {
  1712. // is not supported until IE11
  1713. case 'rem':
  1714. // v* units is too buggy across browsers and better
  1715. // don't merge values with those units
  1716. case 'vw':
  1717. case 'vh':
  1718. case 'vmin':
  1719. case 'vmax':
  1720. case 'vm': // IE9 supporting "vm" instead of "vmin".
  1721. special = child.unit;
  1722. break;
  1723. }
  1724. break;
  1725. case 'Hash': // color
  1726. case 'Number':
  1727. case 'Percentage':
  1728. break;
  1729. case 'Function':
  1730. if (child.name === 'var') {
  1731. return true;
  1732. }
  1733. special = child.name;
  1734. break;
  1735. case 'WhiteSpace':
  1736. return false; // ignore space
  1737. default:
  1738. return true; // bad value
  1739. }
  1740. values.push({
  1741. node: child,
  1742. special: special,
  1743. important: declaration.important
  1744. });
  1745. });
  1746. if (hasBadValues || values.length > count) {
  1747. return false;
  1748. }
  1749. if (typeof this.iehack === 'string' && this.iehack !== iehack) {
  1750. return false;
  1751. }
  1752. this.iehack = iehack; // move outside
  1753. return values;
  1754. };
  1755. TRBL.prototype.canOverride = function(side, value) {
  1756. var currentValue = this.sides[side];
  1757. return !currentValue || (value.important && !currentValue.important);
  1758. };
  1759. TRBL.prototype.add = function(name, declaration) {
  1760. function attemptToAdd() {
  1761. var sides = this.sides;
  1762. var side = SIDE[name];
  1763. if (side) {
  1764. if (side in sides === false) {
  1765. return false;
  1766. }
  1767. var values = this.getValueSequence(declaration, 1);
  1768. if (!values || !values.length) {
  1769. return false;
  1770. }
  1771. // can mix only if specials are equal
  1772. for (var key in sides) {
  1773. if (sides[key] !== null && sides[key].special !== values[0].special) {
  1774. return false;
  1775. }
  1776. }
  1777. if (!this.canOverride(side, values[0])) {
  1778. return true;
  1779. }
  1780. sides[side] = values[0];
  1781. return true;
  1782. } else if (name === this.name) {
  1783. var values = this.getValueSequence(declaration, 4);
  1784. if (!values || !values.length) {
  1785. return false;
  1786. }
  1787. switch (values.length) {
  1788. case 1:
  1789. values[RIGHT] = values[TOP];
  1790. values[BOTTOM] = values[TOP];
  1791. values[LEFT] = values[TOP];
  1792. break;
  1793. case 2:
  1794. values[BOTTOM] = values[TOP];
  1795. values[LEFT] = values[RIGHT];
  1796. break;
  1797. case 3:
  1798. values[LEFT] = values[RIGHT];
  1799. break;
  1800. }
  1801. // can mix only if specials are equal
  1802. for (var i = 0; i < 4; i++) {
  1803. for (var key in sides) {
  1804. if (sides[key] !== null && sides[key].special !== values[i].special) {
  1805. return false;
  1806. }
  1807. }
  1808. }
  1809. for (var i = 0; i < 4; i++) {
  1810. if (this.canOverride(SIDES[i], values[i])) {
  1811. sides[SIDES[i]] = values[i];
  1812. }
  1813. }
  1814. return true;
  1815. }
  1816. }
  1817. if (!attemptToAdd.call(this)) {
  1818. return false;
  1819. }
  1820. // TODO: use it when we can refer to several points in source
  1821. // if (this.loc) {
  1822. // this.loc = {
  1823. // primary: this.loc,
  1824. // merged: declaration.loc
  1825. // };
  1826. // } else {
  1827. // this.loc = declaration.loc;
  1828. // }
  1829. if (!this.loc) {
  1830. this.loc = declaration.loc;
  1831. }
  1832. return true;
  1833. };
  1834. TRBL.prototype.isOkToMinimize = function() {
  1835. var top = this.sides.top;
  1836. var right = this.sides.right;
  1837. var bottom = this.sides.bottom;
  1838. var left = this.sides.left;
  1839. if (top && right && bottom && left) {
  1840. var important =
  1841. top.important +
  1842. right.important +
  1843. bottom.important +
  1844. left.important;
  1845. return important === 0 || important === 4;
  1846. }
  1847. return false;
  1848. };
  1849. TRBL.prototype.getValue = function() {
  1850. var result = new List$3();
  1851. var sides = this.sides;
  1852. var values = [
  1853. sides.top,
  1854. sides.right,
  1855. sides.bottom,
  1856. sides.left
  1857. ];
  1858. var stringValues = [
  1859. generate$3(sides.top.node),
  1860. generate$3(sides.right.node),
  1861. generate$3(sides.bottom.node),
  1862. generate$3(sides.left.node)
  1863. ];
  1864. if (stringValues[LEFT] === stringValues[RIGHT]) {
  1865. values.pop();
  1866. if (stringValues[BOTTOM] === stringValues[TOP]) {
  1867. values.pop();
  1868. if (stringValues[RIGHT] === stringValues[TOP]) {
  1869. values.pop();
  1870. }
  1871. }
  1872. }
  1873. for (var i = 0; i < values.length; i++) {
  1874. if (i) {
  1875. result.appendData({ type: 'WhiteSpace', value: ' ' });
  1876. }
  1877. result.appendData(values[i].node);
  1878. }
  1879. if (this.iehack) {
  1880. result.appendData({ type: 'WhiteSpace', value: ' ' });
  1881. result.appendData({
  1882. type: 'Identifier',
  1883. loc: null,
  1884. name: this.iehack
  1885. });
  1886. }
  1887. return {
  1888. type: 'Value',
  1889. loc: null,
  1890. children: result
  1891. };
  1892. };
  1893. TRBL.prototype.getDeclaration = function() {
  1894. return {
  1895. type: 'Declaration',
  1896. loc: this.loc,
  1897. important: this.sides.top.important,
  1898. property: this.name,
  1899. value: this.getValue()
  1900. };
  1901. };
  1902. function processRule$2(rule, shorts, shortDeclarations, lastShortSelector) {
  1903. var declarations = rule.block.children;
  1904. var selector = rule.prelude.children.first().id;
  1905. rule.block.children.eachRight(function(declaration, item) {
  1906. var property = declaration.property;
  1907. if (!MAIN_PROPERTY.hasOwnProperty(property)) {
  1908. return;
  1909. }
  1910. var key = MAIN_PROPERTY[property];
  1911. var shorthand;
  1912. var operation;
  1913. if (!lastShortSelector || selector === lastShortSelector) {
  1914. if (key in shorts) {
  1915. operation = REMOVE;
  1916. shorthand = shorts[key];
  1917. }
  1918. }
  1919. if (!shorthand || !shorthand.add(property, declaration)) {
  1920. operation = REPLACE;
  1921. shorthand = new TRBL(key);
  1922. // if can't parse value ignore it and break shorthand children
  1923. if (!shorthand.add(property, declaration)) {
  1924. lastShortSelector = null;
  1925. return;
  1926. }
  1927. }
  1928. shorts[key] = shorthand;
  1929. shortDeclarations.push({
  1930. operation: operation,
  1931. block: declarations,
  1932. item: item,
  1933. shorthand: shorthand
  1934. });
  1935. lastShortSelector = selector;
  1936. });
  1937. return lastShortSelector;
  1938. }
  1939. function processShorthands(shortDeclarations, markDeclaration) {
  1940. shortDeclarations.forEach(function(item) {
  1941. var shorthand = item.shorthand;
  1942. if (!shorthand.isOkToMinimize()) {
  1943. return;
  1944. }
  1945. if (item.operation === REPLACE) {
  1946. item.item.data = markDeclaration(shorthand.getDeclaration());
  1947. } else {
  1948. item.block.remove(item.item);
  1949. }
  1950. });
  1951. }
  1952. var _4RestructShorthand = function restructBlock(ast, indexer) {
  1953. var stylesheetMap = {};
  1954. var shortDeclarations = [];
  1955. walk$7(ast, {
  1956. visit: 'Rule',
  1957. reverse: true,
  1958. enter: function(node) {
  1959. var stylesheet = this.block || this.stylesheet;
  1960. var ruleId = (node.pseudoSignature || '') + '|' + node.prelude.children.first().id;
  1961. var ruleMap;
  1962. var shorts;
  1963. if (!stylesheetMap.hasOwnProperty(stylesheet.id)) {
  1964. ruleMap = {
  1965. lastShortSelector: null
  1966. };
  1967. stylesheetMap[stylesheet.id] = ruleMap;
  1968. } else {
  1969. ruleMap = stylesheetMap[stylesheet.id];
  1970. }
  1971. if (ruleMap.hasOwnProperty(ruleId)) {
  1972. shorts = ruleMap[ruleId];
  1973. } else {
  1974. shorts = {};
  1975. ruleMap[ruleId] = shorts;
  1976. }
  1977. ruleMap.lastShortSelector = processRule$2.call(this, node, shorts, shortDeclarations, ruleMap.lastShortSelector);
  1978. }
  1979. });
  1980. processShorthands(shortDeclarations, indexer.declaration);
  1981. };
  1982. var resolveProperty = csstree_min.property;
  1983. var resolveKeyword$4 = csstree_min.keyword;
  1984. var walk$8 = csstree_min.walk;
  1985. var generate$4 = csstree_min.generate;
  1986. var fingerprintId = 1;
  1987. var dontRestructure = {
  1988. 'src': 1 // https://github.com/afelix/csso/issues/50
  1989. };
  1990. var DONT_MIX_VALUE = {
  1991. // https://developer.mozilla.org/en-US/docs/Web/CSS/display#Browser_compatibility
  1992. 'display': /table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,
  1993. // https://developer.mozilla.org/en/docs/Web/CSS/text-align
  1994. 'text-align': /^(start|end|match-parent|justify-all)$/i
  1995. };
  1996. var SAFE_VALUES = {
  1997. cursor: [
  1998. 'auto', 'crosshair', 'default', 'move', 'text', 'wait', 'help',
  1999. 'n-resize', 'e-resize', 's-resize', 'w-resize',
  2000. 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize',
  2001. 'pointer', 'progress', 'not-allowed', 'no-drop', 'vertical-text', 'all-scroll',
  2002. 'col-resize', 'row-resize'
  2003. ],
  2004. overflow: [
  2005. 'hidden', 'visible', 'scroll', 'auto'
  2006. ],
  2007. position: [
  2008. 'static', 'relative', 'absolute', 'fixed'
  2009. ]
  2010. };
  2011. var NEEDLESS_TABLE = {
  2012. 'border-width': ['border'],
  2013. 'border-style': ['border'],
  2014. 'border-color': ['border'],
  2015. 'border-top': ['border'],
  2016. 'border-right': ['border'],
  2017. 'border-bottom': ['border'],
  2018. 'border-left': ['border'],
  2019. 'border-top-width': ['border-top', 'border-width', 'border'],
  2020. 'border-right-width': ['border-right', 'border-width', 'border'],
  2021. 'border-bottom-width': ['border-bottom', 'border-width', 'border'],
  2022. 'border-left-width': ['border-left', 'border-width', 'border'],
  2023. 'border-top-style': ['border-top', 'border-style', 'border'],
  2024. 'border-right-style': ['border-right', 'border-style', 'border'],
  2025. 'border-bottom-style': ['border-bottom', 'border-style', 'border'],
  2026. 'border-left-style': ['border-left', 'border-style', 'border'],
  2027. 'border-top-color': ['border-top', 'border-color', 'border'],
  2028. 'border-right-color': ['border-right', 'border-color', 'border'],
  2029. 'border-bottom-color': ['border-bottom', 'border-color', 'border'],
  2030. 'border-left-color': ['border-left', 'border-color', 'border'],
  2031. 'margin-top': ['margin'],
  2032. 'margin-right': ['margin'],
  2033. 'margin-bottom': ['margin'],
  2034. 'margin-left': ['margin'],
  2035. 'padding-top': ['padding'],
  2036. 'padding-right': ['padding'],
  2037. 'padding-bottom': ['padding'],
  2038. 'padding-left': ['padding'],
  2039. 'font-style': ['font'],
  2040. 'font-variant': ['font'],
  2041. 'font-weight': ['font'],
  2042. 'font-size': ['font'],
  2043. 'font-family': ['font'],
  2044. 'list-style-type': ['list-style'],
  2045. 'list-style-position': ['list-style'],
  2046. 'list-style-image': ['list-style']
  2047. };
  2048. function getPropertyFingerprint(propertyName, declaration, fingerprints) {
  2049. var realName = resolveProperty(propertyName).basename;
  2050. if (realName === 'background') {
  2051. return propertyName + ':' + generate$4(declaration.value);
  2052. }
  2053. var declarationId = declaration.id;
  2054. var fingerprint = fingerprints[declarationId];
  2055. if (!fingerprint) {
  2056. switch (declaration.value.type) {
  2057. case 'Value':
  2058. var vendorId = '';
  2059. var iehack = '';
  2060. var special = {};
  2061. var raw = false;
  2062. declaration.value.children.each(function walk(node) {
  2063. switch (node.type) {
  2064. case 'Value':
  2065. case 'Brackets':
  2066. case 'Parentheses':
  2067. node.children.each(walk);
  2068. break;
  2069. case 'Raw':
  2070. raw = true;
  2071. break;
  2072. case 'Identifier':
  2073. var name = node.name;
  2074. if (!vendorId) {
  2075. vendorId = resolveKeyword$4(name).vendor;
  2076. }
  2077. if (/\\[09]/.test(name)) {
  2078. iehack = RegExp.lastMatch;
  2079. }
  2080. if (SAFE_VALUES.hasOwnProperty(realName)) {
  2081. if (SAFE_VALUES[realName].indexOf(name) === -1) {
  2082. special[name] = true;
  2083. }
  2084. } else if (DONT_MIX_VALUE.hasOwnProperty(realName)) {
  2085. if (DONT_MIX_VALUE[realName].test(name)) {
  2086. special[name] = true;
  2087. }
  2088. }
  2089. break;
  2090. case 'Function':
  2091. var name = node.name;
  2092. if (!vendorId) {
  2093. vendorId = resolveKeyword$4(name).vendor;
  2094. }
  2095. if (name === 'rect') {
  2096. // there are 2 forms of rect:
  2097. // rect(<top>, <right>, <bottom>, <left>) - standart
  2098. // rect(<top> <right> <bottom> <left>) – backwards compatible syntax
  2099. // only the same form values can be merged
  2100. var hasComma = node.children.some(function(node) {
  2101. return node.type === 'Operator' && node.value === ',';
  2102. });
  2103. if (!hasComma) {
  2104. name = 'rect-backward';
  2105. }
  2106. }
  2107. special[name + '()'] = true;
  2108. // check nested tokens too
  2109. node.children.each(walk);
  2110. break;
  2111. case 'Dimension':
  2112. var unit = node.unit;
  2113. if (/\\[09]/.test(unit)) {
  2114. iehack = RegExp.lastMatch;
  2115. }
  2116. switch (unit) {
  2117. // is not supported until IE11
  2118. case 'rem':
  2119. // v* units is too buggy across browsers and better
  2120. // don't merge values with those units
  2121. case 'vw':
  2122. case 'vh':
  2123. case 'vmin':
  2124. case 'vmax':
  2125. case 'vm': // IE9 supporting "vm" instead of "vmin".
  2126. special[unit] = true;
  2127. break;
  2128. }
  2129. break;
  2130. }
  2131. });
  2132. fingerprint = raw
  2133. ? '!' + fingerprintId++
  2134. : '!' + Object.keys(special).sort() + '|' + iehack + vendorId;
  2135. break;
  2136. case 'Raw':
  2137. fingerprint = '!' + declaration.value.value;
  2138. break;
  2139. default:
  2140. fingerprint = generate$4(declaration.value);
  2141. }
  2142. fingerprints[declarationId] = fingerprint;
  2143. }
  2144. return propertyName + fingerprint;
  2145. }
  2146. function needless(props, declaration, fingerprints) {
  2147. var property = resolveProperty(declaration.property);
  2148. if (NEEDLESS_TABLE.hasOwnProperty(property.basename)) {
  2149. var table = NEEDLESS_TABLE[property.basename];
  2150. for (var i = 0; i < table.length; i++) {
  2151. var ppre = getPropertyFingerprint(property.prefix + table[i], declaration, fingerprints);
  2152. var prev = props.hasOwnProperty(ppre) ? props[ppre] : null;
  2153. if (prev && (!declaration.important || prev.item.data.important)) {
  2154. return prev;
  2155. }
  2156. }
  2157. }
  2158. }
  2159. function processRule$3(rule, item, list, props, fingerprints) {
  2160. var declarations = rule.block.children;
  2161. declarations.eachRight(function(declaration, declarationItem) {
  2162. var property = declaration.property;
  2163. var fingerprint = getPropertyFingerprint(property, declaration, fingerprints);
  2164. var prev = props[fingerprint];
  2165. if (prev && !dontRestructure.hasOwnProperty(property)) {
  2166. if (declaration.important && !prev.item.data.important) {
  2167. props[fingerprint] = {
  2168. block: declarations,
  2169. item: declarationItem
  2170. };
  2171. prev.block.remove(prev.item);
  2172. // TODO: use it when we can refer to several points in source
  2173. // declaration.loc = {
  2174. // primary: declaration.loc,
  2175. // merged: prev.item.data.loc
  2176. // };
  2177. } else {
  2178. declarations.remove(declarationItem);
  2179. // TODO: use it when we can refer to several points in source
  2180. // prev.item.data.loc = {
  2181. // primary: prev.item.data.loc,
  2182. // merged: declaration.loc
  2183. // };
  2184. }
  2185. } else {
  2186. var prev = needless(props, declaration, fingerprints);
  2187. if (prev) {
  2188. declarations.remove(declarationItem);
  2189. // TODO: use it when we can refer to several points in source
  2190. // prev.item.data.loc = {
  2191. // primary: prev.item.data.loc,
  2192. // merged: declaration.loc
  2193. // };
  2194. } else {
  2195. declaration.fingerprint = fingerprint;
  2196. props[fingerprint] = {
  2197. block: declarations,
  2198. item: declarationItem
  2199. };
  2200. }
  2201. }
  2202. });
  2203. if (declarations.isEmpty()) {
  2204. list.remove(item);
  2205. }
  2206. }
  2207. var _6RestructBlock = function restructBlock(ast) {
  2208. var stylesheetMap = {};
  2209. var fingerprints = Object.create(null);
  2210. walk$8(ast, {
  2211. visit: 'Rule',
  2212. reverse: true,
  2213. enter: function(node, item, list) {
  2214. var stylesheet = this.block || this.stylesheet;
  2215. var ruleId = (node.pseudoSignature || '') + '|' + node.prelude.children.first().id;
  2216. var ruleMap;
  2217. var props;
  2218. if (!stylesheetMap.hasOwnProperty(stylesheet.id)) {
  2219. ruleMap = {};
  2220. stylesheetMap[stylesheet.id] = ruleMap;
  2221. } else {
  2222. ruleMap = stylesheetMap[stylesheet.id];
  2223. }
  2224. if (ruleMap.hasOwnProperty(ruleId)) {
  2225. props = ruleMap[ruleId];
  2226. } else {
  2227. props = {};
  2228. ruleMap[ruleId] = props;
  2229. }
  2230. processRule$3.call(this, node, item, list, props, fingerprints);
  2231. }
  2232. });
  2233. };
  2234. var walk$9 = csstree_min.walk;
  2235. /*
  2236. At this step all rules has single simple selector. We try to join by equal
  2237. declaration blocks to first rule, e.g.
  2238. .a { color: red }
  2239. b { ... }
  2240. .b { color: red }
  2241. ->
  2242. .a, .b { color: red }
  2243. b { ... }
  2244. */
  2245. function processRule$4(node, item, list) {
  2246. var selectors = node.prelude.children;
  2247. var declarations = node.block.children;
  2248. var nodeCompareMarker = selectors.first().compareMarker;
  2249. var skippedCompareMarkers = {};
  2250. list.nextUntil(item.next, function(next, nextItem) {
  2251. // skip non-ruleset node if safe
  2252. if (next.type !== 'Rule') {
  2253. return utils$1.unsafeToSkipNode.call(selectors, next);
  2254. }
  2255. if (node.pseudoSignature !== next.pseudoSignature) {
  2256. return true;
  2257. }
  2258. var nextFirstSelector = next.prelude.children.head;
  2259. var nextDeclarations = next.block.children;
  2260. var nextCompareMarker = nextFirstSelector.data.compareMarker;
  2261. // if next ruleset has same marked as one of skipped then stop joining
  2262. if (nextCompareMarker in skippedCompareMarkers) {
  2263. return true;
  2264. }
  2265. // try to join by selectors
  2266. if (selectors.head === selectors.tail) {
  2267. if (selectors.first().id === nextFirstSelector.data.id) {
  2268. declarations.appendList(nextDeclarations);
  2269. list.remove(nextItem);
  2270. return;
  2271. }
  2272. }
  2273. // try to join by properties
  2274. if (utils$1.isEqualDeclarations(declarations, nextDeclarations)) {
  2275. var nextStr = nextFirstSelector.data.id;
  2276. selectors.some(function(data, item) {
  2277. var curStr = data.id;
  2278. if (nextStr < curStr) {
  2279. selectors.insert(nextFirstSelector, item);
  2280. return true;
  2281. }
  2282. if (!item.next) {
  2283. selectors.insert(nextFirstSelector);
  2284. return true;
  2285. }
  2286. });
  2287. list.remove(nextItem);
  2288. return;
  2289. }
  2290. // go to next ruleset if current one can be skipped (has no equal specificity nor element selector)
  2291. if (nextCompareMarker === nodeCompareMarker) {
  2292. return true;
  2293. }
  2294. skippedCompareMarkers[nextCompareMarker] = true;
  2295. });
  2296. }
  2297. var _7MergeRuleset = function mergeRule(ast) {
  2298. walk$9(ast, {
  2299. visit: 'Rule',
  2300. enter: processRule$4
  2301. });
  2302. };
  2303. var List$4 = csstree_min.List;
  2304. var walk$a = csstree_min.walk;
  2305. function calcSelectorLength(list) {
  2306. var length = 0;
  2307. list.each(function(data) {
  2308. length += data.id.length + 1;
  2309. });
  2310. return length - 1;
  2311. }
  2312. function calcDeclarationsLength(tokens) {
  2313. var length = 0;
  2314. for (var i = 0; i < tokens.length; i++) {
  2315. length += tokens[i].length;
  2316. }
  2317. return (
  2318. length + // declarations
  2319. tokens.length - 1 // delimeters
  2320. );
  2321. }
  2322. function processRule$5(node, item, list) {
  2323. var avoidRulesMerge = this.block !== null ? this.block.avoidRulesMerge : false;
  2324. var selectors = node.prelude.children;
  2325. var block = node.block;
  2326. var disallowDownMarkers = Object.create(null);
  2327. var allowMergeUp = true;
  2328. var allowMergeDown = true;
  2329. list.prevUntil(item.prev, function(prev, prevItem) {
  2330. var prevBlock = prev.block;
  2331. var prevType = prev.type;
  2332. if (prevType !== 'Rule') {
  2333. var unsafe = utils$1.unsafeToSkipNode.call(selectors, prev);
  2334. if (!unsafe && prevType === 'Atrule' && prevBlock) {
  2335. walk$a(prevBlock, {
  2336. visit: 'Rule',
  2337. enter: function(node) {
  2338. node.prelude.children.each(function(data) {
  2339. disallowDownMarkers[data.compareMarker] = true;
  2340. });
  2341. }
  2342. });
  2343. }
  2344. return unsafe;
  2345. }
  2346. var prevSelectors = prev.prelude.children;
  2347. if (node.pseudoSignature !== prev.pseudoSignature) {
  2348. return true;
  2349. }
  2350. allowMergeDown = !prevSelectors.some(function(selector) {
  2351. return selector.compareMarker in disallowDownMarkers;
  2352. });
  2353. // try prev ruleset if simpleselectors has no equal specifity and element selector
  2354. if (!allowMergeDown && !allowMergeUp) {
  2355. return true;
  2356. }
  2357. // try to join by selectors
  2358. if (allowMergeUp && utils$1.isEqualSelectors(prevSelectors, selectors)) {
  2359. prevBlock.children.appendList(block.children);
  2360. list.remove(item);
  2361. return true;
  2362. }
  2363. // try to join by properties
  2364. var diff = utils$1.compareDeclarations(block.children, prevBlock.children);
  2365. // console.log(diff.eq, diff.ne1, diff.ne2);
  2366. if (diff.eq.length) {
  2367. if (!diff.ne1.length && !diff.ne2.length) {
  2368. // equal blocks
  2369. if (allowMergeDown) {
  2370. utils$1.addSelectors(selectors, prevSelectors);
  2371. list.remove(prevItem);
  2372. }
  2373. return true;
  2374. } else if (!avoidRulesMerge) { /* probably we don't need to prevent those merges for @keyframes
  2375. TODO: need to be checked */
  2376. if (diff.ne1.length && !diff.ne2.length) {
  2377. // prevBlock is subset block
  2378. var selectorLength = calcSelectorLength(selectors);
  2379. var blockLength = calcDeclarationsLength(diff.eq); // declarations length
  2380. if (allowMergeUp && selectorLength < blockLength) {
  2381. utils$1.addSelectors(prevSelectors, selectors);
  2382. block.children = new List$4().fromArray(diff.ne1);
  2383. }
  2384. } else if (!diff.ne1.length && diff.ne2.length) {
  2385. // node is subset of prevBlock
  2386. var selectorLength = calcSelectorLength(prevSelectors);
  2387. var blockLength = calcDeclarationsLength(diff.eq); // declarations length
  2388. if (allowMergeDown && selectorLength < blockLength) {
  2389. utils$1.addSelectors(selectors, prevSelectors);
  2390. prevBlock.children = new List$4().fromArray(diff.ne2);
  2391. }
  2392. } else {
  2393. // diff.ne1.length && diff.ne2.length
  2394. // extract equal block
  2395. var newSelector = {
  2396. type: 'SelectorList',
  2397. loc: null,
  2398. children: utils$1.addSelectors(prevSelectors.copy(), selectors)
  2399. };
  2400. var newBlockLength = calcSelectorLength(newSelector.children) + 2; // selectors length + curly braces length
  2401. var blockLength = calcDeclarationsLength(diff.eq); // declarations length
  2402. // create new ruleset if declarations length greater than
  2403. // ruleset description overhead
  2404. if (blockLength >= newBlockLength) {
  2405. var newItem = list.createItem({
  2406. type: 'Rule',
  2407. loc: null,
  2408. prelude: newSelector,
  2409. block: {
  2410. type: 'Block',
  2411. loc: null,
  2412. children: new List$4().fromArray(diff.eq)
  2413. },
  2414. pseudoSignature: node.pseudoSignature
  2415. });
  2416. block.children = new List$4().fromArray(diff.ne1);
  2417. prevBlock.children = new List$4().fromArray(diff.ne2overrided);
  2418. if (allowMergeUp) {
  2419. list.insert(newItem, prevItem);
  2420. } else {
  2421. list.insert(newItem, item);
  2422. }
  2423. return true;
  2424. }
  2425. }
  2426. }
  2427. }
  2428. if (allowMergeUp) {
  2429. // TODO: disallow up merge only if any property interception only (i.e. diff.ne2overrided.length > 0);
  2430. // await property families to find property interception correctly
  2431. allowMergeUp = !prevSelectors.some(function(prevSelector) {
  2432. return selectors.some(function(selector) {
  2433. return selector.compareMarker === prevSelector.compareMarker;
  2434. });
  2435. });
  2436. }
  2437. prevSelectors.each(function(data) {
  2438. disallowDownMarkers[data.compareMarker] = true;
  2439. });
  2440. });
  2441. }
  2442. var _8RestructRuleset = function restructRule(ast) {
  2443. walk$a(ast, {
  2444. visit: 'Rule',
  2445. reverse: true,
  2446. enter: processRule$5
  2447. });
  2448. };
  2449. var restructure = function(ast, options) {
  2450. // prepare ast for restructing
  2451. var indexer = prepare(ast, options);
  2452. options.logger('prepare', ast);
  2453. _1MergeAtrule(ast, options);
  2454. options.logger('mergeAtrule', ast);
  2455. _2InitialMergeRuleset(ast);
  2456. options.logger('initialMergeRuleset', ast);
  2457. _3DisjoinRuleset(ast);
  2458. options.logger('disjoinRuleset', ast);
  2459. _4RestructShorthand(ast, indexer);
  2460. options.logger('restructShorthand', ast);
  2461. _6RestructBlock(ast);
  2462. options.logger('restructBlock', ast);
  2463. _7MergeRuleset(ast);
  2464. options.logger('mergeRuleset', ast);
  2465. _8RestructRuleset(ast);
  2466. options.logger('restructRuleset', ast);
  2467. };
  2468. var List$5 = csstree_min.List;
  2469. var clone = csstree_min.clone;
  2470. var walk$b = csstree_min.walk;
  2471. function readChunk(children, specialComments) {
  2472. var buffer = new List$5();
  2473. var nonSpaceTokenInBuffer = false;
  2474. var protectedComment;
  2475. children.nextUntil(children.head, function(node, item, list) {
  2476. if (node.type === 'Comment') {
  2477. if (!specialComments || node.value.charAt(0) !== '!') {
  2478. list.remove(item);
  2479. return;
  2480. }
  2481. if (nonSpaceTokenInBuffer || protectedComment) {
  2482. return true;
  2483. }
  2484. list.remove(item);
  2485. protectedComment = node;
  2486. return;
  2487. }
  2488. if (node.type !== 'WhiteSpace') {
  2489. nonSpaceTokenInBuffer = true;
  2490. }
  2491. buffer.insert(list.remove(item));
  2492. });
  2493. return {
  2494. comment: protectedComment,
  2495. stylesheet: {
  2496. type: 'StyleSheet',
  2497. loc: null,
  2498. children: buffer
  2499. }
  2500. };
  2501. }
  2502. function compressChunk(ast, firstAtrulesAllowed, num, options) {
  2503. options.logger('Compress block #' + num, null, true);
  2504. var seed = 1;
  2505. if (ast.type === 'StyleSheet') {
  2506. ast.firstAtrulesAllowed = firstAtrulesAllowed;
  2507. ast.id = seed++;
  2508. }
  2509. walk$b(ast, {
  2510. visit: 'Atrule',
  2511. enter: function markScopes(node) {
  2512. if (node.block !== null) {
  2513. node.block.id = seed++;
  2514. }
  2515. }
  2516. });
  2517. options.logger('init', ast);
  2518. // remove redundant
  2519. clean(ast, options);
  2520. options.logger('clean', ast);
  2521. // replace nodes for shortened forms
  2522. replace(ast);
  2523. options.logger('replace', ast);
  2524. // structure optimisations
  2525. if (options.restructuring) {
  2526. restructure(ast, options);
  2527. }
  2528. return ast;
  2529. }
  2530. function getCommentsOption(options) {
  2531. var comments = 'comments' in options ? options.comments : 'exclamation';
  2532. if (typeof comments === 'boolean') {
  2533. comments = comments ? 'exclamation' : false;
  2534. } else if (comments !== 'exclamation' && comments !== 'first-exclamation') {
  2535. comments = false;
  2536. }
  2537. return comments;
  2538. }
  2539. function getRestructureOption(options) {
  2540. if ('restructure' in options) {
  2541. return options.restructure;
  2542. }
  2543. return 'restructuring' in options ? options.restructuring : true;
  2544. }
  2545. function wrapBlock(block) {
  2546. return new List$5().appendData({
  2547. type: 'Rule',
  2548. loc: null,
  2549. prelude: {
  2550. type: 'SelectorList',
  2551. loc: null,
  2552. children: new List$5().appendData({
  2553. type: 'Selector',
  2554. loc: null,
  2555. children: new List$5().appendData({
  2556. type: 'TypeSelector',
  2557. loc: null,
  2558. name: 'x'
  2559. })
  2560. })
  2561. },
  2562. block: block
  2563. });
  2564. }
  2565. var compress = function compress(ast, options) {
  2566. ast = ast || { type: 'StyleSheet', loc: null, children: new List$5() };
  2567. options = options || {};
  2568. var compressOptions = {
  2569. logger: typeof options.logger === 'function' ? options.logger : function() {},
  2570. restructuring: getRestructureOption(options),
  2571. forceMediaMerge: Boolean(options.forceMediaMerge),
  2572. usage: options.usage ? usage.buildIndex(options.usage) : false
  2573. };
  2574. var specialComments = getCommentsOption(options);
  2575. var firstAtrulesAllowed = true;
  2576. var input;
  2577. var output = new List$5();
  2578. var chunk;
  2579. var chunkNum = 1;
  2580. var chunkChildren;
  2581. if (options.clone) {
  2582. ast = clone(ast);
  2583. }
  2584. if (ast.type === 'StyleSheet') {
  2585. input = ast.children;
  2586. ast.children = output;
  2587. } else {
  2588. input = wrapBlock(ast);
  2589. }
  2590. do {
  2591. chunk = readChunk(input, Boolean(specialComments));
  2592. compressChunk(chunk.stylesheet, firstAtrulesAllowed, chunkNum++, compressOptions);
  2593. chunkChildren = chunk.stylesheet.children;
  2594. if (chunk.comment) {
  2595. // add \n before comment if there is another content in output
  2596. if (!output.isEmpty()) {
  2597. output.insert(List$5.createItem({
  2598. type: 'Raw',
  2599. value: '\n'
  2600. }));
  2601. }
  2602. output.insert(List$5.createItem(chunk.comment));
  2603. // add \n after comment if chunk is not empty
  2604. if (!chunkChildren.isEmpty()) {
  2605. output.insert(List$5.createItem({
  2606. type: 'Raw',
  2607. value: '\n'
  2608. }));
  2609. }
  2610. }
  2611. if (firstAtrulesAllowed && !chunkChildren.isEmpty()) {
  2612. var lastRule = chunkChildren.last();
  2613. if (lastRule.type !== 'Atrule' ||
  2614. (lastRule.name !== 'import' && lastRule.name !== 'charset')) {
  2615. firstAtrulesAllowed = false;
  2616. }
  2617. }
  2618. if (specialComments !== 'exclamation') {
  2619. specialComments = false;
  2620. }
  2621. output.appendList(chunkChildren);
  2622. } while (!input.isEmpty());
  2623. return {
  2624. ast: ast
  2625. };
  2626. };
  2627. var version = "4.2.0";
  2628. var _package = {
  2629. version: version
  2630. };
  2631. var _package$1 = /*#__PURE__*/Object.freeze({
  2632. __proto__: null,
  2633. version: version,
  2634. 'default': _package
  2635. });
  2636. var require$$0 = getCjsExportFromNamespace(_package$1);
  2637. var parse = csstree_min.parse;
  2638. var generate$5 = csstree_min.generate;
  2639. function debugOutput(name, options, startTime, data) {
  2640. if (options.debug) {
  2641. console.error('## ' + name + ' done in %d ms\n', Date.now() - startTime);
  2642. }
  2643. return data;
  2644. }
  2645. function createDefaultLogger(level) {
  2646. var lastDebug;
  2647. return function logger(title, ast) {
  2648. var line = title;
  2649. if (ast) {
  2650. line = '[' + ((Date.now() - lastDebug) / 1000).toFixed(3) + 's] ' + line;
  2651. }
  2652. if (level > 1 && ast) {
  2653. var css = generate$5(ast);
  2654. // when level 2, limit css to 256 symbols
  2655. if (level === 2 && css.length > 256) {
  2656. css = css.substr(0, 256) + '...';
  2657. }
  2658. line += '\n ' + css + '\n';
  2659. }
  2660. console.error(line);
  2661. lastDebug = Date.now();
  2662. };
  2663. }
  2664. function copy(obj) {
  2665. var result = {};
  2666. for (var key in obj) {
  2667. result[key] = obj[key];
  2668. }
  2669. return result;
  2670. }
  2671. function buildCompressOptions(options) {
  2672. options = copy(options);
  2673. if (typeof options.logger !== 'function' && options.debug) {
  2674. options.logger = createDefaultLogger(options.debug);
  2675. }
  2676. return options;
  2677. }
  2678. function runHandler(ast, options, handlers) {
  2679. if (!Array.isArray(handlers)) {
  2680. handlers = [handlers];
  2681. }
  2682. handlers.forEach(function(fn) {
  2683. fn(ast, options);
  2684. });
  2685. }
  2686. function minify(context, source, options) {
  2687. options = options || {};
  2688. var filename = options.filename || '<unknown>';
  2689. var result;
  2690. // parse
  2691. var ast = debugOutput('parsing', options, Date.now(),
  2692. parse(source, {
  2693. context: context,
  2694. filename: filename,
  2695. positions: Boolean(options.sourceMap)
  2696. })
  2697. );
  2698. // before compress handlers
  2699. if (options.beforeCompress) {
  2700. debugOutput('beforeCompress', options, Date.now(),
  2701. runHandler(ast, options, options.beforeCompress)
  2702. );
  2703. }
  2704. // compress
  2705. var compressResult = debugOutput('compress', options, Date.now(),
  2706. compress(ast, buildCompressOptions(options))
  2707. );
  2708. // after compress handlers
  2709. if (options.afterCompress) {
  2710. debugOutput('afterCompress', options, Date.now(),
  2711. runHandler(compressResult, options, options.afterCompress)
  2712. );
  2713. }
  2714. // generate
  2715. if (options.sourceMap) {
  2716. result = debugOutput('generate(sourceMap: true)', options, Date.now(), (function() {
  2717. var tmp = generate$5(compressResult.ast, { sourceMap: true });
  2718. tmp.map._file = filename; // since other tools can relay on file in source map transform chain
  2719. tmp.map.setSourceContent(filename, source);
  2720. return tmp;
  2721. }()));
  2722. } else {
  2723. result = debugOutput('generate', options, Date.now(), {
  2724. css: generate$5(compressResult.ast),
  2725. map: null
  2726. });
  2727. }
  2728. return result;
  2729. }
  2730. function minifyStylesheet(source, options) {
  2731. return minify('stylesheet', source, options);
  2732. }
  2733. function minifyBlock(source, options) {
  2734. return minify('declarationList', source, options);
  2735. }
  2736. var lib = {
  2737. version: require$$0.version,
  2738. // main methods
  2739. minify: minifyStylesheet,
  2740. minifyBlock: minifyBlock,
  2741. // css syntax parser/walkers/generator/etc
  2742. syntax: Object.assign({
  2743. compress: compress
  2744. }, csstree_min)
  2745. };
  2746. var lib_1 = lib.version;
  2747. var lib_2 = lib.minify;
  2748. var lib_3 = lib.minifyBlock;
  2749. var lib_4 = lib.syntax;
  2750. exports.default = lib;
  2751. exports.minify = lib_2;
  2752. exports.minifyBlock = lib_3;
  2753. exports.syntax = lib_4;
  2754. exports.version = lib_1;
  2755. Object.defineProperty(exports, '__esModule', { value: true });
  2756. })));