-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml2canvas.b8923d84.js.map
1 lines (1 loc) · 499 KB
/
html2canvas.b8923d84.js.map
1
{"version":3,"sources":["../src/index.ts","../node_modules/tslib/tslib.es6.js","../node_modules/css-line-break/src/Util.ts","../src/css/layout/bounds.ts","../src/css/syntax/tokenizer.ts","../node_modules/css-line-break/src/Trie.ts","../node_modules/css-line-break/src/LineBreak.ts","../node_modules/css-line-break/src/linebreak-trie.ts","../src/css/syntax/parser.ts","../src/css/types/length.ts","../src/css/types/length-percentage.ts","../src/css/types/angle.ts","../src/css/types/color.ts","../src/css/IPropertyDescriptor.ts","../src/css/property-descriptors/background-clip.ts","../src/css/types/image.ts","../src/css/property-descriptors/background-color.ts","../src/css/types/functions/gradient.ts","../src/css/types/functions/-prefix-linear-gradient.ts","../src/core/features.ts","../src/core/logger.ts","../src/core/cache-storage.ts","../src/css/types/functions/-prefix-radial-gradient.ts","../src/css/types/functions/radial-gradient.ts","../src/css/property-descriptors/background-repeat.ts","../src/css/types/functions/linear-gradient.ts","../src/css/types/functions/-webkit-gradient.ts","../src/css/property-descriptors/background-image.ts","../src/css/property-descriptors/background-origin.ts","../src/css/property-descriptors/background-position.ts","../src/css/property-descriptors/background-size.ts","../src/css/property-descriptors/border-style.ts","../src/css/property-descriptors/border-color.ts","../src/css/property-descriptors/border-radius.ts","../src/css/property-descriptors/float.ts","../src/css/property-descriptors/border-width.ts","../src/css/property-descriptors/color.ts","../src/css/property-descriptors/display.ts","../src/css/property-descriptors/line-break.ts","../src/css/property-descriptors/letter-spacing.ts","../src/css/property-descriptors/list-style-position.ts","../src/css/property-descriptors/line-height.ts","../src/css/property-descriptors/list-style-image.ts","../src/css/property-descriptors/list-style-type.ts","../src/css/property-descriptors/overflow.ts","../src/css/property-descriptors/margin.ts","../src/css/property-descriptors/overflow-wrap.ts","../src/css/property-descriptors/text-align.ts","../src/css/property-descriptors/padding.ts","../src/css/property-descriptors/position.ts","../src/css/property-descriptors/text-transform.ts","../src/css/property-descriptors/text-shadow.ts","../src/css/property-descriptors/visibility.ts","../src/css/property-descriptors/transform.ts","../src/css/property-descriptors/transform-origin.ts","../src/css/property-descriptors/word-break.ts","../src/css/property-descriptors/font-style.ts","../src/css/property-descriptors/z-index.ts","../src/css/property-descriptors/opacity.ts","../src/css/property-descriptors/text-decoration-color.ts","../src/css/property-descriptors/text-decoration-line.ts","../src/css/property-descriptors/font-family.ts","../src/css/property-descriptors/font-size.ts","../src/css/property-descriptors/font-weight.ts","../src/css/property-descriptors/font-variant.ts","../src/dom/document-cloner.ts","../src/core/bitwise.ts","../src/css/property-descriptors/content.ts","../src/css/property-descriptors/counter-increment.ts","../src/css/property-descriptors/counter-reset.ts","../src/css/property-descriptors/quotes.ts","../src/css/property-descriptors/box-shadow.ts","../src/css/index.ts","../src/dom/element-container.ts","../src/css/layout/text.ts","../src/dom/text-container.ts","../src/dom/replaced-elements/image-element-container.ts","../src/dom/replaced-elements/canvas-element-container.ts","../src/dom/replaced-elements/svg-element-container.ts","../src/dom/elements/li-element-container.ts","../src/dom/elements/ol-element-container.ts","../src/dom/replaced-elements/input-element-container.ts","../src/dom/elements/select-element-container.ts","../src/dom/elements/textarea-element-container.ts","../src/dom/replaced-elements/iframe-element-container.ts","../src/dom/node-parser.ts","../src/css/types/functions/counter.ts","../src/render/path.ts","../src/render/bound-curves.ts","../src/render/vector.ts","../src/render/bezier-curve.ts","../src/render/effects.ts","../src/render/stacking-context.ts","../src/render/border.ts","../src/render/box-sizing.ts","../src/render/background.ts","../src/render/font-metrics.ts","../src/core/util.ts","../src/render/canvas/canvas-renderer.ts","../src/render/canvas/foreignobject-renderer.ts"],"names":["color","colorType","angle","angleType","transform","tslib_1.__extends","loadSerializedSVG","parseColor"],"mappings":";;;AA+BA,IAAA,EAAA,EAAA,UAAA,IAAA,SAAA,EAAA,GAAA,iBAAA,SAAA,oBAAA,OAAA,OAAA,QAAA,IAAA,mBAAA,GAAA,EAAA,IAAA,EAAA,I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SAIpB,GAEf,EArDA,GA4DM,GAA8B,CAChC,SAAU,CAAC,IAAM,IAAK,IAAK,IAAK,IAAK,GAAI,GAAI,GAAI,GAAI,EAAG,EAAG,EAAG,GAC9D,OAAQ,CAAC,IAAK,KAAM,IAAK,KAAM,IAAK,KAAM,IAAK,KAAM,IAAK,KAAM,IAAK,KAAM,MAGzE,GAA2B,CAC7B,SAAU,CACN,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEJ,OAAQ,CACJ,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,MAIF,GAAyB,CAC3B,SAAU,CACN,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEJ,OAAQ,CACJ,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,MAIF,GAA2B,CAC7B,SAAU,CACN,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEJ,OAAQ,CACJ,IAC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AY,EAAc,gBACpB,GAAc,GACV,GAAc,GACV,EACA,EACJ,EACJ,EAEJ,EAAgB,CAClB,GAAI,EACJ,MAAO,EAAQ,MACf,OAAQ,EAAQ,OAChB,gBAAe,EACf,MAAO,EAAQ,MACf,EAAG,EAAQ,EACX,EAAG,EAAQ,EACX,QAAS,EAAQ,QACjB,QAAS,EAAQ,QACjB,MAAO,EAAQ,MACf,OAAQ,EAAQ,OAChB,YAAa,EAAQ,YACrB,aAAc,EAAQ,cAKtB,EAAQ,wBACR,GAAO,YAAY,GAAc,MAAM,mDAE9B,CAAA,EADQ,IAAI,GAAsB,GACnB,OAAO,KAH/B,CAAA,EAAA,GAxGR,KAAA,EAAA,OA2GQ,EAAS,EAAA,OA3GjB,CAAA,EAAA,GAAA,KAAA,EA2HiB,OAdT,GAAO,YAAY,GAAc,MAAM,6CAEvC,GAAa,eAAe,EAAQ,OACpC,GAAO,YAAY,GAAc,MAAM,wBACjC,EAAO,GAAU,GACvB,GAAa,iBAET,IAAoB,EAAK,OAAO,kBAChC,EAAK,OAAO,gBAAkB,GAAO,aAGzC,GAAO,YAAY,GAAc,MAAM,qBAG9B,CAAA,EADQ,IAAI,GAAe,GACZ,OAAO,IA3HvC,KAAA,EA2HQ,EAAS,EAAA,OA3HjB,EAAA,MAAA,EAAA,KAAA,EAuII,OATgC,IAA5B,EAAQ,kBACH,GAAe,QAAQ,IACxB,GAAO,YAAY,GAAc,MAAM,gEAI/C,GAAO,YAAY,GAAc,MAAM,sBACvC,GAAO,QAAQ,GACf,GAAa,QAAQ,GACrB,CAAA,EAAO,SAvIX,OAVoB,SAAC,EAAsB,GAChC,YADgC,IAAA,IAAA,EAAA,IAChC,GAAc,EAAS","file":"html2canvas.b8923d84.js","sourceRoot":"..\\src","sourcesContent":["import {Bounds, parseBounds, parseDocumentSize} from './css/layout/bounds';\nimport {color, Color, COLORS, isTransparent} from './css/types/color';\nimport {Parser} from './css/syntax/parser';\nimport {CloneOptions, DocumentCloner} from './dom/document-cloner';\nimport {isBodyElement, isHTMLElement, parseTree} from './dom/node-parser';\nimport {Logger} from './core/logger';\nimport {CacheStorage, ResourceOptions} from './core/cache-storage';\nimport {CanvasRenderer, RenderOptions} from './render/canvas/canvas-renderer';\nimport {ForeignObjectRenderer} from './render/canvas/foreignobject-renderer';\n\nexport type Options = CloneOptions &\n RenderOptions &\n ResourceOptions & {\n backgroundColor: string | null;\n foreignObjectRendering: boolean;\n logging: boolean;\n removeContainer?: boolean;\n };\n\nconst parseColor = (value: string): Color => color.parse(Parser.create(value).parseComponentValue());\n\nconst html2canvas = (element: HTMLElement, options: Partial<Options> = {}): Promise<HTMLCanvasElement> => {\n return renderElement(element, options);\n};\n\nexport default html2canvas;\n\nif (typeof window !== 'undefined') {\n CacheStorage.setContext(window);\n}\n\nconst renderElement = async (element: HTMLElement, opts: Partial<Options>): Promise<HTMLCanvasElement> => {\n const ownerDocument = element.ownerDocument;\n\n if (!ownerDocument) {\n throw new Error(`Element is not attached to a Document`);\n }\n\n const defaultView = ownerDocument.defaultView;\n\n if (!defaultView) {\n throw new Error(`Document is not attached to a Window`);\n }\n\n const instanceName = (Math.round(Math.random() * 1000) + Date.now()).toString(16);\n\n const {width, height, left, top} =\n isBodyElement(element) || isHTMLElement(element) ? parseDocumentSize(ownerDocument) : parseBounds(element);\n\n const defaultResourceOptions = {\n allowTaint: false,\n imageTimeout: 15000,\n proxy: undefined,\n useCORS: false\n };\n\n const resourceOptions: ResourceOptions = {...defaultResourceOptions, ...opts};\n\n const defaultOptions = {\n backgroundColor: '#ffffff',\n cache: opts.cache ? opts.cache : CacheStorage.create(instanceName, resourceOptions),\n logging: true,\n removeContainer: true,\n foreignObjectRendering: false,\n scale: defaultView.devicePixelRatio || 1,\n windowWidth: defaultView.innerWidth,\n windowHeight: defaultView.innerHeight,\n scrollX: defaultView.pageXOffset,\n scrollY: defaultView.pageYOffset,\n x: left,\n y: top,\n width: Math.ceil(width),\n height: Math.ceil(height),\n id: instanceName\n };\n\n const options: Options = {...defaultOptions, ...resourceOptions, ...opts};\n\n const windowBounds = new Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);\n\n Logger.create({id: instanceName, enabled: options.logging});\n Logger.getInstance(instanceName).debug(`Starting document clone`);\n const documentCloner = new DocumentCloner(element, {\n id: instanceName,\n onclone: options.onclone,\n ignoreElements: options.ignoreElements,\n inlineImages: options.foreignObjectRendering,\n copyStyles: options.foreignObjectRendering\n });\n const clonedElement = documentCloner.clonedReferenceElement;\n if (!clonedElement) {\n return Promise.reject(`Unable to find element in cloned iframe`);\n }\n\n const container = await documentCloner.toIFrame(ownerDocument, windowBounds);\n\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n const documentBackgroundColor = ownerDocument.documentElement\n ? parseColor(getComputedStyle(ownerDocument.documentElement).backgroundColor as string)\n : COLORS.TRANSPARENT;\n const bodyBackgroundColor = ownerDocument.body\n ? parseColor(getComputedStyle(ownerDocument.body).backgroundColor as string)\n : COLORS.TRANSPARENT;\n\n const bgColor = opts.backgroundColor;\n const defaultBackgroundColor =\n typeof bgColor === 'string' ? parseColor(bgColor) : bgColor === null ? COLORS.TRANSPARENT : 0xffffffff;\n\n const backgroundColor =\n element === ownerDocument.documentElement\n ? isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? defaultBackgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor\n : defaultBackgroundColor;\n\n const renderOptions = {\n id: instanceName,\n cache: options.cache,\n canvas: options.canvas,\n backgroundColor,\n scale: options.scale,\n x: options.x,\n y: options.y,\n scrollX: options.scrollX,\n scrollY: options.scrollY,\n width: options.width,\n height: options.height,\n windowWidth: options.windowWidth,\n windowHeight: options.windowHeight\n };\n\n let canvas;\n\n if (options.foreignObjectRendering) {\n Logger.getInstance(instanceName).debug(`Document cloned, using foreign object rendering`);\n const renderer = new ForeignObjectRenderer(renderOptions);\n canvas = await renderer.render(clonedElement);\n } else {\n Logger.getInstance(instanceName).debug(`Document cloned, using computed rendering`);\n\n CacheStorage.attachInstance(options.cache);\n Logger.getInstance(instanceName).debug(`Starting DOM parsing`);\n const root = parseTree(clonedElement);\n CacheStorage.detachInstance();\n\n if (backgroundColor === root.styles.backgroundColor) {\n root.styles.backgroundColor = COLORS.TRANSPARENT;\n }\n\n Logger.getInstance(instanceName).debug(`Starting renderer`);\n\n const renderer = new CanvasRenderer(renderOptions);\n canvas = await renderer.render(root);\n }\n\n if (options.removeContainer === true) {\n if (!DocumentCloner.destroy(container)) {\n Logger.getInstance(instanceName).error(`Cannot detach cloned iframe as it is not in the DOM anymore`);\n }\n }\n\n Logger.getInstance(instanceName).debug(`Finished rendering`);\n Logger.destroy(instanceName);\n CacheStorage.destroy(instanceName);\n return canvas;\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","export const toCodePoints = (str: string): number[] => {\n const codePoints = [];\n let i = 0;\n const length = str.length;\n while (i < length) {\n const value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n const extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n } else {\n codePoints.push(value);\n i--;\n }\n } else {\n codePoints.push(value);\n }\n }\n return codePoints;\n};\n\nexport const fromCodePoint = (...codePoints: number[]): string => {\n if (String.fromCodePoint) {\n return String.fromCodePoint(...codePoints);\n }\n\n const length = codePoints.length;\n if (!length) {\n return '';\n }\n\n const codeUnits = [];\n\n let index = -1;\n let result = '';\n while (++index < length) {\n let codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n } else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode(...codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n};\n\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","export class Bounds {\n readonly top: number;\n readonly left: number;\n readonly width: number;\n readonly height: number;\n\n constructor(x: number, y: number, w: number, h: number) {\n this.left = x;\n this.top = y;\n this.width = w;\n this.height = h;\n }\n\n add(x: number, y: number, w: number, h: number): Bounds {\n return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);\n }\n\n static fromClientRect(clientRect: ClientRect): Bounds {\n return new Bounds(clientRect.left, clientRect.top, clientRect.width, clientRect.height);\n }\n}\n\nexport const parseBounds = (node: Element): Bounds => {\n return Bounds.fromClientRect(node.getBoundingClientRect());\n};\n\nexport const parseDocumentSize = (document: Document): Bounds => {\n const body = document.body;\n const documentElement = document.documentElement;\n\n if (!body || !documentElement) {\n throw new Error(`Unable to get document size`);\n }\n const width = Math.max(\n Math.max(body.scrollWidth, documentElement.scrollWidth),\n Math.max(body.offsetWidth, documentElement.offsetWidth),\n Math.max(body.clientWidth, documentElement.clientWidth)\n );\n\n const height = Math.max(\n Math.max(body.scrollHeight, documentElement.scrollHeight),\n Math.max(body.offsetHeight, documentElement.offsetHeight),\n Math.max(body.clientHeight, documentElement.clientHeight)\n );\n\n return new Bounds(0, 0, width, height);\n};\n","// https://www.w3.org/TR/css-syntax-3\n\nimport {fromCodePoint, toCodePoints} from 'css-line-break';\n\nexport enum TokenType {\n STRING_TOKEN,\n BAD_STRING_TOKEN,\n LEFT_PARENTHESIS_TOKEN,\n RIGHT_PARENTHESIS_TOKEN,\n COMMA_TOKEN,\n HASH_TOKEN,\n DELIM_TOKEN,\n AT_KEYWORD_TOKEN,\n PREFIX_MATCH_TOKEN,\n DASH_MATCH_TOKEN,\n INCLUDE_MATCH_TOKEN,\n LEFT_CURLY_BRACKET_TOKEN,\n RIGHT_CURLY_BRACKET_TOKEN,\n SUFFIX_MATCH_TOKEN,\n SUBSTRING_MATCH_TOKEN,\n DIMENSION_TOKEN,\n PERCENTAGE_TOKEN,\n NUMBER_TOKEN,\n FUNCTION,\n FUNCTION_TOKEN,\n IDENT_TOKEN,\n COLUMN_TOKEN,\n URL_TOKEN,\n BAD_URL_TOKEN,\n CDC_TOKEN,\n CDO_TOKEN,\n COLON_TOKEN,\n SEMICOLON_TOKEN,\n LEFT_SQUARE_BRACKET_TOKEN,\n RIGHT_SQUARE_BRACKET_TOKEN,\n UNICODE_RANGE_TOKEN,\n WHITESPACE_TOKEN,\n EOF_TOKEN\n}\n\ninterface IToken {\n type: TokenType;\n}\n\nexport interface Token extends IToken {\n type:\n | TokenType.BAD_URL_TOKEN\n | TokenType.BAD_STRING_TOKEN\n | TokenType.LEFT_PARENTHESIS_TOKEN\n | TokenType.RIGHT_PARENTHESIS_TOKEN\n | TokenType.COMMA_TOKEN\n | TokenType.SUBSTRING_MATCH_TOKEN\n | TokenType.PREFIX_MATCH_TOKEN\n | TokenType.SUFFIX_MATCH_TOKEN\n | TokenType.COLON_TOKEN\n | TokenType.SEMICOLON_TOKEN\n | TokenType.LEFT_SQUARE_BRACKET_TOKEN\n | TokenType.RIGHT_SQUARE_BRACKET_TOKEN\n | TokenType.LEFT_CURLY_BRACKET_TOKEN\n | TokenType.RIGHT_CURLY_BRACKET_TOKEN\n | TokenType.DASH_MATCH_TOKEN\n | TokenType.INCLUDE_MATCH_TOKEN\n | TokenType.COLUMN_TOKEN\n | TokenType.WHITESPACE_TOKEN\n | TokenType.CDC_TOKEN\n | TokenType.CDO_TOKEN\n | TokenType.EOF_TOKEN;\n}\n\nexport interface StringValueToken extends IToken {\n type:\n | TokenType.STRING_TOKEN\n | TokenType.DELIM_TOKEN\n | TokenType.FUNCTION_TOKEN\n | TokenType.IDENT_TOKEN\n | TokenType.URL_TOKEN\n | TokenType.AT_KEYWORD_TOKEN;\n value: string;\n}\n\nexport interface HashToken extends IToken {\n type: TokenType.HASH_TOKEN;\n flags: number;\n value: string;\n}\n\nexport interface NumberValueToken extends IToken {\n type: TokenType.PERCENTAGE_TOKEN | TokenType.NUMBER_TOKEN;\n flags: number;\n number: number;\n}\n\nexport interface DimensionToken extends IToken {\n type: TokenType.DIMENSION_TOKEN;\n flags: number;\n unit: string;\n number: number;\n}\n\nexport interface UnicodeRangeToken extends IToken {\n type: TokenType.UNICODE_RANGE_TOKEN;\n start: number;\n end: number;\n}\n\nexport type CSSToken = Token | StringValueToken | NumberValueToken | DimensionToken | UnicodeRangeToken | HashToken;\n\nexport const FLAG_UNRESTRICTED = 1 << 0;\nexport const FLAG_ID = 1 << 1;\nexport const FLAG_INTEGER = 1 << 2;\nexport const FLAG_NUMBER = 1 << 3;\n\nconst LINE_FEED = 0x000a;\nconst SOLIDUS = 0x002f;\nconst REVERSE_SOLIDUS = 0x005c;\nconst CHARACTER_TABULATION = 0x0009;\nconst SPACE = 0x0020;\nconst QUOTATION_MARK = 0x0022;\nconst EQUALS_SIGN = 0x003d;\nconst NUMBER_SIGN = 0x0023;\nconst DOLLAR_SIGN = 0x0024;\nconst PERCENTAGE_SIGN = 0x0025;\nconst APOSTROPHE = 0x0027;\nconst LEFT_PARENTHESIS = 0x0028;\nconst RIGHT_PARENTHESIS = 0x0029;\nconst LOW_LINE = 0x005f;\nconst HYPHEN_MINUS = 0x002d;\nconst EXCLAMATION_MARK = 0x0021;\nconst LESS_THAN_SIGN = 0x003c;\nconst GREATER_THAN_SIGN = 0x003e;\nconst COMMERCIAL_AT = 0x0040;\nconst LEFT_SQUARE_BRACKET = 0x005b;\nconst RIGHT_SQUARE_BRACKET = 0x005d;\nconst CIRCUMFLEX_ACCENT = 0x003d;\nconst LEFT_CURLY_BRACKET = 0x007b;\nconst QUESTION_MARK = 0x003f;\nconst RIGHT_CURLY_BRACKET = 0x007d;\nconst VERTICAL_LINE = 0x007c;\nconst TILDE = 0x007e;\nconst CONTROL = 0x0080;\nconst REPLACEMENT_CHARACTER = 0xfffd;\nconst ASTERISK = 0x002a;\nconst PLUS_SIGN = 0x002b;\nconst COMMA = 0x002c;\nconst COLON = 0x003a;\nconst SEMICOLON = 0x003b;\nconst FULL_STOP = 0x002e;\nconst NULL = 0x0000;\nconst BACKSPACE = 0x0008;\nconst LINE_TABULATION = 0x000b;\nconst SHIFT_OUT = 0x000e;\nconst INFORMATION_SEPARATOR_ONE = 0x001f;\nconst DELETE = 0x007f;\nconst EOF = -1;\nconst ZERO = 0x0030;\nconst a = 0x0061;\nconst e = 0x0065;\nconst f = 0x0066;\nconst u = 0x0075;\nconst z = 0x007a;\nconst A = 0x0041;\nconst E = 0x0045;\nconst F = 0x0046;\nconst U = 0x0055;\nconst Z = 0x005a;\n\nconst isDigit = (codePoint: number) => codePoint >= ZERO && codePoint <= 0x0039;\nconst isSurrogateCodePoint = (codePoint: number) => codePoint >= 0xd800 && codePoint <= 0xdfff;\nconst isHex = (codePoint: number) =>\n isDigit(codePoint) || (codePoint >= A && codePoint <= F) || (codePoint >= a && codePoint <= f);\nconst isLowerCaseLetter = (codePoint: number) => codePoint >= a && codePoint <= z;\nconst isUpperCaseLetter = (codePoint: number) => codePoint >= A && codePoint <= Z;\nconst isLetter = (codePoint: number) => isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);\nconst isNonASCIICodePoint = (codePoint: number) => codePoint >= CONTROL;\nconst isWhiteSpace = (codePoint: number): boolean =>\n codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;\nconst isNameStartCodePoint = (codePoint: number): boolean =>\n isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;\nconst isNameCodePoint = (codePoint: number): boolean =>\n isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;\nconst isNonPrintableCodePoint = (codePoint: number): boolean => {\n return (\n (codePoint >= NULL && codePoint <= BACKSPACE) ||\n codePoint === LINE_TABULATION ||\n (codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE) ||\n codePoint === DELETE\n );\n};\nconst isValidEscape = (c1: number, c2: number): boolean => {\n if (c1 !== REVERSE_SOLIDUS) {\n return false;\n }\n\n return c2 !== LINE_FEED;\n};\nconst isIdentifierStart = (c1: number, c2: number, c3: number): boolean => {\n if (c1 === HYPHEN_MINUS) {\n return isNameStartCodePoint(c2) || isValidEscape(c2, c3);\n } else if (isNameStartCodePoint(c1)) {\n return true;\n } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {\n return true;\n }\n return false;\n};\n\nconst isNumberStart = (c1: number, c2: number, c3: number): boolean => {\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n if (isDigit(c2)) {\n return true;\n }\n\n return c2 === FULL_STOP && isDigit(c3);\n }\n\n if (c1 === FULL_STOP) {\n return isDigit(c2);\n }\n\n return isDigit(c1);\n};\n\nconst stringToNumber = (codePoints: number[]): number => {\n let c = 0;\n let sign = 1;\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n sign = -1;\n }\n c++;\n }\n\n const integers = [];\n\n while (isDigit(codePoints[c])) {\n integers.push(codePoints[c++]);\n }\n\n const int = integers.length ? parseInt(fromCodePoint(...integers), 10) : 0;\n\n if (codePoints[c] === FULL_STOP) {\n c++;\n }\n\n const fraction = [];\n while (isDigit(codePoints[c])) {\n fraction.push(codePoints[c++]);\n }\n\n const fracd = fraction.length;\n const frac = fracd ? parseInt(fromCodePoint(...fraction), 10) : 0;\n\n if (codePoints[c] === E || codePoints[c] === e) {\n c++;\n }\n\n let expsign = 1;\n\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n expsign = -1;\n }\n c++;\n }\n\n const exponent = [];\n\n while (isDigit(codePoints[c])) {\n exponent.push(codePoints[c++]);\n }\n\n const exp = exponent.length ? parseInt(fromCodePoint(...exponent), 10) : 0;\n\n return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);\n};\n\nconst LEFT_PARENTHESIS_TOKEN: Token = {\n type: TokenType.LEFT_PARENTHESIS_TOKEN\n};\nconst RIGHT_PARENTHESIS_TOKEN: Token = {\n type: TokenType.RIGHT_PARENTHESIS_TOKEN\n};\nconst COMMA_TOKEN: Token = {type: TokenType.COMMA_TOKEN};\nconst SUFFIX_MATCH_TOKEN: Token = {type: TokenType.SUFFIX_MATCH_TOKEN};\nconst PREFIX_MATCH_TOKEN: Token = {type: TokenType.PREFIX_MATCH_TOKEN};\nconst COLUMN_TOKEN: Token = {type: TokenType.COLUMN_TOKEN};\nconst DASH_MATCH_TOKEN: Token = {type: TokenType.DASH_MATCH_TOKEN};\nconst INCLUDE_MATCH_TOKEN: Token = {type: TokenType.INCLUDE_MATCH_TOKEN};\nconst LEFT_CURLY_BRACKET_TOKEN: Token = {\n type: TokenType.LEFT_CURLY_BRACKET_TOKEN\n};\nconst RIGHT_CURLY_BRACKET_TOKEN: Token = {\n type: TokenType.RIGHT_CURLY_BRACKET_TOKEN\n};\nconst SUBSTRING_MATCH_TOKEN: Token = {type: TokenType.SUBSTRING_MATCH_TOKEN};\nconst BAD_URL_TOKEN: Token = {type: TokenType.BAD_URL_TOKEN};\nconst BAD_STRING_TOKEN: Token = {type: TokenType.BAD_STRING_TOKEN};\nconst CDO_TOKEN: Token = {type: TokenType.CDO_TOKEN};\nconst CDC_TOKEN: Token = {type: TokenType.CDC_TOKEN};\nconst COLON_TOKEN: Token = {type: TokenType.COLON_TOKEN};\nconst SEMICOLON_TOKEN: Token = {type: TokenType.SEMICOLON_TOKEN};\nconst LEFT_SQUARE_BRACKET_TOKEN: Token = {\n type: TokenType.LEFT_SQUARE_BRACKET_TOKEN\n};\nconst RIGHT_SQUARE_BRACKET_TOKEN: Token = {\n type: TokenType.RIGHT_SQUARE_BRACKET_TOKEN\n};\nconst WHITESPACE_TOKEN: Token = {type: TokenType.WHITESPACE_TOKEN};\nexport const EOF_TOKEN: Token = {type: TokenType.EOF_TOKEN};\n\nexport class Tokenizer {\n private _value: number[];\n\n constructor() {\n this._value = [];\n }\n\n write(chunk: string) {\n this._value = this._value.concat(toCodePoints(chunk));\n }\n\n read(): CSSToken[] {\n const tokens = [];\n let token = this.consumeToken();\n while (token !== EOF_TOKEN) {\n tokens.push(token);\n token = this.consumeToken();\n }\n return tokens;\n }\n\n private consumeToken(): CSSToken {\n const codePoint = this.consumeCodePoint();\n\n switch (codePoint) {\n case QUOTATION_MARK:\n return this.consumeStringToken(QUOTATION_MARK);\n case NUMBER_SIGN:\n const c1 = this.peekCodePoint(0);\n const c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {\n const flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;\n const value = this.consumeName();\n\n return {type: TokenType.HASH_TOKEN, value, flags};\n }\n break;\n case DOLLAR_SIGN:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUFFIX_MATCH_TOKEN;\n }\n break;\n case APOSTROPHE:\n return this.consumeStringToken(APOSTROPHE);\n case LEFT_PARENTHESIS:\n return LEFT_PARENTHESIS_TOKEN;\n case RIGHT_PARENTHESIS:\n return RIGHT_PARENTHESIS_TOKEN;\n case ASTERISK:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUBSTRING_MATCH_TOKEN;\n }\n break;\n case PLUS_SIGN:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case COMMA:\n return COMMA_TOKEN;\n case HYPHEN_MINUS:\n const e1 = codePoint;\n const e2 = this.peekCodePoint(0);\n const e3 = this.peekCodePoint(1);\n\n if (isNumberStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n\n if (isIdentifierStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n\n if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDC_TOKEN;\n }\n break;\n\n case FULL_STOP:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case SOLIDUS:\n if (this.peekCodePoint(0) === ASTERISK) {\n this.consumeCodePoint();\n while (true) {\n let c = this.consumeCodePoint();\n if (c === ASTERISK) {\n c = this.consumeCodePoint();\n if (c === SOLIDUS) {\n return this.consumeToken();\n }\n }\n if (c === EOF) {\n return this.consumeToken();\n }\n }\n }\n break;\n case COLON:\n return COLON_TOKEN;\n case SEMICOLON:\n return SEMICOLON_TOKEN;\n case LESS_THAN_SIGN:\n if (\n this.peekCodePoint(0) === EXCLAMATION_MARK &&\n this.peekCodePoint(1) === HYPHEN_MINUS &&\n this.peekCodePoint(2) === HYPHEN_MINUS\n ) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDO_TOKEN;\n }\n break;\n case COMMERCIAL_AT:\n const a1 = this.peekCodePoint(0);\n const a2 = this.peekCodePoint(1);\n const a3 = this.peekCodePoint(2);\n if (isIdentifierStart(a1, a2, a3)) {\n const value = this.consumeName();\n return {type: TokenType.AT_KEYWORD_TOKEN, value};\n }\n break;\n case LEFT_SQUARE_BRACKET:\n return LEFT_SQUARE_BRACKET_TOKEN;\n case REVERSE_SOLIDUS:\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n break;\n case RIGHT_SQUARE_BRACKET:\n return RIGHT_SQUARE_BRACKET_TOKEN;\n case CIRCUMFLEX_ACCENT:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return PREFIX_MATCH_TOKEN;\n }\n break;\n case LEFT_CURLY_BRACKET:\n return LEFT_CURLY_BRACKET_TOKEN;\n case RIGHT_CURLY_BRACKET:\n return RIGHT_CURLY_BRACKET_TOKEN;\n case u:\n case U:\n const u1 = this.peekCodePoint(0);\n const u2 = this.peekCodePoint(1);\n if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {\n this.consumeCodePoint();\n this.consumeUnicodeRangeToken();\n }\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n case VERTICAL_LINE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return DASH_MATCH_TOKEN;\n }\n if (this.peekCodePoint(0) === VERTICAL_LINE) {\n this.consumeCodePoint();\n return COLUMN_TOKEN;\n }\n break;\n case TILDE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return INCLUDE_MATCH_TOKEN;\n }\n break;\n case EOF:\n return EOF_TOKEN;\n }\n\n if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n return WHITESPACE_TOKEN;\n }\n\n if (isDigit(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n\n if (isNameStartCodePoint(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n\n return {type: TokenType.DELIM_TOKEN, value: fromCodePoint(codePoint)};\n }\n\n private consumeCodePoint(): number {\n const value = this._value.shift();\n\n return typeof value === 'undefined' ? -1 : value;\n }\n\n private reconsumeCodePoint(codePoint: number) {\n this._value.unshift(codePoint);\n }\n\n private peekCodePoint(delta: number): number {\n if (delta >= this._value.length) {\n return -1;\n }\n\n return this._value[delta];\n }\n\n private consumeUnicodeRangeToken(): UnicodeRangeToken {\n const digits = [];\n let codePoint = this.consumeCodePoint();\n while (isHex(codePoint) && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n let questionMarks = false;\n while (codePoint === QUESTION_MARK && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n questionMarks = true;\n }\n\n if (questionMarks) {\n const start = parseInt(fromCodePoint(...digits.map(digit => (digit === QUESTION_MARK ? ZERO : digit))), 16);\n const end = parseInt(fromCodePoint(...digits.map(digit => (digit === QUESTION_MARK ? F : digit))), 16);\n return {type: TokenType.UNICODE_RANGE_TOKEN, start, end};\n }\n\n const start = parseInt(fromCodePoint(...digits), 16);\n if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {\n this.consumeCodePoint();\n codePoint = this.consumeCodePoint();\n const endDigits = [];\n while (isHex(codePoint) && endDigits.length < 6) {\n endDigits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n const end = parseInt(fromCodePoint(...endDigits), 16);\n\n return {type: TokenType.UNICODE_RANGE_TOKEN, start, end};\n } else {\n return {type: TokenType.UNICODE_RANGE_TOKEN, start, end: start};\n }\n }\n\n private consumeIdentLikeToken(): StringValueToken | Token {\n const value = this.consumeName();\n if (value.toLowerCase() === 'url' && this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return this.consumeUrlToken();\n } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return {type: TokenType.FUNCTION_TOKEN, value};\n }\n\n return {type: TokenType.IDENT_TOKEN, value};\n }\n\n private consumeUrlToken(): StringValueToken | Token {\n const value = [];\n this.consumeWhiteSpace();\n\n if (this.peekCodePoint(0) === EOF) {\n return {type: TokenType.URL_TOKEN, value: ''};\n }\n\n const next = this.peekCodePoint(0);\n if (next === APOSTROPHE || next === QUOTATION_MARK) {\n const stringToken = this.consumeStringToken(this.consumeCodePoint());\n if (stringToken.type === TokenType.STRING_TOKEN) {\n this.consumeWhiteSpace();\n\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return {type: TokenType.URL_TOKEN, value: stringToken.value};\n }\n }\n\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {\n return {type: TokenType.URL_TOKEN, value: fromCodePoint(...value)};\n } else if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return {type: TokenType.URL_TOKEN, value: fromCodePoint(...value)};\n }\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n } else if (\n codePoint === QUOTATION_MARK ||\n codePoint === APOSTROPHE ||\n codePoint === LEFT_PARENTHESIS ||\n isNonPrintableCodePoint(codePoint)\n ) {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n } else if (codePoint === REVERSE_SOLIDUS) {\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n value.push(this.consumeEscapedCodePoint());\n } else {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n } else {\n value.push(codePoint);\n }\n }\n }\n\n private consumeWhiteSpace(): void {\n while (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n }\n\n private consumeBadUrlRemnants(): void {\n while (true) {\n let codePoint = this.consumeCodePoint();\n if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {\n return;\n }\n\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.consumeEscapedCodePoint();\n }\n }\n }\n\n private consumeStringSlice(count: number): string {\n const SLICE_STACK_SIZE = 60000;\n let value = '';\n while (count > 0) {\n const amount = Math.min(SLICE_STACK_SIZE, count);\n value += fromCodePoint(...this._value.splice(0, amount));\n count -= amount;\n }\n this._value.shift();\n\n return value;\n }\n\n private consumeStringToken(endingCodePoint: number): StringValueToken | Token {\n let value = '';\n let i = 0;\n\n do {\n const codePoint = this._value[i];\n if (codePoint === EOF || codePoint === undefined || codePoint === endingCodePoint) {\n value += this.consumeStringSlice(i);\n return {type: TokenType.STRING_TOKEN, value};\n }\n\n if (codePoint === LINE_FEED) {\n this._value.splice(0, i);\n return BAD_STRING_TOKEN;\n }\n\n if (codePoint === REVERSE_SOLIDUS) {\n const next = this._value[i + 1];\n if (next !== EOF && next !== undefined) {\n if (next === LINE_FEED) {\n value += this.consumeStringSlice(i);\n i = -1;\n this._value.shift();\n } else if (isValidEscape(codePoint, next)) {\n value += this.consumeStringSlice(i);\n value += fromCodePoint(this.consumeEscapedCodePoint());\n i = -1;\n }\n }\n }\n\n i++;\n } while (true);\n }\n\n private consumeNumber() {\n let repr = [];\n let type = FLAG_INTEGER;\n let c1 = this.peekCodePoint(0);\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n repr.push(this.consumeCodePoint());\n }\n\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n c1 = this.peekCodePoint(0);\n let c2 = this.peekCodePoint(1);\n if (c1 === FULL_STOP && isDigit(c2)) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n\n c1 = this.peekCodePoint(0);\n c2 = this.peekCodePoint(1);\n let c3 = this.peekCodePoint(2);\n if ((c1 === E || c1 === e) && (((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3)) || isDigit(c2))) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n\n return [stringToNumber(repr), type];\n }\n\n private consumeNumericToken(): NumberValueToken | DimensionToken {\n const [number, flags] = this.consumeNumber();\n const c1 = this.peekCodePoint(0);\n const c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n\n if (isIdentifierStart(c1, c2, c3)) {\n let unit = this.consumeName();\n return {type: TokenType.DIMENSION_TOKEN, number, flags, unit};\n }\n\n if (c1 === PERCENTAGE_SIGN) {\n this.consumeCodePoint();\n return {type: TokenType.PERCENTAGE_TOKEN, number, flags};\n }\n\n return {type: TokenType.NUMBER_TOKEN, number, flags};\n }\n\n private consumeEscapedCodePoint(): number {\n const codePoint = this.consumeCodePoint();\n\n if (isHex(codePoint)) {\n let hex = fromCodePoint(codePoint);\n while (isHex(this.peekCodePoint(0)) && hex.length < 6) {\n hex += fromCodePoint(this.consumeCodePoint());\n }\n\n if (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n\n const hexCodePoint = parseInt(hex, 16);\n\n if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 0x10ffff) {\n return REPLACEMENT_CHARACTER;\n }\n\n return hexCodePoint;\n }\n\n if (codePoint === EOF) {\n return REPLACEMENT_CHARACTER;\n }\n\n return codePoint;\n }\n\n private consumeName(): string {\n let result = '';\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (isNameCodePoint(codePoint)) {\n result += fromCodePoint(codePoint);\n } else if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n result += fromCodePoint(this.consumeEscapedCodePoint());\n } else {\n this.reconsumeCodePoint(codePoint);\n return result;\n }\n }\n }\n}\n","import {decode, polyUint16Array, polyUint32Array} from './Util';\n\nexport type int = number;\n\n/** Shift size for getting the index-2 table offset. */\nexport const UTRIE2_SHIFT_2 = 5;\n\n/** Shift size for getting the index-1 table offset. */\nexport const UTRIE2_SHIFT_1 = 6 + 5;\n\n/**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\nexport const UTRIE2_INDEX_SHIFT = 2;\n\n/**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\nexport const UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\n\n/**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\nexport const UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\n\n/** Number of entries in a data block. 32=0x20 */\nexport const UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\n/** Mask for getting the lower bits for the in-data-block offset. */\nexport const UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\n\nexport const UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\n/** Count the lengths of both BMP pieces. 2080=0x820 */\nexport const UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\n/**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\nexport const UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\nexport const UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n/**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\nexport const UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\n\n/**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\nexport const UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\n\n/** Number of entries in an index-2 block. 64=0x40 */\nexport const UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\n/** Mask for getting the lower bits for the in-index-2-block offset. */\nexport const UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\n\nconst slice16 = (view: number[] | Uint16Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint16Array(Array.prototype.slice.call(view, start, end))\n};\n\nconst slice32 = (view: number[] | Uint32Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n};\n\nexport const createTrieFromBase64 = (base64: string): Trie => {\n const buffer = decode(base64);\n const view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\n const view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\n const headerLength = 24;\n\n const index = slice16(view16, headerLength / 2, view32[4] / 2);\n const data =\n view32[5] === 2\n ? slice16(view16, (headerLength + view32[4]) / 2)\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\n\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\n};\n\nexport class Trie {\n initialValue: int;\n errorValue: int;\n highStart: int;\n highValueIndex: int;\n index: Uint16Array | number[];\n data: Uint32Array | Uint16Array | number[];\n\n constructor(\n initialValue: int,\n errorValue: int,\n highStart: int,\n highValueIndex: int,\n index: Uint16Array | number[],\n data: Uint32Array | Uint16Array | number[]\n ) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n get(codePoint: number): number {\n let ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n }\n}\n","/* @flow */\n'use strict';\n\nimport {createTrieFromBase64} from './Trie';\nimport {base64} from './linebreak-trie';\nimport {fromCodePoint, toCodePoints} from './Util';\n\nexport const LETTER_NUMBER_MODIFIER = 50;\n\n// Non-tailorable Line Breaking Classes\nconst BK = 1; // Cause a line break (after)\nconst CR = 2; // Cause a line break (after), except between CR and LF\nconst LF = 3; // Cause a line break (after)\nconst CM = 4; // Prohibit a line break between the character and the preceding character\nconst NL = 5; // Cause a line break (after)\nconst SG = 6; // Do not occur in well-formed text\nconst WJ = 7; // Prohibit line breaks before and after\nconst ZW = 8; // Provide a break opportunity\nconst GL = 9; // Prohibit line breaks before and after\nconst SP = 10; // Enable indirect line breaks\nconst ZWJ = 11; // Prohibit line breaks within joiner sequences\n// Break Opportunities\nconst B2 = 12; // Provide a line break opportunity before and after the character\nconst BA = 13; // Generally provide a line break opportunity after the character\nconst BB = 14; // Generally provide a line break opportunity before the character\nconst HY = 15; // Provide a line break opportunity after the character, except in numeric context\nconst CB = 16; // Provide a line break opportunity contingent on additional information\n// Characters Prohibiting Certain Breaks\nconst CL = 17; // Prohibit line breaks before\nconst CP = 18; // Prohibit line breaks before\nconst EX = 19; // Prohibit line breaks before\nconst IN = 20; // Allow only indirect line breaks between pairs\nconst NS = 21; // Allow only indirect line breaks before\nconst OP = 22; // Prohibit line breaks after\nconst QU = 23; // Act like they are both opening and closing\n// Numeric Context\nconst IS = 24; // Prevent breaks after any and before numeric\nconst NU = 25; // Form numeric expressions for line breaking purposes\nconst PO = 26; // Do not break following a numeric expression\nconst PR = 27; // Do not break in front of a numeric expression\nconst SY = 28; // Prevent a break before; and allow a break after\n// Other Characters\nconst AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID\nconst AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters\nconst CJ = 31; // Treat as NS or ID for strict or normal breaking.\nconst EB = 32; // Do not break from following Emoji Modifier\nconst EM = 33; // Do not break from preceding Emoji Base\nconst H2 = 34; // Form Korean syllable blocks\nconst H3 = 35; // Form Korean syllable blocks\nconst HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic\nconst ID = 37; // Break before or after; except in some numeric context\nconst JL = 38; // Form Korean syllable blocks\nconst JV = 39; // Form Korean syllable blocks\nconst JT = 40; // Form Korean syllable blocks\nconst RI = 41; // Keep pairs together. For pairs; break before and after other classes\nconst SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis\nconst XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions\n\nexport const classes: {[key: string]: number} = {\n BK,\n CR,\n LF,\n CM,\n NL,\n SG,\n WJ,\n ZW,\n GL,\n SP,\n ZWJ,\n B2,\n BA,\n BB,\n HY,\n CB,\n CL,\n CP,\n EX,\n IN,\n NS,\n OP,\n QU,\n IS,\n NU,\n PO,\n PR,\n SY,\n AI,\n AL,\n CJ,\n EB,\n EM,\n H2,\n H3,\n HL,\n ID,\n JL,\n JV,\n JT,\n RI,\n SA,\n XX,\n};\n\nexport const BREAK_MANDATORY = '!';\nexport const BREAK_NOT_ALLOWED = '×';\nexport const BREAK_ALLOWED = '÷';\nexport const UnicodeTrie = createTrieFromBase64(base64);\n\nconst ALPHABETICS = [AL, HL];\nconst HARD_LINE_BREAKS = [BK, CR, LF, NL];\nconst SPACE = [SP, ZW];\nconst PREFIX_POSTFIX = [PR, PO];\nconst LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);\nconst KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];\nconst HYPHEN = [HY, BA];\n\nexport const codePointsToCharacterClasses = (\n codePoints: number[],\n lineBreak: string = 'strict'\n): [number[], number[], boolean[]] => {\n const types: number[] = [];\n const indicies: number[] = [];\n const categories: boolean[] = [];\n codePoints.forEach((codePoint, index) => {\n let classType = UnicodeTrie.get(codePoint);\n if (classType > LETTER_NUMBER_MODIFIER) {\n categories.push(true);\n classType -= LETTER_NUMBER_MODIFIER;\n } else {\n categories.push(false);\n }\n\n if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {\n // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0\n if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {\n indicies.push(index);\n return types.push(CB);\n }\n }\n\n if (classType === CM || classType === ZWJ) {\n // LB10 Treat any remaining combining mark or ZWJ as AL.\n if (index === 0) {\n indicies.push(index);\n return types.push(AL);\n }\n\n // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of\n // the base character in all of the following rules. Treat ZWJ as if it were CM.\n const prev = types[index - 1];\n if (LINE_BREAKS.indexOf(prev) === -1) {\n indicies.push(indicies[index - 1]);\n return types.push(prev);\n }\n indicies.push(index);\n return types.push(AL);\n }\n\n indicies.push(index);\n\n if (classType === CJ) {\n return types.push(lineBreak === 'strict' ? NS : ID);\n }\n\n if (classType === SA) {\n return types.push(AL);\n }\n\n if (classType === AI) {\n return types.push(AL);\n }\n\n // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL\n // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised\n // to take into account the actual line breaking properties for these characters.\n if (classType === XX) {\n if ((codePoint >= 0x20000 && codePoint <= 0x2fffd) || (codePoint >= 0x30000 && codePoint <= 0x3fffd)) {\n return types.push(ID);\n } else {\n return types.push(AL);\n }\n }\n\n types.push(classType);\n });\n\n return [indicies, types, categories];\n};\n\nconst isAdjacentWithSpaceIgnored = (\n a: number[] | number,\n b: number,\n currentIndex: number,\n classTypes: number[]\n): boolean => {\n const current = classTypes[currentIndex];\n if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {\n let i = currentIndex;\n while (i <= classTypes.length) {\n i++;\n let next = classTypes[i];\n\n if (next === b) {\n return true;\n }\n\n if (next !== SP) {\n break;\n }\n }\n }\n\n if (current === SP) {\n let i = currentIndex;\n\n while (i > 0) {\n i--;\n const prev = classTypes[i];\n\n if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {\n let n = currentIndex;\n while (n <= classTypes.length) {\n n++;\n let next = classTypes[n];\n\n if (next === b) {\n return true;\n }\n\n if (next !== SP) {\n break;\n }\n }\n }\n\n if (prev !== SP) {\n break;\n }\n }\n }\n return false;\n};\n\nconst previousNonSpaceClassType = (currentIndex: number, classTypes: number[]): number => {\n let i = currentIndex;\n while (i >= 0) {\n let type = classTypes[i];\n if (type === SP) {\n i--;\n } else {\n return type;\n }\n }\n return 0;\n};\n\nconst _lineBreakAtIndex = (\n codePoints: number[],\n classTypes: number[],\n indicies: number[],\n index: number,\n forbiddenBreaks?: boolean[]\n) => {\n if (indicies[index] === 0) {\n return BREAK_NOT_ALLOWED;\n }\n\n let currentIndex = index - 1;\n if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {\n return BREAK_NOT_ALLOWED;\n }\n\n let beforeIndex = currentIndex - 1;\n let afterIndex = currentIndex + 1;\n let current = classTypes[currentIndex];\n\n // LB4 Always break after hard line breaks.\n // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.\n let before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;\n let next = classTypes[afterIndex];\n\n if (current === CR && next === LF) {\n return BREAK_NOT_ALLOWED;\n }\n\n if (HARD_LINE_BREAKS.indexOf(current) !== -1) {\n return BREAK_MANDATORY;\n }\n\n // LB6 Do not break before hard line breaks.\n if (HARD_LINE_BREAKS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB7 Do not break before spaces or zero width space.\n if (SPACE.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.\n if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {\n return BREAK_ALLOWED;\n }\n\n // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.\n if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB11 Do not break before or after Word joiner and related characters.\n if (current === WJ || next === WJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB12 Do not break after NBSP and related characters.\n if (current === GL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.\n if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.\n if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB14 Do not break after ‘[’, even after spaces.\n if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB15 Do not break within ‘”[’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.\n if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB17 Do not break within ‘——’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB18 Break after spaces.\n if (current === SP) {\n return BREAK_ALLOWED;\n }\n\n // LB19 Do not break before or after quotation marks, such as ‘ ” ’.\n if (current === QU || next === QU) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB20 Break before and after unresolved CB.\n if (next === CB || current === CB) {\n return BREAK_ALLOWED;\n }\n\n // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.\n if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB21a Don't break after Hebrew + Hyphen.\n if (before === HL && HYPHEN.indexOf(current) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB21b Don’t break between Solidus and Hebrew letters.\n if (current === SY && next === HL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.\n if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB23 Do not break between digits and letters.\n if ((ALPHABETICS.indexOf(next) !== -1 && current === NU) || (ALPHABETICS.indexOf(current) !== -1 && next === NU)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.\n if (\n (current === PR && [ID, EB, EM].indexOf(next) !== -1) ||\n ([ID, EB, EM].indexOf(current) !== -1 && next === PO)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.\n if (\n (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1) ||\n (PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB25 Do not break between the following pairs of classes relevant to numbers:\n if (\n // (PR | PO) × ( OP | HY )? NU\n ([PR, PO].indexOf(current) !== -1 &&\n (next === NU || ([OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU))) ||\n // ( OP | HY ) × NU\n ([OP, HY].indexOf(current) !== -1 && next === NU) ||\n // NU ×\t(NU | SY | IS)\n (current === NU && [NU, SY, IS].indexOf(next) !== -1)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)\n if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {\n let prevIndex = currentIndex;\n while (prevIndex >= 0) {\n let type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED;\n } else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n } else {\n break;\n }\n }\n }\n\n // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))\n if ([PR, PO].indexOf(next) !== -1) {\n let prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;\n while (prevIndex >= 0) {\n let type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED;\n } else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n } else {\n break;\n }\n }\n }\n\n // LB26 Do not break a Korean syllable.\n if (\n (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1) ||\n ([JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1) ||\n ([JT, H3].indexOf(current) !== -1 && next === JT)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB27 Treat a Korean Syllable Block the same as ID.\n if (\n (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1) ||\n (KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB28 Do not break between alphabetics (“at”).\n if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).\n if (current === IS && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.\n if (\n (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP) ||\n (ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB30a Break between two regional indicator symbols if and only if there are an even number of regional\n // indicators preceding the position of the break.\n if (current === RI && next === RI) {\n let i = indicies[currentIndex];\n let count = 1;\n while (i > 0) {\n i--;\n if (classTypes[i] === RI) {\n count++;\n } else {\n break;\n }\n }\n if (count % 2 !== 0) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n // LB30b Do not break between an emoji base and an emoji modifier.\n if (current === EB && next === EM) {\n return BREAK_NOT_ALLOWED;\n }\n\n return BREAK_ALLOWED;\n};\n\nexport const lineBreakAtIndex = (codePoints: number[], index: number) => {\n // LB2 Never break at the start of text.\n if (index === 0) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB3 Always break at the end of text.\n if (index >= codePoints.length) {\n return BREAK_MANDATORY;\n }\n\n const [indicies, classTypes] = codePointsToCharacterClasses(codePoints);\n\n return _lineBreakAtIndex(codePoints, classTypes, indicies, index);\n};\n\nexport type LINE_BREAK = 'auto' | 'normal' | 'strict';\nexport type WORD_BREAK = 'normal' | 'break-all' | 'break-word' | 'keep-all';\n\ninterface IOptions {\n lineBreak?: LINE_BREAK;\n wordBreak?: WORD_BREAK;\n}\n\nconst cssFormattedClasses = (\n codePoints: number[],\n options?: IOptions\n): [number[], number[], boolean[] | undefined] => {\n if (!options) {\n options = {lineBreak: 'normal', wordBreak: 'normal'};\n }\n let [indicies, classTypes, isLetterNumber] = codePointsToCharacterClasses(codePoints, options.lineBreak);\n\n if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {\n classTypes = classTypes.map(type => ([NU, AL, SA].indexOf(type) !== -1 ? ID : type));\n }\n\n const forbiddenBreakpoints =\n options.wordBreak === 'keep-all'\n ? isLetterNumber.map((letterNumber, i) => {\n return letterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;\n })\n : undefined;\n\n return [indicies, classTypes, forbiddenBreakpoints];\n};\n\nexport const inlineBreakOpportunities = (str: string, options?: IOptions): string => {\n const codePoints = toCodePoints(str);\n let output = BREAK_NOT_ALLOWED;\n const [indicies, classTypes, forbiddenBreakpoints] = cssFormattedClasses(codePoints, options);\n\n codePoints.forEach((codePoint, i) => {\n output +=\n fromCodePoint(codePoint) +\n (i >= codePoints.length - 1\n ? BREAK_MANDATORY\n : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));\n });\n\n return output;\n};\n\nclass Break {\n private readonly codePoints: number[];\n readonly required: boolean;\n readonly start: number;\n readonly end: number;\n\n constructor(codePoints: number[], lineBreak: string, start: number, end: number) {\n this.codePoints = codePoints;\n this.required = lineBreak === BREAK_MANDATORY;\n this.start = start;\n this.end = end;\n }\n\n slice(): string {\n return fromCodePoint(...this.codePoints.slice(this.start, this.end));\n }\n}\n\nexport type LineBreak =\n | {\n done: true;\n value: null;\n }\n | {\n done: false;\n value: Break;\n };\n\ninterface ILineBreakIterator {\n next: () => LineBreak;\n}\n\nexport const LineBreaker = (str: string, options?: IOptions): ILineBreakIterator => {\n const codePoints = toCodePoints(str);\n const [indicies, classTypes, forbiddenBreakpoints] = cssFormattedClasses(codePoints, options);\n const length = codePoints.length;\n let lastEnd = 0;\n let nextIndex = 0;\n\n return {\n next: () => {\n if (nextIndex >= length) {\n return {done: true, value: null};\n }\n let lineBreak = BREAK_NOT_ALLOWED;\n while (\n nextIndex < length &&\n (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===\n BREAK_NOT_ALLOWED\n ) {}\n\n if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {\n const value = new Break(codePoints, lineBreak, lastEnd, nextIndex);\n lastEnd = nextIndex;\n return {value, done: false};\n }\n\n return {done: true, value: null};\n },\n };\n};\n","export const base64 =\n 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5w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/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc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AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB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AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAC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HgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACA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eAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA';\n","import {\n CSSToken,\n DimensionToken,\n EOF_TOKEN,\n NumberValueToken,\n StringValueToken,\n Tokenizer,\n TokenType\n} from './tokenizer';\n\nexport type CSSBlockType =\n | TokenType.LEFT_PARENTHESIS_TOKEN\n | TokenType.LEFT_SQUARE_BRACKET_TOKEN\n | TokenType.LEFT_CURLY_BRACKET_TOKEN;\n\nexport interface CSSBlock {\n type: CSSBlockType;\n values: CSSValue[];\n}\n\nexport interface CSSFunction {\n type: TokenType.FUNCTION;\n name: string;\n values: CSSValue[];\n}\n\nexport type CSSValue = CSSFunction | CSSToken | CSSBlock;\n\nexport class Parser {\n private _tokens: CSSToken[];\n\n constructor(tokens: CSSToken[]) {\n this._tokens = tokens;\n }\n\n static create(value: string): Parser {\n const tokenizer = new Tokenizer();\n tokenizer.write(value);\n return new Parser(tokenizer.read());\n }\n\n static parseValue(value: string): CSSValue {\n return Parser.create(value).parseComponentValue();\n }\n\n static parseValues(value: string): CSSValue[] {\n return Parser.create(value).parseComponentValues();\n }\n\n parseComponentValue(): CSSValue {\n let token = this.consumeToken();\n while (token.type === TokenType.WHITESPACE_TOKEN) {\n token = this.consumeToken();\n }\n\n if (token.type === TokenType.EOF_TOKEN) {\n throw new SyntaxError(`Error parsing CSS component value, unexpected EOF`);\n }\n\n this.reconsumeToken(token);\n const value = this.consumeComponentValue();\n\n do {\n token = this.consumeToken();\n } while (token.type === TokenType.WHITESPACE_TOKEN);\n\n if (token.type === TokenType.EOF_TOKEN) {\n return value;\n }\n\n throw new SyntaxError(`Error parsing CSS component value, multiple values found when expecting only one`);\n }\n\n parseComponentValues(): CSSValue[] {\n const values = [];\n while (true) {\n let value = this.consumeComponentValue();\n if (value.type === TokenType.EOF_TOKEN) {\n return values;\n }\n values.push(value);\n values.push();\n }\n }\n\n private consumeComponentValue(): CSSValue {\n const token = this.consumeToken();\n\n switch (token.type) {\n case TokenType.LEFT_CURLY_BRACKET_TOKEN:\n case TokenType.LEFT_SQUARE_BRACKET_TOKEN:\n case TokenType.LEFT_PARENTHESIS_TOKEN:\n return this.consumeSimpleBlock(token.type);\n case TokenType.FUNCTION_TOKEN:\n return this.consumeFunction(token);\n }\n\n return token;\n }\n\n private consumeSimpleBlock(type: CSSBlockType): CSSBlock {\n const block: CSSBlock = {type, values: []};\n\n let token = this.consumeToken();\n while (true) {\n if (token.type === TokenType.EOF_TOKEN || isEndingTokenFor(token, type)) {\n return block;\n }\n\n this.reconsumeToken(token);\n block.values.push(this.consumeComponentValue());\n token = this.consumeToken();\n }\n }\n\n private consumeFunction(functionToken: StringValueToken): CSSFunction {\n const cssFunction: CSSFunction = {\n name: functionToken.value,\n values: [],\n type: TokenType.FUNCTION\n };\n\n while (true) {\n const token = this.consumeToken();\n if (token.type === TokenType.EOF_TOKEN || token.type === TokenType.RIGHT_PARENTHESIS_TOKEN) {\n return cssFunction;\n }\n\n this.reconsumeToken(token);\n cssFunction.values.push(this.consumeComponentValue());\n }\n }\n\n private consumeToken(): CSSToken {\n const token = this._tokens.shift();\n return typeof token === 'undefined' ? EOF_TOKEN : token;\n }\n\n private reconsumeToken(token: CSSToken): void {\n this._tokens.unshift(token);\n }\n}\n\nexport const isDimensionToken = (token: CSSValue): token is DimensionToken => token.type === TokenType.DIMENSION_TOKEN;\nexport const isNumberToken = (token: CSSValue): token is NumberValueToken => token.type === TokenType.NUMBER_TOKEN;\nexport const isIdentToken = (token: CSSValue): token is StringValueToken => token.type === TokenType.IDENT_TOKEN;\nexport const isStringToken = (token: CSSValue): token is StringValueToken => token.type === TokenType.STRING_TOKEN;\nexport const isIdentWithValue = (token: CSSValue, value: string): boolean =>\n isIdentToken(token) && token.value === value;\n\nexport const nonWhiteSpace = (token: CSSValue) => token.type !== TokenType.WHITESPACE_TOKEN;\nexport const nonFunctionArgSeparator = (token: CSSValue) =>\n token.type !== TokenType.WHITESPACE_TOKEN && token.type !== TokenType.COMMA_TOKEN;\n\nexport const parseFunctionArgs = (tokens: CSSValue[]): CSSValue[][] => {\n const args: CSSValue[][] = [];\n let arg: CSSValue[] = [];\n tokens.forEach(token => {\n if (token.type === TokenType.COMMA_TOKEN) {\n if (arg.length === 0) {\n throw new Error(`Error parsing function args, zero tokens for arg`);\n }\n args.push(arg);\n arg = [];\n return;\n }\n\n if (token.type !== TokenType.WHITESPACE_TOKEN) {\n arg.push(token);\n }\n });\n if (arg.length) {\n args.push(arg);\n }\n\n return args;\n};\n\nconst isEndingTokenFor = (token: CSSToken, type: CSSBlockType): boolean => {\n if (type === TokenType.LEFT_CURLY_BRACKET_TOKEN && token.type === TokenType.RIGHT_CURLY_BRACKET_TOKEN) {\n return true;\n }\n if (type === TokenType.LEFT_SQUARE_BRACKET_TOKEN && token.type === TokenType.RIGHT_SQUARE_BRACKET_TOKEN) {\n return true;\n }\n\n return type === TokenType.LEFT_PARENTHESIS_TOKEN && token.type === TokenType.RIGHT_PARENTHESIS_TOKEN;\n};\n","import {CSSValue} from '../syntax/parser';\nimport {DimensionToken, NumberValueToken, TokenType} from '../syntax/tokenizer';\n\nexport type Length = DimensionToken | NumberValueToken;\n\nexport const isLength = (token: CSSValue): token is Length =>\n token.type === TokenType.NUMBER_TOKEN || token.type === TokenType.DIMENSION_TOKEN;\n","import {DimensionToken, FLAG_INTEGER, NumberValueToken, TokenType} from '../syntax/tokenizer';\nimport {CSSValue, isDimensionToken} from '../syntax/parser';\nimport {isLength} from './length';\nexport type LengthPercentage = DimensionToken | NumberValueToken;\nexport type LengthPercentageTuple = [LengthPercentage] | [LengthPercentage, LengthPercentage];\n\nexport const isLengthPercentage = (token: CSSValue): token is LengthPercentage =>\n token.type === TokenType.PERCENTAGE_TOKEN || isLength(token);\nexport const parseLengthPercentageTuple = (tokens: LengthPercentage[]): LengthPercentageTuple =>\n tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];\nexport const ZERO_LENGTH: NumberValueToken = {\n type: TokenType.NUMBER_TOKEN,\n number: 0,\n flags: FLAG_INTEGER\n};\n\nexport const FIFTY_PERCENT: NumberValueToken = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 50,\n flags: FLAG_INTEGER\n};\n\nexport const HUNDRED_PERCENT: NumberValueToken = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 100,\n flags: FLAG_INTEGER\n};\n\nexport const getAbsoluteValueForTuple = (\n tuple: LengthPercentageTuple,\n width: number,\n height: number\n): [number, number] => {\n let [x, y] = tuple;\n return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== 'undefined' ? y : x, height)];\n};\nexport const getAbsoluteValue = (token: LengthPercentage, parent: number) => {\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\n return (token.number / 100) * parent;\n }\n\n if (isDimensionToken(token)) {\n switch (token.unit) {\n case 'rem':\n case 'em':\n return 16 * token.number; // TODO use correct font-size\n case 'px':\n default:\n return token.number;\n }\n }\n\n return token.number;\n};\n","import {CSSValue, isIdentToken} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\nimport {ITypeDescriptor} from '../ITypeDescriptor';\nimport {HUNDRED_PERCENT, ZERO_LENGTH} from './length-percentage';\nimport {GradientCorner} from './image';\n\nconst DEG = 'deg';\nconst GRAD = 'grad';\nconst RAD = 'rad';\nconst TURN = 'turn';\n\nexport const angle: ITypeDescriptor<number> = {\n name: 'angle',\n parse: (value: CSSValue): number => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n switch (value.unit) {\n case DEG:\n return (Math.PI * value.number) / 180;\n case GRAD:\n return (Math.PI / 200) * value.number;\n case RAD:\n return value.number;\n case TURN:\n return Math.PI * 2 * value.number;\n }\n }\n\n throw new Error(`Unsupported angle type`);\n }\n};\n\nexport const isAngle = (value: CSSValue): boolean => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {\n return true;\n }\n }\n return false;\n};\n\nexport const parseNamedSide = (tokens: CSSValue[]): number | GradientCorner => {\n const sideOrCorner = tokens\n .filter(isIdentToken)\n .map(ident => ident.value)\n .join(' ');\n\n switch (sideOrCorner) {\n case 'to bottom right':\n case 'to right bottom':\n case 'left top':\n case 'top left':\n return [ZERO_LENGTH, ZERO_LENGTH];\n case 'to top':\n case 'bottom':\n return deg(0);\n case 'to bottom left':\n case 'to left bottom':\n case 'right top':\n case 'top right':\n return [ZERO_LENGTH, HUNDRED_PERCENT];\n case 'to right':\n case 'left':\n return deg(90);\n case 'to top left':\n case 'to left top':\n case 'right bottom':\n case 'bottom right':\n return [HUNDRED_PERCENT, HUNDRED_PERCENT];\n case 'to bottom':\n case 'top':\n return deg(180);\n case 'to top right':\n case 'to right top':\n case 'left bottom':\n case 'bottom left':\n return [HUNDRED_PERCENT, ZERO_LENGTH];\n case 'to left':\n case 'right':\n return deg(270);\n }\n\n return 0;\n};\n\nexport const deg = (deg: number): number => (Math.PI * deg) / 180;\n","import {CSSValue, nonFunctionArgSeparator} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\nimport {ITypeDescriptor} from '../ITypeDescriptor';\nimport {angle, deg} from './angle';\nimport {getAbsoluteValue, isLengthPercentage} from './length-percentage';\nexport type Color = number;\n\nexport const color: ITypeDescriptor<Color> = {\n name: 'color',\n parse: (value: CSSValue): Color => {\n if (value.type === TokenType.FUNCTION) {\n const colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];\n if (typeof colorFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color function \"${value.name}\"`);\n }\n return colorFunction(value.values);\n }\n\n if (value.type === TokenType.HASH_TOKEN) {\n if (value.value.length === 3) {\n const r = value.value.substring(0, 1);\n const g = value.value.substring(1, 2);\n const b = value.value.substring(2, 3);\n return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1);\n }\n\n if (value.value.length === 4) {\n const r = value.value.substring(0, 1);\n const g = value.value.substring(1, 2);\n const b = value.value.substring(2, 3);\n const a = value.value.substring(3, 4);\n return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255);\n }\n\n if (value.value.length === 6) {\n const r = value.value.substring(0, 2);\n const g = value.value.substring(2, 4);\n const b = value.value.substring(4, 6);\n return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1);\n }\n\n if (value.value.length === 8) {\n const r = value.value.substring(0, 2);\n const g = value.value.substring(2, 4);\n const b = value.value.substring(4, 6);\n const a = value.value.substring(6, 8);\n return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a, 16) / 255);\n }\n }\n\n if (value.type === TokenType.IDENT_TOKEN) {\n const namedColor = COLORS[value.value.toUpperCase()];\n if (typeof namedColor !== 'undefined') {\n return namedColor;\n }\n }\n\n return COLORS.TRANSPARENT;\n }\n};\n\nexport const isTransparent = (color: Color) => (0xff & color) === 0;\n\nexport const asString = (color: Color) => {\n const alpha = 0xff & color;\n const blue = 0xff & (color >> 8);\n const green = 0xff & (color >> 16);\n const red = 0xff & (color >> 24);\n return alpha < 255 ? `rgba(${red},${green},${blue},${alpha / 255})` : `rgb(${red},${green},${blue})`;\n};\n\nexport const pack = (r: number, g: number, b: number, a: number): Color =>\n ((r << 24) | (g << 16) | (b << 8) | (Math.round(a * 255) << 0)) >>> 0;\n\nconst getTokenColorValue = (token: CSSValue, i: number): number => {\n if (token.type === TokenType.NUMBER_TOKEN) {\n return token.number;\n }\n\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\n const max = i === 3 ? 1 : 255;\n return i === 3 ? (token.number / 100) * max : Math.round((token.number / 100) * max);\n }\n\n return 0;\n};\n\nconst rgb = (args: CSSValue[]): number => {\n const tokens = args.filter(nonFunctionArgSeparator);\n\n if (tokens.length === 3) {\n const [r, g, b] = tokens.map(getTokenColorValue);\n return pack(r, g, b, 1);\n }\n\n if (tokens.length === 4) {\n const [r, g, b, a] = tokens.map(getTokenColorValue);\n return pack(r, g, b, a);\n }\n\n return 0;\n};\n\nfunction hue2rgb(t1: number, t2: number, hue: number): number {\n if (hue < 0) {\n hue += 1;\n }\n if (hue >= 1) {\n hue -= 1;\n }\n\n if (hue < 1 / 6) {\n return (t2 - t1) * hue * 6 + t1;\n } else if (hue < 1 / 2) {\n return t2;\n } else if (hue < 2 / 3) {\n return (t2 - t1) * 6 * (2 / 3 - hue) + t1;\n } else {\n return t1;\n }\n}\n\nconst hsl = (args: CSSValue[]): number => {\n const tokens = args.filter(nonFunctionArgSeparator);\n const [hue, saturation, lightness, alpha] = tokens;\n\n const h = (hue.type === TokenType.NUMBER_TOKEN ? deg(hue.number) : angle.parse(hue)) / (Math.PI * 2);\n const s = isLengthPercentage(saturation) ? saturation.number / 100 : 0;\n const l = isLengthPercentage(lightness) ? lightness.number / 100 : 0;\n const a = typeof alpha !== 'undefined' && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;\n\n if (s === 0) {\n return pack(l * 255, l * 255, l * 255, 1);\n }\n\n const t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n\n const t1 = l * 2 - t2;\n const r = hue2rgb(t1, t2, h + 1 / 3);\n const g = hue2rgb(t1, t2, h);\n const b = hue2rgb(t1, t2, h - 1 / 3);\n return pack(r * 255, g * 255, b * 255, a);\n};\n\nconst SUPPORTED_COLOR_FUNCTIONS: {\n [key: string]: (args: CSSValue[]) => number;\n} = {\n hsl: hsl,\n hsla: hsl,\n rgb: rgb,\n rgba: rgb\n};\n\nexport const COLORS: {[key: string]: Color} = {\n ALICEBLUE: 0xf0f8ffff,\n ANTIQUEWHITE: 0xfaebd7ff,\n AQUA: 0x00ffffff,\n AQUAMARINE: 0x7fffd4ff,\n AZURE: 0xf0ffffff,\n BEIGE: 0xf5f5dcff,\n BISQUE: 0xffe4c4ff,\n BLACK: 0x000000ff,\n BLANCHEDALMOND: 0xffebcdff,\n BLUE: 0x0000ffff,\n BLUEVIOLET: 0x8a2be2ff,\n BROWN: 0xa52a2aff,\n BURLYWOOD: 0xdeb887ff,\n CADETBLUE: 0x5f9ea0ff,\n CHARTREUSE: 0x7fff00ff,\n CHOCOLATE: 0xd2691eff,\n CORAL: 0xff7f50ff,\n CORNFLOWERBLUE: 0x6495edff,\n CORNSILK: 0xfff8dcff,\n CRIMSON: 0xdc143cff,\n CYAN: 0x00ffffff,\n DARKBLUE: 0x00008bff,\n DARKCYAN: 0x008b8bff,\n DARKGOLDENROD: 0xb886bbff,\n DARKGRAY: 0xa9a9a9ff,\n DARKGREEN: 0x006400ff,\n DARKGREY: 0xa9a9a9ff,\n DARKKHAKI: 0xbdb76bff,\n DARKMAGENTA: 0x8b008bff,\n DARKOLIVEGREEN: 0x556b2fff,\n DARKORANGE: 0xff8c00ff,\n DARKORCHID: 0x9932ccff,\n DARKRED: 0x8b0000ff,\n DARKSALMON: 0xe9967aff,\n DARKSEAGREEN: 0x8fbc8fff,\n DARKSLATEBLUE: 0x483d8bff,\n DARKSLATEGRAY: 0x2f4f4fff,\n DARKSLATEGREY: 0x2f4f4fff,\n DARKTURQUOISE: 0x00ced1ff,\n DARKVIOLET: 0x9400d3ff,\n DEEPPINK: 0xff1493ff,\n DEEPSKYBLUE: 0x00bfffff,\n DIMGRAY: 0x696969ff,\n DIMGREY: 0x696969ff,\n DODGERBLUE: 0x1e90ffff,\n FIREBRICK: 0xb22222ff,\n FLORALWHITE: 0xfffaf0ff,\n FORESTGREEN: 0x228b22ff,\n FUCHSIA: 0xff00ffff,\n GAINSBORO: 0xdcdcdcff,\n GHOSTWHITE: 0xf8f8ffff,\n GOLD: 0xffd700ff,\n GOLDENROD: 0xdaa520ff,\n GRAY: 0x808080ff,\n GREEN: 0x008000ff,\n GREENYELLOW: 0xadff2fff,\n GREY: 0x808080ff,\n HONEYDEW: 0xf0fff0ff,\n HOTPINK: 0xff69b4ff,\n INDIANRED: 0xcd5c5cff,\n INDIGO: 0x4b0082ff,\n IVORY: 0xfffff0ff,\n KHAKI: 0xf0e68cff,\n LAVENDER: 0xe6e6faff,\n LAVENDERBLUSH: 0xfff0f5ff,\n LAWNGREEN: 0x7cfc00ff,\n LEMONCHIFFON: 0xfffacdff,\n LIGHTBLUE: 0xadd8e6ff,\n LIGHTCORAL: 0xf08080ff,\n LIGHTCYAN: 0xe0ffffff,\n LIGHTGOLDENRODYELLOW: 0xfafad2ff,\n LIGHTGRAY: 0xd3d3d3ff,\n LIGHTGREEN: 0x90ee90ff,\n LIGHTGREY: 0xd3d3d3ff,\n LIGHTPINK: 0xffb6c1ff,\n LIGHTSALMON: 0xffa07aff,\n LIGHTSEAGREEN: 0x20b2aaff,\n LIGHTSKYBLUE: 0x87cefaff,\n LIGHTSLATEGRAY: 0x778899ff,\n LIGHTSLATEGREY: 0x778899ff,\n LIGHTSTEELBLUE: 0xb0c4deff,\n LIGHTYELLOW: 0xffffe0ff,\n LIME: 0x00ff00ff,\n LIMEGREEN: 0x32cd32ff,\n LINEN: 0xfaf0e6ff,\n MAGENTA: 0xff00ffff,\n MAROON: 0x800000ff,\n MEDIUMAQUAMARINE: 0x66cdaaff,\n MEDIUMBLUE: 0x0000cdff,\n MEDIUMORCHID: 0xba55d3ff,\n MEDIUMPURPLE: 0x9370dbff,\n MEDIUMSEAGREEN: 0x3cb371ff,\n MEDIUMSLATEBLUE: 0x7b68eeff,\n MEDIUMSPRINGGREEN: 0x00fa9aff,\n MEDIUMTURQUOISE: 0x48d1ccff,\n MEDIUMVIOLETRED: 0xc71585ff,\n MIDNIGHTBLUE: 0x191970ff,\n MINTCREAM: 0xf5fffaff,\n MISTYROSE: 0xffe4e1ff,\n MOCCASIN: 0xffe4b5ff,\n NAVAJOWHITE: 0xffdeadff,\n NAVY: 0x000080ff,\n OLDLACE: 0xfdf5e6ff,\n OLIVE: 0x808000ff,\n OLIVEDRAB: 0x6b8e23ff,\n ORANGE: 0xffa500ff,\n ORANGERED: 0xff4500ff,\n ORCHID: 0xda70d6ff,\n PALEGOLDENROD: 0xeee8aaff,\n PALEGREEN: 0x98fb98ff,\n PALETURQUOISE: 0xafeeeeff,\n PALEVIOLETRED: 0xdb7093ff,\n PAPAYAWHIP: 0xffefd5ff,\n PEACHPUFF: 0xffdab9ff,\n PERU: 0xcd853fff,\n PINK: 0xffc0cbff,\n PLUM: 0xdda0ddff,\n POWDERBLUE: 0xb0e0e6ff,\n PURPLE: 0x800080ff,\n REBECCAPURPLE: 0x663399ff,\n RED: 0xff0000ff,\n ROSYBROWN: 0xbc8f8fff,\n ROYALBLUE: 0x4169e1ff,\n SADDLEBROWN: 0x8b4513ff,\n SALMON: 0xfa8072ff,\n SANDYBROWN: 0xf4a460ff,\n SEAGREEN: 0x2e8b57ff,\n SEASHELL: 0xfff5eeff,\n SIENNA: 0xa0522dff,\n SILVER: 0xc0c0c0ff,\n SKYBLUE: 0x87ceebff,\n SLATEBLUE: 0x6a5acdff,\n SLATEGRAY: 0x708090ff,\n SLATEGREY: 0x708090ff,\n SNOW: 0xfffafaff,\n SPRINGGREEN: 0x00ff7fff,\n STEELBLUE: 0x4682b4ff,\n TAN: 0xd2b48cff,\n TEAL: 0x008080ff,\n THISTLE: 0xd8bfd8ff,\n TOMATO: 0xff6347ff,\n TRANSPARENT: 0x00000000,\n TURQUOISE: 0x40e0d0ff,\n VIOLET: 0xee82eeff,\n WHEAT: 0xf5deb3ff,\n WHITE: 0xffffffff,\n WHITESMOKE: 0xf5f5f5ff,\n YELLOW: 0xffff00ff,\n YELLOWGREEN: 0x9acd32ff\n};\n","import {CSSValue} from './syntax/parser';\nimport {CSSTypes} from './types/index';\n\nexport enum PropertyDescriptorParsingType {\n VALUE,\n LIST,\n IDENT_VALUE,\n TYPE_VALUE,\n TOKEN_VALUE\n}\n\nexport interface IPropertyDescriptor {\n name: string;\n type: PropertyDescriptorParsingType;\n initialValue: string;\n prefix: boolean;\n}\n\nexport interface IPropertyIdentValueDescriptor<T> extends IPropertyDescriptor {\n type: PropertyDescriptorParsingType.IDENT_VALUE;\n parse: (token: string) => T;\n}\n\nexport interface IPropertyTypeValueDescriptor extends IPropertyDescriptor {\n type: PropertyDescriptorParsingType.TYPE_VALUE;\n format: CSSTypes;\n}\n\nexport interface IPropertyValueDescriptor<T> extends IPropertyDescriptor {\n type: PropertyDescriptorParsingType.VALUE;\n parse: (token: CSSValue) => T;\n}\n\nexport interface IPropertyListDescriptor<T> extends IPropertyDescriptor {\n type: PropertyDescriptorParsingType.LIST;\n parse: (tokens: CSSValue[]) => T;\n}\n\nexport interface IPropertyTokenValueDescriptor extends IPropertyDescriptor {\n type: PropertyDescriptorParsingType.TOKEN_VALUE;\n}\n\nexport type CSSPropertyDescriptor<T> =\n | IPropertyValueDescriptor<T>\n | IPropertyListDescriptor<T>\n | IPropertyIdentValueDescriptor<T>\n | IPropertyTypeValueDescriptor\n | IPropertyTokenValueDescriptor;\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\nexport enum BACKGROUND_CLIP {\n BORDER_BOX = 0,\n PADDING_BOX = 1,\n CONTENT_BOX = 2\n}\n\nexport type BackgroundClip = BACKGROUND_CLIP[];\n\nexport const backgroundClip: IPropertyListDescriptor<BackgroundClip> = {\n name: 'background-clip',\n initialValue: 'border-box',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): BackgroundClip => {\n return tokens.map(token => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return BACKGROUND_CLIP.PADDING_BOX;\n case 'content-box':\n return BACKGROUND_CLIP.CONTENT_BOX;\n }\n }\n return BACKGROUND_CLIP.BORDER_BOX;\n });\n }\n};\n","import {CSSValue} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\nimport {Color} from './color';\nimport {linearGradient} from './functions/linear-gradient';\nimport {prefixLinearGradient} from './functions/-prefix-linear-gradient';\nimport {ITypeDescriptor} from '../ITypeDescriptor';\nimport {CacheStorage} from '../../core/cache-storage';\nimport {LengthPercentage} from './length-percentage';\nimport {webkitGradient} from './functions/-webkit-gradient';\nimport {radialGradient} from './functions/radial-gradient';\nimport {prefixRadialGradient} from './functions/-prefix-radial-gradient';\n\nexport enum CSSImageType {\n URL,\n LINEAR_GRADIENT,\n RADIAL_GRADIENT\n}\n\nexport const isLinearGradient = (background: ICSSImage): background is CSSLinearGradientImage => {\n return background.type === CSSImageType.LINEAR_GRADIENT;\n};\n\nexport const isRadialGradient = (background: ICSSImage): background is CSSRadialGradientImage => {\n return background.type === CSSImageType.RADIAL_GRADIENT;\n};\n\nexport interface UnprocessedGradientColorStop {\n color: Color;\n stop: LengthPercentage | null;\n}\n\nexport interface GradientColorStop {\n color: Color;\n stop: number;\n}\n\nexport interface ICSSImage {\n type: CSSImageType;\n}\n\nexport interface CSSURLImage extends ICSSImage {\n url: string;\n type: CSSImageType.URL;\n}\n\n// interface ICSSGeneratedImage extends ICSSImage {}\n\nexport type GradientCorner = [LengthPercentage, LengthPercentage];\n\ninterface ICSSGradientImage extends ICSSImage {\n stops: UnprocessedGradientColorStop[];\n}\n\nexport interface CSSLinearGradientImage extends ICSSGradientImage {\n angle: number | GradientCorner;\n type: CSSImageType.LINEAR_GRADIENT;\n}\n\nexport enum CSSRadialShape {\n CIRCLE,\n ELLIPSE\n}\n\nexport enum CSSRadialExtent {\n CLOSEST_SIDE,\n FARTHEST_SIDE,\n CLOSEST_CORNER,\n FARTHEST_CORNER\n}\n\nexport type CSSRadialSize = CSSRadialExtent | LengthPercentage[];\n\nexport interface CSSRadialGradientImage extends ICSSGradientImage {\n type: CSSImageType.RADIAL_GRADIENT;\n shape: CSSRadialShape;\n size: CSSRadialSize;\n position: LengthPercentage[];\n}\n\nexport const image: ITypeDescriptor<ICSSImage> = {\n name: 'image',\n parse: (value: CSSValue): ICSSImage => {\n if (value.type === TokenType.URL_TOKEN) {\n const image: CSSURLImage = {url: value.value, type: CSSImageType.URL};\n CacheStorage.getInstance().addImage(value.value);\n return image;\n }\n\n if (value.type === TokenType.FUNCTION) {\n const imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];\n if (typeof imageFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported image function \"${value.name}\"`);\n }\n return imageFunction(value.values);\n }\n\n throw new Error(`Unsupported image type`);\n }\n};\n\nexport function isSupportedImage(value: CSSValue) {\n return value.type !== TokenType.FUNCTION || SUPPORTED_IMAGE_FUNCTIONS[value.name];\n}\n\nconst SUPPORTED_IMAGE_FUNCTIONS: Record<string, (args: CSSValue[]) => ICSSImage> = {\n 'linear-gradient': linearGradient,\n '-moz-linear-gradient': prefixLinearGradient,\n '-ms-linear-gradient': prefixLinearGradient,\n '-o-linear-gradient': prefixLinearGradient,\n '-webkit-linear-gradient': prefixLinearGradient,\n 'radial-gradient': radialGradient,\n '-moz-radial-gradient': prefixRadialGradient,\n '-ms-radial-gradient': prefixRadialGradient,\n '-o-radial-gradient': prefixRadialGradient,\n '-webkit-radial-gradient': prefixRadialGradient,\n '-webkit-gradient': webkitGradient\n};\n","import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\n\nexport const backgroundColor: IPropertyTypeValueDescriptor = {\n name: `background-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import {CSSValue} from '../../syntax/parser';\nimport {\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n GradientColorStop,\n GradientCorner,\n UnprocessedGradientColorStop\n} from '../image';\nimport {color as colorType} from '../color';\nimport {getAbsoluteValue, HUNDRED_PERCENT, isLengthPercentage, ZERO_LENGTH} from '../length-percentage';\n\nexport const parseColorStop = (args: CSSValue[]): UnprocessedGradientColorStop => {\n const color = colorType.parse(args[0]);\n const stop = args[1];\n return stop && isLengthPercentage(stop) ? {color, stop} : {color, stop: null};\n};\n\nexport const processColorStops = (stops: UnprocessedGradientColorStop[], lineLength: number): GradientColorStop[] => {\n const first = stops[0];\n const last = stops[stops.length - 1];\n if (first.stop === null) {\n first.stop = ZERO_LENGTH;\n }\n\n if (last.stop === null) {\n last.stop = HUNDRED_PERCENT;\n }\n\n const processStops: (number | null)[] = [];\n let previous = 0;\n for (let i = 0; i < stops.length; i++) {\n const stop = stops[i].stop;\n if (stop !== null) {\n const absoluteValue = getAbsoluteValue(stop, lineLength);\n if (absoluteValue > previous) {\n processStops.push(absoluteValue);\n } else {\n processStops.push(previous);\n }\n previous = absoluteValue;\n } else {\n processStops.push(null);\n }\n }\n\n let gapBegin = null;\n for (let i = 0; i < processStops.length; i++) {\n const stop = processStops[i];\n if (stop === null) {\n if (gapBegin === null) {\n gapBegin = i;\n }\n } else if (gapBegin !== null) {\n const gapLength = i - gapBegin;\n const beforeGap = processStops[gapBegin - 1] as number;\n const gapValue = (stop - beforeGap) / (gapLength + 1);\n for (let g = 1; g <= gapLength; g++) {\n processStops[gapBegin + g - 1] = gapValue * g;\n }\n gapBegin = null;\n }\n }\n\n return stops.map(({color}, i) => {\n return {color, stop: Math.max(Math.min(1, (processStops[i] as number) / lineLength), 0)};\n });\n};\n\nconst getAngleFromCorner = (corner: GradientCorner, width: number, height: number): number => {\n const centerX = width / 2;\n const centerY = height / 2;\n const x = getAbsoluteValue(corner[0], width) - centerX;\n const y = centerY - getAbsoluteValue(corner[1], height);\n\n return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);\n};\n\nexport const calculateGradientDirection = (\n angle: number | GradientCorner,\n width: number,\n height: number\n): [number, number, number, number, number] => {\n const radian = typeof angle === 'number' ? angle : getAngleFromCorner(angle, width, height);\n\n const lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));\n\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const halfLineLength = lineLength / 2;\n\n const yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;\n const xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;\n\n return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];\n};\n\nconst distance = (a: number, b: number): number => Math.sqrt(a * a + b * b);\n\nconst findCorner = (width: number, height: number, x: number, y: number, closest: boolean): [number, number] => {\n const corners = [[0, 0], [0, height], [width, 0], [width, height]];\n\n return corners.reduce(\n (stat, corner) => {\n const [cx, cy] = corner;\n const d = distance(x - cx, y - cy);\n if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {\n return {\n optimumCorner: corner,\n optimumDistance: d\n };\n }\n\n return stat;\n },\n {\n optimumDistance: closest ? Infinity : -Infinity,\n optimumCorner: null\n }\n ).optimumCorner as [number, number];\n};\n\nexport const calculateRadius = (\n gradient: CSSRadialGradientImage,\n x: number,\n y: number,\n width: number,\n height: number\n): [number, number] => {\n let rx = 0;\n let ry = 0;\n\n switch (gradient.size) {\n case CSSRadialExtent.CLOSEST_SIDE:\n // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, it exactly meets the closest side in each dimension.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n rx = Math.min(Math.abs(x), Math.abs(x - width));\n ry = Math.min(Math.abs(y), Math.abs(y - height));\n }\n break;\n\n case CSSRadialExtent.CLOSEST_CORNER:\n // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.min(\n distance(x, y),\n distance(x, y - height),\n distance(x - width, y),\n distance(x - width, y - height)\n );\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n // Compute the ratio ry/rx (which is to be the same as for \"closest-side\")\n const c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));\n const [cx, cy] = findCorner(width, height, x, y, true);\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n\n case CSSRadialExtent.FARTHEST_SIDE:\n // Same as closest-side, except the ending shape is sized based on the farthest side(s)\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n rx = Math.max(Math.abs(x), Math.abs(x - width));\n ry = Math.max(Math.abs(y), Math.abs(y - height));\n }\n break;\n\n case CSSRadialExtent.FARTHEST_CORNER:\n // Same as closest-corner, except the ending shape is sized based on the farthest corner.\n // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.max(\n distance(x, y),\n distance(x, y - height),\n distance(x - width, y),\n distance(x - width, y - height)\n );\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n // Compute the ratio ry/rx (which is to be the same as for \"farthest-side\")\n const c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));\n const [cx, cy] = findCorner(width, height, x, y, false);\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n }\n\n if (Array.isArray(gradient.size)) {\n rx = getAbsoluteValue(gradient.size[0], width);\n ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;\n }\n\n return [rx, ry];\n};\n","import {CSSValue, parseFunctionArgs} from '../../syntax/parser';\nimport {CSSImageType, CSSLinearGradientImage, GradientCorner, UnprocessedGradientColorStop} from '../image';\nimport {TokenType} from '../../syntax/tokenizer';\nimport {isAngle, angle as angleType, parseNamedSide, deg} from '../angle';\nimport {parseColorStop} from './gradient';\n\nexport const prefixLinearGradient = (tokens: CSSValue[]): CSSLinearGradientImage => {\n let angle: number | GradientCorner = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n if (i === 0) {\n const firstToken = arg[0];\n if (\n firstToken.type === TokenType.IDENT_TOKEN &&\n ['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1\n ) {\n angle = parseNamedSide(arg);\n return;\n } else if (isAngle(firstToken)) {\n angle = (angleType.parse(firstToken) + deg(270)) % deg(360);\n return;\n }\n }\n const colorStop = parseColorStop(arg);\n stops.push(colorStop);\n });\n\n return {\n angle,\n stops,\n type: CSSImageType.LINEAR_GRADIENT\n };\n};\n","const testRangeBounds = (document: Document) => {\n const TEST_HEIGHT = 123;\n\n if (document.createRange) {\n const range = document.createRange();\n if (range.getBoundingClientRect) {\n const testElement = document.createElement('boundtest');\n testElement.style.height = `${TEST_HEIGHT}px`;\n testElement.style.display = 'block';\n document.body.appendChild(testElement);\n\n range.selectNode(testElement);\n const rangeBounds = range.getBoundingClientRect();\n const rangeHeight = Math.round(rangeBounds.height);\n document.body.removeChild(testElement);\n if (rangeHeight === TEST_HEIGHT) {\n return true;\n }\n }\n }\n\n return false;\n};\n\nconst testCORS = (): boolean => typeof new Image().crossOrigin !== 'undefined';\n\nconst testResponseType = (): boolean => typeof new XMLHttpRequest().responseType === 'string';\n\nconst testSVG = (document: Document): boolean => {\n const img = new Image();\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return false;\n }\n\n img.src = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>`;\n\n try {\n ctx.drawImage(img, 0, 0);\n canvas.toDataURL();\n } catch (e) {\n return false;\n }\n return true;\n};\n\nconst isGreenPixel = (data: Uint8ClampedArray): boolean =>\n data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;\n\nconst testForeignObject = (document: Document): Promise<boolean> => {\n const canvas = document.createElement('canvas');\n const size = 100;\n canvas.width = size;\n canvas.height = size;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return Promise.reject(false);\n }\n ctx.fillStyle = 'rgb(0, 255, 0)';\n ctx.fillRect(0, 0, size, size);\n\n const img = new Image();\n const greenImageSrc = canvas.toDataURL();\n img.src = greenImageSrc;\n const svg = createForeignObjectSVG(size, size, 0, 0, img);\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n\n return loadSerializedSVG(svg)\n .then((img: HTMLImageElement) => {\n ctx.drawImage(img, 0, 0);\n const data = ctx.getImageData(0, 0, size, size).data;\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n\n const node = document.createElement('div');\n node.style.backgroundImage = `url(${greenImageSrc})`;\n node.style.height = `${size}px`;\n // Firefox 55 does not render inline <img /> tags\n return isGreenPixel(data)\n ? loadSerializedSVG(createForeignObjectSVG(size, size, 0, 0, node))\n : Promise.reject(false);\n })\n .then((img: HTMLImageElement) => {\n ctx.drawImage(img, 0, 0);\n // Edge does not render background-images\n return isGreenPixel(ctx.getImageData(0, 0, size, size).data);\n })\n .catch(() => false);\n};\n\nexport const createForeignObjectSVG = (width: number, height: number, x: number, y: number, node: Node) => {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttributeNS(null, 'width', width.toString());\n svg.setAttributeNS(null, 'height', height.toString());\n\n foreignObject.setAttributeNS(null, 'width', '100%');\n foreignObject.setAttributeNS(null, 'height', '100%');\n foreignObject.setAttributeNS(null, 'x', x.toString());\n foreignObject.setAttributeNS(null, 'y', y.toString());\n foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n\n foreignObject.appendChild(node);\n\n return svg;\n};\n\nexport const loadSerializedSVG = (svg: Node): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n\n img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n });\n};\n\nexport const FEATURES = {\n get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n const value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', {value});\n return value;\n },\n get SUPPORT_SVG_DRAWING() {\n 'use strict';\n const value = testSVG(document);\n Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', {value});\n return value;\n },\n get SUPPORT_FOREIGNOBJECT_DRAWING() {\n 'use strict';\n const value =\n typeof Array.from === 'function' && typeof window.fetch === 'function'\n ? testForeignObject(document)\n : Promise.resolve(false);\n Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', {value});\n return value;\n },\n get SUPPORT_CORS_IMAGES() {\n 'use strict';\n const value = testCORS();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', {value});\n return value;\n },\n get SUPPORT_RESPONSE_TYPE() {\n 'use strict';\n const value = testResponseType();\n Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', {value});\n return value;\n },\n get SUPPORT_CORS_XHR() {\n 'use strict';\n const value = 'withCredentials' in new XMLHttpRequest();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', {value});\n return value;\n }\n};\n","export interface LoggerOptions {\n id: string;\n enabled: boolean;\n}\n\nexport class Logger {\n static instances: {[key: string]: Logger} = {};\n\n private readonly id: string;\n private readonly enabled: boolean;\n private readonly start: number;\n\n constructor({id, enabled}: LoggerOptions) {\n this.id = id;\n this.enabled = enabled;\n this.start = Date.now();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n debug(...args: any) {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.debug === 'function') {\n // eslint-disable-next-line no-console\n console.debug(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n\n getTime(): number {\n return Date.now() - this.start;\n }\n\n static create(options: LoggerOptions) {\n Logger.instances[options.id] = new Logger(options);\n }\n\n static destroy(id: string) {\n delete Logger.instances[id];\n }\n\n static getInstance(id: string): Logger {\n const instance = Logger.instances[id];\n if (typeof instance === 'undefined') {\n throw new Error(`No logger instance found with id ${id}`);\n }\n return instance;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n info(...args: any) {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.info === 'function') {\n // eslint-disable-next-line no-console\n console.info(this.id, `${this.getTime()}ms`, ...args);\n }\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error(...args: any) {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.error === 'function') {\n // eslint-disable-next-line no-console\n console.error(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n}\n","import {FEATURES} from './features';\nimport {Logger} from './logger';\n\nexport class CacheStorage {\n private static _caches: {[key: string]: Cache} = {};\n private static _link?: HTMLAnchorElement;\n private static _origin: string = 'about:blank';\n private static _current: Cache | null = null;\n\n static create(name: string, options: ResourceOptions): Cache {\n return (CacheStorage._caches[name] = new Cache(name, options));\n }\n\n static destroy(name: string): void {\n delete CacheStorage._caches[name];\n }\n\n static open(name: string): Cache {\n const cache = CacheStorage._caches[name];\n if (typeof cache !== 'undefined') {\n return cache;\n }\n\n throw new Error(`Cache with key \"${name}\" not found`);\n }\n\n static getOrigin(url: string): string {\n const link = CacheStorage._link;\n if (!link) {\n return 'about:blank';\n }\n\n link.href = url;\n link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/\n return link.protocol + link.hostname + link.port;\n }\n\n static isSameOrigin(src: string): boolean {\n return CacheStorage.getOrigin(src) === CacheStorage._origin;\n }\n\n static setContext(window: Window) {\n CacheStorage._link = window.document.createElement('a');\n CacheStorage._origin = CacheStorage.getOrigin(window.location.href);\n }\n\n static getInstance(): Cache {\n const current = CacheStorage._current;\n if (current === null) {\n throw new Error(`No cache instance attached`);\n }\n return current;\n }\n\n static attachInstance(cache: Cache) {\n CacheStorage._current = cache;\n }\n\n static detachInstance() {\n CacheStorage._current = null;\n }\n}\n\nexport interface ResourceOptions {\n imageTimeout: number;\n useCORS: boolean;\n allowTaint: boolean;\n proxy?: string;\n}\n\nexport class Cache {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly _cache: {[key: string]: Promise<any>};\n private readonly _options: ResourceOptions;\n private readonly id: string;\n\n constructor(id: string, options: ResourceOptions) {\n this.id = id;\n this._options = options;\n this._cache = {};\n }\n\n addImage(src: string): Promise<void> {\n const result = Promise.resolve();\n if (this.has(src)) {\n return result;\n }\n\n if (isBlobImage(src) || isRenderable(src)) {\n this._cache[src] = this.loadImage(src);\n return result;\n }\n\n return result;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n match(src: string): Promise<any> {\n return this._cache[src];\n }\n\n private async loadImage(key: string) {\n const isSameOrigin = CacheStorage.isSameOrigin(key);\n const useCORS =\n !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;\n const useProxy =\n !isInlineImage(key) &&\n !isSameOrigin &&\n typeof this._options.proxy === 'string' &&\n FEATURES.SUPPORT_CORS_XHR &&\n !useCORS;\n if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key) && !useProxy && !useCORS) {\n return;\n }\n\n let src = key;\n if (useProxy) {\n src = await this.proxy(src);\n }\n\n Logger.getInstance(this.id).debug(`Added image ${key.substring(0, 256)}`);\n\n return await new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous\n if (isInlineBase64Image(src) || useCORS) {\n img.crossOrigin = 'anonymous';\n }\n img.src = src;\n if (img.complete === true) {\n // Inline XML images may fail to parse, throwing an Error later on\n setTimeout(() => resolve(img), 500);\n }\n if (this._options.imageTimeout > 0) {\n setTimeout(\n () => reject(`Timed out (${this._options.imageTimeout}ms) loading image`),\n this._options.imageTimeout\n );\n }\n });\n }\n\n private has(key: string): boolean {\n return typeof this._cache[key] !== 'undefined';\n }\n\n keys(): Promise<string[]> {\n return Promise.resolve(Object.keys(this._cache));\n }\n\n private proxy(src: string): Promise<string> {\n const proxy = this._options.proxy;\n\n if (!proxy) {\n throw new Error('No proxy defined');\n }\n\n const key = src.substring(0, 256);\n\n return new Promise((resolve, reject) => {\n const responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';\n const xhr = new XMLHttpRequest();\n xhr.onload = () => {\n if (xhr.status === 200) {\n if (responseType === 'text') {\n resolve(xhr.response);\n } else {\n const reader = new FileReader();\n reader.addEventListener('load', () => resolve(reader.result as string), false);\n reader.addEventListener('error', e => reject(e), false);\n reader.readAsDataURL(xhr.response);\n }\n } else {\n reject(`Failed to proxy resource ${key} with status code ${xhr.status}`);\n }\n };\n\n xhr.onerror = reject;\n xhr.open('GET', `${proxy}?url=${encodeURIComponent(src)}&responseType=${responseType}`);\n\n if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {\n xhr.responseType = responseType;\n }\n\n if (this._options.imageTimeout) {\n const timeout = this._options.imageTimeout;\n xhr.timeout = timeout;\n xhr.ontimeout = () => reject(`Timed out (${timeout}ms) proxying ${key}`);\n }\n\n xhr.send();\n });\n }\n}\n\nconst INLINE_SVG = /^data:image\\/svg\\+xml/i;\nconst INLINE_BASE64 = /^data:image\\/.*;base64,/i;\nconst INLINE_IMG = /^data:image\\/.*/i;\n\nconst isRenderable = (src: string): boolean => FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);\nconst isInlineImage = (src: string): boolean => INLINE_IMG.test(src);\nconst isInlineBase64Image = (src: string): boolean => INLINE_BASE64.test(src);\nconst isBlobImage = (src: string): boolean => src.substr(0, 4) === 'blob';\n\nconst isSVG = (src: string): boolean => src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);\n","import {CSSValue, isIdentToken, parseFunctionArgs} from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport {parseColorStop} from './gradient';\nimport {FIFTY_PERCENT, HUNDRED_PERCENT, isLengthPercentage, LengthPercentage, ZERO_LENGTH} from '../length-percentage';\nimport {isLength} from '../length';\nimport {\n CIRCLE,\n CLOSEST_CORNER,\n CLOSEST_SIDE,\n CONTAIN,\n COVER,\n ELLIPSE,\n FARTHEST_CORNER,\n FARTHEST_SIDE\n} from './radial-gradient';\n\nexport const prefixRadialGradient = (tokens: CSSValue[]): CSSRadialGradientImage => {\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const stops: UnprocessedGradientColorStop[] = [];\n const position: LengthPercentage[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n let isColorStop = true;\n if (i === 0) {\n isColorStop = arg.reduce((acc, token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return false;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return false;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return false;\n }\n } else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n return false;\n }\n\n return acc;\n }, isColorStop);\n } else if (i === 1) {\n isColorStop = arg.reduce((acc, token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = CSSRadialShape.CIRCLE;\n return false;\n case ELLIPSE:\n shape = CSSRadialShape.ELLIPSE;\n return false;\n case CONTAIN:\n case CLOSEST_SIDE:\n size = CSSRadialExtent.CLOSEST_SIDE;\n return false;\n case FARTHEST_SIDE:\n size = CSSRadialExtent.FARTHEST_SIDE;\n return false;\n case CLOSEST_CORNER:\n size = CSSRadialExtent.CLOSEST_CORNER;\n return false;\n case COVER:\n case FARTHEST_CORNER:\n size = CSSRadialExtent.FARTHEST_CORNER;\n return false;\n }\n } else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n\n return acc;\n }, isColorStop);\n }\n\n if (isColorStop) {\n const colorStop = parseColorStop(arg);\n stops.push(colorStop);\n }\n });\n\n return {size, shape, stops, position, type: CSSImageType.RADIAL_GRADIENT};\n};\n","import {CSSValue, isIdentToken, parseFunctionArgs} from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport {parseColorStop} from './gradient';\nimport {FIFTY_PERCENT, HUNDRED_PERCENT, isLengthPercentage, LengthPercentage, ZERO_LENGTH} from '../length-percentage';\nimport {isLength} from '../length';\nexport const CLOSEST_SIDE = 'closest-side';\nexport const FARTHEST_SIDE = 'farthest-side';\nexport const CLOSEST_CORNER = 'closest-corner';\nexport const FARTHEST_CORNER = 'farthest-corner';\nexport const CIRCLE = 'circle';\nexport const ELLIPSE = 'ellipse';\nexport const COVER = 'cover';\nexport const CONTAIN = 'contain';\n\nexport const radialGradient = (tokens: CSSValue[]): CSSRadialGradientImage => {\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const stops: UnprocessedGradientColorStop[] = [];\n const position: LengthPercentage[] = [];\n parseFunctionArgs(tokens).forEach((arg, i) => {\n let isColorStop = true;\n if (i === 0) {\n let isAtPosition = false;\n isColorStop = arg.reduce((acc, token) => {\n if (isAtPosition) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return acc;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return acc;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return acc;\n }\n } else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n }\n } else if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = CSSRadialShape.CIRCLE;\n return false;\n case ELLIPSE:\n shape = CSSRadialShape.ELLIPSE;\n return false;\n case 'at':\n isAtPosition = true;\n return false;\n case CLOSEST_SIDE:\n size = CSSRadialExtent.CLOSEST_SIDE;\n return false;\n case COVER:\n case FARTHEST_SIDE:\n size = CSSRadialExtent.FARTHEST_SIDE;\n return false;\n case CONTAIN:\n case CLOSEST_CORNER:\n size = CSSRadialExtent.CLOSEST_CORNER;\n return false;\n case FARTHEST_CORNER:\n size = CSSRadialExtent.FARTHEST_CORNER;\n return false;\n }\n } else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n return acc;\n }, isColorStop);\n }\n\n if (isColorStop) {\n const colorStop = parseColorStop(arg);\n stops.push(colorStop);\n }\n });\n\n return {size, shape, stops, position, type: CSSImageType.RADIAL_GRADIENT};\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken, parseFunctionArgs} from '../syntax/parser';\nexport type BackgroundRepeat = BACKGROUND_REPEAT[];\n\nexport enum BACKGROUND_REPEAT {\n REPEAT = 0,\n NO_REPEAT = 1,\n REPEAT_X = 2,\n REPEAT_Y = 3\n}\n\nexport const backgroundRepeat: IPropertyListDescriptor<BackgroundRepeat> = {\n name: 'background-repeat',\n initialValue: 'repeat',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): BackgroundRepeat => {\n return parseFunctionArgs(tokens)\n .map(values =>\n values\n .filter(isIdentToken)\n .map(token => token.value)\n .join(' ')\n )\n .map(parseBackgroundRepeat);\n }\n};\n\nconst parseBackgroundRepeat = (value: string): BACKGROUND_REPEAT => {\n switch (value) {\n case 'no-repeat':\n return BACKGROUND_REPEAT.NO_REPEAT;\n case 'repeat-x':\n case 'repeat no-repeat':\n return BACKGROUND_REPEAT.REPEAT_X;\n case 'repeat-y':\n case 'no-repeat repeat':\n return BACKGROUND_REPEAT.REPEAT_Y;\n case 'repeat':\n default:\n return BACKGROUND_REPEAT.REPEAT;\n }\n};\n","import {CSSValue, parseFunctionArgs} from '../../syntax/parser';\nimport {TokenType} from '../../syntax/tokenizer';\nimport {isAngle, angle as angleType, parseNamedSide, deg} from '../angle';\nimport {CSSImageType, CSSLinearGradientImage, GradientCorner, UnprocessedGradientColorStop} from '../image';\nimport {parseColorStop} from './gradient';\n\nexport const linearGradient = (tokens: CSSValue[]): CSSLinearGradientImage => {\n let angle: number | GradientCorner = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n if (i === 0) {\n const firstToken = arg[0];\n if (firstToken.type === TokenType.IDENT_TOKEN && firstToken.value === 'to') {\n angle = parseNamedSide(arg);\n return;\n } else if (isAngle(firstToken)) {\n angle = angleType.parse(firstToken);\n return;\n }\n }\n const colorStop = parseColorStop(arg);\n stops.push(colorStop);\n });\n\n return {angle, stops, type: CSSImageType.LINEAR_GRADIENT};\n};\n","import {CSSValue, isIdentToken, isNumberToken, nonFunctionArgSeparator, parseFunctionArgs} from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSLinearGradientImage,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport {deg} from '../angle';\nimport {TokenType} from '../../syntax/tokenizer';\nimport {color as colorType} from '../color';\nimport {HUNDRED_PERCENT, LengthPercentage, ZERO_LENGTH} from '../length-percentage';\n\nexport const webkitGradient = (tokens: CSSValue[]): CSSLinearGradientImage | CSSRadialGradientImage => {\n let angle = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n let type = CSSImageType.LINEAR_GRADIENT;\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const position: LengthPercentage[] = [];\n parseFunctionArgs(tokens).forEach((arg, i) => {\n const firstToken = arg[0];\n if (i === 0) {\n if (isIdentToken(firstToken) && firstToken.value === 'linear') {\n type = CSSImageType.LINEAR_GRADIENT;\n return;\n } else if (isIdentToken(firstToken) && firstToken.value === 'radial') {\n type = CSSImageType.RADIAL_GRADIENT;\n return;\n }\n }\n\n if (firstToken.type === TokenType.FUNCTION) {\n if (firstToken.name === 'from') {\n const color = colorType.parse(firstToken.values[0]);\n stops.push({stop: ZERO_LENGTH, color});\n } else if (firstToken.name === 'to') {\n const color = colorType.parse(firstToken.values[0]);\n stops.push({stop: HUNDRED_PERCENT, color});\n } else if (firstToken.name === 'color-stop') {\n const values = firstToken.values.filter(nonFunctionArgSeparator);\n if (values.length === 2) {\n const color = colorType.parse(values[1]);\n const stop = values[0];\n if (isNumberToken(stop)) {\n stops.push({\n stop: {type: TokenType.PERCENTAGE_TOKEN, number: stop.number * 100, flags: stop.flags},\n color\n });\n }\n }\n }\n }\n });\n\n return type === CSSImageType.LINEAR_GRADIENT\n ? {\n angle: (angle + deg(180)) % deg(360),\n stops,\n type\n }\n : {size, shape, stops, position, type};\n};\n","import {TokenType} from '../syntax/tokenizer';\nimport {ICSSImage, image, isSupportedImage} from '../types/image';\nimport {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, nonFunctionArgSeparator} from '../syntax/parser';\n\nexport const backgroundImage: IPropertyListDescriptor<ICSSImage[]> = {\n name: 'background-image',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return [];\n }\n\n return tokens.filter(value => nonFunctionArgSeparator(value) && isSupportedImage(value)).map(image.parse);\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\n\nexport const enum BACKGROUND_ORIGIN {\n BORDER_BOX = 0,\n PADDING_BOX = 1,\n CONTENT_BOX = 2\n}\n\nexport type BackgroundOrigin = BACKGROUND_ORIGIN[];\n\nexport const backgroundOrigin: IPropertyListDescriptor<BackgroundOrigin> = {\n name: 'background-origin',\n initialValue: 'border-box',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): BackgroundOrigin => {\n return tokens.map(token => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return BACKGROUND_ORIGIN.PADDING_BOX;\n case 'content-box':\n return BACKGROUND_ORIGIN.CONTENT_BOX;\n }\n }\n return BACKGROUND_ORIGIN.BORDER_BOX;\n });\n }\n};\n","import {PropertyDescriptorParsingType, IPropertyListDescriptor} from '../IPropertyDescriptor';\nimport {CSSValue, parseFunctionArgs} from '../syntax/parser';\nimport {isLengthPercentage, LengthPercentageTuple, parseLengthPercentageTuple} from '../types/length-percentage';\nexport type BackgroundPosition = BackgroundImagePosition[];\n\nexport type BackgroundImagePosition = LengthPercentageTuple;\n\nexport const backgroundPosition: IPropertyListDescriptor<BackgroundPosition> = {\n name: 'background-position',\n initialValue: '0% 0%',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (tokens: CSSValue[]): BackgroundPosition => {\n return parseFunctionArgs(tokens)\n .map((values: CSSValue[]) => values.filter(isLengthPercentage))\n .map(parseLengthPercentageTuple);\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken, parseFunctionArgs} from '../syntax/parser';\nimport {isLengthPercentage, LengthPercentage} from '../types/length-percentage';\nimport {StringValueToken} from '../syntax/tokenizer';\n\nexport enum BACKGROUND_SIZE {\n AUTO = 'auto',\n CONTAIN = 'contain',\n COVER = 'cover'\n}\n\nexport type BackgroundSizeInfo = LengthPercentage | StringValueToken;\nexport type BackgroundSize = BackgroundSizeInfo[][];\n\nexport const backgroundSize: IPropertyListDescriptor<BackgroundSize> = {\n name: 'background-size',\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): BackgroundSize => {\n return parseFunctionArgs(tokens).map(values => values.filter(isBackgroundSizeInfoToken));\n }\n};\n\nconst isBackgroundSizeInfoToken = (value: CSSValue): value is BackgroundSizeInfo =>\n isIdentToken(value) || isLengthPercentage(value);\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum BORDER_STYLE {\n NONE = 0,\n SOLID = 1\n}\n\nconst borderStyleForSide = (side: string): IPropertyIdentValueDescriptor<BORDER_STYLE> => ({\n name: `border-${side}-style`,\n initialValue: 'solid',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (style: string): BORDER_STYLE => {\n switch (style) {\n case 'none':\n return BORDER_STYLE.NONE;\n }\n return BORDER_STYLE.SOLID;\n }\n});\n\nexport const borderTopStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('top');\nexport const borderRightStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('right');\nexport const borderBottomStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('bottom');\nexport const borderLeftStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('left');\n","import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nconst borderColorForSide = (side: string): IPropertyTypeValueDescriptor => ({\n name: `border-${side}-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n});\n\nexport const borderTopColor: IPropertyTypeValueDescriptor = borderColorForSide('top');\nexport const borderRightColor: IPropertyTypeValueDescriptor = borderColorForSide('right');\nexport const borderBottomColor: IPropertyTypeValueDescriptor = borderColorForSide('bottom');\nexport const borderLeftColor: IPropertyTypeValueDescriptor = borderColorForSide('left');\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\nimport {isLengthPercentage, LengthPercentageTuple, parseLengthPercentageTuple} from '../types/length-percentage';\nexport type BorderRadius = LengthPercentageTuple;\n\nconst borderRadiusForSide = (side: string): IPropertyListDescriptor<BorderRadius> => ({\n name: `border-radius-${side}`,\n initialValue: '0 0',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): BorderRadius => parseLengthPercentageTuple(tokens.filter(isLengthPercentage))\n});\n\nexport const borderTopLeftRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('top-left');\nexport const borderTopRightRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('top-right');\nexport const borderBottomRightRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('bottom-right');\nexport const borderBottomLeftRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('bottom-left');\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum FLOAT {\n NONE = 0,\n LEFT = 1,\n RIGHT = 2,\n INLINE_START = 3,\n INLINE_END = 4\n}\n\nexport const float: IPropertyIdentValueDescriptor<FLOAT> = {\n name: 'float',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (float: string) => {\n switch (float) {\n case 'left':\n return FLOAT.LEFT;\n case 'right':\n return FLOAT.RIGHT;\n case 'inline-start':\n return FLOAT.INLINE_START;\n case 'inline-end':\n return FLOAT.INLINE_END;\n }\n return FLOAT.NONE;\n }\n};\n","import {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isDimensionToken} from '../syntax/parser';\nconst borderWidthForSide = (side: string): IPropertyValueDescriptor<number> => ({\n name: `border-${side}-width`,\n initialValue: '0',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (token: CSSValue): number => {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n});\n\nexport const borderTopWidth: IPropertyValueDescriptor<number> = borderWidthForSide('top');\nexport const borderRightWidth: IPropertyValueDescriptor<number> = borderWidthForSide('right');\nexport const borderBottomWidth: IPropertyValueDescriptor<number> = borderWidthForSide('bottom');\nexport const borderLeftWidth: IPropertyValueDescriptor<number> = borderWidthForSide('left');\n","import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\n\nexport const color: IPropertyTypeValueDescriptor = {\n name: `color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\nexport const enum DISPLAY {\n NONE = 0,\n BLOCK = 1 << 1,\n INLINE = 1 << 2,\n RUN_IN = 1 << 3,\n FLOW = 1 << 4,\n FLOW_ROOT = 1 << 5,\n TABLE = 1 << 6,\n FLEX = 1 << 7,\n GRID = 1 << 8,\n RUBY = 1 << 9,\n SUBGRID = 1 << 10,\n LIST_ITEM = 1 << 11,\n TABLE_ROW_GROUP = 1 << 12,\n TABLE_HEADER_GROUP = 1 << 13,\n TABLE_FOOTER_GROUP = 1 << 14,\n TABLE_ROW = 1 << 15,\n TABLE_CELL = 1 << 16,\n TABLE_COLUMN_GROUP = 1 << 17,\n TABLE_COLUMN = 1 << 18,\n TABLE_CAPTION = 1 << 19,\n RUBY_BASE = 1 << 20,\n RUBY_TEXT = 1 << 21,\n RUBY_BASE_CONTAINER = 1 << 22,\n RUBY_TEXT_CONTAINER = 1 << 23,\n CONTENTS = 1 << 24,\n INLINE_BLOCK = 1 << 25,\n INLINE_LIST_ITEM = 1 << 26,\n INLINE_TABLE = 1 << 27,\n INLINE_FLEX = 1 << 28,\n INLINE_GRID = 1 << 29\n}\n\nexport type Display = number;\n\nexport const display: IPropertyListDescriptor<Display> = {\n name: 'display',\n initialValue: 'inline-block',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): Display => {\n return tokens.filter(isIdentToken).reduce((bit, token) => {\n return bit | parseDisplayValue(token.value);\n }, DISPLAY.NONE);\n }\n};\n\nconst parseDisplayValue = (display: string): Display => {\n switch (display) {\n case 'block':\n return DISPLAY.BLOCK;\n case 'inline':\n return DISPLAY.INLINE;\n case 'run-in':\n return DISPLAY.RUN_IN;\n case 'flow':\n return DISPLAY.FLOW;\n case 'flow-root':\n return DISPLAY.FLOW_ROOT;\n case 'table':\n return DISPLAY.TABLE;\n case 'flex':\n case '-webkit-flex':\n return DISPLAY.FLEX;\n case 'grid':\n case '-ms-grid':\n return DISPLAY.GRID;\n case 'ruby':\n return DISPLAY.RUBY;\n case 'subgrid':\n return DISPLAY.SUBGRID;\n case 'list-item':\n return DISPLAY.LIST_ITEM;\n case 'table-row-group':\n return DISPLAY.TABLE_ROW_GROUP;\n case 'table-header-group':\n return DISPLAY.TABLE_HEADER_GROUP;\n case 'table-footer-group':\n return DISPLAY.TABLE_FOOTER_GROUP;\n case 'table-row':\n return DISPLAY.TABLE_ROW;\n case 'table-cell':\n return DISPLAY.TABLE_CELL;\n case 'table-column-group':\n return DISPLAY.TABLE_COLUMN_GROUP;\n case 'table-column':\n return DISPLAY.TABLE_COLUMN;\n case 'table-caption':\n return DISPLAY.TABLE_CAPTION;\n case 'ruby-base':\n return DISPLAY.RUBY_BASE;\n case 'ruby-text':\n return DISPLAY.RUBY_TEXT;\n case 'ruby-base-container':\n return DISPLAY.RUBY_BASE_CONTAINER;\n case 'ruby-text-container':\n return DISPLAY.RUBY_TEXT_CONTAINER;\n case 'contents':\n return DISPLAY.CONTENTS;\n case 'inline-block':\n return DISPLAY.INLINE_BLOCK;\n case 'inline-list-item':\n return DISPLAY.INLINE_LIST_ITEM;\n case 'inline-table':\n return DISPLAY.INLINE_TABLE;\n case 'inline-flex':\n return DISPLAY.INLINE_FLEX;\n case 'inline-grid':\n return DISPLAY.INLINE_GRID;\n }\n\n return DISPLAY.NONE;\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum LINE_BREAK {\n NORMAL = 'normal',\n STRICT = 'strict'\n}\n\nexport const lineBreak: IPropertyIdentValueDescriptor<LINE_BREAK> = {\n name: 'line-break',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (lineBreak: string): LINE_BREAK => {\n switch (lineBreak) {\n case 'strict':\n return LINE_BREAK.STRICT;\n case 'normal':\n default:\n return LINE_BREAK.NORMAL;\n }\n }\n};\n","import {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\nexport const letterSpacing: IPropertyValueDescriptor<number> = {\n name: 'letter-spacing',\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'normal') {\n return 0;\n }\n\n if (token.type === TokenType.NUMBER_TOKEN) {\n return token.number;\n }\n\n if (token.type === TokenType.DIMENSION_TOKEN) {\n return token.number;\n }\n\n return 0;\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum LIST_STYLE_POSITION {\n INSIDE = 0,\n OUTSIDE = 1\n}\n\nexport const listStylePosition: IPropertyIdentValueDescriptor<LIST_STYLE_POSITION> = {\n name: 'list-style-position',\n initialValue: 'outside',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (position: string) => {\n switch (position) {\n case 'inside':\n return LIST_STYLE_POSITION.INSIDE;\n case 'outside':\n default:\n return LIST_STYLE_POSITION.OUTSIDE;\n }\n }\n};\n","import {IPropertyTokenValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\nimport {getAbsoluteValue, isLengthPercentage} from '../types/length-percentage';\nexport const lineHeight: IPropertyTokenValueDescriptor = {\n name: 'line-height',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.TOKEN_VALUE\n};\n\nexport const computeLineHeight = (token: CSSValue, fontSize: number): number => {\n if (isIdentToken(token) && token.value === 'normal') {\n return 1.2 * fontSize;\n } else if (token.type === TokenType.NUMBER_TOKEN) {\n return fontSize * token.number;\n } else if (isLengthPercentage(token)) {\n return getAbsoluteValue(token, fontSize);\n }\n\n return fontSize;\n};\n","import {TokenType} from '../syntax/tokenizer';\nimport {ICSSImage, image} from '../types/image';\nimport {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\n\nexport const listStyleImage: IPropertyValueDescriptor<ICSSImage | null> = {\n name: 'list-style-image',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n return image.parse(token);\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum LIST_STYLE_TYPE {\n NONE = -1,\n DISC = 0,\n CIRCLE = 1,\n SQUARE = 2,\n DECIMAL = 3,\n CJK_DECIMAL = 4,\n DECIMAL_LEADING_ZERO = 5,\n LOWER_ROMAN = 6,\n UPPER_ROMAN = 7,\n LOWER_GREEK = 8,\n LOWER_ALPHA = 9,\n UPPER_ALPHA = 10,\n ARABIC_INDIC = 11,\n ARMENIAN = 12,\n BENGALI = 13,\n CAMBODIAN = 14,\n CJK_EARTHLY_BRANCH = 15,\n CJK_HEAVENLY_STEM = 16,\n CJK_IDEOGRAPHIC = 17,\n DEVANAGARI = 18,\n ETHIOPIC_NUMERIC = 19,\n GEORGIAN = 20,\n GUJARATI = 21,\n GURMUKHI = 22,\n HEBREW = 22,\n HIRAGANA = 23,\n HIRAGANA_IROHA = 24,\n JAPANESE_FORMAL = 25,\n JAPANESE_INFORMAL = 26,\n KANNADA = 27,\n KATAKANA = 28,\n KATAKANA_IROHA = 29,\n KHMER = 30,\n KOREAN_HANGUL_FORMAL = 31,\n KOREAN_HANJA_FORMAL = 32,\n KOREAN_HANJA_INFORMAL = 33,\n LAO = 34,\n LOWER_ARMENIAN = 35,\n MALAYALAM = 36,\n MONGOLIAN = 37,\n MYANMAR = 38,\n ORIYA = 39,\n PERSIAN = 40,\n SIMP_CHINESE_FORMAL = 41,\n SIMP_CHINESE_INFORMAL = 42,\n TAMIL = 43,\n TELUGU = 44,\n THAI = 45,\n TIBETAN = 46,\n TRAD_CHINESE_FORMAL = 47,\n TRAD_CHINESE_INFORMAL = 48,\n UPPER_ARMENIAN = 49,\n DISCLOSURE_OPEN = 50,\n DISCLOSURE_CLOSED = 51\n}\n\nexport const listStyleType: IPropertyIdentValueDescriptor<LIST_STYLE_TYPE> = {\n name: 'list-style-type',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (type: string) => {\n switch (type) {\n case 'disc':\n return LIST_STYLE_TYPE.DISC;\n case 'circle':\n return LIST_STYLE_TYPE.CIRCLE;\n case 'square':\n return LIST_STYLE_TYPE.SQUARE;\n case 'decimal':\n return LIST_STYLE_TYPE.DECIMAL;\n case 'cjk-decimal':\n return LIST_STYLE_TYPE.CJK_DECIMAL;\n case 'decimal-leading-zero':\n return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;\n case 'lower-roman':\n return LIST_STYLE_TYPE.LOWER_ROMAN;\n case 'upper-roman':\n return LIST_STYLE_TYPE.UPPER_ROMAN;\n case 'lower-greek':\n return LIST_STYLE_TYPE.LOWER_GREEK;\n case 'lower-alpha':\n return LIST_STYLE_TYPE.LOWER_ALPHA;\n case 'upper-alpha':\n return LIST_STYLE_TYPE.UPPER_ALPHA;\n case 'arabic-indic':\n return LIST_STYLE_TYPE.ARABIC_INDIC;\n case 'armenian':\n return LIST_STYLE_TYPE.ARMENIAN;\n case 'bengali':\n return LIST_STYLE_TYPE.BENGALI;\n case 'cambodian':\n return LIST_STYLE_TYPE.CAMBODIAN;\n case 'cjk-earthly-branch':\n return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;\n case 'cjk-heavenly-stem':\n return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;\n case 'cjk-ideographic':\n return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;\n case 'devanagari':\n return LIST_STYLE_TYPE.DEVANAGARI;\n case 'ethiopic-numeric':\n return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;\n case 'georgian':\n return LIST_STYLE_TYPE.GEORGIAN;\n case 'gujarati':\n return LIST_STYLE_TYPE.GUJARATI;\n case 'gurmukhi':\n return LIST_STYLE_TYPE.GURMUKHI;\n case 'hebrew':\n return LIST_STYLE_TYPE.HEBREW;\n case 'hiragana':\n return LIST_STYLE_TYPE.HIRAGANA;\n case 'hiragana-iroha':\n return LIST_STYLE_TYPE.HIRAGANA_IROHA;\n case 'japanese-formal':\n return LIST_STYLE_TYPE.JAPANESE_FORMAL;\n case 'japanese-informal':\n return LIST_STYLE_TYPE.JAPANESE_INFORMAL;\n case 'kannada':\n return LIST_STYLE_TYPE.KANNADA;\n case 'katakana':\n return LIST_STYLE_TYPE.KATAKANA;\n case 'katakana-iroha':\n return LIST_STYLE_TYPE.KATAKANA_IROHA;\n case 'khmer':\n return LIST_STYLE_TYPE.KHMER;\n case 'korean-hangul-formal':\n return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;\n case 'korean-hanja-formal':\n return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;\n case 'korean-hanja-informal':\n return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;\n case 'lao':\n return LIST_STYLE_TYPE.LAO;\n case 'lower-armenian':\n return LIST_STYLE_TYPE.LOWER_ARMENIAN;\n case 'malayalam':\n return LIST_STYLE_TYPE.MALAYALAM;\n case 'mongolian':\n return LIST_STYLE_TYPE.MONGOLIAN;\n case 'myanmar':\n return LIST_STYLE_TYPE.MYANMAR;\n case 'oriya':\n return LIST_STYLE_TYPE.ORIYA;\n case 'persian':\n return LIST_STYLE_TYPE.PERSIAN;\n case 'simp-chinese-formal':\n return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;\n case 'simp-chinese-informal':\n return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;\n case 'tamil':\n return LIST_STYLE_TYPE.TAMIL;\n case 'telugu':\n return LIST_STYLE_TYPE.TELUGU;\n case 'thai':\n return LIST_STYLE_TYPE.THAI;\n case 'tibetan':\n return LIST_STYLE_TYPE.TIBETAN;\n case 'trad-chinese-formal':\n return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;\n case 'trad-chinese-informal':\n return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;\n case 'upper-armenian':\n return LIST_STYLE_TYPE.UPPER_ARMENIAN;\n case 'disclosure-open':\n return LIST_STYLE_TYPE.DISCLOSURE_OPEN;\n case 'disclosure-closed':\n return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;\n case 'none':\n default:\n return LIST_STYLE_TYPE.NONE;\n }\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\nexport enum OVERFLOW {\n VISIBLE = 0,\n HIDDEN = 1,\n SCROLL = 2,\n AUTO = 3\n}\n\nexport const overflow: IPropertyListDescriptor<OVERFLOW[]> = {\n name: 'overflow',\n initialValue: 'visible',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): OVERFLOW[] => {\n return tokens.filter(isIdentToken).map(overflow => {\n switch (overflow.value) {\n case 'hidden':\n return OVERFLOW.HIDDEN;\n case 'scroll':\n return OVERFLOW.SCROLL;\n case 'auto':\n return OVERFLOW.AUTO;\n case 'visible':\n default:\n return OVERFLOW.VISIBLE;\n }\n });\n }\n};\n","import {IPropertyTokenValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\n\nconst marginForSide = (side: string): IPropertyTokenValueDescriptor => ({\n name: `margin-${side}`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TOKEN_VALUE\n});\n\nexport const marginTop: IPropertyTokenValueDescriptor = marginForSide('top');\nexport const marginRight: IPropertyTokenValueDescriptor = marginForSide('right');\nexport const marginBottom: IPropertyTokenValueDescriptor = marginForSide('bottom');\nexport const marginLeft: IPropertyTokenValueDescriptor = marginForSide('left');\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum OVERFLOW_WRAP {\n NORMAL = 'normal',\n BREAK_WORD = 'break-word'\n}\n\nexport const overflowWrap: IPropertyIdentValueDescriptor<OVERFLOW_WRAP> = {\n name: 'overflow-wrap',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (overflow: string) => {\n switch (overflow) {\n case 'break-word':\n return OVERFLOW_WRAP.BREAK_WORD;\n case 'normal':\n default:\n return OVERFLOW_WRAP.NORMAL;\n }\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum TEXT_ALIGN {\n LEFT = 0,\n CENTER = 1,\n RIGHT = 2\n}\n\nexport const textAlign: IPropertyIdentValueDescriptor<TEXT_ALIGN> = {\n name: 'text-align',\n initialValue: 'left',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (textAlign: string) => {\n switch (textAlign) {\n case 'right':\n return TEXT_ALIGN.RIGHT;\n case 'center':\n case 'justify':\n return TEXT_ALIGN.CENTER;\n case 'left':\n default:\n return TEXT_ALIGN.LEFT;\n }\n }\n};\n","import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\n\nconst paddingForSide = (side: string): IPropertyTypeValueDescriptor => ({\n name: `padding-${side}`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'length-percentage'\n});\n\nexport const paddingTop: IPropertyTypeValueDescriptor = paddingForSide('top');\nexport const paddingRight: IPropertyTypeValueDescriptor = paddingForSide('right');\nexport const paddingBottom: IPropertyTypeValueDescriptor = paddingForSide('bottom');\nexport const paddingLeft: IPropertyTypeValueDescriptor = paddingForSide('left');\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum POSITION {\n STATIC = 0,\n RELATIVE = 1,\n ABSOLUTE = 2,\n FIXED = 3,\n STICKY = 4\n}\n\nexport const position: IPropertyIdentValueDescriptor<POSITION> = {\n name: 'position',\n initialValue: 'static',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (position: string) => {\n switch (position) {\n case 'relative':\n return POSITION.RELATIVE;\n case 'absolute':\n return POSITION.ABSOLUTE;\n case 'fixed':\n return POSITION.FIXED;\n case 'sticky':\n return POSITION.STICKY;\n }\n\n return POSITION.STATIC;\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum TEXT_TRANSFORM {\n NONE = 0,\n LOWERCASE = 1,\n UPPERCASE = 2,\n CAPITALIZE = 3\n}\n\nexport const textTransform: IPropertyIdentValueDescriptor<TEXT_TRANSFORM> = {\n name: 'text-transform',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (textTransform: string) => {\n switch (textTransform) {\n case 'uppercase':\n return TEXT_TRANSFORM.UPPERCASE;\n case 'lowercase':\n return TEXT_TRANSFORM.LOWERCASE;\n case 'capitalize':\n return TEXT_TRANSFORM.CAPITALIZE;\n }\n\n return TEXT_TRANSFORM.NONE;\n }\n};\n","import {PropertyDescriptorParsingType, IPropertyListDescriptor} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentWithValue, parseFunctionArgs} from '../syntax/parser';\nimport {ZERO_LENGTH} from '../types/length-percentage';\nimport {color, Color, COLORS} from '../types/color';\nimport {isLength, Length} from '../types/length';\n\nexport type TextShadow = TextShadowItem[];\ninterface TextShadowItem {\n color: Color;\n offsetX: Length;\n offsetY: Length;\n blur: Length;\n}\n\nexport const textShadow: IPropertyListDescriptor<TextShadow> = {\n name: 'text-shadow',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (tokens: CSSValue[]): TextShadow => {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n\n return parseFunctionArgs(tokens).map((values: CSSValue[]) => {\n const shadow: TextShadowItem = {\n color: COLORS.TRANSPARENT,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH\n };\n let c = 0;\n for (let i = 0; i < values.length; i++) {\n const token = values[i];\n if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n } else if (c === 1) {\n shadow.offsetY = token;\n } else {\n shadow.blur = token;\n }\n c++;\n } else {\n shadow.color = color.parse(token);\n }\n }\n return shadow;\n });\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum VISIBILITY {\n VISIBLE = 0,\n HIDDEN = 1,\n COLLAPSE = 2\n}\n\nexport const visibility: IPropertyIdentValueDescriptor<VISIBILITY> = {\n name: 'visible',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (visibility: string) => {\n switch (visibility) {\n case 'hidden':\n return VISIBILITY.HIDDEN;\n case 'collapse':\n return VISIBILITY.COLLAPSE;\n case 'visible':\n default:\n return VISIBILITY.VISIBLE;\n }\n }\n};\n","import {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\nimport {NumberValueToken, TokenType} from '../syntax/tokenizer';\nexport type Matrix = [number, number, number, number, number, number];\nexport type Transform = Matrix | null;\n\nexport const transform: IPropertyValueDescriptor<Transform> = {\n name: 'transform',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n if (token.type === TokenType.FUNCTION) {\n const transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];\n if (typeof transformFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported transform function \"${token.name}\"`);\n }\n return transformFunction(token.values);\n }\n\n return null;\n }\n};\n\nconst matrix = (args: CSSValue[]): Transform => {\n const values = args.filter(arg => arg.type === TokenType.NUMBER_TOKEN).map((arg: NumberValueToken) => arg.number);\n\n return values.length === 6 ? (values as Matrix) : null;\n};\n\n// doesn't support 3D transforms at the moment\nconst matrix3d = (args: CSSValue[]): Transform => {\n const values = args.filter(arg => arg.type === TokenType.NUMBER_TOKEN).map((arg: NumberValueToken) => arg.number);\n\n const [a1, b1, {}, {}, a2, b2, {}, {}, {}, {}, {}, {}, a4, b4, {}, {}] = values;\n\n return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;\n};\n\nconst SUPPORTED_TRANSFORM_FUNCTIONS: {\n [key: string]: (args: CSSValue[]) => Transform;\n} = {\n matrix: matrix,\n matrix3d: matrix3d\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\nimport {isLengthPercentage, LengthPercentage} from '../types/length-percentage';\nimport {FLAG_INTEGER, TokenType} from '../syntax/tokenizer';\nexport type TransformOrigin = [LengthPercentage, LengthPercentage];\n\nconst DEFAULT_VALUE: LengthPercentage = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 50,\n flags: FLAG_INTEGER\n};\nconst DEFAULT: TransformOrigin = [DEFAULT_VALUE, DEFAULT_VALUE];\n\nexport const transformOrigin: IPropertyListDescriptor<TransformOrigin> = {\n name: 'transform-origin',\n initialValue: '50% 50%',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]) => {\n const origins: LengthPercentage[] = tokens.filter(isLengthPercentage);\n\n if (origins.length !== 2) {\n return DEFAULT;\n }\n\n return [origins[0], origins[1]];\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum WORD_BREAK {\n NORMAL = 'normal',\n BREAK_ALL = 'break-all',\n KEEP_ALL = 'keep-all'\n}\n\nexport const wordBreak: IPropertyIdentValueDescriptor<WORD_BREAK> = {\n name: 'word-break',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (wordBreak: string): WORD_BREAK => {\n switch (wordBreak) {\n case 'break-all':\n return WORD_BREAK.BREAK_ALL;\n case 'keep-all':\n return WORD_BREAK.KEEP_ALL;\n case 'normal':\n default:\n return WORD_BREAK.NORMAL;\n }\n }\n};\n","import {IPropertyIdentValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nexport enum FONT_STYLE {\n NORMAL = 'normal',\n ITALIC = 'italic',\n OBLIQUE = 'oblique'\n}\n\nexport const fontStyle: IPropertyIdentValueDescriptor<FONT_STYLE> = {\n name: 'font-style',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (overflow: string) => {\n switch (overflow) {\n case 'oblique':\n return FONT_STYLE.OBLIQUE;\n case 'italic':\n return FONT_STYLE.ITALIC;\n case 'normal':\n default:\n return FONT_STYLE.NORMAL;\n }\n }\n};\n","import {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isNumberToken} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\n\ninterface zIndex {\n order: number;\n auto: boolean;\n}\n\nexport const zIndex: IPropertyValueDescriptor<zIndex> = {\n name: 'z-index',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (token: CSSValue): zIndex => {\n if (token.type === TokenType.IDENT_TOKEN) {\n return {auto: true, order: 0};\n }\n\n if (isNumberToken(token)) {\n return {auto: false, order: token.number};\n }\n\n throw new Error(`Invalid z-index number parsed`);\n }\n};\n","import {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isNumberToken} from '../syntax/parser';\nexport const opacity: IPropertyValueDescriptor<number> = {\n name: 'opacity',\n initialValue: '1',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (token: CSSValue): number => {\n if (isNumberToken(token)) {\n return token.number;\n }\n return 1;\n }\n};\n","import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\n\nexport const textDecorationColor: IPropertyTypeValueDescriptor = {\n name: `text-decoration-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\n\nexport const enum TEXT_DECORATION_LINE {\n NONE = 0,\n UNDERLINE = 1,\n OVERLINE = 2,\n LINE_THROUGH = 3,\n BLINK = 4\n}\n\nexport type TextDecorationLine = TEXT_DECORATION_LINE[];\n\nexport const textDecorationLine: IPropertyListDescriptor<TextDecorationLine> = {\n name: 'text-decoration-line',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]): TextDecorationLine => {\n return tokens\n .filter(isIdentToken)\n .map(token => {\n switch (token.value) {\n case 'underline':\n return TEXT_DECORATION_LINE.UNDERLINE;\n case 'overline':\n return TEXT_DECORATION_LINE.OVERLINE;\n case 'line-through':\n return TEXT_DECORATION_LINE.LINE_THROUGH;\n case 'none':\n return TEXT_DECORATION_LINE.BLINK;\n }\n return TEXT_DECORATION_LINE.NONE;\n })\n .filter(line => line !== TEXT_DECORATION_LINE.NONE);\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\n\nexport type FONT_FAMILY = string;\n\nexport type FontFamily = FONT_FAMILY[];\n\nexport const fontFamily: IPropertyListDescriptor<FontFamily> = {\n name: `font-family`,\n initialValue: '',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]) => {\n const accumulator: string[] = [];\n const results: string[] = [];\n tokens.forEach(token => {\n switch (token.type) {\n case TokenType.IDENT_TOKEN:\n case TokenType.STRING_TOKEN:\n accumulator.push(token.value);\n break;\n case TokenType.NUMBER_TOKEN:\n accumulator.push(token.number.toString());\n break;\n case TokenType.COMMA_TOKEN:\n results.push(accumulator.join(' '));\n accumulator.length = 0;\n break;\n }\n });\n if (accumulator.length) {\n results.push(accumulator.join(' '));\n }\n return results.map(result => (result.indexOf(' ') === -1 ? result : `'${result}'`));\n }\n};\n","import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\n\nexport const fontSize: IPropertyTypeValueDescriptor = {\n name: `font-size`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'length'\n};\n","import {IPropertyValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken, isNumberToken} from '../syntax/parser';\nexport const fontWeight: IPropertyValueDescriptor<number> = {\n name: 'font-weight',\n initialValue: 'normal',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (token: CSSValue): number => {\n if (isNumberToken(token)) {\n return token.number;\n }\n\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'bold':\n return 700;\n case 'normal':\n default:\n return 400;\n }\n }\n\n return 400;\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken} from '../syntax/parser';\nexport const fontVariant: IPropertyListDescriptor<string[]> = {\n name: 'font-variant',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (tokens: CSSValue[]): string[] => {\n return tokens.filter(isIdentToken).map(token => token.value);\n }\n};\n","import {Bounds} from '../css/layout/bounds';\nimport {\n isBodyElement,\n isCanvasElement,\n isElementNode,\n isHTMLElementNode,\n isIFrameElement,\n isImageElement,\n isScriptElement,\n isSelectElement,\n isStyleElement,\n isSVGElementNode,\n isTextareaElement,\n isTextNode\n} from './node-parser';\nimport {Logger} from '../core/logger';\nimport {isIdentToken, nonFunctionArgSeparator} from '../css/syntax/parser';\nimport {TokenType} from '../css/syntax/tokenizer';\nimport {CounterState, createCounterText} from '../css/types/functions/counter';\nimport {LIST_STYLE_TYPE, listStyleType} from '../css/property-descriptors/list-style-type';\nimport {CSSParsedCounterDeclaration, CSSParsedPseudoDeclaration} from '../css/index';\nimport {getQuote} from '../css/property-descriptors/quotes';\n\nexport interface CloneOptions {\n id: string;\n ignoreElements?: (element: Element) => boolean;\n onclone?: (document: Document) => void;\n}\n\nexport type CloneConfigurations = CloneOptions & {\n inlineImages: boolean;\n copyStyles: boolean;\n};\n\nconst IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';\n\nexport class DocumentCloner {\n private readonly scrolledElements: [Element, number, number][];\n private readonly options: CloneConfigurations;\n private readonly referenceElement: HTMLElement;\n clonedReferenceElement?: HTMLElement;\n private readonly documentElement: HTMLElement;\n private readonly counters: CounterState;\n private quoteDepth: number;\n\n constructor(element: HTMLElement, options: CloneConfigurations) {\n this.options = options;\n this.scrolledElements = [];\n this.referenceElement = element;\n this.counters = new CounterState();\n this.quoteDepth = 0;\n if (!element.ownerDocument) {\n throw new Error('Cloned element does not have an owner document');\n }\n\n this.documentElement = this.cloneNode(element.ownerDocument.documentElement) as HTMLElement;\n }\n\n toIFrame(ownerDocument: Document, windowSize: Bounds): Promise<HTMLIFrameElement> {\n const iframe: HTMLIFrameElement = createIFrameContainer(ownerDocument, windowSize);\n\n if (!iframe.contentWindow) {\n return Promise.reject(`Unable to find iframe window`);\n }\n\n const scrollX = (ownerDocument.defaultView as Window).pageXOffset;\n const scrollY = (ownerDocument.defaultView as Window).pageYOffset;\n\n const cloneWindow = iframe.contentWindow;\n const documentClone: Document = cloneWindow.document;\n\n /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle\n if window url is about:blank, we can assign the url to current by writing onto the document\n */\n\n const iframeLoad = iframeLoader(iframe).then(async () => {\n this.scrolledElements.forEach(restoreNodeScroll);\n if (cloneWindow) {\n cloneWindow.scrollTo(windowSize.left, windowSize.top);\n if (\n /(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&\n (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)\n ) {\n documentClone.documentElement.style.top = -windowSize.top + 'px';\n documentClone.documentElement.style.left = -windowSize.left + 'px';\n documentClone.documentElement.style.position = 'absolute';\n }\n }\n\n const onclone = this.options.onclone;\n\n if (typeof this.clonedReferenceElement === 'undefined') {\n return Promise.reject(`Error finding the ${this.referenceElement.nodeName} in the cloned document`);\n }\n\n if (documentClone.fonts && documentClone.fonts.ready) {\n await documentClone.fonts.ready;\n }\n\n if (typeof onclone === 'function') {\n return Promise.resolve()\n .then(() => onclone(documentClone))\n .then(() => iframe);\n }\n\n return iframe;\n });\n\n documentClone.open();\n documentClone.write(`${serializeDoctype(document.doctype)}<html></html>`);\n // Chrome scrolls the parent document for some reason after the write to the cloned window???\n restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);\n documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);\n documentClone.close();\n\n return iframeLoad;\n }\n\n createElementClone<T extends HTMLElement | SVGElement>(node: T): HTMLElement | SVGElement {\n if (isCanvasElement(node)) {\n return this.createCanvasClone(node);\n }\n /*\n if (isIFrameElement(node)) {\n return this.createIFrameClone(node);\n }\n*/\n if (isStyleElement(node)) {\n return this.createStyleClone(node);\n }\n\n const clone = node.cloneNode(false) as T;\n // @ts-ignore\n if (isImageElement(clone) && clone.loading === 'lazy') {\n // @ts-ignore\n clone.loading = 'eager';\n }\n\n return clone;\n }\n\n createStyleClone(node: HTMLStyleElement): HTMLStyleElement {\n try {\n const sheet = node.sheet as CSSStyleSheet | undefined;\n if (sheet && sheet.cssRules) {\n const css: string = [].slice.call(sheet.cssRules, 0).reduce((css: string, rule: CSSRule) => {\n if (rule && typeof rule.cssText === 'string') {\n return css + rule.cssText;\n }\n return css;\n }, '');\n const style = node.cloneNode(false) as HTMLStyleElement;\n style.textContent = css;\n return style;\n }\n } catch (e) {\n // accessing node.sheet.cssRules throws a DOMException\n Logger.getInstance(this.options.id).error('Unable to access cssRules property', e);\n if (e.name !== 'SecurityError') {\n throw e;\n }\n }\n return node.cloneNode(false) as HTMLStyleElement;\n }\n\n createCanvasClone(canvas: HTMLCanvasElement): HTMLImageElement | HTMLCanvasElement {\n if (this.options.inlineImages && canvas.ownerDocument) {\n const img = canvas.ownerDocument.createElement('img');\n try {\n img.src = canvas.toDataURL();\n return img;\n } catch (e) {\n Logger.getInstance(this.options.id).info(`Unable to clone canvas contents, canvas is tainted`);\n }\n }\n\n const clonedCanvas = canvas.cloneNode(false) as HTMLCanvasElement;\n\n try {\n clonedCanvas.width = canvas.width;\n clonedCanvas.height = canvas.height;\n const ctx = canvas.getContext('2d');\n const clonedCtx = clonedCanvas.getContext('2d');\n if (clonedCtx) {\n if (ctx) {\n clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);\n } else {\n clonedCtx.drawImage(canvas, 0, 0);\n }\n }\n return clonedCanvas;\n } catch (e) {}\n\n return clonedCanvas;\n }\n /*\n createIFrameClone(iframe: HTMLIFrameElement) {\n const tempIframe = <HTMLIFrameElement>iframe.cloneNode(false);\n const iframeKey = generateIframeKey();\n tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);\n\n const {width, height} = parseBounds(iframe);\n\n this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(iframe, this.options)\n .then(documentElement => {\n return this.renderer(\n documentElement,\n {\n allowTaint: this.options.allowTaint,\n backgroundColor: '#ffffff',\n canvas: null,\n imageTimeout: this.options.imageTimeout,\n logging: this.options.logging,\n proxy: this.options.proxy,\n removeContainer: this.options.removeContainer,\n scale: this.options.scale,\n foreignObjectRendering: this.options.foreignObjectRendering,\n useCORS: this.options.useCORS,\n target: new CanvasRenderer(),\n width,\n height,\n x: 0,\n y: 0,\n windowWidth: documentElement.ownerDocument.defaultView.innerWidth,\n windowHeight: documentElement.ownerDocument.defaultView.innerHeight,\n scrollX: documentElement.ownerDocument.defaultView.pageXOffset,\n scrollY: documentElement.ownerDocument.defaultView.pageYOffset\n },\n );\n })\n .then(\n (canvas: HTMLCanvasElement) =>\n new Promise((resolve, reject) => {\n const iframeCanvas = document.createElement('img');\n iframeCanvas.onload = () => resolve(canvas);\n iframeCanvas.onerror = (event) => {\n // Empty iframes may result in empty \"data:,\" URLs, which are invalid from the <img>'s point of view\n // and instead of `onload` cause `onerror` and unhandled rejection warnings\n // https://github.com/niklasvh/html2canvas/issues/1502\n iframeCanvas.src == 'data:,' ? resolve(canvas) : reject(event);\n };\n iframeCanvas.src = canvas.toDataURL();\n if (tempIframe.parentNode && iframe.ownerDocument && iframe.ownerDocument.defaultView) {\n tempIframe.parentNode.replaceChild(\n copyCSSStyles(\n iframe.ownerDocument.defaultView.getComputedStyle(iframe),\n iframeCanvas\n ),\n tempIframe\n );\n }\n })\n );\n return tempIframe;\n }\n*/\n cloneNode(node: Node): Node {\n if (isTextNode(node)) {\n return document.createTextNode(node.data);\n }\n\n if (!node.ownerDocument) {\n return node.cloneNode(false);\n }\n\n const window = node.ownerDocument.defaultView;\n\n if (window && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {\n const clone = this.createElementClone(node);\n\n const style = window.getComputedStyle(node);\n const styleBefore = window.getComputedStyle(node, ':before');\n const styleAfter = window.getComputedStyle(node, ':after');\n\n if (this.referenceElement === node && isHTMLElementNode(clone)) {\n this.clonedReferenceElement = clone;\n }\n if (isBodyElement(clone)) {\n createPseudoHideStyles(clone);\n }\n\n const counters = this.counters.parse(new CSSParsedCounterDeclaration(style));\n const before = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE);\n\n for (let child = node.firstChild; child; child = child.nextSibling) {\n if (\n !isElementNode(child) ||\n (!isScriptElement(child) &&\n !child.hasAttribute(IGNORE_ATTRIBUTE) &&\n (typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))\n ) {\n if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {\n clone.appendChild(this.cloneNode(child));\n }\n }\n }\n\n if (before) {\n clone.insertBefore(before, clone.firstChild);\n }\n\n const after = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER);\n if (after) {\n clone.appendChild(after);\n }\n\n this.counters.pop(counters);\n\n if (style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node)) {\n copyCSSStyles(style, clone);\n }\n\n //this.inlineAllImages(clone);\n\n if (node.scrollTop !== 0 || node.scrollLeft !== 0) {\n this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);\n }\n\n if (\n (isTextareaElement(node) || isSelectElement(node)) &&\n (isTextareaElement(clone) || isSelectElement(clone))\n ) {\n clone.value = node.value;\n }\n\n return clone;\n }\n\n return node.cloneNode(false);\n }\n\n resolvePseudoContent(\n node: Element,\n clone: Element,\n style: CSSStyleDeclaration,\n pseudoElt: PseudoElementType\n ): HTMLElement | void {\n if (!style) {\n return;\n }\n\n const value = style.content;\n const document = clone.ownerDocument;\n if (!document || !value || value === 'none' || value === '-moz-alt-content' || style.display === 'none') {\n return;\n }\n\n this.counters.parse(new CSSParsedCounterDeclaration(style));\n const declaration = new CSSParsedPseudoDeclaration(style);\n\n const anonymousReplacedElement = document.createElement('html2canvaspseudoelement');\n copyCSSStyles(style, anonymousReplacedElement);\n\n declaration.content.forEach(token => {\n if (token.type === TokenType.STRING_TOKEN) {\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n } else if (token.type === TokenType.URL_TOKEN) {\n const img = document.createElement('img');\n img.src = token.value;\n img.style.opacity = '1';\n anonymousReplacedElement.appendChild(img);\n } else if (token.type === TokenType.FUNCTION) {\n if (token.name === 'attr') {\n const attr = token.values.filter(isIdentToken);\n if (attr.length) {\n anonymousReplacedElement.appendChild(\n document.createTextNode(node.getAttribute(attr[0].value) || '')\n );\n }\n } else if (token.name === 'counter') {\n const [counter, counterStyle] = token.values.filter(nonFunctionArgSeparator);\n if (counter && isIdentToken(counter)) {\n const counterState = this.counters.getCounterValue(counter.value);\n const counterType =\n counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(counterStyle.value)\n : LIST_STYLE_TYPE.DECIMAL;\n\n anonymousReplacedElement.appendChild(\n document.createTextNode(createCounterText(counterState, counterType, false))\n );\n }\n } else if (token.name === 'counters') {\n const [counter, delim, counterStyle] = token.values.filter(nonFunctionArgSeparator);\n if (counter && isIdentToken(counter)) {\n const counterStates = this.counters.getCounterValues(counter.value);\n const counterType =\n counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(counterStyle.value)\n : LIST_STYLE_TYPE.DECIMAL;\n const separator = delim && delim.type === TokenType.STRING_TOKEN ? delim.value : '';\n const text = counterStates\n .map(value => createCounterText(value, counterType, false))\n .join(separator);\n\n anonymousReplacedElement.appendChild(document.createTextNode(text));\n }\n } else {\n // console.log('FUNCTION_TOKEN', token);\n }\n } else if (token.type === TokenType.IDENT_TOKEN) {\n switch (token.value) {\n case 'open-quote':\n anonymousReplacedElement.appendChild(\n document.createTextNode(getQuote(declaration.quotes, this.quoteDepth++, true))\n );\n break;\n case 'close-quote':\n anonymousReplacedElement.appendChild(\n document.createTextNode(getQuote(declaration.quotes, --this.quoteDepth, false))\n );\n break;\n default:\n // safari doesn't parse string tokens correctly because of lack of quotes\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n }\n }\n });\n\n anonymousReplacedElement.className = `${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE} ${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}`;\n const newClassName =\n pseudoElt === PseudoElementType.BEFORE\n ? ` ${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE}`\n : ` ${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}`;\n\n if (isSVGElementNode(clone)) {\n clone.className.baseValue += newClassName;\n } else {\n clone.className += newClassName;\n }\n\n return anonymousReplacedElement;\n }\n\n static destroy(container: HTMLIFrameElement): boolean {\n if (container.parentNode) {\n container.parentNode.removeChild(container);\n return true;\n }\n return false;\n }\n}\n\nenum PseudoElementType {\n BEFORE,\n AFTER\n}\n\nconst createIFrameContainer = (ownerDocument: Document, bounds: Bounds): HTMLIFrameElement => {\n const cloneIframeContainer = ownerDocument.createElement('iframe');\n\n cloneIframeContainer.className = 'html2canvas-container';\n cloneIframeContainer.style.visibility = 'hidden';\n cloneIframeContainer.style.position = 'fixed';\n cloneIframeContainer.style.left = '-10000px';\n cloneIframeContainer.style.top = '0px';\n cloneIframeContainer.style.border = '0';\n cloneIframeContainer.width = bounds.width.toString();\n cloneIframeContainer.height = bounds.height.toString();\n cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it\n cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');\n ownerDocument.body.appendChild(cloneIframeContainer);\n\n return cloneIframeContainer;\n};\n\nconst iframeLoader = (iframe: HTMLIFrameElement): Promise<HTMLIFrameElement> => {\n return new Promise((resolve, reject) => {\n const cloneWindow = iframe.contentWindow;\n\n if (!cloneWindow) {\n return reject(`No window assigned for iframe`);\n }\n\n const documentClone = cloneWindow.document;\n\n cloneWindow.onload = iframe.onload = documentClone.onreadystatechange = () => {\n cloneWindow.onload = iframe.onload = documentClone.onreadystatechange = null;\n const interval = setInterval(() => {\n if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {\n clearInterval(interval);\n resolve(iframe);\n }\n }, 50);\n };\n });\n};\n\nexport const copyCSSStyles = <T extends HTMLElement | SVGElement>(style: CSSStyleDeclaration, target: T): T => {\n // Edge does not provide value for cssText\n for (let i = style.length - 1; i >= 0; i--) {\n const property = style.item(i);\n // Safari shows pseudoelements if content is set\n if (property !== 'content') {\n target.style.setProperty(property, style.getPropertyValue(property));\n }\n }\n return target;\n};\n\nconst serializeDoctype = (doctype?: DocumentType | null): string => {\n let str = '';\n if (doctype) {\n str += '<!DOCTYPE ';\n if (doctype.name) {\n str += doctype.name;\n }\n\n if (doctype.internalSubset) {\n str += doctype.internalSubset;\n }\n\n if (doctype.publicId) {\n str += `\"${doctype.publicId}\"`;\n }\n\n if (doctype.systemId) {\n str += `\"${doctype.systemId}\"`;\n }\n\n str += '>';\n }\n\n return str;\n};\n\nconst restoreOwnerScroll = (ownerDocument: Document | null, x: number, y: number) => {\n if (\n ownerDocument &&\n ownerDocument.defaultView &&\n (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)\n ) {\n ownerDocument.defaultView.scrollTo(x, y);\n }\n};\n\nconst restoreNodeScroll = ([element, x, y]: [HTMLElement, number, number]) => {\n element.scrollLeft = x;\n element.scrollTop = y;\n};\n\nconst PSEUDO_BEFORE = ':before';\nconst PSEUDO_AFTER = ':after';\nconst PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';\nconst PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';\n\nconst PSEUDO_HIDE_ELEMENT_STYLE = `{\n content: \"\" !important;\n display: none !important;\n}`;\n\nconst createPseudoHideStyles = (body: HTMLElement) => {\n createStyles(\n body,\n `.${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE}${PSEUDO_BEFORE}${PSEUDO_HIDE_ELEMENT_STYLE}\n .${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}${PSEUDO_AFTER}${PSEUDO_HIDE_ELEMENT_STYLE}`\n );\n};\n\nconst createStyles = (body: HTMLElement, styles: string) => {\n const document = body.ownerDocument;\n if (document) {\n const style = document.createElement('style');\n style.textContent = styles;\n body.appendChild(style);\n }\n};\n","export const contains = (bit: number, value: number): boolean => (bit & value) !== 0;\n","import {TokenType} from '../syntax/tokenizer';\nimport {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue} from '../syntax/parser';\n\nexport type Content = CSSValue[];\n\nexport const content: IPropertyListDescriptor<Content> = {\n name: 'content',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return [];\n }\n\n return tokens;\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isNumberToken, nonWhiteSpace} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\n\nexport interface COUNTER_INCREMENT {\n counter: string;\n increment: number;\n}\n\nexport type CounterIncrement = COUNTER_INCREMENT[] | null;\n\nexport const counterIncrement: IPropertyListDescriptor<CounterIncrement> = {\n name: 'counter-increment',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return null;\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return null;\n }\n\n const increments = [];\n const filtered = tokens.filter(nonWhiteSpace);\n\n for (let i = 0; i < filtered.length; i++) {\n const counter = filtered[i];\n const next = filtered[i + 1];\n if (counter.type === TokenType.IDENT_TOKEN) {\n const increment = next && isNumberToken(next) ? next.number : 1;\n increments.push({counter: counter.value, increment});\n }\n }\n\n return increments;\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentToken, isNumberToken, nonWhiteSpace} from '../syntax/parser';\n\nexport interface COUNTER_RESET {\n counter: string;\n reset: number;\n}\n\nexport type CounterReset = COUNTER_RESET[];\n\nexport const counterReset: IPropertyListDescriptor<CounterReset> = {\n name: 'counter-reset',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const resets = [];\n const filtered = tokens.filter(nonWhiteSpace);\n\n for (let i = 0; i < filtered.length; i++) {\n const counter = filtered[i];\n const next = filtered[i + 1];\n if (isIdentToken(counter) && counter.value !== 'none') {\n const reset = next && isNumberToken(next) ? next.number : 0;\n resets.push({counter: counter.value, reset});\n }\n }\n\n return resets;\n }\n};\n","import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';\nimport {CSSValue, isStringToken} from '../syntax/parser';\nimport {TokenType} from '../syntax/tokenizer';\n\nexport interface QUOTE {\n open: string;\n close: string;\n}\n\nexport type Quotes = QUOTE[] | null;\n\nexport const quotes: IPropertyListDescriptor<Quotes> = {\n name: 'quotes',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return null;\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return null;\n }\n\n const quotes = [];\n const filtered = tokens.filter(isStringToken);\n\n if (filtered.length % 2 !== 0) {\n return null;\n }\n\n for (let i = 0; i < filtered.length; i += 2) {\n const open = filtered[i].value;\n const close = filtered[i + 1].value;\n quotes.push({open, close});\n }\n\n return quotes;\n }\n};\n\nexport const getQuote = (quotes: Quotes, depth: number, open: boolean): string => {\n if (!quotes) {\n return '';\n }\n\n const quote = quotes[Math.min(depth, quotes.length - 1)];\n if (!quote) {\n return '';\n }\n\n return open ? quote.open : quote.close;\n};\n","import {PropertyDescriptorParsingType, IPropertyListDescriptor} from '../IPropertyDescriptor';\nimport {CSSValue, isIdentWithValue, parseFunctionArgs} from '../syntax/parser';\nimport {ZERO_LENGTH} from '../types/length-percentage';\nimport {color, Color} from '../types/color';\nimport {isLength, Length} from '../types/length';\n\nexport type BoxShadow = BoxShadowItem[];\ninterface BoxShadowItem {\n inset: boolean;\n color: Color;\n offsetX: Length;\n offsetY: Length;\n blur: Length;\n spread: Length;\n}\n\nexport const boxShadow: IPropertyListDescriptor<BoxShadow> = {\n name: 'box-shadow',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (tokens: CSSValue[]): BoxShadow => {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n\n return parseFunctionArgs(tokens).map((values: CSSValue[]) => {\n const shadow: BoxShadowItem = {\n color: 0x000000ff,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH,\n spread: ZERO_LENGTH,\n inset: false\n };\n let c = 0;\n for (let i = 0; i < values.length; i++) {\n const token = values[i];\n if (isIdentWithValue(token, 'inset')) {\n shadow.inset = true;\n } else if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n } else if (c === 1) {\n shadow.offsetY = token;\n } else if (c === 2) {\n shadow.blur = token;\n } else {\n shadow.spread = token;\n }\n c++;\n } else {\n shadow.color = color.parse(token);\n }\n }\n return shadow;\n });\n }\n};\n","import {CSSPropertyDescriptor, PropertyDescriptorParsingType} from './IPropertyDescriptor';\nimport {backgroundClip} from './property-descriptors/background-clip';\nimport {backgroundColor} from './property-descriptors/background-color';\nimport {backgroundImage} from './property-descriptors/background-image';\nimport {backgroundOrigin} from './property-descriptors/background-origin';\nimport {backgroundPosition} from './property-descriptors/background-position';\nimport {backgroundRepeat} from './property-descriptors/background-repeat';\nimport {backgroundSize} from './property-descriptors/background-size';\nimport {\n borderBottomColor,\n borderLeftColor,\n borderRightColor,\n borderTopColor\n} from './property-descriptors/border-color';\nimport {\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderTopLeftRadius,\n borderTopRightRadius\n} from './property-descriptors/border-radius';\nimport {\n borderBottomStyle,\n borderLeftStyle,\n borderRightStyle,\n borderTopStyle\n} from './property-descriptors/border-style';\nimport {\n borderBottomWidth,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth\n} from './property-descriptors/border-width';\nimport {color} from './property-descriptors/color';\nimport {display, DISPLAY} from './property-descriptors/display';\nimport {float, FLOAT} from './property-descriptors/float';\nimport {letterSpacing} from './property-descriptors/letter-spacing';\nimport {lineBreak} from './property-descriptors/line-break';\nimport {lineHeight} from './property-descriptors/line-height';\nimport {listStyleImage} from './property-descriptors/list-style-image';\nimport {listStylePosition} from './property-descriptors/list-style-position';\nimport {listStyleType} from './property-descriptors/list-style-type';\nimport {marginBottom, marginLeft, marginRight, marginTop} from './property-descriptors/margin';\nimport {overflow, OVERFLOW} from './property-descriptors/overflow';\nimport {overflowWrap} from './property-descriptors/overflow-wrap';\nimport {paddingBottom, paddingLeft, paddingRight, paddingTop} from './property-descriptors/padding';\nimport {textAlign} from './property-descriptors/text-align';\nimport {position, POSITION} from './property-descriptors/position';\nimport {textShadow} from './property-descriptors/text-shadow';\nimport {textTransform} from './property-descriptors/text-transform';\nimport {transform} from './property-descriptors/transform';\nimport {transformOrigin} from './property-descriptors/transform-origin';\nimport {visibility, VISIBILITY} from './property-descriptors/visibility';\nimport {wordBreak} from './property-descriptors/word-break';\nimport {zIndex} from './property-descriptors/z-index';\nimport {CSSValue, isIdentToken, Parser} from './syntax/parser';\nimport {Tokenizer} from './syntax/tokenizer';\nimport {Color, color as colorType, isTransparent} from './types/color';\nimport {angle} from './types/angle';\nimport {image} from './types/image';\nimport {opacity} from './property-descriptors/opacity';\nimport {textDecorationColor} from './property-descriptors/text-decoration-color';\nimport {textDecorationLine} from './property-descriptors/text-decoration-line';\nimport {isLengthPercentage, LengthPercentage, ZERO_LENGTH} from './types/length-percentage';\nimport {fontFamily} from './property-descriptors/font-family';\nimport {fontSize} from './property-descriptors/font-size';\nimport {isLength} from './types/length';\nimport {fontWeight} from './property-descriptors/font-weight';\nimport {fontVariant} from './property-descriptors/font-variant';\nimport {fontStyle} from './property-descriptors/font-style';\nimport {contains} from '../core/bitwise';\nimport {content} from './property-descriptors/content';\nimport {counterIncrement} from './property-descriptors/counter-increment';\nimport {counterReset} from './property-descriptors/counter-reset';\nimport {quotes} from './property-descriptors/quotes';\nimport {boxShadow} from './property-descriptors/box-shadow';\n\nexport class CSSParsedDeclaration {\n backgroundClip: ReturnType<typeof backgroundClip.parse>;\n backgroundColor: Color;\n backgroundImage: ReturnType<typeof backgroundImage.parse>;\n backgroundOrigin: ReturnType<typeof backgroundOrigin.parse>;\n backgroundPosition: ReturnType<typeof backgroundPosition.parse>;\n backgroundRepeat: ReturnType<typeof backgroundRepeat.parse>;\n backgroundSize: ReturnType<typeof backgroundSize.parse>;\n borderTopColor: Color;\n borderRightColor: Color;\n borderBottomColor: Color;\n borderLeftColor: Color;\n borderTopLeftRadius: ReturnType<typeof borderTopLeftRadius.parse>;\n borderTopRightRadius: ReturnType<typeof borderTopRightRadius.parse>;\n borderBottomRightRadius: ReturnType<typeof borderBottomRightRadius.parse>;\n borderBottomLeftRadius: ReturnType<typeof borderBottomLeftRadius.parse>;\n borderTopStyle: ReturnType<typeof borderTopStyle.parse>;\n borderRightStyle: ReturnType<typeof borderRightStyle.parse>;\n borderBottomStyle: ReturnType<typeof borderBottomStyle.parse>;\n borderLeftStyle: ReturnType<typeof borderLeftStyle.parse>;\n borderTopWidth: ReturnType<typeof borderTopWidth.parse>;\n borderRightWidth: ReturnType<typeof borderRightWidth.parse>;\n borderBottomWidth: ReturnType<typeof borderBottomWidth.parse>;\n borderLeftWidth: ReturnType<typeof borderLeftWidth.parse>;\n boxShadow: ReturnType<typeof boxShadow.parse>;\n color: Color;\n display: ReturnType<typeof display.parse>;\n float: ReturnType<typeof float.parse>;\n fontFamily: ReturnType<typeof fontFamily.parse>;\n fontSize: LengthPercentage;\n fontStyle: ReturnType<typeof fontStyle.parse>;\n fontVariant: ReturnType<typeof fontVariant.parse>;\n fontWeight: ReturnType<typeof fontWeight.parse>;\n letterSpacing: ReturnType<typeof letterSpacing.parse>;\n lineBreak: ReturnType<typeof lineBreak.parse>;\n lineHeight: CSSValue;\n listStyleImage: ReturnType<typeof listStyleImage.parse>;\n listStylePosition: ReturnType<typeof listStylePosition.parse>;\n listStyleType: ReturnType<typeof listStyleType.parse>;\n marginTop: CSSValue;\n marginRight: CSSValue;\n marginBottom: CSSValue;\n marginLeft: CSSValue;\n opacity: ReturnType<typeof opacity.parse>;\n overflowX: OVERFLOW;\n overflowY: OVERFLOW;\n overflowWrap: ReturnType<typeof overflowWrap.parse>;\n paddingTop: LengthPercentage;\n paddingRight: LengthPercentage;\n paddingBottom: LengthPercentage;\n paddingLeft: LengthPercentage;\n position: ReturnType<typeof position.parse>;\n textAlign: ReturnType<typeof textAlign.parse>;\n textDecorationColor: Color;\n textDecorationLine: ReturnType<typeof textDecorationLine.parse>;\n textShadow: ReturnType<typeof textShadow.parse>;\n textTransform: ReturnType<typeof textTransform.parse>;\n transform: ReturnType<typeof transform.parse>;\n transformOrigin: ReturnType<typeof transformOrigin.parse>;\n visibility: ReturnType<typeof visibility.parse>;\n wordBreak: ReturnType<typeof wordBreak.parse>;\n zIndex: ReturnType<typeof zIndex.parse>;\n\n constructor(declaration: CSSStyleDeclaration) {\n this.backgroundClip = parse(backgroundClip, declaration.backgroundClip);\n this.backgroundColor = parse(backgroundColor, declaration.backgroundColor);\n this.backgroundImage = parse(backgroundImage, declaration.backgroundImage);\n this.backgroundOrigin = parse(backgroundOrigin, declaration.backgroundOrigin);\n this.backgroundPosition = parse(backgroundPosition, declaration.backgroundPosition);\n this.backgroundRepeat = parse(backgroundRepeat, declaration.backgroundRepeat);\n this.backgroundSize = parse(backgroundSize, declaration.backgroundSize);\n this.borderTopColor = parse(borderTopColor, declaration.borderTopColor);\n this.borderRightColor = parse(borderRightColor, declaration.borderRightColor);\n this.borderBottomColor = parse(borderBottomColor, declaration.borderBottomColor);\n this.borderLeftColor = parse(borderLeftColor, declaration.borderLeftColor);\n this.borderTopLeftRadius = parse(borderTopLeftRadius, declaration.borderTopLeftRadius);\n this.borderTopRightRadius = parse(borderTopRightRadius, declaration.borderTopRightRadius);\n this.borderBottomRightRadius = parse(borderBottomRightRadius, declaration.borderBottomRightRadius);\n this.borderBottomLeftRadius = parse(borderBottomLeftRadius, declaration.borderBottomLeftRadius);\n this.borderTopStyle = parse(borderTopStyle, declaration.borderTopStyle);\n this.borderRightStyle = parse(borderRightStyle, declaration.borderRightStyle);\n this.borderBottomStyle = parse(borderBottomStyle, declaration.borderBottomStyle);\n this.borderLeftStyle = parse(borderLeftStyle, declaration.borderLeftStyle);\n this.borderTopWidth = parse(borderTopWidth, declaration.borderTopWidth);\n this.borderRightWidth = parse(borderRightWidth, declaration.borderRightWidth);\n this.borderBottomWidth = parse(borderBottomWidth, declaration.borderBottomWidth);\n this.borderLeftWidth = parse(borderLeftWidth, declaration.borderLeftWidth);\n this.boxShadow = parse(boxShadow, declaration.boxShadow);\n this.color = parse(color, declaration.color);\n this.display = parse(display, declaration.display);\n this.float = parse(float, declaration.cssFloat);\n this.fontFamily = parse(fontFamily, declaration.fontFamily);\n this.fontSize = parse(fontSize, declaration.fontSize);\n this.fontStyle = parse(fontStyle, declaration.fontStyle);\n this.fontVariant = parse(fontVariant, declaration.fontVariant);\n this.fontWeight = parse(fontWeight, declaration.fontWeight);\n this.letterSpacing = parse(letterSpacing, declaration.letterSpacing);\n this.lineBreak = parse(lineBreak, declaration.lineBreak);\n this.lineHeight = parse(lineHeight, declaration.lineHeight);\n this.listStyleImage = parse(listStyleImage, declaration.listStyleImage);\n this.listStylePosition = parse(listStylePosition, declaration.listStylePosition);\n this.listStyleType = parse(listStyleType, declaration.listStyleType);\n this.marginTop = parse(marginTop, declaration.marginTop);\n this.marginRight = parse(marginRight, declaration.marginRight);\n this.marginBottom = parse(marginBottom, declaration.marginBottom);\n this.marginLeft = parse(marginLeft, declaration.marginLeft);\n this.opacity = parse(opacity, declaration.opacity);\n const overflowTuple = parse(overflow, declaration.overflow);\n this.overflowX = overflowTuple[0];\n this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];\n this.overflowWrap = parse(overflowWrap, declaration.overflowWrap);\n this.paddingTop = parse(paddingTop, declaration.paddingTop);\n this.paddingRight = parse(paddingRight, declaration.paddingRight);\n this.paddingBottom = parse(paddingBottom, declaration.paddingBottom);\n this.paddingLeft = parse(paddingLeft, declaration.paddingLeft);\n this.position = parse(position, declaration.position);\n this.textAlign = parse(textAlign, declaration.textAlign);\n this.textDecorationColor = parse(textDecorationColor, declaration.textDecorationColor || declaration.color);\n this.textDecorationLine = parse(textDecorationLine, declaration.textDecorationLine);\n this.textShadow = parse(textShadow, declaration.textShadow);\n this.textTransform = parse(textTransform, declaration.textTransform);\n this.transform = parse(transform, declaration.transform);\n this.transformOrigin = parse(transformOrigin, declaration.transformOrigin);\n this.visibility = parse(visibility, declaration.visibility);\n this.wordBreak = parse(wordBreak, declaration.wordBreak);\n this.zIndex = parse(zIndex, declaration.zIndex);\n }\n\n isVisible(): boolean {\n return this.display > 0 && this.opacity > 0 && this.visibility === VISIBILITY.VISIBLE;\n }\n\n isTransparent(): boolean {\n return isTransparent(this.backgroundColor);\n }\n\n isTransformed(): boolean {\n return this.transform !== null;\n }\n\n isPositioned(): boolean {\n return this.position !== POSITION.STATIC;\n }\n\n isPositionedWithZIndex(): boolean {\n return this.isPositioned() && !this.zIndex.auto;\n }\n\n isFloating(): boolean {\n return this.float !== FLOAT.NONE;\n }\n\n isInlineLevel(): boolean {\n return (\n contains(this.display, DISPLAY.INLINE) ||\n contains(this.display, DISPLAY.INLINE_BLOCK) ||\n contains(this.display, DISPLAY.INLINE_FLEX) ||\n contains(this.display, DISPLAY.INLINE_GRID) ||\n contains(this.display, DISPLAY.INLINE_LIST_ITEM) ||\n contains(this.display, DISPLAY.INLINE_TABLE)\n );\n }\n}\n\nexport class CSSParsedPseudoDeclaration {\n content: ReturnType<typeof content.parse>;\n quotes: ReturnType<typeof quotes.parse>;\n\n constructor(declaration: CSSStyleDeclaration) {\n this.content = parse(content, declaration.content);\n this.quotes = parse(quotes, declaration.quotes);\n }\n}\n\nexport class CSSParsedCounterDeclaration {\n counterIncrement: ReturnType<typeof counterIncrement.parse>;\n counterReset: ReturnType<typeof counterReset.parse>;\n\n constructor(declaration: CSSStyleDeclaration) {\n this.counterIncrement = parse(counterIncrement, declaration.counterIncrement);\n this.counterReset = parse(counterReset, declaration.counterReset);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst parse = (descriptor: CSSPropertyDescriptor<any>, style?: string | null) => {\n const tokenizer = new Tokenizer();\n const value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;\n tokenizer.write(value);\n const parser = new Parser(tokenizer.read());\n switch (descriptor.type) {\n case PropertyDescriptorParsingType.IDENT_VALUE:\n const token = parser.parseComponentValue();\n return descriptor.parse(isIdentToken(token) ? token.value : descriptor.initialValue);\n case PropertyDescriptorParsingType.VALUE:\n return descriptor.parse(parser.parseComponentValue());\n case PropertyDescriptorParsingType.LIST:\n return descriptor.parse(parser.parseComponentValues());\n case PropertyDescriptorParsingType.TOKEN_VALUE:\n return parser.parseComponentValue();\n case PropertyDescriptorParsingType.TYPE_VALUE:\n switch (descriptor.format) {\n case 'angle':\n return angle.parse(parser.parseComponentValue());\n case 'color':\n return colorType.parse(parser.parseComponentValue());\n case 'image':\n return image.parse(parser.parseComponentValue());\n case 'length':\n const length = parser.parseComponentValue();\n return isLength(length) ? length : ZERO_LENGTH;\n case 'length-percentage':\n const value = parser.parseComponentValue();\n return isLengthPercentage(value) ? value : ZERO_LENGTH;\n }\n }\n\n throw new Error(`Attempting to parse unsupported css format type ${descriptor.format}`);\n};\n","import {CSSParsedDeclaration} from '../css/index';\nimport {TextContainer} from './text-container';\nimport {Bounds, parseBounds} from '../css/layout/bounds';\nimport {isHTMLElementNode} from './node-parser';\n\nexport const enum FLAGS {\n CREATES_STACKING_CONTEXT = 1 << 1,\n CREATES_REAL_STACKING_CONTEXT = 1 << 2,\n IS_LIST_OWNER = 1 << 3\n}\n\nexport class ElementContainer {\n readonly styles: CSSParsedDeclaration;\n readonly textNodes: TextContainer[];\n readonly elements: ElementContainer[];\n bounds: Bounds;\n flags: number;\n\n constructor(element: Element) {\n this.styles = new CSSParsedDeclaration(window.getComputedStyle(element, null));\n this.textNodes = [];\n this.elements = [];\n if (this.styles.transform !== null && isHTMLElementNode(element)) {\n // getBoundingClientRect takes transforms into account\n element.style.transform = 'none';\n }\n this.bounds = parseBounds(element);\n this.flags = 0;\n }\n}\n","import {OVERFLOW_WRAP} from '../property-descriptors/overflow-wrap';\nimport {CSSParsedDeclaration} from '../index';\nimport {fromCodePoint, LineBreaker, toCodePoints} from 'css-line-break';\nimport {Bounds, parseBounds} from './bounds';\nimport {FEATURES} from '../../core/features';\n\nexport class TextBounds {\n readonly text: string;\n readonly bounds: Bounds;\n\n constructor(text: string, bounds: Bounds) {\n this.text = text;\n this.bounds = bounds;\n }\n}\n\nexport const parseTextBounds = (value: string, styles: CSSParsedDeclaration, node: Text): TextBounds[] => {\n const textList = breakText(value, styles);\n const textBounds: TextBounds[] = [];\n let offset = 0;\n textList.forEach(text => {\n if (styles.textDecorationLine.length || text.trim().length > 0) {\n if (FEATURES.SUPPORT_RANGE_BOUNDS) {\n textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length)));\n } else {\n const replacementNode = node.splitText(text.length);\n textBounds.push(new TextBounds(text, getWrapperBounds(node)));\n node = replacementNode;\n }\n } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {\n node = node.splitText(text.length);\n }\n offset += text.length;\n });\n\n return textBounds;\n};\n\nconst getWrapperBounds = (node: Text): Bounds => {\n const ownerDocument = node.ownerDocument;\n if (ownerDocument) {\n const wrapper = ownerDocument.createElement('html2canvaswrapper');\n wrapper.appendChild(node.cloneNode(true));\n const parentNode = node.parentNode;\n if (parentNode) {\n parentNode.replaceChild(wrapper, node);\n const bounds = parseBounds(wrapper);\n if (wrapper.firstChild) {\n parentNode.replaceChild(wrapper.firstChild, wrapper);\n }\n return bounds;\n }\n }\n\n return new Bounds(0, 0, 0, 0);\n};\n\nconst getRangeBounds = (node: Text, offset: number, length: number): Bounds => {\n const ownerDocument = node.ownerDocument;\n if (!ownerDocument) {\n throw new Error('Node has no owner document');\n }\n const range = ownerDocument.createRange();\n range.setStart(node, offset);\n range.setEnd(node, offset + length);\n return Bounds.fromClientRect(range.getBoundingClientRect());\n};\n\nconst breakText = (value: string, styles: CSSParsedDeclaration): string[] => {\n return styles.letterSpacing !== 0 ? toCodePoints(value).map(i => fromCodePoint(i)) : breakWords(value, styles);\n};\n\nconst breakWords = (str: string, styles: CSSParsedDeclaration): string[] => {\n const breaker = LineBreaker(str, {\n lineBreak: styles.lineBreak,\n wordBreak: styles.overflowWrap === OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : styles.wordBreak\n });\n\n const words = [];\n let bk;\n\n while (!(bk = breaker.next()).done) {\n if (bk.value) {\n words.push(bk.value.slice());\n }\n }\n\n return words;\n};\n","import {CSSParsedDeclaration} from '../css/index';\nimport {TEXT_TRANSFORM} from '../css/property-descriptors/text-transform';\nimport {parseTextBounds, TextBounds} from '../css/layout/text';\n\nexport class TextContainer {\n text: string;\n textBounds: TextBounds[];\n\n constructor(node: Text, styles: CSSParsedDeclaration) {\n this.text = transform(node.data, styles.textTransform);\n this.textBounds = parseTextBounds(this.text, styles, node);\n }\n}\n\nconst transform = (text: string, transform: TEXT_TRANSFORM) => {\n switch (transform) {\n case TEXT_TRANSFORM.LOWERCASE:\n return text.toLowerCase();\n case TEXT_TRANSFORM.CAPITALIZE:\n return text.replace(CAPITALIZE, capitalize);\n case TEXT_TRANSFORM.UPPERCASE:\n return text.toUpperCase();\n default:\n return text;\n }\n};\n\nconst CAPITALIZE = /(^|\\s|:|-|\\(|\\))([a-z])/g;\n\nconst capitalize = (m: string, p1: string, p2: string) => {\n if (m.length > 0) {\n return p1 + p2.toUpperCase();\n }\n\n return m;\n};\n","import {ElementContainer} from '../element-container';\nimport {CacheStorage} from '../../core/cache-storage';\n\nexport class ImageElementContainer extends ElementContainer {\n src: string;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(img: HTMLImageElement) {\n super(img);\n this.src = img.currentSrc || img.src;\n this.intrinsicWidth = img.naturalWidth;\n this.intrinsicHeight = img.naturalHeight;\n CacheStorage.getInstance().addImage(this.src);\n }\n}\n","import {ElementContainer} from '../element-container';\n\nexport class CanvasElementContainer extends ElementContainer {\n canvas: HTMLCanvasElement;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(canvas: HTMLCanvasElement) {\n super(canvas);\n this.canvas = canvas;\n this.intrinsicWidth = canvas.width;\n this.intrinsicHeight = canvas.height;\n }\n}\n","import {ElementContainer} from '../element-container';\nimport {CacheStorage} from '../../core/cache-storage';\n\nexport class SVGElementContainer extends ElementContainer {\n svg: string;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(img: SVGSVGElement) {\n super(img);\n const s = new XMLSerializer();\n this.svg = `data:image/svg+xml,${encodeURIComponent(s.serializeToString(img))}`;\n this.intrinsicWidth = img.width.baseVal.value;\n this.intrinsicHeight = img.height.baseVal.value;\n\n CacheStorage.getInstance().addImage(this.svg);\n }\n}\n","import {ElementContainer} from '../element-container';\nexport class LIElementContainer extends ElementContainer {\n readonly value: number;\n\n constructor(element: HTMLLIElement) {\n super(element);\n this.value = element.value;\n }\n}\n","import {ElementContainer} from '../element-container';\nexport class OLElementContainer extends ElementContainer {\n readonly start: number;\n readonly reversed: boolean;\n\n constructor(element: HTMLOListElement) {\n super(element);\n this.start = element.start;\n this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;\n }\n}\n","import {ElementContainer} from '../element-container';\nimport {BORDER_STYLE} from '../../css/property-descriptors/border-style';\nimport {BACKGROUND_CLIP} from '../../css/property-descriptors/background-clip';\nimport {BACKGROUND_ORIGIN} from '../../css/property-descriptors/background-origin';\nimport {TokenType} from '../../css/syntax/tokenizer';\nimport {LengthPercentageTuple} from '../../css/types/length-percentage';\nimport {Bounds} from '../../css/layout/bounds';\n\nconst CHECKBOX_BORDER_RADIUS: LengthPercentageTuple = [\n {\n type: TokenType.DIMENSION_TOKEN,\n flags: 0,\n unit: 'px',\n number: 3\n }\n];\n\nconst RADIO_BORDER_RADIUS: LengthPercentageTuple = [\n {\n type: TokenType.PERCENTAGE_TOKEN,\n flags: 0,\n number: 50\n }\n];\n\nconst reformatInputBounds = (bounds: Bounds): Bounds => {\n if (bounds.width > bounds.height) {\n return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);\n } else if (bounds.width < bounds.height) {\n return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);\n }\n return bounds;\n};\n\nconst getInputValue = (node: HTMLInputElement): string => {\n const value = node.type === PASSWORD ? new Array(node.value.length + 1).join('\\u2022') : node.value;\n\n return value.length === 0 ? node.placeholder || '' : value;\n};\n\nexport const CHECKBOX = 'checkbox';\nexport const RADIO = 'radio';\nexport const PASSWORD = 'password';\nexport const INPUT_COLOR = 0x2a2a2aff;\n\nexport class InputElementContainer extends ElementContainer {\n readonly type: string;\n readonly checked: boolean;\n readonly value: string;\n\n constructor(input: HTMLInputElement) {\n super(input);\n this.type = input.type.toLowerCase();\n this.checked = input.checked;\n this.value = getInputValue(input);\n\n if (this.type === CHECKBOX || this.type === RADIO) {\n this.styles.backgroundColor = 0xdededeff;\n this.styles.borderTopColor = this.styles.borderRightColor = this.styles.borderBottomColor = this.styles.borderLeftColor = 0xa5a5a5ff;\n this.styles.borderTopWidth = this.styles.borderRightWidth = this.styles.borderBottomWidth = this.styles.borderLeftWidth = 1;\n this.styles.borderTopStyle = this.styles.borderRightStyle = this.styles.borderBottomStyle = this.styles.borderLeftStyle =\n BORDER_STYLE.SOLID;\n this.styles.backgroundClip = [BACKGROUND_CLIP.BORDER_BOX];\n this.styles.backgroundOrigin = [BACKGROUND_ORIGIN.BORDER_BOX];\n this.bounds = reformatInputBounds(this.bounds);\n }\n\n switch (this.type) {\n case CHECKBOX:\n this.styles.borderTopRightRadius = this.styles.borderTopLeftRadius = this.styles.borderBottomRightRadius = this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;\n break;\n case RADIO:\n this.styles.borderTopRightRadius = this.styles.borderTopLeftRadius = this.styles.borderBottomRightRadius = this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;\n break;\n }\n }\n}\n","import {ElementContainer} from '../element-container';\nexport class SelectElementContainer extends ElementContainer {\n readonly value: string;\n constructor(element: HTMLSelectElement) {\n super(element);\n const option = element.options[element.selectedIndex || 0];\n this.value = option ? option.text || '' : '';\n }\n}\n","import {ElementContainer} from '../element-container';\nexport class TextareaElementContainer extends ElementContainer {\n readonly value: string;\n constructor(element: HTMLTextAreaElement) {\n super(element);\n this.value = element.value;\n }\n}\n","import {ElementContainer} from '../element-container';\nimport {parseTree} from '../node-parser';\nimport {Color, color, COLORS, isTransparent} from '../../css/types/color';\nimport {Parser} from '../../css/syntax/parser';\n\nconst parseColor = (value: string): Color => color.parse(Parser.create(value).parseComponentValue());\n\nexport class IFrameElementContainer extends ElementContainer {\n src: string;\n width: number;\n height: number;\n tree?: ElementContainer;\n backgroundColor: Color;\n\n constructor(iframe: HTMLIFrameElement) {\n super(iframe);\n this.src = iframe.src;\n this.width = parseInt(iframe.width, 10) || 0;\n this.height = parseInt(iframe.height, 10) || 0;\n this.backgroundColor = this.styles.backgroundColor;\n try {\n if (\n iframe.contentWindow &&\n iframe.contentWindow.document &&\n iframe.contentWindow.document.documentElement\n ) {\n this.tree = parseTree(iframe.contentWindow.document.documentElement);\n\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n const documentBackgroundColor = iframe.contentWindow.document.documentElement\n ? parseColor(getComputedStyle(iframe.contentWindow.document.documentElement)\n .backgroundColor as string)\n : COLORS.TRANSPARENT;\n const bodyBackgroundColor = iframe.contentWindow.document.body\n ? parseColor(getComputedStyle(iframe.contentWindow.document.body).backgroundColor as string)\n : COLORS.TRANSPARENT;\n\n this.backgroundColor = isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? this.styles.backgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor;\n }\n } catch (e) {}\n }\n}\n","import {CSSParsedDeclaration} from '../css/index';\nimport {ElementContainer, FLAGS} from './element-container';\nimport {TextContainer} from './text-container';\nimport {ImageElementContainer} from './replaced-elements/image-element-container';\nimport {CanvasElementContainer} from './replaced-elements/canvas-element-container';\nimport {SVGElementContainer} from './replaced-elements/svg-element-container';\nimport {LIElementContainer} from './elements/li-element-container';\nimport {OLElementContainer} from './elements/ol-element-container';\nimport {InputElementContainer} from './replaced-elements/input-element-container';\nimport {SelectElementContainer} from './elements/select-element-container';\nimport {TextareaElementContainer} from './elements/textarea-element-container';\nimport {IFrameElementContainer} from './replaced-elements/iframe-element-container';\n\nconst LIST_OWNERS = ['OL', 'UL', 'MENU'];\n\nconst parseNodeTree = (node: Node, parent: ElementContainer, root: ElementContainer) => {\n for (let childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {\n nextNode = childNode.nextSibling;\n\n if (isTextNode(childNode) && childNode.data.trim().length > 0) {\n parent.textNodes.push(new TextContainer(childNode, parent.styles));\n } else if (isElementNode(childNode)) {\n const container = createContainer(childNode);\n if (container.styles.isVisible()) {\n if (createsRealStackingContext(childNode, container, root)) {\n container.flags |= FLAGS.CREATES_REAL_STACKING_CONTEXT;\n } else if (createsStackingContext(container.styles)) {\n container.flags |= FLAGS.CREATES_STACKING_CONTEXT;\n }\n\n if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {\n container.flags |= FLAGS.IS_LIST_OWNER;\n }\n\n parent.elements.push(container);\n if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) {\n parseNodeTree(childNode, container, root);\n }\n }\n }\n }\n};\n\nconst createContainer = (element: Element): ElementContainer => {\n if (isImageElement(element)) {\n return new ImageElementContainer(element);\n }\n\n if (isCanvasElement(element)) {\n return new CanvasElementContainer(element);\n }\n\n if (isSVGElement(element)) {\n return new SVGElementContainer(element);\n }\n\n if (isLIElement(element)) {\n return new LIElementContainer(element);\n }\n\n if (isOLElement(element)) {\n return new OLElementContainer(element);\n }\n\n if (isInputElement(element)) {\n return new InputElementContainer(element);\n }\n\n if (isSelectElement(element)) {\n return new SelectElementContainer(element);\n }\n\n if (isTextareaElement(element)) {\n return new TextareaElementContainer(element);\n }\n\n if (isIFrameElement(element)) {\n return new IFrameElementContainer(element);\n }\n\n return new ElementContainer(element);\n};\n\nexport const parseTree = (element: HTMLElement): ElementContainer => {\n const container = createContainer(element);\n container.flags |= FLAGS.CREATES_REAL_STACKING_CONTEXT;\n parseNodeTree(element, container, container);\n return container;\n};\n\nconst createsRealStackingContext = (node: Element, container: ElementContainer, root: ElementContainer): boolean => {\n return (\n container.styles.isPositionedWithZIndex() ||\n container.styles.opacity < 1 ||\n container.styles.isTransformed() ||\n (isBodyElement(node) && root.styles.isTransparent())\n );\n};\n\nconst createsStackingContext = (styles: CSSParsedDeclaration): boolean => styles.isPositioned() || styles.isFloating();\n\nexport const isTextNode = (node: Node): node is Text => node.nodeType === Node.TEXT_NODE;\nexport const isElementNode = (node: Node): node is Element => node.nodeType === Node.ELEMENT_NODE;\nexport const isHTMLElementNode = (node: Node): node is HTMLElement =>\n isElementNode(node) && typeof (node as HTMLElement).style !== 'undefined' && !isSVGElementNode(node);\nexport const isSVGElementNode = (element: Element): element is SVGElement =>\n typeof (element as SVGElement).className === 'object';\nexport const isLIElement = (node: Element): node is HTMLLIElement => node.tagName === 'LI';\nexport const isOLElement = (node: Element): node is HTMLOListElement => node.tagName === 'OL';\nexport const isInputElement = (node: Element): node is HTMLInputElement => node.tagName === 'INPUT';\nexport const isHTMLElement = (node: Element): node is HTMLHtmlElement => node.tagName === 'HTML';\nexport const isSVGElement = (node: Element): node is SVGSVGElement => node.tagName === 'svg';\nexport const isBodyElement = (node: Element): node is HTMLBodyElement => node.tagName === 'BODY';\nexport const isCanvasElement = (node: Element): node is HTMLCanvasElement => node.tagName === 'CANVAS';\nexport const isImageElement = (node: Element): node is HTMLImageElement => node.tagName === 'IMG';\nexport const isIFrameElement = (node: Element): node is HTMLIFrameElement => node.tagName === 'IFRAME';\nexport const isStyleElement = (node: Element): node is HTMLStyleElement => node.tagName === 'STYLE';\nexport const isScriptElement = (node: Element): node is HTMLScriptElement => node.tagName === 'SCRIPT';\nexport const isTextareaElement = (node: Element): node is HTMLTextAreaElement => node.tagName === 'TEXTAREA';\nexport const isSelectElement = (node: Element): node is HTMLSelectElement => node.tagName === 'SELECT';\n","import {LIST_STYLE_TYPE} from '../../property-descriptors/list-style-type';\nimport {fromCodePoint} from 'css-line-break';\nimport {contains} from '../../../core/bitwise';\nimport {CSSParsedCounterDeclaration} from '../../index';\n\nexport class CounterState {\n readonly counters: {[key: string]: number[]};\n constructor() {\n this.counters = {};\n }\n\n getCounterValue(name: string) {\n const counter = this.counters[name];\n\n if (counter && counter.length) {\n return counter[counter.length - 1];\n }\n return 1;\n }\n\n getCounterValues(name: string): number[] {\n const counter = this.counters[name];\n return counter ? counter : [];\n }\n\n pop(counters: string[]) {\n counters.forEach(counter => this.counters[counter].pop());\n }\n\n parse(style: CSSParsedCounterDeclaration): string[] {\n const counterIncrement = style.counterIncrement;\n const counterReset = style.counterReset;\n let canReset = true;\n\n if (counterIncrement !== null) {\n counterIncrement.forEach(entry => {\n const counter = this.counters[entry.counter];\n if (counter && entry.increment !== 0) {\n canReset = false;\n counter[Math.max(0, counter.length - 1)] += entry.increment;\n }\n });\n }\n\n const counterNames: string[] = [];\n if (canReset) {\n counterReset.forEach(entry => {\n let counter = this.counters[entry.counter];\n counterNames.push(entry.counter);\n if (!counter) {\n counter = this.counters[entry.counter] = [];\n }\n counter.push(entry.reset);\n });\n }\n\n return counterNames;\n }\n}\n\ninterface CounterSymbols {\n integers: number[];\n values: string[];\n}\n\nconst ROMAN_UPPER: CounterSymbols = {\n integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],\n values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']\n};\n\nconst ARMENIAN: CounterSymbols = {\n integers: [\n 9000,\n 8000,\n 7000,\n 6000,\n 5000,\n 4000,\n 3000,\n 2000,\n 1000,\n 900,\n 800,\n 700,\n 600,\n 500,\n 400,\n 300,\n 200,\n 100,\n 90,\n 80,\n 70,\n 60,\n 50,\n 40,\n 30,\n 20,\n 10,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 1\n ],\n values: [\n 'Ք',\n 'Փ',\n 'Ւ',\n 'Ց',\n 'Ր',\n 'Տ',\n 'Վ',\n 'Ս',\n 'Ռ',\n 'Ջ',\n 'Պ',\n 'Չ',\n 'Ո',\n 'Շ',\n 'Ն',\n 'Յ',\n 'Մ',\n 'Ճ',\n 'Ղ',\n 'Ձ',\n 'Հ',\n 'Կ',\n 'Ծ',\n 'Խ',\n 'Լ',\n 'Ի',\n 'Ժ',\n 'Թ',\n 'Ը',\n 'Է',\n 'Զ',\n 'Ե',\n 'Դ',\n 'Գ',\n 'Բ',\n 'Ա'\n ]\n};\n\nconst HEBREW: CounterSymbols = {\n integers: [\n 10000,\n 9000,\n 8000,\n 7000,\n 6000,\n 5000,\n 4000,\n 3000,\n 2000,\n 1000,\n 400,\n 300,\n 200,\n 100,\n 90,\n 80,\n 70,\n 60,\n 50,\n 40,\n 30,\n 20,\n 19,\n 18,\n 17,\n 16,\n 15,\n 10,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 1\n ],\n values: [\n 'י׳',\n 'ט׳',\n 'ח׳',\n 'ז׳',\n 'ו׳',\n 'ה׳',\n 'ד׳',\n 'ג׳',\n 'ב׳',\n 'א׳',\n 'ת',\n 'ש',\n 'ר',\n 'ק',\n 'צ',\n 'פ',\n 'ע',\n 'ס',\n 'נ',\n 'מ',\n 'ל',\n 'כ',\n 'יט',\n 'יח',\n 'יז',\n 'טז',\n 'טו',\n 'י',\n 'ט',\n 'ח',\n 'ז',\n 'ו',\n 'ה',\n 'ד',\n 'ג',\n 'ב',\n 'א'\n ]\n};\n\nconst GEORGIAN: CounterSymbols = {\n integers: [\n 10000,\n 9000,\n 8000,\n 7000,\n 6000,\n 5000,\n 4000,\n 3000,\n 2000,\n 1000,\n 900,\n 800,\n 700,\n 600,\n 500,\n 400,\n 300,\n 200,\n 100,\n 90,\n 80,\n 70,\n 60,\n 50,\n 40,\n 30,\n 20,\n 10,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 1\n ],\n values: [\n 'ჵ',\n 'ჰ',\n 'ჯ',\n 'ჴ',\n 'ხ',\n 'ჭ',\n 'წ',\n 'ძ',\n 'ც',\n 'ჩ',\n 'შ',\n 'ყ',\n 'ღ',\n 'ქ',\n 'ფ',\n 'ჳ',\n 'ტ',\n 'ს',\n 'რ',\n 'ჟ',\n 'პ',\n 'ო',\n 'ჲ',\n 'ნ',\n 'მ',\n 'ლ',\n 'კ',\n 'ი',\n 'თ',\n 'ჱ',\n 'ზ',\n 'ვ',\n 'ე',\n 'დ',\n 'გ',\n 'ბ',\n 'ა'\n ]\n};\n\nconst createAdditiveCounter = (\n value: number,\n min: number,\n max: number,\n symbols: CounterSymbols,\n fallback: LIST_STYLE_TYPE,\n suffix: string\n) => {\n if (value < min || value > max) {\n return createCounterText(value, fallback, suffix.length > 0);\n }\n\n return (\n symbols.integers.reduce((string, integer, index) => {\n while (value >= integer) {\n value -= integer;\n string += symbols.values[index];\n }\n return string;\n }, '') + suffix\n );\n};\n\nconst createCounterStyleWithSymbolResolver = (\n value: number,\n codePointRangeLength: number,\n isNumeric: boolean,\n resolver: (codePoint: number) => string\n): string => {\n let string = '';\n\n do {\n if (!isNumeric) {\n value--;\n }\n string = resolver(value) + string;\n value /= codePointRangeLength;\n } while (value * codePointRangeLength >= codePointRangeLength);\n\n return string;\n};\n\nconst createCounterStyleFromRange = (\n value: number,\n codePointRangeStart: number,\n codePointRangeEnd: number,\n isNumeric: boolean,\n suffix: string\n): string => {\n const codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;\n\n return (\n (value < 0 ? '-' : '') +\n (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, codePoint =>\n fromCodePoint(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart)\n ) +\n suffix)\n );\n};\n\nconst createCounterStyleFromSymbols = (value: number, symbols: string, suffix: string = '. '): string => {\n const codePointRangeLength = symbols.length;\n return (\n createCounterStyleWithSymbolResolver(\n Math.abs(value),\n codePointRangeLength,\n false,\n codePoint => symbols[Math.floor(codePoint % codePointRangeLength)]\n ) + suffix\n );\n};\n\nconst CJK_ZEROS = 1 << 0;\nconst CJK_TEN_COEFFICIENTS = 1 << 1;\nconst CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;\nconst CJK_HUNDRED_COEFFICIENTS = 1 << 3;\n\nconst createCJKCounter = (\n value: number,\n numbers: string,\n multipliers: string,\n negativeSign: string,\n suffix: string,\n flags: number\n): string => {\n if (value < -9999 || value > 9999) {\n return createCounterText(value, LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);\n }\n let tmp = Math.abs(value);\n let string = suffix;\n\n if (tmp === 0) {\n return numbers[0] + string;\n }\n\n for (let digit = 0; tmp > 0 && digit <= 4; digit++) {\n let coefficient = tmp % 10;\n\n if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== '') {\n string = numbers[coefficient] + string;\n } else if (\n coefficient > 1 ||\n (coefficient === 1 && digit === 0) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS)) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100) ||\n (coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS))\n ) {\n string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;\n } else if (coefficient === 1 && digit > 0) {\n string = multipliers[digit - 1] + string;\n }\n tmp = Math.floor(tmp / 10);\n }\n\n return (value < 0 ? negativeSign : '') + string;\n};\n\nconst CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';\nconst CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';\nconst JAPANESE_NEGATIVE = 'マイナス';\nconst KOREAN_NEGATIVE = '마이너스';\n\nexport const createCounterText = (value: number, type: LIST_STYLE_TYPE, appendSuffix: boolean): string => {\n const defaultSuffix = appendSuffix ? '. ' : '';\n const cjkSuffix = appendSuffix ? '、' : '';\n const koreanSuffix = appendSuffix ? ', ' : '';\n const spaceSuffix = appendSuffix ? ' ' : '';\n switch (type) {\n case LIST_STYLE_TYPE.DISC:\n return '•' + spaceSuffix;\n case LIST_STYLE_TYPE.CIRCLE:\n return '◦' + spaceSuffix;\n case LIST_STYLE_TYPE.SQUARE:\n return '◾' + spaceSuffix;\n case LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:\n const string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n return string.length < 4 ? `0${string}` : string;\n case LIST_STYLE_TYPE.CJK_DECIMAL:\n return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);\n case LIST_STYLE_TYPE.LOWER_ROMAN:\n return createAdditiveCounter(\n value,\n 1,\n 3999,\n ROMAN_UPPER,\n LIST_STYLE_TYPE.DECIMAL,\n defaultSuffix\n ).toLowerCase();\n case LIST_STYLE_TYPE.UPPER_ROMAN:\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_GREEK:\n return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_ALPHA:\n return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);\n case LIST_STYLE_TYPE.UPPER_ALPHA:\n return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);\n case LIST_STYLE_TYPE.ARABIC_INDIC:\n return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);\n case LIST_STYLE_TYPE.ARMENIAN:\n case LIST_STYLE_TYPE.UPPER_ARMENIAN:\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_ARMENIAN:\n return createAdditiveCounter(\n value,\n 1,\n 9999,\n ARMENIAN,\n LIST_STYLE_TYPE.DECIMAL,\n defaultSuffix\n ).toLowerCase();\n case LIST_STYLE_TYPE.BENGALI:\n return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);\n case LIST_STYLE_TYPE.CAMBODIAN:\n case LIST_STYLE_TYPE.KHMER:\n return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);\n case LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:\n return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);\n case LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:\n return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);\n case LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:\n case LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:\n return createCJKCounter(\n value,\n '零一二三四五六七八九',\n CHINESE_INFORMAL_MULTIPLIERS,\n '負',\n cjkSuffix,\n CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:\n return createCJKCounter(\n value,\n '零壹貳參肆伍陸柒捌玖',\n CHINESE_FORMAL_MULTIPLIERS,\n '負',\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:\n return createCJKCounter(\n value,\n '零一二三四五六七八九',\n CHINESE_INFORMAL_MULTIPLIERS,\n '负',\n cjkSuffix,\n CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:\n return createCJKCounter(\n value,\n '零壹贰叁肆伍陆柒捌玖',\n CHINESE_FORMAL_MULTIPLIERS,\n '负',\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.JAPANESE_INFORMAL:\n return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);\n case LIST_STYLE_TYPE.JAPANESE_FORMAL:\n return createCJKCounter(\n value,\n '零壱弐参四伍六七八九',\n '拾百千万',\n JAPANESE_NEGATIVE,\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:\n return createCJKCounter(\n value,\n '영일이삼사오육칠팔구',\n '십백천만',\n KOREAN_NEGATIVE,\n koreanSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:\n return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);\n case LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:\n return createCJKCounter(\n value,\n '零壹貳參四五六七八九',\n '拾百千',\n KOREAN_NEGATIVE,\n koreanSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.DEVANAGARI:\n return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);\n case LIST_STYLE_TYPE.GEORGIAN:\n return createAdditiveCounter(value, 1, 19999, GEORGIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.GUJARATI:\n return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);\n case LIST_STYLE_TYPE.GURMUKHI:\n return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.HEBREW:\n return createAdditiveCounter(value, 1, 10999, HEBREW, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.HIRAGANA:\n return createCounterStyleFromSymbols(\n value,\n 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん'\n );\n case LIST_STYLE_TYPE.HIRAGANA_IROHA:\n return createCounterStyleFromSymbols(\n value,\n 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす'\n );\n case LIST_STYLE_TYPE.KANNADA:\n return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);\n case LIST_STYLE_TYPE.KATAKANA:\n return createCounterStyleFromSymbols(\n value,\n 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン',\n cjkSuffix\n );\n case LIST_STYLE_TYPE.KATAKANA_IROHA:\n return createCounterStyleFromSymbols(\n value,\n 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス',\n cjkSuffix\n );\n case LIST_STYLE_TYPE.LAO:\n return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);\n case LIST_STYLE_TYPE.MONGOLIAN:\n return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);\n case LIST_STYLE_TYPE.MYANMAR:\n return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);\n case LIST_STYLE_TYPE.ORIYA:\n return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.PERSIAN:\n return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);\n case LIST_STYLE_TYPE.TAMIL:\n return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);\n case LIST_STYLE_TYPE.TELUGU:\n return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.THAI:\n return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);\n case LIST_STYLE_TYPE.TIBETAN:\n return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);\n case LIST_STYLE_TYPE.DECIMAL:\n default:\n return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n }\n};\n","import {BezierCurve} from './bezier-curve';\nimport {Vector} from './vector';\nexport enum PathType {\n VECTOR = 0,\n BEZIER_CURVE = 1\n}\n\nexport interface IPath {\n type: PathType;\n add(deltaX: number, deltaY: number): IPath;\n}\n\nexport const equalPath = (a: Path[], b: Path[]): boolean => {\n if (a.length === b.length) {\n return a.some((v, i) => v === b[i]);\n }\n\n return false;\n};\n\nexport const transformPath = (path: Path[], deltaX: number, deltaY: number, deltaW: number, deltaH: number): Path[] => {\n return path.map((point, index) => {\n switch (index) {\n case 0:\n return point.add(deltaX, deltaY);\n case 1:\n return point.add(deltaX + deltaW, deltaY);\n case 2:\n return point.add(deltaX + deltaW, deltaY + deltaH);\n case 3:\n return point.add(deltaX, deltaY + deltaH);\n }\n return point;\n });\n};\n\nexport type Path = Vector | BezierCurve;\n","import {ElementContainer} from '../dom/element-container';\nimport {getAbsoluteValue, getAbsoluteValueForTuple} from '../css/types/length-percentage';\nimport {Vector} from './vector';\nimport {BezierCurve} from './bezier-curve';\nimport {Path} from './path';\n\nexport class BoundCurves {\n readonly topLeftBorderBox: Path;\n readonly topRightBorderBox: Path;\n readonly bottomRightBorderBox: Path;\n readonly bottomLeftBorderBox: Path;\n readonly topLeftPaddingBox: Path;\n readonly topRightPaddingBox: Path;\n readonly bottomRightPaddingBox: Path;\n readonly bottomLeftPaddingBox: Path;\n readonly topLeftContentBox: Path;\n readonly topRightContentBox: Path;\n readonly bottomRightContentBox: Path;\n readonly bottomLeftContentBox: Path;\n\n constructor(element: ElementContainer) {\n const styles = element.styles;\n const bounds = element.bounds;\n\n let [tlh, tlv] = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height);\n let [trh, trv] = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height);\n let [brh, brv] = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height);\n let [blh, blv] = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height);\n\n const factors = [];\n factors.push((tlh + trh) / bounds.width);\n factors.push((blh + brh) / bounds.width);\n factors.push((tlv + blv) / bounds.height);\n factors.push((trv + brv) / bounds.height);\n const maxFactor = Math.max(...factors);\n\n if (maxFactor > 1) {\n tlh /= maxFactor;\n tlv /= maxFactor;\n trh /= maxFactor;\n trv /= maxFactor;\n brh /= maxFactor;\n brv /= maxFactor;\n blh /= maxFactor;\n blv /= maxFactor;\n }\n\n const topWidth = bounds.width - trh;\n const rightHeight = bounds.height - brv;\n const bottomWidth = bounds.width - brh;\n const leftHeight = bounds.height - blv;\n\n const borderTopWidth = styles.borderTopWidth;\n const borderRightWidth = styles.borderRightWidth;\n const borderBottomWidth = styles.borderBottomWidth;\n const borderLeftWidth = styles.borderLeftWidth;\n\n const paddingTop = getAbsoluteValue(styles.paddingTop, element.bounds.width);\n const paddingRight = getAbsoluteValue(styles.paddingRight, element.bounds.width);\n const paddingBottom = getAbsoluteValue(styles.paddingBottom, element.bounds.width);\n const paddingLeft = getAbsoluteValue(styles.paddingLeft, element.bounds.width);\n\n this.topLeftBorderBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT)\n : new Vector(bounds.left, bounds.top);\n this.topRightBorderBox =\n trh > 0 || trv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top);\n this.bottomRightBorderBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);\n this.bottomLeftBorderBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left, bounds.top + bounds.height);\n this.topLeftPaddingBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth,\n bounds.top + borderTopWidth,\n Math.max(0, tlh - borderLeftWidth),\n Math.max(0, tlv - borderTopWidth),\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth, bounds.top + borderTopWidth);\n this.topRightPaddingBox =\n trh > 0 || trv > 0\n ? getCurvePoints(\n bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth),\n bounds.top + borderTopWidth,\n topWidth > bounds.width + borderLeftWidth ? 0 : trh - borderLeftWidth,\n trv - borderTopWidth,\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + borderTopWidth);\n this.bottomRightPaddingBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth),\n bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth),\n Math.max(0, brh - borderRightWidth),\n brv - borderBottomWidth,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth,\n bounds.top + bounds.height - borderBottomWidth\n );\n this.bottomLeftPaddingBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth,\n bounds.top + leftHeight,\n Math.max(0, blh - borderLeftWidth),\n blv - borderBottomWidth,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth, bounds.top + bounds.height - borderBottomWidth);\n this.topLeftContentBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + borderTopWidth + paddingTop,\n Math.max(0, tlh - (borderLeftWidth + paddingLeft)),\n Math.max(0, tlv - (borderTopWidth + paddingTop)),\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop);\n this.topRightContentBox =\n trh > 0 || trv > 0\n ? getCurvePoints(\n bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth + paddingLeft),\n bounds.top + borderTopWidth + paddingTop,\n topWidth > bounds.width + borderLeftWidth + paddingLeft ? 0 : trh - borderLeftWidth + paddingLeft,\n trv - (borderTopWidth + paddingTop),\n CORNER.TOP_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth + paddingRight),\n bounds.top + borderTopWidth + paddingTop\n );\n this.bottomRightContentBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth + paddingLeft)),\n bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth + paddingTop),\n Math.max(0, brh - (borderRightWidth + paddingRight)),\n brv - (borderBottomWidth + paddingBottom),\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth + paddingRight),\n bounds.top + bounds.height - (borderBottomWidth + paddingBottom)\n );\n this.bottomLeftContentBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + leftHeight,\n Math.max(0, blh - (borderLeftWidth + paddingLeft)),\n blv - (borderBottomWidth + paddingBottom),\n CORNER.BOTTOM_LEFT\n )\n : new Vector(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + bounds.height - (borderBottomWidth + paddingBottom)\n );\n }\n}\n\nenum CORNER {\n TOP_LEFT = 0,\n TOP_RIGHT = 1,\n BOTTOM_RIGHT = 2,\n BOTTOM_LEFT = 3\n}\n\nconst getCurvePoints = (x: number, y: number, r1: number, r2: number, position: CORNER): BezierCurve => {\n const kappa = 4 * ((Math.sqrt(2) - 1) / 3);\n const ox = r1 * kappa; // control point offset horizontal\n const oy = r2 * kappa; // control point offset vertical\n const xm = x + r1; // x-middle\n const ym = y + r2; // y-middle\n\n switch (position) {\n case CORNER.TOP_LEFT:\n return new BezierCurve(\n new Vector(x, ym),\n new Vector(x, ym - oy),\n new Vector(xm - ox, y),\n new Vector(xm, y)\n );\n case CORNER.TOP_RIGHT:\n return new BezierCurve(\n new Vector(x, y),\n new Vector(x + ox, y),\n new Vector(xm, ym - oy),\n new Vector(xm, ym)\n );\n case CORNER.BOTTOM_RIGHT:\n return new BezierCurve(\n new Vector(xm, y),\n new Vector(xm, y + oy),\n new Vector(x + ox, ym),\n new Vector(x, ym)\n );\n case CORNER.BOTTOM_LEFT:\n default:\n return new BezierCurve(\n new Vector(xm, ym),\n new Vector(xm - ox, ym),\n new Vector(x, y + oy),\n new Vector(x, y)\n );\n }\n};\n\nexport const calculateBorderBoxPath = (curves: BoundCurves): Path[] => {\n return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];\n};\n\nexport const calculateContentBoxPath = (curves: BoundCurves): Path[] => {\n return [\n curves.topLeftContentBox,\n curves.topRightContentBox,\n curves.bottomRightContentBox,\n curves.bottomLeftContentBox\n ];\n};\n\nexport const calculatePaddingBoxPath = (curves: BoundCurves): Path[] => {\n return [\n curves.topLeftPaddingBox,\n curves.topRightPaddingBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftPaddingBox\n ];\n};\n","import {IPath, Path, PathType} from './path';\n\nexport class Vector implements IPath {\n type: PathType;\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.type = PathType.VECTOR;\n this.x = x;\n this.y = y;\n }\n\n add(deltaX: number, deltaY: number): Vector {\n return new Vector(this.x + deltaX, this.y + deltaY);\n }\n}\n\nexport const isVector = (path: Path): path is Vector => path.type === PathType.VECTOR;\n","import {Vector} from './vector';\nimport {IPath, PathType, Path} from './path';\n\nconst lerp = (a: Vector, b: Vector, t: number): Vector => {\n return new Vector(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);\n};\n\nexport class BezierCurve implements IPath {\n type: PathType;\n start: Vector;\n startControl: Vector;\n endControl: Vector;\n end: Vector;\n\n constructor(start: Vector, startControl: Vector, endControl: Vector, end: Vector) {\n this.type = PathType.BEZIER_CURVE;\n this.start = start;\n this.startControl = startControl;\n this.endControl = endControl;\n this.end = end;\n }\n\n subdivide(t: number, firstHalf: boolean): BezierCurve {\n const ab = lerp(this.start, this.startControl, t);\n const bc = lerp(this.startControl, this.endControl, t);\n const cd = lerp(this.endControl, this.end, t);\n const abbc = lerp(ab, bc, t);\n const bccd = lerp(bc, cd, t);\n const dest = lerp(abbc, bccd, t);\n return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);\n }\n\n add(deltaX: number, deltaY: number): BezierCurve {\n return new BezierCurve(\n this.start.add(deltaX, deltaY),\n this.startControl.add(deltaX, deltaY),\n this.endControl.add(deltaX, deltaY),\n this.end.add(deltaX, deltaY)\n );\n }\n\n reverse(): BezierCurve {\n return new BezierCurve(this.end, this.endControl, this.startControl, this.start);\n }\n}\n\nexport const isBezierCurve = (path: Path): path is BezierCurve => path.type === PathType.BEZIER_CURVE;\n","import {Matrix} from '../css/property-descriptors/transform';\nimport {Path} from './path';\n\nexport const enum EffectType {\n TRANSFORM = 0,\n CLIP = 1\n}\n\nexport const enum EffectTarget {\n BACKGROUND_BORDERS = 1 << 1,\n CONTENT = 1 << 2\n}\n\nexport interface IElementEffect {\n readonly type: EffectType;\n readonly target: number;\n}\n\nexport class TransformEffect implements IElementEffect {\n readonly type: EffectType;\n readonly target: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly matrix: Matrix;\n\n constructor(offsetX: number, offsetY: number, matrix: Matrix) {\n this.type = EffectType.TRANSFORM;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.matrix = matrix;\n this.target = EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT;\n }\n}\n\nexport class ClipEffect implements IElementEffect {\n readonly type: EffectType;\n readonly target: number;\n readonly path: Path[];\n\n constructor(path: Path[], target: EffectTarget) {\n this.type = EffectType.CLIP;\n this.target = target;\n this.path = path;\n }\n}\n\nexport const isTransformEffect = (effect: IElementEffect): effect is TransformEffect =>\n effect.type === EffectType.TRANSFORM;\nexport const isClipEffect = (effect: IElementEffect): effect is ClipEffect => effect.type === EffectType.CLIP;\n","import {ElementContainer, FLAGS} from '../dom/element-container';\nimport {contains} from '../core/bitwise';\nimport {BoundCurves, calculateBorderBoxPath, calculatePaddingBoxPath} from './bound-curves';\nimport {ClipEffect, EffectTarget, IElementEffect, TransformEffect} from './effects';\nimport {OVERFLOW} from '../css/property-descriptors/overflow';\nimport {equalPath} from './path';\nimport {DISPLAY} from '../css/property-descriptors/display';\nimport {OLElementContainer} from '../dom/elements/ol-element-container';\nimport {LIElementContainer} from '../dom/elements/li-element-container';\nimport {createCounterText} from '../css/types/functions/counter';\n\nexport class StackingContext {\n element: ElementPaint;\n negativeZIndex: StackingContext[];\n zeroOrAutoZIndexOrTransformedOrOpacity: StackingContext[];\n positiveZIndex: StackingContext[];\n nonPositionedFloats: StackingContext[];\n nonPositionedInlineLevel: StackingContext[];\n inlineLevel: ElementPaint[];\n nonInlineLevel: ElementPaint[];\n\n constructor(container: ElementPaint) {\n this.element = container;\n this.inlineLevel = [];\n this.nonInlineLevel = [];\n this.negativeZIndex = [];\n this.zeroOrAutoZIndexOrTransformedOrOpacity = [];\n this.positiveZIndex = [];\n this.nonPositionedFloats = [];\n this.nonPositionedInlineLevel = [];\n }\n}\n\nexport class ElementPaint {\n container: ElementContainer;\n effects: IElementEffect[];\n curves: BoundCurves;\n listValue?: string;\n\n constructor(element: ElementContainer, parentStack: IElementEffect[]) {\n this.container = element;\n this.effects = parentStack.slice(0);\n this.curves = new BoundCurves(element);\n if (element.styles.transform !== null) {\n const offsetX = element.bounds.left + element.styles.transformOrigin[0].number;\n const offsetY = element.bounds.top + element.styles.transformOrigin[1].number;\n const matrix = element.styles.transform;\n this.effects.push(new TransformEffect(offsetX, offsetY, matrix));\n }\n\n if (element.styles.overflowX !== OVERFLOW.VISIBLE) {\n const borderBox = calculateBorderBoxPath(this.curves);\n const paddingBox = calculatePaddingBoxPath(this.curves);\n\n if (equalPath(borderBox, paddingBox)) {\n this.effects.push(new ClipEffect(borderBox, EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT));\n } else {\n this.effects.push(new ClipEffect(borderBox, EffectTarget.BACKGROUND_BORDERS));\n this.effects.push(new ClipEffect(paddingBox, EffectTarget.CONTENT));\n }\n }\n }\n\n getParentEffects(): IElementEffect[] {\n const effects = this.effects.slice(0);\n if (this.container.styles.overflowX !== OVERFLOW.VISIBLE) {\n const borderBox = calculateBorderBoxPath(this.curves);\n const paddingBox = calculatePaddingBoxPath(this.curves);\n if (!equalPath(borderBox, paddingBox)) {\n effects.push(new ClipEffect(paddingBox, EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT));\n }\n }\n return effects;\n }\n}\n\nconst parseStackTree = (\n parent: ElementPaint,\n stackingContext: StackingContext,\n realStackingContext: StackingContext,\n listItems: ElementPaint[]\n) => {\n parent.container.elements.forEach(child => {\n const treatAsRealStackingContext = contains(child.flags, FLAGS.CREATES_REAL_STACKING_CONTEXT);\n const createsStackingContext = contains(child.flags, FLAGS.CREATES_STACKING_CONTEXT);\n const paintContainer = new ElementPaint(child, parent.getParentEffects());\n if (contains(child.styles.display, DISPLAY.LIST_ITEM)) {\n listItems.push(paintContainer);\n }\n\n const listOwnerItems = contains(child.flags, FLAGS.IS_LIST_OWNER) ? [] : listItems;\n\n if (treatAsRealStackingContext || createsStackingContext) {\n const parentStack =\n treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;\n\n const stack = new StackingContext(paintContainer);\n\n if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {\n const order = child.styles.zIndex.order;\n if (order < 0) {\n let index = 0;\n\n parentStack.negativeZIndex.some((current, i) => {\n if (order > current.element.container.styles.zIndex.order) {\n index = i;\n return false;\n } else if (index > 0) {\n return true;\n }\n\n return false;\n });\n parentStack.negativeZIndex.splice(index, 0, stack);\n } else if (order > 0) {\n let index = 0;\n parentStack.positiveZIndex.some((current, i) => {\n if (order >= current.element.container.styles.zIndex.order) {\n index = i + 1;\n return false;\n } else if (index > 0) {\n return true;\n }\n\n return false;\n });\n parentStack.positiveZIndex.splice(index, 0, stack);\n } else {\n parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);\n }\n } else {\n if (child.styles.isFloating()) {\n parentStack.nonPositionedFloats.push(stack);\n } else {\n parentStack.nonPositionedInlineLevel.push(stack);\n }\n }\n\n parseStackTree(\n paintContainer,\n stack,\n treatAsRealStackingContext ? stack : realStackingContext,\n listOwnerItems\n );\n } else {\n if (child.styles.isInlineLevel()) {\n stackingContext.inlineLevel.push(paintContainer);\n } else {\n stackingContext.nonInlineLevel.push(paintContainer);\n }\n\n parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);\n }\n\n if (contains(child.flags, FLAGS.IS_LIST_OWNER)) {\n processListItems(child, listOwnerItems);\n }\n });\n};\n\nconst processListItems = (owner: ElementContainer, elements: ElementPaint[]) => {\n let numbering = owner instanceof OLElementContainer ? owner.start : 1;\n const reversed = owner instanceof OLElementContainer ? owner.reversed : false;\n for (let i = 0; i < elements.length; i++) {\n const item = elements[i];\n if (\n item.container instanceof LIElementContainer &&\n typeof item.container.value === 'number' &&\n item.container.value !== 0\n ) {\n numbering = item.container.value;\n }\n\n item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);\n\n numbering += reversed ? -1 : 1;\n }\n};\n\nexport const parseStackingContexts = (container: ElementContainer): StackingContext => {\n const paintContainer = new ElementPaint(container, []);\n const root = new StackingContext(paintContainer);\n const listItems: ElementPaint[] = [];\n parseStackTree(paintContainer, root, root, listItems);\n processListItems(paintContainer.container, listItems);\n return root;\n};\n","import {Path} from './path';\nimport {BoundCurves} from './bound-curves';\nimport {isBezierCurve} from './bezier-curve';\n\nexport const parsePathForBorder = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderBox,\n curves.topLeftPaddingBox,\n curves.topRightBorderBox,\n curves.topRightPaddingBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderBox,\n curves.topRightPaddingBox,\n curves.bottomRightBorderBox,\n curves.bottomRightPaddingBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftBorderBox,\n curves.bottomLeftPaddingBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderBox,\n curves.bottomLeftPaddingBox,\n curves.topLeftBorderBox,\n curves.topLeftPaddingBox\n );\n }\n};\n\nconst createPathFromCurves = (outer1: Path, inner1: Path, outer2: Path, inner2: Path): Path[] => {\n const path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n } else {\n path.push(outer1);\n }\n\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n } else {\n path.push(outer2);\n }\n\n if (isBezierCurve(inner2)) {\n path.push(inner2.subdivide(0.5, true).reverse());\n } else {\n path.push(inner2);\n }\n\n if (isBezierCurve(inner1)) {\n path.push(inner1.subdivide(0.5, false).reverse());\n } else {\n path.push(inner1);\n }\n\n return path;\n};\n","import {getAbsoluteValue} from '../css/types/length-percentage';\nimport {Bounds} from '../css/layout/bounds';\nimport {ElementContainer} from '../dom/element-container';\n\nexport const paddingBox = (element: ElementContainer): Bounds => {\n const bounds = element.bounds;\n const styles = element.styles;\n return bounds.add(\n styles.borderLeftWidth,\n styles.borderTopWidth,\n -(styles.borderRightWidth + styles.borderLeftWidth),\n -(styles.borderTopWidth + styles.borderBottomWidth)\n );\n};\n\nexport const contentBox = (element: ElementContainer): Bounds => {\n const styles = element.styles;\n const bounds = element.bounds;\n\n const paddingLeft = getAbsoluteValue(styles.paddingLeft, bounds.width);\n const paddingRight = getAbsoluteValue(styles.paddingRight, bounds.width);\n const paddingTop = getAbsoluteValue(styles.paddingTop, bounds.width);\n const paddingBottom = getAbsoluteValue(styles.paddingBottom, bounds.width);\n\n return bounds.add(\n paddingLeft + styles.borderLeftWidth,\n paddingTop + styles.borderTopWidth,\n -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft + paddingRight),\n -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop + paddingBottom)\n );\n};\n","import {Bounds} from '../css/layout/bounds';\nimport {BACKGROUND_ORIGIN} from '../css/property-descriptors/background-origin';\nimport {ElementContainer} from '../dom/element-container';\nimport {BACKGROUND_SIZE, BackgroundSizeInfo} from '../css/property-descriptors/background-size';\nimport {Vector} from './vector';\nimport {BACKGROUND_REPEAT} from '../css/property-descriptors/background-repeat';\nimport {getAbsoluteValue, getAbsoluteValueForTuple, isLengthPercentage} from '../css/types/length-percentage';\nimport {CSSValue, isIdentToken} from '../css/syntax/parser';\nimport {contentBox, paddingBox} from './box-sizing';\nimport {Path} from './path';\nimport {BACKGROUND_CLIP} from '../css/property-descriptors/background-clip';\n\nexport const calculateBackgroundPositioningArea = (\n backgroundOrigin: BACKGROUND_ORIGIN,\n element: ElementContainer\n): Bounds => {\n if (backgroundOrigin === BACKGROUND_ORIGIN.BORDER_BOX) {\n return element.bounds;\n }\n\n if (backgroundOrigin === BACKGROUND_ORIGIN.CONTENT_BOX) {\n return contentBox(element);\n }\n\n return paddingBox(element);\n};\n\nexport const calculateBackgroundPaintingArea = (backgroundClip: BACKGROUND_CLIP, element: ElementContainer): Bounds => {\n if (backgroundClip === BACKGROUND_CLIP.BORDER_BOX) {\n return element.bounds;\n }\n\n if (backgroundClip === BACKGROUND_CLIP.CONTENT_BOX) {\n return contentBox(element);\n }\n\n return paddingBox(element);\n};\n\nexport const calculateBackgroundRendering = (\n container: ElementContainer,\n index: number,\n intrinsicSize: [number | null, number | null, number | null]\n): [Path[], number, number, number, number] => {\n const backgroundPositioningArea = calculateBackgroundPositioningArea(\n getBackgroundValueForIndex(container.styles.backgroundOrigin, index),\n container\n );\n\n const backgroundPaintingArea = calculateBackgroundPaintingArea(\n getBackgroundValueForIndex(container.styles.backgroundClip, index),\n container\n );\n\n const backgroundImageSize = calculateBackgroundSize(\n getBackgroundValueForIndex(container.styles.backgroundSize, index),\n intrinsicSize,\n backgroundPositioningArea\n );\n\n const [sizeWidth, sizeHeight] = backgroundImageSize;\n\n const position = getAbsoluteValueForTuple(\n getBackgroundValueForIndex(container.styles.backgroundPosition, index),\n backgroundPositioningArea.width - sizeWidth,\n backgroundPositioningArea.height - sizeHeight\n );\n\n const path = calculateBackgroundRepeatPath(\n getBackgroundValueForIndex(container.styles.backgroundRepeat, index),\n position,\n backgroundImageSize,\n backgroundPositioningArea,\n backgroundPaintingArea\n );\n\n const offsetX = Math.round(backgroundPositioningArea.left + position[0]);\n const offsetY = Math.round(backgroundPositioningArea.top + position[1]);\n\n return [path, offsetX, offsetY, sizeWidth, sizeHeight];\n};\n\nexport const isAuto = (token: CSSValue): boolean => isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;\n\nconst hasIntrinsicValue = (value: number | null): value is number => typeof value === 'number';\n\nexport const calculateBackgroundSize = (\n size: BackgroundSizeInfo[],\n [intrinsicWidth, intrinsicHeight, intrinsicProportion]: [number | null, number | null, number | null],\n bounds: Bounds\n): [number, number] => {\n const [first, second] = size;\n\n if (isLengthPercentage(first) && second && isLengthPercentage(second)) {\n return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];\n }\n\n const hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);\n\n if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {\n if (hasIntrinsicValue(intrinsicProportion)) {\n const targetRatio = bounds.width / bounds.height;\n\n return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER)\n ? [bounds.width, bounds.width / intrinsicProportion]\n : [bounds.height * intrinsicProportion, bounds.height];\n }\n\n return [bounds.width, bounds.height];\n }\n\n const hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);\n const hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);\n const hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;\n\n // If the background-size is auto or auto auto:\n if (isAuto(first) && (!second || isAuto(second))) {\n // If the image has both horizontal and vertical intrinsic dimensions, it's rendered at that size.\n if (hasIntrinsicWidth && hasIntrinsicHeight) {\n return [intrinsicWidth as number, intrinsicHeight as number];\n }\n\n // If the image has no intrinsic dimensions and has no intrinsic proportions,\n // it's rendered at the size of the background positioning area.\n\n if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {\n return [bounds.width, bounds.height];\n }\n\n // TODO If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if contain had been specified instead.\n\n // If the image has only one intrinsic dimension and has intrinsic proportions, it's rendered at the size corresponding to that one dimension.\n // The other dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicDimensions && hasIntrinsicProportion) {\n const width = hasIntrinsicWidth\n ? (intrinsicWidth as number)\n : (intrinsicHeight as number) * (intrinsicProportion as number);\n const height = hasIntrinsicHeight\n ? (intrinsicHeight as number)\n : (intrinsicWidth as number) / (intrinsicProportion as number);\n return [width, height];\n }\n\n // If the image has only one intrinsic dimension but has no intrinsic proportions,\n // it's rendered using the specified dimension and the other dimension of the background positioning area.\n const width = hasIntrinsicWidth ? (intrinsicWidth as number) : bounds.width;\n const height = hasIntrinsicHeight ? (intrinsicHeight as number) : bounds.height;\n return [width, height];\n }\n\n // If the image has intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicProportion) {\n let width = 0;\n let height = 0;\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n } else if (isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n\n if (isAuto(first)) {\n width = height * (intrinsicProportion as number);\n } else if (!second || isAuto(second)) {\n height = width / (intrinsicProportion as number);\n }\n\n return [width, height];\n }\n\n // If the image has no intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the image's corresponding intrinsic dimension,\n // if there is one. If there is no such intrinsic dimension,\n // it becomes the corresponding dimension of the background positioning area.\n\n let width = null;\n let height = null;\n\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n } else if (second && isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n\n if (width !== null && (!second || isAuto(second))) {\n height =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (width / (intrinsicWidth as number)) * (intrinsicHeight as number)\n : bounds.height;\n }\n\n if (height !== null && isAuto(first)) {\n width =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (height / (intrinsicHeight as number)) * (intrinsicWidth as number)\n : bounds.width;\n }\n\n if (width !== null && height !== null) {\n return [width, height];\n }\n\n throw new Error(`Unable to calculate background-size for element`);\n};\n\nexport const getBackgroundValueForIndex = <T>(values: T[], index: number): T => {\n const value = values[index];\n if (typeof value === 'undefined') {\n return values[0];\n }\n\n return value;\n};\n\nexport const calculateBackgroundRepeatPath = (\n repeat: BACKGROUND_REPEAT,\n [x, y]: [number, number],\n [width, height]: [number, number],\n backgroundPositioningArea: Bounds,\n backgroundPaintingArea: Bounds\n) => {\n switch (repeat) {\n case BACKGROUND_REPEAT.REPEAT_X:\n return [\n new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),\n new Vector(\n Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width),\n Math.round(height + backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left),\n Math.round(height + backgroundPositioningArea.top + y)\n )\n ];\n case BACKGROUND_REPEAT.REPEAT_Y:\n return [\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)\n )\n ];\n case BACKGROUND_REPEAT.NO_REPEAT:\n return [\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top + y + height)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.top + y + height)\n )\n ];\n default:\n return [\n new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),\n new Vector(\n Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width),\n Math.round(backgroundPaintingArea.top)\n ),\n new Vector(\n Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width),\n Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)\n ),\n new Vector(\n Math.round(backgroundPaintingArea.left),\n Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)\n )\n ];\n }\n};\n","import {SMALL_IMAGE} from '../core/util';\nexport interface FontMetric {\n baseline: number;\n middle: number;\n}\n\nconst SAMPLE_TEXT = 'Hidden Text';\n\nexport class FontMetrics {\n private readonly _data: {[key: string]: FontMetric};\n private readonly _document: Document;\n\n constructor(document: Document) {\n this._data = {};\n this._document = document;\n }\n\n private parseMetrics(fontFamily: string, fontSize: string): FontMetric {\n const container = this._document.createElement('div');\n const img = this._document.createElement('img');\n const span = this._document.createElement('span');\n\n const body = this._document.body as HTMLBodyElement;\n\n container.style.visibility = 'hidden';\n container.style.fontFamily = fontFamily;\n container.style.fontSize = fontSize;\n container.style.margin = '0';\n container.style.padding = '0';\n\n body.appendChild(container);\n\n img.src = SMALL_IMAGE;\n img.width = 1;\n img.height = 1;\n\n img.style.margin = '0';\n img.style.padding = '0';\n img.style.verticalAlign = 'baseline';\n\n span.style.fontFamily = fontFamily;\n span.style.fontSize = fontSize;\n span.style.margin = '0';\n span.style.padding = '0';\n\n span.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n container.appendChild(span);\n container.appendChild(img);\n const baseline = img.offsetTop - span.offsetTop + 2;\n\n container.removeChild(span);\n container.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n\n container.style.lineHeight = 'normal';\n img.style.verticalAlign = 'super';\n\n const middle = img.offsetTop - container.offsetTop + 2;\n\n body.removeChild(container);\n\n return {baseline, middle};\n }\n getMetrics(fontFamily: string, fontSize: string): FontMetric {\n const key = `${fontFamily} ${fontSize}`;\n if (typeof this._data[key] === 'undefined') {\n this._data[key] = this.parseMetrics(fontFamily, fontSize);\n }\n\n return this._data[key];\n }\n}\n","export const SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n","import {ElementPaint, parseStackingContexts, StackingContext} from '../stacking-context';\nimport {asString, Color, isTransparent} from '../../css/types/color';\nimport {Logger} from '../../core/logger';\nimport {ElementContainer} from '../../dom/element-container';\nimport {BORDER_STYLE} from '../../css/property-descriptors/border-style';\nimport {CSSParsedDeclaration} from '../../css/index';\nimport {TextContainer} from '../../dom/text-container';\nimport {Path, transformPath} from '../path';\nimport {BACKGROUND_CLIP} from '../../css/property-descriptors/background-clip';\nimport {BoundCurves, calculateBorderBoxPath, calculateContentBoxPath, calculatePaddingBoxPath} from '../bound-curves';\nimport {isBezierCurve} from '../bezier-curve';\nimport {Vector} from '../vector';\nimport {CSSImageType, CSSURLImage, isLinearGradient, isRadialGradient} from '../../css/types/image';\nimport {parsePathForBorder} from '../border';\nimport {Cache} from '../../core/cache-storage';\nimport {calculateBackgroundRendering, getBackgroundValueForIndex} from '../background';\nimport {isDimensionToken} from '../../css/syntax/parser';\nimport {TextBounds} from '../../css/layout/text';\nimport {fromCodePoint, toCodePoints} from 'css-line-break';\nimport {ImageElementContainer} from '../../dom/replaced-elements/image-element-container';\nimport {contentBox} from '../box-sizing';\nimport {CanvasElementContainer} from '../../dom/replaced-elements/canvas-element-container';\nimport {SVGElementContainer} from '../../dom/replaced-elements/svg-element-container';\nimport {ReplacedElementContainer} from '../../dom/replaced-elements/index';\nimport {EffectTarget, IElementEffect, isClipEffect, isTransformEffect} from '../effects';\nimport {contains} from '../../core/bitwise';\nimport {calculateGradientDirection, calculateRadius, processColorStops} from '../../css/types/functions/gradient';\nimport {FIFTY_PERCENT, getAbsoluteValue} from '../../css/types/length-percentage';\nimport {TEXT_DECORATION_LINE} from '../../css/property-descriptors/text-decoration-line';\nimport {FontMetrics} from '../font-metrics';\nimport {DISPLAY} from '../../css/property-descriptors/display';\nimport {Bounds} from '../../css/layout/bounds';\nimport {LIST_STYLE_TYPE} from '../../css/property-descriptors/list-style-type';\nimport {computeLineHeight} from '../../css/property-descriptors/line-height';\nimport {CHECKBOX, INPUT_COLOR, InputElementContainer, RADIO} from '../../dom/replaced-elements/input-element-container';\nimport {TEXT_ALIGN} from '../../css/property-descriptors/text-align';\nimport {TextareaElementContainer} from '../../dom/elements/textarea-element-container';\nimport {SelectElementContainer} from '../../dom/elements/select-element-container';\nimport {IFrameElementContainer} from '../../dom/replaced-elements/iframe-element-container';\nimport {TextShadow} from '../../css/property-descriptors/text-shadow';\n\nexport type RenderConfigurations = RenderOptions & {\n backgroundColor: Color | null;\n};\n\nexport interface RenderOptions {\n id: string;\n scale: number;\n canvas?: HTMLCanvasElement;\n x: number;\n y: number;\n scrollX: number;\n scrollY: number;\n width: number;\n height: number;\n windowWidth: number;\n windowHeight: number;\n cache: Cache;\n}\n\nconst MASK_OFFSET = 10000;\n\nexport class CanvasRenderer {\n canvas: HTMLCanvasElement;\n ctx: CanvasRenderingContext2D;\n options: RenderConfigurations;\n private readonly _activeEffects: IElementEffect[] = [];\n private readonly fontMetrics: FontMetrics;\n\n constructor(options: RenderConfigurations) {\n this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d') as CanvasRenderingContext2D;\n this.options = options;\n if (!options.canvas) {\n this.canvas.width = Math.floor(options.width * options.scale);\n this.canvas.height = Math.floor(options.height * options.scale);\n this.canvas.style.width = `${options.width}px`;\n this.canvas.style.height = `${options.height}px`;\n }\n this.fontMetrics = new FontMetrics(document);\n this.ctx.scale(this.options.scale, this.options.scale);\n this.ctx.translate(-options.x + options.scrollX, -options.y + options.scrollY);\n this.ctx.textBaseline = 'bottom';\n this._activeEffects = [];\n Logger.getInstance(options.id).debug(\n `Canvas renderer initialized (${options.width}x${options.height} at ${options.x},${options.y}) with scale ${\n options.scale\n }`\n );\n }\n\n applyEffects(effects: IElementEffect[], target: EffectTarget) {\n while (this._activeEffects.length) {\n this.popEffect();\n }\n\n effects.filter(effect => contains(effect.target, target)).forEach(effect => this.applyEffect(effect));\n }\n\n applyEffect(effect: IElementEffect) {\n this.ctx.save();\n if (isTransformEffect(effect)) {\n this.ctx.translate(effect.offsetX, effect.offsetY);\n this.ctx.transform(\n effect.matrix[0],\n effect.matrix[1],\n effect.matrix[2],\n effect.matrix[3],\n effect.matrix[4],\n effect.matrix[5]\n );\n this.ctx.translate(-effect.offsetX, -effect.offsetY);\n }\n\n if (isClipEffect(effect)) {\n this.path(effect.path);\n this.ctx.clip();\n }\n\n this._activeEffects.push(effect);\n }\n\n popEffect() {\n this._activeEffects.pop();\n this.ctx.restore();\n }\n\n async renderStack(stack: StackingContext) {\n const styles = stack.element.container.styles;\n if (styles.isVisible()) {\n this.ctx.globalAlpha = styles.opacity;\n await this.renderStackContent(stack);\n }\n }\n\n async renderNode(paint: ElementPaint) {\n if (paint.container.styles.isVisible()) {\n await this.renderNodeBackgroundAndBorders(paint);\n await this.renderNodeContent(paint);\n }\n }\n\n renderTextWithLetterSpacing(text: TextBounds, letterSpacing: number) {\n if (letterSpacing === 0) {\n this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);\n } else {\n const letters = toCodePoints(text.text).map(i => fromCodePoint(i));\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, text.bounds.top + text.bounds.height);\n\n return left + this.ctx.measureText(letter).width;\n }, text.bounds.left);\n }\n }\n\n private createFontStyle(styles: CSSParsedDeclaration): string[] {\n const fontVariant = styles.fontVariant\n .filter(variant => variant === 'normal' || variant === 'small-caps')\n .join('');\n const fontFamily = styles.fontFamily.join(', ');\n const fontSize = isDimensionToken(styles.fontSize)\n ? `${styles.fontSize.number}${styles.fontSize.unit}`\n : `${styles.fontSize.number}px`;\n\n return [\n [styles.fontStyle, fontVariant, styles.fontWeight, fontSize, fontFamily].join(' '),\n fontFamily,\n fontSize\n ];\n }\n\n async renderTextNode(text: TextContainer, styles: CSSParsedDeclaration) {\n const [font, fontFamily, fontSize] = this.createFontStyle(styles);\n\n this.ctx.font = font;\n\n text.textBounds.forEach(text => {\n this.ctx.fillStyle = asString(styles.color);\n this.renderTextWithLetterSpacing(text, styles.letterSpacing);\n const textShadows: TextShadow = styles.textShadow;\n\n if (textShadows.length && text.text.trim().length) {\n textShadows\n .slice(0)\n .reverse()\n .forEach(textShadow => {\n this.ctx.shadowColor = asString(textShadow.color);\n this.ctx.shadowOffsetX = textShadow.offsetX.number * this.options.scale;\n this.ctx.shadowOffsetY = textShadow.offsetY.number * this.options.scale;\n this.ctx.shadowBlur = textShadow.blur.number;\n\n this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);\n });\n\n this.ctx.shadowColor = '';\n this.ctx.shadowOffsetX = 0;\n this.ctx.shadowOffsetY = 0;\n this.ctx.shadowBlur = 0;\n }\n\n if (styles.textDecorationLine.length) {\n this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);\n styles.textDecorationLine.forEach(textDecorationLine => {\n switch (textDecorationLine) {\n case TEXT_DECORATION_LINE.UNDERLINE:\n // Draws a line at the baseline of the font\n // TODO As some browsers display the line as more than 1px if the font-size is big,\n // need to take that into account both in position and size\n const {baseline} = this.fontMetrics.getMetrics(fontFamily, fontSize);\n this.ctx.fillRect(\n text.bounds.left,\n Math.round(text.bounds.top + baseline),\n text.bounds.width,\n 1\n );\n\n break;\n case TEXT_DECORATION_LINE.OVERLINE:\n this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);\n break;\n case TEXT_DECORATION_LINE.LINE_THROUGH:\n // TODO try and find exact position for line-through\n const {middle} = this.fontMetrics.getMetrics(fontFamily, fontSize);\n this.ctx.fillRect(\n text.bounds.left,\n Math.ceil(text.bounds.top + middle),\n text.bounds.width,\n 1\n );\n break;\n }\n });\n }\n });\n }\n\n renderReplacedElement(\n container: ReplacedElementContainer,\n curves: BoundCurves,\n image: HTMLImageElement | HTMLCanvasElement\n ) {\n if (image && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {\n const box = contentBox(container);\n const path = calculatePaddingBoxPath(curves);\n this.path(path);\n this.ctx.save();\n this.ctx.clip();\n this.ctx.drawImage(\n image,\n 0,\n 0,\n container.intrinsicWidth,\n container.intrinsicHeight,\n box.left,\n box.top,\n box.width,\n box.height\n );\n this.ctx.restore();\n }\n }\n\n async renderNodeContent(paint: ElementPaint) {\n this.applyEffects(paint.effects, EffectTarget.CONTENT);\n const container = paint.container;\n const curves = paint.curves;\n const styles = container.styles;\n for (const child of container.textNodes) {\n await this.renderTextNode(child, styles);\n }\n\n if (container instanceof ImageElementContainer) {\n try {\n const image = await this.options.cache.match(container.src);\n this.renderReplacedElement(container, curves, image);\n } catch (e) {\n Logger.getInstance(this.options.id).error(`Error loading image ${container.src}`);\n }\n }\n\n if (container instanceof CanvasElementContainer) {\n this.renderReplacedElement(container, curves, container.canvas);\n }\n\n if (container instanceof SVGElementContainer) {\n try {\n const image = await this.options.cache.match(container.svg);\n this.renderReplacedElement(container, curves, image);\n } catch (e) {\n Logger.getInstance(this.options.id).error(`Error loading svg ${container.svg.substring(0, 255)}`);\n }\n }\n\n if (container instanceof IFrameElementContainer && container.tree) {\n const iframeRenderer = new CanvasRenderer({\n id: this.options.id,\n scale: this.options.scale,\n backgroundColor: container.backgroundColor,\n x: 0,\n y: 0,\n scrollX: 0,\n scrollY: 0,\n width: container.width,\n height: container.height,\n cache: this.options.cache,\n windowWidth: container.width,\n windowHeight: container.height\n });\n\n const canvas = await iframeRenderer.render(container.tree);\n if (container.width && container.height) {\n this.ctx.drawImage(\n canvas,\n 0,\n 0,\n container.width,\n container.height,\n container.bounds.left,\n container.bounds.top,\n container.bounds.width,\n container.bounds.height\n );\n }\n }\n\n if (container instanceof InputElementContainer) {\n const size = Math.min(container.bounds.width, container.bounds.height);\n\n if (container.type === CHECKBOX) {\n if (container.checked) {\n this.ctx.save();\n this.path([\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),\n new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),\n new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),\n new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),\n new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),\n new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)\n ]);\n\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n } else if (container.type === RADIO) {\n if (container.checked) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(\n container.bounds.left + size / 2,\n container.bounds.top + size / 2,\n size / 4,\n 0,\n Math.PI * 2,\n true\n );\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n }\n }\n\n if (isTextInputElement(container) && container.value.length) {\n [this.ctx.font] = this.createFontStyle(styles);\n this.ctx.fillStyle = asString(styles.color);\n\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);\n\n const bounds = contentBox(container);\n\n let x = 0;\n\n switch (container.styles.textAlign) {\n case TEXT_ALIGN.CENTER:\n x += bounds.width / 2;\n break;\n case TEXT_ALIGN.RIGHT:\n x += bounds.width;\n break;\n }\n\n const textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);\n\n this.ctx.save();\n this.path([\n new Vector(bounds.left, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top + bounds.height),\n new Vector(bounds.left, bounds.top + bounds.height)\n ]);\n\n this.ctx.clip();\n this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing);\n this.ctx.restore();\n this.ctx.textBaseline = 'bottom';\n this.ctx.textAlign = 'left';\n }\n\n if (contains(container.styles.display, DISPLAY.LIST_ITEM)) {\n if (container.styles.listStyleImage !== null) {\n const img = container.styles.listStyleImage;\n if (img.type === CSSImageType.URL) {\n let image;\n const url = (img as CSSURLImage).url;\n try {\n image = await this.options.cache.match(url);\n this.ctx.drawImage(image, container.bounds.left - (image.width + 10), container.bounds.top);\n } catch (e) {\n Logger.getInstance(this.options.id).error(`Error loading list-style-image ${url}`);\n }\n }\n } else if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) {\n [this.ctx.font] = this.createFontStyle(styles);\n this.ctx.fillStyle = asString(styles.color);\n\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = 'right';\n const bounds = new Bounds(\n container.bounds.left,\n container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width),\n container.bounds.width,\n computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1\n );\n\n this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing);\n this.ctx.textBaseline = 'bottom';\n this.ctx.textAlign = 'left';\n }\n }\n }\n\n async renderStackContent(stack: StackingContext) {\n // https://www.w3.org/TR/css-position-3/#painting-order\n // 1. the background and borders of the element forming the stacking context.\n await this.renderNodeBackgroundAndBorders(stack.element);\n // 2. the child stacking contexts with negative stack levels (most negative first).\n for (const child of stack.negativeZIndex) {\n await this.renderStack(child);\n }\n // 3. For all its in-flow, non-positioned, block-level descendants in tree order:\n await this.renderNodeContent(stack.element);\n\n for (const child of stack.nonInlineLevel) {\n await this.renderNode(child);\n }\n // 4. All non-positioned floating descendants, in tree order. For each one of these,\n // treat the element as if it created a new stacking context, but any positioned descendants and descendants\n // which actually create a new stacking context should be considered part of the parent stacking context,\n // not this new one.\n for (const child of stack.nonPositionedFloats) {\n await this.renderStack(child);\n }\n // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.\n for (const child of stack.nonPositionedInlineLevel) {\n await this.renderStack(child);\n }\n for (const child of stack.inlineLevel) {\n await this.renderNode(child);\n }\n // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:\n // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.\n // For those with 'z-index: auto', treat the element as if it created a new stacking context,\n // but any positioned descendants and descendants which actually create a new stacking context should be\n // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',\n // treat the stacking context generated atomically.\n //\n // All opacity descendants with opacity less than 1\n //\n // All transform descendants with transform other than none\n for (const child of stack.zeroOrAutoZIndexOrTransformedOrOpacity) {\n await this.renderStack(child);\n }\n // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index\n // order (smallest first) then tree order.\n for (const child of stack.positiveZIndex) {\n await this.renderStack(child);\n }\n }\n\n mask(paths: Path[]) {\n this.ctx.beginPath();\n this.ctx.moveTo(0, 0);\n this.ctx.lineTo(this.canvas.width, 0);\n this.ctx.lineTo(this.canvas.width, this.canvas.height);\n this.ctx.lineTo(0, this.canvas.height);\n this.ctx.lineTo(0, 0);\n this.formatPath(paths.slice(0).reverse());\n this.ctx.closePath();\n }\n\n path(paths: Path[]) {\n this.ctx.beginPath();\n this.formatPath(paths);\n this.ctx.closePath();\n }\n\n formatPath(paths: Path[]) {\n paths.forEach((point, index) => {\n const start: Vector = isBezierCurve(point) ? point.start : point;\n if (index === 0) {\n this.ctx.moveTo(start.x, start.y);\n } else {\n this.ctx.lineTo(start.x, start.y);\n }\n\n if (isBezierCurve(point)) {\n this.ctx.bezierCurveTo(\n point.startControl.x,\n point.startControl.y,\n point.endControl.x,\n point.endControl.y,\n point.end.x,\n point.end.y\n );\n }\n });\n }\n\n renderRepeat(path: Path[], pattern: CanvasPattern | CanvasGradient, offsetX: number, offsetY: number) {\n this.path(path);\n this.ctx.fillStyle = pattern;\n this.ctx.translate(offsetX, offsetY);\n this.ctx.fill();\n this.ctx.translate(-offsetX, -offsetY);\n }\n\n resizeImage(image: HTMLImageElement, width: number, height: number): HTMLCanvasElement | HTMLImageElement {\n if (image.width === width && image.height === height) {\n return image;\n }\n\n const canvas = (this.canvas.ownerDocument as Document).createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);\n return canvas;\n }\n\n async renderBackgroundImage(container: ElementContainer) {\n let index = container.styles.backgroundImage.length - 1;\n for (const backgroundImage of container.styles.backgroundImage.slice(0).reverse()) {\n if (backgroundImage.type === CSSImageType.URL) {\n let image;\n const url = (backgroundImage as CSSURLImage).url;\n try {\n image = await this.options.cache.match(url);\n } catch (e) {\n Logger.getInstance(this.options.id).error(`Error loading background-image ${url}`);\n }\n\n if (image) {\n const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [\n image.width,\n image.height,\n image.width / image.height\n ]);\n const pattern = this.ctx.createPattern(\n this.resizeImage(image, width, height),\n 'repeat'\n ) as CanvasPattern;\n this.renderRepeat(path, pattern, x, y);\n }\n } else if (isLinearGradient(backgroundImage)) {\n const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [null, null, null]);\n const [lineLength, x0, x1, y0, y1] = calculateGradientDirection(backgroundImage.angle, width, height);\n\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n\n processColorStops(backgroundImage.stops, lineLength).forEach(colorStop =>\n gradient.addColorStop(colorStop.stop, asString(colorStop.color))\n );\n\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, width, height);\n if (width > 0 && height > 0) {\n const pattern = this.ctx.createPattern(canvas, 'repeat') as CanvasPattern;\n this.renderRepeat(path, pattern, x, y);\n }\n } else if (isRadialGradient(backgroundImage)) {\n const [path, left, top, width, height] = calculateBackgroundRendering(container, index, [\n null,\n null,\n null\n ]);\n const position = backgroundImage.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage.position;\n const x = getAbsoluteValue(position[0], width);\n const y = getAbsoluteValue(position[position.length - 1], height);\n\n const [rx, ry] = calculateRadius(backgroundImage, x, y, width, height);\n if (rx > 0 && rx > 0) {\n const radialGradient = this.ctx.createRadialGradient(left + x, top + y, 0, left + x, top + y, rx);\n\n processColorStops(backgroundImage.stops, rx * 2).forEach(colorStop =>\n radialGradient.addColorStop(colorStop.stop, asString(colorStop.color))\n );\n\n this.path(path);\n this.ctx.fillStyle = radialGradient;\n if (rx !== ry) {\n // transforms for elliptical radial gradient\n const midX = container.bounds.left + 0.5 * container.bounds.width;\n const midY = container.bounds.top + 0.5 * container.bounds.height;\n const f = ry / rx;\n const invF = 1 / f;\n\n this.ctx.save();\n this.ctx.translate(midX, midY);\n this.ctx.transform(1, 0, 0, f, 0, 0);\n this.ctx.translate(-midX, -midY);\n\n this.ctx.fillRect(left, invF * (top - midY) + midY, width, height * invF);\n this.ctx.restore();\n } else {\n this.ctx.fill();\n }\n }\n }\n index--;\n }\n }\n\n async renderBorder(color: Color, side: number, curvePoints: BoundCurves) {\n this.path(parsePathForBorder(curvePoints, side));\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n }\n\n async renderNodeBackgroundAndBorders(paint: ElementPaint) {\n this.applyEffects(paint.effects, EffectTarget.BACKGROUND_BORDERS);\n const styles = paint.container.styles;\n const hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;\n\n const borders = [\n {style: styles.borderTopStyle, color: styles.borderTopColor},\n {style: styles.borderRightStyle, color: styles.borderRightColor},\n {style: styles.borderBottomStyle, color: styles.borderBottomColor},\n {style: styles.borderLeftStyle, color: styles.borderLeftColor}\n ];\n\n const backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(\n getBackgroundValueForIndex(styles.backgroundClip, 0),\n paint.curves\n );\n\n if (hasBackground || styles.boxShadow.length) {\n this.ctx.save();\n this.path(backgroundPaintingArea);\n this.ctx.clip();\n\n if (!isTransparent(styles.backgroundColor)) {\n this.ctx.fillStyle = asString(styles.backgroundColor);\n this.ctx.fill();\n }\n\n await this.renderBackgroundImage(paint.container);\n\n this.ctx.restore();\n\n styles.boxShadow\n .slice(0)\n .reverse()\n .forEach(shadow => {\n this.ctx.save();\n const borderBoxArea = calculateBorderBoxPath(paint.curves);\n const maskOffset = shadow.inset ? 0 : MASK_OFFSET;\n const shadowPaintingArea = transformPath(\n borderBoxArea,\n -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number,\n (shadow.inset ? 1 : -1) * shadow.spread.number,\n shadow.spread.number * (shadow.inset ? -2 : 2),\n shadow.spread.number * (shadow.inset ? -2 : 2)\n );\n\n if (shadow.inset) {\n this.path(borderBoxArea);\n this.ctx.clip();\n this.mask(shadowPaintingArea);\n } else {\n this.mask(borderBoxArea);\n this.ctx.clip();\n this.path(shadowPaintingArea);\n }\n\n this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;\n this.ctx.shadowOffsetY = shadow.offsetY.number;\n this.ctx.shadowColor = asString(shadow.color);\n this.ctx.shadowBlur = shadow.blur.number;\n this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : 'rgba(0,0,0,1)';\n\n this.ctx.fill();\n this.ctx.restore();\n });\n }\n\n let side = 0;\n for (const border of borders) {\n if (border.style !== BORDER_STYLE.NONE && !isTransparent(border.color)) {\n await this.renderBorder(border.color, side, paint.curves);\n }\n side++;\n }\n }\n\n async render(element: ElementContainer): Promise<HTMLCanvasElement> {\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(\n this.options.x - this.options.scrollX,\n this.options.y - this.options.scrollY,\n this.options.width,\n this.options.height\n );\n }\n\n const stack = parseStackingContexts(element);\n\n await this.renderStack(stack);\n this.applyEffects([], EffectTarget.BACKGROUND_BORDERS);\n return this.canvas;\n }\n}\n\nconst isTextInputElement = (\n container: ElementContainer\n): container is InputElementContainer | TextareaElementContainer | SelectElementContainer => {\n if (container instanceof TextareaElementContainer) {\n return true;\n } else if (container instanceof SelectElementContainer) {\n return true;\n } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {\n return true;\n }\n return false;\n};\n\nconst calculateBackgroundCurvedPaintingArea = (clip: BACKGROUND_CLIP, curves: BoundCurves): Path[] => {\n switch (clip) {\n case BACKGROUND_CLIP.BORDER_BOX:\n return calculateBorderBoxPath(curves);\n case BACKGROUND_CLIP.CONTENT_BOX:\n return calculateContentBoxPath(curves);\n case BACKGROUND_CLIP.PADDING_BOX:\n default:\n return calculatePaddingBoxPath(curves);\n }\n};\n\nconst canvasTextAlign = (textAlign: TEXT_ALIGN): CanvasTextAlign => {\n switch (textAlign) {\n case TEXT_ALIGN.CENTER:\n return 'center';\n case TEXT_ALIGN.RIGHT:\n return 'right';\n case TEXT_ALIGN.LEFT:\n default:\n return 'left';\n }\n};\n","import {RenderConfigurations} from './canvas-renderer';\nimport {Logger} from '../../core/logger';\nimport {createForeignObjectSVG} from '../../core/features';\nimport {asString} from '../../css/types/color';\n\nexport class ForeignObjectRenderer {\n canvas: HTMLCanvasElement;\n ctx: CanvasRenderingContext2D;\n options: RenderConfigurations;\n\n constructor(options: RenderConfigurations) {\n this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d') as CanvasRenderingContext2D;\n this.options = options;\n this.canvas.width = Math.floor(options.width * options.scale);\n this.canvas.height = Math.floor(options.height * options.scale);\n this.canvas.style.width = `${options.width}px`;\n this.canvas.style.height = `${options.height}px`;\n\n this.ctx.scale(this.options.scale, this.options.scale);\n this.ctx.translate(-options.x + options.scrollX, -options.y + options.scrollY);\n Logger.getInstance(options.id).debug(\n `EXPERIMENTAL ForeignObject renderer initialized (${options.width}x${options.height} at ${options.x},${\n options.y\n }) with scale ${options.scale}`\n );\n }\n\n async render(element: HTMLElement) {\n const svg = createForeignObjectSVG(\n Math.max(this.options.windowWidth, this.options.width) * this.options.scale,\n Math.max(this.options.windowHeight, this.options.height) * this.options.scale,\n this.options.scrollX * this.options.scale,\n this.options.scrollY * this.options.scale,\n element\n );\n\n const img = await loadSerializedSVG(svg);\n\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);\n }\n\n this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);\n\n return this.canvas;\n }\n}\n\nexport const loadSerializedSVG = (svg: Node): Promise<HTMLImageElement> =>\n new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n resolve(img);\n };\n img.onerror = reject;\n\n img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n });\n"]}