Files
ArtPlayer/docs/compiled/artplayer-plugin-libass.mjs.map
T
Harvey Zack c911928166 feat: add danmuku plugin documentation and i18n setup
- Created a new documentation file for the danmuku plugin with interactive code execution.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Introduced a test file to verify the integration of the danmuku plugin.
2025-08-17 12:09:50 +08:00

1 line
197 KiB
Plaintext

{"mappings":"C,A,S,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,E,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,A,Y,O,C,C,E,E,C,C,E,C,E,E,C,E,C,E,E,E,K,E,C,E,E,A,a,O,Q,A,Y,O,O,O,E,O,O,C,I,C,Q,S,E,C,C,C,E,G,C,C,C,E,C,C,G,C,C,C,E,C,C,G,C,C,E,C,O,C,C,E,C,I,E,A,Y,O,C,C,E,E,C,C,E,C,G,C,G,E,O,E,E,C,G,G,E,O,E,E,C,G,G,G,A,U,O,E,O,E,G,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,O,C,S,C,E,I,E,C,C,E,C,E,C,E,C,O,A,M,E,E,C,E,E,K,C,C,E,I,E,C,C,E,C,I,E,M,C,G,C,C,E,C,E,C,I,C,E,O,C,E,E,E,O,C,E,C,O,C,C,E,C,O,C,S,E,C,E,I,E,E,O,C,G,M,A,C,I,E,C,E,E,E,C,C,E,e,C,C,E,E,M,C,S,C,E,I,C,E,C,E,I,C,M,C,E,I,C,O,C,E,I,C,O,C,C,C,E,E,O,C,E,E,K,C,E,E,M,C,E,E,O,C,K,E,E,S,C,K,E,E,S,C,K,E,E,C,C,E,E,Q,C,S,C,C,C,E,C,C,E,C,C,S,C,C,C,E,E,O,C,C,E,C,E,A,E,O,c,C,E,O,C,I,W,O,C,C,E,A,C,G,C,C,E,C,E,I,I,E,E,E,E,M,C,I,E,C,C,E,E,G,E,C,I,E,E,E,A,C,U,O,S,A,a,O,O,O,O,C,E,A,Y,O,Q,O,G,E,O,W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AG,SAAU,CAAM,CAAE,CAAI,EAkBxC,OAjBA,OAAO,IAAI,CAAC,GAAQ,OAAO,CAAC,SAAU,CAAG,EAE7B,YAAR,GACA,AAAQ,eAAR,GACA,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAM,IAK7C,OAAO,cAAc,CAAC,EAAM,EAAK,CAC/B,WAAY,CAAA,EACZ,IAAK,WACH,OAAO,CAAM,CAAC,EAAI,AACpB,CACF,EACF,GAEO,CACT,EAEA,EAAQ,MAAM,CAAG,SAAU,CAAI,CAAE,CAAQ,CAAE,CAAG,EAC5C,OAAO,cAAc,CAAC,EAAM,EAAU,CACpC,WAAY,CAAA,EACZ,IAAK,CACP,EACF,C,E,C,E,E,C,Q,C,Q,oB,C,G,G,C,Q,C,C,C,kB,gB,K,O","sources":["<anon>","packages/artplayer-plugin-libass/src/index.js","packages/artplayer-plugin-libass/src/adapter.js","node_modules/libass-wasm/dist/js/subtitles-octopus.js","node_modules/@parcel/transformer-js/src/esmodule-helpers.js"],"sourcesContent":["// modules are defined as an array\n// [ module function, map of requires ]\n//\n// map of requires is short require name -> numeric require\n//\n// anything defined in a previous bundle is accessed via the\n// orig method which is the require for previous bundles\n\n(function (\n modules,\n entry,\n mainEntry,\n parcelRequireName,\n externals,\n distDir,\n publicUrl,\n devServer\n) {\n /* eslint-disable no-undef */\n var globalObject =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n /* eslint-enable no-undef */\n\n // Save the require from previous bundle to this closure if any\n var previousRequire =\n typeof globalObject[parcelRequireName] === 'function' &&\n globalObject[parcelRequireName];\n\n var importMap = previousRequire.i || {};\n var cache = previousRequire.cache || {};\n // Do not use `require` to prevent Webpack from trying to bundle this call\n var nodeRequire =\n typeof module !== 'undefined' &&\n typeof module.require === 'function' &&\n module.require.bind(module);\n\n function newRequire(name, jumped) {\n if (!cache[name]) {\n if (!modules[name]) {\n if (externals[name]) {\n return externals[name];\n }\n // if we cannot find the module within our internal map or\n // cache jump to the current global require ie. the last bundle\n // that was added to the page.\n var currentRequire =\n typeof globalObject[parcelRequireName] === 'function' &&\n globalObject[parcelRequireName];\n if (!jumped && currentRequire) {\n return currentRequire(name, true);\n }\n\n // If there are other bundles on this page the require from the\n // previous one is saved to 'previousRequire'. Repeat this as\n // many times as there are bundles until the module is found or\n // we exhaust the require chain.\n if (previousRequire) {\n return previousRequire(name, true);\n }\n\n // Try the node require function if it exists.\n if (nodeRequire && typeof name === 'string') {\n return nodeRequire(name);\n }\n\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n }\n\n localRequire.resolve = resolve;\n localRequire.cache = {};\n\n var module = (cache[name] = new newRequire.Module(name));\n\n modules[name][0].call(\n module.exports,\n localRequire,\n module,\n module.exports,\n globalObject\n );\n }\n\n return cache[name].exports;\n\n function localRequire(x) {\n var res = localRequire.resolve(x);\n return res === false ? {} : newRequire(res);\n }\n\n function resolve(x) {\n var id = modules[name][1][x];\n return id != null ? id : x;\n }\n }\n\n function Module(moduleName) {\n this.id = moduleName;\n this.bundle = newRequire;\n this.require = nodeRequire;\n this.exports = {};\n }\n\n newRequire.isParcelRequire = true;\n newRequire.Module = Module;\n newRequire.modules = modules;\n newRequire.cache = cache;\n newRequire.parent = previousRequire;\n newRequire.distDir = distDir;\n newRequire.publicUrl = publicUrl;\n newRequire.devServer = devServer;\n newRequire.i = importMap;\n newRequire.register = function (id, exports) {\n modules[id] = [\n function (require, module) {\n module.exports = exports;\n },\n {},\n ];\n };\n\n // Only insert newRequire.load when it is actually used.\n // The code in this file is linted against ES5, so dynamic import is not allowed.\n // INSERT_LOAD_HERE\n\n Object.defineProperty(newRequire, 'root', {\n get: function () {\n return globalObject[parcelRequireName];\n },\n });\n\n globalObject[parcelRequireName] = newRequire;\n\n for (var i = 0; i < entry.length; i++) {\n newRequire(entry[i]);\n }\n\n if (mainEntry) {\n // Expose entry point to Node, AMD or browser globals\n // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js\n var mainExports = newRequire(mainEntry);\n\n // CommonJS\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n module.exports = mainExports;\n\n // RequireJS\n } else if (typeof define === 'function' && define.amd) {\n define(function () {\n return mainExports;\n });\n }\n }\n})({\"4083l\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"default\", ()=>artplayerPluginLibass);\nvar _adapter = require(\"./adapter\");\nvar _adapterDefault = parcelHelpers.interopDefault(_adapter);\nfunction artplayerPluginLibass(option) {\n return (art)=>{\n const adapter = new (0, _adapterDefault.default)(art, option);\n return {\n name: 'artplayerPluginLibass',\n libass: adapter.libass,\n visible: adapter.visible,\n init: adapter.init.bind(adapter),\n switch: adapter.switch.bind(adapter),\n show: adapter.show.bind(adapter),\n hide: adapter.hide.bind(adapter),\n destroy: adapter.destroy.bind(adapter)\n };\n };\n}\nif (typeof window !== 'undefined') window.artplayerPluginLibass = artplayerPluginLibass;\n\n},{\"./adapter\":\"uLby7\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"5lQoW\"}],\"uLby7\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nvar _libassWasm = require(\"libass-wasm\");\nvar _libassWasmDefault = parcelHelpers.interopDefault(_libassWasm);\nconst defaultAssSubtitle = `[Script Info]\\nScriptType: v4.00+`;\nclass LibassAdapter {\n constructor(art, option){\n const { constructor, template } = art;\n this.art = art;\n this.$video = template.$video;\n this.$webvtt = template.$subtitle;\n this.utils = constructor.utils;\n this.libass = null;\n art.once('ready', this.init.bind(this, option));\n }\n async init(option) {\n this.#checkWebAssemblySupport();\n await this.#createLibass(option);\n this.#addEventListeners();\n this.art.emit('artplayerPluginLibass:init', this);\n // set initial subtitle\n const initialSubtitle = this.art?.option?.subtitle?.url;\n if (initialSubtitle && this.utils.getExt(initialSubtitle) === 'ass') this.switch(initialSubtitle);\n }\n switch(url) {\n this.art.emit('artplayerPluginLibass:switch', url);\n if (url && this.utils.getExt(url) === 'ass') {\n this.currentType = 'ass';\n this.libass.freeTrack();\n this.libass.setTrackByUrl(this.#toAbsoluteUrl(url));\n this.visible = this.art.subtitle.show;\n } else {\n this.currentType = 'webvtt';\n this.hide();\n this.libass.freeTrack();\n }\n }\n setVisibility(visible) {\n this.visible = visible;\n }\n setOffset(offset) {\n this.timeOffset = offset;\n }\n get active() {\n return this.currentType === 'ass';\n }\n get visible() {\n if (!this.libass) return false;\n return this.libass.canvasParent.style.display !== 'none';\n }\n set visible(visible) {\n this.art.emit('artplayerPluginLibass:visible', visible);\n this.#setVttVisible(!this.active);\n if (this.libass.canvasParent) {\n this.libass.canvasParent.style.display = visible ? 'block' : 'none';\n if (visible) this.libass.resize();\n }\n }\n get timeOffset() {\n return this.libass.timeOffset;\n }\n set timeOffset(offset) {\n this.art.emit('artplayerPluginLibass:timeOffset', offset);\n this.libass.timeOffset = offset;\n }\n show() {\n this.visible = true;\n }\n hide() {\n this.visible = false;\n }\n destroy() {\n this.art.emit('artplayerPluginLibass:destroy');\n this.#removeEventListeners();\n this.libass.dispose();\n URL.revokeObjectURL(this.workerScriptUrl);\n this.libass = null;\n }\n async #createLibass(option = {}) {\n if (!option.fallbackFont) return this.utils.errorHandle(option.fallbackFont, 'artplayerPluginLibass: fallbackFont is required');\n if (!option.workerUrl) option.workerUrl = 'https://cdnjs.cloudflare.com/ajax/libs/libass-wasm/4.1.0/js/subtitles-octopus-worker.js';\n if (option.availableFonts) option.availableFonts = Object.entries(option.availableFonts).reduce((acc, [key, value])=>{\n acc[key] = this.#toAbsoluteUrl(value);\n return acc;\n }, {});\n this.libass = new (0, _libassWasmDefault.default)({\n subContent: defaultAssSubtitle,\n video: this.$video,\n ...option,\n workerUrl: await this.#loadWorker(option),\n fallbackFont: this.#toAbsoluteUrl(option.fallbackFont),\n fonts: option.fonts?.map((font)=>this.#toAbsoluteUrl(font))\n });\n this.libass.canvasParent.className = 'artplayer-plugin-libass';\n this.libass.canvasParent.style.cssText = `\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n user-select: none;\n pointer-events: none;\n z-index: 20;`;\n }\n #addEventListeners() {\n this.switchHandler = this.switch.bind(this);\n this.visibleHandler = this.setVisibility.bind(this);\n this.offsetHandler = this.setOffset.bind(this);\n this.art.on('subtitle', this.visibleHandler);\n this.art.on('subtitleLoad', this.switchHandler);\n this.art.on('subtitleOffset', this.offsetHandler);\n this.art.once('destroy', this.destroy.bind(this));\n }\n #removeEventListeners() {\n this.art.off('subtitle', this.visibleHandler);\n this.art.off('subtitleLoad', this.switchHandler);\n this.art.off('subtitleOffset', this.offsetHandler);\n }\n #setVttVisible(visible) {\n this.$webvtt.style.visibility = visible ? 'visible' : 'hidden';\n }\n #toAbsoluteUrl(url) {\n if (this.#isAbsoluteUrl(url)) return url;\n // handle absolute URL when the `Worker` of `BLOB` type loading network resources\n return new URL(url, document.baseURI).toString();\n }\n #isAbsoluteUrl(url) {\n return /^https?:\\/\\//.test(url);\n }\n #loadWorker({ workerUrl, wasmUrl }) {\n return new Promise((resolve)=>{\n fetch(workerUrl).then((res)=>res.text()).then((text)=>{\n let workerScriptContent = text;\n workerScriptContent = workerScriptContent.replace(/wasmBinaryFile\\s*=\\s*\"(subtitles-octopus-worker\\.wasm)\"/g, (_match, wasm)=>{\n if (!wasmUrl) wasmUrl = new URL(wasm, workerUrl).toString();\n else wasmUrl = this.#toAbsoluteUrl(wasmUrl);\n return `wasmBinaryFile = \"${wasmUrl}\"`;\n });\n const workerBlob = new Blob([\n workerScriptContent\n ], {\n type: 'text/javascript'\n });\n resolve(URL.createObjectURL(workerBlob));\n });\n });\n }\n #checkWebAssemblySupport() {\n let supportsWebAssembly = false;\n try {\n if (typeof WebAssembly === 'object' && typeof WebAssembly.instantiate === 'function') {\n const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6D, 0x01, 0x00, 0x00, 0x00));\n if (module instanceof WebAssembly.Module) supportsWebAssembly = new WebAssembly.Instance(module) instanceof WebAssembly.Instance;\n }\n } catch (error) {\n console.error('WebAssembly is not supported in this browser.', error);\n supportsWebAssembly = false;\n }\n this.utils.errorHandle(supportsWebAssembly, 'Browser does not support WebAssembly');\n }\n}\nexports.default = LibassAdapter;\n\n},{\"libass-wasm\":\"hVU5p\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"5lQoW\"}],\"hVU5p\":[function(require,module,exports,__globalThis) {\n// # The following lists all copyright notices and licenses for the\n// # work contained in JavascriptSubtitlesOctopus per project.\n// \n// # Project: subtitlesoctopus\n// License: Expat\n// Copyright: 2017-2021 JavascriptSubtitlesOctopus contributors\n// \n// # Project: brotli\n// License: Expat\n// Copyright: 2014 Google Inc.\n// 2015 The Chromium Authors.\n// 2016 Google Inc.\n// 2017 Google Inc.\n// 2018 Google Inc.\n// 2015 Google Inc.\n// 2013 Google Inc.\n// 2009, 2010, 2013-2016 by the Brotli Authors\n// 2010 Google Inc.\n// \n// # Project: expat\n// License: Expat\n// Copyright: 2019 Zhongyuan Zhou <zhouzhongyuan@huawei.com>\n// 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>\n// 2020 Joe Orton <jorton@redhat.com>\n// 2016-2019 Sebastian Pipping <sebastian@pipping.org>\n// 2021 Dong-hee Na <donghee.na@python.org>\n// 2017 Joe Orton <jorton@redhat.com>\n// 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2004-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2017 Sebastian Pipping <sebastian@pipping.org>\n// 2004-2006 Karl Waclawek <karl@waclawek.net>\n// 2006 Karl Waclawek <karl@waclawek.net>\n// 2003-2006 Karl Waclawek <karl@waclawek.net>\n// 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2017 Franek Korta <fkorta@gmail.com>\n// 2001-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2006-2012 Karl Waclawek <karl@waclawek.net>\n// 2017 Benbuck Nason <bnason@netflix.com>\n// 2019 David Loffredo <loffredo@steptools.com>\n// 2021 Tim Bray <tbray@textuality.com>\n// 2018 Benjamin Peterson <benjamin@python.org>\n// 2017 Rhodri James <rhodri@wildebeest.org.uk>\n// 2002-2005 Karl Waclawek <karl@waclawek.net>\n// 2016-2020 Sebastian Pipping <sebastian@pipping.org>\n// 2016-2018 Sebastian Pipping <sebastian@pipping.org>\n// 2016 Gilles Espinasse <g.esp@free.fr>\n// 2007 Karl Waclawek <karl@waclawek.net>\n// 2002-2016 Karl Waclawek <karl@waclawek.net>\n// 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2016 Don Lewis <truckman@apache.org>\n// 2000-2017 Expat development team\n// 2002-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2000 Clark Cooper <coopercc@users.sourceforge.net>\n// 2002 Greg Stein <gstein@users.sourceforge.net>\n// 2018 Marco Maggi <marco.maggi-ipsu@poste.it>\n// 2005-2012 Karl Waclawek <karl@waclawek.net>\n// 2020 Boris Kolpackov <boris@codesynthesis.com>\n// 2022 Thijs Schreijer <thijs@thijsschreijer.nl>\n// 2017-2019 Sebastian Pipping <sebastian@pipping.org>\n// 2016 Cristian Rodr\\x{00c3}\\x{00ad}guez <crrodriguez@opensuse.org>\n// 2005 Karl Waclawek <karl@waclawek.net>\n// 1999-2000 Thai Open Source Software Center Ltd\n// 2000-2017 Expat development team / 1997-2000 Thai Open Source Software Center Ltd\n// 2005-2007 Steven Solie <steven@solie.ca>\n// 2016-2021 Sebastian Pipping <sebastian@pipping.org>\n// 2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2018 Anton Maklakov <antmak.pub@gmail.com>\n// 2017 Alexander Bluhm <alexander.bluhm@gmx.net>\n// 2016-2022 Sebastian Pipping <sebastian@pipping.org>\n// 1997-2000 Thai Open Source Software Center Ltd\n// 2017-2021 Sebastian Pipping <sebastian@pipping.org>\n// 2002-2009 Karl Waclawek <karl@waclawek.net>\n// 2002 Karl Waclawek <karl@waclawek.net>\n// 2004-2009 Karl Waclawek <karl@waclawek.net>\n// 2020 Tim Gates <tim.gates@iress.com>\n// 2016 Pascal Cuoq <cuoq@trust-in-soft.com>\n// 2017 Jos\\x{00c3}\\x{00a9} Guti\\x{00c3}\\x{00a9}rrez de la Concha <jose@zeroc.com>\n// 2001-2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2002-2006 Karl Waclawek <karl@waclawek.net>\n// 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2005-2009 Steven Solie <steven@solie.ca>\n// 2018 Yury Gribov <tetra2005@gmail.com>\n// 2022 Martin Ettl <ettl.martin78@googlemail.com>\n// 2003 Greg Stein <gstein@users.sourceforge.net>\n// 2016-2017 Sebastian Pipping <sebastian@pipping.org>\n// 2020 Kleber Tarc\\x{00c3}\\x{00ad}sio <klebertarcisio@yahoo.com.br>\n// 2001-2002 Greg Stein <gstein@users.sourceforge.net>\n// 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2005-2006 Karl Waclawek <karl@waclawek.net>\n// 2016 Thomas Beutlich <tc@tbeu.de>\n// \n// # Project: freetype\n// License: FTL\n// Copyright: \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5} \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5}\\x{00d1}\\x{008f}\\x{00c3}\\x{00af}\\x{00ef}\\x{00ac}\\x{00af}\\x{00c4}\\x{009f}\")\n// 2009-2013 Adobe Systems Incorporated.\n// 2016-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2013 Adobe Systems Incorporated.\n// 2004-2022 David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.\n// 2013-2022 Google, Inc.\n// 2018-2022 Armin Hasitzka, David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2014 Adobe Systems Incorporated.\n// 2008-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2005-2022 Werner Lemberg and Detlef W\\x{00fc}rkner.\n// 2006-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1996-2022 David Turner, Robert Wilhelm, Werner Lemberg and Detlef W\\x{00fc}rkner.\n// 2004-2022 Masatake YAMATO, Redhat K.K,\n// 1996-2022 David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner.\n// 1996-2022 David Turner, Robert Wilhelm, and Werner Lemberg\n// 1995-2016 Jean-loup Gailly, Mark Adler\n// 2021-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5} \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5}\\x{00d1}\\x{008f}\\x{00c3}\\x{00af}\\x{00ef}\\x{00ac}\\x{00af}\\x{00c4}\\x{009f}\"));\n// 2004-2022 David Turner, Robert Wilhelm, Werner Lemberg and George Williams.\n// 2009-2022 Oran Agra and Mickey Gabel.\n// 2010-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2017 Jean-loup Gailly\n// 2003 Huw D M Davies for Codeweavers\n// 2013-2014 Adobe Systems Incorporated.\n// 2005-2022 David Turner.\n// 1995-2011, 2016 Mark Adler\n// 2010-2022 Joel Klinghed.\n// 2002-2022 Roberto Alameda.\n// 1996-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2011-2013 Adobe Systems Incorporated.\n// 2007 Dmitry Timoshkov for Codeweavers\n// 2002-2022 David Turner, Robert Wilhelm, and Werner Lemberg\n// 2013-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1996-2022 Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2017 Mark Adler\n// 2000-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2022 David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.\n// 2006-2013 Adobe Systems Incorporated.\n// 1995-2003, 2010 Mark Adler\n// 2012-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2022 Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.\n// 2007-2022 David Turner.\n// 2017-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2008-2022 David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.\n// 2018-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2005, 2010 Mark Adler\n// 2005-2022 suzuki toshiya, Masatake YAMATO, Red Hat K.K.,\n// 2020-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2022 Derek Clegg and Michael Toftdal.\n// \\x{00e1}\\x{00bb}\\x{008b}...): %dn\", \"\\x{00e1}\\x{00ba}\\x{0083}\\x{00ce}\\x{00ad}\\x{00c5}\\x{0082}\\x{00c4}\\x{00ba}\", \"all\", 42);\n// 2019-2022 Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2013 Google, Inc.\n// 2004-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2009-2014 Adobe Systems Incorporated.\n// 2004-2022 Albert Chin-A-Young.\n// 2003-2022 Masatake YAMATO, Redhat K.K.,\n// 2002-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2013 Adobe Systems Incorporated.\n// 2007-2022 Dereg Clegg and Michael Toftdal.\n// 2003-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2004-2022 Masatake YAMATO and Redhat K.K.\n// 2004-2022 Masatake YAMATO, Red Hat K.K.,\n// 2001-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2001, 2012 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2022 Jean-loup Gailly, Mark Adler\n// 1995-2022 Mark Adler\n// 2004-2019 Mark Adler\n// 1990, 1994, 1998 The Open Group\n// 2005-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2019 Mark Adler\n// 2018-2022 David Turner, Robert Wilhelm, Dominik R\\x{00c3}\\x{00b6}ttsches, and Werner Lemberg.\n// 2004-2022 suzuki toshiya, Masatake YAMATO, Red Hat K.K.,\n// \n// License: public-domain\n// Copyright: 2001 Alexander Peslyak and it is hereby released to the\n// \n// License: Zlib\n// Copyright: 1995-2022 Jean-loup Gailly and Mark Adler\n// \n// License: Expat\n// Copyright: 2000-2001, 2004 Francesco Zappa Nardelli\n// 2001-2004 Francesco Zappa Nardelli\n// 2003 Francesco Zappa Nardelli\n// 2001-2015 Francesco Zappa Nardelli\n// 2001-2004, 2011 Francesco Zappa Nardelli\n// 2000-2002 Francesco Zappa Nardelli\n// 2000 Computing Research Labs, New Mexico State University\n// 2001-2014 Francesco Zappa Nardelli\n// 2001-2002, 2012 Francesco Zappa Nardelli\n// 2001-2002 Francesco Zappa Nardelli\n// 2001-2008, 2011, 2013-2014 Francesco Zappa Nardelli\n// 2000-2003, 2006, 2010 Francesco Zappa Nardelli\n// 2000-2001, 2003 Francesco Zappa Nardelli\n// 2000-2004, 2006-2011, 2013-2014 Francesco Zappa Nardelli\n// 2000-2010, 2012-2014 Francesco Zappa Nardelli\n// \n// License: BSL-1.0\n// Copyright: 2019 nyorain\n// \n// # Project: fribidi\n// License: LGPL-2.1+\n// Copyright: 1999-2000, 2017 Dov Grobgeld\n// 1999-2000 Dov Grobgeld\n// 2004 Behdad Esfahbod\n// 2001-2002, 2004 Behdad Esfahbod\n// 2009 Behdad Esfahbod\n// 2017 Dov Grobgeld\n// 2004-2005 Behdad Esfahbod\n// 2004 Sharif FarsiWeb, Inc.\n// 2015, 2017 Dov Grobgeld\n// 2005 Behdad Esfahbod\n// 2001 Behdad Esfahbod.\n// 2001-2002 Behdad Esfahbod\n// 2004 Sharif FarsiWeb, Inc\n// \n// # Project: fontconfig\n// License: NTP~disclaimer\n// Copyright: 2002 Keith Packard\n// 2009 Roozbeh Pournader\n// 2000 Tuomas J. Lukka\n// 2006 Keith Packard\n// 2008 Red Hat, Inc.\n// 2000-2007 Keith Packard / 2005 Patrick Lam / 2009 Roozbeh Pournader / 2008,2009 Red Hat, Inc. / 2008 Danilo Šegan / 2012 Google, Inc.\n// 2001 Keith Packard\n// 2012 Google, Inc.\n// 2012 Red Hat, Inc.\n// 2013 Raimund Steger\n// 2008,2009 Red Hat, Inc.\n// 2000-2007 Keith Packard\n// 2005 Patrick Lam\n// 2003 Keith Packard\n// 2020 Zoltan Vandrus\n// \\x{00e6}\\x{0081}\\x{00af} 2010 Behdad Esfahbod\n// 2014 Red Hat, Inc.\n// 2018 Akira TAGOH\n// 2007 Keith Packard\n// \\x{00e6}\\x{0081}\\x{00af} 2006 Keith Packard\n// 2008 Danilo Šegan\n// 2015 Akira TAGOH\n// 2016 Akira TAGOH\n// 2008-2009 Red Hat, Inc.\n// 2000 Keith Packard\n// 2013 Akira TAGOH\n// 2013 Google, Inc.\n// 2010 Behdad Esfahbod\n// \n// License: MIT~old\n// Copyright: 2009-2010 Red Hat, Inc.\n// 2011-2013 Google, Inc.\n// 2007 Chris Wilson\n// \n// License: public-domain\n// Copyright: 2008,2009 Red Hat, Inc.\n// 2009 Roozbeh Pournader\n// 2012 Google, Inc.\n// 2008 Danilo Šegan\n// 2005 Patrick Lam\n// 2000-2007 Keith Packard\n// \n// License: Expat\n// Copyright: 2002-2003 Juliusz Chroboczek\n// \n// # Project: harfbuzz\n// License: NTP~disclaimer\n// Copyright: 2002 Keith Packard\n// 2014 Google, Inc.\n// \n// License: MIT~old\n// Copyright: 2012 Mozilla Foundation.\n// 2004, 2007, 2009 Red Hat, Inc.\n// 2009 Red Hat, Inc.\n// 2015 Google, Inc.\n// 2014 Google, Inc.\n// 2018 Ebrahim Byagowi\n// 2016 Igalia S.L.\n// 2018 Ebrahim Byagowi.\n// 2011 Martin Hosken\n// 2019 Ebrahim Byagowi\n// 1998-2004 David Turner and Werner Lemberg\n// 2020 Ebrahim Byagowi\n// 2013 Red Hat, Inc.\n// 2011-2012 Google, Inc.\n// 2011 SIL International\n// 2018 Khaled Hosny\n// 2018 Google, Inc.\n// 2019-2020 Ebrahim Byagowi\n// 2022 Google, Inc.\n// 2012 Google, Inc.\n// 2017 Google, Inc.\n// 2007-2009 Red Hat, Inc.\n// 2011 Codethink Limited\n// 2013 Google, Inc.\n// 2015-2019 Ebrahim Byagowi\n// 2016 Google, Inc.\n// 2011 Google, Inc.\n// \n// # Project: libass\n// License: public-domain\n// Copyright: 2006-2016 libass contributors\n// \n// License: NTP\n// Copyright: 1994 Sun Microsystems, Inc.\n// 2016 Oleg Oshmyan <chortos@inbox.lv>\n// 1988-1993 The Regents of the University of California.\n// \n// License: ISC\n// Copyright: 2015 Oleg Oshmyan <chortos@inbox.lv>\n// 2011-2014 Yu Zhuohuang <yuzhuohuang@qq.com>\n// 2013 rcombs <rcombs@rcombs.me>\n// 2016 Vabishchevich Nikolay <vabnick@gmail.com>\n// 2022 libass contributors\n// 2015 Stephan Vedder <stephan.vedder@gmail.com>\n// 2015 Vabishchevich Nikolay <vabnick@gmail.com>\n// interest in the\n// 2006-2016 libass contributors\n// 2021 libass contributors\n// 2017 Vabishchevich Nikolay <vabnick@gmail.com>\n// 2011 Grigori Goronzy <greg@chown.ath.cx>\n// 2010 Grigori Goronzy <greg@geekmind.org>\n// 2014 Vabishchevich Nikolay <vabnick@gmail.com>\n// 2015 Grigori Goronzy <greg@kinoho.net>\n// 2013 Stefano Pigozzi <stefano.pigozzi@gmail.com>\n// 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>\n// 2009 Grigori Goronzy <greg@geekmind.org>\n// \n// # The following section contains the full license text or\n// # where permitted a shorter notice for all works contained\n// # in JavascriptSubtitlesOctopus listed above\n// #\n// # Note that the shortnames used here are identical to those used by Debian\n// # and will in some cases differ from SPDX identifiers. See below.\n// #\n// # Debian-name | SPDX-name\n// # ---------------+-------------------\n// # MIT~old | MIT-Modern-Variant\n// # Expat | MIT\n// # NTP~disclaimer | (None; it is NTP with a more verbose warranty disclaimer)\n// \n// License: Expat\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n// .\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n// .\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// \n// License: FTL\n// Portions of this software are copyright © 2021 The FreeType\n// Project (www.freetype.org). All rights reserved.\n// A copy of the FreeType License can be obtained at\n// https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/FTL.TXT\n// \n// License: ISC\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// .\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n// \n// License: MIT~old\n// Permission is hereby granted, without written agreement and without\n// license or royalty fees, to use, copy, modify, and distribute this\n// software and its documentation for any purpose, provided that the\n// above copyright notice and the following two paragraphs appear in\n// all copies of this software.\n// .\n// IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n// DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n// IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGE.\n// .\n// THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n// FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n// ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n// PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS\n// \n// License: NTP\n// Permission to use, copy, modify, and distribute this\n// software and its documentation for any purpose and without\n// fee is hereby granted, provided that the above copyright\n// notice appear in all copies. The University of California\n// makes no representations about the suitability of this\n// software for any purpose. It is provided \"as is\" without\n// express or implied warranty.\n// \n// License: NTP~disclaimer\n// Permission to use, copy, modify, distribute, and sell this software and its\n// documentation for any purpose is hereby granted without fee, provided that\n// the above copyright notice appear in all copies and that both that\n// copyright notice and this permission notice appear in supporting\n// documentation, and that the name of the author(s) not be used in\n// advertising or publicity pertaining to distribution of the software without\n// specific, written prior permission. The authors make no\n// representations about the suitability of this software for any purpose. It\n// is provided \"as is\" without express or implied warranty.\n// .\n// THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\n// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO\n// EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR\n// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\n// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n// PERFORMANCE OF THIS SOFTWARE.\n// \n// License: Zlib\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n// .\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n// .\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n// \n// License: BSL-1\n// Boost Software License - Version 1.0 - August 17th, 2003\n// .\n// Permission is hereby granted, free of charge, to any person or organization\n// obtaining a copy of the software and accompanying documentation covered by\n// this license (the \"Software\") to use, reproduce, display, distribute,\n// execute, and transmit the Software, and to prepare derivative works of the\n// Software, and to permit third-parties to whom the Software is furnished to\n// do so, all subject to the following:\n// .\n// The copyright notices in the Software and this entire statement, including\n// the above license grant, this restriction and the following disclaimer,\n// must be included in all copies of the Software, in whole or in part, and\n// all derivative works of the Software, unless such copies or derivative\n// works are solely in the form of machine-executable object code generated by\n// a source language processor.\n// .\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\n// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\n// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\n// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n// \n// License: LGPL-2.1\n// GNU LESSER GENERAL PUBLIC LICENSE\n// Version 2.1, February 1999\n// .\n// Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n// Everyone is permitted to copy and distribute verbatim copies\n// of this license document, but changing it is not allowed.\n// .\n// [This is the first released version of the Lesser GPL. It also counts\n// as the successor of the GNU Library Public License, version 2, hence\n// the version number 2.1.]\n// .\n// Preamble\n// .\n// The licenses for most software are designed to take away your\n// freedom to share and change it. By contrast, the GNU General Public\n// Licenses are intended to guarantee your freedom to share and change\n// free software--to make sure the software is free for all its users.\n// .\n// This license, the Lesser General Public License, applies to some\n// specially designated software packages--typically libraries--of the\n// Free Software Foundation and other authors who decide to use it. You\n// can use it too, but we suggest you first think carefully about whether\n// this license or the ordinary General Public License is the better\n// strategy to use in any particular case, based on the explanations below.\n// .\n// When we speak of free software, we are referring to freedom of use,\n// not price. Our General Public Licenses are designed to make sure that\n// you have the freedom to distribute copies of free software (and charge\n// for this service if you wish); that you receive source code or can get\n// it if you want it; that you can change the software and use pieces of\n// it in new free programs; and that you are informed that you can do\n// these things.\n// .\n// To protect your rights, we need to make restrictions that forbid\n// distributors to deny you these rights or to ask you to surrender these\n// rights. These restrictions translate to certain responsibilities for\n// you if you distribute copies of the library or if you modify it.\n// .\n// For example, if you distribute copies of the library, whether gratis\n// or for a fee, you must give the recipients all the rights that we gave\n// you. You must make sure that they, too, receive or can get the source\n// code. If you link other code with the library, you must provide\n// complete object files to the recipients, so that they can relink them\n// with the library after making changes to the library and recompiling\n// it. And you must show them these terms so they know their rights.\n// .\n// We protect your rights with a two-step method: (1) we copyright the\n// library, and (2) we offer you this license, which gives you legal\n// permission to copy, distribute and/or modify the library.\n// .\n// To protect each distributor, we want to make it very clear that\n// there is no warranty for the free library. Also, if the library is\n// modified by someone else and passed on, the recipients should know\n// that what they have is not the original version, so that the original\n// author's reputation will not be affected by problems that might be\n// introduced by others.\n// .\n// Finally, software patents pose a constant threat to the existence of\n// any free program. We wish to make sure that a company cannot\n// effectively restrict the users of a free program by obtaining a\n// restrictive license from a patent holder. Therefore, we insist that\n// any patent license obtained for a version of the library must be\n// consistent with the full freedom of use specified in this license.\n// .\n// Most GNU software, including some libraries, is covered by the\n// ordinary GNU General Public License. This license, the GNU Lesser\n// General Public License, applies to certain designated libraries, and\n// is quite different from the ordinary General Public License. We use\n// this license for certain libraries in order to permit linking those\n// libraries into non-free programs.\n// .\n// When a program is linked with a library, whether statically or using\n// a shared library, the combination of the two is legally speaking a\n// combined work, a derivative of the original library. The ordinary\n// General Public License therefore permits such linking only if the\n// entire combination fits its criteria of freedom. The Lesser General\n// Public License permits more lax criteria for linking other code with\n// the library.\n// .\n// We call this license the \"Lesser\" General Public License because it\n// does Less to protect the user's freedom than the ordinary General\n// Public License. It also provides other free software developers Less\n// of an advantage over competing non-free programs. These disadvantages\n// are the reason we use the ordinary General Public License for many\n// libraries. However, the Lesser license provides advantages in certain\n// special circumstances.\n// .\n// For example, on rare occasions, there may be a special need to\n// encourage the widest possible use of a certain library, so that it becomes\n// a de-facto standard. To achieve this, non-free programs must be\n// allowed to use the library. A more frequent case is that a free\n// library does the same job as widely used non-free libraries. In this\n// case, there is little to gain by limiting the free library to free\n// software only, so we use the Lesser General Public License.\n// .\n// In other cases, permission to use a particular library in non-free\n// programs enables a greater number of people to use a large body of\n// free software. For example, permission to use the GNU C Library in\n// non-free programs enables many more people to use the whole GNU\n// operating system, as well as its variant, the GNU/Linux operating\n// system.\n// .\n// Although the Lesser General Public License is Less protective of the\n// users' freedom, it does ensure that the user of a program that is\n// linked with the Library has the freedom and the wherewithal to run\n// that program using a modified version of the Library.\n// .\n// The precise terms and conditions for copying, distribution and\n// modification follow. Pay close attention to the difference between a\n// \"work based on the library\" and a \"work that uses the library\". The\n// former contains code derived from the library, whereas the latter must\n// be combined with the library in order to run.\n// .\n// GNU LESSER GENERAL PUBLIC LICENSE\n// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n// .\n// 0. This License Agreement applies to any software library or other\n// program which contains a notice placed by the copyright holder or\n// other authorized party saying it may be distributed under the terms of\n// this Lesser General Public License (also called \"this License\").\n// Each licensee is addressed as \"you\".\n// .\n// A \"library\" means a collection of software functions and/or data\n// prepared so as to be conveniently linked with application programs\n// (which use some of those functions and data) to form executables.\n// .\n// The \"Library\", below, refers to any such software library or work\n// which has been distributed under these terms. A \"work based on the\n// Library\" means either the Library or any derivative work under\n// copyright law: that is to say, a work containing the Library or a\n// portion of it, either verbatim or with modifications and/or translated\n// straightforwardly into another language. (Hereinafter, translation is\n// included without limitation in the term \"modification\".)\n// .\n// \"Source code\" for a work means the preferred form of the work for\n// making modifications to it. For a library, complete source code means\n// all the source code for all modules it contains, plus any associated\n// interface definition files, plus the scripts used to control compilation\n// and installation of the library.\n// .\n// Activities other than copying, distribution and modification are not\n// covered by this License; they are outside its scope. The act of\n// running a program using the Library is not restricted, and output from\n// such a program is covered only if its contents constitute a work based\n// on the Library (independent of the use of the Library in a tool for\n// writing it). Whether that is true depends on what the Library does\n// and what the program that uses the Library does.\n// \n// 1. You may copy and distribute verbatim copies of the Library's\n// complete source code as you receive it, in any medium, provided that\n// you conspicuously and appropriately publish on each copy an\n// appropriate copyright notice and disclaimer of warranty; keep intact\n// all the notices that refer to this License and to the absence of any\n// warranty; and distribute a copy of this License along with the\n// Library.\n// .\n// You may charge a fee for the physical act of transferring a copy,\n// and you may at your option offer warranty protection in exchange for a\n// fee.\n// .\n// 2. You may modify your copy or copies of the Library or any portion\n// of it, thus forming a work based on the Library, and copy and\n// distribute such modifications or work under the terms of Section 1\n// above, provided that you also meet all of these conditions:\n// .\n// a) The modified work must itself be a software library.\n// .\n// b) You must cause the files modified to carry prominent notices\n// stating that you changed the files and the date of any change.\n// .\n// c) You must cause the whole of the work to be licensed at no\n// charge to all third parties under the terms of this License.\n// .\n// d) If a facility in the modified Library refers to a function or a\n// table of data to be supplied by an application program that uses\n// the facility, other than as an argument passed when the facility\n// is invoked, then you must make a good faith effort to ensure that,\n// in the event an application does not supply such function or\n// table, the facility still operates, and performs whatever part of\n// its purpose remains meaningful.\n// .\n// (For example, a function in a library to compute square roots has\n// a purpose that is entirely well-defined independent of the\n// application. Therefore, Subsection 2d requires that any\n// application-supplied function or table used by this function must\n// be optional: if the application does not supply it, the square\n// root function must still compute square roots.)\n// .\n// These requirements apply to the modified work as a whole. If\n// identifiable sections of that work are not derived from the Library,\n// and can be reasonably considered independent and separate works in\n// themselves, then this License, and its terms, do not apply to those\n// sections when you distribute them as separate works. But when you\n// distribute the same sections as part of a whole which is a work based\n// on the Library, the distribution of the whole must be on the terms of\n// this License, whose permissions for other licensees extend to the\n// entire whole, and thus to each and every part regardless of who wrote\n// it.\n// .\n// Thus, it is not the intent of this section to claim rights or contest\n// your rights to work written entirely by you; rather, the intent is to\n// exercise the right to control the distribution of derivative or\n// collective works based on the Library.\n// .\n// In addition, mere aggregation of another work not based on the Library\n// with the Library (or with a work based on the Library) on a volume of\n// a storage or distribution medium does not bring the other work under\n// the scope of this License.\n// .\n// 3. You may opt to apply the terms of the ordinary GNU General Public\n// License instead of this License to a given copy of the Library. To do\n// this, you must alter all the notices that refer to this License, so\n// that they refer to the ordinary GNU General Public License, version 2,\n// instead of to this License. (If a newer version than version 2 of the\n// ordinary GNU General Public License has appeared, then you can specify\n// that version instead if you wish.) Do not make any other change in\n// these notices.\n// .\n// Once this change is made in a given copy, it is irreversible for\n// that copy, so the ordinary GNU General Public License applies to all\n// subsequent copies and derivative works made from that copy.\n// .\n// This option is useful when you wish to copy part of the code of\n// the Library into a program that is not a library.\n// .\n// 4. You may copy and distribute the Library (or a portion or\n// derivative of it, under Section 2) in object code or executable form\n// under the terms of Sections 1 and 2 above provided that you accompany\n// it with the complete corresponding machine-readable source code, which\n// must be distributed under the terms of Sections 1 and 2 above on a\n// medium customarily used for software interchange.\n// .\n// If distribution of object code is made by offering access to copy\n// from a designated place, then offering equivalent access to copy the\n// source code from the same place satisfies the requirement to\n// distribute the source code, even though third parties are not\n// compelled to copy the source along with the object code.\n// .\n// 5. A program that contains no derivative of any portion of the\n// Library, but is designed to work with the Library by being compiled or\n// linked with it, is called a \"work that uses the Library\". Such a\n// work, in isolation, is not a derivative work of the Library, and\n// therefore falls outside the scope of this License.\n// .\n// However, linking a \"work that uses the Library\" with the Library\n// creates an executable that is a derivative of the Library (because it\n// contains portions of the Library), rather than a \"work that uses the\n// library\". The executable is therefore covered by this License.\n// Section 6 states terms for distribution of such executables.\n// .\n// When a \"work that uses the Library\" uses material from a header file\n// that is part of the Library, the object code for the work may be a\n// derivative work of the Library even though the source code is not.\n// Whether this is true is especially significant if the work can be\n// linked without the Library, or if the work is itself a library. The\n// threshold for this to be true is not precisely defined by law.\n// .\n// If such an object file uses only numerical parameters, data\n// structure layouts and accessors, and small macros and small inline\n// functions (ten lines or less in length), then the use of the object\n// file is unrestricted, regardless of whether it is legally a derivative\n// work. (Executables containing this object code plus portions of the\n// Library will still fall under Section 6.)\n// .\n// Otherwise, if the work is a derivative of the Library, you may\n// distribute the object code for the work under the terms of Section 6.\n// Any executables containing that work also fall under Section 6,\n// whether or not they are linked directly with the Library itself.\n// .\n// 6. As an exception to the Sections above, you may also combine or\n// link a \"work that uses the Library\" with the Library to produce a\n// work containing portions of the Library, and distribute that work\n// under terms of your choice, provided that the terms permit\n// modification of the work for the customer's own use and reverse\n// engineering for debugging such modifications.\n// .\n// You must give prominent notice with each copy of the work that the\n// Library is used in it and that the Library and its use are covered by\n// this License. You must supply a copy of this License. If the work\n// during execution displays copyright notices, you must include the\n// copyright notice for the Library among them, as well as a reference\n// directing the user to the copy of this License. Also, you must do one\n// of these things:\n// .\n// a) Accompany the work with the complete corresponding\n// machine-readable source code for the Library including whatever\n// changes were used in the work (which must be distributed under\n// Sections 1 and 2 above); and, if the work is an executable linked\n// with the Library, with the complete machine-readable \"work that\n// uses the Library\", as object code and/or source code, so that the\n// user can modify the Library and then relink to produce a modified\n// executable containing the modified Library. (It is understood\n// that the user who changes the contents of definitions files in the\n// Library will not necessarily be able to recompile the application\n// to use the modified definitions.)\n// .\n// b) Use a suitable shared library mechanism for linking with the\n// Library. A suitable mechanism is one that (1) uses at run time a\n// copy of the library already present on the user's computer system,\n// rather than copying library functions into the executable, and (2)\n// will operate properly with a modified version of the library, if\n// the user installs one, as long as the modified version is\n// interface-compatible with the version that the work was made with.\n// .\n// c) Accompany the work with a written offer, valid for at\n// least three years, to give the same user the materials\n// specified in Subsection 6a, above, for a charge no more\n// than the cost of performing this distribution.\n// .\n// d) If distribution of the work is made by offering access to copy\n// from a designated place, offer equivalent access to copy the above\n// specified materials from the same place.\n// .\n// e) Verify that the user has already received a copy of these\n// materials or that you have already sent this user a copy.\n// .\n// For an executable, the required form of the \"work that uses the\n// Library\" must include any data and utility programs needed for\n// reproducing the executable from it. However, as a special exception,\n// the materials to be distributed need not include anything that is\n// normally distributed (in either source or binary form) with the major\n// components (compiler, kernel, and so on) of the operating system on\n// which the executable runs, unless that component itself accompanies\n// the executable.\n// .\n// It may happen that this requirement contradicts the license\n// restrictions of other proprietary libraries that do not normally\n// accompany the operating system. Such a contradiction means you cannot\n// use both them and the Library together in an executable that you\n// distribute.\n// .\n// 7. You may place library facilities that are a work based on the\n// Library side-by-side in a single library together with other library\n// facilities not covered by this License, and distribute such a combined\n// library, provided that the separate distribution of the work based on\n// the Library and of the other library facilities is otherwise\n// permitted, and provided that you do these two things:\n// .\n// a) Accompany the combined library with a copy of the same work\n// based on the Library, uncombined with any other library\n// facilities. This must be distributed under the terms of the\n// Sections above.\n// .\n// b) Give prominent notice with the combined library of the fact\n// that part of it is a work based on the Library, and explaining\n// where to find the accompanying uncombined form of the same work.\n// .\n// 8. You may not copy, modify, sublicense, link with, or distribute\n// the Library except as expressly provided under this License. Any\n// attempt otherwise to copy, modify, sublicense, link with, or\n// distribute the Library is void, and will automatically terminate your\n// rights under this License. However, parties who have received copies,\n// or rights, from you under this License will not have their licenses\n// terminated so long as such parties remain in full compliance.\n// .\n// 9. You are not required to accept this License, since you have not\n// signed it. However, nothing else grants you permission to modify or\n// distribute the Library or its derivative works. These actions are\n// prohibited by law if you do not accept this License. Therefore, by\n// modifying or distributing the Library (or any work based on the\n// Library), you indicate your acceptance of this License to do so, and\n// all its terms and conditions for copying, distributing or modifying\n// the Library or works based on it.\n// .\n// 10. Each time you redistribute the Library (or any work based on the\n// Library), the recipient automatically receives a license from the\n// original licensor to copy, distribute, link with or modify the Library\n// subject to these terms and conditions. You may not impose any further\n// restrictions on the recipients' exercise of the rights granted herein.\n// You are not responsible for enforcing compliance by third parties with\n// this License.\n// .\n// 11. If, as a consequence of a court judgment or allegation of patent\n// infringement or for any other reason (not limited to patent issues),\n// conditions are imposed on you (whether by court order, agreement or\n// otherwise) that contradict the conditions of this License, they do not\n// excuse you from the conditions of this License. If you cannot\n// distribute so as to satisfy simultaneously your obligations under this\n// License and any other pertinent obligations, then as a consequence you\n// may not distribute the Library at all. For example, if a patent\n// license would not permit royalty-free redistribution of the Library by\n// all those who receive copies directly or indirectly through you, then\n// the only way you could satisfy both it and this License would be to\n// refrain entirely from distribution of the Library.\n// .\n// If any portion of this section is held invalid or unenforceable under any\n// particular circumstance, the balance of the section is intended to apply,\n// and the section as a whole is intended to apply in other circumstances.\n// .\n// It is not the purpose of this section to induce you to infringe any\n// patents or other property right claims or to contest validity of any\n// such claims; this section has the sole purpose of protecting the\n// integrity of the free software distribution system which is\n// implemented by public license practices. Many people have made\n// generous contributions to the wide range of software distributed\n// through that system in reliance on consistent application of that\n// system; it is up to the author/donor to decide if he or she is willing\n// to distribute software through any other system and a licensee cannot\n// impose that choice.\n// .\n// This section is intended to make thoroughly clear what is believed to\n// be a consequence of the rest of this License.\n// .\n// 12. If the distribution and/or use of the Library is restricted in\n// certain countries either by patents or by copyrighted interfaces, the\n// original copyright holder who places the Library under this License may add\n// an explicit geographical distribution limitation excluding those countries,\n// so that distribution is permitted only in or among countries not thus\n// excluded. In such case, this License incorporates the limitation as if\n// written in the body of this License.\n// .\n// 13. The Free Software Foundation may publish revised and/or new\n// versions of the Lesser General Public License from time to time.\n// Such new versions will be similar in spirit to the present version,\n// but may differ in detail to address new problems or concerns.\n// .\n// Each version is given a distinguishing version number. If the Library\n// specifies a version number of this License which applies to it and\n// \"any later version\", you have the option of following the terms and\n// conditions either of that version or of any later version published by\n// the Free Software Foundation. If the Library does not specify a\n// license version number, you may choose any version ever published by\n// the Free Software Foundation.\n// .\n// 14. If you wish to incorporate parts of the Library into other free\n// programs whose distribution conditions are incompatible with these,\n// write to the author to ask for permission. For software which is\n// copyrighted by the Free Software Foundation, write to the Free\n// Software Foundation; we sometimes make exceptions for this. Our\n// decision will be guided by the two goals of preserving the free status\n// of all derivatives of our free software and of promoting the sharing\n// and reuse of software generally.\n// .\n// NO WARRANTY\n// .\n// 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\n// WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\n// EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n// OTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\n// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\n// LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\n// THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n// .\n// 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\n// WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\n// AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\n// FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n// CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\n// LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\n// RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\n// FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\n// SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGES.\n// .\n// END OF TERMS AND CONDITIONS\n// .\n// How to Apply These Terms to Your New Libraries\n// .\n// If you develop a new library, and you want it to be of the greatest\n// possible use to the public, we recommend making it free software that\n// everyone can redistribute and change. You can do so by permitting\n// redistribution under these terms (or, alternatively, under the terms of the\n// ordinary General Public License).\n// .\n// To apply these terms, attach the following notices to the library. It is\n// safest to attach them to the start of each source file to most effectively\n// convey the exclusion of warranty; and each file should have at least the\n// \"copyright\" line and a pointer to where the full notice is found.\n// .\n// <one line to give the library's name and a brief idea of what it does.>\n// Copyright (C) <year> <name of author>\n// .\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n// .\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n// .\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n// .\n// Also add information on how to contact you by electronic and paper mail.\n// .\n// You should also get your employer (if you work as a programmer) or your\n// school, if any, to sign a \"copyright disclaimer\" for the library, if\n// necessary. Here is a sample; alter the names:\n// .\n// Yoyodyne, Inc., hereby disclaims all copyright interest in the\n// library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n// .\n// <signature of Ty Coon>, 1 April 1990\n// Ty Coon, President of Vice\n// .\n// That's all there is to it!\n\"use strict\";\nvar SubtitlesOctopus = function(options) {\n var supportsWebAssembly = false;\n try {\n if (typeof WebAssembly === \"object\" && typeof WebAssembly.instantiate === \"function\") {\n const module1 = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));\n if (module1 instanceof WebAssembly.Module) supportsWebAssembly = new WebAssembly.Instance(module1) instanceof WebAssembly.Instance;\n }\n } catch (e) {}\n console.log(\"WebAssembly support detected: \" + (supportsWebAssembly ? \"yes\" : \"no\"));\n var self = this;\n self.canvas = options.canvas; // HTML canvas element (optional if video specified)\n self.renderMode = options.renderMode || (options.lossyRender ? 'lossy' : 'wasm-blend');\n self.libassMemoryLimit = options.libassMemoryLimit || 0;\n self.libassGlyphLimit = options.libassGlyphLimit || 0;\n self.targetFps = options.targetFps || 24;\n self.prescaleFactor = options.prescaleFactor || 1.0;\n self.prescaleHeightLimit = options.prescaleHeightLimit || 1080;\n self.maxRenderHeight = options.maxRenderHeight || 0; // 0 - no limit\n self.dropAllAnimations = options.dropAllAnimations || false; // attempt to remove all animations as a last ditch effort for displaying on weak hardware; may severly mangle subtitles if enabled\n self.isOurCanvas = false; // (internal) we created canvas and manage it\n self.video = options.video; // HTML video element (optional if canvas specified)\n self.canvasParent = null; // (internal) HTML canvas parent element\n self.fonts = options.fonts || []; // Array with links to fonts used in sub (optional)\n self.availableFonts = options.availableFonts || []; // Object with all available fonts (optional). Key is font name in lower case, value is link: {\"arial\": \"/font1.ttf\"}\n self.fallbackFont = options.fallbackFont || 'default.woff2'; // URL to override fallback font, for example, with a CJK one. Default fallback font is Liberation Sans (Optional)\n self.lazyFileLoading = options.lazyFileLoading || false; // Load fonts in a lazy way. Requires Access-Control-Expose-Headers for Accept-Ranges, Content-Length, and Content-Encoding. If Content-Encoding is compressed, file will be fully fetched instead of just a HEAD request.\n self.onReadyEvent = options.onReady; // Function called when SubtitlesOctopus is ready (optional)\n if (supportsWebAssembly) self.workerUrl = options.workerUrl || 'subtitles-octopus-worker.js'; // Link to WebAssembly worker\n else self.workerUrl = options.legacyWorkerUrl || 'subtitles-octopus-worker-legacy.js'; // Link to legacy worker\n self.subUrl = options.subUrl; // Link to sub file (optional if subContent specified)\n self.subContent = options.subContent || null; // Sub content (optional if subUrl specified)\n self.onErrorEvent = options.onError; // Function called in case of critical error meaning sub wouldn't be shown and you should use alternative method (for instance it occurs if browser doesn't support web workers).\n self.debug = options.debug || false; // When debug enabled, some performance info printed in console.\n self.lastRenderTime = 0; // (internal) Last time we got some frame from worker\n self.pixelRatio = window.devicePixelRatio || 1; // (internal) Device pixel ratio (for high dpi devices)\n self.timeOffset = options.timeOffset || 0; // Time offset would be applied to currentTime from video (option)\n self.hasAlphaBug = false;\n (function() {\n if (typeof ImageData.prototype.constructor === 'function') try {\n // try actually calling ImageData, as on some browsers it's reported\n // as existing but calling it errors out as \"TypeError: Illegal constructor\"\n new window.ImageData(new Uint8ClampedArray([\n 0,\n 0,\n 0,\n 0\n ]), 1, 1);\n return;\n } catch (e) {\n console.log(\"detected that ImageData is not constructable despite browser saying so\");\n }\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n window.ImageData = function() {\n var i = 0;\n if (arguments[0] instanceof Uint8ClampedArray) var data = arguments[i++];\n var width = arguments[i++];\n var height = arguments[i];\n var imageData = ctx.createImageData(width, height);\n if (data) imageData.data.set(data);\n return imageData;\n };\n })();\n self.workerError = function(error) {\n console.error('Worker error: ', error);\n if (self.onErrorEvent) self.onErrorEvent(error);\n if (!self.debug) {\n self.dispose();\n throw new Error('Worker error: ' + error);\n }\n };\n // Not tested for repeated usage yet\n self.init = function() {\n if (!window.Worker) {\n self.workerError('worker not supported');\n return;\n }\n // Worker\n if (!self.worker) {\n self.worker = new Worker(self.workerUrl);\n self.worker.addEventListener('message', self.onWorkerMessage);\n self.worker.addEventListener('error', self.workerError);\n }\n self.workerActive = false;\n self.createCanvas();\n self.setVideo(options.video);\n self.setSubUrl(options.subUrl);\n self.worker.postMessage({\n target: 'worker-init',\n width: self.canvas.width,\n height: self.canvas.height,\n URL: document.URL,\n currentScript: self.workerUrl,\n preMain: true,\n renderMode: self.renderMode,\n subUrl: self.subUrl,\n subContent: self.subContent,\n fonts: self.fonts,\n availableFonts: self.availableFonts,\n fallbackFont: self.fallbackFont,\n lazyFileLoading: self.lazyFileLoading,\n debug: self.debug,\n targetFps: self.targetFps,\n libassMemoryLimit: self.libassMemoryLimit,\n libassGlyphLimit: self.libassGlyphLimit,\n dropAllAnimations: self.dropAllAnimations\n });\n };\n self.createCanvas = function() {\n if (!self.canvas) {\n if (self.video) {\n self.isOurCanvas = true;\n self.canvas = document.createElement('canvas');\n self.canvas.className = 'libassjs-canvas';\n self.canvas.style.display = 'none';\n self.canvasParent = document.createElement('div');\n self.canvasParent.className = 'libassjs-canvas-parent';\n self.canvasParent.appendChild(self.canvas);\n if (self.video.nextSibling) self.video.parentNode.insertBefore(self.canvasParent, self.video.nextSibling);\n else self.video.parentNode.appendChild(self.canvasParent);\n } else if (!self.canvas) self.workerError('Don\\'t know where to render: you should give video or canvas in options.');\n }\n self.ctx = self.canvas.getContext('2d');\n self.bufferCanvas = document.createElement('canvas');\n self.bufferCanvasCtx = self.bufferCanvas.getContext('2d');\n // test for alpha bug, where e.g. WebKit can render a transparent pixel\n // (with alpha == 0) as non-black which then leads to visual artifacts\n self.bufferCanvas.width = 1;\n self.bufferCanvas.height = 1;\n var testBuf = new Uint8ClampedArray([\n 0,\n 255,\n 0,\n 0\n ]);\n var testImage = new ImageData(testBuf, 1, 1);\n self.bufferCanvasCtx.clearRect(0, 0, 1, 1);\n self.ctx.clearRect(0, 0, 1, 1);\n var prePut = self.ctx.getImageData(0, 0, 1, 1).data;\n self.bufferCanvasCtx.putImageData(testImage, 0, 0);\n self.ctx.drawImage(self.bufferCanvas, 0, 0);\n var postPut = self.ctx.getImageData(0, 0, 1, 1).data;\n self.hasAlphaBug = prePut[1] != postPut[1];\n if (self.hasAlphaBug) console.log(\"Detected a browser having issue with transparent pixels, applying workaround\");\n };\n function onTimeUpdate() {\n self.setCurrentTime(self.video.currentTime + self.timeOffset);\n }\n function onPlaying() {\n self.setIsPaused(false, self.video.currentTime + self.timeOffset);\n }\n function onPause() {\n self.setIsPaused(true, self.video.currentTime + self.timeOffset);\n }\n function onSeeking() {\n self.video.removeEventListener('timeupdate', onTimeUpdate, false);\n }\n function onSeeked() {\n self.video.addEventListener('timeupdate', onTimeUpdate, false);\n var currentTime = self.video.currentTime + self.timeOffset;\n self.setCurrentTime(currentTime);\n }\n function onRateChange() {\n self.setRate(self.video.playbackRate);\n }\n function onWaiting() {\n self.setIsPaused(true, self.video.currentTime + self.timeOffset);\n }\n function onLoadedMetadata(e) {\n e.target.removeEventListener(e.type, onLoadedMetadata, false);\n self.resize();\n }\n self.setVideo = function(video) {\n self.video = video;\n if (self.video) {\n self.video.addEventListener('timeupdate', onTimeUpdate, false);\n self.video.addEventListener('playing', onPlaying, false);\n self.video.addEventListener('pause', onPause, false);\n self.video.addEventListener('seeking', onSeeking, false);\n self.video.addEventListener('seeked', onSeeked, false);\n self.video.addEventListener('ratechange', onRateChange, false);\n self.video.addEventListener('waiting', onWaiting, false);\n document.addEventListener(\"fullscreenchange\", self.resizeWithTimeout, false);\n document.addEventListener(\"mozfullscreenchange\", self.resizeWithTimeout, false);\n document.addEventListener(\"webkitfullscreenchange\", self.resizeWithTimeout, false);\n document.addEventListener(\"msfullscreenchange\", self.resizeWithTimeout, false);\n window.addEventListener(\"resize\", self.resizeWithTimeout, false);\n // Support Element Resize Observer\n if (typeof ResizeObserver !== \"undefined\") {\n self.ro = new ResizeObserver(self.resizeWithTimeout);\n self.ro.observe(self.video);\n }\n if (self.video.videoWidth > 0) self.resize();\n else self.video.addEventListener('loadedmetadata', onLoadedMetadata, false);\n }\n };\n self.getVideoPosition = function() {\n var videoRatio = self.video.videoWidth / self.video.videoHeight;\n var width = self.video.offsetWidth, height = self.video.offsetHeight;\n var elementRatio = width / height;\n var realWidth = width, realHeight = height;\n if (elementRatio > videoRatio) realWidth = Math.floor(height * videoRatio);\n else realHeight = Math.floor(width / videoRatio);\n var x = (width - realWidth) / 2;\n var y = (height - realHeight) / 2;\n return {\n width: realWidth,\n height: realHeight,\n x: x,\n y: y\n };\n };\n self.setSubUrl = function(subUrl) {\n self.subUrl = subUrl;\n };\n self.renderFrameData = null;\n function renderFrames() {\n var data = self.renderFramesData;\n var beforeDrawTime = performance.now();\n self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.height);\n for(var i = 0; i < data.canvases.length; i++){\n var image = data.canvases[i];\n self.bufferCanvas.width = image.w;\n self.bufferCanvas.height = image.h;\n var imageBuffer = new Uint8ClampedArray(image.buffer);\n if (self.hasAlphaBug) for(var j = 3; j < imageBuffer.length; j = j + 4)imageBuffer[j] = imageBuffer[j] >= 1 ? imageBuffer[j] : 1;\n var imageData = new ImageData(imageBuffer, image.w, image.h);\n self.bufferCanvasCtx.putImageData(imageData, 0, 0);\n self.ctx.drawImage(self.bufferCanvas, image.x, image.y);\n }\n if (self.debug) {\n var drawTime = Math.round(performance.now() - beforeDrawTime);\n var blendTime = data.blendTime;\n if (typeof blendTime !== 'undefined') console.log('render: ' + Math.round(data.spentTime - blendTime) + ' ms, blend: ' + Math.round(blendTime) + ' ms, draw: ' + drawTime + ' ms; TOTAL=' + Math.round(data.spentTime + drawTime) + ' ms');\n else console.log(Math.round(data.spentTime) + ' ms (+ ' + drawTime + ' ms draw)');\n self.renderStart = performance.now();\n }\n }\n /**\n * Lossy Render Mode\n *\n */ function renderFastFrames() {\n var data = self.renderFramesData;\n var beforeDrawTime = performance.now();\n self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.height);\n for(var i = 0; i < data.bitmaps.length; i++){\n var image = data.bitmaps[i];\n self.ctx.drawImage(image.bitmap, image.x, image.y);\n }\n if (self.debug) {\n var drawTime = Math.round(performance.now() - beforeDrawTime);\n console.log(data.bitmaps.length + ' bitmaps, libass: ' + Math.round(data.libassTime) + 'ms, decode: ' + Math.round(data.decodeTime) + 'ms, draw: ' + drawTime + 'ms');\n self.renderStart = performance.now();\n }\n }\n self.workerActive = false;\n self.frameId = 0;\n self.onWorkerMessage = function(event) {\n //dump('\\nclient got ' + JSON.stringify(event.data).substr(0, 150) + '\\n');\n if (!self.workerActive) {\n self.workerActive = true;\n if (self.onReadyEvent) self.onReadyEvent();\n }\n var data = event.data;\n switch(data.target){\n case 'stdout':\n console.log(data.content);\n break;\n case 'console-log':\n console.log.apply(console, JSON.parse(data.content));\n break;\n case 'console-debug':\n console.debug.apply(console, JSON.parse(data.content));\n break;\n case 'console-info':\n console.info.apply(console, JSON.parse(data.content));\n break;\n case 'console-warn':\n console.warn.apply(console, JSON.parse(data.content));\n break;\n case 'console-error':\n console.error.apply(console, JSON.parse(data.content));\n break;\n case 'stderr':\n console.error(data.content);\n break;\n case 'window':\n window[data.method]();\n break;\n case 'canvas':\n switch(data.op){\n case 'getContext':\n self.ctx = self.canvas.getContext(data.type, data.attributes);\n break;\n case 'resize':\n self.resize(data.width, data.height);\n break;\n case 'renderCanvas':\n if (self.lastRenderTime < data.time) {\n self.lastRenderTime = data.time;\n self.renderFramesData = data;\n window.requestAnimationFrame(renderFrames);\n }\n break;\n case 'renderFastCanvas':\n if (self.lastRenderTime < data.time) {\n self.lastRenderTime = data.time;\n self.renderFramesData = data;\n window.requestAnimationFrame(renderFastFrames);\n }\n break;\n case 'setObjectProperty':\n self.canvas[data.object][data.property] = data.value;\n break;\n default:\n throw 'eh?';\n }\n break;\n case 'tick':\n self.frameId = data.id;\n self.worker.postMessage({\n target: 'tock',\n id: self.frameId\n });\n break;\n case 'custom':\n if (self['onCustomMessage']) self['onCustomMessage'](event);\n else throw 'Custom message received but client onCustomMessage not implemented.';\n break;\n case 'setimmediate':\n self.worker.postMessage({\n target: 'setimmediate'\n });\n break;\n case 'get-events':\n break;\n case 'get-styles':\n break;\n case 'ready':\n break;\n default:\n throw 'what? ' + data.target;\n }\n };\n function _computeCanvasSize(width, height) {\n var scalefactor = self.prescaleFactor <= 0 ? 1.0 : self.prescaleFactor;\n if (height <= 0 || width <= 0) {\n width = 0;\n height = 0;\n } else {\n var sgn = scalefactor < 1 ? -1 : 1;\n var newH = height;\n if (sgn * newH * scalefactor <= sgn * self.prescaleHeightLimit) newH *= scalefactor;\n else if (sgn * newH < sgn * self.prescaleHeightLimit) newH = self.prescaleHeightLimit;\n if (self.maxRenderHeight > 0 && newH > self.maxRenderHeight) newH = self.maxRenderHeight;\n width *= newH / height;\n height = newH;\n }\n return {\n 'width': width,\n 'height': height\n };\n }\n self.resize = function(width, height, top, left) {\n var videoSize = null;\n top = top || 0;\n left = left || 0;\n if ((!width || !height) && self.video) {\n videoSize = self.getVideoPosition();\n var newSize = _computeCanvasSize(videoSize.width * self.pixelRatio, videoSize.height * self.pixelRatio);\n width = newSize.width;\n height = newSize.height;\n var offset = self.canvasParent.getBoundingClientRect().top - self.video.getBoundingClientRect().top;\n top = videoSize.y - offset;\n left = videoSize.x;\n }\n if (!width || !height) {\n if (!self.video) console.error('width or height is 0. You should specify width & height for resize.');\n return;\n }\n if (self.canvas.width != width || self.canvas.height != height || self.canvas.style.top != top || self.canvas.style.left != left) {\n self.canvas.width = width;\n self.canvas.height = height;\n if (videoSize != null) {\n self.canvasParent.style.position = 'relative';\n self.canvas.style.display = 'block';\n self.canvas.style.position = 'absolute';\n self.canvas.style.width = videoSize.width + 'px';\n self.canvas.style.height = videoSize.height + 'px';\n self.canvas.style.top = top + 'px';\n self.canvas.style.left = left + 'px';\n self.canvas.style.pointerEvents = 'none';\n }\n self.worker.postMessage({\n target: 'canvas',\n width: self.canvas.width,\n height: self.canvas.height\n });\n }\n };\n self.resizeWithTimeout = function() {\n self.resize();\n setTimeout(self.resize, 100);\n };\n self.runBenchmark = function() {\n self.worker.postMessage({\n target: 'runBenchmark'\n });\n };\n self.customMessage = function(data, options) {\n options = options || {};\n self.worker.postMessage({\n target: 'custom',\n userData: data,\n preMain: options.preMain\n });\n };\n self.setCurrentTime = function(currentTime) {\n self.worker.postMessage({\n target: 'video',\n currentTime: currentTime\n });\n };\n self.setTrackByUrl = function(url) {\n self.worker.postMessage({\n target: 'set-track-by-url',\n url: url\n });\n };\n self.setTrack = function(content) {\n self.worker.postMessage({\n target: 'set-track',\n content: content\n });\n };\n self.freeTrack = function(content) {\n self.worker.postMessage({\n target: 'free-track'\n });\n };\n self.render = self.setCurrentTime;\n self.setIsPaused = function(isPaused, currentTime) {\n self.worker.postMessage({\n target: 'video',\n isPaused: isPaused,\n currentTime: currentTime\n });\n };\n self.setRate = function(rate) {\n self.worker.postMessage({\n target: 'video',\n rate: rate\n });\n };\n self.dispose = function() {\n self.worker.postMessage({\n target: 'destroy'\n });\n self.worker.terminate();\n self.worker.removeEventListener('message', self.onWorkerMessage);\n self.worker.removeEventListener('error', self.workerError);\n self.workerActive = false;\n self.worker = null;\n // Remove the canvas element to remove residual subtitles rendered on player\n if (self.video) {\n self.video.removeEventListener('timeupdate', onTimeUpdate, false);\n self.video.removeEventListener('playing', onPlaying, false);\n self.video.removeEventListener('pause', onPause, false);\n self.video.removeEventListener('seeking', onSeeking, false);\n self.video.removeEventListener('seeked', onSeeked, false);\n self.video.removeEventListener('ratechange', onRateChange, false);\n self.video.removeEventListener('waiting', onWaiting, false);\n self.video.removeEventListener('loadedmetadata', onLoadedMetadata, false);\n document.removeEventListener('fullscreenchange', self.resizeWithTimeout, false);\n document.removeEventListener('mozfullscreenchange', self.resizeWithTimeout, false);\n document.removeEventListener('webkitfullscreenchange', self.resizeWithTimeout, false);\n document.removeEventListener('msfullscreenchange', self.resizeWithTimeout, false);\n window.removeEventListener('resize', self.resizeWithTimeout, false);\n self.video.parentNode.removeChild(self.canvasParent);\n self.video = null;\n }\n if (self.ro) {\n self.ro.disconnect();\n self.ro = null;\n }\n self.onCustomMessage = null;\n self.onErrorEvent = null;\n self.onReadyEvent = null;\n };\n self.fetchFromWorker = function(workerOptions, onSuccess, onError) {\n try {\n var target = workerOptions['target'];\n var timeout = setTimeout(function() {\n reject(Error('Error: Timeout while try to fetch ' + target));\n }, 5000);\n var resolve = function(event) {\n if (event.data.target == target) {\n onSuccess(event.data);\n self.worker.removeEventListener('message', resolve);\n self.worker.removeEventListener('error', reject);\n clearTimeout(timeout);\n }\n };\n var reject = function(event) {\n onError(event);\n self.worker.removeEventListener('message', resolve);\n self.worker.removeEventListener('error', reject);\n clearTimeout(timeout);\n };\n self.worker.addEventListener('message', resolve);\n self.worker.addEventListener('error', reject);\n self.worker.postMessage(workerOptions);\n } catch (error) {\n onError(error);\n }\n };\n self.createEvent = function(event) {\n self.worker.postMessage({\n target: 'create-event',\n event: event\n });\n };\n self.getEvents = function(onSuccess, onError) {\n self.fetchFromWorker({\n target: 'get-events'\n }, function(data) {\n onSuccess(data.events);\n }, onError);\n };\n self.setEvent = function(event, index) {\n self.worker.postMessage({\n target: 'set-event',\n event: event,\n index: index\n });\n };\n self.removeEvent = function(index) {\n self.worker.postMessage({\n target: 'remove-event',\n index: index\n });\n };\n self.createStyle = function(style) {\n self.worker.postMessage({\n target: 'create-style',\n style: style\n });\n };\n self.getStyles = function(onSuccess, onError) {\n self.fetchFromWorker({\n target: 'get-styles'\n }, function(data) {\n onSuccess(data.styles);\n }, onError);\n };\n self.setStyle = function(style, index) {\n self.worker.postMessage({\n target: 'set-style',\n style: style,\n index: index\n });\n };\n self.removeStyle = function(index) {\n self.worker.postMessage({\n target: 'remove-style',\n index: index\n });\n };\n self.init();\n};\nif (typeof SubtitlesOctopusOnLoad == 'function') SubtitlesOctopusOnLoad();\nif (module.exports) exports = module.exports = SubtitlesOctopus;\n\n},{}],\"5lQoW\":[function(require,module,exports,__globalThis) {\nexports.interopDefault = function(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n};\nexports.defineInteropFlag = function(a) {\n Object.defineProperty(a, '__esModule', {\n value: true\n });\n};\nexports.exportAll = function(source, dest) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) return;\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function() {\n return source[key];\n }\n });\n });\n return dest;\n};\nexports.export = function(dest, destName, get) {\n Object.defineProperty(dest, destName, {\n enumerable: true,\n get: get\n });\n};\n\n},{}]},[\"4083l\"], \"4083l\", \"parcelRequire4dc0\", {})\nlet {default: _default, } = parcelRequire4dc0(\"4083l\");\nexport {_default as default, };\n\n//# sourceMappingURL=index.js.map\n","import LibassAdapter from './adapter'\n\nexport default function artplayerPluginLibass(option) {\n return (art) => {\n const adapter = new LibassAdapter(art, option)\n return {\n name: 'artplayerPluginLibass',\n libass: adapter.libass,\n visible: adapter.visible,\n init: adapter.init.bind(adapter),\n switch: adapter.switch.bind(adapter),\n show: adapter.show.bind(adapter),\n hide: adapter.hide.bind(adapter),\n destroy: adapter.destroy.bind(adapter),\n }\n }\n}\n\nif (typeof window !== 'undefined') {\n window.artplayerPluginLibass = artplayerPluginLibass\n}\n","import SubtitlesOctopus from 'libass-wasm'\n\nconst defaultAssSubtitle = `[Script Info]\\nScriptType: v4.00+`\n\nexport default class LibassAdapter {\n constructor(art, option) {\n const { constructor, template } = art\n\n this.art = art\n this.$video = template.$video\n this.$webvtt = template.$subtitle\n this.utils = constructor.utils\n\n this.libass = null\n\n art.once('ready', this.init.bind(this, option))\n }\n\n async init(option) {\n this.#checkWebAssemblySupport()\n\n await this.#createLibass(option)\n\n this.#addEventListeners()\n\n this.art.emit('artplayerPluginLibass:init', this)\n\n // set initial subtitle\n const initialSubtitle = this.art?.option?.subtitle?.url\n if (initialSubtitle && this.utils.getExt(initialSubtitle) === 'ass') {\n this.switch(initialSubtitle)\n }\n }\n\n switch(url) {\n this.art.emit('artplayerPluginLibass:switch', url)\n\n if (url && this.utils.getExt(url) === 'ass') {\n this.currentType = 'ass'\n this.libass.freeTrack()\n this.libass.setTrackByUrl(this.#toAbsoluteUrl(url))\n\n this.visible = this.art.subtitle.show\n }\n else {\n this.currentType = 'webvtt'\n this.hide()\n this.libass.freeTrack()\n }\n }\n\n setVisibility(visible) {\n this.visible = visible\n }\n\n setOffset(offset) {\n this.timeOffset = offset\n }\n\n get active() {\n return this.currentType === 'ass'\n }\n\n get visible() {\n if (!this.libass)\n return false\n\n return this.libass.canvasParent.style.display !== 'none'\n }\n\n set visible(visible) {\n this.art.emit('artplayerPluginLibass:visible', visible)\n\n this.#setVttVisible(!this.active)\n\n if (this.libass.canvasParent) {\n this.libass.canvasParent.style.display = visible ? 'block' : 'none'\n\n if (visible)\n this.libass.resize()\n }\n }\n\n get timeOffset() {\n return this.libass.timeOffset\n }\n\n set timeOffset(offset) {\n this.art.emit('artplayerPluginLibass:timeOffset', offset)\n this.libass.timeOffset = offset\n }\n\n show() {\n this.visible = true\n }\n\n hide() {\n this.visible = false\n }\n\n destroy() {\n this.art.emit('artplayerPluginLibass:destroy')\n\n this.#removeEventListeners()\n\n this.libass.dispose()\n URL.revokeObjectURL(this.workerScriptUrl)\n this.libass = null\n }\n\n async #createLibass(option = {}) {\n if (!option.fallbackFont) {\n return this.utils.errorHandle(option.fallbackFont, 'artplayerPluginLibass: fallbackFont is required')\n }\n\n if (!option.workerUrl) {\n option.workerUrl\n = 'https://cdnjs.cloudflare.com/ajax/libs/libass-wasm/4.1.0/js/subtitles-octopus-worker.js'\n }\n\n if (option.availableFonts) {\n option.availableFonts = Object.entries(option.availableFonts).reduce((acc, [key, value]) => {\n acc[key] = this.#toAbsoluteUrl(value)\n return acc\n }, {})\n }\n\n this.libass = new SubtitlesOctopus({\n subContent: defaultAssSubtitle,\n video: this.$video,\n ...option,\n workerUrl: await this.#loadWorker(option),\n fallbackFont: this.#toAbsoluteUrl(option.fallbackFont),\n fonts: option.fonts?.map(font => this.#toAbsoluteUrl(font)),\n })\n\n this.libass.canvasParent.className = 'artplayer-plugin-libass'\n this.libass.canvasParent.style.cssText = `\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n user-select: none;\n pointer-events: none;\n z-index: 20;`\n }\n\n #addEventListeners() {\n this.switchHandler = this.switch.bind(this)\n this.visibleHandler = this.setVisibility.bind(this)\n this.offsetHandler = this.setOffset.bind(this)\n\n this.art.on('subtitle', this.visibleHandler)\n this.art.on('subtitleLoad', this.switchHandler)\n this.art.on('subtitleOffset', this.offsetHandler)\n\n this.art.once('destroy', this.destroy.bind(this))\n }\n\n #removeEventListeners() {\n this.art.off('subtitle', this.visibleHandler)\n this.art.off('subtitleLoad', this.switchHandler)\n this.art.off('subtitleOffset', this.offsetHandler)\n }\n\n #setVttVisible(visible) {\n this.$webvtt.style.visibility = visible ? 'visible' : 'hidden'\n }\n\n #toAbsoluteUrl(url) {\n if (this.#isAbsoluteUrl(url))\n return url\n\n // handle absolute URL when the `Worker` of `BLOB` type loading network resources\n return new URL(url, document.baseURI).toString()\n }\n\n #isAbsoluteUrl(url) {\n return /^https?:\\/\\//.test(url)\n }\n\n #loadWorker({ workerUrl, wasmUrl }) {\n return new Promise((resolve) => {\n fetch(workerUrl)\n .then(res => res.text())\n .then((text) => {\n let workerScriptContent = text\n\n workerScriptContent = workerScriptContent.replace(\n /wasmBinaryFile\\s*=\\s*\"(subtitles-octopus-worker\\.wasm)\"/g,\n (_match, wasm) => {\n if (!wasmUrl) {\n wasmUrl = new URL(wasm, workerUrl).toString()\n }\n else {\n wasmUrl = this.#toAbsoluteUrl(wasmUrl)\n }\n\n return `wasmBinaryFile = \"${wasmUrl}\"`\n },\n )\n\n const workerBlob = new Blob([workerScriptContent], { type: 'text/javascript' })\n resolve(URL.createObjectURL(workerBlob))\n })\n })\n }\n\n #checkWebAssemblySupport() {\n let supportsWebAssembly = false\n try {\n if (typeof WebAssembly === 'object' && typeof WebAssembly.instantiate === 'function') {\n const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6D, 0x01, 0x00, 0x00, 0x00))\n if (module instanceof WebAssembly.Module)\n supportsWebAssembly = new WebAssembly.Instance(module) instanceof WebAssembly.Instance\n }\n }\n catch (error) {\n console.error('WebAssembly is not supported in this browser.', error)\n supportsWebAssembly = false\n }\n\n this.utils.errorHandle(supportsWebAssembly, 'Browser does not support WebAssembly')\n }\n}\n","// # The following lists all copyright notices and licenses for the\n// # work contained in JavascriptSubtitlesOctopus per project.\n// \n// # Project: subtitlesoctopus\n// License: Expat\n// Copyright: 2017-2021 JavascriptSubtitlesOctopus contributors\n// \n// # Project: brotli\n// License: Expat\n// Copyright: 2014 Google Inc.\n// 2015 The Chromium Authors.\n// 2016 Google Inc.\n// 2017 Google Inc.\n// 2018 Google Inc.\n// 2015 Google Inc.\n// 2013 Google Inc.\n// 2009, 2010, 2013-2016 by the Brotli Authors\n// 2010 Google Inc.\n// \n// # Project: expat\n// License: Expat\n// Copyright: 2019 Zhongyuan Zhou <zhouzhongyuan@huawei.com>\n// 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>\n// 2020 Joe Orton <jorton@redhat.com>\n// 2016-2019 Sebastian Pipping <sebastian@pipping.org>\n// 2021 Dong-hee Na <donghee.na@python.org>\n// 2017 Joe Orton <jorton@redhat.com>\n// 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2004-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2017 Sebastian Pipping <sebastian@pipping.org>\n// 2004-2006 Karl Waclawek <karl@waclawek.net>\n// 2006 Karl Waclawek <karl@waclawek.net>\n// 2003-2006 Karl Waclawek <karl@waclawek.net>\n// 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2017 Franek Korta <fkorta@gmail.com>\n// 2001-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2006-2012 Karl Waclawek <karl@waclawek.net>\n// 2017 Benbuck Nason <bnason@netflix.com>\n// 2019 David Loffredo <loffredo@steptools.com>\n// 2021 Tim Bray <tbray@textuality.com>\n// 2018 Benjamin Peterson <benjamin@python.org>\n// 2017 Rhodri James <rhodri@wildebeest.org.uk>\n// 2002-2005 Karl Waclawek <karl@waclawek.net>\n// 2016-2020 Sebastian Pipping <sebastian@pipping.org>\n// 2016-2018 Sebastian Pipping <sebastian@pipping.org>\n// 2016 Gilles Espinasse <g.esp@free.fr>\n// 2007 Karl Waclawek <karl@waclawek.net>\n// 2002-2016 Karl Waclawek <karl@waclawek.net>\n// 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2016 Don Lewis <truckman@apache.org>\n// 2000-2017 Expat development team\n// 2002-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2000 Clark Cooper <coopercc@users.sourceforge.net>\n// 2002 Greg Stein <gstein@users.sourceforge.net>\n// 2018 Marco Maggi <marco.maggi-ipsu@poste.it>\n// 2005-2012 Karl Waclawek <karl@waclawek.net>\n// 2020 Boris Kolpackov <boris@codesynthesis.com>\n// 2022 Thijs Schreijer <thijs@thijsschreijer.nl>\n// 2017-2019 Sebastian Pipping <sebastian@pipping.org>\n// 2016 Cristian Rodr\\x{00c3}\\x{00ad}guez <crrodriguez@opensuse.org>\n// 2005 Karl Waclawek <karl@waclawek.net>\n// 1999-2000 Thai Open Source Software Center Ltd\n// 2000-2017 Expat development team / 1997-2000 Thai Open Source Software Center Ltd\n// 2005-2007 Steven Solie <steven@solie.ca>\n// 2016-2021 Sebastian Pipping <sebastian@pipping.org>\n// 2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2018 Anton Maklakov <antmak.pub@gmail.com>\n// 2017 Alexander Bluhm <alexander.bluhm@gmx.net>\n// 2016-2022 Sebastian Pipping <sebastian@pipping.org>\n// 1997-2000 Thai Open Source Software Center Ltd\n// 2017-2021 Sebastian Pipping <sebastian@pipping.org>\n// 2002-2009 Karl Waclawek <karl@waclawek.net>\n// 2002 Karl Waclawek <karl@waclawek.net>\n// 2004-2009 Karl Waclawek <karl@waclawek.net>\n// 2020 Tim Gates <tim.gates@iress.com>\n// 2016 Pascal Cuoq <cuoq@trust-in-soft.com>\n// 2017 Jos\\x{00c3}\\x{00a9} Guti\\x{00c3}\\x{00a9}rrez de la Concha <jose@zeroc.com>\n// 2001-2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2002-2006 Karl Waclawek <karl@waclawek.net>\n// 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2005-2009 Steven Solie <steven@solie.ca>\n// 2018 Yury Gribov <tetra2005@gmail.com>\n// 2022 Martin Ettl <ettl.martin78@googlemail.com>\n// 2003 Greg Stein <gstein@users.sourceforge.net>\n// 2016-2017 Sebastian Pipping <sebastian@pipping.org>\n// 2020 Kleber Tarc\\x{00c3}\\x{00ad}sio <klebertarcisio@yahoo.com.br>\n// 2001-2002 Greg Stein <gstein@users.sourceforge.net>\n// 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>\n// 2005-2006 Karl Waclawek <karl@waclawek.net>\n// 2016 Thomas Beutlich <tc@tbeu.de>\n// \n// # Project: freetype\n// License: FTL\n// Copyright: \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5} \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5}\\x{00d1}\\x{008f}\\x{00c3}\\x{00af}\\x{00ef}\\x{00ac}\\x{00af}\\x{00c4}\\x{009f}\")\n// 2009-2013 Adobe Systems Incorporated.\n// 2016-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2013 Adobe Systems Incorporated.\n// 2004-2022 David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.\n// 2013-2022 Google, Inc.\n// 2018-2022 Armin Hasitzka, David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2014 Adobe Systems Incorporated.\n// 2008-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2005-2022 Werner Lemberg and Detlef W\\x{00fc}rkner.\n// 2006-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1996-2022 David Turner, Robert Wilhelm, Werner Lemberg and Detlef W\\x{00fc}rkner.\n// 2004-2022 Masatake YAMATO, Redhat K.K,\n// 1996-2022 David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner.\n// 1996-2022 David Turner, Robert Wilhelm, and Werner Lemberg\n// 1995-2016 Jean-loup Gailly, Mark Adler\n// 2021-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5} \\x{00c5}\\x{009d}\\x{00c5}\\x{00a5}\\x{00d1}\\x{008f}\\x{00c3}\\x{00af}\\x{00ef}\\x{00ac}\\x{00af}\\x{00c4}\\x{009f}\"));\n// 2004-2022 David Turner, Robert Wilhelm, Werner Lemberg and George Williams.\n// 2009-2022 Oran Agra and Mickey Gabel.\n// 2010-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2017 Jean-loup Gailly\n// 2003 Huw D M Davies for Codeweavers\n// 2013-2014 Adobe Systems Incorporated.\n// 2005-2022 David Turner.\n// 1995-2011, 2016 Mark Adler\n// 2010-2022 Joel Klinghed.\n// 2002-2022 Roberto Alameda.\n// 1996-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2011-2013 Adobe Systems Incorporated.\n// 2007 Dmitry Timoshkov for Codeweavers\n// 2002-2022 David Turner, Robert Wilhelm, and Werner Lemberg\n// 2013-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1996-2022 Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2017 Mark Adler\n// 2000-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2022 David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.\n// 2006-2013 Adobe Systems Incorporated.\n// 1995-2003, 2010 Mark Adler\n// 2012-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2022 Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.\n// 2007-2022 David Turner.\n// 2017-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2008-2022 David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.\n// 2018-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2005, 2010 Mark Adler\n// 2005-2022 suzuki toshiya, Masatake YAMATO, Red Hat K.K.,\n// 2020-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2022 Derek Clegg and Michael Toftdal.\n// \\x{00e1}\\x{00bb}\\x{008b}...): %dn\", \"\\x{00e1}\\x{00ba}\\x{0083}\\x{00ce}\\x{00ad}\\x{00c5}\\x{0082}\\x{00c4}\\x{00ba}\", \"all\", 42);\n// 2019-2022 Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2013 Google, Inc.\n// 2004-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2009-2014 Adobe Systems Incorporated.\n// 2004-2022 Albert Chin-A-Young.\n// 2003-2022 Masatake YAMATO, Redhat K.K.,\n// 2002-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2007-2013 Adobe Systems Incorporated.\n// 2007-2022 Dereg Clegg and Michael Toftdal.\n// 2003-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2004-2022 Masatake YAMATO and Redhat K.K.\n// 2004-2022 Masatake YAMATO, Red Hat K.K.,\n// 2001-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 2001, 2012 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2022 Jean-loup Gailly, Mark Adler\n// 1995-2022 Mark Adler\n// 2004-2019 Mark Adler\n// 1990, 1994, 1998 The Open Group\n// 2005-2022 David Turner, Robert Wilhelm, and Werner Lemberg.\n// 1995-2019 Mark Adler\n// 2018-2022 David Turner, Robert Wilhelm, Dominik R\\x{00c3}\\x{00b6}ttsches, and Werner Lemberg.\n// 2004-2022 suzuki toshiya, Masatake YAMATO, Red Hat K.K.,\n// \n// License: public-domain\n// Copyright: 2001 Alexander Peslyak and it is hereby released to the\n// \n// License: Zlib\n// Copyright: 1995-2022 Jean-loup Gailly and Mark Adler\n// \n// License: Expat\n// Copyright: 2000-2001, 2004 Francesco Zappa Nardelli\n// 2001-2004 Francesco Zappa Nardelli\n// 2003 Francesco Zappa Nardelli\n// 2001-2015 Francesco Zappa Nardelli\n// 2001-2004, 2011 Francesco Zappa Nardelli\n// 2000-2002 Francesco Zappa Nardelli\n// 2000 Computing Research Labs, New Mexico State University\n// 2001-2014 Francesco Zappa Nardelli\n// 2001-2002, 2012 Francesco Zappa Nardelli\n// 2001-2002 Francesco Zappa Nardelli\n// 2001-2008, 2011, 2013-2014 Francesco Zappa Nardelli\n// 2000-2003, 2006, 2010 Francesco Zappa Nardelli\n// 2000-2001, 2003 Francesco Zappa Nardelli\n// 2000-2004, 2006-2011, 2013-2014 Francesco Zappa Nardelli\n// 2000-2010, 2012-2014 Francesco Zappa Nardelli\n// \n// License: BSL-1.0\n// Copyright: 2019 nyorain\n// \n// # Project: fribidi\n// License: LGPL-2.1+\n// Copyright: 1999-2000, 2017 Dov Grobgeld\n// 1999-2000 Dov Grobgeld\n// 2004 Behdad Esfahbod\n// 2001-2002, 2004 Behdad Esfahbod\n// 2009 Behdad Esfahbod\n// 2017 Dov Grobgeld\n// 2004-2005 Behdad Esfahbod\n// 2004 Sharif FarsiWeb, Inc.\n// 2015, 2017 Dov Grobgeld\n// 2005 Behdad Esfahbod\n// 2001 Behdad Esfahbod.\n// 2001-2002 Behdad Esfahbod\n// 2004 Sharif FarsiWeb, Inc\n// \n// # Project: fontconfig\n// License: NTP~disclaimer\n// Copyright: 2002 Keith Packard\n// 2009 Roozbeh Pournader\n// 2000 Tuomas J. Lukka\n// 2006 Keith Packard\n// 2008 Red Hat, Inc.\n// 2000-2007 Keith Packard / 2005 Patrick Lam / 2009 Roozbeh Pournader / 2008,2009 Red Hat, Inc. / 2008 Danilo Šegan / 2012 Google, Inc.\n// 2001 Keith Packard\n// 2012 Google, Inc.\n// 2012 Red Hat, Inc.\n// 2013 Raimund Steger\n// 2008,2009 Red Hat, Inc.\n// 2000-2007 Keith Packard\n// 2005 Patrick Lam\n// 2003 Keith Packard\n// 2020 Zoltan Vandrus\n// \\x{00e6}\\x{0081}\\x{00af} 2010 Behdad Esfahbod\n// 2014 Red Hat, Inc.\n// 2018 Akira TAGOH\n// 2007 Keith Packard\n// \\x{00e6}\\x{0081}\\x{00af} 2006 Keith Packard\n// 2008 Danilo Šegan\n// 2015 Akira TAGOH\n// 2016 Akira TAGOH\n// 2008-2009 Red Hat, Inc.\n// 2000 Keith Packard\n// 2013 Akira TAGOH\n// 2013 Google, Inc.\n// 2010 Behdad Esfahbod\n// \n// License: MIT~old\n// Copyright: 2009-2010 Red Hat, Inc.\n// 2011-2013 Google, Inc.\n// 2007 Chris Wilson\n// \n// License: public-domain\n// Copyright: 2008,2009 Red Hat, Inc.\n// 2009 Roozbeh Pournader\n// 2012 Google, Inc.\n// 2008 Danilo Šegan\n// 2005 Patrick Lam\n// 2000-2007 Keith Packard\n// \n// License: Expat\n// Copyright: 2002-2003 Juliusz Chroboczek\n// \n// # Project: harfbuzz\n// License: NTP~disclaimer\n// Copyright: 2002 Keith Packard\n// 2014 Google, Inc.\n// \n// License: MIT~old\n// Copyright: 2012 Mozilla Foundation.\n// 2004, 2007, 2009 Red Hat, Inc.\n// 2009 Red Hat, Inc.\n// 2015 Google, Inc.\n// 2014 Google, Inc.\n// 2018 Ebrahim Byagowi\n// 2016 Igalia S.L.\n// 2018 Ebrahim Byagowi.\n// 2011 Martin Hosken\n// 2019 Ebrahim Byagowi\n// 1998-2004 David Turner and Werner Lemberg\n// 2020 Ebrahim Byagowi\n// 2013 Red Hat, Inc.\n// 2011-2012 Google, Inc.\n// 2011 SIL International\n// 2018 Khaled Hosny\n// 2018 Google, Inc.\n// 2019-2020 Ebrahim Byagowi\n// 2022 Google, Inc.\n// 2012 Google, Inc.\n// 2017 Google, Inc.\n// 2007-2009 Red Hat, Inc.\n// 2011 Codethink Limited\n// 2013 Google, Inc.\n// 2015-2019 Ebrahim Byagowi\n// 2016 Google, Inc.\n// 2011 Google, Inc.\n// \n// # Project: libass\n// License: public-domain\n// Copyright: 2006-2016 libass contributors\n// \n// License: NTP\n// Copyright: 1994 Sun Microsystems, Inc.\n// 2016 Oleg Oshmyan <chortos@inbox.lv>\n// 1988-1993 The Regents of the University of California.\n// \n// License: ISC\n// Copyright: 2015 Oleg Oshmyan <chortos@inbox.lv>\n// 2011-2014 Yu Zhuohuang <yuzhuohuang@qq.com>\n// 2013 rcombs <rcombs@rcombs.me>\n// 2016 Vabishchevich Nikolay <vabnick@gmail.com>\n// 2022 libass contributors\n// 2015 Stephan Vedder <stephan.vedder@gmail.com>\n// 2015 Vabishchevich Nikolay <vabnick@gmail.com>\n// interest in the\n// 2006-2016 libass contributors\n// 2021 libass contributors\n// 2017 Vabishchevich Nikolay <vabnick@gmail.com>\n// 2011 Grigori Goronzy <greg@chown.ath.cx>\n// 2010 Grigori Goronzy <greg@geekmind.org>\n// 2014 Vabishchevich Nikolay <vabnick@gmail.com>\n// 2015 Grigori Goronzy <greg@kinoho.net>\n// 2013 Stefano Pigozzi <stefano.pigozzi@gmail.com>\n// 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>\n// 2009 Grigori Goronzy <greg@geekmind.org>\n// \n// # The following section contains the full license text or\n// # where permitted a shorter notice for all works contained\n// # in JavascriptSubtitlesOctopus listed above\n// #\n// # Note that the shortnames used here are identical to those used by Debian\n// # and will in some cases differ from SPDX identifiers. See below.\n// #\n// # Debian-name | SPDX-name\n// # ---------------+-------------------\n// # MIT~old | MIT-Modern-Variant\n// # Expat | MIT\n// # NTP~disclaimer | (None; it is NTP with a more verbose warranty disclaimer)\n// \n// License: Expat\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n// .\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n// .\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// \n// License: FTL\n// Portions of this software are copyright © 2021 The FreeType\n// Project (www.freetype.org). All rights reserved.\n// A copy of the FreeType License can be obtained at\n// https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/FTL.TXT\n// \n// License: ISC\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// .\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n// \n// License: MIT~old\n// Permission is hereby granted, without written agreement and without\n// license or royalty fees, to use, copy, modify, and distribute this\n// software and its documentation for any purpose, provided that the\n// above copyright notice and the following two paragraphs appear in\n// all copies of this software.\n// .\n// IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n// DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n// IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGE.\n// .\n// THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n// FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n// ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n// PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS\n// \n// License: NTP\n// Permission to use, copy, modify, and distribute this\n// software and its documentation for any purpose and without\n// fee is hereby granted, provided that the above copyright\n// notice appear in all copies. The University of California\n// makes no representations about the suitability of this\n// software for any purpose. It is provided \"as is\" without\n// express or implied warranty.\n// \n// License: NTP~disclaimer\n// Permission to use, copy, modify, distribute, and sell this software and its\n// documentation for any purpose is hereby granted without fee, provided that\n// the above copyright notice appear in all copies and that both that\n// copyright notice and this permission notice appear in supporting\n// documentation, and that the name of the author(s) not be used in\n// advertising or publicity pertaining to distribution of the software without\n// specific, written prior permission. The authors make no\n// representations about the suitability of this software for any purpose. It\n// is provided \"as is\" without express or implied warranty.\n// .\n// THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\n// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO\n// EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR\n// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\n// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n// PERFORMANCE OF THIS SOFTWARE.\n// \n// License: Zlib\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n// .\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n// .\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n// \n// License: BSL-1\n// Boost Software License - Version 1.0 - August 17th, 2003\n// .\n// Permission is hereby granted, free of charge, to any person or organization\n// obtaining a copy of the software and accompanying documentation covered by\n// this license (the \"Software\") to use, reproduce, display, distribute,\n// execute, and transmit the Software, and to prepare derivative works of the\n// Software, and to permit third-parties to whom the Software is furnished to\n// do so, all subject to the following:\n// .\n// The copyright notices in the Software and this entire statement, including\n// the above license grant, this restriction and the following disclaimer,\n// must be included in all copies of the Software, in whole or in part, and\n// all derivative works of the Software, unless such copies or derivative\n// works are solely in the form of machine-executable object code generated by\n// a source language processor.\n// .\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\n// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\n// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\n// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n// \n// License: LGPL-2.1\n// GNU LESSER GENERAL PUBLIC LICENSE\n// Version 2.1, February 1999\n// .\n// Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n// Everyone is permitted to copy and distribute verbatim copies\n// of this license document, but changing it is not allowed.\n// .\n// [This is the first released version of the Lesser GPL. It also counts\n// as the successor of the GNU Library Public License, version 2, hence\n// the version number 2.1.]\n// .\n// Preamble\n// .\n// The licenses for most software are designed to take away your\n// freedom to share and change it. By contrast, the GNU General Public\n// Licenses are intended to guarantee your freedom to share and change\n// free software--to make sure the software is free for all its users.\n// .\n// This license, the Lesser General Public License, applies to some\n// specially designated software packages--typically libraries--of the\n// Free Software Foundation and other authors who decide to use it. You\n// can use it too, but we suggest you first think carefully about whether\n// this license or the ordinary General Public License is the better\n// strategy to use in any particular case, based on the explanations below.\n// .\n// When we speak of free software, we are referring to freedom of use,\n// not price. Our General Public Licenses are designed to make sure that\n// you have the freedom to distribute copies of free software (and charge\n// for this service if you wish); that you receive source code or can get\n// it if you want it; that you can change the software and use pieces of\n// it in new free programs; and that you are informed that you can do\n// these things.\n// .\n// To protect your rights, we need to make restrictions that forbid\n// distributors to deny you these rights or to ask you to surrender these\n// rights. These restrictions translate to certain responsibilities for\n// you if you distribute copies of the library or if you modify it.\n// .\n// For example, if you distribute copies of the library, whether gratis\n// or for a fee, you must give the recipients all the rights that we gave\n// you. You must make sure that they, too, receive or can get the source\n// code. If you link other code with the library, you must provide\n// complete object files to the recipients, so that they can relink them\n// with the library after making changes to the library and recompiling\n// it. And you must show them these terms so they know their rights.\n// .\n// We protect your rights with a two-step method: (1) we copyright the\n// library, and (2) we offer you this license, which gives you legal\n// permission to copy, distribute and/or modify the library.\n// .\n// To protect each distributor, we want to make it very clear that\n// there is no warranty for the free library. Also, if the library is\n// modified by someone else and passed on, the recipients should know\n// that what they have is not the original version, so that the original\n// author's reputation will not be affected by problems that might be\n// introduced by others.\n// .\n// Finally, software patents pose a constant threat to the existence of\n// any free program. We wish to make sure that a company cannot\n// effectively restrict the users of a free program by obtaining a\n// restrictive license from a patent holder. Therefore, we insist that\n// any patent license obtained for a version of the library must be\n// consistent with the full freedom of use specified in this license.\n// .\n// Most GNU software, including some libraries, is covered by the\n// ordinary GNU General Public License. This license, the GNU Lesser\n// General Public License, applies to certain designated libraries, and\n// is quite different from the ordinary General Public License. We use\n// this license for certain libraries in order to permit linking those\n// libraries into non-free programs.\n// .\n// When a program is linked with a library, whether statically or using\n// a shared library, the combination of the two is legally speaking a\n// combined work, a derivative of the original library. The ordinary\n// General Public License therefore permits such linking only if the\n// entire combination fits its criteria of freedom. The Lesser General\n// Public License permits more lax criteria for linking other code with\n// the library.\n// .\n// We call this license the \"Lesser\" General Public License because it\n// does Less to protect the user's freedom than the ordinary General\n// Public License. It also provides other free software developers Less\n// of an advantage over competing non-free programs. These disadvantages\n// are the reason we use the ordinary General Public License for many\n// libraries. However, the Lesser license provides advantages in certain\n// special circumstances.\n// .\n// For example, on rare occasions, there may be a special need to\n// encourage the widest possible use of a certain library, so that it becomes\n// a de-facto standard. To achieve this, non-free programs must be\n// allowed to use the library. A more frequent case is that a free\n// library does the same job as widely used non-free libraries. In this\n// case, there is little to gain by limiting the free library to free\n// software only, so we use the Lesser General Public License.\n// .\n// In other cases, permission to use a particular library in non-free\n// programs enables a greater number of people to use a large body of\n// free software. For example, permission to use the GNU C Library in\n// non-free programs enables many more people to use the whole GNU\n// operating system, as well as its variant, the GNU/Linux operating\n// system.\n// .\n// Although the Lesser General Public License is Less protective of the\n// users' freedom, it does ensure that the user of a program that is\n// linked with the Library has the freedom and the wherewithal to run\n// that program using a modified version of the Library.\n// .\n// The precise terms and conditions for copying, distribution and\n// modification follow. Pay close attention to the difference between a\n// \"work based on the library\" and a \"work that uses the library\". The\n// former contains code derived from the library, whereas the latter must\n// be combined with the library in order to run.\n// .\n// GNU LESSER GENERAL PUBLIC LICENSE\n// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n// .\n// 0. This License Agreement applies to any software library or other\n// program which contains a notice placed by the copyright holder or\n// other authorized party saying it may be distributed under the terms of\n// this Lesser General Public License (also called \"this License\").\n// Each licensee is addressed as \"you\".\n// .\n// A \"library\" means a collection of software functions and/or data\n// prepared so as to be conveniently linked with application programs\n// (which use some of those functions and data) to form executables.\n// .\n// The \"Library\", below, refers to any such software library or work\n// which has been distributed under these terms. A \"work based on the\n// Library\" means either the Library or any derivative work under\n// copyright law: that is to say, a work containing the Library or a\n// portion of it, either verbatim or with modifications and/or translated\n// straightforwardly into another language. (Hereinafter, translation is\n// included without limitation in the term \"modification\".)\n// .\n// \"Source code\" for a work means the preferred form of the work for\n// making modifications to it. For a library, complete source code means\n// all the source code for all modules it contains, plus any associated\n// interface definition files, plus the scripts used to control compilation\n// and installation of the library.\n// .\n// Activities other than copying, distribution and modification are not\n// covered by this License; they are outside its scope. The act of\n// running a program using the Library is not restricted, and output from\n// such a program is covered only if its contents constitute a work based\n// on the Library (independent of the use of the Library in a tool for\n// writing it). Whether that is true depends on what the Library does\n// and what the program that uses the Library does.\n// \n// 1. You may copy and distribute verbatim copies of the Library's\n// complete source code as you receive it, in any medium, provided that\n// you conspicuously and appropriately publish on each copy an\n// appropriate copyright notice and disclaimer of warranty; keep intact\n// all the notices that refer to this License and to the absence of any\n// warranty; and distribute a copy of this License along with the\n// Library.\n// .\n// You may charge a fee for the physical act of transferring a copy,\n// and you may at your option offer warranty protection in exchange for a\n// fee.\n// .\n// 2. You may modify your copy or copies of the Library or any portion\n// of it, thus forming a work based on the Library, and copy and\n// distribute such modifications or work under the terms of Section 1\n// above, provided that you also meet all of these conditions:\n// .\n// a) The modified work must itself be a software library.\n// .\n// b) You must cause the files modified to carry prominent notices\n// stating that you changed the files and the date of any change.\n// .\n// c) You must cause the whole of the work to be licensed at no\n// charge to all third parties under the terms of this License.\n// .\n// d) If a facility in the modified Library refers to a function or a\n// table of data to be supplied by an application program that uses\n// the facility, other than as an argument passed when the facility\n// is invoked, then you must make a good faith effort to ensure that,\n// in the event an application does not supply such function or\n// table, the facility still operates, and performs whatever part of\n// its purpose remains meaningful.\n// .\n// (For example, a function in a library to compute square roots has\n// a purpose that is entirely well-defined independent of the\n// application. Therefore, Subsection 2d requires that any\n// application-supplied function or table used by this function must\n// be optional: if the application does not supply it, the square\n// root function must still compute square roots.)\n// .\n// These requirements apply to the modified work as a whole. If\n// identifiable sections of that work are not derived from the Library,\n// and can be reasonably considered independent and separate works in\n// themselves, then this License, and its terms, do not apply to those\n// sections when you distribute them as separate works. But when you\n// distribute the same sections as part of a whole which is a work based\n// on the Library, the distribution of the whole must be on the terms of\n// this License, whose permissions for other licensees extend to the\n// entire whole, and thus to each and every part regardless of who wrote\n// it.\n// .\n// Thus, it is not the intent of this section to claim rights or contest\n// your rights to work written entirely by you; rather, the intent is to\n// exercise the right to control the distribution of derivative or\n// collective works based on the Library.\n// .\n// In addition, mere aggregation of another work not based on the Library\n// with the Library (or with a work based on the Library) on a volume of\n// a storage or distribution medium does not bring the other work under\n// the scope of this License.\n// .\n// 3. You may opt to apply the terms of the ordinary GNU General Public\n// License instead of this License to a given copy of the Library. To do\n// this, you must alter all the notices that refer to this License, so\n// that they refer to the ordinary GNU General Public License, version 2,\n// instead of to this License. (If a newer version than version 2 of the\n// ordinary GNU General Public License has appeared, then you can specify\n// that version instead if you wish.) Do not make any other change in\n// these notices.\n// .\n// Once this change is made in a given copy, it is irreversible for\n// that copy, so the ordinary GNU General Public License applies to all\n// subsequent copies and derivative works made from that copy.\n// .\n// This option is useful when you wish to copy part of the code of\n// the Library into a program that is not a library.\n// .\n// 4. You may copy and distribute the Library (or a portion or\n// derivative of it, under Section 2) in object code or executable form\n// under the terms of Sections 1 and 2 above provided that you accompany\n// it with the complete corresponding machine-readable source code, which\n// must be distributed under the terms of Sections 1 and 2 above on a\n// medium customarily used for software interchange.\n// .\n// If distribution of object code is made by offering access to copy\n// from a designated place, then offering equivalent access to copy the\n// source code from the same place satisfies the requirement to\n// distribute the source code, even though third parties are not\n// compelled to copy the source along with the object code.\n// .\n// 5. A program that contains no derivative of any portion of the\n// Library, but is designed to work with the Library by being compiled or\n// linked with it, is called a \"work that uses the Library\". Such a\n// work, in isolation, is not a derivative work of the Library, and\n// therefore falls outside the scope of this License.\n// .\n// However, linking a \"work that uses the Library\" with the Library\n// creates an executable that is a derivative of the Library (because it\n// contains portions of the Library), rather than a \"work that uses the\n// library\". The executable is therefore covered by this License.\n// Section 6 states terms for distribution of such executables.\n// .\n// When a \"work that uses the Library\" uses material from a header file\n// that is part of the Library, the object code for the work may be a\n// derivative work of the Library even though the source code is not.\n// Whether this is true is especially significant if the work can be\n// linked without the Library, or if the work is itself a library. The\n// threshold for this to be true is not precisely defined by law.\n// .\n// If such an object file uses only numerical parameters, data\n// structure layouts and accessors, and small macros and small inline\n// functions (ten lines or less in length), then the use of the object\n// file is unrestricted, regardless of whether it is legally a derivative\n// work. (Executables containing this object code plus portions of the\n// Library will still fall under Section 6.)\n// .\n// Otherwise, if the work is a derivative of the Library, you may\n// distribute the object code for the work under the terms of Section 6.\n// Any executables containing that work also fall under Section 6,\n// whether or not they are linked directly with the Library itself.\n// .\n// 6. As an exception to the Sections above, you may also combine or\n// link a \"work that uses the Library\" with the Library to produce a\n// work containing portions of the Library, and distribute that work\n// under terms of your choice, provided that the terms permit\n// modification of the work for the customer's own use and reverse\n// engineering for debugging such modifications.\n// .\n// You must give prominent notice with each copy of the work that the\n// Library is used in it and that the Library and its use are covered by\n// this License. You must supply a copy of this License. If the work\n// during execution displays copyright notices, you must include the\n// copyright notice for the Library among them, as well as a reference\n// directing the user to the copy of this License. Also, you must do one\n// of these things:\n// .\n// a) Accompany the work with the complete corresponding\n// machine-readable source code for the Library including whatever\n// changes were used in the work (which must be distributed under\n// Sections 1 and 2 above); and, if the work is an executable linked\n// with the Library, with the complete machine-readable \"work that\n// uses the Library\", as object code and/or source code, so that the\n// user can modify the Library and then relink to produce a modified\n// executable containing the modified Library. (It is understood\n// that the user who changes the contents of definitions files in the\n// Library will not necessarily be able to recompile the application\n// to use the modified definitions.)\n// .\n// b) Use a suitable shared library mechanism for linking with the\n// Library. A suitable mechanism is one that (1) uses at run time a\n// copy of the library already present on the user's computer system,\n// rather than copying library functions into the executable, and (2)\n// will operate properly with a modified version of the library, if\n// the user installs one, as long as the modified version is\n// interface-compatible with the version that the work was made with.\n// .\n// c) Accompany the work with a written offer, valid for at\n// least three years, to give the same user the materials\n// specified in Subsection 6a, above, for a charge no more\n// than the cost of performing this distribution.\n// .\n// d) If distribution of the work is made by offering access to copy\n// from a designated place, offer equivalent access to copy the above\n// specified materials from the same place.\n// .\n// e) Verify that the user has already received a copy of these\n// materials or that you have already sent this user a copy.\n// .\n// For an executable, the required form of the \"work that uses the\n// Library\" must include any data and utility programs needed for\n// reproducing the executable from it. However, as a special exception,\n// the materials to be distributed need not include anything that is\n// normally distributed (in either source or binary form) with the major\n// components (compiler, kernel, and so on) of the operating system on\n// which the executable runs, unless that component itself accompanies\n// the executable.\n// .\n// It may happen that this requirement contradicts the license\n// restrictions of other proprietary libraries that do not normally\n// accompany the operating system. Such a contradiction means you cannot\n// use both them and the Library together in an executable that you\n// distribute.\n// .\n// 7. You may place library facilities that are a work based on the\n// Library side-by-side in a single library together with other library\n// facilities not covered by this License, and distribute such a combined\n// library, provided that the separate distribution of the work based on\n// the Library and of the other library facilities is otherwise\n// permitted, and provided that you do these two things:\n// .\n// a) Accompany the combined library with a copy of the same work\n// based on the Library, uncombined with any other library\n// facilities. This must be distributed under the terms of the\n// Sections above.\n// .\n// b) Give prominent notice with the combined library of the fact\n// that part of it is a work based on the Library, and explaining\n// where to find the accompanying uncombined form of the same work.\n// .\n// 8. You may not copy, modify, sublicense, link with, or distribute\n// the Library except as expressly provided under this License. Any\n// attempt otherwise to copy, modify, sublicense, link with, or\n// distribute the Library is void, and will automatically terminate your\n// rights under this License. However, parties who have received copies,\n// or rights, from you under this License will not have their licenses\n// terminated so long as such parties remain in full compliance.\n// .\n// 9. You are not required to accept this License, since you have not\n// signed it. However, nothing else grants you permission to modify or\n// distribute the Library or its derivative works. These actions are\n// prohibited by law if you do not accept this License. Therefore, by\n// modifying or distributing the Library (or any work based on the\n// Library), you indicate your acceptance of this License to do so, and\n// all its terms and conditions for copying, distributing or modifying\n// the Library or works based on it.\n// .\n// 10. Each time you redistribute the Library (or any work based on the\n// Library), the recipient automatically receives a license from the\n// original licensor to copy, distribute, link with or modify the Library\n// subject to these terms and conditions. You may not impose any further\n// restrictions on the recipients' exercise of the rights granted herein.\n// You are not responsible for enforcing compliance by third parties with\n// this License.\n// .\n// 11. If, as a consequence of a court judgment or allegation of patent\n// infringement or for any other reason (not limited to patent issues),\n// conditions are imposed on you (whether by court order, agreement or\n// otherwise) that contradict the conditions of this License, they do not\n// excuse you from the conditions of this License. If you cannot\n// distribute so as to satisfy simultaneously your obligations under this\n// License and any other pertinent obligations, then as a consequence you\n// may not distribute the Library at all. For example, if a patent\n// license would not permit royalty-free redistribution of the Library by\n// all those who receive copies directly or indirectly through you, then\n// the only way you could satisfy both it and this License would be to\n// refrain entirely from distribution of the Library.\n// .\n// If any portion of this section is held invalid or unenforceable under any\n// particular circumstance, the balance of the section is intended to apply,\n// and the section as a whole is intended to apply in other circumstances.\n// .\n// It is not the purpose of this section to induce you to infringe any\n// patents or other property right claims or to contest validity of any\n// such claims; this section has the sole purpose of protecting the\n// integrity of the free software distribution system which is\n// implemented by public license practices. Many people have made\n// generous contributions to the wide range of software distributed\n// through that system in reliance on consistent application of that\n// system; it is up to the author/donor to decide if he or she is willing\n// to distribute software through any other system and a licensee cannot\n// impose that choice.\n// .\n// This section is intended to make thoroughly clear what is believed to\n// be a consequence of the rest of this License.\n// .\n// 12. If the distribution and/or use of the Library is restricted in\n// certain countries either by patents or by copyrighted interfaces, the\n// original copyright holder who places the Library under this License may add\n// an explicit geographical distribution limitation excluding those countries,\n// so that distribution is permitted only in or among countries not thus\n// excluded. In such case, this License incorporates the limitation as if\n// written in the body of this License.\n// .\n// 13. The Free Software Foundation may publish revised and/or new\n// versions of the Lesser General Public License from time to time.\n// Such new versions will be similar in spirit to the present version,\n// but may differ in detail to address new problems or concerns.\n// .\n// Each version is given a distinguishing version number. If the Library\n// specifies a version number of this License which applies to it and\n// \"any later version\", you have the option of following the terms and\n// conditions either of that version or of any later version published by\n// the Free Software Foundation. If the Library does not specify a\n// license version number, you may choose any version ever published by\n// the Free Software Foundation.\n// .\n// 14. If you wish to incorporate parts of the Library into other free\n// programs whose distribution conditions are incompatible with these,\n// write to the author to ask for permission. For software which is\n// copyrighted by the Free Software Foundation, write to the Free\n// Software Foundation; we sometimes make exceptions for this. Our\n// decision will be guided by the two goals of preserving the free status\n// of all derivatives of our free software and of promoting the sharing\n// and reuse of software generally.\n// .\n// NO WARRANTY\n// .\n// 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\n// WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\n// EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n// OTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\n// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\n// LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\n// THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n// .\n// 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\n// WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\n// AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\n// FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n// CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\n// LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\n// RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\n// FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\n// SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGES.\n// .\n// END OF TERMS AND CONDITIONS\n// .\n// How to Apply These Terms to Your New Libraries\n// .\n// If you develop a new library, and you want it to be of the greatest\n// possible use to the public, we recommend making it free software that\n// everyone can redistribute and change. You can do so by permitting\n// redistribution under these terms (or, alternatively, under the terms of the\n// ordinary General Public License).\n// .\n// To apply these terms, attach the following notices to the library. It is\n// safest to attach them to the start of each source file to most effectively\n// convey the exclusion of warranty; and each file should have at least the\n// \"copyright\" line and a pointer to where the full notice is found.\n// .\n// <one line to give the library's name and a brief idea of what it does.>\n// Copyright (C) <year> <name of author>\n// .\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n// .\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n// .\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n// .\n// Also add information on how to contact you by electronic and paper mail.\n// .\n// You should also get your employer (if you work as a programmer) or your\n// school, if any, to sign a \"copyright disclaimer\" for the library, if\n// necessary. Here is a sample; alter the names:\n// .\n// Yoyodyne, Inc., hereby disclaims all copyright interest in the\n// library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n// .\n// <signature of Ty Coon>, 1 April 1990\n// Ty Coon, President of Vice\n// .\n// That's all there is to it!\n\"use strict\";\nvar SubtitlesOctopus = function (options) {\n var supportsWebAssembly = false;\n try {\n if (typeof WebAssembly === \"object\"\n && typeof WebAssembly.instantiate === \"function\") {\n const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));\n if (module instanceof WebAssembly.Module)\n supportsWebAssembly = (new WebAssembly.Instance(module) instanceof WebAssembly.Instance);\n }\n } catch (e) {\n }\n console.log(\"WebAssembly support detected: \" + (supportsWebAssembly ? \"yes\" : \"no\"));\n\n var self = this;\n self.canvas = options.canvas; // HTML canvas element (optional if video specified)\n self.renderMode = options.renderMode || (options.lossyRender ? 'lossy' : 'wasm-blend');\n self.libassMemoryLimit = options.libassMemoryLimit || 0;\n self.libassGlyphLimit = options.libassGlyphLimit || 0;\n self.targetFps = options.targetFps || 24;\n self.prescaleFactor = options.prescaleFactor || 1.0;\n self.prescaleHeightLimit = options.prescaleHeightLimit || 1080;\n self.maxRenderHeight = options.maxRenderHeight || 0; // 0 - no limit\n self.dropAllAnimations = options.dropAllAnimations || false; // attempt to remove all animations as a last ditch effort for displaying on weak hardware; may severly mangle subtitles if enabled\n self.isOurCanvas = false; // (internal) we created canvas and manage it\n self.video = options.video; // HTML video element (optional if canvas specified)\n self.canvasParent = null; // (internal) HTML canvas parent element\n self.fonts = options.fonts || []; // Array with links to fonts used in sub (optional)\n self.availableFonts = options.availableFonts || []; // Object with all available fonts (optional). Key is font name in lower case, value is link: {\"arial\": \"/font1.ttf\"}\n self.fallbackFont = options.fallbackFont || 'default.woff2'; // URL to override fallback font, for example, with a CJK one. Default fallback font is Liberation Sans (Optional)\n self.lazyFileLoading = options.lazyFileLoading || false; // Load fonts in a lazy way. Requires Access-Control-Expose-Headers for Accept-Ranges, Content-Length, and Content-Encoding. If Content-Encoding is compressed, file will be fully fetched instead of just a HEAD request.\n self.onReadyEvent = options.onReady; // Function called when SubtitlesOctopus is ready (optional)\n if (supportsWebAssembly) {\n self.workerUrl = options.workerUrl || 'subtitles-octopus-worker.js'; // Link to WebAssembly worker\n } else {\n self.workerUrl = options.legacyWorkerUrl || 'subtitles-octopus-worker-legacy.js'; // Link to legacy worker\n }\n self.subUrl = options.subUrl; // Link to sub file (optional if subContent specified)\n self.subContent = options.subContent || null; // Sub content (optional if subUrl specified)\n self.onErrorEvent = options.onError; // Function called in case of critical error meaning sub wouldn't be shown and you should use alternative method (for instance it occurs if browser doesn't support web workers).\n self.debug = options.debug || false; // When debug enabled, some performance info printed in console.\n self.lastRenderTime = 0; // (internal) Last time we got some frame from worker\n self.pixelRatio = window.devicePixelRatio || 1; // (internal) Device pixel ratio (for high dpi devices)\n\n self.timeOffset = options.timeOffset || 0; // Time offset would be applied to currentTime from video (option)\n\n self.hasAlphaBug = false;\n\n (function() {\n if (typeof ImageData.prototype.constructor === 'function') {\n try {\n // try actually calling ImageData, as on some browsers it's reported\n // as existing but calling it errors out as \"TypeError: Illegal constructor\"\n new window.ImageData(new Uint8ClampedArray([0, 0, 0, 0]), 1, 1);\n return;\n } catch (e) {\n console.log(\"detected that ImageData is not constructable despite browser saying so\");\n }\n }\n\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n\n window.ImageData = function () {\n var i = 0;\n if (arguments[0] instanceof Uint8ClampedArray) {\n var data = arguments[i++];\n }\n var width = arguments[i++];\n var height = arguments[i];\n\n var imageData = ctx.createImageData(width, height);\n if (data) imageData.data.set(data);\n return imageData;\n }\n })();\n\n self.workerError = function (error) {\n console.error('Worker error: ', error);\n if (self.onErrorEvent) {\n self.onErrorEvent(error);\n }\n if (!self.debug) {\n self.dispose();\n throw new Error('Worker error: ' + error);\n }\n };\n\n // Not tested for repeated usage yet\n self.init = function () {\n if (!window.Worker) {\n self.workerError('worker not supported');\n return;\n }\n // Worker\n if (!self.worker) {\n self.worker = new Worker(self.workerUrl);\n self.worker.addEventListener('message', self.onWorkerMessage);\n self.worker.addEventListener('error', self.workerError);\n }\n self.workerActive = false;\n self.createCanvas();\n self.setVideo(options.video);\n self.setSubUrl(options.subUrl);\n self.worker.postMessage({\n target: 'worker-init',\n width: self.canvas.width,\n height: self.canvas.height,\n URL: document.URL,\n currentScript: self.workerUrl,\n preMain: true,\n renderMode: self.renderMode,\n subUrl: self.subUrl,\n subContent: self.subContent,\n fonts: self.fonts,\n availableFonts: self.availableFonts,\n fallbackFont: self.fallbackFont,\n lazyFileLoading: self.lazyFileLoading,\n debug: self.debug,\n targetFps: self.targetFps,\n libassMemoryLimit: self.libassMemoryLimit,\n libassGlyphLimit: self.libassGlyphLimit,\n dropAllAnimations: self.dropAllAnimations\n });\n };\n\n self.createCanvas = function () {\n if (!self.canvas) {\n if (self.video) {\n self.isOurCanvas = true;\n self.canvas = document.createElement('canvas');\n self.canvas.className = 'libassjs-canvas';\n self.canvas.style.display = 'none';\n\n self.canvasParent = document.createElement('div');\n self.canvasParent.className = 'libassjs-canvas-parent';\n self.canvasParent.appendChild(self.canvas);\n\n if (self.video.nextSibling) {\n self.video.parentNode.insertBefore(self.canvasParent, self.video.nextSibling);\n }\n else {\n self.video.parentNode.appendChild(self.canvasParent);\n }\n }\n else {\n if (!self.canvas) {\n self.workerError('Don\\'t know where to render: you should give video or canvas in options.');\n }\n }\n }\n self.ctx = self.canvas.getContext('2d');\n self.bufferCanvas = document.createElement('canvas');\n self.bufferCanvasCtx = self.bufferCanvas.getContext('2d');\n\n // test for alpha bug, where e.g. WebKit can render a transparent pixel\n // (with alpha == 0) as non-black which then leads to visual artifacts\n self.bufferCanvas.width = 1;\n self.bufferCanvas.height = 1;\n var testBuf = new Uint8ClampedArray([0, 255, 0, 0]);\n var testImage = new ImageData(testBuf, 1, 1);\n self.bufferCanvasCtx.clearRect(0, 0, 1, 1);\n self.ctx.clearRect(0, 0, 1, 1);\n var prePut = self.ctx.getImageData(0, 0, 1, 1).data;\n self.bufferCanvasCtx.putImageData(testImage, 0, 0);\n self.ctx.drawImage(self.bufferCanvas, 0, 0);\n var postPut = self.ctx.getImageData(0, 0, 1, 1).data;\n self.hasAlphaBug = prePut[1] != postPut[1];\n if (self.hasAlphaBug) {\n console.log(\"Detected a browser having issue with transparent pixels, applying workaround\");\n }\n };\n\n function onTimeUpdate() {\n self.setCurrentTime(self.video.currentTime + self.timeOffset);\n };\n\n function onPlaying() {\n self.setIsPaused(false, self.video.currentTime + self.timeOffset);\n }\n\n function onPause() {\n self.setIsPaused(true, self.video.currentTime + self.timeOffset);\n }\n\n function onSeeking() {\n self.video.removeEventListener('timeupdate', onTimeUpdate, false);\n }\n\n function onSeeked() {\n self.video.addEventListener('timeupdate', onTimeUpdate, false);\n\n var currentTime = self.video.currentTime + self.timeOffset;\n\n self.setCurrentTime(currentTime);\n }\n\n function onRateChange() {\n self.setRate(self.video.playbackRate);\n }\n\n function onWaiting() {\n self.setIsPaused(true, self.video.currentTime + self.timeOffset);\n }\n\n function onLoadedMetadata(e) {\n e.target.removeEventListener(e.type, onLoadedMetadata, false);\n self.resize();\n }\n\n self.setVideo = function (video) {\n self.video = video;\n if (self.video) {\n self.video.addEventListener('timeupdate', onTimeUpdate, false);\n self.video.addEventListener('playing', onPlaying, false);\n self.video.addEventListener('pause', onPause, false);\n self.video.addEventListener('seeking', onSeeking, false);\n self.video.addEventListener('seeked', onSeeked, false);\n self.video.addEventListener('ratechange', onRateChange, false);\n self.video.addEventListener('waiting', onWaiting, false);\n\n document.addEventListener(\"fullscreenchange\", self.resizeWithTimeout, false);\n document.addEventListener(\"mozfullscreenchange\", self.resizeWithTimeout, false);\n document.addEventListener(\"webkitfullscreenchange\", self.resizeWithTimeout, false);\n document.addEventListener(\"msfullscreenchange\", self.resizeWithTimeout, false);\n window.addEventListener(\"resize\", self.resizeWithTimeout, false);\n\n // Support Element Resize Observer\n if (typeof ResizeObserver !== \"undefined\") {\n self.ro = new ResizeObserver(self.resizeWithTimeout);\n self.ro.observe(self.video);\n }\n\n if (self.video.videoWidth > 0) {\n self.resize();\n }\n else {\n self.video.addEventListener('loadedmetadata', onLoadedMetadata, false);\n }\n }\n };\n\n self.getVideoPosition = function () {\n var videoRatio = self.video.videoWidth / self.video.videoHeight;\n var width = self.video.offsetWidth, height = self.video.offsetHeight;\n var elementRatio = width / height;\n var realWidth = width, realHeight = height;\n if (elementRatio > videoRatio) realWidth = Math.floor(height * videoRatio);\n else realHeight = Math.floor(width / videoRatio);\n\n var x = (width - realWidth) / 2;\n var y = (height - realHeight) / 2;\n\n return {\n width: realWidth,\n height: realHeight,\n x: x,\n y: y\n };\n };\n\n self.setSubUrl = function (subUrl) {\n self.subUrl = subUrl;\n };\n\n self.renderFrameData = null;\n function renderFrames() {\n var data = self.renderFramesData;\n var beforeDrawTime = performance.now();\n self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.height);\n for (var i = 0; i < data.canvases.length; i++) {\n var image = data.canvases[i];\n self.bufferCanvas.width = image.w;\n self.bufferCanvas.height = image.h;\n var imageBuffer = new Uint8ClampedArray(image.buffer);\n if (self.hasAlphaBug) {\n for (var j = 3; j < imageBuffer.length; j = j + 4) {\n imageBuffer[j] = (imageBuffer[j] >= 1) ? imageBuffer[j] : 1;\n }\n }\n var imageData = new ImageData(imageBuffer, image.w, image.h);\n self.bufferCanvasCtx.putImageData(imageData, 0, 0);\n self.ctx.drawImage(self.bufferCanvas, image.x, image.y);\n }\n if (self.debug) {\n var drawTime = Math.round(performance.now() - beforeDrawTime);\n var blendTime = data.blendTime;\n if (typeof blendTime !== 'undefined') {\n console.log('render: ' + Math.round(data.spentTime - blendTime) + ' ms, blend: ' + Math.round(blendTime) + ' ms, draw: ' + drawTime + ' ms; TOTAL=' + Math.round(data.spentTime + drawTime) + ' ms');\n } else {\n console.log(Math.round(data.spentTime) + ' ms (+ ' + drawTime + ' ms draw)');\n }\n self.renderStart = performance.now();\n }\n }\n\n /**\n * Lossy Render Mode\n *\n */\n function renderFastFrames() {\n var data = self.renderFramesData;\n var beforeDrawTime = performance.now();\n self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.height);\n for (var i = 0; i < data.bitmaps.length; i++) {\n var image = data.bitmaps[i];\n self.ctx.drawImage(image.bitmap, image.x, image.y);\n }\n if (self.debug) {\n var drawTime = Math.round(performance.now() - beforeDrawTime);\n console.log(data.bitmaps.length + ' bitmaps, libass: ' + Math.round(data.libassTime) + 'ms, decode: ' + Math.round(data.decodeTime) + 'ms, draw: ' + drawTime + 'ms');\n self.renderStart = performance.now();\n }\n }\n\n self.workerActive = false;\n self.frameId = 0;\n self.onWorkerMessage = function (event) {\n //dump('\\nclient got ' + JSON.stringify(event.data).substr(0, 150) + '\\n');\n if (!self.workerActive) {\n self.workerActive = true;\n if (self.onReadyEvent) {\n self.onReadyEvent();\n }\n }\n var data = event.data;\n switch (data.target) {\n case 'stdout': {\n console.log(data.content);\n break;\n }\n case 'console-log': {\n console.log.apply(console, JSON.parse(data.content));\n break;\n }\n case 'console-debug': {\n console.debug.apply(console, JSON.parse(data.content));\n break;\n }\n case 'console-info': {\n console.info.apply(console, JSON.parse(data.content));\n break;\n }\n case 'console-warn': {\n console.warn.apply(console, JSON.parse(data.content));\n break;\n }\n case 'console-error': {\n console.error.apply(console, JSON.parse(data.content));\n break;\n }\n case 'stderr': {\n console.error(data.content);\n break;\n }\n case 'window': {\n window[data.method]();\n break;\n }\n case 'canvas': {\n switch (data.op) {\n case 'getContext': {\n self.ctx = self.canvas.getContext(data.type, data.attributes);\n break;\n }\n case 'resize': {\n self.resize(data.width, data.height);\n break;\n }\n case 'renderCanvas': {\n if (self.lastRenderTime < data.time) {\n self.lastRenderTime = data.time;\n self.renderFramesData = data;\n window.requestAnimationFrame(renderFrames);\n }\n break;\n }\n case 'renderFastCanvas': {\n if (self.lastRenderTime < data.time) {\n self.lastRenderTime = data.time;\n self.renderFramesData = data;\n window.requestAnimationFrame(renderFastFrames);\n }\n break;\n }\n case 'setObjectProperty': {\n self.canvas[data.object][data.property] = data.value;\n break;\n }\n default:\n throw 'eh?';\n }\n break;\n }\n case 'tick': {\n self.frameId = data.id;\n self.worker.postMessage({\n target: 'tock',\n id: self.frameId\n });\n break;\n }\n case 'custom': {\n if (self['onCustomMessage']) {\n self['onCustomMessage'](event);\n } else {\n throw 'Custom message received but client onCustomMessage not implemented.';\n }\n break;\n }\n case 'setimmediate': {\n self.worker.postMessage({\n target: 'setimmediate'\n });\n break;\n }\n case 'get-events': {\n break;\n }\n case 'get-styles': {\n break;\n }\n case 'ready': {\n break;\n }\n default:\n throw 'what? ' + data.target;\n }\n };\n\n function _computeCanvasSize(width, height) {\n var scalefactor = self.prescaleFactor <= 0 ? 1.0 : self.prescaleFactor;\n\n if (height <= 0 || width <= 0) {\n width = 0;\n height = 0;\n } else {\n var sgn = scalefactor < 1 ? -1 : 1;\n var newH = height;\n if (sgn * newH * scalefactor <= sgn * self.prescaleHeightLimit)\n newH *= scalefactor;\n else if (sgn * newH < sgn * self.prescaleHeightLimit)\n newH = self.prescaleHeightLimit;\n\n if (self.maxRenderHeight > 0 && newH > self.maxRenderHeight)\n newH = self.maxRenderHeight;\n\n width *= newH / height;\n height = newH;\n }\n\n return {'width': width, 'height': height};\n }\n\n self.resize = function (width, height, top, left) {\n var videoSize = null;\n top = top || 0;\n left = left || 0;\n if ((!width || !height) && self.video) {\n videoSize = self.getVideoPosition();\n var newSize = _computeCanvasSize(videoSize.width * self.pixelRatio, videoSize.height * self.pixelRatio);\n width = newSize.width;\n height = newSize.height;\n var offset = self.canvasParent.getBoundingClientRect().top - self.video.getBoundingClientRect().top;\n top = videoSize.y - offset;\n left = videoSize.x;\n }\n if (!width || !height) {\n if (!self.video) {\n console.error('width or height is 0. You should specify width & height for resize.');\n }\n return;\n }\n\n\n if (\n self.canvas.width != width ||\n self.canvas.height != height ||\n self.canvas.style.top != top ||\n self.canvas.style.left != left\n ) {\n self.canvas.width = width;\n self.canvas.height = height;\n\n if (videoSize != null) {\n self.canvasParent.style.position = 'relative';\n self.canvas.style.display = 'block';\n self.canvas.style.position = 'absolute';\n self.canvas.style.width = videoSize.width + 'px';\n self.canvas.style.height = videoSize.height + 'px';\n self.canvas.style.top = top + 'px';\n self.canvas.style.left = left + 'px';\n self.canvas.style.pointerEvents = 'none';\n }\n\n self.worker.postMessage({\n target: 'canvas',\n width: self.canvas.width,\n height: self.canvas.height\n });\n }\n };\n\n self.resizeWithTimeout = function () {\n self.resize();\n setTimeout(self.resize, 100);\n };\n\n self.runBenchmark = function () {\n self.worker.postMessage({\n target: 'runBenchmark'\n });\n };\n\n self.customMessage = function (data, options) {\n options = options || {};\n self.worker.postMessage({\n target: 'custom',\n userData: data,\n preMain: options.preMain\n });\n };\n\n self.setCurrentTime = function (currentTime) {\n self.worker.postMessage({\n target: 'video',\n currentTime: currentTime\n });\n };\n\n self.setTrackByUrl = function (url) {\n self.worker.postMessage({\n target: 'set-track-by-url',\n url: url\n });\n };\n\n self.setTrack = function (content) {\n self.worker.postMessage({\n target: 'set-track',\n content: content\n });\n };\n\n self.freeTrack = function (content) {\n self.worker.postMessage({\n target: 'free-track'\n });\n };\n\n\n self.render = self.setCurrentTime;\n\n self.setIsPaused = function (isPaused, currentTime) {\n self.worker.postMessage({\n target: 'video',\n isPaused: isPaused,\n currentTime: currentTime\n });\n };\n\n self.setRate = function (rate) {\n self.worker.postMessage({\n target: 'video',\n rate: rate\n });\n };\n\n self.dispose = function () {\n self.worker.postMessage({\n target: 'destroy'\n });\n\n self.worker.terminate();\n self.worker.removeEventListener('message', self.onWorkerMessage);\n self.worker.removeEventListener('error', self.workerError);\n self.workerActive = false;\n self.worker = null;\n\n // Remove the canvas element to remove residual subtitles rendered on player\n if (self.video) {\n self.video.removeEventListener('timeupdate', onTimeUpdate, false);\n self.video.removeEventListener('playing', onPlaying, false);\n self.video.removeEventListener('pause', onPause, false);\n self.video.removeEventListener('seeking', onSeeking, false);\n self.video.removeEventListener('seeked', onSeeked, false);\n self.video.removeEventListener('ratechange', onRateChange, false);\n self.video.removeEventListener('waiting', onWaiting, false);\n self.video.removeEventListener('loadedmetadata', onLoadedMetadata, false);\n\n document.removeEventListener('fullscreenchange', self.resizeWithTimeout, false);\n document.removeEventListener('mozfullscreenchange', self.resizeWithTimeout, false);\n document.removeEventListener('webkitfullscreenchange', self.resizeWithTimeout, false);\n document.removeEventListener('msfullscreenchange', self.resizeWithTimeout, false);\n window.removeEventListener('resize', self.resizeWithTimeout, false);\n\n self.video.parentNode.removeChild(self.canvasParent);\n\n self.video = null;\n }\n\n if (self.ro) {\n self.ro.disconnect();\n self.ro = null;\n }\n\n self.onCustomMessage = null;\n self.onErrorEvent = null;\n self.onReadyEvent = null;\n };\n\n self.fetchFromWorker = function (workerOptions, onSuccess, onError) {\n try {\n var target = workerOptions['target']\n\n var timeout = setTimeout(function() {\n reject(Error('Error: Timeout while try to fetch ' + target))\n }, 5000)\n\n var resolve = function (event) {\n if (event.data.target == target) {\n onSuccess(event.data)\n self.worker.removeEventListener('message', resolve)\n self.worker.removeEventListener('error', reject)\n clearTimeout(timeout)\n }\n }\n\n var reject = function (event) {\n onError(event)\n self.worker.removeEventListener('message', resolve)\n self.worker.removeEventListener('error', reject)\n clearTimeout(timeout)\n }\n\n self.worker.addEventListener('message', resolve)\n self.worker.addEventListener('error', reject)\n\n self.worker.postMessage(workerOptions)\n } catch (error) {\n onError(error)\n }\n }\n\n self.createEvent = function (event) {\n self.worker.postMessage({\n target: 'create-event',\n event: event\n });\n };\n\n self.getEvents = function (onSuccess, onError) {\n self.fetchFromWorker({\n target: 'get-events'\n }, function(data) {\n onSuccess(data.events)\n }, onError);\n };\n\n self.setEvent = function (event, index) {\n self.worker.postMessage({\n target: 'set-event',\n event: event,\n index: index\n });\n };\n\n self.removeEvent = function (index) {\n self.worker.postMessage({\n target: 'remove-event',\n index: index\n });\n };\n\n self.createStyle = function (style) {\n self.worker.postMessage({\n target: 'create-style',\n style: style\n });\n };\n \n self.getStyles = function (onSuccess, onError) {\n self.fetchFromWorker({\n target: 'get-styles'\n }, function(data) {\n onSuccess(data.styles)\n }, onError);\n };\n\n self.setStyle = function (style, index) {\n self.worker.postMessage({\n target: 'set-style',\n style: style,\n index: index\n });\n };\n\n self.removeStyle = function (index) {\n self.worker.postMessage({\n target: 'remove-style',\n index: index\n });\n };\n\n self.init();\n};\n\nif (typeof SubtitlesOctopusOnLoad == 'function') {\n SubtitlesOctopusOnLoad();\n}\n\nif (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = SubtitlesOctopus\n }\n}\n","exports.interopDefault = function (a) {\n return a && a.__esModule ? a : {default: a};\n};\n\nexports.defineInteropFlag = function (a) {\n Object.defineProperty(a, '__esModule', {value: true});\n};\n\nexports.exportAll = function (source, dest) {\n Object.keys(source).forEach(function (key) {\n if (\n key === 'default' ||\n key === '__esModule' ||\n Object.prototype.hasOwnProperty.call(dest, key)\n ) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function () {\n return source[key];\n },\n });\n });\n\n return dest;\n};\n\nexports.export = function (dest, destName, get) {\n Object.defineProperty(dest, destName, {\n enumerable: true,\n get: get,\n });\n};\n"],"names":["modules","entry","mainEntry","parcelRequireName","externals","distDir","publicUrl","devServer","globalObject","globalThis","self","window","global","previousRequire","importMap","i","cache","nodeRequire","module","require","bind","newRequire","name","jumped","currentRequire","err","Error","code","localRequire","resolve","x","id","Module","call","exports","res","isParcelRequire","moduleName","bundle","parent","register","Object","defineProperty","get","length","mainExports","define","amd","__globalThis","parcelHelpers","defineInteropFlag","export","artplayerPluginLibass","_adapter","_adapterDefault","interopDefault","option","art","adapter","default","libass","visible","init","switch","show","hide","destroy","_libassWasm","_libassWasmDefault","defaultAssSubtitle","constructor","template","$video","$webvtt","$subtitle","utils","once","emit","initialSubtitle","subtitle","url","getExt","currentType","freeTrack","setTrackByUrl","setVisibility","setOffset","offset","timeOffset","active","canvasParent","style","display","resize","dispose","URL","revokeObjectURL","workerScriptUrl","fallbackFont","errorHandle","workerUrl","availableFonts","entries","reduce","acc","key","value","subContent","video","fonts","map","font","className","cssText","switchHandler","visibleHandler","offsetHandler","on","off","visibility","document","baseURI","toString","test","wasmUrl","Promise","fetch","then","text","workerScriptContent","workerBlob","Blob","replace","_match","wasm","type","createObjectURL","supportsWebAssembly","WebAssembly","instantiate","Uint8Array","of","Instance","error","console","SubtitlesOctopusOnLoad","options","module1","e","log","onTimeUpdate","setCurrentTime","currentTime","onPlaying","setIsPaused","onPause","onSeeking","removeEventListener","onSeeked","addEventListener","onRateChange","setRate","playbackRate","onWaiting","onLoadedMetadata","target","renderFrames","data","renderFramesData","beforeDrawTime","performance","now","ctx","clearRect","canvas","width","height","canvases","image","bufferCanvas","w","h","imageBuffer","Uint8ClampedArray","buffer","hasAlphaBug","j","imageData","ImageData","bufferCanvasCtx","putImageData","drawImage","y","debug","drawTime","Math","round","blendTime","spentTime","renderStart","renderFastFrames","bitmaps","bitmap","libassTime","decodeTime","renderMode","lossyRender","libassMemoryLimit","libassGlyphLimit","targetFps","prescaleFactor","prescaleHeightLimit","maxRenderHeight","dropAllAnimations","isOurCanvas","lazyFileLoading","onReadyEvent","onReady","legacyWorkerUrl","subUrl","onErrorEvent","onError","lastRenderTime","pixelRatio","devicePixelRatio","prototype","createElement","getContext","arguments","createImageData","set","workerError","Worker","worker","onWorkerMessage","workerActive","createCanvas","setVideo","setSubUrl","postMessage","currentScript","preMain","appendChild","nextSibling","parentNode","insertBefore","testImage","prePut","getImageData","postPut","resizeWithTimeout","ResizeObserver","ro","observe","videoWidth","getVideoPosition","videoRatio","videoHeight","offsetWidth","offsetHeight","realWidth","realHeight","elementRatio","floor","renderFrameData","frameId","event","content","apply","JSON","parse","info","warn","method","op","attributes","time","requestAnimationFrame","object","property","top","left","videoSize","newSize","_computeCanvasSize","scalefactor","sgn","newH","getBoundingClientRect","position","pointerEvents","setTimeout","runBenchmark","customMessage","userData","setTrack","render","isPaused","rate","terminate","removeChild","disconnect","onCustomMessage","fetchFromWorker","workerOptions","onSuccess","timeout","reject","clearTimeout","createEvent","getEvents","events","setEvent","index","removeEvent","createStyle","getStyles","styles","setStyle","removeStyle","a","__esModule","exportAll","source","dest","keys","forEach","hasOwnProperty","enumerable","destName","_default","parcelRequire4dc0"],"version":3,"file":"index.js.map"}