@turbodocx/html-to-docx
Version:
HTML to DOCX converter
1 lines • 1.74 MB
JavaScript
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("jszip"),require("os"),require("http"),require("https"),require("url"),require("path"),require("fs"),require("xmlbuilder2"),require("html-to-vdom"),require("html-entities"),require("crypto"),require("util"),require("events"),require("stream"),require("punycode"),require("zlib"),require("color-name")):"function"==typeof define&&define.amd?define(["jszip","os","http","https","url","path","fs","xmlbuilder2","html-to-vdom","html-entities","crypto","util","events","stream","punycode","zlib","color-name"],factory):(global="undefined"!=typeof globalThis?globalThis:global||self).HTMLToDOCX=factory(global.JSZip,global.os,global.http,global.https,global.Url,global.path$2,global.fs,global.xmlbuilder2,global.HTMLToVDOM,global.htmlEntities,global.crypto,global.util$1,global.events,global.Stream,global.punycode,global.zlib,global.colorNames)}(this,(function(JSZip,os,http,https,Url,path$2,fs,xmlbuilder2,HTMLToVDOM,htmlEntities,crypto,util$1,events,Stream,punycode,zlib,colorNames){"use strict";function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var JSZip__default=_interopDefaultLegacy(JSZip),os__default=_interopDefaultLegacy(os),http__default=_interopDefaultLegacy(http),https__default=_interopDefaultLegacy(https),Url__default=_interopDefaultLegacy(Url),path__default=_interopDefaultLegacy(path$2),fs__default=_interopDefaultLegacy(fs),HTMLToVDOM__default=_interopDefaultLegacy(HTMLToVDOM),crypto__default=_interopDefaultLegacy(crypto),util__default=_interopDefaultLegacy(util$1),events__default=_interopDefaultLegacy(events),Stream__default=_interopDefaultLegacy(Stream),punycode__default=_interopDefaultLegacy(punycode),zlib__default=_interopDefaultLegacy(zlib),colorNames__default=_interopDefaultLegacy(colorNames),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function createCommonjsModule(fn,basedir,module){return fn(module={path:basedir,exports:{},require:function(path,base){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==base&&module.path)}},module.exports),module.exports}function getCjsExportFromNamespace(n){return n&&n.default||n}var optimize$3=function(tokens){return tokens},NUMBER_PATTERN=/([0-9]+)/;function tryParseInt(value){return""+parseInt(value)==value?parseInt(value):value}var naturalCompare_1=function(value1,value2){var key1,key2,i,l,keys1=(""+value1).split(NUMBER_PATTERN).map(tryParseInt),keys2=(""+value2).split(NUMBER_PATTERN).map(tryParseInt);for(i=0,l=Math.min(keys1.length,keys2.length);i<l;i++)if((key1=keys1[i])!=(key2=keys2[i]))return key1>key2?1:-1;return keys1.length>keys2.length?1:keys1.length==keys2.length?0:-1};function naturalSorter$1(scope1,scope2){return naturalCompare_1(scope1[1],scope2[1])}function standardSorter(scope1,scope2){return scope1[1]>scope2[1]?1:-1}var sortSelectors_1=function(selectors,method){switch(method){case"natural":return selectors.sort(naturalSorter$1);case"standard":return selectors.sort(standardSorter);case"none":case!1:return selectors}};var override_1=function override$1(source1,source2){var key1,key2,item,target={};for(key1 in source1)item=source1[key1],Array.isArray(item)?target[key1]=item.slice(0):target[key1]="object"==typeof item&&null!==item?override$1(item,{}):item;for(key2 in source2)item=source2[key2],key2 in target&&Array.isArray(item)?target[key2]=item.slice(0):target[key2]=key2 in target&&"object"==typeof item&&null!==item?override$1(target[key2],item):item;return target};var Breaks$1={AfterAtRule:"afterAtRule",AfterBlockBegins:"afterBlockBegins",AfterBlockEnds:"afterBlockEnds",AfterComment:"afterComment",AfterProperty:"afterProperty",AfterRuleBegins:"afterRuleBegins",AfterRuleEnds:"afterRuleEnds",BeforeBlockEnds:"beforeBlockEnds",BetweenSelectors:"betweenSelectors"},BreakWith={CarriageReturnLineFeed:"\r\n",LineFeed:"\n",System:function(){var systemLineBreak="\n";try{systemLineBreak=os__default.default.EOL}catch(_){}return systemLineBreak}()},IndentWith_Space=" ",IndentWith_Tab="\t",Spaces$2={AroundSelectorRelation:"aroundSelectorRelation",BeforeBlockBegins:"beforeBlockBegins",BeforeValue:"beforeValue"},DEFAULTS$2={breaks:breaks(!1),breakWith:BreakWith.System,indentBy:0,indentWith:IndentWith_Space,spaces:spaces(!1),wrapAt:!1,semicolonAfterLastProperty:!1};function breaks(value){var breakOptions={};return breakOptions[Breaks$1.AfterAtRule]=value,breakOptions[Breaks$1.AfterBlockBegins]=value,breakOptions[Breaks$1.AfterBlockEnds]=value,breakOptions[Breaks$1.AfterComment]=value,breakOptions[Breaks$1.AfterProperty]=value,breakOptions[Breaks$1.AfterRuleBegins]=value,breakOptions[Breaks$1.AfterRuleEnds]=value,breakOptions[Breaks$1.BeforeBlockEnds]=value,breakOptions[Breaks$1.BetweenSelectors]=value,breakOptions}function spaces(value){var spaceOptions={};return spaceOptions[Spaces$2.AroundSelectorRelation]=value,spaceOptions[Spaces$2.BeforeBlockBegins]=value,spaceOptions[Spaces$2.BeforeValue]=value,spaceOptions}function mapBreakWith(value){switch(value){case"windows":case"crlf":case BreakWith.CarriageReturnLineFeed:return BreakWith.CarriageReturnLineFeed;case"unix":case"lf":case BreakWith.LineFeed:return BreakWith.LineFeed;default:return BreakWith.System}}function mapIndentWith(value){switch(value){case"space":return IndentWith_Space;case"tab":return IndentWith_Tab;default:return value}}function remapBreaks(source){for(var key in Breaks$1){var breakName=Breaks$1[key],breakValue=source.breaks[breakName];source.breaks[breakName]=!0===breakValue?source.breakWith:!1===breakValue?"":source.breakWith.repeat(parseInt(breakValue))}return source}var format$1_Breaks=Breaks$1,format$1_Spaces=Spaces$2,format$1_formatFrom=function(source){return void 0!==source&&!1!==source&&("object"==typeof source&&"breakWith"in source&&(source=override_1(source,{breakWith:mapBreakWith(source.breakWith)})),"object"==typeof source&&"indentBy"in source&&(source=override_1(source,{indentBy:parseInt(source.indentBy)})),"object"==typeof source&&"indentWith"in source&&(source=override_1(source,{indentWith:mapIndentWith(source.indentWith)})),"object"==typeof source?remapBreaks(override_1(DEFAULTS$2,source)):"string"==typeof source&&"beautify"==source?remapBreaks(override_1(DEFAULTS$2,{breaks:breaks(!0),indentBy:2,spaces:spaces(!0)})):"string"==typeof source&&"keep-breaks"==source?remapBreaks(override_1(DEFAULTS$2,{breaks:{afterAtRule:!0,afterBlockBegins:!0,afterBlockEnds:!0,afterComment:!0,afterRuleEnds:!0,beforeBlockEnds:!0}})):"string"==typeof source?remapBreaks(override_1(DEFAULTS$2,source.split(";").reduce((function(accumulator,directive){var parts=directive.split(":"),name=parts[0],value=parts[1];return"breaks"==name||"spaces"==name?accumulator[name]=function(string){return string.split(",").reduce((function(accumulator,directive){var parts=directive.split("="),name=parts[0],value=parts[1];return accumulator[name]=function(value){switch(value){case"false":case"off":return!1;case"true":case"on":return!0;default:return value}}(value),accumulator}),{})}(value):"indentBy"==name||"wrapAt"==name?accumulator[name]=parseInt(value):"indentWith"==name?accumulator[name]=mapIndentWith(value):"breakWith"==name&&(accumulator[name]=mapBreakWith(value)),accumulator}),{}))):DEFAULTS$2)},marker={ASTERISK:"*",AT:"@",BACK_SLASH:"\\",CARRIAGE_RETURN:"\r",CLOSE_CURLY_BRACKET:"}",CLOSE_ROUND_BRACKET:")",CLOSE_SQUARE_BRACKET:"]",COLON:":",COMMA:",",DOUBLE_QUOTE:'"',EXCLAMATION:"!",FORWARD_SLASH:"/",INTERNAL:"-clean-css-",NEW_LINE_NIX:"\n",OPEN_CURLY_BRACKET:"{",OPEN_ROUND_BRACKET:"(",OPEN_SQUARE_BRACKET:"[",SEMICOLON:";",SINGLE_QUOTE:"'",SPACE:" ",TAB:"\t",UNDERSCORE:"_"};var formatPosition_1=function(metadata){var line=metadata[0],column=metadata[1],source=metadata[2];return source?source+":"+line+":"+column:line+":"+column},Spaces$1=format$1_Spaces,CASE_ATTRIBUTE_PATTERN=/[\s"'][iI]\s*\]/,CASE_RESTORE_PATTERN=/([\d\w])([iI])\]/g,DOUBLE_QUOTE_CASE_PATTERN=/="([a-zA-Z][a-zA-Z\d\-_]+)"([iI])/g,DOUBLE_QUOTE_PATTERN=/="([a-zA-Z][a-zA-Z\d\-_]+)"(\s|\])/g,HTML_COMMENT_PATTERN=/^(?:(?:<!--|-->)\s*)+/,SINGLE_QUOTE_CASE_PATTERN=/='([a-zA-Z][a-zA-Z\d\-_]+)'([iI])/g,SINGLE_QUOTE_PATTERN=/='([a-zA-Z][a-zA-Z\d\-_]+)'(\s|\])/g,RELATION_PATTERN$1=/[>+~]/,WHITESPACE_PATTERN$2=/\s/,PSEUDO_CLASSES_WITH_SELECTORS=[":current",":future",":has",":host",":host-context",":is",":not",":past",":where"];function hasInvalidCharacters(value){var isEscaped,character,i,l,isInvalid=!1,isQuote=!1;for(i=0,l=value.length;i<l;i++){if(character=value[i],isEscaped);else if(character==marker.SINGLE_QUOTE||character==marker.DOUBLE_QUOTE)isQuote=!isQuote;else{if(!(isQuote||character!=marker.CLOSE_CURLY_BRACKET&&character!=marker.EXCLAMATION&&"<"!=character&&character!=marker.SEMICOLON)){isInvalid=!0;break}if(!isQuote&&0===i&&RELATION_PATTERN$1.test(character)){isInvalid=!0;break}}isEscaped=character==marker.BACK_SLASH}return isInvalid}function removeWhitespace(value,format){var character,isNewLineNix,isNewLineWin,isEscaped,wasEscaped,isQuoted,isSingleQuoted,isDoubleQuoted,isAttribute,isRelation,isWhitespace,isSpaceAwarePseudoClass,i,l,stripped=[],roundBracketLevel=0,wasComma=!1,wasRelation=!1,wasWhitespace=!1,withCaseAttribute=CASE_ATTRIBUTE_PATTERN.test(value),spaceAroundRelation=format&&format.spaces[Spaces$1.AroundSelectorRelation];for(i=0,l=value.length;i<l;i++){if(isNewLineNix=(character=value[i])==marker.NEW_LINE_NIX,isNewLineWin=character==marker.NEW_LINE_NIX&&value[i-1]==marker.CARRIAGE_RETURN,isQuoted=isSingleQuoted||isDoubleQuoted,isRelation=!isAttribute&&!isEscaped&&0===roundBracketLevel&&RELATION_PATTERN$1.test(character),isWhitespace=WHITESPACE_PATTERN$2.test(character),isSpaceAwarePseudoClass=(1!=roundBracketLevel||character!=marker.CLOSE_ROUND_BRACKET)&&(isSpaceAwarePseudoClass||0===roundBracketLevel&&character==marker.COLON&&isPseudoClassWithSelectors(value,i)),wasEscaped&&isQuoted&&isNewLineWin)stripped.pop(),stripped.pop();else if(isEscaped&&isQuoted&&isNewLineNix)stripped.pop();else if(isEscaped)stripped.push(character);else if(character!=marker.OPEN_SQUARE_BRACKET||isQuoted)if(character!=marker.CLOSE_SQUARE_BRACKET||isQuoted)if(character!=marker.OPEN_ROUND_BRACKET||isQuoted)if(character!=marker.CLOSE_ROUND_BRACKET||isQuoted)if(character!=marker.SINGLE_QUOTE||isQuoted)if(character!=marker.DOUBLE_QUOTE||isQuoted)if(character==marker.SINGLE_QUOTE&&isQuoted)stripped.push(character),isSingleQuoted=!1;else if(character==marker.DOUBLE_QUOTE&&isQuoted)stripped.push(character),isDoubleQuoted=!1;else{if(isWhitespace&&wasRelation&&!spaceAroundRelation)continue;!isWhitespace&&wasRelation&&spaceAroundRelation?(stripped.push(marker.SPACE),stripped.push(character)):isWhitespace&&!wasWhitespace&&wasComma&&roundBracketLevel>0&&isSpaceAwarePseudoClass||(isWhitespace&&!wasWhitespace&&roundBracketLevel>0&&isSpaceAwarePseudoClass?stripped.push(character):isWhitespace&&(isAttribute||roundBracketLevel>0)&&!isQuoted||isWhitespace&&wasWhitespace&&!isQuoted||(isNewLineWin||isNewLineNix)&&(isAttribute||roundBracketLevel>0)&&isQuoted||(isRelation&&wasWhitespace&&!spaceAroundRelation?(stripped.pop(),stripped.push(character)):isRelation&&!wasWhitespace&&spaceAroundRelation?(stripped.push(marker.SPACE),stripped.push(character)):isWhitespace?stripped.push(marker.SPACE):stripped.push(character)))}else stripped.push(character),isDoubleQuoted=!0;else stripped.push(character),isSingleQuoted=!0;else stripped.push(character),roundBracketLevel--;else stripped.push(character),roundBracketLevel++;else stripped.push(character),isAttribute=!1;else stripped.push(character),isAttribute=!0;wasEscaped=isEscaped,isEscaped=character==marker.BACK_SLASH,wasRelation=isRelation,wasWhitespace=isWhitespace,wasComma=character==marker.COMMA}return withCaseAttribute?stripped.join("").replace(CASE_RESTORE_PATTERN,"$1 $2]"):stripped.join("")}function isPseudoClassWithSelectors(value,colonPosition){var pseudoClass=value.substring(colonPosition,value.indexOf(marker.OPEN_ROUND_BRACKET,colonPosition));return PSEUDO_CLASSES_WITH_SELECTORS.indexOf(pseudoClass)>-1}function removeQuotes(value){return-1==value.indexOf("'")&&-1==value.indexOf('"')?value:value.replace(SINGLE_QUOTE_CASE_PATTERN,"=$1 $2").replace(SINGLE_QUOTE_PATTERN,"=$1$2").replace(DOUBLE_QUOTE_CASE_PATTERN,"=$1 $2").replace(DOUBLE_QUOTE_PATTERN,"=$1$2")}function replacePseudoClasses(value){return value.replace("nth-child(1)","first-child").replace("nth-of-type(1)","first-of-type").replace("nth-of-type(even)","nth-of-type(2n)").replace("nth-child(even)","nth-child(2n)").replace("nth-of-type(2n+1)","nth-of-type(odd)").replace("nth-child(2n+1)","nth-child(odd)").replace("nth-last-child(1)","last-child").replace("nth-last-of-type(1)","last-of-type").replace("nth-last-of-type(even)","nth-last-of-type(2n)").replace("nth-last-child(even)","nth-last-child(2n)").replace("nth-last-of-type(2n+1)","nth-last-of-type(odd)").replace("nth-last-child(2n+1)","nth-last-child(odd)")}var tidyRules_1=function(rules,removeUnsupported,adjacentSpace,format,warnings){var list=[],repeated=[];function removeHTMLComment(rule,match){return warnings.push("HTML comment '"+match+"' at "+formatPosition_1(rule[2][0])+". Removing."),""}for(var i=0,l=rules.length;i<l;i++){var rule=rules[i],reduced=rule[1];hasInvalidCharacters(reduced=reduced.replace(HTML_COMMENT_PATTERN,removeHTMLComment.bind(null,rule)))?warnings.push("Invalid selector '"+rule[1]+"' at "+formatPosition_1(rule[2][0])+". Ignoring."):(reduced=removeQuotes(reduced=removeWhitespace(reduced,format)),adjacentSpace&&reduced.indexOf("nav")>0&&(reduced=reduced.replace(/\+nav(\S|$)/,"+ nav$1")),removeUnsupported&&reduced.indexOf("*+html ")>-1||removeUnsupported&&reduced.indexOf("*:first-child+html ")>-1||(reduced.indexOf("*")>-1&&(reduced=reduced.replace(/\*([:#.[])/g,"$1").replace(/^(:first-child)?\+html/,"*$1+html")),repeated.indexOf(reduced)>-1||(reduced=replacePseudoClasses(reduced),rule[1]=reduced,repeated.push(reduced),list.push(rule))))}return 1==list.length&&0===list[0][1].length&&(warnings.push("Empty selector '"+list[0][1]+"' at "+formatPosition_1(list[0][2][0])+". Ignoring."),list=[]),list},SUPPORTED_COMPACT_BLOCK_MATCHER=/^@media\W/,SUPPORTED_QUOTE_REMOVAL_MATCHER=/^@(?:keyframes|-moz-keyframes|-o-keyframes|-webkit-keyframes)\W/;var tidyBlock_1=function(values,spaceAfterClosingBrace){var withoutSpaceAfterClosingBrace,withoutQuotes,i;for(i=values.length-1;i>=0;i--)withoutSpaceAfterClosingBrace=!spaceAfterClosingBrace&&SUPPORTED_COMPACT_BLOCK_MATCHER.test(values[i][1]),withoutQuotes=SUPPORTED_QUOTE_REMOVAL_MATCHER.test(values[i][1]),values[i][1]=values[i][1].replace(/\n|\r\n/g," ").replace(/\s+/g," ").replace(/(,|:|\() /g,"$1").replace(/ \)/g,")"),withoutQuotes&&(values[i][1]=values[i][1].replace(/'([a-zA-Z][a-zA-Z\d\-_]+)'/,"$1").replace(/"([a-zA-Z][a-zA-Z\d\-_]+)"/,"$1")),withoutSpaceAfterClosingBrace&&(values[i][1]=values[i][1].replace(/\) /g,")"));return values};var tidyAtRule_1=function(value){return value.replace(/\s+/g," ").replace(/url\(\s+/g,"url(").replace(/\s+\)/g,")").trim()},hack={ASTERISK:"asterisk",BANG:"bang",BACKSLASH:"backslash",UNDERSCORE:"underscore"};var removeUnused_1=function(properties){for(var i=properties.length-1;i>=0;i--){var property=properties[i];property.unused&&property.all.splice(property.position,1)}};function restoreImportant(property){property.value[property.value.length-1][1]+="!important"}function restoreHack(property){property.hack[0]==hack.UNDERSCORE?property.name="_"+property.name:property.hack[0]==hack.ASTERISK?property.name="*"+property.name:property.hack[0]==hack.BACKSLASH?property.value[property.value.length-1][1]+="\\"+property.hack[1]:property.hack[0]==hack.BANG&&(property.value[property.value.length-1][1]+=marker.SPACE+"!ie")}var restoreFromOptimizing_1=function(properties,restoreCallback){var property,restored,current,i;for(i=properties.length-1;i>=0;i--)(property=properties[i]).dynamic&&property.important?restoreImportant(property):property.dynamic||property.unused||(property.dirty||property.important||property.hack)&&(property.optimizable&&restoreCallback?(restored=restoreCallback(property),property.value=restored):restored=property.value,property.important&&restoreImportant(property),property.hack&&restoreHack(property),"all"in property&&((current=property.all[property.position])[1][1]=property.name,current.splice(2,current.length-1),Array.prototype.push.apply(current,restored)))},token={AT_RULE:"at-rule",AT_RULE_BLOCK:"at-rule-block",AT_RULE_BLOCK_SCOPE:"at-rule-block-scope",COMMENT:"comment",NESTED_BLOCK:"nested-block",NESTED_BLOCK_SCOPE:"nested-block-scope",PROPERTY:"property",PROPERTY_BLOCK:"property-block",PROPERTY_NAME:"property-name",PROPERTY_VALUE:"property-value",RAW:"raw",RULE:"rule",RULE_SCOPE:"rule-scope"},Match={ASTERISK:"*",BACKSLASH:"\\",BANG:"!",BANG_SUFFIX_PATTERN:/!\w+$/,IMPORTANT_TOKEN:"!important",IMPORTANT_TOKEN_PATTERN:new RegExp("!important$","i"),IMPORTANT_WORD:"important",IMPORTANT_WORD_PATTERN:new RegExp("important$","i"),SUFFIX_BANG_PATTERN:/!$/,UNDERSCORE:"_",VARIABLE_REFERENCE_PATTERN:/var\(--.+\)$/};function someVariableReferences(property){var i,l,value;for(i=2,l=property.length;i<l;i++)if((value=property[i])[0]==token.PROPERTY_VALUE&&isVariableReference(value[1]))return!0;return!1}function isVariableReference(value){return Match.VARIABLE_REFERENCE_PATTERN.test(value)}function isMultiplex(property){var value,i,l;for(i=3,l=property.length;i<l;i++)if((value=property[i])[0]==token.PROPERTY_VALUE&&(value[1]==marker.COMMA||value[1]==marker.FORWARD_SLASH))return!0;return!1}function wrapSingle$3(property){var importantProperty=function(property){if(property.length<3)return!1;var lastValue=property[property.length-1];return!!Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])||!(!Match.IMPORTANT_WORD_PATTERN.test(lastValue[1])||!Match.SUFFIX_BANG_PATTERN.test(property[property.length-2][1]))}(property);importantProperty&&function(property){var lastValue=property[property.length-1],oneButLastValue=property[property.length-2];Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])?lastValue[1]=lastValue[1].replace(Match.IMPORTANT_TOKEN_PATTERN,""):(lastValue[1]=lastValue[1].replace(Match.IMPORTANT_WORD_PATTERN,""),oneButLastValue[1]=oneButLastValue[1].replace(Match.SUFFIX_BANG_PATTERN,"")),0===lastValue[1].length&&property.pop(),0===oneButLastValue[1].length&&property.pop()}(property);var whichHack=function(property){var match=!1,name=property[1][1],lastValue=property[property.length-1];return name[0]==Match.UNDERSCORE?match=[hack.UNDERSCORE]:name[0]==Match.ASTERISK?match=[hack.ASTERISK]:lastValue[1][0]!=Match.BANG||lastValue[1].match(Match.IMPORTANT_WORD_PATTERN)?lastValue[1].indexOf(Match.BANG)>0&&!lastValue[1].match(Match.IMPORTANT_WORD_PATTERN)&&Match.BANG_SUFFIX_PATTERN.test(lastValue[1])?match=[hack.BANG]:lastValue[1].indexOf(Match.BACKSLASH)>0&&lastValue[1].indexOf(Match.BACKSLASH)==lastValue[1].length-Match.BACKSLASH.length-1?match=[hack.BACKSLASH,lastValue[1].substring(lastValue[1].indexOf(Match.BACKSLASH)+1)]:0===lastValue[1].indexOf(Match.BACKSLASH)&&2==lastValue[1].length&&(match=[hack.BACKSLASH,lastValue[1].substring(1)]):match=[hack.BANG],match}(property);return whichHack[0]==hack.ASTERISK||whichHack[0]==hack.UNDERSCORE?function(property){property[1][1]=property[1][1].substring(1)}(property):whichHack[0]!=hack.BACKSLASH&&whichHack[0]!=hack.BANG||function(property,hackFrom){var lastValue=property[property.length-1];lastValue[1]=lastValue[1].substring(0,lastValue[1].indexOf(hackFrom[0]==hack.BACKSLASH?Match.BACKSLASH:Match.BANG)).trim(),0===lastValue[1].length&&property.pop()}(property,whichHack),{block:property[2]&&property[2][0]==token.PROPERTY_BLOCK,components:[],dirty:!1,dynamic:someVariableReferences(property),hack:whichHack,important:importantProperty,name:property[1][1],multiplex:property.length>3&&isMultiplex(property),optimizable:!0,position:0,shorthand:!1,unused:!1,value:property.slice(2)}}var wrapForOptimizing$3_all=function(properties,skipProperties){var single,property,i,wrapped=[];for(i=properties.length-1;i>=0;i--)(property=properties[i])[0]==token.PROPERTY&&(skipProperties&&skipProperties.indexOf(property[1][1])>-1||((single=wrapSingle$3(property)).all=properties,single.position=i,wrapped.unshift(single)));return wrapped},wrapForOptimizing$3_single=wrapSingle$3;function InvalidPropertyError(message){this.name="InvalidPropertyError",this.message=message,this.stack=(new Error).stack}InvalidPropertyError.prototype=Object.create(Error.prototype),InvalidPropertyError.prototype.constructor=InvalidPropertyError;var invalidPropertyError=InvalidPropertyError,wrapSingle$2=wrapForOptimizing$3_single;function _anyIsInherit(values){var i,l;for(i=0,l=values.length;i<l;i++)if("inherit"==values[i][1])return!0;return!1}function _wrapDefault(name,property,configuration){var descriptor=configuration[name];return descriptor.doubleValues&&2==descriptor.defaultValue.length?wrapSingle$2([token.PROPERTY,[token.PROPERTY_NAME,name],[token.PROPERTY_VALUE,descriptor.defaultValue[0]],[token.PROPERTY_VALUE,descriptor.defaultValue[1]]]):descriptor.doubleValues&&1==descriptor.defaultValue.length?wrapSingle$2([token.PROPERTY,[token.PROPERTY_NAME,name],[token.PROPERTY_VALUE,descriptor.defaultValue[0]]]):wrapSingle$2([token.PROPERTY,[token.PROPERTY_NAME,name],[token.PROPERTY_VALUE,descriptor.defaultValue]])}function fourValues$1(property,configuration){var componentNames=configuration[property.name].components,components=[],value=property.value;if(value.length<1)return[];value.length<2&&(value[1]=value[0].slice(0)),value.length<3&&(value[2]=value[0].slice(0)),value.length<4&&(value[3]=value[1].slice(0));for(var i=componentNames.length-1;i>=0;i--){var component=wrapSingle$2([token.PROPERTY,[token.PROPERTY_NAME,componentNames[i]]]);component.value=[value[i]],components.unshift(component)}return components}function widthStyleColor(property,configuration,validator){for(var color,style,width,descriptor=configuration[property.name],components=[_wrapDefault(descriptor.components[0],0,configuration),_wrapDefault(descriptor.components[1],0,configuration),_wrapDefault(descriptor.components[2],0,configuration)],i=0;i<3;i++){var component=components[i];component.name.indexOf("color")>0?color=component:component.name.indexOf("style")>0?style=component:width=component}if(1==property.value.length&&"inherit"==property.value[0][1]||3==property.value.length&&"inherit"==property.value[0][1]&&"inherit"==property.value[1][1]&&"inherit"==property.value[2][1])return color.value=style.value=width.value=[property.value[0]],components;var match,matches,values=property.value.slice(0);return values.length>0&&(matches=values.filter(function(validator){return function(value){return"inherit"!=value[1]&&(validator.isWidth(value[1])||validator.isUnit(value[1])||validator.isDynamicUnit(value[1]))&&!validator.isStyleKeyword(value[1])&&!validator.isColorFunction(value[1])}}(validator)),(match=matches.length>1&&("none"==matches[0][1]||"auto"==matches[0][1])?matches[1]:matches[0])&&(width.value=[match],values.splice(values.indexOf(match),1))),values.length>0&&(match=values.filter(function(validator){return function(value){return"inherit"!=value[1]&&validator.isStyleKeyword(value[1])&&!validator.isColorFunction(value[1])}}(validator))[0],match&&(style.value=[match],values.splice(values.indexOf(match),1))),values.length>0&&(match=values.filter(function(validator){return function(value){return"invert"==value[1]||validator.isColor(value[1])||validator.isPrefixed(value[1])}}(validator))[0],match&&(color.value=[match],values.splice(values.indexOf(match),1))),components}var breakUp={animation:function(property,configuration,validator){var value,i,l,duration=_wrapDefault(property.name+"-duration",0,configuration),timing=_wrapDefault(property.name+"-timing-function",0,configuration),delay=_wrapDefault(property.name+"-delay",0,configuration),iteration=_wrapDefault(property.name+"-iteration-count",0,configuration),direction=_wrapDefault(property.name+"-direction",0,configuration),fill=_wrapDefault(property.name+"-fill-mode",0,configuration),play=_wrapDefault(property.name+"-play-state",0,configuration),name=_wrapDefault(property.name+"-name",0,configuration),components=[duration,timing,delay,iteration,direction,fill,play,name],values=property.value,durationSet=!1,timingSet=!1,delaySet=!1,iterationSet=!1,directionSet=!1,fillSet=!1,playSet=!1,nameSet=!1;if(1==property.value.length&&"inherit"==property.value[0][1])return duration.value=timing.value=delay.value=iteration.value=direction.value=fill.value=play.value=name.value=property.value,components;if(values.length>1&&_anyIsInherit(values))throw new invalidPropertyError("Invalid animation values at "+formatPosition_1(values[0][2][0])+". Ignoring.");for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isTime(value[1])&&!durationSet)duration.value=[value],durationSet=!0;else if(validator.isTime(value[1])&&!delaySet)delay.value=[value],delaySet=!0;else if(!validator.isGlobal(value[1])&&!validator.isTimingFunction(value[1])||timingSet)if(!validator.isAnimationIterationCountKeyword(value[1])&&!validator.isPositiveNumber(value[1])||iterationSet)if(validator.isAnimationDirectionKeyword(value[1])&&!directionSet)direction.value=[value],directionSet=!0;else if(validator.isAnimationFillModeKeyword(value[1])&&!fillSet)fill.value=[value],fillSet=!0;else if(validator.isAnimationPlayStateKeyword(value[1])&&!playSet)play.value=[value],playSet=!0;else{if(!validator.isAnimationNameKeyword(value[1])&&!validator.isIdentifier(value[1])||nameSet)throw new invalidPropertyError("Invalid animation value at "+formatPosition_1(value[2][0])+". Ignoring.");name.value=[value],nameSet=!0}else iteration.value=[value],iterationSet=!0;else timing.value=[value],timingSet=!0;return components},background:function(property,configuration,validator){var image=_wrapDefault("background-image",0,configuration),position=_wrapDefault("background-position",0,configuration),size=_wrapDefault("background-size",0,configuration),repeat=_wrapDefault("background-repeat",0,configuration),attachment=_wrapDefault("background-attachment",0,configuration),origin=_wrapDefault("background-origin",0,configuration),clip=_wrapDefault("background-clip",0,configuration),color=_wrapDefault("background-color",0,configuration),components=[image,position,size,repeat,attachment,origin,clip,color],values=property.value,positionSet=!1,clipSet=!1,originSet=!1,repeatSet=!1,anyValueSet=!1;if(1==property.value.length&&"inherit"==property.value[0][1])return color.value=image.value=repeat.value=position.value=size.value=origin.value=clip.value=property.value,components;if(1==property.value.length&&"0 0"==property.value[0][1])return components;for(var i=values.length-1;i>=0;i--){var value=values[i];if(validator.isBackgroundAttachmentKeyword(value[1]))attachment.value=[value],anyValueSet=!0;else if(validator.isBackgroundClipKeyword(value[1])||validator.isBackgroundOriginKeyword(value[1]))clipSet?(origin.value=[value],originSet=!0):(clip.value=[value],clipSet=!0),anyValueSet=!0;else if(validator.isBackgroundRepeatKeyword(value[1]))repeatSet?repeat.value.unshift(value):(repeat.value=[value],repeatSet=!0),anyValueSet=!0;else if(validator.isBackgroundPositionKeyword(value[1])||validator.isBackgroundSizeKeyword(value[1])||validator.isUnit(value[1])||validator.isDynamicUnit(value[1])){if(i>0){var previousValue=values[i-1];previousValue[1]==marker.FORWARD_SLASH?size.value=[value]:i>1&&values[i-2][1]==marker.FORWARD_SLASH?(size.value=[previousValue,value],i-=2):(positionSet||(position.value=[]),position.value.unshift(value),positionSet=!0)}else positionSet||(position.value=[]),position.value.unshift(value),positionSet=!0;anyValueSet=!0}else color.value[0][1]!=configuration[color.name].defaultValue&&"none"!=color.value[0][1]||!validator.isColor(value[1])&&!validator.isPrefixed(value[1])?(validator.isUrl(value[1])||validator.isFunction(value[1]))&&(image.value=[value],anyValueSet=!0):(color.value=[value],anyValueSet=!0)}if(clipSet&&!originSet&&(origin.value=clip.value.slice(0)),!anyValueSet)throw new invalidPropertyError("Invalid background value at "+formatPosition_1(values[0][2][0])+". Ignoring.");return components},border:widthStyleColor,borderRadius:function(property,configuration){for(var values=property.value,splitAt=-1,i=0,l=values.length;i<l;i++)if(values[i][1]==marker.FORWARD_SLASH){splitAt=i;break}if(0===splitAt||splitAt===values.length-1)throw new invalidPropertyError("Invalid border-radius value at "+formatPosition_1(values[0][2][0])+". Ignoring.");var target=_wrapDefault(property.name,0,configuration);target.value=splitAt>-1?values.slice(0,splitAt):values.slice(0),target.components=fourValues$1(target,configuration);var remainder=_wrapDefault(property.name,0,configuration);remainder.value=splitAt>-1?values.slice(splitAt+1):values.slice(0),remainder.components=fourValues$1(remainder,configuration);for(var j=0;j<4;j++)target.components[j].multiplex=!0,target.components[j].value=target.components[j].value.concat(remainder.components[j].value);return target.components},font:function(property,configuration,validator){var isStretchValid,isStyleValid,isVariantValid,isWeightValid,style=_wrapDefault("font-style",0,configuration),variant=_wrapDefault("font-variant",0,configuration),weight=_wrapDefault("font-weight",0,configuration),stretch=_wrapDefault("font-stretch",0,configuration),size=_wrapDefault("font-size",0,configuration),height=_wrapDefault("line-height",0,configuration),family=_wrapDefault("font-family",0,configuration),components=[style,variant,weight,stretch,size,height,family],values=property.value,index=0,isStretchSet=!1,isStyleSet=!1,isVariantSet=!1,isWeightSet=!1,appendableFamilyName=!1;if(!values[index])throw new invalidPropertyError("Missing font values at "+formatPosition_1(property.all[property.position][1][2][0])+". Ignoring.");if(1==values.length&&"inherit"==values[0][1])return style.value=variant.value=weight.value=stretch.value=size.value=height.value=family.value=values,components;if(1==values.length&&(validator.isFontKeyword(values[0][1])||validator.isGlobal(values[0][1])||validator.isPrefixed(values[0][1])))return values[0][1]=marker.INTERNAL+values[0][1],style.value=variant.value=weight.value=stretch.value=size.value=height.value=family.value=values,components;if(values.length<2||!function(values,validator){var value,i,l;for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isFontSizeKeyword(value[1])||validator.isUnit(value[1])&&!validator.isDynamicUnit(value[1])||validator.isFunction(value[1]))return!0;return!1}(values,validator)||!function(values,validator){var value,i,l;for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isIdentifier(value[1])||validator.isQuotedText(value[1]))return!0;return!1}(values,validator))throw new invalidPropertyError("Invalid font values at "+formatPosition_1(property.all[property.position][1][2][0])+". Ignoring.");if(values.length>1&&_anyIsInherit(values))throw new invalidPropertyError("Invalid font values at "+formatPosition_1(values[0][2][0])+". Ignoring.");for(;index<4;){if(isStretchValid=validator.isFontStretchKeyword(values[index][1])||validator.isGlobal(values[index][1]),isStyleValid=validator.isFontStyleKeyword(values[index][1])||validator.isGlobal(values[index][1]),isVariantValid=validator.isFontVariantKeyword(values[index][1])||validator.isGlobal(values[index][1]),isWeightValid=validator.isFontWeightKeyword(values[index][1])||validator.isGlobal(values[index][1]),isStyleValid&&!isStyleSet)style.value=[values[index]],isStyleSet=!0;else if(isVariantValid&&!isVariantSet)variant.value=[values[index]],isVariantSet=!0;else if(isWeightValid&&!isWeightSet)weight.value=[values[index]],isWeightSet=!0;else{if(!isStretchValid||isStretchSet){if(isStyleValid&&isStyleSet||isVariantValid&&isVariantSet||isWeightValid&&isWeightSet||isStretchValid&&isStretchSet)throw new invalidPropertyError("Invalid font style / variant / weight / stretch value at "+formatPosition_1(values[0][2][0])+". Ignoring.");break}stretch.value=[values[index]],isStretchSet=!0}index++}if(!(validator.isFontSizeKeyword(values[index][1])||validator.isUnit(values[index][1])&&!validator.isDynamicUnit(values[index][1])))throw new invalidPropertyError("Missing font size at "+formatPosition_1(values[0][2][0])+". Ignoring.");if(size.value=[values[index]],!values[++index])throw new invalidPropertyError("Missing font family at "+formatPosition_1(values[0][2][0])+". Ignoring.");for(values[index]&&values[index][1]==marker.FORWARD_SLASH&&values[index+1]&&(validator.isLineHeightKeyword(values[index+1][1])||validator.isUnit(values[index+1][1])||validator.isNumber(values[index+1][1]))&&(height.value=[values[index+1]],index++,index++),family.value=[];values[index];)values[index][1]==marker.COMMA?appendableFamilyName=!1:(appendableFamilyName?family.value[family.value.length-1][1]+=marker.SPACE+values[index][1]:family.value.push(values[index]),appendableFamilyName=!0),index++;if(0===family.value.length)throw new invalidPropertyError("Missing font family at "+formatPosition_1(values[0][2][0])+". Ignoring.");return components},fourValues:fourValues$1,listStyle:function(property,configuration,validator){var type=_wrapDefault("list-style-type",0,configuration),position=_wrapDefault("list-style-position",0,configuration),image=_wrapDefault("list-style-image",0,configuration),components=[type,position,image];if(1==property.value.length&&"inherit"==property.value[0][1])return type.value=position.value=image.value=[property.value[0]],components;var values=property.value.slice(0),total=values.length,index=0;for(index=0,total=values.length;index<total;index++)if(validator.isUrl(values[index][1])||"0"==values[index][1]){image.value=[values[index]],values.splice(index,1);break}for(index=0,total=values.length;index<total;index++)if(validator.isListStylePositionKeyword(values[index][1])){position.value=[values[index]],values.splice(index,1);break}return values.length>0&&(validator.isListStyleTypeKeyword(values[0][1])||validator.isIdentifier(values[0][1]))&&(type.value=[values[0]]),components},multiplex:function(splitWith){return function(property,configuration,validator){var i,j,l,m,splitsAt=[],values=property.value;for(i=0,l=values.length;i<l;i++)","==values[i][1]&&splitsAt.push(i);if(0===splitsAt.length)return splitWith(property,configuration,validator);var splitComponents=[];for(i=0,l=splitsAt.length;i<=l;i++){var from=0===i?0:splitsAt[i-1]+1,to=i<l?splitsAt[i]:values.length,_property=_wrapDefault(property.name,0,configuration);_property.value=values.slice(from,to),_property.value.length>0&&splitComponents.push(splitWith(_property,configuration,validator))}var components=splitComponents[0];for(i=0,l=components.length;i<l;i++)for(components[i].multiplex=!0,j=1,m=splitComponents.length;j<m;j++)components[i].value.push([token.PROPERTY_VALUE,marker.COMMA]),Array.prototype.push.apply(components[i].value,splitComponents[j][i].value);return components}},outline:widthStyleColor,transition:function(property,configuration,validator){var value,i,l,prop=_wrapDefault(property.name+"-property",0,configuration),duration=_wrapDefault(property.name+"-duration",0,configuration),timing=_wrapDefault(property.name+"-timing-function",0,configuration),delay=_wrapDefault(property.name+"-delay",0,configuration),components=[prop,duration,timing,delay],values=property.value,durationSet=!1,delaySet=!1,propSet=!1,timingSet=!1;if(1==property.value.length&&"inherit"==property.value[0][1])return prop.value=duration.value=timing.value=delay.value=property.value,components;if(values.length>1&&_anyIsInherit(values))throw new invalidPropertyError("Invalid animation values at "+formatPosition_1(values[0][2][0])+". Ignoring.");for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isTime(value[1])&&!durationSet)duration.value=[value],durationSet=!0;else if(validator.isTime(value[1])&&!delaySet)delay.value=[value],delaySet=!0;else if(!validator.isGlobal(value[1])&&!validator.isTimingFunction(value[1])||timingSet){if(!validator.isIdentifier(value[1])||propSet)throw new invalidPropertyError("Invalid animation value at "+formatPosition_1(value[2][0])+". Ignoring.");prop.value=[value],propSet=!0}else timing.value=[value],timingSet=!0;return components}},VENDOR_PREFIX_PATTERN=/(?:^|\W)(-\w+-)/g;function unique(value){for(var match,prefixes=[];null!==(match=VENDOR_PREFIX_PATTERN.exec(value));)-1==prefixes.indexOf(match[0])&&prefixes.push(match[0]);return prefixes}var vendorPrefixes_same=function(value1,value2){return unique(value1).sort().join(",")==unique(value2).sort().join(",")},sameVendorPrefixes=vendorPrefixes_same;var understandable_1=function(validator,value1,value2,_position,isPaired){return!!sameVendorPrefixes(value1,value2)&&(!isPaired||validator.isVariable(value1)===validator.isVariable(value2))};function areSameFunction(validator,value1,value2){if(!validator.isFunction(value1)||!validator.isFunction(value2))return!1;var function1Name=value1.substring(0,value1.indexOf("(")),function2Name=value2.substring(0,value2.indexOf("(")),function1Value=value1.substring(function1Name.length+1,value1.length-1),function2Value=value2.substring(function2Name.length+1,value2.length-1);return validator.isFunction(function1Value)||validator.isFunction(function2Value)?function1Name===function2Name&&areSameFunction(validator,function1Value,function2Value):function1Name===function2Name}function keyword(propertyName){return function(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isKeyword(propertyName)(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||validator.isKeyword(propertyName)(value2))}}function keywordWithGlobal(propertyName){return function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isKeyword(propertyName)(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isKeyword(propertyName)(value2)||validator.isGlobal(value2)))}}function sameFunctionOrValue(validator,value1,value2){return!!areSameFunction(validator,value1,value2)||value1===value2}function unit$1(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isUnit(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!(validator.isUnit(value1)&&!validator.isUnit(value2))&&(!!validator.isUnit(value2)||!validator.isUnit(value1)&&(!(!validator.isFunction(value1)||validator.isPrefixed(value1)||!validator.isFunction(value2)||validator.isPrefixed(value2))||sameFunctionOrValue(validator,value1,value2))))}function unitOrKeywordWithGlobal(propertyName){var byKeyword=keywordWithGlobal(propertyName);return function(validator,value1,value2){return unit$1(validator,value1,value2)||byKeyword(validator,value1,value2)}}var canOverride={generic:{color:function(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isColor(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!(!validator.colorOpacity&&(validator.isRgbColor(value1)||validator.isHslColor(value1)))&&(!(!validator.colorOpacity&&(validator.isRgbColor(value2)||validator.isHslColor(value2)))&&(!(!validator.colorHexAlpha&&(validator.isHexAlphaColor(value1)||validator.isHexAlphaColor(value2)))&&(!(!validator.isColor(value1)||!validator.isColor(value2))||sameFunctionOrValue(validator,value1,value2)))))},components:function(overrideCheckers){return function(validator,value1,value2,position){return overrideCheckers[position](validator,value1,value2)}},image:function(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isImage(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(!!validator.isImage(value2)||!validator.isImage(value1)&&sameFunctionOrValue(validator,value1,value2)))},propertyName:function(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isIdentifier(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||validator.isIdentifier(value2))},time:function(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isTime(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!(validator.isTime(value1)&&!validator.isTime(value2))&&(!!validator.isTime(value2)||!validator.isTime(value1)&&(!(!validator.isFunction(value1)||validator.isPrefixed(value1)||!validator.isFunction(value2)||validator.isPrefixed(value2))||sameFunctionOrValue(validator,value1,value2))))},timingFunction:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isTimingFunction(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isTimingFunction(value2)||validator.isGlobal(value2)))},unit:unit$1,unitOrNumber:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isUnit(value2)||validator.isNumber(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!((validator.isUnit(value1)||validator.isNumber(value1))&&!validator.isUnit(value2)&&!validator.isNumber(value2))&&(!(!validator.isUnit(value2)&&!validator.isNumber(value2))||!validator.isUnit(value1)&&!validator.isNumber(value1)&&(!(!validator.isFunction(value1)||validator.isPrefixed(value1)||!validator.isFunction(value2)||validator.isPrefixed(value2))||sameFunctionOrValue(validator,value1,value2))))}},property:{animationDirection:keywordWithGlobal("animation-direction"),animationFillMode:keyword("animation-fill-mode"),animationIterationCount:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isAnimationIterationCountKeyword(value2)||validator.isPositiveNumber(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isAnimationIterationCountKeyword(value2)||validator.isPositiveNumber(value2)))},animationName:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isAnimationNameKeyword(value2)||validator.isIdentifier(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isAnimationNameKeyword(value2)||validator.isIdentifier(value2)))},animationPlayState:keywordWithGlobal("animation-play-state"),backgroundAttachment:keyword("background-attachment"),backgroundClip:keywordWithGlobal("background-clip"),backgroundOrigin:keyword("background-origin"),backgroundPosition:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isBackgroundPositionKeyword(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(!(!validator.isBackgroundPositionKeyword(value2)&&!validator.isGlobal(value2))||unit$1(validator,value1,value2)))},backgroundRepeat:keyword("background-repeat"),backgroundSize:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isBackgroundSizeKeyword(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(!(!validator.isBackgroundSizeKeyword(value2)&&!validator.isGlobal(value2))||unit$1(validator,value1,value2)))},bottom:unitOrKeywordWithGlobal("bottom"),borderCollapse:keyword("border-collapse"),borderStyle:keywordWithGlobal("*-style"),clear:keywordWithGlobal("clear"),cursor:keywordWithGlobal("cursor"),display:keywordWithGlobal("display"),float:keywordWithGlobal("float"),left:unitOrKeywordWithGlobal("left"),fontFamily:function(validator,value1,value2){return understandable_1(validator,value1,value2,0,!0)},fontStretch:keywordWithGlobal("font-stretch"),fontStyle:keywordWithGlobal("font-style"),fontVariant:keywordWithGlobal("font-variant"),fontWeight:keywordWithGlobal("font-weight"),listStyleType:keywordWithGlobal("list-style-type"),listStylePosition:keywordWithGlobal("list-style-position"),outlineStyle:keywordWithGlobal("*-style"),overflow:keywordWithGlobal("overflow"),position:keywordWithGlobal("position"),right:unitOrKeywordWithGlobal("right"),textAlign:keywordWithGlobal("text-align"),textDecoration:keywordWithGlobal("text-decoration"),textOverflow:keywordWithGlobal("text-overflow"),textShadow:function(validator,value1,value2){return!!(understandable_1(validator,value1,value2,0,!0)||validator.isUnit(value2)||validator.isColor(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isUnit(value2)||validator.isColor(value2)||validator.isGlobal(value2)))},top:unitOrKeywordWithGlobal("top"),transform:sameFunctionOrValue,verticalAlign:unitOrKeywordWithGlobal("vertical-align"),visibility:keywordWithGlobal("visibility"),whiteSpace:keywordWithGlobal("white-space"),zIndex:function(validator,value1,value2){return!(!understandable_1(validator,value1,value2,0,!0)&&!validator.isZIndex(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||validator.isZIndex(value2))}}},wrapSingle$1=wrapForOptimizing$3_single;function shallow(property){var cloned=wrapSingle$1([token.PROPERTY,[token.PROPERTY_NAME,property.name]]);return cloned.important=property.important,cloned.hack=property.hack,cloned.unused=!1,cloned}var clone$2_deep=function(property){for(var cloned=shallow(property),i=property.components.length-1;i>=0;i--){var component=shallow(property.components[i]);component.value=property.components[i].value.slice(0),cloned.components.unshift(component)}return cloned.dirty=!0,cloned.value=property.value.slice(0),cloned},clone$2_shallow=shallow,shallowClone$1=clone$2_shallow;function isInheritOnly(values){for(var i=0,l=values.length;i<l;i++){var value=values[i][1];if("inherit"!=value&&value!=marker.COMMA&&value!=marker.FORWARD_SLASH)return!1}return!0}function fourValues(property){var components=property.components,value1=components[0].value[0],value2=components[1].value[0],value3=components[2].value[0],value4=components[3].value[0];return value1[1]==value2[1]&&value1[1]==value3[1]&&value1[1]==value4[1]?[value1]:value1[1]==value3[1]&&value2[1]==value4[1]?[value1,value2]:value2[1]==value4[1]?[value1,value2,value3]:[value1,value2,value3,value4]}function isDefault(components,configuration,propertyName){var component,i,l;for(i=0,l=components.length;i<l;i++)if((component=components[i]).name==propertyName&&component.value[0][1]==configuration[propertyName].defaultValue)return!0;return!1}var restore={background:function(property,configuration,lastInMultiplex){var needsOne,needsBoth,components=property.components,restored=[];function restoreValue(component){Array.prototype.unshift.apply(restored,component.value)}function isDefaultValue(component){var descriptor=configuration[component.name];return descriptor.doubleValues&&1==descriptor.defaultValue.length?component.value[0][1]==descriptor.defaultValue[0]&&(!component.value[1]||component.value[1][1]==descriptor.defaultValue[0]):descriptor.doubleValues&&1!=descriptor.defaultValue.length?component.value[0][1]==descriptor.defaultValue[0]&&(component.value[1]?component.value[1][1]:component.value[0][1])==descriptor.defaultValue[1]:component.value[0][1]==descriptor.defaultValue}for(var i=components.length-1;i>=0;i--){var component=components[i],isDefault=isDefaultValue(component);if("background-clip"==component.name){var originComponent=components[i-1],isOriginDefault=isDefaultValue(originComponent);needsBoth=!(needsOne=component.value[0][1]==originComponent.value[0][1])&&(isOriginDefault&&!isDefault||!isOriginDefault&&!isDefault||!isOriginDefault&&isDefault&&component.value[0][1]!=originComponent.value[0][1]),needsOne?restoreValue(originComponent):needsBoth&&(restoreValue(component),restoreValue(originComponent)),i--}else if("background-size"==component.name){var positionComponent=components[i-1],isPositionDefault=isDefaultValue(positionComponent);needsBoth=!(needsOne=!isPositionDefault&&isDefault)&&(isPositionDefault&&!isDefault||!isPositionDefault&&!isDefault),needsOne?restoreValue(positionComponent):needsBoth?(restoreValue(component),restored.unshift([token.PROPERTY_VALUE,marker.FORWARD_SLASH]),restoreValue(positionComponent)):1==positionComponent.value.length&&restoreValue(positionComponent),i--}else{if(isDefault||configuration[component.name].multiplexLastOnly&&!lastInMultiplex)continue;restoreValue(component)}}return 0===restored.length&&1==property.value.length&&"0"==property.value[0][1]&&restored.push(property.value[0]),0===restored.length&&restored.push([token.PROPERTY_VALUE,configuration[property.name].defaultValue]),isInheritOnly(restored)?[restored[0]]:restored},borderRadius:function(property){if(property.multiplex){for(var horizontal=shallowClone$1(property),vertical=shallowClone$1(property),i=0;i<4;i++){var component=property.components[i],horizontalComponent=shallowClone$1(property);horizontalComponent.value=[component.value[0]],horizontal.components.push(horizontalComponent);var verticalComponent=shallowClone$1(property);verticalComponent.value=[component.value[1]||component.value[0]],vertical.components.push(verticalComponent)}var horizontalValues=fourValues(horizontal),verticalValues=fourValues(vertical);return horizontalValues.length!=verticalValues.length||horizontalValues[0][1]!=verticalValues[0][1]||horizontalValues.length>1&&horizontalValues[1][1]!=verticalValues[1][1]||horizontalValues.length>2&&horizontalValues[2][1]!=verticalValues[2][1]||horizontalValues.length>3&&horizontalValues[3][1]!=verticalValues[3][1]?horizontalValues.concat([[token.PROPERTY_VALUE,marker.FORWARD_SLASH]]).concat(verticalValues):horizontalValues}return fourValues(propert